diff --git a/bridge/abi/BridgeV4.json b/bridge/abi/BridgeV4.json new file mode 100644 index 000000000..43ff8ad3e --- /dev/null +++ b/bridge/abi/BridgeV4.json @@ -0,0 +1,1356 @@ +[ + { + "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" + } + ], + "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" + } + ], + "name": "Claimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_tokenAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "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": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "FeeCollectorAddressChanged", + "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" + } + ], + "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": [], + "name": "DOMAIN_SEPARATOR", + "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" + } + ], + "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": "struct IBridgeV4.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": "struct IBridgeV4.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": "struct IBridgeV4.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": [ + { + "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" + } + ], + "name": "createSideToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "depositTo", + "outputs": [], + "stateMutability": "payable", + "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": "getFeeCollectorAddress", + "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": "_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" + } + ], + "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": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "address", + "name": "_federation", + "type": "address" + }, + { + "internalType": "address", + "name": "_allowTokens", + "type": "address" + }, + { + "internalType": "address", + "name": "_sideTokenFactory", + "type": "address" + }, + { + "internalType": "string", + "name": "_symbolPrefix", + "type": "string" + } + ], + "name": "initialize", + "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": [], + "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": "address", + "name": "", + "type": "address" + } + ], + "name": "knownTokens", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "mappedTokens", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "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": "originalTokens", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "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": "address", + "name": "_newAddress", + "type": "address" + } + ], + "name": "setFeeCollectorAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "setFeePercentage", + "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": [], + "name": "sideTokenFactory", + "outputs": [ + { + "internalType": "contract ISideTokenFactory", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbolPrefix", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "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" + } +] diff --git a/bridge/contracts/Bridge/BridgeV4.sol b/bridge/contracts/Bridge/BridgeV4.sol new file mode 100644 index 000000000..62a400749 --- /dev/null +++ b/bridge/contracts/Bridge/BridgeV4.sol @@ -0,0 +1,514 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; + +// import "hardhat/console.sol"; +// Import base Initializable contract +import "../zeppelin/upgradable/Initializable.sol"; +// Import interface and library from OpenZeppelin contracts +import "../zeppelin/upgradable/utils/ReentrancyGuard.sol"; +import "../zeppelin/upgradable/lifecycle/UpgradablePausable.sol"; +import "../zeppelin/upgradable/ownership/UpgradableOwnable.sol"; + +import "../zeppelin/introspection/IERC1820Registry.sol"; +import "../zeppelin/token/ERC777/IERC777Recipient.sol"; +import "../zeppelin/token/ERC20/IERC20.sol"; +import "../zeppelin/token/ERC20/SafeERC20.sol"; +import "../zeppelin/utils/Address.sol"; +import "../zeppelin/math/SafeMath.sol"; +import "../zeppelin/token/ERC777/IERC777.sol"; + +import "../lib/LibEIP712.sol"; +import "../lib/LibUtils.sol"; + +import "./IBridgeV4.sol"; +import "../interface/ISideToken.sol"; +import "../interface/ISideTokenFactory.sol"; +import "../interface/IAllowTokens.sol"; +import "../interface/IWrapped.sol"; + + +contract BridgeV4 is Initializable, IBridgeV4, IERC777Recipient, UpgradablePausable, UpgradableOwnable, ReentrancyGuard { + using SafeMath for uint256; + using SafeERC20 for IERC20; + using Address for address; + + address constant internal NULL_ADDRESS = address(0); + bytes32 constant internal NULL_HASH = bytes32(0); + IERC1820Registry constant internal erc1820 = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24); + + address internal federation; + uint256 internal feePercentage; + string public symbolPrefix; + bytes32 public DOMAIN_SEPARATOR; // replaces uint256 internal _depprecatedLastDay; + uint256 internal _deprecatedSpentToday; + address private feeCollectorAddress = 0x803c3910f339ee570A3fB9dB8a5A8143d284c5c5; + + mapping (address => address) public mappedTokens; // OirignalToken => SideToken + mapping (address => address) public originalTokens; // SideToken => OriginalToken + mapping (address => bool) public knownTokens; // OriginalToken => true + mapping (bytes32 => bool) public claimed; // transactionDataHash => true // previously named processed + IAllowTokens public allowTokens; + ISideTokenFactory public sideTokenFactory; + //Bridge_v1 variables + bool public isUpgrading; + uint256 constant public feePercentageDivider = 10000; // Porcentage with up to 2 decimals + //Bridge_v4 variables + bytes32 constant internal _erc777Interface = keccak256("ERC777Token"); + IWrapped public wrappedCurrency; + mapping (bytes32 => bytes32) public transactionsDataHashes; // transactionHash => transactionDataHash + mapping (bytes32 => address) public originalTokenAddresses; // transactionHash => originalTokenAddress + mapping (bytes32 => address) public senderAddresses; // transactionHash => senderAddress + + // keccak256("Claim(address to,uint256 amount,bytes32 transactionHash,address relayer,uint256 fee,uint256 nonce,uint256 deadline)"); + bytes32 public constant CLAIM_TYPEHASH = 0xf18ceda3f6355f78c234feba066041a50f6557bfb600201e2a71a89e2dd80433; + mapping(address => uint) public nonces; + + event AllowTokensChanged(address _newAllowTokens); + event FederationChanged(address _newFederation); + event SideTokenFactoryChanged(address _newSideTokenFactory); + event Upgrading(bool _isUpgrading); + event WrappedCurrencyChanged(address _wrappedCurrency); + event FeeCollectorAddressChanged(address indexed sender, address oldAddress, address newAddress); + + function initialize( + address _manager, + address _federation, + address _allowTokens, + address _sideTokenFactory, + string memory _symbolPrefix + ) public initializer { + UpgradableOwnable.initialize(_manager); + UpgradablePausable.__Pausable_init(_manager); + symbolPrefix = _symbolPrefix; + allowTokens = IAllowTokens(_allowTokens); + sideTokenFactory = ISideTokenFactory(_sideTokenFactory); + federation = _federation; + //keccak256("ERC777TokensRecipient") + erc1820.setInterfaceImplementer(address(this), 0xb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b, address(this)); + initDomainSeparator(); + } + + receive () external payable { + // The fallback function is needed to use WRBTC + require(_msgSender() == address(wrappedCurrency), "Bridge: not wrappedCurrency"); + } + + function version() override external pure returns (string memory) { + return "v4"; + } + + function initDomainSeparator() public { + uint chainId; + // solium-disable-next-line security/no-inline-assembly + assembly { + chainId := chainid() + } + DOMAIN_SEPARATOR = LibEIP712.hashEIP712Domain( + "RSK Token Bridge", + "1", + chainId, + address(this) + ); + } + + modifier whenNotUpgrading() { + require(!isUpgrading, "Bridge: Upgrading"); + _; + } + + function acceptTransfer( + address _originalTokenAddress, + address payable _from, + address payable _to, + uint256 _amount, + bytes32 _blockHash, + bytes32 _transactionHash, + uint32 _logIndex + ) external whenNotPaused nonReentrant override { + require(_msgSender() == federation, "Bridge: Not Federation"); + require(knownTokens[_originalTokenAddress] || + mappedTokens[_originalTokenAddress] != NULL_ADDRESS, + "Bridge: Unknown token" + ); + require(_to != NULL_ADDRESS, "Bridge: Null To"); + require(_amount > 0, "Bridge: Amount 0"); + require(_blockHash != NULL_HASH, "Bridge: Null BlockHash"); + require(_transactionHash != NULL_HASH, "Bridge: Null TxHash"); + require(transactionsDataHashes[_transactionHash] == bytes32(0), "Bridge: Already accepted"); + + bytes32 _transactionDataHash = getTransactionDataHash( + _to, + _amount, + _blockHash, + _transactionHash, + _logIndex + ); + // Do not remove, claimed also has the previously processed using the older bridge version + // https://github.com/rsksmart/tokenbridge/blob/TOKENBRIDGE-1.2.0/bridge/contracts/Bridge.sol#L41 + require(!claimed[_transactionDataHash], "Bridge: Already claimed"); + + transactionsDataHashes[_transactionHash] = _transactionDataHash; + originalTokenAddresses[_transactionHash] = _originalTokenAddress; + senderAddresses[_transactionHash] = _from; + + emit AcceptedCrossTransfer( + _transactionHash, + _originalTokenAddress, + _to, + _from, + _amount, + _blockHash, + _logIndex + ); + } + + function setFeeCollectorAddress(address _newAddress) public onlyOwner { + address oldAddress = feeCollectorAddress; + feeCollectorAddress = _newAddress; + emit FeeCollectorAddressChanged(_msgSender(), oldAddress, _newAddress); + } + + function getFeeCollectorAddress() public view returns(address) { + return feeCollectorAddress; + } + + function createSideToken( + uint256 _typeId, + address _originalTokenAddress, + uint8 _originalTokenDecimals, + string calldata _originalTokenSymbol, + string calldata _originalTokenName + ) external onlyOwner { + require(_originalTokenAddress != NULL_ADDRESS, "Bridge: Null token"); + address sideToken = mappedTokens[_originalTokenAddress]; + require(sideToken == NULL_ADDRESS, "Bridge: Already exists"); + uint256 granularity = LibUtils.decimalsToGranularity(_originalTokenDecimals); + string memory newSymbol = string(abi.encodePacked(symbolPrefix, _originalTokenSymbol)); + + // Create side token + sideToken = sideTokenFactory.createSideToken(_originalTokenName, newSymbol, granularity); + + mappedTokens[_originalTokenAddress] = sideToken; + originalTokens[sideToken] = _originalTokenAddress; + allowTokens.setToken(sideToken, _typeId); + + emit NewSideToken(sideToken, _originalTokenAddress, newSymbol, granularity); + } + + function claim(ClaimData calldata _claimData) + external override returns (uint256 receivedAmount) { + + receivedAmount = _claim( + _claimData, + _claimData.to, + payable(address(0)), + 0 + ); + return receivedAmount; + } + + function claimFallback(ClaimData calldata _claimData) + external override returns (uint256 receivedAmount) { + require(_msgSender() == senderAddresses[_claimData.transactionHash],"Bridge: invalid sender"); + receivedAmount = _claim( + _claimData, + _msgSender(), + payable(address(0)), + 0 + ); + return receivedAmount; + } + + function getDigest( + ClaimData memory _claimData, + address payable _relayer, + uint256 _fee, + uint256 _deadline + ) internal returns (bytes32) { + return LibEIP712.hashEIP712Message( + DOMAIN_SEPARATOR, + keccak256( + abi.encode( + CLAIM_TYPEHASH, + _claimData.to, + _claimData.amount, + _claimData.transactionHash, + _relayer, + _fee, + nonces[_claimData.to]++, + _deadline + ) + ) + ); + } + + // Inspired by https://github.com/dapphub/ds-dach/blob/master/src/dach.sol + function claimGasless( + ClaimData calldata _claimData, + address payable _relayer, + uint256 _fee, + uint256 _deadline, + uint8 _v, + bytes32 _r, + bytes32 _s + ) external override returns (uint256 receivedAmount) { + require(_deadline >= block.timestamp, "Bridge: EXPIRED"); + + bytes32 digest = getDigest(_claimData, _relayer, _fee, _deadline); + address recoveredAddress = ecrecover(digest, _v, _r, _s); + require(_claimData.to != address(0) && recoveredAddress == _claimData.to, "Bridge: INVALID_SIGNATURE"); + + receivedAmount = _claim( + _claimData, + _claimData.to, + _relayer, + _fee + ); + return receivedAmount; + } + + function _claim( + ClaimData calldata _claimData, + address payable _reciever, + address payable _relayer, + uint256 _fee + ) internal nonReentrant returns (uint256 receivedAmount) { + address originalTokenAddress = originalTokenAddresses[_claimData.transactionHash]; + require(originalTokenAddress != NULL_ADDRESS, "Bridge: Tx not crossed"); + + bytes32 transactionDataHash = getTransactionDataHash( + _claimData.to, + _claimData.amount, + _claimData.blockHash, + _claimData.transactionHash, + _claimData.logIndex + ); + require(transactionsDataHashes[_claimData.transactionHash] == transactionDataHash, "Bridge: Wrong transactionDataHash"); + require(!claimed[transactionDataHash], "Bridge: Already claimed"); + + claimed[transactionDataHash] = true; + if (knownTokens[originalTokenAddress]) { + receivedAmount =_claimCrossBackToToken( + originalTokenAddress, + _reciever, + _claimData.amount, + _relayer, + _fee + ); + } else { + receivedAmount =_claimCrossToSideToken( + originalTokenAddress, + _reciever, + _claimData.amount, + _relayer, + _fee + ); + } + emit Claimed( + _claimData.transactionHash, + originalTokenAddress, + _claimData.to, + senderAddresses[_claimData.transactionHash], + _claimData.amount, + _claimData.blockHash, + _claimData.logIndex, + _reciever, + _relayer, + _fee + ); + return receivedAmount; + } + + function _claimCrossToSideToken( + address _originalTokenAddress, + address payable _receiver, + uint256 _amount, + address payable _relayer, + uint256 _fee + ) internal returns (uint256 receivedAmount) { + address sideToken = mappedTokens[_originalTokenAddress]; + uint256 granularity = IERC777(sideToken).granularity(); + uint256 formattedAmount = _amount.mul(granularity); + require(_fee <= formattedAmount, "Bridge: fee too high"); + receivedAmount = formattedAmount - _fee; + ISideToken(sideToken).mint(_receiver, receivedAmount, "", ""); + if(_fee > 0) { + ISideToken(sideToken).mint(_relayer, _fee, "", "relayer fee"); + } + return receivedAmount; + } + + function _claimCrossBackToToken( + address _originalTokenAddress, + address payable _receiver, + uint256 _amount, + address payable _relayer, + uint256 _fee + ) internal returns (uint256 receivedAmount) { + uint256 decimals = LibUtils.getDecimals(_originalTokenAddress); + //As side tokens are ERC777 they will always have 18 decimals + uint256 formattedAmount = _amount.div(uint256(10) ** (18 - decimals)); + require(_fee <= formattedAmount, "Bridge: fee too high"); + receivedAmount = formattedAmount - _fee; + if(address(wrappedCurrency) == _originalTokenAddress) { + wrappedCurrency.withdraw(formattedAmount); + _receiver.transfer(receivedAmount); + if(_fee > 0) { + _relayer.transfer(_fee); + } + } else { + IERC20(_originalTokenAddress).safeTransfer(_receiver, receivedAmount); + if(_fee > 0) { + IERC20(_originalTokenAddress).safeTransfer(_relayer, _fee); + } + } + return receivedAmount; + } + + /** + * ERC-20 tokens approve and transferFrom pattern + * See https://eips.ethereum.org/EIPS/eip-20#transferfrom + */ + function receiveTokensTo(address tokenToUse, address to, uint256 amount) override public { + address sender = _msgSender(); + //Transfer the tokens on IERC20, they should be already Approved for the bridge Address to use them + IERC20(tokenToUse).safeTransferFrom(sender, address(this), amount); + crossTokens(tokenToUse, sender, to, amount, ""); + } + + /** + * Use network currency and cross it. + */ + function depositTo(address to) override external payable { + address sender = _msgSender(); + require(address(wrappedCurrency) != NULL_ADDRESS, "Bridge: wrappedCurrency empty"); + wrappedCurrency.deposit{ value: msg.value }(); + crossTokens(address(wrappedCurrency), sender, to, msg.value, ""); + } + + /** + * 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 + */ + function tokensReceived ( + address operator, + address from, + address to, + uint amount, + bytes calldata userData, + bytes calldata + ) external override(IBridgeV4, IERC777Recipient){ + //Hook from ERC777address + if(operator == address(this)) return; // Avoid loop from bridge calling to ERC77transferFrom + require(to == address(this), "Bridge: Not to this address"); + address tokenToUse = _msgSender(); + require(erc1820.getInterfaceImplementer(tokenToUse, _erc777Interface) != NULL_ADDRESS, "Bridge: Not ERC777 token"); + require(userData.length != 0 || !from.isContract(), "Bridge: Specify receiver address in data"); + address receiver = userData.length == 0 ? from : LibUtils.bytesToAddress(userData); + crossTokens(tokenToUse, from, receiver, amount, userData); + } + + function crossTokens(address tokenToUse, address from, address to, uint256 amount, bytes memory userData) + internal whenNotUpgrading whenNotPaused nonReentrant { + knownTokens[tokenToUse] = true; + uint256 fee = amount.mul(feePercentage).div(feePercentageDivider); + uint256 amountMinusFees = amount.sub(fee); + uint8 decimals = LibUtils.getDecimals(tokenToUse); + uint formattedAmount = amount; + if(decimals != 18) { + formattedAmount = amount.mul(uint256(10)**(18-decimals)); + } + // We consider the amount before fees converted to 18 decimals to check the limits + // updateTokenTransfer revert if token not allowed + allowTokens.updateTokenTransfer(tokenToUse, formattedAmount); + address originalTokenAddress = tokenToUse; + if (originalTokens[tokenToUse] != NULL_ADDRESS) { + //Side Token Crossing + originalTokenAddress = originalTokens[tokenToUse]; + uint256 granularity = LibUtils.getGranularity(tokenToUse); + uint256 modulo = amountMinusFees.mod(granularity); + fee = fee.add(modulo); + amountMinusFees = amountMinusFees.sub(modulo); + IERC777(tokenToUse).burn(amountMinusFees, userData); + } + + emit Cross( + originalTokenAddress, + from, + to, + amountMinusFees, + userData + ); + + if (fee > 0) { + //Send the payment to the MultiSig of the Federation + IERC20(tokenToUse).safeTransfer(payable(feeCollectorAddress), fee); + } + } + + function getTransactionDataHash( + address _to, + uint256 _amount, + bytes32 _blockHash, + bytes32 _transactionHash, + uint32 _logIndex + ) + public pure override returns(bytes32) + { + return keccak256(abi.encodePacked(_blockHash, _transactionHash, _to, _amount, _logIndex)); + } + + function setFeePercentage(uint amount) external onlyOwner { + require(amount < (feePercentageDivider/10), "Bridge: bigger than 10%"); + feePercentage = amount; + emit FeePercentageChanged(feePercentage); + } + + function getFeePercentage() external view override returns(uint) { + return feePercentage; + } + + function changeFederation(address newFederation) external onlyOwner { + require(newFederation != NULL_ADDRESS, "Bridge: Federation is empty"); + federation = newFederation; + emit FederationChanged(federation); + } + + + function changeAllowTokens(address newAllowTokens) external onlyOwner { + require(newAllowTokens != NULL_ADDRESS, "Bridge: AllowTokens is empty"); + allowTokens = IAllowTokens(newAllowTokens); + emit AllowTokensChanged(newAllowTokens); + } + + function getFederation() external view returns(address) { + return federation; + } + + function changeSideTokenFactory(address newSideTokenFactory) external onlyOwner { + require(newSideTokenFactory != NULL_ADDRESS, "Bridge: SideTokenFactory is empty"); + sideTokenFactory = ISideTokenFactory(newSideTokenFactory); + emit SideTokenFactoryChanged(newSideTokenFactory); + } + + function setUpgrading(bool _isUpgrading) external onlyOwner { + isUpgrading = _isUpgrading; + emit Upgrading(isUpgrading); + } + + function setWrappedCurrency(address _wrappedCurrency) external onlyOwner { + require(_wrappedCurrency != NULL_ADDRESS, "Bridge: wrapp is empty"); + wrappedCurrency = IWrapped(_wrappedCurrency); + emit WrappedCurrencyChanged(_wrappedCurrency); + } + + function hasCrossed(bytes32 transactionHash) public view returns (bool) { + return transactionsDataHashes[transactionHash] != bytes32(0); + } + + function hasBeenClaimed(bytes32 transactionHash) public view returns (bool) { + return claimed[transactionsDataHashes[transactionHash]]; + } + +} diff --git a/bridge/contracts/Bridge/IBridgeV4.sol b/bridge/contracts/Bridge/IBridgeV4.sol new file mode 100644 index 000000000..e42ce21b0 --- /dev/null +++ b/bridge/contracts/Bridge/IBridgeV4.sol @@ -0,0 +1,116 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; + +interface IBridgeV4 { + + struct ClaimData { + address payable to; + uint256 amount; + bytes32 blockHash; + bytes32 transactionHash; + uint32 logIndex; + } + + function version() external pure returns (string memory); + + function getFeePercentage() external view returns(uint); + + /** + * ERC-20 tokens approve and transferFrom pattern + * See https://eips.ethereum.org/EIPS/eip-20#transferfrom + */ + function receiveTokensTo(address tokenToUse, address to, uint256 amount) external; + + /** + * Use network currency and cross it. + */ + function depositTo(address to) external payable; + + /** + * 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 + */ + function tokensReceived ( + address operator, + address from, + address to, + uint amount, + bytes calldata userData, + bytes calldata operatorData + ) external; + + /** + * Accepts the transaction from the other chain that was voted and sent by the Federation contract + */ + function acceptTransfer( + address _originalTokenAddress, + address payable _from, + address payable _to, + uint256 _amount, + bytes32 _blockHash, + bytes32 _transactionHash, + uint32 _logIndex + ) external; + + /** + * Claims the crossed transaction using the hash, this sends the funds to the address indicated in + */ + function claim(ClaimData calldata _claimData) external returns (uint256 receivedAmount); + + function claimFallback(ClaimData calldata _claimData) external returns (uint256 receivedAmount); + + function claimGasless( + ClaimData calldata _claimData, + address payable _relayer, + uint256 _fee, + uint256 _deadline, + uint8 _v, + bytes32 _r, + bytes32 _s + ) external returns (uint256 receivedAmount); + + function getTransactionDataHash( + address _to, + uint256 _amount, + bytes32 _blockHash, + bytes32 _transactionHash, + uint32 _logIndex + ) external returns(bytes32); + + event Cross( + address indexed _tokenAddress, + address indexed _from, + address indexed _to, + uint256 _amount, + bytes _userData + ); + event NewSideToken( + address indexed _newSideTokenAddress, + address indexed _originalTokenAddress, + string _newSymbol, + uint256 _granularity + ); + event AcceptedCrossTransfer( + bytes32 indexed _transactionHash, + address indexed _originalTokenAddress, + address indexed _to, + address _from, + uint256 _amount, + bytes32 _blockHash, + uint256 _logIndex + ); + event FeePercentageChanged(uint256 _amount); + event Claimed( + bytes32 indexed _transactionHash, + address indexed _originalTokenAddress, + address indexed _to, + address _sender, + uint256 _amount, + bytes32 _blockHash, + uint256 _logIndex, + address _reciever, + address _relayer, + uint256 _fee + ); +} diff --git a/bridge/deploy/04_deploy_bridge.js b/bridge/deploy/04_deploy_bridge.js index 926f04a73..3beeb39b4 100644 --- a/bridge/deploy/04_deploy_bridge.js +++ b/bridge/deploy/04_deploy_bridge.js @@ -5,19 +5,19 @@ module.exports = async function(hre) { // HardhatRuntimeEnvironment const {deployments, network} = hre; const {deployer} = await getNamedAccounts(); const {deploy, log} = deployments; - const BRIDGE_LAST_VERSION = 'v3' + const BRIDGE_LAST_VERSION = 'v4' const bridgeProxyAddress = await address.getBridgeProxyAddress(hre); if (bridgeProxyAddress) { - const Bridge = await deployments.getArtifact('BridgeV3'); + const Bridge = await deployments.getArtifact('BridgeV4'); const bridge = new web3.eth.Contract(Bridge.abi, bridgeProxyAddress); - const currentBridgeVersion = bridge.methods.version().call(); + const currentBridgeVersion = bridge.methods.version().send(); if (currentBridgeVersion === BRIDGE_LAST_VERSION) { return; } } - const deployResult = await deploy('BridgeV3', { + const deployResult = await deploy('BridgeV4', { from: deployer, log: true, }); @@ -35,4 +35,4 @@ module.exports = async function(hre) { // HardhatRuntimeEnvironment } }; module.exports.id = 'deploy_bridge'; // id required to prevent reexecution -module.exports.tags = ['BridgeV3', 'Upgrade', 'DeployFromScratch', 'IntegrationTest']; +module.exports.tags = ['BridgeV4', 'Upgrade', 'DeployFromScratch', 'IntegrationTest']; diff --git a/bridge/deploy/05_deploy_bridgeProxy.js b/bridge/deploy/05_deploy_bridgeProxy.js index 29bb0ab3d..c8be1f9ff 100644 --- a/bridge/deploy/05_deploy_bridgeProxy.js +++ b/bridge/deploy/05_deploy_bridgeProxy.js @@ -10,12 +10,13 @@ module.exports = async function (hre) { // HardhatRuntimeEnvironment return; } - const Bridge = await deployments.get('BridgeV3'); + const Bridge = await deployments.get('BridgeV4'); const multiSigAddress = await address.getMultiSigAddress(hre); const proxyAdminAddress = await address.getProxyAdminAddress(hre); const sideTokenFactoryAddress = await address.getSideTokenFactoryAddress(hre); const bridge = new web3.eth.Contract(Bridge.abi, Bridge.address); + const methodCall = bridge.methods.initialize( multiSigAddress, deployer, @@ -23,7 +24,11 @@ module.exports = async function (hre) { // HardhatRuntimeEnvironment sideTokenFactoryAddress, 'r' ); - await methodCall.call({ from: deployer }) + try { + await methodCall.send({ from: deployer }) + } catch (error) { + throw error; + } const constructorArguments = [ Bridge.address, @@ -51,4 +56,4 @@ module.exports = async function (hre) { // HardhatRuntimeEnvironment }; module.exports.id = 'deploy_bridge_proxy'; // id required to prevent reexecution module.exports.tags = ['BridgeProxy', 'DeployFromScratch', 'IntegrationTest']; -module.exports.dependencies = ['BridgeV3', 'MultiSigWallet', 'ProxyAdmin', 'SideTokenFactory']; +module.exports.dependencies = ['BridgeV4', 'MultiSigWallet', 'ProxyAdmin', 'SideTokenFactory']; diff --git a/bridge/deploy/06_deploy_federation.js b/bridge/deploy/06_deploy_federation.js index f18d50db5..b42dfa7d3 100644 --- a/bridge/deploy/06_deploy_federation.js +++ b/bridge/deploy/06_deploy_federation.js @@ -11,7 +11,7 @@ module.exports = async function(hre) { // HardhatRuntimeEnvironment if (federationProxyAddress) { const Federation = await deployments.getArtifact('FederationV2'); const federation = new web3.eth.Contract(Federation.abi, federationProxyAddress); - const currentFederationVersion = federation.methods.version().call(); + const currentFederationVersion = federation.methods.version().send(); if (currentFederationVersion === FEDERATION_LAST_VERSION) { return; } diff --git a/bridge/deploy/07_deploy_federationProxy.js b/bridge/deploy/07_deploy_federationProxy.js index a347e752d..73f2dcf40 100644 --- a/bridge/deploy/07_deploy_federationProxy.js +++ b/bridge/deploy/07_deploy_federationProxy.js @@ -24,7 +24,7 @@ module.exports = async function(hre) { // HardhatRuntimeEnvironment bridgeProxyAddress, multiSigAddress, ); - methodCall.call({from: deployer}); + methodCall.send({from: deployer}); const constructorArguments = [ Federation.address, @@ -82,4 +82,4 @@ function getFederationConf(deployer, network) { members: [deployer], required: 1, }; -} \ No newline at end of file +} diff --git a/bridge/deploy/08_deploy_allowToken.js b/bridge/deploy/08_deploy_allowToken.js index 8d8140175..45aa74561 100644 --- a/bridge/deploy/08_deploy_allowToken.js +++ b/bridge/deploy/08_deploy_allowToken.js @@ -11,7 +11,7 @@ module.exports = async function(hre) { // HardhatRuntimeEnvironment if (allowTokensProxyAddress) { const AllowTokens = await deployments.getArtifact('AllowTokens'); const allowTokens = new web3.eth.Contract(AllowTokens.abi, allowTokensProxyAddress); - const currentAllowTokensVersion = allowTokens.methods.version().call(); + const currentAllowTokensVersion = allowTokens.methods.version().send(); if (currentAllowTokensVersion === ALLOW_TOKEN_LAST_VERSION) { return; } diff --git a/bridge/deploy/09_deploy_allowTokensProxy.js b/bridge/deploy/09_deploy_allowTokensProxy.js index a2b15fd7b..7b21fe775 100644 --- a/bridge/deploy/09_deploy_allowTokensProxy.js +++ b/bridge/deploy/09_deploy_allowTokensProxy.js @@ -29,7 +29,7 @@ module.exports = async function(hre) { // HardhatRuntimeEnvironment deployedJson.largeAmountConfirmations ?? '0', typesInfo ); - methodCall.call({from: deployer}); + methodCall.send({from: deployer}); const constructorArguments = [ AllowTokens.address, diff --git a/bridge/deploy/10_transfer_setTokens_allowTokens.js b/bridge/deploy/10_transfer_setTokens_allowTokens.js index 0c6401435..acc184f1e 100644 --- a/bridge/deploy/10_transfer_setTokens_allowTokens.js +++ b/bridge/deploy/10_transfer_setTokens_allowTokens.js @@ -19,7 +19,7 @@ module.exports = async function(hre) { // HardhatRuntimeEnvironment const allowTokens = new web3.eth.Contract(AllowTokens.abi, AllowTokensProxy.address); const multiSigAddress = await address.getMultiSigAddress(hre); - const owner = await allowTokens.methods.owner().call({from: deployer}); + const owner = await allowTokens.methods.owner().send({from: deployer}); if (owner === multiSigAddress) { return } diff --git a/bridge/deploy/11_transfer_sideTokenFactoryToBridge.js b/bridge/deploy/11_transfer_sideTokenFactoryToBridge.js index 6e51ab6f4..1dc659adb 100644 --- a/bridge/deploy/11_transfer_sideTokenFactoryToBridge.js +++ b/bridge/deploy/11_transfer_sideTokenFactoryToBridge.js @@ -20,11 +20,10 @@ module.exports = async function({getNamedAccounts, deployments}) { // HardhatRun const SideTokenFactory = await deployments.get(sideTokenFactoryName); const sideTokenFactoryContract = new web3.eth.Contract(SideTokenFactory.abi, SideTokenFactory.address); - const primary = await sideTokenFactoryContract.methods.primary().call({from: deployer}); + const primary = await sideTokenFactoryContract.methods.primary().send({from: deployer}); if (primary === BridgeProxy.address) { return } - await execute(sideTokenFactoryName, {from: deployer, gasLimit: GAS_LIMIT}, 'transferPrimary', BridgeProxy.address); log(`SideTokenFactory Transferred Primary to BridgeProxy`); }; diff --git a/bridge/deploy/12_transfer_federationToBridge.js b/bridge/deploy/12_transfer_federationToBridge.js index 4b2ebb473..5f6ce76d8 100644 --- a/bridge/deploy/12_transfer_federationToBridge.js +++ b/bridge/deploy/12_transfer_federationToBridge.js @@ -9,7 +9,7 @@ module.exports = async function (hre) { // HardhatRuntimeEnvironment return; } - const Bridge = await deployments.getArtifact('BridgeV3'); + const Bridge = await deployments.getArtifact('BridgeV4'); const MultiSigWallet = await deployments.getArtifact('MultiSigWallet'); const bridgeProxyAddress = await address.getBridgeProxyAddress(hre); @@ -26,4 +26,4 @@ module.exports = async function (hre) { // HardhatRuntimeEnvironment }; module.exports.id = 'transfer_federation_to_bridge'; // id required to prevent reexecution module.exports.tags = ['TransferFederationToBridge', 'DeployFromScratch', 'IntegrationTest']; -module.exports.dependencies = ['BridgeV3', 'BridgeProxy', 'FederationProxy', 'MultiSigWallet']; +module.exports.dependencies = ['BridgeV4', 'BridgeProxy', 'FederationProxy', 'MultiSigWallet']; diff --git a/bridge/deploy/13_transfer_allowTokensToBridge.js b/bridge/deploy/13_transfer_allowTokensToBridge.js index 2ccee7804..ebdcb5704 100644 --- a/bridge/deploy/13_transfer_allowTokensToBridge.js +++ b/bridge/deploy/13_transfer_allowTokensToBridge.js @@ -9,7 +9,7 @@ module.exports = async function (hre) { // HardhatRuntimeEnvironment return; } - const Bridge = await deployments.getArtifact('BridgeV3'); + const Bridge = await deployments.getArtifact('BridgeV4'); const MultiSigWallet = await deployments.getArtifact('MultiSigWallet'); const multiSigAddress = await address.getMultiSigAddress(hre); @@ -26,4 +26,4 @@ module.exports = async function (hre) { // HardhatRuntimeEnvironment }; module.exports.id = 'transfer_allow_tokens'; // id required to prevent reexecution module.exports.tags = ['TransferAllowTokensToBridge', 'DeployFromScratch', 'IntegrationTest']; -module.exports.dependencies = ['BridgeV3', 'BridgeProxy', 'AllowTokensProxy', 'MultiSigWallet']; +module.exports.dependencies = ['BridgeV4', 'BridgeProxy', 'AllowTokensProxy', 'MultiSigWallet']; diff --git a/bridge/deploy/17_set_wrapped_currency.js b/bridge/deploy/17_set_wrapped_currency.js index 1d04078ca..537f58e33 100644 --- a/bridge/deploy/17_set_wrapped_currency.js +++ b/bridge/deploy/17_set_wrapped_currency.js @@ -9,7 +9,7 @@ module.exports = async function (hre) { // HardhatRuntimeEnvironment return; } - const Bridge = await deployments.getArtifact('BridgeV3'); + const Bridge = await deployments.getArtifact('BridgeV4'); const BridgeProxy = await deployments.get('BridgeProxy'); const MultiSigWallet = await deployments.getArtifact('MultiSigWallet'); @@ -48,5 +48,5 @@ module.exports = async function (hre) { // HardhatRuntimeEnvironment module.exports.id = 'set_bridge_wrapped_currency'; // id required to prevent reexecution module.exports.tags = ['BridgeSetWrappedCurrency', 'DeployFromScratch', 'IntegrationTest']; module.exports.dependencies = [ - 'AllowTokensProxy', 'AllowTokens', 'BridgeV3', 'BridgeProxy', 'MultiSigWallet' + 'AllowTokensProxy', 'AllowTokens', 'BridgeV4', 'BridgeProxy', 'MultiSigWallet' ]; diff --git a/bridge/deploy/upgrades/01_upgrade_bridge.js b/bridge/deploy/upgrades/01_upgrade_bridge.js index a7806ed77..c1859244f 100644 --- a/bridge/deploy/upgrades/01_upgrade_bridge.js +++ b/bridge/deploy/upgrades/01_upgrade_bridge.js @@ -11,7 +11,7 @@ module.exports = async function (hre) { // HardhatRuntimeEnvironment const proxyAdminContract = new web3.eth.Contract(proxyAdminArtifact.abi, proxyAdmin); const methodCallUpdagradeBridgeDeployment = proxyAdminContract.methods.upgrade(bridgeProxy, bridgeDeployed.address); - await methodCallUpdagradeBridgeDeployment.call({ from: multiSig }); + await methodCallUpdagradeBridgeDeployment.send({ from: multiSig }); const multiSigContract = new web3.eth.Contract(multiSigWalletArtifact.abi, multiSig); await multiSigContract.methods.submitTransaction( diff --git a/bridge/deploy/upgrades/02_upgrade_federation.js b/bridge/deploy/upgrades/02_upgrade_federation.js index 65b0d5cae..bac5d7922 100644 --- a/bridge/deploy/upgrades/02_upgrade_federation.js +++ b/bridge/deploy/upgrades/02_upgrade_federation.js @@ -11,7 +11,7 @@ module.exports = async function (hre) { // HardhatRuntimeEnvironment const proxyAdminContract = new web3.eth.Contract(proxyAdminArtifact.abi, proxyAdmin); const methodCallUpdagradeBridgeDeployment = proxyAdminContract.methods.upgrade(federationProxy, federationDeployed.address); - await methodCallUpdagradeBridgeDeployment.call({ from: multiSig }); + await methodCallUpdagradeBridgeDeployment.send({ from: multiSig }); const multiSigContract = new web3.eth.Contract(multiSigWalletDeployment.abi, multiSig); await multiSigContract.methods.submitTransaction( diff --git a/bridge/deployments/alphanet/.chainId b/bridge/deployments/alphanet/.chainId new file mode 100644 index 000000000..efee1f88b --- /dev/null +++ b/bridge/deployments/alphanet/.chainId @@ -0,0 +1 @@ +78 \ No newline at end of file diff --git a/bridge/deployments/alphanet/AllowTokensProxy.json b/bridge/deployments/alphanet/AllowTokensProxy.json new file mode 100644 index 000000000..8b4935c0e --- /dev/null +++ b/bridge/deployments/alphanet/AllowTokensProxy.json @@ -0,0 +1,427 @@ +{ + "address": "0x4175946608a417f54C17c0b2e3B893aA2996ad73", + "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": "0xd67951fe545c959ca0e85cf0c6de60d40a4853645aaf676de04a002c2e2199f8", + "receipt": { + "to": null, + "from": "0x49A2731C440B0A217f817dB99145Ef5c2e3c9f4E", + "contractAddress": "0x4175946608a417f54C17c0b2e3B893aA2996ad73", + "transactionIndex": 0, + "gasUsed": "1822453", + "logsBloom": "0x04000000000000000000200000010000000400000000200000800000000000000000000000000000000000000000000000002400020400000100000000040000000010000000000000000000000000000001000100040000000000000000000008000000020000000000800000000800000000000000000000000000000000400000000400000000000000000004001000000800000000000000000000000000000000000000800000000100000004000000000000800000002000080000400000000000000004000000000000000000000008008000000000000000000060220000000080000000000000000000000000000000008000000000000000100000", + "blockHash": "0x87ab7c456bb41d21c9cec5ee6b031c908354d07db3dc585b976bffd10dd2f008", + "transactionHash": "0xd67951fe545c959ca0e85cf0c6de60d40a4853645aaf676de04a002c2e2199f8", + "logs": [ + { + "transactionIndex": 0, + "blockNumber": 103914, + "transactionHash": "0xd67951fe545c959ca0e85cf0c6de60d40a4853645aaf676de04a002c2e2199f8", + "address": "0x4175946608a417f54C17c0b2e3B893aA2996ad73", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000049a2731c440b0a217f817db99145ef5c2e3c9f4e" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x87ab7c456bb41d21c9cec5ee6b031c908354d07db3dc585b976bffd10dd2f008" + }, + { + "transactionIndex": 0, + "blockNumber": 103914, + "transactionHash": "0xd67951fe545c959ca0e85cf0c6de60d40a4853645aaf676de04a002c2e2199f8", + "address": "0x4175946608a417f54C17c0b2e3B893aA2996ad73", + "topics": [ + "0x4101e71e974f68df5e9730cc223280b41654676bbb052cdcc735c3337e64d2d9" + ], + "data": "0x000000000000000000000000ddd720f6ac69c48b11bae06ca1f852d7920fd58a", + "logIndex": 1, + "blockHash": "0x87ab7c456bb41d21c9cec5ee6b031c908354d07db3dc585b976bffd10dd2f008" + }, + { + "transactionIndex": 0, + "blockNumber": 103914, + "transactionHash": "0xd67951fe545c959ca0e85cf0c6de60d40a4853645aaf676de04a002c2e2199f8", + "address": "0x4175946608a417f54C17c0b2e3B893aA2996ad73", + "topics": [ + "0xfcc55d4aea72e6d2d439843942c59b3141c952375a217e381f6a40e0b5ac4219" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "logIndex": 2, + "blockHash": "0x87ab7c456bb41d21c9cec5ee6b031c908354d07db3dc585b976bffd10dd2f008" + }, + { + "transactionIndex": 0, + "blockNumber": 103914, + "transactionHash": "0xd67951fe545c959ca0e85cf0c6de60d40a4853645aaf676de04a002c2e2199f8", + "address": "0x4175946608a417f54C17c0b2e3B893aA2996ad73", + "topics": [ + "0x1d2b256bb06ebc298b1980410a5e3b1e9bc4be642e8f26a58dc8a97d7fe2bbbb", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + "data": "0x00000000000000000000000000000000000000000000000000005af3107a40000000000000000000000000000000000000000000000000015af1d78b58c400000000000000000000000000000000000000000000000000056bc75e2d63100000000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000de0b6b3a7640000", + "logIndex": 3, + "blockHash": "0x87ab7c456bb41d21c9cec5ee6b031c908354d07db3dc585b976bffd10dd2f008" + }, + { + "transactionIndex": 0, + "blockNumber": 103914, + "transactionHash": "0xd67951fe545c959ca0e85cf0c6de60d40a4853645aaf676de04a002c2e2199f8", + "address": "0x4175946608a417f54C17c0b2e3B893aA2996ad73", + "topics": [ + "0xb30844b47136a66c1307afd352145423a1c237692b6ba474578f06f4614b35a0", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000034254430000000000000000000000000000000000000000000000000000000000", + "logIndex": 4, + "blockHash": "0x87ab7c456bb41d21c9cec5ee6b031c908354d07db3dc585b976bffd10dd2f008" + }, + { + "transactionIndex": 0, + "blockNumber": 103914, + "transactionHash": "0xd67951fe545c959ca0e85cf0c6de60d40a4853645aaf676de04a002c2e2199f8", + "address": "0x4175946608a417f54C17c0b2e3B893aA2996ad73", + "topics": [ + "0x1d2b256bb06ebc298b1980410a5e3b1e9bc4be642e8f26a58dc8a97d7fe2bbbb", + "0x0000000000000000000000000000000000000000000000000000000000000001" + ], + "data": "0x0000000000000000000000000000000000000000000000000011c37937e08000000000000000000000000000000000000000000000000028a857425466f800000000000000000000000000000000000000000000000000a2a15d09519be0000000000000000000000000000000000000000000000000000029a2241af62c0000000000000000000000000000000000000000000000000001a055690d9db80000", + "logIndex": 5, + "blockHash": "0x87ab7c456bb41d21c9cec5ee6b031c908354d07db3dc585b976bffd10dd2f008" + }, + { + "transactionIndex": 0, + "blockNumber": 103914, + "transactionHash": "0xd67951fe545c959ca0e85cf0c6de60d40a4853645aaf676de04a002c2e2199f8", + "address": "0x4175946608a417f54C17c0b2e3B893aA2996ad73", + "topics": [ + "0xb30844b47136a66c1307afd352145423a1c237692b6ba474578f06f4614b35a0", + "0x0000000000000000000000000000000000000000000000000000000000000001" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000034554480000000000000000000000000000000000000000000000000000000000", + "logIndex": 6, + "blockHash": "0x87ab7c456bb41d21c9cec5ee6b031c908354d07db3dc585b976bffd10dd2f008" + }, + { + "transactionIndex": 0, + "blockNumber": 103914, + "transactionHash": "0xd67951fe545c959ca0e85cf0c6de60d40a4853645aaf676de04a002c2e2199f8", + "address": "0x4175946608a417f54C17c0b2e3B893aA2996ad73", + "topics": [ + "0x1d2b256bb06ebc298b1980410a5e3b1e9bc4be642e8f26a58dc8a97d7fe2bbbb", + "0x0000000000000000000000000000000000000000000000000000000000000002" + ], + "data": "0x000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000000000000000000000000000878678326eac90000000000000000000000000000000000000000000000000010f0cf064dd592000000000000000000000000000000000000000000000000000008ac7230489e800000000000000000000000000000000000000000000000000056bc75e2d63100000", + "logIndex": 7, + "blockHash": "0x87ab7c456bb41d21c9cec5ee6b031c908354d07db3dc585b976bffd10dd2f008" + }, + { + "transactionIndex": 0, + "blockNumber": 103914, + "transactionHash": "0xd67951fe545c959ca0e85cf0c6de60d40a4853645aaf676de04a002c2e2199f8", + "address": "0x4175946608a417f54C17c0b2e3B893aA2996ad73", + "topics": [ + "0xb30844b47136a66c1307afd352145423a1c237692b6ba474578f06f4614b35a0", + "0x0000000000000000000000000000000000000000000000000000000000000002" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000083c31303030757364000000000000000000000000000000000000000000000000", + "logIndex": 8, + "blockHash": "0x87ab7c456bb41d21c9cec5ee6b031c908354d07db3dc585b976bffd10dd2f008" + }, + { + "transactionIndex": 0, + "blockNumber": 103914, + "transactionHash": "0xd67951fe545c959ca0e85cf0c6de60d40a4853645aaf676de04a002c2e2199f8", + "address": "0x4175946608a417f54C17c0b2e3B893aA2996ad73", + "topics": [ + "0x1d2b256bb06ebc298b1980410a5e3b1e9bc4be642e8f26a58dc8a97d7fe2bbbb", + "0x0000000000000000000000000000000000000000000000000000000000000003" + ], + "data": "0x000000000000000000000000000000000000000000000000016345785d8a000000000000000000000000000000000000000000000000054b40b1f852bda00000000000000000000000000000000000000000000000000a968163f0a57b4000000000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000003635c9adc5dea00000", + "logIndex": 9, + "blockHash": "0x87ab7c456bb41d21c9cec5ee6b031c908354d07db3dc585b976bffd10dd2f008" + }, + { + "transactionIndex": 0, + "blockNumber": 103914, + "transactionHash": "0xd67951fe545c959ca0e85cf0c6de60d40a4853645aaf676de04a002c2e2199f8", + "address": "0x4175946608a417f54C17c0b2e3B893aA2996ad73", + "topics": [ + "0xb30844b47136a66c1307afd352145423a1c237692b6ba474578f06f4614b35a0", + "0x0000000000000000000000000000000000000000000000000000000000000003" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000073c31303075736400000000000000000000000000000000000000000000000000", + "logIndex": 10, + "blockHash": "0x87ab7c456bb41d21c9cec5ee6b031c908354d07db3dc585b976bffd10dd2f008" + }, + { + "transactionIndex": 0, + "blockNumber": 103914, + "transactionHash": "0xd67951fe545c959ca0e85cf0c6de60d40a4853645aaf676de04a002c2e2199f8", + "address": "0x4175946608a417f54C17c0b2e3B893aA2996ad73", + "topics": [ + "0x1d2b256bb06ebc298b1980410a5e3b1e9bc4be642e8f26a58dc8a97d7fe2bbbb", + "0x0000000000000000000000000000000000000000000000000000000000000004" + ], + "data": "0x0000000000000000000000000000000000000000000000008ac7230489e8000000000000000000000000000000000000000000000002116545850052128000000000000000000000000000000000000000000000000422ca8b0a00a42500000000000000000000000000000000000000000000000000021e19e0c9bab240000000000000000000000000000000000000000000000000152d02c7e14af6800000", + "logIndex": 11, + "blockHash": "0x87ab7c456bb41d21c9cec5ee6b031c908354d07db3dc585b976bffd10dd2f008" + }, + { + "transactionIndex": 0, + "blockNumber": 103914, + "transactionHash": "0xd67951fe545c959ca0e85cf0c6de60d40a4853645aaf676de04a002c2e2199f8", + "address": "0x4175946608a417f54C17c0b2e3B893aA2996ad73", + "topics": [ + "0xb30844b47136a66c1307afd352145423a1c237692b6ba474578f06f4614b35a0", + "0x0000000000000000000000000000000000000000000000000000000000000004" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000053d31757364000000000000000000000000000000000000000000000000000000", + "logIndex": 12, + "blockHash": "0x87ab7c456bb41d21c9cec5ee6b031c908354d07db3dc585b976bffd10dd2f008" + }, + { + "transactionIndex": 0, + "blockNumber": 103914, + "transactionHash": "0xd67951fe545c959ca0e85cf0c6de60d40a4853645aaf676de04a002c2e2199f8", + "address": "0x4175946608a417f54C17c0b2e3B893aA2996ad73", + "topics": [ + "0x1d2b256bb06ebc298b1980410a5e3b1e9bc4be642e8f26a58dc8a97d7fe2bbbb", + "0x0000000000000000000000000000000000000000000000000000000000000005" + ], + "data": "0x00000000000000000000000000000000000000000000003635c9adc5dea00000000000000000000000000000000000000000000000cecb8f27f4200f3a0000000000000000000000000000000000000000000000019d971e4fe8401e7400000000000000000000000000000000000000000000000000d3c21bcecceda1000000000000000000000000000000000000000000000000084595161401484a000000", + "logIndex": 13, + "blockHash": "0x87ab7c456bb41d21c9cec5ee6b031c908354d07db3dc585b976bffd10dd2f008" + }, + { + "transactionIndex": 0, + "blockNumber": 103914, + "transactionHash": "0xd67951fe545c959ca0e85cf0c6de60d40a4853645aaf676de04a002c2e2199f8", + "address": "0x4175946608a417f54C17c0b2e3B893aA2996ad73", + "topics": [ + "0xb30844b47136a66c1307afd352145423a1c237692b6ba474578f06f4614b35a0", + "0x0000000000000000000000000000000000000000000000000000000000000005" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000053c31757364000000000000000000000000000000000000000000000000000000", + "logIndex": 14, + "blockHash": "0x87ab7c456bb41d21c9cec5ee6b031c908354d07db3dc585b976bffd10dd2f008" + }, + { + "transactionIndex": 0, + "blockNumber": 103914, + "transactionHash": "0xd67951fe545c959ca0e85cf0c6de60d40a4853645aaf676de04a002c2e2199f8", + "address": "0x4175946608a417f54C17c0b2e3B893aA2996ad73", + "topics": [ + "0x1d2b256bb06ebc298b1980410a5e3b1e9bc4be642e8f26a58dc8a97d7fe2bbbb", + "0x0000000000000000000000000000000000000000000000000000000000000006" + ], + "data": "0x00000000000000000000000000000000000000000000152d02c7e14af6800000000000000000000000000000000000000000000050c783eb9b5c85f2a80000000000000000000000000000000000000000000000a18f07d736b90be55000000000000000000000000000000000000000000000000052b7d2dcc80cd2e40000000000000000000000000000000000000000000000033b2e3c9fd0803ce8000000", + "logIndex": 15, + "blockHash": "0x87ab7c456bb41d21c9cec5ee6b031c908354d07db3dc585b976bffd10dd2f008" + }, + { + "transactionIndex": 0, + "blockNumber": 103914, + "transactionHash": "0xd67951fe545c959ca0e85cf0c6de60d40a4853645aaf676de04a002c2e2199f8", + "address": "0x4175946608a417f54C17c0b2e3B893aA2996ad73", + "topics": [ + "0xb30844b47136a66c1307afd352145423a1c237692b6ba474578f06f4614b35a0", + "0x0000000000000000000000000000000000000000000000000000000000000006" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000063c3163656e740000000000000000000000000000000000000000000000000000", + "logIndex": 16, + "blockHash": "0x87ab7c456bb41d21c9cec5ee6b031c908354d07db3dc585b976bffd10dd2f008" + } + ], + "blockNumber": 103914, + "cumulativeGasUsed": "1822453", + "status": 1, + "byzantium": true + }, + "args": [ + "0xaa0e9A669eFcCcfCa40d9a14823D25327dAcc065", + "0x56183c2CCBe444f6217dA6cAF1F8000410542104", + "0xd4164b5d00000000000000000000000049a2731c440b0a217f817db99145ef5c2e3c9f4e000000000000000000000000ddd720f6ac69c48b11bae06ca1f852d7920fd58a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000003e000000000000000000000000000000000000000000000000000000000000004e000000000000000000000000000000000000000000000000000000000000005e000000000000000000000000000000000000000000000000000000000000006e000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000005af3107a40000000000000000000000000000000000000000000000000015af1d78b58c400000000000000000000000000000000000000000000000000056bc75e2d63100000000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000003425443000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000011c37937e08000000000000000000000000000000000000000000000000028a857425466f800000000000000000000000000000000000000000000000000a2a15d09519be0000000000000000000000000000000000000000000000000000029a2241af62c0000000000000000000000000000000000000000000000000001a055690d9db800000000000000000000000000000000000000000000000000000000000000000003455448000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000000000000000000000000000878678326eac90000000000000000000000000000000000000000000000000010f0cf064dd592000000000000000000000000000000000000000000000000000008ac7230489e800000000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000000000000000000083c3130303075736400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000016345785d8a000000000000000000000000000000000000000000000000054b40b1f852bda00000000000000000000000000000000000000000000000000a968163f0a57b4000000000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000003635c9adc5dea0000000000000000000000000000000000000000000000000000000000000000000073c3130307573640000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000008ac7230489e8000000000000000000000000000000000000000000000002116545850052128000000000000000000000000000000000000000000000000422ca8b0a00a42500000000000000000000000000000000000000000000000000021e19e0c9bab240000000000000000000000000000000000000000000000000152d02c7e14af680000000000000000000000000000000000000000000000000000000000000000000053d3175736400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000003635c9adc5dea00000000000000000000000000000000000000000000000cecb8f27f4200f3a0000000000000000000000000000000000000000000000019d971e4fe8401e7400000000000000000000000000000000000000000000000000d3c21bcecceda1000000000000000000000000000000000000000000000000084595161401484a00000000000000000000000000000000000000000000000000000000000000000000053c3175736400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000152d02c7e14af6800000000000000000000000000000000000000000000050c783eb9b5c85f2a80000000000000000000000000000000000000000000000a18f07d736b90be55000000000000000000000000000000000000000000000000052b7d2dcc80cd2e40000000000000000000000000000000000000000000000033b2e3c9fd0803ce800000000000000000000000000000000000000000000000000000000000000000000063c3163656e740000000000000000000000000000000000000000000000000000" + ], + "numDeployments": 1, + "solcInputHash": "bfc96d5f60348b72136d284c7b5c1536", + "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/alphanet/AllowTokensV1.json b/bridge/deployments/alphanet/AllowTokensV1.json new file mode 100644 index 000000000..809fa8c0e --- /dev/null +++ b/bridge/deployments/alphanet/AllowTokensV1.json @@ -0,0 +1,1238 @@ +{ + "address": "0xaa0e9A669eFcCcfCa40d9a14823D25327dAcc065", + "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": "0xe1a4f06d2a402b47461df1cada04db5c00edfa0e4b9283b1705662a229a19ccc", + "receipt": { + "to": null, + "from": "0x49A2731C440B0A217f817dB99145Ef5c2e3c9f4E", + "contractAddress": "0xaa0e9A669eFcCcfCa40d9a14823D25327dAcc065", + "transactionIndex": 1, + "gasUsed": "2528187", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xa9870a16f2efa0defb88b758ed46104e7c06b6a0e6582fa5f9d3d721da2970df", + "transactionHash": "0xe1a4f06d2a402b47461df1cada04db5c00edfa0e4b9283b1705662a229a19ccc", + "logs": [], + "blockNumber": 103912, + "cumulativeGasUsed": "2564051", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "bfc96d5f60348b72136d284c7b5c1536", + "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/AllowTokensV1.sol\":\"AllowTokensV1\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/AllowTokens/AllowTokensV1.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 AllowTokensV1 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\":\"0x2496cf004fb1d9fd082c33e20b3ea0790419b11a8c5a35f1361e2f8cbbebf3d3\",\"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": "0x608060405234801561001057600080fd5b5061243c806100206000396000f3fe608060405234801561001057600080fd5b50600436106101f05760003560e01c806390469a9d1161010f578063c6dbdf61116100a2578063e744092e11610071578063e744092e14610488578063f2fde38b146104e3578063f5dab711146104f6578063f9eaee0d1461051657600080fd5b8063c6dbdf6114610449578063d4164b5d1461045a578063d7516faa1461046d578063e4f89ae41461047557600080fd5b8063b348a29f116100de578063b348a29f146103ec578063bb698dad146103ff578063c361ce8314610412578063c4d66de81461043657600080fd5b806390469a9d1461039c5780639d27d226146103af578063a81a8b1f146103d0578063adfeb5eb146103d957600080fd5b8063601ad4c9116101875780638c34bc55116101565780638c34bc551461033c5780638da5cb5b1461034f5780638de52dd7146103745780638f32d59b1461037d57600080fd5b8063601ad4c914610305578063715018a61461031857806378bf2b53146103205780637d496be91461033357600080fd5b8063250540cf116101c3578063250540cf146102aa5780633777804f146102bd57806353a8b574146102d257806354fd4d50146102e757600080fd5b806307fc9eb9146101f55780630a9763d71461025f5780631c21a08f146102755780632348238c14610295575b600080fd5b610232610203366004611bad565b603660205260009081526040902080546001820154600283015460038401546004909401549293919290919085565b604080519586526020860194909452928401919091526060830152608082015260a0015b60405180910390f35b61026760fa81565b604051908152602001610256565b610288610283366004611bad565b610529565b6040516102569190611c13565b6102a86102a3366004611c42565b6105d5565b005b6102676102b8366004611c42565b6106ce565b6102c56106f2565b6040516102569190611c5d565b6102da610807565b6040516102569190611cd6565b604080518082019091526002815261763160f01b6020820152610288565b6102a8610313366004611d38565b61093e565b6102a8610978565b6102a861032e366004611d64565b6109ec565b61026760395481565b6102a861034a366004611d64565b610b49565b6033546001600160a01b03165b6040516001600160a01b039091168152602001610256565b61026760385481565b6033546001600160a01b031633145b6040519015158152602001610256565b6102a86103aa366004611c42565b610d27565b6103c26103bd366004611c42565b610e1b565b604051610256929190611d8e565b61026760375481565b6102a86103e7366004611c42565b610ee0565b6102a86103fa366004611eca565b610f9e565b61026761040d366004611ef7565b610fd2565b60375460385460395460408051938452602084019290925290820152606001610256565b6102a8610444366004611c42565b611057565b6034546001600160a01b031661035c565b6102a8610468366004611f86565b61110c565b603a54610267565b6102a8610483366004612164565b6111ff565b6104c1610496366004611c42565b603560205260009081526040902080546001820154600283015460039093015460ff90921692909184565b6040805194151585526020850193909352918301526060820152608001610256565b6102a86104f1366004611c42565b6112df565b610509610504366004611c42565b611315565b60405161025691906121d9565b61038c610524366004611c42565b611395565b603a818154811061053957600080fd5b90600052602060002001600091509050805461055490612206565b80601f016020809104026020016040519081016040528092919081815260200182805461058090612206565b80156105cd5780601f106105a2576101008083540402835291602001916105cd565b820191906000526020600020905b8154815290600101906020018083116105b057829003601f168201915b505050505081565b6034546001600160a01b0316336001600160a01b0316146106115760405162461bcd60e51b81526004016106089061223b565b60405180910390fd5b6001600160a01b03811661067a5760405162461bcd60e51b815260206004820152602a60248201527f5365636f6e646172793a206e6577207072696d61727920697320746865207a65604482015269726f206164647265737360b01b6064820152608401610608565b603480546001600160a01b0319166001600160a01b0383169081179091556040519081527f4101e71e974f68df5e9730cc223280b41654676bbb052cdcc735c3337e64d2d99060200160405180910390a150565b60008060006106dc84610e1b565b915091506106ea82826113d1565b949350505050565b603a5460609067ffffffffffffffff81111561071057610710611dea565b60405190808252806020026020018201604052801561077357816020015b6107606040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b81526020019060019003908161072e5790505b50905060005b603a5481101561080357603660008281526020019081526020016000206040518060a0016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820154815250508282815181106107e5576107e5612287565b602002602001018190525080806107fb906122b3565b915050610779565b5090565b603a5460609067ffffffffffffffff81111561082557610825611dea565b60405190808252806020026020018201604052801561085857816020015b60608152602001906001900390816108435790505b50905060005b603a5481101561080357603a818154811061087b5761087b612287565b90600052602060002001805461089090612206565b80601f01602080910402602001604051908101604052809291908181526020018280546108bc90612206565b80156109095780601f106108de57610100808354040283529160200191610909565b820191906000526020600020905b8154815290600101906020018083116108ec57829003601f168201915b505050505082828151811061092057610920612287565b60200260200101819052508080610936906122b3565b91505061085e565b6033546001600160a01b031633146109685760405162461bcd60e51b8152600401610608906122ce565b61097383838361143b565b505050565b6033546001600160a01b031633146109a25760405162461bcd60e51b8152600401610608906122ce565b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b816001600160a01b038116610a135760405162461bcd60e51b815260040161060890612303565b6033546001600160a01b0316331480610a3657506034546001600160a01b031633145b610a825760405162461bcd60e51b815260206004820181905260248201527f416c6c6f77546f6b656e733a20756e617574686f72697a65642073656e6465726044820152606401610608565b603a548210610ade5760405162461bcd60e51b815260206004820152602260248201527f416c6c6f77546f6b656e733a2074797065496420646f6573206e6f74206578696044820152611cdd60f21b6064820152608401610608565b6000610ae984611315565b60018152602081018490529050610b008482611568565b836001600160a01b03167f720764556647dd167f4229d6a4255ac86018e302a50fc29dd67a70edb7b314d084604051610b3b91815260200190565b60405180910390a250505050565b6034546001600160a01b0316336001600160a01b031614610b7c5760405162461bcd60e51b81526004016106089061223b565b600080610b8884610e1b565b91509150610b9584611395565b610be15760405162461bcd60e51b815260206004820152601c60248201527f416c6c6f77546f6b656e733a204e6f742077686974656c6973746564000000006044820152606401610608565b8051831015610c325760405162461bcd60e51b815260206004820152601d60248201527f416c6c6f77546f6b656e733a204c6f776572207468616e206c696d69740000006044820152606401610608565b6060820151610c44906201518061233a565b421115610c5957426060830152600060408301525b6000610c6583836113d1565b905080841115610cb75760405162461bcd60e51b815260206004820152601b60248201527f416c6c6f77546f6b656e733a204578636565646564206c696d697400000000006044820152606401610608565b6040830151610cc69085611623565b6040840152610cd58584611568565b6060830151604080850151815192835260208301526001600160a01b038716917f84480cc6a063ffd72c3eddf21e3ffd30db3e2b8e386ec3abf09c98ee9e0e8d34910160405180910390a25050505050565b806001600160a01b038116610d4e5760405162461bcd60e51b815260040161060890612303565b6033546001600160a01b03163314610d785760405162461bcd60e51b8152600401610608906122ce565b6000610d8383611315565b8051909150610dd45760405162461bcd60e51b815260206004820152601860248201527f416c6c6f77546f6b656e733a204e6f7420416c6c6f77656400000000000000006044820152606401610608565b60008152610de28382611568565b6040516001600160a01b038416907fbf996b4fd74f0c7159bb017b1db415b0d9a6f13129f46d0b93309d170b78df3190600090a2505050565b610e4860405180608001604052806000151581526020016000815260200160008152602001600081525090565b610e7a6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b610e8383611315565b915060366000836020015181526020019081526020016000206040518060a0016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820154815250509050915091565b600054610100900460ff1680610ef9575060005460ff16155b610f155760405162461bcd60e51b815260040161060890612352565b600054610100900460ff16158015610f37576000805461ffff19166101011790555b603480546001600160a01b0319166001600160a01b0384169081179091556040519081527f4101e71e974f68df5e9730cc223280b41654676bbb052cdcc735c3337e64d2d99060200160405180910390a18015610f9a576000805461ff00191690555b5050565b6033546001600160a01b03163314610fc85760405162461bcd60e51b8152600401610608906122ce565b610f9a8282611682565b6033546000906001600160a01b03163314610fff5760405162461bcd60e51b8152600401610608906122ce565b61104d84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611048925050503685900385018561239a565b611923565b90505b9392505050565b600054610100900460ff1680611070575060005460ff16155b61108c5760405162461bcd60e51b815260040161060890612352565b600054610100900460ff161580156110ae576000805461ffff19166101011790555b603380546001600160a01b0319166001600160a01b0384169081179091556040516000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a38015610f9a576000805461ff00191690555050565b600054610100900460ff1680611125575060005460ff16155b6111415760405162461bcd60e51b815260040161060890612352565b600054610100900460ff16158015611163576000805461ffff19166101011790555b61116c87611057565b61117586610ee0565b61118085858561143b565b60005b82518110156111e3576111d08382815181106111a1576111a1612287565b6020026020010151600001518483815181106111bf576111bf612287565b602002602001015160200151611923565b506111dc81600161233a565b9050611183565b5080156111f6576000805461ff00191690555b50505050505050565b6033546001600160a01b031633146112295760405162461bcd60e51b8152600401610608906122ce565b806112765760405162461bcd60e51b815260206004820152601960248201527f416c6c6f77546f6b656e733a20656d70747920746f6b656e73000000000000006044820152606401610608565b60005b81811015610973576112cd83838381811061129657611296612287565b6112ac9260206040909202019081019150611c42565b8484848181106112be576112be612287565b905060400201602001356109ec565b6112d881600161233a565b9050611279565b6033546001600160a01b031633146113095760405162461bcd60e51b8152600401610608906122ce565b61131281611a60565b50565b61134260405180608001604052806000151581526020016000815260200160008152602001600081525090565b506001600160a01b03166000908152603560209081526040918290208251608081018452815460ff1615158152600182015492810192909252600281015492820192909252600390910154606082015290565b6000816001600160a01b0381166113be5760405162461bcd60e51b815260040161060890612303565b6113c783611315565b5191505b50919050565b60008260600151620151806113e6919061233a565b4211156113f557600060408401525b826040015182604001511161140c57506000611435565b8260400151826040015161142091906123b6565b90508160200151811115611435575060208101515b92915050565b818311156114a75760405162461bcd60e51b815260206004820152603360248201527f416c6c6f77546f6b656e733a20736d616c6c20626967676572207468616e206d604482015272656469756d20636f6e6669726d6174696f6e7360681b6064820152608401610608565b808211156115135760405162461bcd60e51b815260206004820152603360248201527f416c6c6f77546f6b656e733a206d656469756d20626967676572207468616e206044820152726c6172676520636f6e6669726d6174696f6e7360681b6064820152608401610608565b60378390556038829055603981905560408051848152602081018490529081018290527ffcc55d4aea72e6d2d439843942c59b3141c952375a217e381f6a40e0b5ac42199060600160405180910390a1505050565b6033546001600160a01b031633148061158b57506034546001600160a01b031633145b6115d75760405162461bcd60e51b815260206004820181905260248201527f416c6c6f77546f6b656e733a20756e617574686f72697a65642073656e6465726044820152606401610608565b6001600160a01b03919091166000908152603560209081526040918290208351815460ff1916901515178155908301516001820155908201516002820155606090910151600390910155565b600080611630838561233a565b9050838110156110505760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610608565b603a5482106116e55760405162461bcd60e51b815260206004820152602960248201527f416c6c6f77546f6b656e733a20626967676572207468616e20747970654465736044820152686372697074696f6e7360b81b6064820152608401610608565b8051602082015110156117505760405162461bcd60e51b815260206004820152602d60248201527f416c6c6f77546f6b656e733a206d6178546f6b656e7320736d616c6c6572207460448201526c68616e206d696e546f6b656e7360981b6064820152608401610608565b8060200151816040015110156117bf5760405162461bcd60e51b815260206004820152602e60248201527f416c6c6f77546f6b656e733a206461696c794c696d697420736d616c6c65722060448201526d7468616e206d6178546f6b656e7360901b6064820152608401610608565b805160608201511161182d5760405162461bcd60e51b815260206004820152603160248201527f416c6c6f77546f6b656e733a206c696d6974732e6d656469756d416d6f756e746044820152701039b6b0b63632b9103a3430b71036b4b760791b6064820152608401610608565b80606001518160800151116118aa5760405162461bcd60e51b815260206004820152603960248201527f416c6c6f77546f6b656e733a206c696d6974732e6c61726765416d6f756e742060448201527f736d616c6c6572207468616e206d656469756d416d6f756e74000000000000006064820152608401610608565b600082815260366020908152604091829020835181559083015160018201558183015160028201556060830151600382015560808301516004909101555182907f1d2b256bb06ebc298b1980410a5e3b1e9bc4be642e8f26a58dc8a97d7fe2bbbb906119179084906123cd565b60405180910390a25050565b6000808351116119755760405162461bcd60e51b815260206004820152601e60248201527f416c6c6f77546f6b656e733a20456d707479206465736372697074696f6e00006044820152606401610608565b50603a5460fa61198682600161233a565b11156119d45760405162461bcd60e51b815260206004820152601e60248201527f416c6c6f77546f6b656e733a2052656163686564204d41585f545950455300006044820152606401610608565b603a80546001810182556000919091528351611a17917fa2999d817b6757290b50e8ecf3fa939673403dd35c97de392fdb343b4015ce9e01906020860190611b1d565b50611a228183611682565b807fb30844b47136a66c1307afd352145423a1c237692b6ba474578f06f4614b35a084604051611a529190611c13565b60405180910390a292915050565b6001600160a01b038116611ac15760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a206e6577206f776e6572206973207a65726f206164647265604482015261737360f01b6064820152608401610608565b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b828054611b2990612206565b90600052602060002090601f016020900481019282611b4b5760008555611b91565b82601f10611b6457805160ff1916838001178555611b91565b82800160010185558215611b91579182015b82811115611b91578251825591602001919060010190611b76565b506108039291505b808211156108035760008155600101611b99565b600060208284031215611bbf57600080fd5b5035919050565b6000815180845260005b81811015611bec57602081850181015186830182015201611bd0565b81811115611bfe576000602083870101525b50601f01601f19169290920160200192915050565b6020815260006110506020830184611bc6565b80356001600160a01b0381168114611c3d57600080fd5b919050565b600060208284031215611c5457600080fd5b61105082611c26565b6020808252825182820181905260009190848201906040850190845b81811015611cca57611cb783855180518252602081015160208301526040810151604083015260608101516060830152608081015160808301525050565b9284019260a09290920191600101611c79565b50909695505050505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611d2b57603f19888603018452611d19858351611bc6565b94509285019290850190600101611cfd565b5092979650505050505050565b600080600060608486031215611d4d57600080fd5b505081359360208301359350604090920135919050565b60008060408385031215611d7757600080fd5b611d8083611c26565b946020939093013593505050565b82511515815260208084015181830152604080850151818401526060808601518185015284516080808601919091529285015160a08501529084015160c084015283015160e08301528201516101008201526101208101611050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715611e2357611e23611dea565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611e5257611e52611dea565b604052919050565b600060a08284031215611e6c57600080fd5b60405160a0810181811067ffffffffffffffff82111715611e8f57611e8f611dea565b806040525080915082358152602083013560208201526040830135604082015260608301356060820152608083013560808201525092915050565b60008060c08385031215611edd57600080fd5b82359150611eee8460208501611e5a565b90509250929050565b600080600083850360c0811215611f0d57600080fd5b843567ffffffffffffffff80821115611f2557600080fd5b818701915087601f830112611f3957600080fd5b813581811115611f4857600080fd5b886020828501011115611f5a57600080fd5b60209290920195509093505060a0601f1982011215611f7857600080fd5b506020840190509250925092565b60008060008060008060c08789031215611f9f57600080fd5b611fa887611c26565b9550611fb660208801611c26565b945060408701359350606087013592506080870135915067ffffffffffffffff60a08801351115611fe657600080fd5b60a0870135870188601f820112611ffc57600080fd5b67ffffffffffffffff8135111561201557612015611dea565b6120256020823560051b01611e29565b81358082526020808301929160051b8401018b101561204357600080fd5b602083015b6020843560051b8501018110156121535767ffffffffffffffff8135111561206f57600080fd5b8035840160c0818e03601f1901121561208757600080fd5b61208f611e00565b67ffffffffffffffff602083013511156120a857600080fd5b8d603f6020840135840101126120bd57600080fd5b6020808301358301013567ffffffffffffffff8111156120df576120df611dea565b6120f2601f8201601f1916602001611e29565b8181528f604083602087013587010101111561210d57600080fd5b8160406020860135860101602083013760006020838301015280835250506121388e60408401611e5a565b60208201528085525050602083019250602081019050612048565b508093505050509295509295509295565b6000806020838503121561217757600080fd5b823567ffffffffffffffff8082111561218f57600080fd5b818501915085601f8301126121a357600080fd5b8135818111156121b257600080fd5b8660208260061b85010111156121c757600080fd5b60209290920196919550909350505050565b81511515815260208083015190820152604080830151908201526060808301519082015260808101611435565b600181811c9082168061221a57607f821691505b602082108114156113cb57634e487b7160e01b600052602260045260246000fd5b6020808252602c908201527f5365636f6e646172793a2063616c6c6572206973206e6f74207468652070726960408201526b1b585c9e481858d8dbdd5b9d60a21b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156122c7576122c761229d565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526019908201527f416c6c6f77546f6b656e733a204e756c6c204164647265737300000000000000604082015260600190565b6000821982111561234d5761234d61229d565b500190565b60208082526028908201527f436f6e747261637420696e7374616e636520697320616c726561647920696e696040820152671d1a585b1a5e995960c21b606082015260800190565b600060a082840312156123ac57600080fd5b6110508383611e5a565b6000828210156123c8576123c861229d565b500390565b60a0810161143582848051825260208101516020830152604081015160408301526060810151606083015260808101516080830152505056fea2646970667358221220a971cb8bd64a0010543b80b889c22dfe50d292f2fb3e69136eb8ec1d92ee89fd64736f6c63430008090033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101f05760003560e01c806390469a9d1161010f578063c6dbdf61116100a2578063e744092e11610071578063e744092e14610488578063f2fde38b146104e3578063f5dab711146104f6578063f9eaee0d1461051657600080fd5b8063c6dbdf6114610449578063d4164b5d1461045a578063d7516faa1461046d578063e4f89ae41461047557600080fd5b8063b348a29f116100de578063b348a29f146103ec578063bb698dad146103ff578063c361ce8314610412578063c4d66de81461043657600080fd5b806390469a9d1461039c5780639d27d226146103af578063a81a8b1f146103d0578063adfeb5eb146103d957600080fd5b8063601ad4c9116101875780638c34bc55116101565780638c34bc551461033c5780638da5cb5b1461034f5780638de52dd7146103745780638f32d59b1461037d57600080fd5b8063601ad4c914610305578063715018a61461031857806378bf2b53146103205780637d496be91461033357600080fd5b8063250540cf116101c3578063250540cf146102aa5780633777804f146102bd57806353a8b574146102d257806354fd4d50146102e757600080fd5b806307fc9eb9146101f55780630a9763d71461025f5780631c21a08f146102755780632348238c14610295575b600080fd5b610232610203366004611bad565b603660205260009081526040902080546001820154600283015460038401546004909401549293919290919085565b604080519586526020860194909452928401919091526060830152608082015260a0015b60405180910390f35b61026760fa81565b604051908152602001610256565b610288610283366004611bad565b610529565b6040516102569190611c13565b6102a86102a3366004611c42565b6105d5565b005b6102676102b8366004611c42565b6106ce565b6102c56106f2565b6040516102569190611c5d565b6102da610807565b6040516102569190611cd6565b604080518082019091526002815261763160f01b6020820152610288565b6102a8610313366004611d38565b61093e565b6102a8610978565b6102a861032e366004611d64565b6109ec565b61026760395481565b6102a861034a366004611d64565b610b49565b6033546001600160a01b03165b6040516001600160a01b039091168152602001610256565b61026760385481565b6033546001600160a01b031633145b6040519015158152602001610256565b6102a86103aa366004611c42565b610d27565b6103c26103bd366004611c42565b610e1b565b604051610256929190611d8e565b61026760375481565b6102a86103e7366004611c42565b610ee0565b6102a86103fa366004611eca565b610f9e565b61026761040d366004611ef7565b610fd2565b60375460385460395460408051938452602084019290925290820152606001610256565b6102a8610444366004611c42565b611057565b6034546001600160a01b031661035c565b6102a8610468366004611f86565b61110c565b603a54610267565b6102a8610483366004612164565b6111ff565b6104c1610496366004611c42565b603560205260009081526040902080546001820154600283015460039093015460ff90921692909184565b6040805194151585526020850193909352918301526060820152608001610256565b6102a86104f1366004611c42565b6112df565b610509610504366004611c42565b611315565b60405161025691906121d9565b61038c610524366004611c42565b611395565b603a818154811061053957600080fd5b90600052602060002001600091509050805461055490612206565b80601f016020809104026020016040519081016040528092919081815260200182805461058090612206565b80156105cd5780601f106105a2576101008083540402835291602001916105cd565b820191906000526020600020905b8154815290600101906020018083116105b057829003601f168201915b505050505081565b6034546001600160a01b0316336001600160a01b0316146106115760405162461bcd60e51b81526004016106089061223b565b60405180910390fd5b6001600160a01b03811661067a5760405162461bcd60e51b815260206004820152602a60248201527f5365636f6e646172793a206e6577207072696d61727920697320746865207a65604482015269726f206164647265737360b01b6064820152608401610608565b603480546001600160a01b0319166001600160a01b0383169081179091556040519081527f4101e71e974f68df5e9730cc223280b41654676bbb052cdcc735c3337e64d2d99060200160405180910390a150565b60008060006106dc84610e1b565b915091506106ea82826113d1565b949350505050565b603a5460609067ffffffffffffffff81111561071057610710611dea565b60405190808252806020026020018201604052801561077357816020015b6107606040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b81526020019060019003908161072e5790505b50905060005b603a5481101561080357603660008281526020019081526020016000206040518060a0016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820154815250508282815181106107e5576107e5612287565b602002602001018190525080806107fb906122b3565b915050610779565b5090565b603a5460609067ffffffffffffffff81111561082557610825611dea565b60405190808252806020026020018201604052801561085857816020015b60608152602001906001900390816108435790505b50905060005b603a5481101561080357603a818154811061087b5761087b612287565b90600052602060002001805461089090612206565b80601f01602080910402602001604051908101604052809291908181526020018280546108bc90612206565b80156109095780601f106108de57610100808354040283529160200191610909565b820191906000526020600020905b8154815290600101906020018083116108ec57829003601f168201915b505050505082828151811061092057610920612287565b60200260200101819052508080610936906122b3565b91505061085e565b6033546001600160a01b031633146109685760405162461bcd60e51b8152600401610608906122ce565b61097383838361143b565b505050565b6033546001600160a01b031633146109a25760405162461bcd60e51b8152600401610608906122ce565b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b816001600160a01b038116610a135760405162461bcd60e51b815260040161060890612303565b6033546001600160a01b0316331480610a3657506034546001600160a01b031633145b610a825760405162461bcd60e51b815260206004820181905260248201527f416c6c6f77546f6b656e733a20756e617574686f72697a65642073656e6465726044820152606401610608565b603a548210610ade5760405162461bcd60e51b815260206004820152602260248201527f416c6c6f77546f6b656e733a2074797065496420646f6573206e6f74206578696044820152611cdd60f21b6064820152608401610608565b6000610ae984611315565b60018152602081018490529050610b008482611568565b836001600160a01b03167f720764556647dd167f4229d6a4255ac86018e302a50fc29dd67a70edb7b314d084604051610b3b91815260200190565b60405180910390a250505050565b6034546001600160a01b0316336001600160a01b031614610b7c5760405162461bcd60e51b81526004016106089061223b565b600080610b8884610e1b565b91509150610b9584611395565b610be15760405162461bcd60e51b815260206004820152601c60248201527f416c6c6f77546f6b656e733a204e6f742077686974656c6973746564000000006044820152606401610608565b8051831015610c325760405162461bcd60e51b815260206004820152601d60248201527f416c6c6f77546f6b656e733a204c6f776572207468616e206c696d69740000006044820152606401610608565b6060820151610c44906201518061233a565b421115610c5957426060830152600060408301525b6000610c6583836113d1565b905080841115610cb75760405162461bcd60e51b815260206004820152601b60248201527f416c6c6f77546f6b656e733a204578636565646564206c696d697400000000006044820152606401610608565b6040830151610cc69085611623565b6040840152610cd58584611568565b6060830151604080850151815192835260208301526001600160a01b038716917f84480cc6a063ffd72c3eddf21e3ffd30db3e2b8e386ec3abf09c98ee9e0e8d34910160405180910390a25050505050565b806001600160a01b038116610d4e5760405162461bcd60e51b815260040161060890612303565b6033546001600160a01b03163314610d785760405162461bcd60e51b8152600401610608906122ce565b6000610d8383611315565b8051909150610dd45760405162461bcd60e51b815260206004820152601860248201527f416c6c6f77546f6b656e733a204e6f7420416c6c6f77656400000000000000006044820152606401610608565b60008152610de28382611568565b6040516001600160a01b038416907fbf996b4fd74f0c7159bb017b1db415b0d9a6f13129f46d0b93309d170b78df3190600090a2505050565b610e4860405180608001604052806000151581526020016000815260200160008152602001600081525090565b610e7a6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b610e8383611315565b915060366000836020015181526020019081526020016000206040518060a0016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820154815250509050915091565b600054610100900460ff1680610ef9575060005460ff16155b610f155760405162461bcd60e51b815260040161060890612352565b600054610100900460ff16158015610f37576000805461ffff19166101011790555b603480546001600160a01b0319166001600160a01b0384169081179091556040519081527f4101e71e974f68df5e9730cc223280b41654676bbb052cdcc735c3337e64d2d99060200160405180910390a18015610f9a576000805461ff00191690555b5050565b6033546001600160a01b03163314610fc85760405162461bcd60e51b8152600401610608906122ce565b610f9a8282611682565b6033546000906001600160a01b03163314610fff5760405162461bcd60e51b8152600401610608906122ce565b61104d84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611048925050503685900385018561239a565b611923565b90505b9392505050565b600054610100900460ff1680611070575060005460ff16155b61108c5760405162461bcd60e51b815260040161060890612352565b600054610100900460ff161580156110ae576000805461ffff19166101011790555b603380546001600160a01b0319166001600160a01b0384169081179091556040516000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a38015610f9a576000805461ff00191690555050565b600054610100900460ff1680611125575060005460ff16155b6111415760405162461bcd60e51b815260040161060890612352565b600054610100900460ff16158015611163576000805461ffff19166101011790555b61116c87611057565b61117586610ee0565b61118085858561143b565b60005b82518110156111e3576111d08382815181106111a1576111a1612287565b6020026020010151600001518483815181106111bf576111bf612287565b602002602001015160200151611923565b506111dc81600161233a565b9050611183565b5080156111f6576000805461ff00191690555b50505050505050565b6033546001600160a01b031633146112295760405162461bcd60e51b8152600401610608906122ce565b806112765760405162461bcd60e51b815260206004820152601960248201527f416c6c6f77546f6b656e733a20656d70747920746f6b656e73000000000000006044820152606401610608565b60005b81811015610973576112cd83838381811061129657611296612287565b6112ac9260206040909202019081019150611c42565b8484848181106112be576112be612287565b905060400201602001356109ec565b6112d881600161233a565b9050611279565b6033546001600160a01b031633146113095760405162461bcd60e51b8152600401610608906122ce565b61131281611a60565b50565b61134260405180608001604052806000151581526020016000815260200160008152602001600081525090565b506001600160a01b03166000908152603560209081526040918290208251608081018452815460ff1615158152600182015492810192909252600281015492820192909252600390910154606082015290565b6000816001600160a01b0381166113be5760405162461bcd60e51b815260040161060890612303565b6113c783611315565b5191505b50919050565b60008260600151620151806113e6919061233a565b4211156113f557600060408401525b826040015182604001511161140c57506000611435565b8260400151826040015161142091906123b6565b90508160200151811115611435575060208101515b92915050565b818311156114a75760405162461bcd60e51b815260206004820152603360248201527f416c6c6f77546f6b656e733a20736d616c6c20626967676572207468616e206d604482015272656469756d20636f6e6669726d6174696f6e7360681b6064820152608401610608565b808211156115135760405162461bcd60e51b815260206004820152603360248201527f416c6c6f77546f6b656e733a206d656469756d20626967676572207468616e206044820152726c6172676520636f6e6669726d6174696f6e7360681b6064820152608401610608565b60378390556038829055603981905560408051848152602081018490529081018290527ffcc55d4aea72e6d2d439843942c59b3141c952375a217e381f6a40e0b5ac42199060600160405180910390a1505050565b6033546001600160a01b031633148061158b57506034546001600160a01b031633145b6115d75760405162461bcd60e51b815260206004820181905260248201527f416c6c6f77546f6b656e733a20756e617574686f72697a65642073656e6465726044820152606401610608565b6001600160a01b03919091166000908152603560209081526040918290208351815460ff1916901515178155908301516001820155908201516002820155606090910151600390910155565b600080611630838561233a565b9050838110156110505760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610608565b603a5482106116e55760405162461bcd60e51b815260206004820152602960248201527f416c6c6f77546f6b656e733a20626967676572207468616e20747970654465736044820152686372697074696f6e7360b81b6064820152608401610608565b8051602082015110156117505760405162461bcd60e51b815260206004820152602d60248201527f416c6c6f77546f6b656e733a206d6178546f6b656e7320736d616c6c6572207460448201526c68616e206d696e546f6b656e7360981b6064820152608401610608565b8060200151816040015110156117bf5760405162461bcd60e51b815260206004820152602e60248201527f416c6c6f77546f6b656e733a206461696c794c696d697420736d616c6c65722060448201526d7468616e206d6178546f6b656e7360901b6064820152608401610608565b805160608201511161182d5760405162461bcd60e51b815260206004820152603160248201527f416c6c6f77546f6b656e733a206c696d6974732e6d656469756d416d6f756e746044820152701039b6b0b63632b9103a3430b71036b4b760791b6064820152608401610608565b80606001518160800151116118aa5760405162461bcd60e51b815260206004820152603960248201527f416c6c6f77546f6b656e733a206c696d6974732e6c61726765416d6f756e742060448201527f736d616c6c6572207468616e206d656469756d416d6f756e74000000000000006064820152608401610608565b600082815260366020908152604091829020835181559083015160018201558183015160028201556060830151600382015560808301516004909101555182907f1d2b256bb06ebc298b1980410a5e3b1e9bc4be642e8f26a58dc8a97d7fe2bbbb906119179084906123cd565b60405180910390a25050565b6000808351116119755760405162461bcd60e51b815260206004820152601e60248201527f416c6c6f77546f6b656e733a20456d707479206465736372697074696f6e00006044820152606401610608565b50603a5460fa61198682600161233a565b11156119d45760405162461bcd60e51b815260206004820152601e60248201527f416c6c6f77546f6b656e733a2052656163686564204d41585f545950455300006044820152606401610608565b603a80546001810182556000919091528351611a17917fa2999d817b6757290b50e8ecf3fa939673403dd35c97de392fdb343b4015ce9e01906020860190611b1d565b50611a228183611682565b807fb30844b47136a66c1307afd352145423a1c237692b6ba474578f06f4614b35a084604051611a529190611c13565b60405180910390a292915050565b6001600160a01b038116611ac15760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a206e6577206f776e6572206973207a65726f206164647265604482015261737360f01b6064820152608401610608565b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b828054611b2990612206565b90600052602060002090601f016020900481019282611b4b5760008555611b91565b82601f10611b6457805160ff1916838001178555611b91565b82800160010185558215611b91579182015b82811115611b91578251825591602001919060010190611b76565b506108039291505b808211156108035760008155600101611b99565b600060208284031215611bbf57600080fd5b5035919050565b6000815180845260005b81811015611bec57602081850181015186830182015201611bd0565b81811115611bfe576000602083870101525b50601f01601f19169290920160200192915050565b6020815260006110506020830184611bc6565b80356001600160a01b0381168114611c3d57600080fd5b919050565b600060208284031215611c5457600080fd5b61105082611c26565b6020808252825182820181905260009190848201906040850190845b81811015611cca57611cb783855180518252602081015160208301526040810151604083015260608101516060830152608081015160808301525050565b9284019260a09290920191600101611c79565b50909695505050505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611d2b57603f19888603018452611d19858351611bc6565b94509285019290850190600101611cfd565b5092979650505050505050565b600080600060608486031215611d4d57600080fd5b505081359360208301359350604090920135919050565b60008060408385031215611d7757600080fd5b611d8083611c26565b946020939093013593505050565b82511515815260208084015181830152604080850151818401526060808601518185015284516080808601919091529285015160a08501529084015160c084015283015160e08301528201516101008201526101208101611050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715611e2357611e23611dea565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611e5257611e52611dea565b604052919050565b600060a08284031215611e6c57600080fd5b60405160a0810181811067ffffffffffffffff82111715611e8f57611e8f611dea565b806040525080915082358152602083013560208201526040830135604082015260608301356060820152608083013560808201525092915050565b60008060c08385031215611edd57600080fd5b82359150611eee8460208501611e5a565b90509250929050565b600080600083850360c0811215611f0d57600080fd5b843567ffffffffffffffff80821115611f2557600080fd5b818701915087601f830112611f3957600080fd5b813581811115611f4857600080fd5b886020828501011115611f5a57600080fd5b60209290920195509093505060a0601f1982011215611f7857600080fd5b506020840190509250925092565b60008060008060008060c08789031215611f9f57600080fd5b611fa887611c26565b9550611fb660208801611c26565b945060408701359350606087013592506080870135915067ffffffffffffffff60a08801351115611fe657600080fd5b60a0870135870188601f820112611ffc57600080fd5b67ffffffffffffffff8135111561201557612015611dea565b6120256020823560051b01611e29565b81358082526020808301929160051b8401018b101561204357600080fd5b602083015b6020843560051b8501018110156121535767ffffffffffffffff8135111561206f57600080fd5b8035840160c0818e03601f1901121561208757600080fd5b61208f611e00565b67ffffffffffffffff602083013511156120a857600080fd5b8d603f6020840135840101126120bd57600080fd5b6020808301358301013567ffffffffffffffff8111156120df576120df611dea565b6120f2601f8201601f1916602001611e29565b8181528f604083602087013587010101111561210d57600080fd5b8160406020860135860101602083013760006020838301015280835250506121388e60408401611e5a565b60208201528085525050602083019250602081019050612048565b508093505050509295509295509295565b6000806020838503121561217757600080fd5b823567ffffffffffffffff8082111561218f57600080fd5b818501915085601f8301126121a357600080fd5b8135818111156121b257600080fd5b8660208260061b85010111156121c757600080fd5b60209290920196919550909350505050565b81511515815260208083015190820152604080830151908201526060808301519082015260808101611435565b600181811c9082168061221a57607f821691505b602082108114156113cb57634e487b7160e01b600052602260045260246000fd5b6020808252602c908201527f5365636f6e646172793a2063616c6c6572206973206e6f74207468652070726960408201526b1b585c9e481858d8dbdd5b9d60a21b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156122c7576122c761229d565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526019908201527f416c6c6f77546f6b656e733a204e756c6c204164647265737300000000000000604082015260600190565b6000821982111561234d5761234d61229d565b500190565b60208082526028908201527f436f6e747261637420696e7374616e636520697320616c726561647920696e696040820152671d1a585b1a5e995960c21b606082015260800190565b600060a082840312156123ac57600080fd5b6110508383611e5a565b6000828210156123c8576123c861229d565b500390565b60a0810161143582848051825260208101516020830152604081015160408301526060810151606083015260808101516080830152505056fea2646970667358221220a971cb8bd64a0010543b80b889c22dfe50d292f2fb3e69136eb8ec1d92ee89fd64736f6c63430008090033", + "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": 17666, + "contract": "contracts/AllowTokens/AllowTokensV1.sol:AllowTokensV1", + "label": "initialized", + "offset": 0, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 17669, + "contract": "contracts/AllowTokens/AllowTokensV1.sol:AllowTokensV1", + "label": "initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 17709, + "contract": "contracts/AllowTokens/AllowTokensV1.sol:AllowTokensV1", + "label": "______gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 17955, + "contract": "contracts/AllowTokens/AllowTokensV1.sol:AllowTokensV1", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 18088, + "contract": "contracts/AllowTokens/AllowTokensV1.sol:AllowTokensV1", + "label": "_primary", + "offset": 0, + "slot": "52", + "type": "t_address" + }, + { + "astId": 412, + "contract": "contracts/AllowTokens/AllowTokensV1.sol:AllowTokensV1", + "label": "allowedTokens", + "offset": 0, + "slot": "53", + "type": "t_mapping(t_address,t_struct(TokenInfo)9891_storage)" + }, + { + "astId": 417, + "contract": "contracts/AllowTokens/AllowTokensV1.sol:AllowTokensV1", + "label": "typeLimits", + "offset": 0, + "slot": "54", + "type": "t_mapping(t_uint256,t_struct(Limits)9882_storage)" + }, + { + "astId": 419, + "contract": "contracts/AllowTokens/AllowTokensV1.sol:AllowTokensV1", + "label": "smallAmountConfirmations", + "offset": 0, + "slot": "55", + "type": "t_uint256" + }, + { + "astId": 421, + "contract": "contracts/AllowTokens/AllowTokensV1.sol:AllowTokensV1", + "label": "mediumAmountConfirmations", + "offset": 0, + "slot": "56", + "type": "t_uint256" + }, + { + "astId": 423, + "contract": "contracts/AllowTokens/AllowTokensV1.sol:AllowTokensV1", + "label": "largeAmountConfirmations", + "offset": 0, + "slot": "57", + "type": "t_uint256" + }, + { + "astId": 426, + "contract": "contracts/AllowTokens/AllowTokensV1.sol:AllowTokensV1", + "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)9891_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct IAllowTokens.TokenInfo)", + "numberOfBytes": "32", + "value": "t_struct(TokenInfo)9891_storage" + }, + "t_mapping(t_uint256,t_struct(Limits)9882_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct IAllowTokens.Limits)", + "numberOfBytes": "32", + "value": "t_struct(Limits)9882_storage" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Limits)9882_storage": { + "encoding": "inplace", + "label": "struct IAllowTokens.Limits", + "members": [ + { + "astId": 9873, + "contract": "contracts/AllowTokens/AllowTokensV1.sol:AllowTokensV1", + "label": "min", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 9875, + "contract": "contracts/AllowTokens/AllowTokensV1.sol:AllowTokensV1", + "label": "max", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 9877, + "contract": "contracts/AllowTokens/AllowTokensV1.sol:AllowTokensV1", + "label": "daily", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 9879, + "contract": "contracts/AllowTokens/AllowTokensV1.sol:AllowTokensV1", + "label": "mediumAmount", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 9881, + "contract": "contracts/AllowTokens/AllowTokensV1.sol:AllowTokensV1", + "label": "largeAmount", + "offset": 0, + "slot": "4", + "type": "t_uint256" + } + ], + "numberOfBytes": "160" + }, + "t_struct(TokenInfo)9891_storage": { + "encoding": "inplace", + "label": "struct IAllowTokens.TokenInfo", + "members": [ + { + "astId": 9884, + "contract": "contracts/AllowTokens/AllowTokensV1.sol:AllowTokensV1", + "label": "allowed", + "offset": 0, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 9886, + "contract": "contracts/AllowTokens/AllowTokensV1.sol:AllowTokensV1", + "label": "typeId", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 9888, + "contract": "contracts/AllowTokens/AllowTokensV1.sol:AllowTokensV1", + "label": "spentToday", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 9890, + "contract": "contracts/AllowTokens/AllowTokensV1.sol:AllowTokensV1", + "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/alphanet/BridgeProxy.json b/bridge/deployments/alphanet/BridgeProxy.json new file mode 100644 index 000000000..86fbd4c1d --- /dev/null +++ b/bridge/deployments/alphanet/BridgeProxy.json @@ -0,0 +1,235 @@ +{ + "address": "0xdDd720f6AC69C48B11bae06ca1F852D7920fd58a", + "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": "0x74704bb8ac425b6ac2baf83ef1c223076778b4d25d1a6f771dfb6ce2bf629a7f", + "receipt": { + "to": null, + "from": "0x49A2731C440B0A217f817dB99145Ef5c2e3c9f4E", + "contractAddress": "0xdDd720f6AC69C48B11bae06ca1F852D7920fd58a", + "transactionIndex": 1, + "gasUsed": "959724", + "logsBloom": "0x00000000020004000000000000000000000000000000000000800000000000000000000000000000000000000000002000000010000000000000000000000000004000000080000000000000000000000003000000000001000000000000000000000000020000000000000000000800000010084000000000000000000000400000001000000000000000000000000000000000000000000000000000000000000000000000000000040000000000020000200000800000200001000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000040000000000000000000c00000000000", + "blockHash": "0xc4ec110586eaaffa24ac930b75a1693c35c0d31a4965a548ebb6946459575cb1", + "transactionHash": "0x74704bb8ac425b6ac2baf83ef1c223076778b4d25d1a6f771dfb6ce2bf629a7f", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 103906, + "transactionHash": "0x74704bb8ac425b6ac2baf83ef1c223076778b4d25d1a6f771dfb6ce2bf629a7f", + "address": "0xdDd720f6AC69C48B11bae06ca1F852D7920fd58a", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000e16b04a1a87ac65a4af8d46a8b797d0d46572408" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0xc4ec110586eaaffa24ac930b75a1693c35c0d31a4965a548ebb6946459575cb1" + }, + { + "transactionIndex": 1, + "blockNumber": 103906, + "transactionHash": "0x74704bb8ac425b6ac2baf83ef1c223076778b4d25d1a6f771dfb6ce2bf629a7f", + "address": "0xdDd720f6AC69C48B11bae06ca1F852D7920fd58a", + "topics": [ + "0x6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f8", + "0x000000000000000000000000e16b04a1a87ac65a4af8d46a8b797d0d46572408" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0xc4ec110586eaaffa24ac930b75a1693c35c0d31a4965a548ebb6946459575cb1" + }, + { + "transactionIndex": 1, + "blockNumber": 103906, + "transactionHash": "0x74704bb8ac425b6ac2baf83ef1c223076778b4d25d1a6f771dfb6ce2bf629a7f", + "address": "0xdd343Ef491B9520BB5efFC2A7154B133893840Ea", + "topics": [ + "0x93baa6efbd2244243bfee6ce4cfdd1d04fc4c0e9a786abd3a41313bd352db153", + "0x000000000000000000000000ddd720f6ac69c48b11bae06ca1f852d7920fd58a", + "0xb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b", + "0x000000000000000000000000ddd720f6ac69c48b11bae06ca1f852d7920fd58a" + ], + "data": "0x", + "logIndex": 2, + "blockHash": "0xc4ec110586eaaffa24ac930b75a1693c35c0d31a4965a548ebb6946459575cb1" + } + ], + "blockNumber": 103906, + "cumulativeGasUsed": "995652", + "status": 1, + "byzantium": true + }, + "args": [ + "0x15c240d9Fb91224c0d3Ca9b04Ff63844aA3dF040", + "0x56183c2CCBe444f6217dA6cAF1F8000410542104", + "0x2fb3b361000000000000000000000000e16b04a1a87ac65a4af8d46a8b797d0d4657240800000000000000000000000049a2731c440b0a217f817db99145ef5c2e3c9f4e00000000000000000000000049a2731c440b0a217f817db99145ef5c2e3c9f4e0000000000000000000000008f32871c464e254e1ddb1b8be1444c201a6e656c00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000017200000000000000000000000000000000000000000000000000000000000000" + ], + "numDeployments": 1, + "solcInputHash": "bfc96d5f60348b72136d284c7b5c1536", + "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/alphanet/BridgeV4.json b/bridge/deployments/alphanet/BridgeV4.json new file mode 100644 index 000000000..41e9d7966 --- /dev/null +++ b/bridge/deployments/alphanet/BridgeV4.json @@ -0,0 +1,1744 @@ +{ + "address": "0x15c240d9Fb91224c0d3Ca9b04Ff63844aA3dF040", + "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" + } + ], + "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" + } + ], + "name": "Claimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_tokenAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "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": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "FeeCollectorAddressChanged", + "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" + } + ], + "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": [], + "name": "DOMAIN_SEPARATOR", + "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" + } + ], + "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": "struct IBridgeV4.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": "struct IBridgeV4.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": "struct IBridgeV4.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": [ + { + "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" + } + ], + "name": "createSideToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "depositTo", + "outputs": [], + "stateMutability": "payable", + "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": "getFeeCollectorAddress", + "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": "_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" + } + ], + "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": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "address", + "name": "_federation", + "type": "address" + }, + { + "internalType": "address", + "name": "_allowTokens", + "type": "address" + }, + { + "internalType": "address", + "name": "_sideTokenFactory", + "type": "address" + }, + { + "internalType": "string", + "name": "_symbolPrefix", + "type": "string" + } + ], + "name": "initialize", + "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": [], + "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": "address", + "name": "", + "type": "address" + } + ], + "name": "knownTokens", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "mappedTokens", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "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": "originalTokens", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "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": "address", + "name": "_newAddress", + "type": "address" + } + ], + "name": "setFeeCollectorAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "setFeePercentage", + "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": [], + "name": "sideTokenFactory", + "outputs": [ + { + "internalType": "contract ISideTokenFactory", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbolPrefix", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "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": "0x4bfe6d6ba308bd943d2a4efdc4553d4ecc8963545ce97ec1a281f908d19fe93f", + "receipt": { + "to": null, + "from": "0x49A2731C440B0A217f817dB99145Ef5c2e3c9f4E", + "contractAddress": "0x15c240d9Fb91224c0d3Ca9b04Ff63844aA3dF040", + "transactionIndex": 0, + "gasUsed": "4699372", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xffccf9f7fad5247ed19266438e7e86c83b9dfc9313ea62c2eb16bcb7350f9088", + "transactionHash": "0x4bfe6d6ba308bd943d2a4efdc4553d4ecc8963545ce97ec1a281f908d19fe93f", + "logs": [], + "blockNumber": 103902, + "cumulativeGasUsed": "4699372", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "710a63f3b7163326f2263e80f2d9698b", + "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\"}],\"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\"}],\"name\":\"Claimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_tokenAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"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\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"FeeCollectorAddressChanged\",\"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\"}],\"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\":[],\"name\":\"DOMAIN_SEPARATOR\",\"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\"}],\"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\":\"struct IBridgeV4.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\":\"struct IBridgeV4.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\":\"struct IBridgeV4.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\":[{\"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\"}],\"name\":\"createSideToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"depositTo\",\"outputs\":[],\"stateMutability\":\"payable\",\"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\":\"getFeeCollectorAddress\",\"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\":\"_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\"}],\"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\":[{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_federation\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_allowTokens\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_sideTokenFactory\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_symbolPrefix\",\"type\":\"string\"}],\"name\":\"initialize\",\"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\":[],\"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\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"knownTokens\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"mappedTokens\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"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\":\"originalTokens\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"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\":\"address\",\"name\":\"_newAddress\",\"type\":\"address\"}],\"name\":\"setFeeCollectorAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"setFeePercentage\",\"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\":[],\"name\":\"sideTokenFactory\",\"outputs\":[{\"internalType\":\"contract ISideTokenFactory\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbolPrefix\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"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.\"},\"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)\":{\"notice\":\"Accepts the transaction from the other chain that was voted and sent by the Federation contract\"},\"claim((address,uint256,bytes32,bytes32,uint32))\":{\"notice\":\"Claims the crossed transaction using the hash, this sends the funds to the address indicated in\"},\"depositTo(address)\":{\"notice\":\"Use network currency and cross it.\"},\"receiveTokensTo(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/BridgeV4.sol\":\"BridgeV4\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/Bridge/BridgeV4.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 \\\"./IBridgeV4.sol\\\";\\nimport \\\"../interface/ISideToken.sol\\\";\\nimport \\\"../interface/ISideTokenFactory.sol\\\";\\nimport \\\"../interface/IAllowTokens.sol\\\";\\nimport \\\"../interface/IWrapped.sol\\\";\\n\\n\\ncontract BridgeV4 is Initializable, IBridgeV4, 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(0xdd343Ef491B9520BB5efFC2A7154B133893840Ea);\\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 address private feeCollectorAddress = 0x803c3910f339ee570A3fB9dB8a5A8143d284c5c5;\\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_v4 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 event FeeCollectorAddressChanged(address indexed sender, address oldAddress, address newAddress);\\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 \\\"v4\\\";\\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 function setFeeCollectorAddress(address _newAddress) public onlyOwner {\\n address oldAddress = feeCollectorAddress;\\n feeCollectorAddress = _newAddress;\\n emit FeeCollectorAddressChanged(_msgSender(), oldAddress, _newAddress);\\n }\\n\\n function getFeeCollectorAddress() public view returns(address) {\\n return feeCollectorAddress;\\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(IBridgeV4, 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(payable(feeCollectorAddress), 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}\\n\",\"keccak256\":\"0x0354ecd66574a7b266900f2a77cb04c187d6a80b4fee9fd1a8fde55574d95c1c\",\"license\":\"MIT\"},\"contracts/Bridge/IBridgeV4.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\ninterface IBridgeV4 {\\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}\\n\",\"keccak256\":\"0xa971e6f03a2b99ed5c40b80dcf74967371d82a2526249080dd8c4f3ff55b691d\",\"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/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": "0x6080604052603b80546001600160a01b03191673803c3910f339ee570a3fb9db8a5a8143d284c5c517905534801561003657600080fd5b506143c7806100466000396000f3fe6080604052600436106103385760003560e01c806382dc1ec4116101ab578063b86f60d2116100f7578063e6ede14d11610095578063eb16136f1161006f578063eb16136f14610a7c578063f2fde38b14610a9c578063f74032f014610abc578063fa0caa1614610af257600080fd5b8063e6ede14d14610a12578063e6fc774414610a48578063ea21709114610a5e57600080fd5b8063ca07140c116100d1578063ca07140c14610968578063cc3c0f061461099e578063d12e825d146109ce578063da677037146109e357600080fd5b8063b86f60d21461090a578063bf2d75fb1461092a578063c4d66de81461094857600080fd5b8063adc5fb6411610164578063b0e1268e1161013e578063b0e1268e14610896578063b50277bb146108b6578063b760faf9146108d6578063b7947262146108e957600080fd5b8063adc5fb6414610836578063ae06c1b714610856578063afad80ac1461087657600080fd5b806382dc1ec4146107785780638456cb59146107985780638da5cb5b146107ad5780638f32d59b146107d0578063916dc59d146107f6578063a53d6e6e1461081657600080fd5b806346fbf68e116102855780636b0509b1116102235780637813bea2116101fd5780637813bea2146106f65780637d6ba5b3146107165780637ecebe00146107365780638129fc1c1461076357600080fd5b80636b0509b1146106985780636ef8d66d146106cc578063715018a6146106e157600080fd5b806359a8a8671161025f57806359a8a8671461061b5780635c975abb146106305780635d447129146106485780636a8631911461067857600080fd5b806346fbf68e146105a75780634beea506146105c757806354fd4d50146105e757600080fd5b80632fb3b361116102f257806337e76109116102cc57806337e76109146104d75780633cf3058b146105245780633f4ba83a1461057257806342cdb2c61461058757600080fd5b80632fb3b361146104815780633500c1dc146104a15780633644e515146104c157600080fd5b806223de29146103ac57806302697619146103cc57806307c8f7b01461040c57806311efbf611461042c57806320e3bb00146104415780632f3cca4e1461046157600080fd5b366103a7576042546001600160a01b0316336001600160a01b0316146103a55760405162461bcd60e51b815260206004820152601b60248201527f4272696467653a206e6f74207772617070656443757272656e6379000000000060448201526064015b60405180910390fd5b005b600080fd5b3480156103b857600080fd5b506103a56103c73660046138e5565b610b12565b3480156103d857600080fd5b506103f96103e7366004613996565b60436020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561041857600080fd5b506103a56104273660046139bd565b610da4565b34801561043857600080fd5b506037546103f9565b34801561044d57600080fd5b506103a561045c3660046139f0565b610e35565b34801561046d57600080fd5b506103a561047c366004613a8d565b6110d1565b34801561048d57600080fd5b506103a561049c366004613af1565b611151565b3480156104ad57600080fd5b506103a56104bc366004613a8d565b6112b8565b3480156104cd57600080fd5b506103f960395481565b3480156104e357600080fd5b506105146104f2366004613996565b6000908152604360209081526040808320548352603f90915290205460ff1690565b6040519015158152602001610403565b34801561053057600080fd5b5061055a61053f366004613996565b6045602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610403565b34801561057e57600080fd5b506103a561138a565b34801561059357600080fd5b506103a56105a2366004613a8d565b611442565b3480156105b357600080fd5b506105146105c2366004613a8d565b611525565b3480156105d357600080fd5b506103f96105e2366004613be9565b611538565b3480156105f357600080fd5b506040805180820190915260028152611d8d60f21b60208201525b6040516104039190613cb2565b34801561062757600080fd5b5061060e6116b3565b34801561063c57600080fd5b5060345460ff16610514565b34801561065457600080fd5b50610514610663366004613a8d565b603e6020526000908152604090205460ff1681565b34801561068457600080fd5b506103a5610693366004613cd9565b611741565b3480156106a457600080fd5b506103f97ff18ceda3f6355f78c234feba066041a50f6557bfb600201e2a71a89e2dd8043381565b3480156106d857600080fd5b506103a5611af9565b3480156106ed57600080fd5b506103a5611b04565b34801561070257600080fd5b506103a5610711366004613d50565b611b89565b34801561072257600080fd5b506103a5610731366004613a8d565b611bc1565b34801561074257600080fd5b506103f9610751366004613a8d565b60466020526000908152604090205481565b34801561076f57600080fd5b506103a5611c69565b34801561078457600080fd5b506103a5610793366004613a8d565b611cda565b3480156107a457600080fd5b506103a5611d08565b3480156107b957600080fd5b5060345461010090046001600160a01b031661055a565b3480156107dc57600080fd5b5061051460345461010090046001600160a01b0316331490565b34801561080257600080fd5b506103a5610811366004613a8d565b611d85565b34801561082257600080fd5b5060405461055a906001600160a01b031681565b34801561084257600080fd5b506103f9610851366004613d91565b611e5c565b34801561086257600080fd5b506103a5610871366004613996565b611ed7565b34801561088257600080fd5b506103f9610891366004613dad565b611f9c565b3480156108a257600080fd5b5060425461055a906001600160a01b031681565b3480156108c257600080fd5b506103f96108d1366004613d91565b612007565b6103a56108e4366004613a8d565b61201a565b3480156108f557600080fd5b5060415461051490600160a01b900460ff1681565b34801561091657600080fd5b5060415461055a906001600160a01b031681565b34801561093657600080fd5b50603b546001600160a01b031661055a565b34801561095457600080fd5b506103a5610963366004613a8d565b61210e565b34801561097457600080fd5b5061055a610983366004613996565b6044602052600090815260409020546001600160a01b031681565b3480156109aa57600080fd5b506105146109b9366004613996565b603f6020526000908152604090205460ff1681565b3480156109da57600080fd5b506103a56121d0565b3480156109ef57600080fd5b506105146109fe366004613996565b600090815260436020526040902054151590565b348015610a1e57600080fd5b5061055a610a2d366004613a8d565b603c602052600090815260409020546001600160a01b031681565b348015610a5457600080fd5b506103f961271081565b348015610a6a57600080fd5b506036546001600160a01b031661055a565b348015610a8857600080fd5b506103a5610a97366004613a8d565b612277565b348015610aa857600080fd5b506103a5610ab7366004613a8d565b6122f9565b348015610ac857600080fd5b5061055a610ad7366004613a8d565b603d602052600090815260409020546001600160a01b031681565b348015610afe57600080fd5b506103a5610b0d366004613a8d565b612337565b6001600160a01b038816301415610b2857610d9a565b6001600160a01b0386163014610b805760405162461bcd60e51b815260206004820152601b60248201527f4272696467653a204e6f7420746f207468697320616464726573730000000000604482015260640161039c565b60003360405163555ddc6560e11b81526001600160a01b03821660048201527fac7fbab5f54a3ca8194167523c6753bfeb96a445279294b6125b68cce2177054602482015290915060009073dd343ef491b9520bb5effc2a7154b133893840ea9063aabbb8ca9060440160206040518083038186803b158015610c0257600080fd5b505afa158015610c16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3a9190613dff565b6001600160a01b03161415610c915760405162461bcd60e51b815260206004820152601860248201527f4272696467653a204e6f742045524337373720746f6b656e0000000000000000604482015260640161039c565b83151580610ca757506001600160a01b0388163b155b610d045760405162461bcd60e51b815260206004820152602860248201527f4272696467653a2053706563696679207265636569766572206164647265737360448201526720696e206461746160c01b606482015260840161039c565b60008415610d5057610d4b86868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061241092505050565b610d52565b885b9050610d97828a838a8a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061241792505050565b50505b5050505050505050565b610dbd60345461010090046001600160a01b0316331490565b610dd95760405162461bcd60e51b815260040161039c90613e1c565b6041805460ff60a01b1916600160a01b8315158102919091179182905560405160ff9190920416151581527f983e436223c000a441c2443b394ca5fb4669a513fe86dc1dd44494047b514ad9906020015b60405180910390a150565b610e4e60345461010090046001600160a01b0316331490565b610e6a5760405162461bcd60e51b815260040161039c90613e1c565b6001600160a01b038616610eb55760405162461bcd60e51b8152602060048201526012602482015271213934b233b29d10273ab636103a37b5b2b760711b604482015260640161039c565b6001600160a01b038087166000908152603c6020526040902054168015610f175760405162461bcd60e51b81526020600482015260166024820152754272696467653a20416c72656164792065786973747360501b604482015260640161039c565b6000610f2287612707565b9050600060388787604051602001610f3c93929190613e95565b60408051601f19818403018152908290526041546326d9e96360e01b83529092506001600160a01b0316906326d9e96390610f81908890889086908890600401613f3e565b602060405180830381600087803b158015610f9b57600080fd5b505af1158015610faf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd39190613dff565b6001600160a01b038a81166000818152603c6020908152604080832080548787166001600160a01b03199182168117909255818552603d9093529281902080549092169093179055815491516378bf2b5360e01b81526004810191909152602481018e905292955016906378bf2b5390604401600060405180830381600087803b15801561106057600080fd5b505af1158015611074573d6000803e3d6000fd5b50505050886001600160a01b0316836001600160a01b03167f2ef93c4e96a4ef0b19497ff60c9e7360a8734f3d2cd27ae5318e43851734d17f83856040516110bd929190613f8e565b60405180910390a350505050505050505050565b600054610100900460ff16806110ea575060005460ff16155b6111065760405162461bcd60e51b815260040161039c90613fb0565b600054610100900460ff16158015611128576000805461ffff19166101011790555b61113182612277565b6034805460ff19169055801561114d576000805461ff00191690555b5050565b600054610100900460ff168061116a575060005460ff16155b6111865760405162461bcd60e51b815260040161039c90613fb0565b600054610100900460ff161580156111a8576000805461ffff19166101011790555b6111b18661210e565b6111ba866110d1565b81516111cd9060389060208501906137ee565b50604080546001600160a01b038681166001600160a01b0319928316178355604180548783169084161790556036805491891691909216179055516329965a1d60e01b815230600482018190527fb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b6024830152604482015273dd343ef491b9520bb5effc2a7154b133893840ea906329965a1d90606401600060405180830381600087803b15801561127e57600080fd5b505af1158015611292573d6000803e3d6000fd5b5050505061129e6121d0565b80156112b0576000805461ff00191690555b505050505050565b6112d160345461010090046001600160a01b0316331490565b6112ed5760405162461bcd60e51b815260040161039c90613e1c565b6001600160a01b03811661133c5760405162461bcd60e51b81526020600482015260166024820152754272696467653a20777261707020697320656d70747960501b604482015260640161039c565b604280546001600160a01b0319166001600160a01b0383169081179091556040519081527f0966c958966f6fac9ff807af074f8117eb2e9ce2b76390db7a158e9bdeb2485c90602001610e2a565b61139333611525565b6113af5760405162461bcd60e51b815260040161039c90613ff8565b60345460ff166113f85760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161039c565b6034805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b61145b60345461010090046001600160a01b0316331490565b6114775760405162461bcd60e51b815260040161039c90613e1c565b6001600160a01b0381166114d75760405162461bcd60e51b815260206004820152602160248201527f4272696467653a2053696465546f6b656e466163746f727920697320656d70746044820152607960f81b606482015260840161039c565b604180546001600160a01b0319166001600160a01b0383169081179091556040519081527f619936bc6e3618d0b8dc69bcc70134fe9d88f9967f3a8b8304e318369252162590602001610e2a565b6000611532603383612773565b92915050565b60004285101561157c5760405162461bcd60e51b815260206004820152600f60248201526e109c9a5919d94e8811561412549151608a1b604482015260640161039c565b6000611598611590368b90038b018b614040565b8989896127f6565b6040805160008082526020820180845284905260ff89169282019290925260608101879052608081018690529192509060019060a0016020604051602081039080840390855afa1580156115f0573d6000803e3d6000fd5b5050604051601f19015191506000905061160d60208c018c613a8d565b6001600160a01b031614158015611641575061162c60208b018b613a8d565b6001600160a01b0316816001600160a01b0316145b61168d5760405162461bcd60e51b815260206004820152601960248201527f4272696467653a20494e56414c49445f5349474e415455524500000000000000604482015260640161039c565b6116a58a61169e6020820182613a8d565b8b8b6128ea565b9a9950505050505050505050565b603880546116c090613e51565b80601f01602080910402602001604051908101604052809291908181526020018280546116ec90613e51565b80156117395780601f1061170e57610100808354040283529160200191611739565b820191906000526020600020905b81548152906001019060200180831161171c57829003601f168201915b505050505081565b60345460ff16156117645760405162461bcd60e51b815260040161039c906140bd565b60016035600082825461177791906140fd565b90915550506035546036546001600160a01b0316336001600160a01b0316146117db5760405162461bcd60e51b8152602060048201526016602482015275213934b233b29d102737ba102332b232b930ba34b7b760511b604482015260640161039c565b6001600160a01b0388166000908152603e602052604090205460ff168061181b57506001600160a01b038881166000908152603c60205260409020541615155b61185f5760405162461bcd60e51b8152602060048201526015602482015274213934b233b29d102ab735b737bbb7103a37b5b2b760591b604482015260640161039c565b6001600160a01b0386166118a75760405162461bcd60e51b815260206004820152600f60248201526e4272696467653a204e756c6c20546f60881b604482015260640161039c565b600085116118ea5760405162461bcd60e51b815260206004820152601060248201526f04272696467653a20416d6f756e7420360841b604482015260640161039c565b836119305760405162461bcd60e51b8152602060048201526016602482015275084e4d2c8ceca74409cead8d84084d8dec6d690c2e6d60531b604482015260640161039c565b826119735760405162461bcd60e51b8152602060048201526013602482015272084e4d2c8ceca74409cead8d840a8f090c2e6d606b1b604482015260640161039c565b600083815260436020526040902054156119cf5760405162461bcd60e51b815260206004820152601860248201527f4272696467653a20416c72656164792061636365707465640000000000000000604482015260640161039c565b60006119de8787878787611f9c565b6000818152603f602052604090205490915060ff1615611a3a5760405162461bcd60e51b8152602060048201526017602482015276109c9a5919d94e88105b1c9958591e4818db185a5b5959604a1b604482015260640161039c565b60008481526043602090815260408083208490556044825280832080546001600160a01b038e81166001600160a01b03199283168117909355604585529483902080548e871692168217905582519081529283018a905290820188905263ffffffff86166060830152918916919086907f2858b8803acb87882fd2de49ce7572ae3e741fb8073cbe772fa50ce00bdfba229060800160405180910390a4506035548114610d9a5760405162461bcd60e51b815260040161039c90614115565b611b0233612bcd565b565b611b1d60345461010090046001600160a01b0316331490565b611b395760405162461bcd60e51b815260040161039c90613e1c565b60345460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360348054610100600160a81b0319169055565b33611b9f6001600160a01b038516823085612c0f565b611bbb8482858560405180602001604052806000815250612417565b50505050565b611bda60345461010090046001600160a01b0316331490565b611bf65760405162461bcd60e51b815260040161039c90613e1c565b603b80546001600160a01b038381166001600160a01b031983161790925516611c1c3390565b604080516001600160a01b038481168252858116602083015292909216917fac04bdb273a7954b7742ad0ab311fdd70a13eec4b7e625f7119fd21c21c430a4910160405180910390a25050565b600054610100900460ff1680611c82575060005460ff16155b611c9e5760405162461bcd60e51b815260040161039c90613fb0565b600054610100900460ff16158015611cc0576000805461ffff19166101011790555b60016035558015611cd7576000805461ff00191690555b50565b611ce333611525565b611cff5760405162461bcd60e51b815260040161039c90613ff8565b611cd781612c7a565b611d1133611525565b611d2d5760405162461bcd60e51b815260040161039c90613ff8565b60345460ff1615611d505760405162461bcd60e51b815260040161039c906140bd565b6034805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586114253390565b611d9e60345461010090046001600160a01b0316331490565b611dba5760405162461bcd60e51b815260040161039c90613e1c565b6001600160a01b038116611e105760405162461bcd60e51b815260206004820152601c60248201527f4272696467653a20416c6c6f77546f6b656e7320697320656d70747900000000604482015260640161039c565b604080546001600160a01b0319166001600160a01b038316908117825590519081527f5f2c1fe803fd576d8af05ea156011cc9cc8c025bda24c1e85772fc05a0b3f1e390602001610e2a565b60608101356000908152604560205260408120546001600160a01b0316336001600160a01b031614611ec95760405162461bcd60e51b8152602060048201526016602482015275213934b233b29d1034b73b30b634b21039b2b73232b960511b604482015260640161039c565b61153282335b6000806128ea565b611ef060345461010090046001600160a01b0316331490565b611f0c5760405162461bcd60e51b815260040161039c90613e1c565b611f19600a612710614170565b8110611f675760405162461bcd60e51b815260206004820152601760248201527f4272696467653a20626967676572207468616e20313025000000000000000000604482015260640161039c565b60378190556040518181527f97e97c577f03bda90e2c9739011ec065ed5fbfb36ae217d20bb0d9be95e160cd90602001610e2a565b6040805160208101859052908101839052606086811b6bffffffffffffffffffffffff1916908201526074810185905260e082901b6001600160e01b031916609482015260009060980160405160208183030381529060405280519060200120905095945050505050565b600061153282611ecf6020820182613a8d565b60425433906001600160a01b03166120745760405162461bcd60e51b815260206004820152601d60248201527f4272696467653a207772617070656443757272656e637920656d707479000000604482015260640161039c565b604260009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156120c457600080fd5b505af11580156120d8573d6000803e3d6000fd5b505050505061114d604260009054906101000a90046001600160a01b031682843460405180602001604052806000815250612417565b600054610100900460ff1680612127575060005460ff16155b6121435760405162461bcd60e51b815260040161039c90613fb0565b600054610100900460ff16158015612165576000805461ffff19166101011790555b60348054610100600160a81b0319166101006001600160a01b0385811682029290921792839055604051920416906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3801561114d576000805461ff00191690555050565b604080518082018252601081526f52534b20546f6b656e2042726964676560801b60208083019182528351808501855260018152603160f81b908201529151902082517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8152918201527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc69181019190915246606082015230608082015260a09020603955565b600054610100900460ff1680612290575060005460ff16155b6122ac5760405162461bcd60e51b815260040161039c90613fb0565b600054610100900460ff161580156122ce576000805461ffff19166101011790555b6122d782611525565b6122e4576122e482612c7a565b801561114d576000805461ff00191690555050565b61231260345461010090046001600160a01b0316331490565b61232e5760405162461bcd60e51b815260040161039c90613e1c565b611cd781612cbc565b61235060345461010090046001600160a01b0316331490565b61236c5760405162461bcd60e51b815260040161039c90613e1c565b6001600160a01b0381166123c25760405162461bcd60e51b815260206004820152601b60248201527f4272696467653a2046656465726174696f6e20697320656d7074790000000000604482015260640161039c565b603680546001600160a01b0319166001600160a01b0383169081179091556040519081527f4a41a4d11aaf0c0c9e4311ac1d68b2b0134556da594779a2a35b0ddf7cd1eafb90602001610e2a565b6014015190565b604154600160a01b900460ff16156124655760405162461bcd60e51b81526020600482015260116024820152704272696467653a20557067726164696e6760781b604482015260640161039c565b60345460ff16156124885760405162461bcd60e51b815260040161039c906140bd565b60016035600082825461249b91906140fd565b90915550506035546001600160a01b0386166000908152603e60205260408120805460ff191660011790556037546124e290612710906124dc908790612d84565b90612e0a565b905060006124f08583612e4c565b905060006124fd89612e8e565b905085601260ff83161461252e5761252b612519836012614184565b61252490600a61428b565b8890612d84565b90505b604080549051638c34bc5560e01b81526001600160a01b038c811660048301526024820184905290911690638c34bc5590604401600060405180830381600087803b15801561257c57600080fd5b505af1158015612590573d6000803e3d6000fd5b5050506001600160a01b03808c166000908152603d60205260409020548c9250161561266a57506001600160a01b03808b166000908152603d6020526040812054909116906125de8c612f7a565b905060006125ec8683613052565b90506125f88782613094565b96506126048682612e4c565b60405163fe9d930360e01b81529096506001600160a01b038e169063fe9d9303906126359089908d9060040161429a565b600060405180830381600087803b15801561264f57600080fd5b505af1158015612663573d6000803e3d6000fd5b5050505050505b886001600160a01b03168a6001600160a01b0316826001600160a01b03167f1e90de9ae4d02420648a650f45f089a1be18fbca324092544ea626f9833212b0878b6040516126b992919061429a565b60405180910390a484156126e157603b546126e1906001600160a01b038d81169116876130f3565b505050505060355481146112b05760405162461bcd60e51b815260040161039c90614115565b600060128260ff16111561275d5760405162461bcd60e51b815260206004820152601c60248201527f4c69625574696c733a20446563696d616c73206e6f74203c3d20313800000000604482015260640161039c565b612768826012614184565b61153290600a61428b565b60006001600160a01b0382166127d65760405162461bcd60e51b815260206004820152602260248201527f526f6c65733a206163636f756e7420697320746865207a65726f206164647265604482015261737360f01b606482015260840161039c565b506001600160a01b03166000908152602091909152604090205460ff1690565b603954845160208087015160608801516001600160a01b0384166000908152604690935260408320805493956128e19590947ff18ceda3f6355f78c234feba066041a50f6557bfb600201e2a71a89e2dd8043394919391928b918b918a61285c836142b3565b909155506040805160208101989098526001600160a01b03968716908801526060870194909452608086019290925290921660a084015260c083019190915260e08201526101008101859052610120016040516020818303038152906040528051906020012060405161190160f01b8152600281019290925260228201526042902090565b95945050505050565b60006001603560008282546128ff91906140fd565b909155505060355460608601356000908152604460205260409020546001600160a01b03168061296a5760405162461bcd60e51b8152602060048201526016602482015275109c9a5919d94e88151e081b9bdd0818dc9bdcdcd95960521b604482015260640161039c565b600061299b61297c60208a018a613a8d565b60208a013560408b013560608c013561089160a08e0160808f016142ce565b60608901356000908152604360205260409020549091508114612a0a5760405162461bcd60e51b815260206004820152602160248201527f4272696467653a2057726f6e67207472616e73616374696f6e446174614861736044820152600d60fb1b606482015260840161039c565b6000818152603f602052604090205460ff1615612a635760405162461bcd60e51b8152602060048201526017602482015276109c9a5919d94e88105b1c9958591e4818db185a5b5959604a1b604482015260640161039c565b6000818152603f60209081526040808320805460ff191660011790556001600160a01b0385168352603e90915290205460ff1615612ab357612aac82888a602001358989613128565b9350612ac7565b612ac482888a6020013589896132d8565b93505b612ad46020890189613a8d565b6001600160a01b0316826001600160a01b031689606001357f42b1cb6263e8da47edf0583516eda1de16f729d26282f5791dc5b7af1010e925604560008d60600135815260200190815260200160002060009054906101000a90046001600160a01b03168c602001358d604001358e6080016020810190612b5591906142ce565b604080516001600160a01b039586168152602081019490945283019190915263ffffffff166060820152818d166080820152908b1660a082015260c081018a905260e00160405180910390a450506035548114612bc45760405162461bcd60e51b815260040161039c90614115565b50949350505050565b612bd86033826134ef565b6040516001600160a01b038216907fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e90600090a250565b6040516001600160a01b0380851660248301528316604482015260648101829052611bbb9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613567565b612c856033826136e7565b6040516001600160a01b038216907f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f890600090a250565b6001600160a01b038116612d1d5760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a206e6577206f776e6572206973207a65726f206164647265604482015261737360f01b606482015260840161039c565b6034546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603480546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b600082612d9357506000611532565b6000612d9f83856142e9565b905082612dac8583614170565b14612e035760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161039c565b9392505050565b6000612e0383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613763565b6000612e0383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613791565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b1790529051600091829182916001600160a01b03861691612ed49190614308565b600060405180830381855afa9150503d8060008114612f0f576040519150601f19603f3d011682016040523d82523d6000602084013e612f14565b606091505b509150915081612f5e5760405162461bcd60e51b81526020600482015260156024820152744c69625574696c733a204e6f20646563696d616c7360581b604482015260640161039c565b80806020019051810190612f729190614324565b949350505050565b60408051600481526024810182526020810180516001600160e01b031663556f0dc760e01b1790529051600091829182916001600160a01b03861691612fc09190614308565b600060405180830381855afa9150503d8060008114612ffb576040519150601f19603f3d011682016040523d82523d6000602084013e613000565b606091505b509150915081612f5e5760405162461bcd60e51b815260206004820152601860248201527f4c69625574696c733a204e6f206772616e756c61726974790000000000000000604482015260640161039c565b6000612e0383836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f00000000000000008152506137c2565b6000806130a183856140fd565b905083811015612e035760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161039c565b6040516001600160a01b03831660248201526044810182905261312390849063a9059cbb60e01b90606401612c43565b505050565b60008061313487612e8e565b60ff169050600061315b61314983601261433d565b61315490600a614354565b8790612e0a565b9050808411156131a45760405162461bcd60e51b8152602060048201526014602482015273084e4d2c8ceca7440cccaca40e8dede40d0d2ced60631b604482015260640161039c565b6131ae848261433d565b6042549093506001600160a01b038981169116141561329f57604254604051632e1a7d4d60e01b8152600481018390526001600160a01b0390911690632e1a7d4d90602401600060405180830381600087803b15801561320d57600080fd5b505af1158015613221573d6000803e3d6000fd5b50506040516001600160a01b038a16925085156108fc02915085906000818181858888f1935050505015801561325b573d6000803e3d6000fd5b50831561329a576040516001600160a01b0386169085156108fc029086906000818181858888f19350505050158015613298573d6000803e3d6000fd5b505b6132cd565b6132b36001600160a01b03891688856130f3565b83156132cd576132cd6001600160a01b03891686866130f3565b505095945050505050565b6001600160a01b038086166000908152603c6020908152604080832054815163556f0dc760e01b81529151939416928492849263556f0dc79260048083019392829003018186803b15801561332c57600080fd5b505afa158015613340573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133649190614324565b905060006133728783612d84565b9050808511156133bb5760405162461bcd60e51b8152602060048201526014602482015273084e4d2c8ceca7440cccaca40e8dede40d0d2ced60631b604482015260640161039c565b6133c5858261433d565b604051630dcdc7dd60e41b81526001600160a01b038a81166004830152602482018390526080604483015260006084830181905260a0606484015260a48301529195509084169063dcdc7dd09060c401600060405180830381600087803b15801561342f57600080fd5b505af1158015613443573d6000803e3d6000fd5b5050505060008511156134e357604051630dcdc7dd60e41b81526001600160a01b03878116600483015260248201879052608060448301526000608483015260a06064830152600b60a48301526a72656c617965722066656560a81b60c483015284169063dcdc7dd09060e401600060405180830381600087803b1580156134ca57600080fd5b505af11580156134de573d6000803e3d6000fd5b505050505b50505095945050505050565b6134f98282612773565b6135455760405162461bcd60e51b815260206004820181905260248201527f526f6c65733a206163636f756e7420646f65736e2774206861766520726f6c65604482015260640161039c565b6001600160a01b0316600090815260209190915260409020805460ff19169055565b6001600160a01b0382163b6135be5760405162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015260640161039c565b600080836001600160a01b0316836040516135d99190614308565b6000604051808303816000865af19150503d8060008114613616576040519150601f19603f3d011682016040523d82523d6000602084013e61361b565b606091505b50915091508161366d5760405162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015260640161039c565b805115611bbb57808060200190518101906136889190614360565b611bbb5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161039c565b6136f18282612773565b1561373e5760405162461bcd60e51b815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015260640161039c565b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b600081836137845760405162461bcd60e51b815260040161039c9190613cb2565b5060006128e18486614170565b600081848411156137b55760405162461bcd60e51b815260040161039c9190613cb2565b5060006128e1848661433d565b600081836137e35760405162461bcd60e51b815260040161039c9190613cb2565b50612f72838561437d565b8280546137fa90613e51565b90600052602060002090601f01602090048101928261381c5760008555613862565b82601f1061383557805160ff1916838001178555613862565b82800160010185558215613862579182015b82811115613862578251825591602001919060010190613847565b5061386e929150613872565b5090565b5b8082111561386e5760008155600101613873565b6001600160a01b0381168114611cd757600080fd5b60008083601f8401126138ae57600080fd5b50813567ffffffffffffffff8111156138c657600080fd5b6020830191508360208285010111156138de57600080fd5b9250929050565b60008060008060008060008060c0898b03121561390157600080fd5b883561390c81613887565b9750602089013561391c81613887565b9650604089013561392c81613887565b955060608901359450608089013567ffffffffffffffff8082111561395057600080fd5b61395c8c838d0161389c565b909650945060a08b013591508082111561397557600080fd5b506139828b828c0161389c565b999c989b5096995094979396929594505050565b6000602082840312156139a857600080fd5b5035919050565b8015158114611cd757600080fd5b6000602082840312156139cf57600080fd5b8135612e03816139af565b803560ff811681146139eb57600080fd5b919050565b600080600080600080600060a0888a031215613a0b57600080fd5b873596506020880135613a1d81613887565b9550613a2b604089016139da565b9450606088013567ffffffffffffffff80821115613a4857600080fd5b613a548b838c0161389c565b909650945060808a0135915080821115613a6d57600080fd5b50613a7a8a828b0161389c565b989b979a50959850939692959293505050565b600060208284031215613a9f57600080fd5b8135612e0381613887565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613ae957613ae9613aaa565b604052919050565b600080600080600060a08688031215613b0957600080fd5b8535613b1481613887565b9450602086810135613b2581613887565b94506040870135613b3581613887565b93506060870135613b4581613887565b9250608087013567ffffffffffffffff80821115613b6257600080fd5b818901915089601f830112613b7657600080fd5b813581811115613b8857613b88613aaa565b613b9a601f8201601f19168501613ac0565b91508082528a84828501011115613bb057600080fd5b80848401858401376000848284010152508093505050509295509295909350565b600060a08284031215613be357600080fd5b50919050565b6000806000806000806000610160888a031215613c0557600080fd5b613c0f8989613bd1565b965060a0880135613c1f81613887565b955060c0880135945060e08801359350613c3c61010089016139da565b92506101208801359150610140880135905092959891949750929550565b60005b83811015613c75578181015183820152602001613c5d565b83811115611bbb5750506000910152565b60008151808452613c9e816020860160208601613c5a565b601f01601f19169290920160200192915050565b602081526000612e036020830184613c86565b803563ffffffff811681146139eb57600080fd5b600080600080600080600060e0888a031215613cf457600080fd5b8735613cff81613887565b96506020880135613d0f81613887565b95506040880135613d1f81613887565b9450606088013593506080880135925060a08801359150613d4260c08901613cc5565b905092959891949750929550565b600080600060608486031215613d6557600080fd5b8335613d7081613887565b92506020840135613d8081613887565b929592945050506040919091013590565b600060a08284031215613da357600080fd5b612e038383613bd1565b600080600080600060a08688031215613dc557600080fd5b8535613dd081613887565b9450602086013593506040860135925060608601359150613df360808701613cc5565b90509295509295909350565b600060208284031215613e1157600080fd5b8151612e0381613887565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c90821680613e6557607f821691505b60208210811415613be357634e487b7160e01b600052602260045260246000fd5b81818437506000910190815290565b600080855481600182811c915080831680613eb157607f831692505b6020808410821415613ed157634e487b7160e01b86526022600452602486fd5b818015613ee55760018114613ef657613f23565b60ff19861689528489019650613f23565b60008c81526020902060005b86811015613f1b5781548b820152908501908301613f02565b505084890196505b505050505050613f34818587613e86565b9695505050505050565b60608152836060820152838560808301376000608085830101526000601f19601f86011682016080838203016020840152613f7c6080820186613c86565b91505082604083015295945050505050565b604081526000613fa16040830185613c86565b90508260208301529392505050565b60208082526028908201527f436f6e747261637420696e7374616e636520697320616c726561647920696e696040820152671d1a585b1a5e995960c21b606082015260800190565b60208082526028908201527f506175736572526f6c653a2063616c6c657220646f65736e277420686176652060408201526774686520726f6c6560c01b606082015260800190565b600060a0828403121561405257600080fd5b60405160a0810181811067ffffffffffffffff8211171561407557614075613aaa565b604052823561408381613887565b808252506020830135602082015260408301356040820152606083013560608201526140b160808401613cc5565b60808201529392505050565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008219821115614110576141106140e7565b500190565b60208082526025908201527f5265656e7472616e637947756172643a206e6f207265656e7472616e7420616c6040820152641b1bddd95960da1b606082015260800190565b634e487b7160e01b600052601260045260246000fd5b60008261417f5761417f61415a565b500490565b600060ff821660ff84168082101561419e5761419e6140e7565b90039392505050565b600181815b808511156141e25781600019048211156141c8576141c86140e7565b808516156141d557918102915b93841c93908002906141ac565b509250929050565b6000826141f957506001611532565b8161420657506000611532565b816001811461421c576002811461422657614242565b6001915050611532565b60ff841115614237576142376140e7565b50506001821b611532565b5060208310610133831016604e8410600b8410161715614265575081810a611532565b61426f83836141a7565b8060001904821115614283576142836140e7565b029392505050565b6000612e0360ff8416836141ea565b828152604060208201526000612f726040830184613c86565b60006000198214156142c7576142c76140e7565b5060010190565b6000602082840312156142e057600080fd5b612e0382613cc5565b6000816000190483118215151615614303576143036140e7565b500290565b6000825161431a818460208701613c5a565b9190910192915050565b60006020828403121561433657600080fd5b5051919050565b60008282101561434f5761434f6140e7565b500390565b6000612e0383836141ea565b60006020828403121561437257600080fd5b8151612e03816139af565b60008261438c5761438c61415a565b50069056fea26469706673582212208ce049f3a18245b27fbdfc5d5fce142efcb6f858f2f85701f5cddfac65e050ae64736f6c63430008090033", + "deployedBytecode": "0x6080604052600436106103385760003560e01c806382dc1ec4116101ab578063b86f60d2116100f7578063e6ede14d11610095578063eb16136f1161006f578063eb16136f14610a7c578063f2fde38b14610a9c578063f74032f014610abc578063fa0caa1614610af257600080fd5b8063e6ede14d14610a12578063e6fc774414610a48578063ea21709114610a5e57600080fd5b8063ca07140c116100d1578063ca07140c14610968578063cc3c0f061461099e578063d12e825d146109ce578063da677037146109e357600080fd5b8063b86f60d21461090a578063bf2d75fb1461092a578063c4d66de81461094857600080fd5b8063adc5fb6411610164578063b0e1268e1161013e578063b0e1268e14610896578063b50277bb146108b6578063b760faf9146108d6578063b7947262146108e957600080fd5b8063adc5fb6414610836578063ae06c1b714610856578063afad80ac1461087657600080fd5b806382dc1ec4146107785780638456cb59146107985780638da5cb5b146107ad5780638f32d59b146107d0578063916dc59d146107f6578063a53d6e6e1461081657600080fd5b806346fbf68e116102855780636b0509b1116102235780637813bea2116101fd5780637813bea2146106f65780637d6ba5b3146107165780637ecebe00146107365780638129fc1c1461076357600080fd5b80636b0509b1146106985780636ef8d66d146106cc578063715018a6146106e157600080fd5b806359a8a8671161025f57806359a8a8671461061b5780635c975abb146106305780635d447129146106485780636a8631911461067857600080fd5b806346fbf68e146105a75780634beea506146105c757806354fd4d50146105e757600080fd5b80632fb3b361116102f257806337e76109116102cc57806337e76109146104d75780633cf3058b146105245780633f4ba83a1461057257806342cdb2c61461058757600080fd5b80632fb3b361146104815780633500c1dc146104a15780633644e515146104c157600080fd5b806223de29146103ac57806302697619146103cc57806307c8f7b01461040c57806311efbf611461042c57806320e3bb00146104415780632f3cca4e1461046157600080fd5b366103a7576042546001600160a01b0316336001600160a01b0316146103a55760405162461bcd60e51b815260206004820152601b60248201527f4272696467653a206e6f74207772617070656443757272656e6379000000000060448201526064015b60405180910390fd5b005b600080fd5b3480156103b857600080fd5b506103a56103c73660046138e5565b610b12565b3480156103d857600080fd5b506103f96103e7366004613996565b60436020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561041857600080fd5b506103a56104273660046139bd565b610da4565b34801561043857600080fd5b506037546103f9565b34801561044d57600080fd5b506103a561045c3660046139f0565b610e35565b34801561046d57600080fd5b506103a561047c366004613a8d565b6110d1565b34801561048d57600080fd5b506103a561049c366004613af1565b611151565b3480156104ad57600080fd5b506103a56104bc366004613a8d565b6112b8565b3480156104cd57600080fd5b506103f960395481565b3480156104e357600080fd5b506105146104f2366004613996565b6000908152604360209081526040808320548352603f90915290205460ff1690565b6040519015158152602001610403565b34801561053057600080fd5b5061055a61053f366004613996565b6045602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610403565b34801561057e57600080fd5b506103a561138a565b34801561059357600080fd5b506103a56105a2366004613a8d565b611442565b3480156105b357600080fd5b506105146105c2366004613a8d565b611525565b3480156105d357600080fd5b506103f96105e2366004613be9565b611538565b3480156105f357600080fd5b506040805180820190915260028152611d8d60f21b60208201525b6040516104039190613cb2565b34801561062757600080fd5b5061060e6116b3565b34801561063c57600080fd5b5060345460ff16610514565b34801561065457600080fd5b50610514610663366004613a8d565b603e6020526000908152604090205460ff1681565b34801561068457600080fd5b506103a5610693366004613cd9565b611741565b3480156106a457600080fd5b506103f97ff18ceda3f6355f78c234feba066041a50f6557bfb600201e2a71a89e2dd8043381565b3480156106d857600080fd5b506103a5611af9565b3480156106ed57600080fd5b506103a5611b04565b34801561070257600080fd5b506103a5610711366004613d50565b611b89565b34801561072257600080fd5b506103a5610731366004613a8d565b611bc1565b34801561074257600080fd5b506103f9610751366004613a8d565b60466020526000908152604090205481565b34801561076f57600080fd5b506103a5611c69565b34801561078457600080fd5b506103a5610793366004613a8d565b611cda565b3480156107a457600080fd5b506103a5611d08565b3480156107b957600080fd5b5060345461010090046001600160a01b031661055a565b3480156107dc57600080fd5b5061051460345461010090046001600160a01b0316331490565b34801561080257600080fd5b506103a5610811366004613a8d565b611d85565b34801561082257600080fd5b5060405461055a906001600160a01b031681565b34801561084257600080fd5b506103f9610851366004613d91565b611e5c565b34801561086257600080fd5b506103a5610871366004613996565b611ed7565b34801561088257600080fd5b506103f9610891366004613dad565b611f9c565b3480156108a257600080fd5b5060425461055a906001600160a01b031681565b3480156108c257600080fd5b506103f96108d1366004613d91565b612007565b6103a56108e4366004613a8d565b61201a565b3480156108f557600080fd5b5060415461051490600160a01b900460ff1681565b34801561091657600080fd5b5060415461055a906001600160a01b031681565b34801561093657600080fd5b50603b546001600160a01b031661055a565b34801561095457600080fd5b506103a5610963366004613a8d565b61210e565b34801561097457600080fd5b5061055a610983366004613996565b6044602052600090815260409020546001600160a01b031681565b3480156109aa57600080fd5b506105146109b9366004613996565b603f6020526000908152604090205460ff1681565b3480156109da57600080fd5b506103a56121d0565b3480156109ef57600080fd5b506105146109fe366004613996565b600090815260436020526040902054151590565b348015610a1e57600080fd5b5061055a610a2d366004613a8d565b603c602052600090815260409020546001600160a01b031681565b348015610a5457600080fd5b506103f961271081565b348015610a6a57600080fd5b506036546001600160a01b031661055a565b348015610a8857600080fd5b506103a5610a97366004613a8d565b612277565b348015610aa857600080fd5b506103a5610ab7366004613a8d565b6122f9565b348015610ac857600080fd5b5061055a610ad7366004613a8d565b603d602052600090815260409020546001600160a01b031681565b348015610afe57600080fd5b506103a5610b0d366004613a8d565b612337565b6001600160a01b038816301415610b2857610d9a565b6001600160a01b0386163014610b805760405162461bcd60e51b815260206004820152601b60248201527f4272696467653a204e6f7420746f207468697320616464726573730000000000604482015260640161039c565b60003360405163555ddc6560e11b81526001600160a01b03821660048201527fac7fbab5f54a3ca8194167523c6753bfeb96a445279294b6125b68cce2177054602482015290915060009073dd343ef491b9520bb5effc2a7154b133893840ea9063aabbb8ca9060440160206040518083038186803b158015610c0257600080fd5b505afa158015610c16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3a9190613dff565b6001600160a01b03161415610c915760405162461bcd60e51b815260206004820152601860248201527f4272696467653a204e6f742045524337373720746f6b656e0000000000000000604482015260640161039c565b83151580610ca757506001600160a01b0388163b155b610d045760405162461bcd60e51b815260206004820152602860248201527f4272696467653a2053706563696679207265636569766572206164647265737360448201526720696e206461746160c01b606482015260840161039c565b60008415610d5057610d4b86868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061241092505050565b610d52565b885b9050610d97828a838a8a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061241792505050565b50505b5050505050505050565b610dbd60345461010090046001600160a01b0316331490565b610dd95760405162461bcd60e51b815260040161039c90613e1c565b6041805460ff60a01b1916600160a01b8315158102919091179182905560405160ff9190920416151581527f983e436223c000a441c2443b394ca5fb4669a513fe86dc1dd44494047b514ad9906020015b60405180910390a150565b610e4e60345461010090046001600160a01b0316331490565b610e6a5760405162461bcd60e51b815260040161039c90613e1c565b6001600160a01b038616610eb55760405162461bcd60e51b8152602060048201526012602482015271213934b233b29d10273ab636103a37b5b2b760711b604482015260640161039c565b6001600160a01b038087166000908152603c6020526040902054168015610f175760405162461bcd60e51b81526020600482015260166024820152754272696467653a20416c72656164792065786973747360501b604482015260640161039c565b6000610f2287612707565b9050600060388787604051602001610f3c93929190613e95565b60408051601f19818403018152908290526041546326d9e96360e01b83529092506001600160a01b0316906326d9e96390610f81908890889086908890600401613f3e565b602060405180830381600087803b158015610f9b57600080fd5b505af1158015610faf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd39190613dff565b6001600160a01b038a81166000818152603c6020908152604080832080548787166001600160a01b03199182168117909255818552603d9093529281902080549092169093179055815491516378bf2b5360e01b81526004810191909152602481018e905292955016906378bf2b5390604401600060405180830381600087803b15801561106057600080fd5b505af1158015611074573d6000803e3d6000fd5b50505050886001600160a01b0316836001600160a01b03167f2ef93c4e96a4ef0b19497ff60c9e7360a8734f3d2cd27ae5318e43851734d17f83856040516110bd929190613f8e565b60405180910390a350505050505050505050565b600054610100900460ff16806110ea575060005460ff16155b6111065760405162461bcd60e51b815260040161039c90613fb0565b600054610100900460ff16158015611128576000805461ffff19166101011790555b61113182612277565b6034805460ff19169055801561114d576000805461ff00191690555b5050565b600054610100900460ff168061116a575060005460ff16155b6111865760405162461bcd60e51b815260040161039c90613fb0565b600054610100900460ff161580156111a8576000805461ffff19166101011790555b6111b18661210e565b6111ba866110d1565b81516111cd9060389060208501906137ee565b50604080546001600160a01b038681166001600160a01b0319928316178355604180548783169084161790556036805491891691909216179055516329965a1d60e01b815230600482018190527fb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b6024830152604482015273dd343ef491b9520bb5effc2a7154b133893840ea906329965a1d90606401600060405180830381600087803b15801561127e57600080fd5b505af1158015611292573d6000803e3d6000fd5b5050505061129e6121d0565b80156112b0576000805461ff00191690555b505050505050565b6112d160345461010090046001600160a01b0316331490565b6112ed5760405162461bcd60e51b815260040161039c90613e1c565b6001600160a01b03811661133c5760405162461bcd60e51b81526020600482015260166024820152754272696467653a20777261707020697320656d70747960501b604482015260640161039c565b604280546001600160a01b0319166001600160a01b0383169081179091556040519081527f0966c958966f6fac9ff807af074f8117eb2e9ce2b76390db7a158e9bdeb2485c90602001610e2a565b61139333611525565b6113af5760405162461bcd60e51b815260040161039c90613ff8565b60345460ff166113f85760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161039c565b6034805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b61145b60345461010090046001600160a01b0316331490565b6114775760405162461bcd60e51b815260040161039c90613e1c565b6001600160a01b0381166114d75760405162461bcd60e51b815260206004820152602160248201527f4272696467653a2053696465546f6b656e466163746f727920697320656d70746044820152607960f81b606482015260840161039c565b604180546001600160a01b0319166001600160a01b0383169081179091556040519081527f619936bc6e3618d0b8dc69bcc70134fe9d88f9967f3a8b8304e318369252162590602001610e2a565b6000611532603383612773565b92915050565b60004285101561157c5760405162461bcd60e51b815260206004820152600f60248201526e109c9a5919d94e8811561412549151608a1b604482015260640161039c565b6000611598611590368b90038b018b614040565b8989896127f6565b6040805160008082526020820180845284905260ff89169282019290925260608101879052608081018690529192509060019060a0016020604051602081039080840390855afa1580156115f0573d6000803e3d6000fd5b5050604051601f19015191506000905061160d60208c018c613a8d565b6001600160a01b031614158015611641575061162c60208b018b613a8d565b6001600160a01b0316816001600160a01b0316145b61168d5760405162461bcd60e51b815260206004820152601960248201527f4272696467653a20494e56414c49445f5349474e415455524500000000000000604482015260640161039c565b6116a58a61169e6020820182613a8d565b8b8b6128ea565b9a9950505050505050505050565b603880546116c090613e51565b80601f01602080910402602001604051908101604052809291908181526020018280546116ec90613e51565b80156117395780601f1061170e57610100808354040283529160200191611739565b820191906000526020600020905b81548152906001019060200180831161171c57829003601f168201915b505050505081565b60345460ff16156117645760405162461bcd60e51b815260040161039c906140bd565b60016035600082825461177791906140fd565b90915550506035546036546001600160a01b0316336001600160a01b0316146117db5760405162461bcd60e51b8152602060048201526016602482015275213934b233b29d102737ba102332b232b930ba34b7b760511b604482015260640161039c565b6001600160a01b0388166000908152603e602052604090205460ff168061181b57506001600160a01b038881166000908152603c60205260409020541615155b61185f5760405162461bcd60e51b8152602060048201526015602482015274213934b233b29d102ab735b737bbb7103a37b5b2b760591b604482015260640161039c565b6001600160a01b0386166118a75760405162461bcd60e51b815260206004820152600f60248201526e4272696467653a204e756c6c20546f60881b604482015260640161039c565b600085116118ea5760405162461bcd60e51b815260206004820152601060248201526f04272696467653a20416d6f756e7420360841b604482015260640161039c565b836119305760405162461bcd60e51b8152602060048201526016602482015275084e4d2c8ceca74409cead8d84084d8dec6d690c2e6d60531b604482015260640161039c565b826119735760405162461bcd60e51b8152602060048201526013602482015272084e4d2c8ceca74409cead8d840a8f090c2e6d606b1b604482015260640161039c565b600083815260436020526040902054156119cf5760405162461bcd60e51b815260206004820152601860248201527f4272696467653a20416c72656164792061636365707465640000000000000000604482015260640161039c565b60006119de8787878787611f9c565b6000818152603f602052604090205490915060ff1615611a3a5760405162461bcd60e51b8152602060048201526017602482015276109c9a5919d94e88105b1c9958591e4818db185a5b5959604a1b604482015260640161039c565b60008481526043602090815260408083208490556044825280832080546001600160a01b038e81166001600160a01b03199283168117909355604585529483902080548e871692168217905582519081529283018a905290820188905263ffffffff86166060830152918916919086907f2858b8803acb87882fd2de49ce7572ae3e741fb8073cbe772fa50ce00bdfba229060800160405180910390a4506035548114610d9a5760405162461bcd60e51b815260040161039c90614115565b611b0233612bcd565b565b611b1d60345461010090046001600160a01b0316331490565b611b395760405162461bcd60e51b815260040161039c90613e1c565b60345460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360348054610100600160a81b0319169055565b33611b9f6001600160a01b038516823085612c0f565b611bbb8482858560405180602001604052806000815250612417565b50505050565b611bda60345461010090046001600160a01b0316331490565b611bf65760405162461bcd60e51b815260040161039c90613e1c565b603b80546001600160a01b038381166001600160a01b031983161790925516611c1c3390565b604080516001600160a01b038481168252858116602083015292909216917fac04bdb273a7954b7742ad0ab311fdd70a13eec4b7e625f7119fd21c21c430a4910160405180910390a25050565b600054610100900460ff1680611c82575060005460ff16155b611c9e5760405162461bcd60e51b815260040161039c90613fb0565b600054610100900460ff16158015611cc0576000805461ffff19166101011790555b60016035558015611cd7576000805461ff00191690555b50565b611ce333611525565b611cff5760405162461bcd60e51b815260040161039c90613ff8565b611cd781612c7a565b611d1133611525565b611d2d5760405162461bcd60e51b815260040161039c90613ff8565b60345460ff1615611d505760405162461bcd60e51b815260040161039c906140bd565b6034805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586114253390565b611d9e60345461010090046001600160a01b0316331490565b611dba5760405162461bcd60e51b815260040161039c90613e1c565b6001600160a01b038116611e105760405162461bcd60e51b815260206004820152601c60248201527f4272696467653a20416c6c6f77546f6b656e7320697320656d70747900000000604482015260640161039c565b604080546001600160a01b0319166001600160a01b038316908117825590519081527f5f2c1fe803fd576d8af05ea156011cc9cc8c025bda24c1e85772fc05a0b3f1e390602001610e2a565b60608101356000908152604560205260408120546001600160a01b0316336001600160a01b031614611ec95760405162461bcd60e51b8152602060048201526016602482015275213934b233b29d1034b73b30b634b21039b2b73232b960511b604482015260640161039c565b61153282335b6000806128ea565b611ef060345461010090046001600160a01b0316331490565b611f0c5760405162461bcd60e51b815260040161039c90613e1c565b611f19600a612710614170565b8110611f675760405162461bcd60e51b815260206004820152601760248201527f4272696467653a20626967676572207468616e20313025000000000000000000604482015260640161039c565b60378190556040518181527f97e97c577f03bda90e2c9739011ec065ed5fbfb36ae217d20bb0d9be95e160cd90602001610e2a565b6040805160208101859052908101839052606086811b6bffffffffffffffffffffffff1916908201526074810185905260e082901b6001600160e01b031916609482015260009060980160405160208183030381529060405280519060200120905095945050505050565b600061153282611ecf6020820182613a8d565b60425433906001600160a01b03166120745760405162461bcd60e51b815260206004820152601d60248201527f4272696467653a207772617070656443757272656e637920656d707479000000604482015260640161039c565b604260009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156120c457600080fd5b505af11580156120d8573d6000803e3d6000fd5b505050505061114d604260009054906101000a90046001600160a01b031682843460405180602001604052806000815250612417565b600054610100900460ff1680612127575060005460ff16155b6121435760405162461bcd60e51b815260040161039c90613fb0565b600054610100900460ff16158015612165576000805461ffff19166101011790555b60348054610100600160a81b0319166101006001600160a01b0385811682029290921792839055604051920416906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3801561114d576000805461ff00191690555050565b604080518082018252601081526f52534b20546f6b656e2042726964676560801b60208083019182528351808501855260018152603160f81b908201529151902082517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8152918201527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc69181019190915246606082015230608082015260a09020603955565b600054610100900460ff1680612290575060005460ff16155b6122ac5760405162461bcd60e51b815260040161039c90613fb0565b600054610100900460ff161580156122ce576000805461ffff19166101011790555b6122d782611525565b6122e4576122e482612c7a565b801561114d576000805461ff00191690555050565b61231260345461010090046001600160a01b0316331490565b61232e5760405162461bcd60e51b815260040161039c90613e1c565b611cd781612cbc565b61235060345461010090046001600160a01b0316331490565b61236c5760405162461bcd60e51b815260040161039c90613e1c565b6001600160a01b0381166123c25760405162461bcd60e51b815260206004820152601b60248201527f4272696467653a2046656465726174696f6e20697320656d7074790000000000604482015260640161039c565b603680546001600160a01b0319166001600160a01b0383169081179091556040519081527f4a41a4d11aaf0c0c9e4311ac1d68b2b0134556da594779a2a35b0ddf7cd1eafb90602001610e2a565b6014015190565b604154600160a01b900460ff16156124655760405162461bcd60e51b81526020600482015260116024820152704272696467653a20557067726164696e6760781b604482015260640161039c565b60345460ff16156124885760405162461bcd60e51b815260040161039c906140bd565b60016035600082825461249b91906140fd565b90915550506035546001600160a01b0386166000908152603e60205260408120805460ff191660011790556037546124e290612710906124dc908790612d84565b90612e0a565b905060006124f08583612e4c565b905060006124fd89612e8e565b905085601260ff83161461252e5761252b612519836012614184565b61252490600a61428b565b8890612d84565b90505b604080549051638c34bc5560e01b81526001600160a01b038c811660048301526024820184905290911690638c34bc5590604401600060405180830381600087803b15801561257c57600080fd5b505af1158015612590573d6000803e3d6000fd5b5050506001600160a01b03808c166000908152603d60205260409020548c9250161561266a57506001600160a01b03808b166000908152603d6020526040812054909116906125de8c612f7a565b905060006125ec8683613052565b90506125f88782613094565b96506126048682612e4c565b60405163fe9d930360e01b81529096506001600160a01b038e169063fe9d9303906126359089908d9060040161429a565b600060405180830381600087803b15801561264f57600080fd5b505af1158015612663573d6000803e3d6000fd5b5050505050505b886001600160a01b03168a6001600160a01b0316826001600160a01b03167f1e90de9ae4d02420648a650f45f089a1be18fbca324092544ea626f9833212b0878b6040516126b992919061429a565b60405180910390a484156126e157603b546126e1906001600160a01b038d81169116876130f3565b505050505060355481146112b05760405162461bcd60e51b815260040161039c90614115565b600060128260ff16111561275d5760405162461bcd60e51b815260206004820152601c60248201527f4c69625574696c733a20446563696d616c73206e6f74203c3d20313800000000604482015260640161039c565b612768826012614184565b61153290600a61428b565b60006001600160a01b0382166127d65760405162461bcd60e51b815260206004820152602260248201527f526f6c65733a206163636f756e7420697320746865207a65726f206164647265604482015261737360f01b606482015260840161039c565b506001600160a01b03166000908152602091909152604090205460ff1690565b603954845160208087015160608801516001600160a01b0384166000908152604690935260408320805493956128e19590947ff18ceda3f6355f78c234feba066041a50f6557bfb600201e2a71a89e2dd8043394919391928b918b918a61285c836142b3565b909155506040805160208101989098526001600160a01b03968716908801526060870194909452608086019290925290921660a084015260c083019190915260e08201526101008101859052610120016040516020818303038152906040528051906020012060405161190160f01b8152600281019290925260228201526042902090565b95945050505050565b60006001603560008282546128ff91906140fd565b909155505060355460608601356000908152604460205260409020546001600160a01b03168061296a5760405162461bcd60e51b8152602060048201526016602482015275109c9a5919d94e88151e081b9bdd0818dc9bdcdcd95960521b604482015260640161039c565b600061299b61297c60208a018a613a8d565b60208a013560408b013560608c013561089160a08e0160808f016142ce565b60608901356000908152604360205260409020549091508114612a0a5760405162461bcd60e51b815260206004820152602160248201527f4272696467653a2057726f6e67207472616e73616374696f6e446174614861736044820152600d60fb1b606482015260840161039c565b6000818152603f602052604090205460ff1615612a635760405162461bcd60e51b8152602060048201526017602482015276109c9a5919d94e88105b1c9958591e4818db185a5b5959604a1b604482015260640161039c565b6000818152603f60209081526040808320805460ff191660011790556001600160a01b0385168352603e90915290205460ff1615612ab357612aac82888a602001358989613128565b9350612ac7565b612ac482888a6020013589896132d8565b93505b612ad46020890189613a8d565b6001600160a01b0316826001600160a01b031689606001357f42b1cb6263e8da47edf0583516eda1de16f729d26282f5791dc5b7af1010e925604560008d60600135815260200190815260200160002060009054906101000a90046001600160a01b03168c602001358d604001358e6080016020810190612b5591906142ce565b604080516001600160a01b039586168152602081019490945283019190915263ffffffff166060820152818d166080820152908b1660a082015260c081018a905260e00160405180910390a450506035548114612bc45760405162461bcd60e51b815260040161039c90614115565b50949350505050565b612bd86033826134ef565b6040516001600160a01b038216907fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e90600090a250565b6040516001600160a01b0380851660248301528316604482015260648101829052611bbb9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613567565b612c856033826136e7565b6040516001600160a01b038216907f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f890600090a250565b6001600160a01b038116612d1d5760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a206e6577206f776e6572206973207a65726f206164647265604482015261737360f01b606482015260840161039c565b6034546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603480546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b600082612d9357506000611532565b6000612d9f83856142e9565b905082612dac8583614170565b14612e035760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161039c565b9392505050565b6000612e0383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613763565b6000612e0383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613791565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b1790529051600091829182916001600160a01b03861691612ed49190614308565b600060405180830381855afa9150503d8060008114612f0f576040519150601f19603f3d011682016040523d82523d6000602084013e612f14565b606091505b509150915081612f5e5760405162461bcd60e51b81526020600482015260156024820152744c69625574696c733a204e6f20646563696d616c7360581b604482015260640161039c565b80806020019051810190612f729190614324565b949350505050565b60408051600481526024810182526020810180516001600160e01b031663556f0dc760e01b1790529051600091829182916001600160a01b03861691612fc09190614308565b600060405180830381855afa9150503d8060008114612ffb576040519150601f19603f3d011682016040523d82523d6000602084013e613000565b606091505b509150915081612f5e5760405162461bcd60e51b815260206004820152601860248201527f4c69625574696c733a204e6f206772616e756c61726974790000000000000000604482015260640161039c565b6000612e0383836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f00000000000000008152506137c2565b6000806130a183856140fd565b905083811015612e035760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161039c565b6040516001600160a01b03831660248201526044810182905261312390849063a9059cbb60e01b90606401612c43565b505050565b60008061313487612e8e565b60ff169050600061315b61314983601261433d565b61315490600a614354565b8790612e0a565b9050808411156131a45760405162461bcd60e51b8152602060048201526014602482015273084e4d2c8ceca7440cccaca40e8dede40d0d2ced60631b604482015260640161039c565b6131ae848261433d565b6042549093506001600160a01b038981169116141561329f57604254604051632e1a7d4d60e01b8152600481018390526001600160a01b0390911690632e1a7d4d90602401600060405180830381600087803b15801561320d57600080fd5b505af1158015613221573d6000803e3d6000fd5b50506040516001600160a01b038a16925085156108fc02915085906000818181858888f1935050505015801561325b573d6000803e3d6000fd5b50831561329a576040516001600160a01b0386169085156108fc029086906000818181858888f19350505050158015613298573d6000803e3d6000fd5b505b6132cd565b6132b36001600160a01b03891688856130f3565b83156132cd576132cd6001600160a01b03891686866130f3565b505095945050505050565b6001600160a01b038086166000908152603c6020908152604080832054815163556f0dc760e01b81529151939416928492849263556f0dc79260048083019392829003018186803b15801561332c57600080fd5b505afa158015613340573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133649190614324565b905060006133728783612d84565b9050808511156133bb5760405162461bcd60e51b8152602060048201526014602482015273084e4d2c8ceca7440cccaca40e8dede40d0d2ced60631b604482015260640161039c565b6133c5858261433d565b604051630dcdc7dd60e41b81526001600160a01b038a81166004830152602482018390526080604483015260006084830181905260a0606484015260a48301529195509084169063dcdc7dd09060c401600060405180830381600087803b15801561342f57600080fd5b505af1158015613443573d6000803e3d6000fd5b5050505060008511156134e357604051630dcdc7dd60e41b81526001600160a01b03878116600483015260248201879052608060448301526000608483015260a06064830152600b60a48301526a72656c617965722066656560a81b60c483015284169063dcdc7dd09060e401600060405180830381600087803b1580156134ca57600080fd5b505af11580156134de573d6000803e3d6000fd5b505050505b50505095945050505050565b6134f98282612773565b6135455760405162461bcd60e51b815260206004820181905260248201527f526f6c65733a206163636f756e7420646f65736e2774206861766520726f6c65604482015260640161039c565b6001600160a01b0316600090815260209190915260409020805460ff19169055565b6001600160a01b0382163b6135be5760405162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015260640161039c565b600080836001600160a01b0316836040516135d99190614308565b6000604051808303816000865af19150503d8060008114613616576040519150601f19603f3d011682016040523d82523d6000602084013e61361b565b606091505b50915091508161366d5760405162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015260640161039c565b805115611bbb57808060200190518101906136889190614360565b611bbb5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161039c565b6136f18282612773565b1561373e5760405162461bcd60e51b815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015260640161039c565b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b600081836137845760405162461bcd60e51b815260040161039c9190613cb2565b5060006128e18486614170565b600081848411156137b55760405162461bcd60e51b815260040161039c9190613cb2565b5060006128e1848661433d565b600081836137e35760405162461bcd60e51b815260040161039c9190613cb2565b50612f72838561437d565b8280546137fa90613e51565b90600052602060002090601f01602090048101928261381c5760008555613862565b82601f1061383557805160ff1916838001178555613862565b82800160010185558215613862579182015b82811115613862578251825591602001919060010190613847565b5061386e929150613872565b5090565b5b8082111561386e5760008155600101613873565b6001600160a01b0381168114611cd757600080fd5b60008083601f8401126138ae57600080fd5b50813567ffffffffffffffff8111156138c657600080fd5b6020830191508360208285010111156138de57600080fd5b9250929050565b60008060008060008060008060c0898b03121561390157600080fd5b883561390c81613887565b9750602089013561391c81613887565b9650604089013561392c81613887565b955060608901359450608089013567ffffffffffffffff8082111561395057600080fd5b61395c8c838d0161389c565b909650945060a08b013591508082111561397557600080fd5b506139828b828c0161389c565b999c989b5096995094979396929594505050565b6000602082840312156139a857600080fd5b5035919050565b8015158114611cd757600080fd5b6000602082840312156139cf57600080fd5b8135612e03816139af565b803560ff811681146139eb57600080fd5b919050565b600080600080600080600060a0888a031215613a0b57600080fd5b873596506020880135613a1d81613887565b9550613a2b604089016139da565b9450606088013567ffffffffffffffff80821115613a4857600080fd5b613a548b838c0161389c565b909650945060808a0135915080821115613a6d57600080fd5b50613a7a8a828b0161389c565b989b979a50959850939692959293505050565b600060208284031215613a9f57600080fd5b8135612e0381613887565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613ae957613ae9613aaa565b604052919050565b600080600080600060a08688031215613b0957600080fd5b8535613b1481613887565b9450602086810135613b2581613887565b94506040870135613b3581613887565b93506060870135613b4581613887565b9250608087013567ffffffffffffffff80821115613b6257600080fd5b818901915089601f830112613b7657600080fd5b813581811115613b8857613b88613aaa565b613b9a601f8201601f19168501613ac0565b91508082528a84828501011115613bb057600080fd5b80848401858401376000848284010152508093505050509295509295909350565b600060a08284031215613be357600080fd5b50919050565b6000806000806000806000610160888a031215613c0557600080fd5b613c0f8989613bd1565b965060a0880135613c1f81613887565b955060c0880135945060e08801359350613c3c61010089016139da565b92506101208801359150610140880135905092959891949750929550565b60005b83811015613c75578181015183820152602001613c5d565b83811115611bbb5750506000910152565b60008151808452613c9e816020860160208601613c5a565b601f01601f19169290920160200192915050565b602081526000612e036020830184613c86565b803563ffffffff811681146139eb57600080fd5b600080600080600080600060e0888a031215613cf457600080fd5b8735613cff81613887565b96506020880135613d0f81613887565b95506040880135613d1f81613887565b9450606088013593506080880135925060a08801359150613d4260c08901613cc5565b905092959891949750929550565b600080600060608486031215613d6557600080fd5b8335613d7081613887565b92506020840135613d8081613887565b929592945050506040919091013590565b600060a08284031215613da357600080fd5b612e038383613bd1565b600080600080600060a08688031215613dc557600080fd5b8535613dd081613887565b9450602086013593506040860135925060608601359150613df360808701613cc5565b90509295509295909350565b600060208284031215613e1157600080fd5b8151612e0381613887565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c90821680613e6557607f821691505b60208210811415613be357634e487b7160e01b600052602260045260246000fd5b81818437506000910190815290565b600080855481600182811c915080831680613eb157607f831692505b6020808410821415613ed157634e487b7160e01b86526022600452602486fd5b818015613ee55760018114613ef657613f23565b60ff19861689528489019650613f23565b60008c81526020902060005b86811015613f1b5781548b820152908501908301613f02565b505084890196505b505050505050613f34818587613e86565b9695505050505050565b60608152836060820152838560808301376000608085830101526000601f19601f86011682016080838203016020840152613f7c6080820186613c86565b91505082604083015295945050505050565b604081526000613fa16040830185613c86565b90508260208301529392505050565b60208082526028908201527f436f6e747261637420696e7374616e636520697320616c726561647920696e696040820152671d1a585b1a5e995960c21b606082015260800190565b60208082526028908201527f506175736572526f6c653a2063616c6c657220646f65736e277420686176652060408201526774686520726f6c6560c01b606082015260800190565b600060a0828403121561405257600080fd5b60405160a0810181811067ffffffffffffffff8211171561407557614075613aaa565b604052823561408381613887565b808252506020830135602082015260408301356040820152606083013560608201526140b160808401613cc5565b60808201529392505050565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008219821115614110576141106140e7565b500190565b60208082526025908201527f5265656e7472616e637947756172643a206e6f207265656e7472616e7420616c6040820152641b1bddd95960da1b606082015260800190565b634e487b7160e01b600052601260045260246000fd5b60008261417f5761417f61415a565b500490565b600060ff821660ff84168082101561419e5761419e6140e7565b90039392505050565b600181815b808511156141e25781600019048211156141c8576141c86140e7565b808516156141d557918102915b93841c93908002906141ac565b509250929050565b6000826141f957506001611532565b8161420657506000611532565b816001811461421c576002811461422657614242565b6001915050611532565b60ff841115614237576142376140e7565b50506001821b611532565b5060208310610133831016604e8410600b8410161715614265575081810a611532565b61426f83836141a7565b8060001904821115614283576142836140e7565b029392505050565b6000612e0360ff8416836141ea565b828152604060208201526000612f726040830184613c86565b60006000198214156142c7576142c76140e7565b5060010190565b6000602082840312156142e057600080fd5b612e0382613cc5565b6000816000190483118215151615614303576143036140e7565b500290565b6000825161431a818460208701613c5a565b9190910192915050565b60006020828403121561433657600080fd5b5051919050565b60008282101561434f5761434f6140e7565b500390565b6000612e0383836141ea565b60006020828403121561437257600080fd5b8151612e03816139af565b60008261438c5761438c61415a565b50069056fea26469706673582212208ce049f3a18245b27fbdfc5d5fce142efcb6f858f2f85701f5cddfac65e050ae64736f6c63430008090033", + "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." + }, + "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)": { + "notice": "Accepts the transaction from the other chain that was voted and sent by the Federation contract" + }, + "claim((address,uint256,bytes32,bytes32,uint32))": { + "notice": "Claims the crossed transaction using the hash, this sends the funds to the address indicated in" + }, + "depositTo(address)": { + "notice": "Use network currency and cross it." + }, + "receiveTokensTo(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": 3081, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "initialized", + "offset": 0, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 3084, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 3124, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "______gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 3150, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "_pausers", + "offset": 0, + "slot": "51", + "type": "t_struct(Role)2205_storage" + }, + { + "astId": 3272, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "_paused", + "offset": 0, + "slot": "52", + "type": "t_bool" + }, + { + "astId": 3370, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "_owner", + "offset": 1, + "slot": "52", + "type": "t_address" + }, + { + "astId": 3501, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "_guardCounter", + "offset": 0, + "slot": "53", + "type": "t_uint256" + }, + { + "astId": 61, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "federation", + "offset": 0, + "slot": "54", + "type": "t_address" + }, + { + "astId": 63, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "feePercentage", + "offset": 0, + "slot": "55", + "type": "t_uint256" + }, + { + "astId": 65, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "symbolPrefix", + "offset": 0, + "slot": "56", + "type": "t_string_storage" + }, + { + "astId": 67, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "DOMAIN_SEPARATOR", + "offset": 0, + "slot": "57", + "type": "t_bytes32" + }, + { + "astId": 69, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "_deprecatedSpentToday", + "offset": 0, + "slot": "58", + "type": "t_uint256" + }, + { + "astId": 72, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "feeCollectorAddress", + "offset": 0, + "slot": "59", + "type": "t_address" + }, + { + "astId": 76, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "mappedTokens", + "offset": 0, + "slot": "60", + "type": "t_mapping(t_address,t_address)" + }, + { + "astId": 80, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "originalTokens", + "offset": 0, + "slot": "61", + "type": "t_mapping(t_address,t_address)" + }, + { + "astId": 84, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "knownTokens", + "offset": 0, + "slot": "62", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 88, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "claimed", + "offset": 0, + "slot": "63", + "type": "t_mapping(t_bytes32,t_bool)" + }, + { + "astId": 91, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "allowTokens", + "offset": 0, + "slot": "64", + "type": "t_contract(IAllowTokens)1850" + }, + { + "astId": 94, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "sideTokenFactory", + "offset": 0, + "slot": "65", + "type": "t_contract(ISideTokenFactory)1888" + }, + { + "astId": 96, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "isUpgrading", + "offset": 20, + "slot": "65", + "type": "t_bool" + }, + { + "astId": 107, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "wrappedCurrency", + "offset": 0, + "slot": "66", + "type": "t_contract(IWrapped)1941" + }, + { + "astId": 111, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "transactionsDataHashes", + "offset": 0, + "slot": "67", + "type": "t_mapping(t_bytes32,t_bytes32)" + }, + { + "astId": 115, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "originalTokenAddresses", + "offset": 0, + "slot": "68", + "type": "t_mapping(t_bytes32,t_address)" + }, + { + "astId": 119, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "senderAddresses", + "offset": 0, + "slot": "69", + "type": "t_mapping(t_bytes32,t_address)" + }, + { + "astId": 126, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "label": "nonces", + "offset": 0, + "slot": "70", + "type": "t_mapping(t_address,t_uint256)" + } + ], + "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)1850": { + "encoding": "inplace", + "label": "contract IAllowTokens", + "numberOfBytes": "20" + }, + "t_contract(ISideTokenFactory)1888": { + "encoding": "inplace", + "label": "contract ISideTokenFactory", + "numberOfBytes": "20" + }, + "t_contract(IWrapped)1941": { + "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_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_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Role)2205_storage": { + "encoding": "inplace", + "label": "struct Roles.Role", + "members": [ + { + "astId": 2204, + "contract": "contracts/Bridge/BridgeV4.sol:BridgeV4", + "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/alphanet/FederationProxy.json b/bridge/deployments/alphanet/FederationProxy.json new file mode 100644 index 000000000..850861493 --- /dev/null +++ b/bridge/deployments/alphanet/FederationProxy.json @@ -0,0 +1,258 @@ +{ + "address": "0x76E470726f3B25048A05eE995abd1302740B1061", + "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": "0x31d216c50aab9d121e5fa7d2038dd4b551a8d7e61b1a1bde1080fb7175727be0", + "receipt": { + "to": null, + "from": "0x49A2731C440B0A217f817dB99145Ef5c2e3c9f4E", + "contractAddress": "0x76E470726f3B25048A05eE995abd1302740B1061", + "transactionIndex": 0, + "gasUsed": "908212", + "logsBloom": "0x00000000000000000001204000000000000100000000000000800000000000000000000000000000000000000000000000000400000000000080000000000000000000800000000000000000000000000003000000000001000000000000000000000000020000000000000000000800000000080000000000000000800000400000000000000000000000008000000000000000000000000000000000000000000000000000800000000000000000000000008000000000000000000000000020000000000000000000000000000000000000000000000000000000000020000010000000000000000000000000000100000000000000000800000000000000", + "blockHash": "0xa4f6bb32a3a2bac115118390fe2c0af79558a26b6a5f8622370d2b917e5ae6e5", + "transactionHash": "0x31d216c50aab9d121e5fa7d2038dd4b551a8d7e61b1a1bde1080fb7175727be0", + "logs": [ + { + "transactionIndex": 0, + "blockNumber": 103910, + "transactionHash": "0x31d216c50aab9d121e5fa7d2038dd4b551a8d7e61b1a1bde1080fb7175727be0", + "address": "0x76E470726f3B25048A05eE995abd1302740B1061", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000e16b04a1a87ac65a4af8d46a8b797d0d46572408" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0xa4f6bb32a3a2bac115118390fe2c0af79558a26b6a5f8622370d2b917e5ae6e5" + }, + { + "transactionIndex": 0, + "blockNumber": 103910, + "transactionHash": "0x31d216c50aab9d121e5fa7d2038dd4b551a8d7e61b1a1bde1080fb7175727be0", + "address": "0x76E470726f3B25048A05eE995abd1302740B1061", + "topics": [ + "0x72114e270de66b9d2710ecf140403e5e99b1574767d6a8197bdc8d807a46e7c7", + "0x00000000000000000000000049a2731c440b0a217f817db99145ef5c2e3c9f4e" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0xa4f6bb32a3a2bac115118390fe2c0af79558a26b6a5f8622370d2b917e5ae6e5" + }, + { + "transactionIndex": 0, + "blockNumber": 103910, + "transactionHash": "0x31d216c50aab9d121e5fa7d2038dd4b551a8d7e61b1a1bde1080fb7175727be0", + "address": "0x76E470726f3B25048A05eE995abd1302740B1061", + "topics": [ + "0xa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 2, + "blockHash": "0xa4f6bb32a3a2bac115118390fe2c0af79558a26b6a5f8622370d2b917e5ae6e5" + }, + { + "transactionIndex": 0, + "blockNumber": 103910, + "transactionHash": "0x31d216c50aab9d121e5fa7d2038dd4b551a8d7e61b1a1bde1080fb7175727be0", + "address": "0x76E470726f3B25048A05eE995abd1302740B1061", + "topics": [ + "0x9775531310b2880b61484ed85cbb0b491c8fde3a07f289c63b92551782794497" + ], + "data": "0x000000000000000000000000ddd720f6ac69c48b11bae06ca1f852d7920fd58a", + "logIndex": 3, + "blockHash": "0xa4f6bb32a3a2bac115118390fe2c0af79558a26b6a5f8622370d2b917e5ae6e5" + } + ], + "blockNumber": 103910, + "cumulativeGasUsed": "908212", + "status": 1, + "byzantium": true + }, + "args": [ + "0x10b9D58D929626A745a94CB138Ee07521C0B67c5", + "0x56183c2CCBe444f6217dA6cAF1F8000410542104", + "0xc1b4a1e300000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000ddd720f6ac69c48b11bae06ca1f852d7920fd58a000000000000000000000000e16b04a1a87ac65a4af8d46a8b797d0d46572408000000000000000000000000000000000000000000000000000000000000000100000000000000000000000049a2731c440b0a217f817db99145ef5c2e3c9f4e" + ], + "numDeployments": 1, + "solcInputHash": "bfc96d5f60348b72136d284c7b5c1536", + "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/alphanet/FederationV2.json b/bridge/deployments/alphanet/FederationV2.json new file mode 100644 index 000000000..eda7f807d --- /dev/null +++ b/bridge/deployments/alphanet/FederationV2.json @@ -0,0 +1,906 @@ +{ + "address": "0x10b9D58D929626A745a94CB138Ee07521C0B67c5", + "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" + } + ], + "name": "Executed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fedRskBlock", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fedEthBlock", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "federatorVersion", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "nodeRskInfo", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "nodeEthInfo", + "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" + } + ], + "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 IBridgeV3", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_required", + "type": "uint256" + } + ], + "name": "changeRequirement", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "fedRskBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "fedEthBlock", + "type": "uint256" + }, + { + "internalType": "string", + "name": "federatorVersion", + "type": "string" + }, + { + "internalType": "string", + "name": "nodeRskInfo", + "type": "string" + }, + { + "internalType": "string", + "name": "nodeEthInfo", + "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" + } + ], + "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": "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": "amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "transactionHash", + "type": "bytes32" + }, + { + "internalType": "uint32", + "name": "logIndex", + "type": "uint32" + } + ], + "name": "voteTransaction", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "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": "0x2ac8618ba6808f025aacffc9ae3823a0777af67e596bfd58b3946c8b5083229d", + "receipt": { + "to": null, + "from": "0x49A2731C440B0A217f817dB99145Ef5c2e3c9f4E", + "contractAddress": "0x10b9D58D929626A745a94CB138Ee07521C0B67c5", + "transactionIndex": 0, + "gasUsed": "1912203", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x44625e9bd61e1c52e6c4d35075251fdff912befb5378738da2e21bfc47bf5e76", + "transactionHash": "0x2ac8618ba6808f025aacffc9ae3823a0777af67e596bfd58b3946c8b5083229d", + "logs": [], + "blockNumber": 103908, + "cumulativeGasUsed": "1912203", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "bfc96d5f60348b72136d284c7b5c1536", + "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\"}],\"name\":\"Executed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fedRskBlock\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fedEthBlock\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"federatorVersion\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"nodeRskInfo\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"nodeEthInfo\",\"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\"}],\"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 IBridgeV3\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_required\",\"type\":\"uint256\"}],\"name\":\"changeRequirement\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"fedRskBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fedEthBlock\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"federatorVersion\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"nodeRskInfo\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"nodeEthInfo\",\"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\"}],\"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\":\"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\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"transactionHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"logIndex\",\"type\":\"uint32\"}],\"name\":\"voteTransaction\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":{\"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.\"},\"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.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/Federation/FederationV2.sol\":\"FederationV2\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"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}\",\"keccak256\":\"0x8b09418db4e442cd6dcdf9f1692827bf2a498e222ac9b68f833a706b250ce5b5\",\"license\":\"MIT\"},\"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}\",\"keccak256\":\"0xe58ed8966176fb161741d550d2ca85d3ba6e490ab1c4ddac9c8a15f5c60c26fd\",\"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": "0x608060405234801561001057600080fd5b50611b32806100206000396000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c8063a1fb4acb116100de578063c1f0808a11610097578063dc8452cd11610071578063dc8452cd146103a5578063e78cea92146103ae578063f2fde38b146103c1578063fa6297ba146103d457600080fd5b8063c1f0808a1461035c578063c4d66de81461037f578063ca6d56dc1461039257600080fd5b8063a1fb4acb146102ca578063a230c524146102dd578063a93585f014610300578063b9a3b9dc14610323578063ba51a6df14610336578063c1b4a1e31461034957600080fd5b8063715018a611610130578063715018a6146102485780638da5cb5b146102505780638dd14802146102615780638f32d59b146102745780639386775a146102875780639eab5253146102b557600080fd5b80630b1ca49a146101785780631b4613cb1461018d57806335d4aa9e146101d057806354fd4d50146101e35780635daf08ca14610207578063681fc92114610232575b600080fd5b61018b61018636600461157d565b6103e7565b005b6101bb61019b3660046115a1565b600090815260386020908152604080832033845290915290205460ff1690565b60405190151581526020015b60405180910390f35b6101bb6101de3660046115ce565b610725565b60408051808201825260028152613b1960f11b602082015290516101c79190611645565b61021a6102153660046115a1565b6109a3565b6040516001600160a01b0390911681526020016101c7565b61023a603281565b6040519081526020016101c7565b61018b6109cd565b6033546001600160a01b031661021a565b61018b61026f36600461157d565b610a41565b6033546001600160a01b031633146101bb565b6101bb61029536600461169a565b603860209081526000928352604080842090915290825290205460ff1681565b6102bd610a77565b6040516101c791906116ca565b61023a6102d83660046115a1565b610ad9565b6101bb6102eb36600461157d565b60376020526000908152604090205460ff1681565b6101bb61030e3660046115a1565b60009081526039602052604090205460ff1690565b61018b610331366004611760565b610b61565b61018b6103443660046115a1565b610c15565b61018b610357366004611823565b610d37565b6101bb61036a3660046115a1565b60396020526000908152604090205460ff1681565b61018b61038d36600461157d565b611049565b61018b6103a036600461157d565b6110ff565b61023a60365481565b60345461021a906001600160a01b031681565b61018b6103cf36600461157d565b6112cb565b61023a6103e23660046115ce565b6112fe565b6033546001600160a01b0316331461041a5760405162461bcd60e51b815260040161041190611913565b60405180910390fd5b6001600160a01b03811661046b5760405162461bcd60e51b81526020600482015260186024820152772332b232b930ba34b7b71d1022b6b83a3c9036b2b6b132b960411b6044820152606401610411565b6001600160a01b03811660009081526037602052604090205460ff166104dd5760405162461bcd60e51b815260206004820152602160248201527f46656465726174696f6e3a204d656d62657220646f65736e27742065786973746044820152607360f81b6064820152608401610411565b6035546001106105405760405162461bcd60e51b815260206004820152602860248201527f46656465726174696f6e3a2043616e27742072656d6f766520616c6c20746865604482015267206d656d6265727360c01b6064820152608401610411565b6036546035546105529060019061195e565b10156105ba5760405162461bcd60e51b815260206004820152603160248201527f46656465726174696f6e3a2043616e27742068617665206c657373207468616e604482015270207265717569726564206d656d6265727360781b6064820152608401610411565b6001600160a01b0381166000908152603760205260408120805460ff191690555b6035546105ea9060019061195e565b8110156106ba57816001600160a01b03166035828154811061060e5761060e611975565b6000918252602090912001546001600160a01b031614156106a857603580546106399060019061195e565b8154811061064957610649611975565b600091825260209091200154603580546001600160a01b03909216918390811061067557610675611975565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506106ba565b806106b28161198b565b9150506105db565b5060358054806106cc576106cc6119a6565b600082815260208120820160001990810180546001600160a01b03191690559091019091556040516001600160a01b038316917f270bfc616dd36d5cb6b35aac93e6ef22b089c34e6f6ad6f0892797424840897b91a250565b3360009081526037602052604081205460ff166107805760405162461bcd60e51b81526020600482015260196024820152782332b232b930ba34b7b71d102737ba102332b232b930ba37b960391b6044820152606401610411565b6000610791898989898989896112fe565b60008181526039602052604090205490915060ff16156107b5576001915050610998565b600081815260386020908152604080832033845290915290205460ff16156107e1576001915050610998565b600081815260386020908152604080832033808552925291829020805460ff191660011790559051829186917fd22894491aaa5bb67855bcff4b9730bdf7768be1e25f66ced9a7d7ad623bf29190610844908e908e908e908e908e908d906119bc565b60405180910390a4600061085782610ad9565b905060365481101580156108845750603554610875906002906119fa565b610880906001611a1c565b8110155b156109915760008281526039602052604090819020805460ff191660011790556034549051636a86319160e01b81526001600160a01b038c811660048301528b811660248301528a81166044830152606482018a90526084820189905260a4820188905263ffffffff871660c483015290911690636a8631919060e401600060405180830381600087803b15801561091b57600080fd5b505af115801561092f573d6000803e3d6000fd5b50505050818561093c3390565b6001600160a01b03167fe21e4d3d66ef78424137270e65cfafe938736bb770702ab4fd630383e7820b738d8d8d8d8d8c60405161097e969594939291906119bc565b60405180910390a4600192505050610998565b6001925050505b979650505050505050565b603581815481106109b357600080fd5b6000918252602090912001546001600160a01b0316905081565b6033546001600160a01b031633146109f75760405162461bcd60e51b815260040161041190611913565b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b6033546001600160a01b03163314610a6b5760405162461bcd60e51b815260040161041190611913565b610a7481611377565b50565b60606035805480602002602001604051908101604052809291908181526020018280548015610acf57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610ab1575b5050505050905090565b600080805b603554811015610b5a5760008481526038602052604081206035805491929184908110610b0d57610b0d611975565b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff1615610b4857610b45600183611a1c565b91505b80610b528161198b565b915050610ade565b5092915050565b3360009081526037602052604090205460ff16610bbc5760405162461bcd60e51b81526020600482015260196024820152782332b232b930ba34b7b71d102737ba102332b232b930ba37b960391b6044820152606401610411565b336001600160a01b03167fbb00e6cbdccbb5b7549e189335249187223d88583604555326aa1d7ccbcad4428989898989898989604051610c03989796959493929190611a5d565b60405180910390a25050505050505050565b6033546001600160a01b03163314610c3f5760405162461bcd60e51b815260040161041190611913565b60355481818111801590610c5257508015155b8015610c5d57508115155b610ca95760405162461bcd60e51b815260206004820181905260248201527f46656465726174696f6e3a20496e76616c696420726571756972656d656e74736044820152606401610411565b6002831015610cfa5760405162461bcd60e51b815260206004820152601f60248201527f46656465726174696f6e3a205265717569726573206174206c656173742032006044820152606401610411565b60368390556040518381527fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9060200160405180910390a1505050565b835183818111158015610d4957508015155b8015610d5457508115155b610da05760405162461bcd60e51b815260206004820181905260248201527f46656465726174696f6e3a20496e76616c696420726571756972656d656e74736044820152606401610411565b600054610100900460ff1680610db9575060005460ff16155b610dd55760405162461bcd60e51b815260040161041190611ab4565b600054610100900460ff16158015610df7576000805461ffff19166101011790555b610e0084611049565b603287511115610e525760405162461bcd60e51b815260206004820152601c60248201527f46656465726174696f6e3a20546f6f206d616e79206d656d62657273000000006044820152606401610411565b8651610e659060359060208a01906114de565b5060005b8751811015610fec5760376000898381518110610e8857610e88611975565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff16158015610ee8575060006001600160a01b0316888281518110610ed457610ed4611975565b60200260200101516001600160a01b031614155b610f345760405162461bcd60e51b815260206004820152601b60248201527f46656465726174696f6e3a20496e76616c6964206d656d6265727300000000006044820152606401610411565b6001603760008a8481518110610f4c57610f4c611975565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550878181518110610f9d57610f9d611975565b60200260200101516001600160a01b03167f72114e270de66b9d2710ecf140403e5e99b1574767d6a8197bdc8d807a46e7c760405160405180910390a280610fe48161198b565b915050610e69565b5060368690556040518681527fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9060200160405180910390a161102e85611377565b8015611040576000805461ff00191690555b50505050505050565b600054610100900460ff1680611062575060005460ff16155b61107e5760405162461bcd60e51b815260040161041190611ab4565b600054610100900460ff161580156110a0576000805461ffff19166101011790555b603380546001600160a01b0319166001600160a01b0384169081179091556040516000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a380156110fb576000805461ff00191690555b5050565b6033546001600160a01b031633146111295760405162461bcd60e51b815260040161041190611913565b6001600160a01b03811661117a5760405162461bcd60e51b81526020600482015260186024820152772332b232b930ba34b7b71d1022b6b83a3c9036b2b6b132b960411b6044820152606401610411565b6001600160a01b03811660009081526037602052604090205460ff16156111ed5760405162461bcd60e51b815260206004820152602160248201527f46656465726174696f6e3a204d656d62657220616c72656164792065786973746044820152607360f81b6064820152608401610411565b60355460321161123f5760405162461bcd60e51b815260206004820152601f60248201527f46656465726174696f6e3a204d6178206d656d626572732072656163686564006044820152606401610411565b6001600160a01b038116600081815260376020526040808220805460ff1916600190811790915560358054918201815583527fcfa4bec1d3298408bb5afcfcd9c430549c5b31f8aa5c5848151c0a55f473c34d0180546001600160a01b03191684179055517f72114e270de66b9d2710ecf140403e5e99b1574767d6a8197bdc8d807a46e7c79190a250565b6033546001600160a01b031633146112f55760405162461bcd60e51b815260040161041190611913565b610a7481611421565b60408051606098891b6bffffffffffffffffffffffff19908116602080840191909152988a1b811660348301529690981b9095166048880152605c870193909352607c860191909152609c85015260e01b6001600160e01b03191660bc840152805160a081850301815260c09093019052815191012090565b6001600160a01b0381166113cd5760405162461bcd60e51b815260206004820152601860248201527f46656465726174696f6e3a20456d7074792062726964676500000000000000006044820152606401610411565b603480546001600160a01b0319166001600160a01b0383169081179091556040519081527f9775531310b2880b61484ed85cbb0b491c8fde3a07f289c63b925517827944979060200160405180910390a150565b6001600160a01b0381166114825760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a206e6577206f776e6572206973207a65726f206164647265604482015261737360f01b6064820152608401610411565b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b828054828255906000526020600020908101928215611533579160200282015b8281111561153357825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906114fe565b5061153f929150611543565b5090565b5b8082111561153f5760008155600101611544565b6001600160a01b0381168114610a7457600080fd5b803561157881611558565b919050565b60006020828403121561158f57600080fd5b813561159a81611558565b9392505050565b6000602082840312156115b357600080fd5b5035919050565b803563ffffffff8116811461157857600080fd5b600080600080600080600060e0888a0312156115e957600080fd5b87356115f481611558565b9650602088013561160481611558565b9550604088013561161481611558565b9450606088013593506080880135925060a0880135915061163760c089016115ba565b905092959891949750929550565b600060208083528351808285015260005b8181101561167257858101830151858201604001528201611656565b81811115611684576000604083870101525b50601f01601f1916929092016040019392505050565b600080604083850312156116ad57600080fd5b8235915060208301356116bf81611558565b809150509250929050565b6020808252825182820181905260009190848201906040850190845b8181101561170b5783516001600160a01b0316835292840192918401916001016116e6565b50909695505050505050565b60008083601f84011261172957600080fd5b50813567ffffffffffffffff81111561174157600080fd5b60208301915083602082850101111561175957600080fd5b9250929050565b60008060008060008060008060a0898b03121561177c57600080fd5b8835975060208901359650604089013567ffffffffffffffff808211156117a257600080fd5b6117ae8c838d01611717565b909850965060608b01359150808211156117c757600080fd5b6117d38c838d01611717565b909650945060808b01359150808211156117ec57600080fd5b506117f98b828c01611717565b999c989b5096995094979396929594505050565b634e487b7160e01b600052604160045260246000fd5b6000806000806080858703121561183957600080fd5b843567ffffffffffffffff8082111561185157600080fd5b818701915087601f83011261186557600080fd5b81356020828211156118795761187961180d565b8160051b604051601f19603f8301168101818110868211171561189e5761189e61180d565b60405292835281830193508481018201928b8411156118bc57600080fd5b948201945b838610156118e1576118d28661156d565b855294820194938201936118c1565b98505088013595506118fa92505060408701905061156d565b91506119086060860161156d565b905092959194509250565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008282101561197057611970611948565b500390565b634e487b7160e01b600052603260045260246000fd5b600060001982141561199f5761199f611948565b5060010190565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b03968716815294861660208601529290941660408401526060830152608082019290925263ffffffff90911660a082015260c00190565b600082611a1757634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611a2f57611a2f611948565b500190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b88815287602082015260a060408201526000611a7d60a08301888a611a34565b8281036060840152611a90818789611a34565b90508281036080840152611aa5818587611a34565b9b9a5050505050505050505050565b60208082526028908201527f436f6e747261637420696e7374616e636520697320616c726561647920696e696040820152671d1a585b1a5e995960c21b60608201526080019056fea2646970667358221220131853999ada9a2b6c990add208c8f10c6a4444a915ec1a3d5e193e0b86dde0e64736f6c63430008090033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101735760003560e01c8063a1fb4acb116100de578063c1f0808a11610097578063dc8452cd11610071578063dc8452cd146103a5578063e78cea92146103ae578063f2fde38b146103c1578063fa6297ba146103d457600080fd5b8063c1f0808a1461035c578063c4d66de81461037f578063ca6d56dc1461039257600080fd5b8063a1fb4acb146102ca578063a230c524146102dd578063a93585f014610300578063b9a3b9dc14610323578063ba51a6df14610336578063c1b4a1e31461034957600080fd5b8063715018a611610130578063715018a6146102485780638da5cb5b146102505780638dd14802146102615780638f32d59b146102745780639386775a146102875780639eab5253146102b557600080fd5b80630b1ca49a146101785780631b4613cb1461018d57806335d4aa9e146101d057806354fd4d50146101e35780635daf08ca14610207578063681fc92114610232575b600080fd5b61018b61018636600461157d565b6103e7565b005b6101bb61019b3660046115a1565b600090815260386020908152604080832033845290915290205460ff1690565b60405190151581526020015b60405180910390f35b6101bb6101de3660046115ce565b610725565b60408051808201825260028152613b1960f11b602082015290516101c79190611645565b61021a6102153660046115a1565b6109a3565b6040516001600160a01b0390911681526020016101c7565b61023a603281565b6040519081526020016101c7565b61018b6109cd565b6033546001600160a01b031661021a565b61018b61026f36600461157d565b610a41565b6033546001600160a01b031633146101bb565b6101bb61029536600461169a565b603860209081526000928352604080842090915290825290205460ff1681565b6102bd610a77565b6040516101c791906116ca565b61023a6102d83660046115a1565b610ad9565b6101bb6102eb36600461157d565b60376020526000908152604090205460ff1681565b6101bb61030e3660046115a1565b60009081526039602052604090205460ff1690565b61018b610331366004611760565b610b61565b61018b6103443660046115a1565b610c15565b61018b610357366004611823565b610d37565b6101bb61036a3660046115a1565b60396020526000908152604090205460ff1681565b61018b61038d36600461157d565b611049565b61018b6103a036600461157d565b6110ff565b61023a60365481565b60345461021a906001600160a01b031681565b61018b6103cf36600461157d565b6112cb565b61023a6103e23660046115ce565b6112fe565b6033546001600160a01b0316331461041a5760405162461bcd60e51b815260040161041190611913565b60405180910390fd5b6001600160a01b03811661046b5760405162461bcd60e51b81526020600482015260186024820152772332b232b930ba34b7b71d1022b6b83a3c9036b2b6b132b960411b6044820152606401610411565b6001600160a01b03811660009081526037602052604090205460ff166104dd5760405162461bcd60e51b815260206004820152602160248201527f46656465726174696f6e3a204d656d62657220646f65736e27742065786973746044820152607360f81b6064820152608401610411565b6035546001106105405760405162461bcd60e51b815260206004820152602860248201527f46656465726174696f6e3a2043616e27742072656d6f766520616c6c20746865604482015267206d656d6265727360c01b6064820152608401610411565b6036546035546105529060019061195e565b10156105ba5760405162461bcd60e51b815260206004820152603160248201527f46656465726174696f6e3a2043616e27742068617665206c657373207468616e604482015270207265717569726564206d656d6265727360781b6064820152608401610411565b6001600160a01b0381166000908152603760205260408120805460ff191690555b6035546105ea9060019061195e565b8110156106ba57816001600160a01b03166035828154811061060e5761060e611975565b6000918252602090912001546001600160a01b031614156106a857603580546106399060019061195e565b8154811061064957610649611975565b600091825260209091200154603580546001600160a01b03909216918390811061067557610675611975565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506106ba565b806106b28161198b565b9150506105db565b5060358054806106cc576106cc6119a6565b600082815260208120820160001990810180546001600160a01b03191690559091019091556040516001600160a01b038316917f270bfc616dd36d5cb6b35aac93e6ef22b089c34e6f6ad6f0892797424840897b91a250565b3360009081526037602052604081205460ff166107805760405162461bcd60e51b81526020600482015260196024820152782332b232b930ba34b7b71d102737ba102332b232b930ba37b960391b6044820152606401610411565b6000610791898989898989896112fe565b60008181526039602052604090205490915060ff16156107b5576001915050610998565b600081815260386020908152604080832033845290915290205460ff16156107e1576001915050610998565b600081815260386020908152604080832033808552925291829020805460ff191660011790559051829186917fd22894491aaa5bb67855bcff4b9730bdf7768be1e25f66ced9a7d7ad623bf29190610844908e908e908e908e908e908d906119bc565b60405180910390a4600061085782610ad9565b905060365481101580156108845750603554610875906002906119fa565b610880906001611a1c565b8110155b156109915760008281526039602052604090819020805460ff191660011790556034549051636a86319160e01b81526001600160a01b038c811660048301528b811660248301528a81166044830152606482018a90526084820189905260a4820188905263ffffffff871660c483015290911690636a8631919060e401600060405180830381600087803b15801561091b57600080fd5b505af115801561092f573d6000803e3d6000fd5b50505050818561093c3390565b6001600160a01b03167fe21e4d3d66ef78424137270e65cfafe938736bb770702ab4fd630383e7820b738d8d8d8d8d8c60405161097e969594939291906119bc565b60405180910390a4600192505050610998565b6001925050505b979650505050505050565b603581815481106109b357600080fd5b6000918252602090912001546001600160a01b0316905081565b6033546001600160a01b031633146109f75760405162461bcd60e51b815260040161041190611913565b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b6033546001600160a01b03163314610a6b5760405162461bcd60e51b815260040161041190611913565b610a7481611377565b50565b60606035805480602002602001604051908101604052809291908181526020018280548015610acf57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610ab1575b5050505050905090565b600080805b603554811015610b5a5760008481526038602052604081206035805491929184908110610b0d57610b0d611975565b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff1615610b4857610b45600183611a1c565b91505b80610b528161198b565b915050610ade565b5092915050565b3360009081526037602052604090205460ff16610bbc5760405162461bcd60e51b81526020600482015260196024820152782332b232b930ba34b7b71d102737ba102332b232b930ba37b960391b6044820152606401610411565b336001600160a01b03167fbb00e6cbdccbb5b7549e189335249187223d88583604555326aa1d7ccbcad4428989898989898989604051610c03989796959493929190611a5d565b60405180910390a25050505050505050565b6033546001600160a01b03163314610c3f5760405162461bcd60e51b815260040161041190611913565b60355481818111801590610c5257508015155b8015610c5d57508115155b610ca95760405162461bcd60e51b815260206004820181905260248201527f46656465726174696f6e3a20496e76616c696420726571756972656d656e74736044820152606401610411565b6002831015610cfa5760405162461bcd60e51b815260206004820152601f60248201527f46656465726174696f6e3a205265717569726573206174206c656173742032006044820152606401610411565b60368390556040518381527fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9060200160405180910390a1505050565b835183818111158015610d4957508015155b8015610d5457508115155b610da05760405162461bcd60e51b815260206004820181905260248201527f46656465726174696f6e3a20496e76616c696420726571756972656d656e74736044820152606401610411565b600054610100900460ff1680610db9575060005460ff16155b610dd55760405162461bcd60e51b815260040161041190611ab4565b600054610100900460ff16158015610df7576000805461ffff19166101011790555b610e0084611049565b603287511115610e525760405162461bcd60e51b815260206004820152601c60248201527f46656465726174696f6e3a20546f6f206d616e79206d656d62657273000000006044820152606401610411565b8651610e659060359060208a01906114de565b5060005b8751811015610fec5760376000898381518110610e8857610e88611975565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff16158015610ee8575060006001600160a01b0316888281518110610ed457610ed4611975565b60200260200101516001600160a01b031614155b610f345760405162461bcd60e51b815260206004820152601b60248201527f46656465726174696f6e3a20496e76616c6964206d656d6265727300000000006044820152606401610411565b6001603760008a8481518110610f4c57610f4c611975565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550878181518110610f9d57610f9d611975565b60200260200101516001600160a01b03167f72114e270de66b9d2710ecf140403e5e99b1574767d6a8197bdc8d807a46e7c760405160405180910390a280610fe48161198b565b915050610e69565b5060368690556040518681527fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9060200160405180910390a161102e85611377565b8015611040576000805461ff00191690555b50505050505050565b600054610100900460ff1680611062575060005460ff16155b61107e5760405162461bcd60e51b815260040161041190611ab4565b600054610100900460ff161580156110a0576000805461ffff19166101011790555b603380546001600160a01b0319166001600160a01b0384169081179091556040516000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a380156110fb576000805461ff00191690555b5050565b6033546001600160a01b031633146111295760405162461bcd60e51b815260040161041190611913565b6001600160a01b03811661117a5760405162461bcd60e51b81526020600482015260186024820152772332b232b930ba34b7b71d1022b6b83a3c9036b2b6b132b960411b6044820152606401610411565b6001600160a01b03811660009081526037602052604090205460ff16156111ed5760405162461bcd60e51b815260206004820152602160248201527f46656465726174696f6e3a204d656d62657220616c72656164792065786973746044820152607360f81b6064820152608401610411565b60355460321161123f5760405162461bcd60e51b815260206004820152601f60248201527f46656465726174696f6e3a204d6178206d656d626572732072656163686564006044820152606401610411565b6001600160a01b038116600081815260376020526040808220805460ff1916600190811790915560358054918201815583527fcfa4bec1d3298408bb5afcfcd9c430549c5b31f8aa5c5848151c0a55f473c34d0180546001600160a01b03191684179055517f72114e270de66b9d2710ecf140403e5e99b1574767d6a8197bdc8d807a46e7c79190a250565b6033546001600160a01b031633146112f55760405162461bcd60e51b815260040161041190611913565b610a7481611421565b60408051606098891b6bffffffffffffffffffffffff19908116602080840191909152988a1b811660348301529690981b9095166048880152605c870193909352607c860191909152609c85015260e01b6001600160e01b03191660bc840152805160a081850301815260c09093019052815191012090565b6001600160a01b0381166113cd5760405162461bcd60e51b815260206004820152601860248201527f46656465726174696f6e3a20456d7074792062726964676500000000000000006044820152606401610411565b603480546001600160a01b0319166001600160a01b0383169081179091556040519081527f9775531310b2880b61484ed85cbb0b491c8fde3a07f289c63b925517827944979060200160405180910390a150565b6001600160a01b0381166114825760405162461bcd60e51b815260206004820152602260248201527f4f776e61626c653a206e6577206f776e6572206973207a65726f206164647265604482015261737360f01b6064820152608401610411565b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b828054828255906000526020600020908101928215611533579160200282015b8281111561153357825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906114fe565b5061153f929150611543565b5090565b5b8082111561153f5760008155600101611544565b6001600160a01b0381168114610a7457600080fd5b803561157881611558565b919050565b60006020828403121561158f57600080fd5b813561159a81611558565b9392505050565b6000602082840312156115b357600080fd5b5035919050565b803563ffffffff8116811461157857600080fd5b600080600080600080600060e0888a0312156115e957600080fd5b87356115f481611558565b9650602088013561160481611558565b9550604088013561161481611558565b9450606088013593506080880135925060a0880135915061163760c089016115ba565b905092959891949750929550565b600060208083528351808285015260005b8181101561167257858101830151858201604001528201611656565b81811115611684576000604083870101525b50601f01601f1916929092016040019392505050565b600080604083850312156116ad57600080fd5b8235915060208301356116bf81611558565b809150509250929050565b6020808252825182820181905260009190848201906040850190845b8181101561170b5783516001600160a01b0316835292840192918401916001016116e6565b50909695505050505050565b60008083601f84011261172957600080fd5b50813567ffffffffffffffff81111561174157600080fd5b60208301915083602082850101111561175957600080fd5b9250929050565b60008060008060008060008060a0898b03121561177c57600080fd5b8835975060208901359650604089013567ffffffffffffffff808211156117a257600080fd5b6117ae8c838d01611717565b909850965060608b01359150808211156117c757600080fd5b6117d38c838d01611717565b909650945060808b01359150808211156117ec57600080fd5b506117f98b828c01611717565b999c989b5096995094979396929594505050565b634e487b7160e01b600052604160045260246000fd5b6000806000806080858703121561183957600080fd5b843567ffffffffffffffff8082111561185157600080fd5b818701915087601f83011261186557600080fd5b81356020828211156118795761187961180d565b8160051b604051601f19603f8301168101818110868211171561189e5761189e61180d565b60405292835281830193508481018201928b8411156118bc57600080fd5b948201945b838610156118e1576118d28661156d565b855294820194938201936118c1565b98505088013595506118fa92505060408701905061156d565b91506119086060860161156d565b905092959194509250565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008282101561197057611970611948565b500390565b634e487b7160e01b600052603260045260246000fd5b600060001982141561199f5761199f611948565b5060010190565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b03968716815294861660208601529290941660408401526060830152608082019290925263ffffffff90911660a082015260c00190565b600082611a1757634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611a2f57611a2f611948565b500190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b88815287602082015260a060408201526000611a7d60a08301888a611a34565b8281036060840152611a90818789611a34565b90508281036080840152611aa5818587611a34565b9b9a5050505050505050505050565b60208082526028908201527f436f6e747261637420696e7374616e636520697320616c726561647920696e696040820152671d1a585b1a5e995960c21b60608201526080019056fea2646970667358221220131853999ada9a2b6c990add208c8f10c6a4444a915ec1a3d5e193e0b86dde0e64736f6c63430008090033", + "devdoc": { + "kind": "dev", + "methods": { + "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." + }, + "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." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 17666, + "contract": "contracts/Federation/FederationV2.sol:FederationV2", + "label": "initialized", + "offset": 0, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 17669, + "contract": "contracts/Federation/FederationV2.sol:FederationV2", + "label": "initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 17709, + "contract": "contracts/Federation/FederationV2.sol:FederationV2", + "label": "______gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 17955, + "contract": "contracts/Federation/FederationV2.sol:FederationV2", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 7633, + "contract": "contracts/Federation/FederationV2.sol:FederationV2", + "label": "bridge", + "offset": 0, + "slot": "52", + "type": "t_contract(IBridgeV3)6555" + }, + { + "astId": 7636, + "contract": "contracts/Federation/FederationV2.sol:FederationV2", + "label": "members", + "offset": 0, + "slot": "53", + "type": "t_array(t_address)dyn_storage" + }, + { + "astId": 7638, + "contract": "contracts/Federation/FederationV2.sol:FederationV2", + "label": "required", + "offset": 0, + "slot": "54", + "type": "t_uint256" + }, + { + "astId": 7642, + "contract": "contracts/Federation/FederationV2.sol:FederationV2", + "label": "isMember", + "offset": 0, + "slot": "55", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 7648, + "contract": "contracts/Federation/FederationV2.sol:FederationV2", + "label": "votes", + "offset": 0, + "slot": "56", + "type": "t_mapping(t_bytes32,t_mapping(t_address,t_bool))" + }, + { + "astId": 7652, + "contract": "contracts/Federation/FederationV2.sol:FederationV2", + "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(IBridgeV3)6555": { + "encoding": "inplace", + "label": "contract IBridgeV3", + "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/alphanet/MainToken.json b/bridge/deployments/alphanet/MainToken.json new file mode 100644 index 000000000..0ac176af0 --- /dev/null +++ b/bridge/deployments/alphanet/MainToken.json @@ -0,0 +1,508 @@ +{ + "address": "0x2D0b3915Ae7765B3ea7c097aC3e3e53421765335", + "abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint8", + "name": "decimals", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "totalSupply", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "transferAndCall", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x72ed73d6fd33305fec7af008555ebc0baf0240d58fe12dc19647ab0fb1920ea2", + "receipt": { + "to": null, + "from": "0x49A2731C440B0A217f817dB99145Ef5c2e3c9f4E", + "contractAddress": "0x2D0b3915Ae7765B3ea7c097aC3e3e53421765335", + "transactionIndex": 0, + "gasUsed": "977082", + "logsBloom": "0x00000000000000000000200000000000000000000000000000000000004000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000008000000000000000000000000000000000100000000000000020000000000000000000800000000000000000800000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xdfffd1c45e1734d5d07a2a1fc449fcd11c6f3a88f2681fe62cb3e768f6f7c101", + "transactionHash": "0x72ed73d6fd33305fec7af008555ebc0baf0240d58fe12dc19647ab0fb1920ea2", + "logs": [ + { + "transactionIndex": 0, + "blockNumber": 103930, + "transactionHash": "0x72ed73d6fd33305fec7af008555ebc0baf0240d58fe12dc19647ab0fb1920ea2", + "address": "0x2D0b3915Ae7765B3ea7c097aC3e3e53421765335", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000049a2731c440b0a217f817db99145ef5c2e3c9f4e" + ], + "data": "0x00000000000000000000000000000000000000000000003635c9adc5dea00000", + "logIndex": 0, + "blockHash": "0xdfffd1c45e1734d5d07a2a1fc449fcd11c6f3a88f2681fe62cb3e768f6f7c101" + } + ], + "blockNumber": 103930, + "cumulativeGasUsed": "977082", + "status": 1, + "byzantium": true + }, + "args": [ + "MAIN", + "MAIN", + 18, + "1000000000000000000000" + ], + "numDeployments": 1, + "solcInputHash": "bfc96d5f60348b72136d284c7b5c1536", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"decimals\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"totalSupply\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"transferAndCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5,05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"name()\":{\"details\":\"Returns the name of the token.\"},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}; Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for `sender`'s tokens of at least `amount`.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"transferAndCall(address,uint256,bytes)\":{\"notice\":\"ERC-677's only method implementation See https://github.com/ethereum/EIPs/issues/677 for details\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/test/MainToken.sol\":\"MainToken\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"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}\",\"keccak256\":\"0x6d12e4170c1a66ca5458fa54e52dab12a4688fdea8b986e45da646662e9e2dc5\",\"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/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\",\"keccak256\":\"0x3d82d998d70e0566ebab88b6ca3d508cbf792ecb2e5e24e05673ae904e1a7bd8\",\"license\":\"MIT\"},\"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\",\"keccak256\":\"0x5bf88e16fc63ce679a8b5fe79fc6890f725b5afba2d9b2d3b63ebccf2e09ed64\",\"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\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162000f6b38038062000f6b83398101604081905262000034916200037b565b83838382600090805190602001906200004f92919062000208565b5081516200006590600190602085019062000208565b506002805460ff191660ff9290921691909117905550620000899050338262000093565b505050506200046a565b6001600160a01b038216620000ef5760405162461bcd60e51b815260206004820152601b60248201527f45524332303a206d696e7420746f207a65726f2061646472657373000000000060448201526064015b60405180910390fd5b6200010b816005546200019e60201b6200044c1790919060201c565b6005556001600160a01b038216600090815260036020908152604090912054620001409183906200044c6200019e821b17901c565b6001600160a01b0383166000818152600360205260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90620001929085815260200190565b60405180910390a35050565b600080620001ad838562000406565b905083811015620002015760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401620000e6565b9392505050565b82805462000216906200042d565b90600052602060002090601f0160209004810192826200023a576000855562000285565b82601f106200025557805160ff191683800117855562000285565b8280016001018555821562000285579182015b828111156200028557825182559160200191906001019062000268565b506200029392915062000297565b5090565b5b8082111562000293576000815560010162000298565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620002d657600080fd5b81516001600160401b0380821115620002f357620002f3620002ae565b604051601f8301601f19908116603f011681019082821181831017156200031e576200031e620002ae565b816040528381526020925086838588010111156200033b57600080fd5b600091505b838210156200035f578582018301518183018401529082019062000340565b83821115620003715760008385830101525b9695505050505050565b600080600080608085870312156200039257600080fd5b84516001600160401b0380821115620003aa57600080fd5b620003b888838901620002c4565b95506020870151915080821115620003cf57600080fd5b50620003de87828801620002c4565b935050604085015160ff81168114620003f657600080fd5b6060959095015193969295505050565b600082198211156200042857634e487b7160e01b600052601160045260246000fd5b500190565b600181811c908216806200044257607f821691505b602082108114156200046457634e487b7160e01b600052602260045260246000fd5b50919050565b610af1806200047a6000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c80634000aea0116100715780634000aea01461014757806370a082311461015a57806395d89b4114610183578063a457c2d71461018b578063a9059cbb1461019e578063dd62ed3e146101b157600080fd5b806306fdde03146100b9578063095ea7b3146100d757806318160ddd146100fa57806323b872dd1461010c578063313ce5671461011f5780633950935114610134575b600080fd5b6100c16101ea565b6040516100ce91906107bb565b60405180910390f35b6100ea6100e53660046107ea565b61027c565b60405190151581526020016100ce565b6005545b6040519081526020016100ce565b6100ea61011a366004610814565b610292565b60025460405160ff90911681526020016100ce565b6100ea6101423660046107ea565b6102fc565b6100ea610155366004610866565b610332565b6100fe610168366004610931565b6001600160a01b031660009081526003602052604090205490565b6100c16103e1565b6100ea6101993660046107ea565b6103f0565b6100ea6101ac3660046107ea565b61043f565b6100fe6101bf36600461094c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6060600080546101f99061097f565b80601f01602080910402602001604051908101604052809291908181526020018280546102259061097f565b80156102725780601f1061024757610100808354040283529160200191610272565b820191906000526020600020905b81548152906001019060200180831161025557829003601f168201915b5050505050905090565b60006102893384846104b0565b50600192915050565b600061029f8484846105be565b6102f184336102ec85604051806060016040528060288152602001610a6f602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610734565b6104b0565b5060015b9392505050565b3360008181526004602090815260408083206001600160a01b038716845290915281205490916102899185906102ec908661044c565b60008061033f858561043f565b9050806103505760009150506102f5565b60405163607705c560e11b815285906001600160a01b0382169063c0ee0b8a90610382903390899089906004016109ba565b602060405180830381600087803b15801561039c57600080fd5b505af11580156103b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d491906109e1565b5060019695505050505050565b6060600180546101f99061097f565b600061028933846102ec85604051806060016040528060258152602001610a97602591393360009081526004602090815260408083206001600160a01b038d1684529091529020549190610734565b60006102893384846105be565b6000806104598385610a19565b9050838110156102f55760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064015b60405180910390fd5b6001600160a01b0383166105065760405162461bcd60e51b815260206004820181905260248201527f45524332303a20617070726f76652066726f6d207a65726f206164647265737360448201526064016104a7565b6001600160a01b03821661055c5760405162461bcd60e51b815260206004820152601e60248201527f45524332303a20617070726f766520746f207a65726f2061646472657373000060448201526064016104a7565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b03831661061e5760405162461bcd60e51b815260206004820152602160248201527f45524332303a207472616e736665722066726f6d207a65726f206164647265736044820152607360f81b60648201526084016104a7565b6001600160a01b0382166106745760405162461bcd60e51b815260206004820152601f60248201527f45524332303a207472616e7366657220746f207a65726f20616464726573730060448201526064016104a7565b6106b181604051806060016040528060268152602001610a49602691396001600160a01b0386166000908152600360205260409020549190610734565b6001600160a01b0380851660009081526003602052604080822093909355908416815220546106e0908261044c565b6001600160a01b0380841660008181526003602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906105b19085815260200190565b600081848411156107585760405162461bcd60e51b81526004016104a791906107bb565b5060006107658486610a31565b95945050505050565b6000815180845260005b8181101561079457602081850181015186830182015201610778565b818111156107a6576000602083870101525b50601f01601f19169290920160200192915050565b6020815260006102f5602083018461076e565b80356001600160a01b03811681146107e557600080fd5b919050565b600080604083850312156107fd57600080fd5b610806836107ce565b946020939093013593505050565b60008060006060848603121561082957600080fd5b610832846107ce565b9250610840602085016107ce565b9150604084013590509250925092565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561087b57600080fd5b610884846107ce565b925060208401359150604084013567ffffffffffffffff808211156108a857600080fd5b818601915086601f8301126108bc57600080fd5b8135818111156108ce576108ce610850565b604051601f8201601f19908116603f011681019083821181831017156108f6576108f6610850565b8160405282815289602084870101111561090f57600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b60006020828403121561094357600080fd5b6102f5826107ce565b6000806040838503121561095f57600080fd5b610968836107ce565b9150610976602084016107ce565b90509250929050565b600181811c9082168061099357607f821691505b602082108114156109b457634e487b7160e01b600052602260045260246000fd5b50919050565b60018060a01b0384168152826020820152606060408201526000610765606083018461076e565b6000602082840312156109f357600080fd5b815180151581146102f557600080fd5b634e487b7160e01b600052601160045260246000fd5b60008219821115610a2c57610a2c610a03565b500190565b600082821015610a4357610a43610a03565b50039056fe45524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220f6b3b1e2c5d06b427ee0a0a93ffd8ff3c7ab50a22a03205c31f4c7f2ab9ada8e64736f6c63430008090033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80634000aea0116100715780634000aea01461014757806370a082311461015a57806395d89b4114610183578063a457c2d71461018b578063a9059cbb1461019e578063dd62ed3e146101b157600080fd5b806306fdde03146100b9578063095ea7b3146100d757806318160ddd146100fa57806323b872dd1461010c578063313ce5671461011f5780633950935114610134575b600080fd5b6100c16101ea565b6040516100ce91906107bb565b60405180910390f35b6100ea6100e53660046107ea565b61027c565b60405190151581526020016100ce565b6005545b6040519081526020016100ce565b6100ea61011a366004610814565b610292565b60025460405160ff90911681526020016100ce565b6100ea6101423660046107ea565b6102fc565b6100ea610155366004610866565b610332565b6100fe610168366004610931565b6001600160a01b031660009081526003602052604090205490565b6100c16103e1565b6100ea6101993660046107ea565b6103f0565b6100ea6101ac3660046107ea565b61043f565b6100fe6101bf36600461094c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6060600080546101f99061097f565b80601f01602080910402602001604051908101604052809291908181526020018280546102259061097f565b80156102725780601f1061024757610100808354040283529160200191610272565b820191906000526020600020905b81548152906001019060200180831161025557829003601f168201915b5050505050905090565b60006102893384846104b0565b50600192915050565b600061029f8484846105be565b6102f184336102ec85604051806060016040528060288152602001610a6f602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610734565b6104b0565b5060015b9392505050565b3360008181526004602090815260408083206001600160a01b038716845290915281205490916102899185906102ec908661044c565b60008061033f858561043f565b9050806103505760009150506102f5565b60405163607705c560e11b815285906001600160a01b0382169063c0ee0b8a90610382903390899089906004016109ba565b602060405180830381600087803b15801561039c57600080fd5b505af11580156103b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d491906109e1565b5060019695505050505050565b6060600180546101f99061097f565b600061028933846102ec85604051806060016040528060258152602001610a97602591393360009081526004602090815260408083206001600160a01b038d1684529091529020549190610734565b60006102893384846105be565b6000806104598385610a19565b9050838110156102f55760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064015b60405180910390fd5b6001600160a01b0383166105065760405162461bcd60e51b815260206004820181905260248201527f45524332303a20617070726f76652066726f6d207a65726f206164647265737360448201526064016104a7565b6001600160a01b03821661055c5760405162461bcd60e51b815260206004820152601e60248201527f45524332303a20617070726f766520746f207a65726f2061646472657373000060448201526064016104a7565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b03831661061e5760405162461bcd60e51b815260206004820152602160248201527f45524332303a207472616e736665722066726f6d207a65726f206164647265736044820152607360f81b60648201526084016104a7565b6001600160a01b0382166106745760405162461bcd60e51b815260206004820152601f60248201527f45524332303a207472616e7366657220746f207a65726f20616464726573730060448201526064016104a7565b6106b181604051806060016040528060268152602001610a49602691396001600160a01b0386166000908152600360205260409020549190610734565b6001600160a01b0380851660009081526003602052604080822093909355908416815220546106e0908261044c565b6001600160a01b0380841660008181526003602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906105b19085815260200190565b600081848411156107585760405162461bcd60e51b81526004016104a791906107bb565b5060006107658486610a31565b95945050505050565b6000815180845260005b8181101561079457602081850181015186830182015201610778565b818111156107a6576000602083870101525b50601f01601f19169290920160200192915050565b6020815260006102f5602083018461076e565b80356001600160a01b03811681146107e557600080fd5b919050565b600080604083850312156107fd57600080fd5b610806836107ce565b946020939093013593505050565b60008060006060848603121561082957600080fd5b610832846107ce565b9250610840602085016107ce565b9150604084013590509250925092565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561087b57600080fd5b610884846107ce565b925060208401359150604084013567ffffffffffffffff808211156108a857600080fd5b818601915086601f8301126108bc57600080fd5b8135818111156108ce576108ce610850565b604051601f8201601f19908116603f011681019083821181831017156108f6576108f6610850565b8160405282815289602084870101111561090f57600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b60006020828403121561094357600080fd5b6102f5826107ce565b6000806040838503121561095f57600080fd5b610968836107ce565b9150610976602084016107ce565b90509250929050565b600181811c9082168061099357607f821691505b602082108114156109b457634e487b7160e01b600052602260045260246000fd5b50919050565b60018060a01b0384168152826020820152606060408201526000610765606083018461076e565b6000602082840312156109f357600080fd5b815180151581146102f557600080fd5b634e487b7160e01b600052601160045260246000fd5b60008219821115610a2c57610a2c610a03565b500190565b600082821015610a4357610a43610a03565b50039056fe45524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220f6b3b1e2c5d06b427ee0a0a93ffd8ff3c7ab50a22a03205c31f4c7f2ab9ada8e64736f6c63430008090033", + "devdoc": { + "kind": "dev", + "methods": { + "allowance(address,address)": { + "details": "See {IERC20-allowance}." + }, + "approve(address,uint256)": { + "details": "See {IERC20-approve}. Requirements: - `spender` cannot be the zero address." + }, + "balanceOf(address)": { + "details": "See {IERC20-balanceOf}." + }, + "decimals()": { + "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5,05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." + }, + "decreaseAllowance(address,uint256)": { + "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." + }, + "increaseAllowance(address,uint256)": { + "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." + }, + "name()": { + "details": "Returns the name of the token." + }, + "symbol()": { + "details": "Returns the symbol of the token, usually a shorter version of the name." + }, + "totalSupply()": { + "details": "See {IERC20-totalSupply}." + }, + "transfer(address,uint256)": { + "details": "See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}; Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for `sender`'s tokens of at least `amount`." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "transferAndCall(address,uint256,bytes)": { + "notice": "ERC-677's only method implementation See https://github.com/ethereum/EIPs/issues/677 for details" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 14784, + "contract": "contracts/test/MainToken.sol:MainToken", + "label": "_name", + "offset": 0, + "slot": "0", + "type": "t_string_storage" + }, + { + "astId": 14786, + "contract": "contracts/test/MainToken.sol:MainToken", + "label": "_symbol", + "offset": 0, + "slot": "1", + "type": "t_string_storage" + }, + { + "astId": 14788, + "contract": "contracts/test/MainToken.sol:MainToken", + "label": "_decimals", + "offset": 0, + "slot": "2", + "type": "t_uint8" + }, + { + "astId": 14359, + "contract": "contracts/test/MainToken.sol:MainToken", + "label": "_balances", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 14365, + "contract": "contracts/test/MainToken.sol:MainToken", + "label": "_allowances", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" + }, + { + "astId": 14367, + "contract": "contracts/test/MainToken.sol:MainToken", + "label": "_totalSupply", + "offset": 0, + "slot": "5", + "type": "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/alphanet/MultiSigWallet.json b/bridge/deployments/alphanet/MultiSigWallet.json new file mode 100644 index 000000000..3163007f8 --- /dev/null +++ b/bridge/deployments/alphanet/MultiSigWallet.json @@ -0,0 +1,844 @@ +{ + "address": "0xe16b04a1a87aC65a4aF8D46a8b797D0d46572408", + "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": "0x45b9cf9dfef6158320b019bd8952ba93b79b6cbb918cf8e12ca39b730d35d4a1", + "receipt": { + "to": null, + "from": "0x49A2731C440B0A217f817dB99145Ef5c2e3c9f4E", + "contractAddress": "0xe16b04a1a87aC65a4aF8D46a8b797D0d46572408", + "transactionIndex": 0, + "gasUsed": "2171079", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x829e27bd2893dd344e8d8d64ef4923baae245986fd91227f4b3dc0cb9d450d04", + "transactionHash": "0x45b9cf9dfef6158320b019bd8952ba93b79b6cbb918cf8e12ca39b730d35d4a1", + "logs": [], + "blockNumber": 103896, + "cumulativeGasUsed": "2171079", + "status": 1, + "byzantium": true + }, + "args": [ + [ + "0x49A2731C440B0A217f817dB99145Ef5c2e3c9f4E" + ], + 1 + ], + "numDeployments": 1, + "solcInputHash": "bfc96d5f60348b72136d284c7b5c1536", + "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": 8372, + "contract": "contracts/MultiSigWallet.sol:MultiSigWallet", + "label": "transactions", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_uint256,t_struct(Transaction)8398_storage)" + }, + { + "astId": 8378, + "contract": "contracts/MultiSigWallet.sol:MultiSigWallet", + "label": "confirmations", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint256,t_mapping(t_address,t_bool))" + }, + { + "astId": 8382, + "contract": "contracts/MultiSigWallet.sol:MultiSigWallet", + "label": "isOwner", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 8385, + "contract": "contracts/MultiSigWallet.sol:MultiSigWallet", + "label": "owners", + "offset": 0, + "slot": "3", + "type": "t_array(t_address)dyn_storage" + }, + { + "astId": 8387, + "contract": "contracts/MultiSigWallet.sol:MultiSigWallet", + "label": "required", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 8389, + "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)8398_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct MultiSigWallet.Transaction)", + "numberOfBytes": "32", + "value": "t_struct(Transaction)8398_storage" + }, + "t_struct(Transaction)8398_storage": { + "encoding": "inplace", + "label": "struct MultiSigWallet.Transaction", + "members": [ + { + "astId": 8391, + "contract": "contracts/MultiSigWallet.sol:MultiSigWallet", + "label": "destination", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 8393, + "contract": "contracts/MultiSigWallet.sol:MultiSigWallet", + "label": "value", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 8395, + "contract": "contracts/MultiSigWallet.sol:MultiSigWallet", + "label": "data", + "offset": 0, + "slot": "2", + "type": "t_bytes_storage" + }, + { + "astId": 8397, + "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/alphanet/ProxyAdmin.json b/bridge/deployments/alphanet/ProxyAdmin.json new file mode 100644 index 000000000..dfc5c1485 --- /dev/null +++ b/bridge/deployments/alphanet/ProxyAdmin.json @@ -0,0 +1,262 @@ +{ + "address": "0x56183c2CCBe444f6217dA6cAF1F8000410542104", + "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": "0x907955024d242890f9777d358fb2aca397e89e07003a2a20a31bed460396ffb0", + "receipt": { + "to": null, + "from": "0x49A2731C440B0A217f817dB99145Ef5c2e3c9f4E", + "contractAddress": "0x56183c2CCBe444f6217dA6cAF1F8000410542104", + "transactionIndex": 0, + "gasUsed": "599966", + "logsBloom": "0x00000000000000000000200000000000000000000000000000800000000000000000000000000000000000000000000000010400000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000800800000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x6ca6f94bf2defe96fe07a56b48f4f7bc87823da56b0309b786aed7a3fecb2e81", + "transactionHash": "0x907955024d242890f9777d358fb2aca397e89e07003a2a20a31bed460396ffb0", + "logs": [ + { + "transactionIndex": 0, + "blockNumber": 103897, + "transactionHash": "0x907955024d242890f9777d358fb2aca397e89e07003a2a20a31bed460396ffb0", + "address": "0x56183c2CCBe444f6217dA6cAF1F8000410542104", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000049a2731c440b0a217f817db99145ef5c2e3c9f4e" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x6ca6f94bf2defe96fe07a56b48f4f7bc87823da56b0309b786aed7a3fecb2e81" + } + ], + "blockNumber": 103897, + "cumulativeGasUsed": "599966", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "bfc96d5f60348b72136d284c7b5c1536", + "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": 12757, + "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/alphanet/SideTokenFactoryV1.json b/bridge/deployments/alphanet/SideTokenFactoryV1.json new file mode 100644 index 000000000..a1177c219 --- /dev/null +++ b/bridge/deployments/alphanet/SideTokenFactoryV1.json @@ -0,0 +1,163 @@ +{ + "address": "0x8f32871C464E254e1DDb1b8be1444c201a6E656C", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "sideToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "symbol", + "type": "string" + } + ], + "name": "CreatedSideToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "PrimaryTransferred", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + } + ], + "name": "createSideToken", + "outputs": [ + { + "internalType": "contract SideTokenV1", + "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": "0x5568a3296ad53a60d8a97607be73c7f8a4ef5825067e4efc22cba6bbc98f483a", + "receipt": { + "to": null, + "from": "0x49A2731C440B0A217f817dB99145Ef5c2e3c9f4E", + "contractAddress": "0x8f32871C464E254e1DDb1b8be1444c201a6E656C", + "transactionIndex": 0, + "gasUsed": "2635320", + "logsBloom": "0x00000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000800000000000000000000100000", + "blockHash": "0x2ba06f0f533e8c5c90a3f5967dc2fa6162814140168228f77ae01540c3bb585c", + "transactionHash": "0x5568a3296ad53a60d8a97607be73c7f8a4ef5825067e4efc22cba6bbc98f483a", + "logs": [ + { + "transactionIndex": 0, + "blockNumber": 103901, + "transactionHash": "0x5568a3296ad53a60d8a97607be73c7f8a4ef5825067e4efc22cba6bbc98f483a", + "address": "0x8f32871C464E254e1DDb1b8be1444c201a6E656C", + "topics": [ + "0x4101e71e974f68df5e9730cc223280b41654676bbb052cdcc735c3337e64d2d9" + ], + "data": "0x00000000000000000000000049a2731c440b0a217f817db99145ef5c2e3c9f4e", + "logIndex": 0, + "blockHash": "0x2ba06f0f533e8c5c90a3f5967dc2fa6162814140168228f77ae01540c3bb585c" + } + ], + "blockNumber": 103901, + "cumulativeGasUsed": "2635320", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "bfc96d5f60348b72136d284c7b5c1536", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sideToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"}],\"name\":\"CreatedSideToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"PrimaryTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"}],\"name\":\"createSideToken\",\"outputs\":[{\"internalType\":\"contract SideTokenV1\",\"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/SideTokenFactoryV1.sol\":\"SideTokenFactoryV1\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"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}\",\"keccak256\":\"0xc49437b3915e15f13364cd5a91c3f90cf1e63768556ddd1c7d50482fcc19c2a4\",\"license\":\"MIT\"},\"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}\",\"keccak256\":\"0x7754cde7712b09e5ab4ce3f6a8fe567d9cefda1cd4ffe29b6998d8bfb9eac82c\",\"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": "0x608060405234801561001057600080fd5b50600080546001600160a01b0319163390811790915560408051918252517f4101e71e974f68df5e9730cc223280b41654676bbb052cdcc735c3337e64d2d99181900360200190a161258f806100676000396000f3fe60806040523480156200001157600080fd5b5060043610620000465760003560e01c80632348238c146200004b578063bb3a39ee1462000064578063c6dbdf611462000097575b600080fd5b620000626200005c36600462000289565b620000a9565b005b6200007b6200007536600462000307565b620001a7565b6040516001600160a01b03909116815260200160405180910390f35b6000546001600160a01b03166200007b565b6000546001600160a01b0316336001600160a01b031614620000e85760405162461bcd60e51b8152600401620000df906200037a565b60405180910390fd5b6001600160a01b038116620001535760405162461bcd60e51b815260206004820152602a60248201527f5365636f6e646172793a206e6577207072696d61727920697320746865207a65604482015269726f206164647265737360b01b6064820152608401620000df565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f4101e71e974f68df5e9730cc223280b41654676bbb052cdcc735c3337e64d2d99060200160405180910390a150565b600080546001600160a01b0316336001600160a01b031614620001de5760405162461bcd60e51b8152600401620000df906200037a565b600085858585620001f76000546001600160a01b031690565b60405162000205906200027b565b62000215959493929190620003ef565b604051809103906000f08015801562000232573d6000803e3d6000fd5b5090507f316f047f5c065537114379c7b7365dadd3cdf36ec1c32b528520bb31beaf37178185856040516200026a9392919062000435565b60405180910390a195945050505050565b6120f4806200046683390190565b6000602082840312156200029c57600080fd5b81356001600160a01b0381168114620002b457600080fd5b9392505050565b60008083601f840112620002ce57600080fd5b50813567ffffffffffffffff811115620002e757600080fd5b6020830191508360208285010111156200030057600080fd5b9250929050565b600080600080604085870312156200031e57600080fd5b843567ffffffffffffffff808211156200033757600080fd5b6200034588838901620002bb565b909650945060208701359150808211156200035f57600080fd5b506200036e87828801620002bb565b95989497509550505050565b6020808252602c908201527f5365636f6e646172793a2063616c6c6572206973206e6f74207468652070726960408201526b1b585c9e481858d8dbdd5b9d60a21b606082015260800190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600062000405606083018789620003c6565b82810360208401526200041a818688620003c6565b91505060018060a01b03831660408301529695505050505050565b6001600160a01b03841681526040602082018190526000906200045c9083018486620003c6565b9594505050505056fe60806040523480156200001157600080fd5b50604051620020f4380380620020f4833981016040819052620000349162000484565b60408051600081526020808201909252845185928592916200005d9160029190860190620002b9565b50815162000073906003906020850190620002b9565b5080516200008990600490602084019062000348565b5060005b600454811015620000fd5760016005600060048481548110620000b457620000b462000511565b6000918252602080832091909101546001600160a01b031683528201929092526040019020805460ff191691151591909117905580620000f48162000527565b9150506200008d565b506040516329965a1d60e01b815230600482018190527fac7fbab5f54a3ca8194167523c6753bfeb96a445279294b6125b68cce217705460248301526044820152731820a4b7618bde71dce8cdc73aab6c95905fad24906329965a1d90606401600060405180830381600087803b1580156200017857600080fd5b505af11580156200018d573d6000803e3d6000fd5b50506040516329965a1d60e01b815230600482018190527faea199e31a596269b42cdafd93407f14436db6e4cad65417994c2eb37381e05a60248301526044820152731820a4b7618bde71dce8cdc73aab6c95905fad2492506329965a1d9150606401600060405180830381600087803b1580156200020b57600080fd5b505af115801562000220573d6000803e3d6000fd5b50505050506001600160a01b038316151591506200029090505760405162461bcd60e51b815260206004820152602160248201527f53696465546f6b656e3a204d696e7465722061646472657373206973206e756c6044820152601b60fa1b606482015260840160405180910390fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055506200058e9050565b828054620002c79062000551565b90600052602060002090601f016020900481019282620002eb576000855562000336565b82601f106200030657805160ff191683800117855562000336565b8280016001018555821562000336579182015b828111156200033657825182559160200191906001019062000319565b5062000344929150620003a0565b5090565b82805482825590600052602060002090810192821562000336579160200282015b828111156200033657825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062000369565b5b80821115620003445760008155600101620003a1565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620003df57600080fd5b81516001600160401b0380821115620003fc57620003fc620003b7565b604051601f8301601f19908116603f01168101908282118183101715620004275762000427620003b7565b816040528381526020925086838588010111156200044457600080fd5b600091505b8382101562000468578582018301518183018401529082019062000449565b838211156200047a5760008385830101525b9695505050505050565b6000806000606084860312156200049a57600080fd5b83516001600160401b0380821115620004b257600080fd5b620004c087838801620003cd565b94506020860151915080821115620004d757600080fd5b50620004e686828701620003cd565b604086015190935090506001600160a01b03811681146200050657600080fd5b809150509250925092565b634e487b7160e01b600052603260045260246000fd5b60006000198214156200054a57634e487b7160e01b600052601160045260246000fd5b5060010190565b600181811c908216806200056657607f821691505b602082108114156200058857634e487b7160e01b600052602260045260246000fd5b50919050565b611b56806200059e6000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c8063959b8c3f116100ad578063dcdc7dd011610071578063dcdc7dd01461027f578063dd62ed3e14610292578063fad8b32a146102cb578063fc673c4f146102de578063fe9d9303146102f157600080fd5b8063959b8c3f1461022b57806395d89b411461023e5780639bd9bbc614610246578063a9059cbb14610259578063d95b63711461026c57600080fd5b806323b872dd116100f457806323b872dd146101c4578063313ce567146101d7578063556f0dc7146101e657806362ad1b83146101ed57806370a082311461020257600080fd5b806306e485381461013157806306fdde031461014f5780630754617214610164578063095ea7b31461018f57806318160ddd146101b2575b600080fd5b610139610304565b604051610146919061159c565b60405180910390f35b610157610366565b6040516101469190611636565b600954610177906001600160a01b031681565b6040516001600160a01b039091168152602001610146565b6101a261019d366004611661565b6103ef565b6040519015158152602001610146565b6001545b604051908152602001610146565b6101a26101d236600461168d565b610407565b60405160128152602001610146565b60016101b6565b6102006101fb366004611717565b6105af565b005b6101b66102103660046117b6565b6001600160a01b031660009081526020819052604090205490565b6102006102393660046117b6565b610658565b610157610776565b6102006102543660046117d3565b610785565b6101a2610267366004611661565b6107df565b6101a261027a36600461182f565b6108c2565b61020061028d366004611868565b610964565b6101b66102a036600461182f565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b6102006102d93660046117b6565b610a51565b6102006102ec366004611868565b610b6d565b6102006102ff3660046118f4565b610c09565b6060600480548060200260200160405190810160405280929190818152602001828054801561035c57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161033e575b5050505050905090565b60606002805461037590611940565b80601f01602080910402602001604051908101604052809291908181526020018280546103a190611940565b801561035c5780601f106103c35761010080835404028352916020019161035c565b820191906000526020600020905b8154815290600101906020018083116103d157509395945050505050565b6000336103fd818585610c5e565b5060019392505050565b60006001600160a01b0383166104645760405162461bcd60e51b815260206004820181905260248201527f4552433737373a207472616e7366657220746f207a65726f206164647265737360448201526064015b60405180910390fd5b6001600160a01b0384166104c55760405162461bcd60e51b815260206004820152602260248201527f4552433737373a207472616e736665722066726f6d207a65726f206164647265604482015261737360f01b606482015260840161045b565b60003390506104f6818686866040518060200160405280600081525060405180602001604052806000815250610d15565b610522818686866040518060200160405280600081525060405180602001604052806000815250610e4b565b610576858261057186604051806060016040528060298152602001611ad5602991396001600160a01b03808c166000908152600860209081526040808320938b16835292905220549190610f6d565b610c5e565b6105a48186868660405180602001604052806000815250604051806020016040528060008152506000610fa7565b506001949350505050565b6105b933886108c2565b6105d55760405162461bcd60e51b815260040161045b9061197b565b61064f3388888888888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8c018190048102820181019092528a815292508a91508990819084018382808284376000920191909152506001925061117b915050565b50505050505050565b336001600160a01b03821614156106bd5760405162461bcd60e51b8152602060048201526024808201527f4552433737373a20617574686f72697a696e672073656c66206173206f70657260448201526330ba37b960e11b606482015260840161045b565b6001600160a01b03811660009081526005602052604090205460ff161561070e573360009081526007602090815260408083206001600160a01b03851684529091529020805460ff1916905561073d565b3360009081526006602090815260408083206001600160a01b03851684529091529020805460ff191660011790555b60405133906001600160a01b038316907ff4caeb2d6ca8932a215a353d0703c326ec2d81fc68170f320eb2ab49e9df61f990600090a350565b60606003805461037590611940565b6107d93333868686868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250604080516020810190915290815292506001915061117b9050565b50505050565b60006001600160a01b0383166108375760405162461bcd60e51b815260206004820181905260248201527f4552433737373a207472616e7366657220746f207a65726f2061646472657373604482015260640161045b565b6000339050610868818286866040518060200160405280600081525060405180602001604052806000815250610d15565b610894818286866040518060200160405280600081525060405180602001604052806000815250610e4b565b6103fd8182868660405180602001604052806000815250604051806020016040528060008152506000610fa7565b6000816001600160a01b0316836001600160a01b0316148061092d57506001600160a01b03831660009081526005602052604090205460ff16801561092d57506001600160a01b0380831660009081526007602090815260408083209387168352929052205460ff16155b8061095d57506001600160a01b0380831660009081526006602090815260408083209387168352929052205460ff165b9392505050565b6009546001600160a01b0316336001600160a01b0316146109d35760405162461bcd60e51b815260206004820152602360248201527f53696465546f6b656e3a2043616c6c6572206973206e6f7420746865206d696e6044820152623a32b960e91b606482015260840161045b565b610a4933878787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8b01819004810282018101909252898152925089915088908190840183828082843760009201919091525061125292505050565b505050505050565b6001600160a01b038116331415610ab45760405162461bcd60e51b815260206004820152602160248201527f4552433737373a207265766f6b696e672073656c66206173206f70657261746f6044820152603960f91b606482015260840161045b565b6001600160a01b03811660009081526005602052604090205460ff1615610b08573360009081526007602090815260408083206001600160a01b03851684529091529020805460ff19166001179055610b34565b3360009081526006602090815260408083206001600160a01b03851684529091529020805460ff191690555b60405133906001600160a01b038316907f50546e66e5f44d728365dc3908c63bc5cfeeab470722c1677e3073a6ac294aa190600090a350565b610b7733876108c2565b610b935760405162461bcd60e51b815260040161045b9061197b565b610a4933878787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8b0181900481028201810190925289815292508991508890819084018382808284376000920191909152506113a092505050565b610c5933338585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250604080516020810190915290815292506113a0915050565b505050565b6001600160a01b038216610cb45760405162461bcd60e51b815260206004820152601f60248201527f4552433737373a20617070726f766520746f207a65726f206164647265737300604482015260640161045b565b6001600160a01b0383811660008181526008602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60405163555ddc6560e11b81526001600160a01b03861660048201527f29ddb589b1fb5fc7cf394961c1adf5f8c6454761adf795e67fe149f658abe8956024820152600090731820a4b7618bde71dce8cdc73aab6c95905fad249063aabbb8ca9060440160206040518083038186803b158015610d9157600080fd5b505afa158015610da5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc991906119bc565b90506001600160a01b0381161561064f57604051633ad5cbc160e11b81526001600160a01b038216906375ab978290610e10908a908a908a908a908a908a906004016119d9565b600060405180830381600087803b158015610e2a57600080fd5b505af1158015610e3e573d6000803e3d6000fd5b5050505050505050505050565b610e8883604051806060016040528060278152602001611aae602791396001600160a01b0388166000908152602081905260409020549190610f6d565b6001600160a01b038087166000908152602081905260408082209390935590861681522054610eb790846114fb565b6001600160a01b0380861660008181526020819052604090819020939093559151878216918916907f06b541ddaa720db2b10a4d0cdac39b8d360425fc073085fac19bc8261467798790610f1090889088908890611a33565b60405180910390a4836001600160a01b0316856001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051610f5d91815260200190565b60405180910390a3505050505050565b60008184841115610f915760405162461bcd60e51b815260040161045b9190611636565b506000610f9e8486611a7e565b95945050505050565b60405163555ddc6560e11b81526001600160a01b03861660048201527fb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b6024820152600090731820a4b7618bde71dce8cdc73aab6c95905fad249063aabbb8ca9060440160206040518083038186803b15801561102357600080fd5b505afa158015611037573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105b91906119bc565b90506001600160a01b038116156110d7576040516223de2960e01b81526001600160a01b038216906223de29906110a0908b908b908b908b908b908b906004016119d9565b600060405180830381600087803b1580156110ba57600080fd5b505af11580156110ce573d6000803e3d6000fd5b50505050611171565b8115611171576001600160a01b0386163b156111715760405162461bcd60e51b815260206004820152604d60248201527f4552433737373a20746f6b656e20726563697069656e7420636f6e747261637460448201527f20686173206e6f20696d706c656d656e74657220666f7220455243373737546f60648201526c1ad95b9cd49958da5c1a595b9d609a1b608482015260a40161045b565b5050505050505050565b6001600160a01b0386166111d15760405162461bcd60e51b815260206004820152601e60248201527f4552433737373a2073656e642066726f6d207a65726f20616464726573730000604482015260640161045b565b6001600160a01b0385166112275760405162461bcd60e51b815260206004820152601c60248201527f4552433737373a2073656e6420746f207a65726f206164647265737300000000604482015260640161045b565b611235878787878787610d15565b611243878787878787610e4b565b61064f87878787878787610fa7565b6001600160a01b0384166112a85760405162461bcd60e51b815260206004820152601c60248201527f4552433737373a206d696e7420746f207a65726f206164647265737300000000604482015260640161045b565b6001546112b590846114fb565b6001556001600160a01b0384166000908152602081905260409020546112db90846114fb565b6001600160a01b038516600090815260208190526040812091909155611308908690868686866001610fa7565b836001600160a01b0316856001600160a01b03167f2fe5be0146f74c5bce36c0b80911af6c7d86ff27e89d5cfa61fc681327954e5d85858560405161134f93929190611a33565b60405180910390a36040518381526001600160a01b038516906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a35050505050565b6001600160a01b0384166113f65760405162461bcd60e51b815260206004820152601e60248201527f4552433737373a206275726e2066726f6d207a65726f20616464726573730000604482015260640161045b565b61140585856000868686610d15565b61144283604051806060016040528060238152602001611afe602391396001600160a01b0387166000908152602081905260409020549190610f6d565b6001600160a01b038516600090815260208190526040902055600154611468908461155a565b600181905550836001600160a01b0316856001600160a01b03167fa78a9be3a7b862d26933ad85fb11d80ef66b8f972d7cbba06621d583943a40988585856040516114b593929190611a33565b60405180910390a36040518381526000906001600160a01b038616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001611391565b6000806115088385611a95565b90508381101561095d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161045b565b600061095d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f6d565b6020808252825182820181905260009190848201906040850190845b818110156115dd5783516001600160a01b0316835292840192918401916001016115b8565b50909695505050505050565b6000815180845260005b8181101561160f576020818501810151868301820152016115f3565b81811115611621576000602083870101525b50601f01601f19169290920160200192915050565b60208152600061095d60208301846115e9565b6001600160a01b038116811461165e57600080fd5b50565b6000806040838503121561167457600080fd5b823561167f81611649565b946020939093013593505050565b6000806000606084860312156116a257600080fd5b83356116ad81611649565b925060208401356116bd81611649565b929592945050506040919091013590565b60008083601f8401126116e057600080fd5b50813567ffffffffffffffff8111156116f857600080fd5b60208301915083602082850101111561171057600080fd5b9250929050565b600080600080600080600060a0888a03121561173257600080fd5b873561173d81611649565b9650602088013561174d81611649565b955060408801359450606088013567ffffffffffffffff8082111561177157600080fd5b61177d8b838c016116ce565b909650945060808a013591508082111561179657600080fd5b506117a38a828b016116ce565b989b979a50959850939692959293505050565b6000602082840312156117c857600080fd5b813561095d81611649565b600080600080606085870312156117e957600080fd5b84356117f481611649565b935060208501359250604085013567ffffffffffffffff81111561181757600080fd5b611823878288016116ce565b95989497509550505050565b6000806040838503121561184257600080fd5b823561184d81611649565b9150602083013561185d81611649565b809150509250929050565b6000806000806000806080878903121561188157600080fd5b863561188c81611649565b955060208701359450604087013567ffffffffffffffff808211156118b057600080fd5b6118bc8a838b016116ce565b909650945060608901359150808211156118d557600080fd5b506118e289828a016116ce565b979a9699509497509295939492505050565b60008060006040848603121561190957600080fd5b83359250602084013567ffffffffffffffff81111561192757600080fd5b611933868287016116ce565b9497909650939450505050565b600181811c9082168061195457607f821691505b6020821081141561197557634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526021908201527f4552433737373a2063616c6c6572206973206e6f7420616e206f70657261746f6040820152603960f91b606082015260800190565b6000602082840312156119ce57600080fd5b815161095d81611649565b6001600160a01b0387811682528681166020830152851660408201526060810184905260c060808201819052600090611a14908301856115e9565b82810360a0840152611a2681856115e9565b9998505050505050505050565b838152606060208201526000611a4c60608301856115e9565b8281036040840152611a5e81856115e9565b9695505050505050565b634e487b7160e01b600052601160045260246000fd5b600082821015611a9057611a90611a68565b500390565b60008219821115611aa857611aa8611a68565b50019056fe4552433737373a207472616e7366657220616d6f756e7420657863656564732062616c616e63654552433737373a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654552433737373a206275726e20616d6f756e7420657863656564732062616c616e6365a2646970667358221220d599207468b3ad7662c75ca9bc158bdcb36544458e22bf99af0889486fb8b0a464736f6c63430008090033a2646970667358221220b9ce5ea052dbc591f06afbe7425fd3d24ea8414050ee0193959c313433d2d31764736f6c63430008090033", + "deployedBytecode": "0x60806040523480156200001157600080fd5b5060043610620000465760003560e01c80632348238c146200004b578063bb3a39ee1462000064578063c6dbdf611462000097575b600080fd5b620000626200005c36600462000289565b620000a9565b005b6200007b6200007536600462000307565b620001a7565b6040516001600160a01b03909116815260200160405180910390f35b6000546001600160a01b03166200007b565b6000546001600160a01b0316336001600160a01b031614620000e85760405162461bcd60e51b8152600401620000df906200037a565b60405180910390fd5b6001600160a01b038116620001535760405162461bcd60e51b815260206004820152602a60248201527f5365636f6e646172793a206e6577207072696d61727920697320746865207a65604482015269726f206164647265737360b01b6064820152608401620000df565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f4101e71e974f68df5e9730cc223280b41654676bbb052cdcc735c3337e64d2d99060200160405180910390a150565b600080546001600160a01b0316336001600160a01b031614620001de5760405162461bcd60e51b8152600401620000df906200037a565b600085858585620001f76000546001600160a01b031690565b60405162000205906200027b565b62000215959493929190620003ef565b604051809103906000f08015801562000232573d6000803e3d6000fd5b5090507f316f047f5c065537114379c7b7365dadd3cdf36ec1c32b528520bb31beaf37178185856040516200026a9392919062000435565b60405180910390a195945050505050565b6120f4806200046683390190565b6000602082840312156200029c57600080fd5b81356001600160a01b0381168114620002b457600080fd5b9392505050565b60008083601f840112620002ce57600080fd5b50813567ffffffffffffffff811115620002e757600080fd5b6020830191508360208285010111156200030057600080fd5b9250929050565b600080600080604085870312156200031e57600080fd5b843567ffffffffffffffff808211156200033757600080fd5b6200034588838901620002bb565b909650945060208701359150808211156200035f57600080fd5b506200036e87828801620002bb565b95989497509550505050565b6020808252602c908201527f5365636f6e646172793a2063616c6c6572206973206e6f74207468652070726960408201526b1b585c9e481858d8dbdd5b9d60a21b606082015260800190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600062000405606083018789620003c6565b82810360208401526200041a818688620003c6565b91505060018060a01b03831660408301529695505050505050565b6001600160a01b03841681526040602082018190526000906200045c9083018486620003c6565b9594505050505056fe60806040523480156200001157600080fd5b50604051620020f4380380620020f4833981016040819052620000349162000484565b60408051600081526020808201909252845185928592916200005d9160029190860190620002b9565b50815162000073906003906020850190620002b9565b5080516200008990600490602084019062000348565b5060005b600454811015620000fd5760016005600060048481548110620000b457620000b462000511565b6000918252602080832091909101546001600160a01b031683528201929092526040019020805460ff191691151591909117905580620000f48162000527565b9150506200008d565b506040516329965a1d60e01b815230600482018190527fac7fbab5f54a3ca8194167523c6753bfeb96a445279294b6125b68cce217705460248301526044820152731820a4b7618bde71dce8cdc73aab6c95905fad24906329965a1d90606401600060405180830381600087803b1580156200017857600080fd5b505af11580156200018d573d6000803e3d6000fd5b50506040516329965a1d60e01b815230600482018190527faea199e31a596269b42cdafd93407f14436db6e4cad65417994c2eb37381e05a60248301526044820152731820a4b7618bde71dce8cdc73aab6c95905fad2492506329965a1d9150606401600060405180830381600087803b1580156200020b57600080fd5b505af115801562000220573d6000803e3d6000fd5b50505050506001600160a01b038316151591506200029090505760405162461bcd60e51b815260206004820152602160248201527f53696465546f6b656e3a204d696e7465722061646472657373206973206e756c6044820152601b60fa1b606482015260840160405180910390fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055506200058e9050565b828054620002c79062000551565b90600052602060002090601f016020900481019282620002eb576000855562000336565b82601f106200030657805160ff191683800117855562000336565b8280016001018555821562000336579182015b828111156200033657825182559160200191906001019062000319565b5062000344929150620003a0565b5090565b82805482825590600052602060002090810192821562000336579160200282015b828111156200033657825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062000369565b5b80821115620003445760008155600101620003a1565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620003df57600080fd5b81516001600160401b0380821115620003fc57620003fc620003b7565b604051601f8301601f19908116603f01168101908282118183101715620004275762000427620003b7565b816040528381526020925086838588010111156200044457600080fd5b600091505b8382101562000468578582018301518183018401529082019062000449565b838211156200047a5760008385830101525b9695505050505050565b6000806000606084860312156200049a57600080fd5b83516001600160401b0380821115620004b257600080fd5b620004c087838801620003cd565b94506020860151915080821115620004d757600080fd5b50620004e686828701620003cd565b604086015190935090506001600160a01b03811681146200050657600080fd5b809150509250925092565b634e487b7160e01b600052603260045260246000fd5b60006000198214156200054a57634e487b7160e01b600052601160045260246000fd5b5060010190565b600181811c908216806200056657607f821691505b602082108114156200058857634e487b7160e01b600052602260045260246000fd5b50919050565b611b56806200059e6000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c8063959b8c3f116100ad578063dcdc7dd011610071578063dcdc7dd01461027f578063dd62ed3e14610292578063fad8b32a146102cb578063fc673c4f146102de578063fe9d9303146102f157600080fd5b8063959b8c3f1461022b57806395d89b411461023e5780639bd9bbc614610246578063a9059cbb14610259578063d95b63711461026c57600080fd5b806323b872dd116100f457806323b872dd146101c4578063313ce567146101d7578063556f0dc7146101e657806362ad1b83146101ed57806370a082311461020257600080fd5b806306e485381461013157806306fdde031461014f5780630754617214610164578063095ea7b31461018f57806318160ddd146101b2575b600080fd5b610139610304565b604051610146919061159c565b60405180910390f35b610157610366565b6040516101469190611636565b600954610177906001600160a01b031681565b6040516001600160a01b039091168152602001610146565b6101a261019d366004611661565b6103ef565b6040519015158152602001610146565b6001545b604051908152602001610146565b6101a26101d236600461168d565b610407565b60405160128152602001610146565b60016101b6565b6102006101fb366004611717565b6105af565b005b6101b66102103660046117b6565b6001600160a01b031660009081526020819052604090205490565b6102006102393660046117b6565b610658565b610157610776565b6102006102543660046117d3565b610785565b6101a2610267366004611661565b6107df565b6101a261027a36600461182f565b6108c2565b61020061028d366004611868565b610964565b6101b66102a036600461182f565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b6102006102d93660046117b6565b610a51565b6102006102ec366004611868565b610b6d565b6102006102ff3660046118f4565b610c09565b6060600480548060200260200160405190810160405280929190818152602001828054801561035c57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161033e575b5050505050905090565b60606002805461037590611940565b80601f01602080910402602001604051908101604052809291908181526020018280546103a190611940565b801561035c5780601f106103c35761010080835404028352916020019161035c565b820191906000526020600020905b8154815290600101906020018083116103d157509395945050505050565b6000336103fd818585610c5e565b5060019392505050565b60006001600160a01b0383166104645760405162461bcd60e51b815260206004820181905260248201527f4552433737373a207472616e7366657220746f207a65726f206164647265737360448201526064015b60405180910390fd5b6001600160a01b0384166104c55760405162461bcd60e51b815260206004820152602260248201527f4552433737373a207472616e736665722066726f6d207a65726f206164647265604482015261737360f01b606482015260840161045b565b60003390506104f6818686866040518060200160405280600081525060405180602001604052806000815250610d15565b610522818686866040518060200160405280600081525060405180602001604052806000815250610e4b565b610576858261057186604051806060016040528060298152602001611ad5602991396001600160a01b03808c166000908152600860209081526040808320938b16835292905220549190610f6d565b610c5e565b6105a48186868660405180602001604052806000815250604051806020016040528060008152506000610fa7565b506001949350505050565b6105b933886108c2565b6105d55760405162461bcd60e51b815260040161045b9061197b565b61064f3388888888888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8c018190048102820181019092528a815292508a91508990819084018382808284376000920191909152506001925061117b915050565b50505050505050565b336001600160a01b03821614156106bd5760405162461bcd60e51b8152602060048201526024808201527f4552433737373a20617574686f72697a696e672073656c66206173206f70657260448201526330ba37b960e11b606482015260840161045b565b6001600160a01b03811660009081526005602052604090205460ff161561070e573360009081526007602090815260408083206001600160a01b03851684529091529020805460ff1916905561073d565b3360009081526006602090815260408083206001600160a01b03851684529091529020805460ff191660011790555b60405133906001600160a01b038316907ff4caeb2d6ca8932a215a353d0703c326ec2d81fc68170f320eb2ab49e9df61f990600090a350565b60606003805461037590611940565b6107d93333868686868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250604080516020810190915290815292506001915061117b9050565b50505050565b60006001600160a01b0383166108375760405162461bcd60e51b815260206004820181905260248201527f4552433737373a207472616e7366657220746f207a65726f2061646472657373604482015260640161045b565b6000339050610868818286866040518060200160405280600081525060405180602001604052806000815250610d15565b610894818286866040518060200160405280600081525060405180602001604052806000815250610e4b565b6103fd8182868660405180602001604052806000815250604051806020016040528060008152506000610fa7565b6000816001600160a01b0316836001600160a01b0316148061092d57506001600160a01b03831660009081526005602052604090205460ff16801561092d57506001600160a01b0380831660009081526007602090815260408083209387168352929052205460ff16155b8061095d57506001600160a01b0380831660009081526006602090815260408083209387168352929052205460ff165b9392505050565b6009546001600160a01b0316336001600160a01b0316146109d35760405162461bcd60e51b815260206004820152602360248201527f53696465546f6b656e3a2043616c6c6572206973206e6f7420746865206d696e6044820152623a32b960e91b606482015260840161045b565b610a4933878787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8b01819004810282018101909252898152925089915088908190840183828082843760009201919091525061125292505050565b505050505050565b6001600160a01b038116331415610ab45760405162461bcd60e51b815260206004820152602160248201527f4552433737373a207265766f6b696e672073656c66206173206f70657261746f6044820152603960f91b606482015260840161045b565b6001600160a01b03811660009081526005602052604090205460ff1615610b08573360009081526007602090815260408083206001600160a01b03851684529091529020805460ff19166001179055610b34565b3360009081526006602090815260408083206001600160a01b03851684529091529020805460ff191690555b60405133906001600160a01b038316907f50546e66e5f44d728365dc3908c63bc5cfeeab470722c1677e3073a6ac294aa190600090a350565b610b7733876108c2565b610b935760405162461bcd60e51b815260040161045b9061197b565b610a4933878787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8b0181900481028201810190925289815292508991508890819084018382808284376000920191909152506113a092505050565b610c5933338585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250604080516020810190915290815292506113a0915050565b505050565b6001600160a01b038216610cb45760405162461bcd60e51b815260206004820152601f60248201527f4552433737373a20617070726f766520746f207a65726f206164647265737300604482015260640161045b565b6001600160a01b0383811660008181526008602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60405163555ddc6560e11b81526001600160a01b03861660048201527f29ddb589b1fb5fc7cf394961c1adf5f8c6454761adf795e67fe149f658abe8956024820152600090731820a4b7618bde71dce8cdc73aab6c95905fad249063aabbb8ca9060440160206040518083038186803b158015610d9157600080fd5b505afa158015610da5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc991906119bc565b90506001600160a01b0381161561064f57604051633ad5cbc160e11b81526001600160a01b038216906375ab978290610e10908a908a908a908a908a908a906004016119d9565b600060405180830381600087803b158015610e2a57600080fd5b505af1158015610e3e573d6000803e3d6000fd5b5050505050505050505050565b610e8883604051806060016040528060278152602001611aae602791396001600160a01b0388166000908152602081905260409020549190610f6d565b6001600160a01b038087166000908152602081905260408082209390935590861681522054610eb790846114fb565b6001600160a01b0380861660008181526020819052604090819020939093559151878216918916907f06b541ddaa720db2b10a4d0cdac39b8d360425fc073085fac19bc8261467798790610f1090889088908890611a33565b60405180910390a4836001600160a01b0316856001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051610f5d91815260200190565b60405180910390a3505050505050565b60008184841115610f915760405162461bcd60e51b815260040161045b9190611636565b506000610f9e8486611a7e565b95945050505050565b60405163555ddc6560e11b81526001600160a01b03861660048201527fb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b6024820152600090731820a4b7618bde71dce8cdc73aab6c95905fad249063aabbb8ca9060440160206040518083038186803b15801561102357600080fd5b505afa158015611037573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105b91906119bc565b90506001600160a01b038116156110d7576040516223de2960e01b81526001600160a01b038216906223de29906110a0908b908b908b908b908b908b906004016119d9565b600060405180830381600087803b1580156110ba57600080fd5b505af11580156110ce573d6000803e3d6000fd5b50505050611171565b8115611171576001600160a01b0386163b156111715760405162461bcd60e51b815260206004820152604d60248201527f4552433737373a20746f6b656e20726563697069656e7420636f6e747261637460448201527f20686173206e6f20696d706c656d656e74657220666f7220455243373737546f60648201526c1ad95b9cd49958da5c1a595b9d609a1b608482015260a40161045b565b5050505050505050565b6001600160a01b0386166111d15760405162461bcd60e51b815260206004820152601e60248201527f4552433737373a2073656e642066726f6d207a65726f20616464726573730000604482015260640161045b565b6001600160a01b0385166112275760405162461bcd60e51b815260206004820152601c60248201527f4552433737373a2073656e6420746f207a65726f206164647265737300000000604482015260640161045b565b611235878787878787610d15565b611243878787878787610e4b565b61064f87878787878787610fa7565b6001600160a01b0384166112a85760405162461bcd60e51b815260206004820152601c60248201527f4552433737373a206d696e7420746f207a65726f206164647265737300000000604482015260640161045b565b6001546112b590846114fb565b6001556001600160a01b0384166000908152602081905260409020546112db90846114fb565b6001600160a01b038516600090815260208190526040812091909155611308908690868686866001610fa7565b836001600160a01b0316856001600160a01b03167f2fe5be0146f74c5bce36c0b80911af6c7d86ff27e89d5cfa61fc681327954e5d85858560405161134f93929190611a33565b60405180910390a36040518381526001600160a01b038516906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a35050505050565b6001600160a01b0384166113f65760405162461bcd60e51b815260206004820152601e60248201527f4552433737373a206275726e2066726f6d207a65726f20616464726573730000604482015260640161045b565b61140585856000868686610d15565b61144283604051806060016040528060238152602001611afe602391396001600160a01b0387166000908152602081905260409020549190610f6d565b6001600160a01b038516600090815260208190526040902055600154611468908461155a565b600181905550836001600160a01b0316856001600160a01b03167fa78a9be3a7b862d26933ad85fb11d80ef66b8f972d7cbba06621d583943a40988585856040516114b593929190611a33565b60405180910390a36040518381526000906001600160a01b038616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001611391565b6000806115088385611a95565b90508381101561095d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161045b565b600061095d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f6d565b6020808252825182820181905260009190848201906040850190845b818110156115dd5783516001600160a01b0316835292840192918401916001016115b8565b50909695505050505050565b6000815180845260005b8181101561160f576020818501810151868301820152016115f3565b81811115611621576000602083870101525b50601f01601f19169290920160200192915050565b60208152600061095d60208301846115e9565b6001600160a01b038116811461165e57600080fd5b50565b6000806040838503121561167457600080fd5b823561167f81611649565b946020939093013593505050565b6000806000606084860312156116a257600080fd5b83356116ad81611649565b925060208401356116bd81611649565b929592945050506040919091013590565b60008083601f8401126116e057600080fd5b50813567ffffffffffffffff8111156116f857600080fd5b60208301915083602082850101111561171057600080fd5b9250929050565b600080600080600080600060a0888a03121561173257600080fd5b873561173d81611649565b9650602088013561174d81611649565b955060408801359450606088013567ffffffffffffffff8082111561177157600080fd5b61177d8b838c016116ce565b909650945060808a013591508082111561179657600080fd5b506117a38a828b016116ce565b989b979a50959850939692959293505050565b6000602082840312156117c857600080fd5b813561095d81611649565b600080600080606085870312156117e957600080fd5b84356117f481611649565b935060208501359250604085013567ffffffffffffffff81111561181757600080fd5b611823878288016116ce565b95989497509550505050565b6000806040838503121561184257600080fd5b823561184d81611649565b9150602083013561185d81611649565b809150509250929050565b6000806000806000806080878903121561188157600080fd5b863561188c81611649565b955060208701359450604087013567ffffffffffffffff808211156118b057600080fd5b6118bc8a838b016116ce565b909650945060608901359150808211156118d557600080fd5b506118e289828a016116ce565b979a9699509497509295939492505050565b60008060006040848603121561190957600080fd5b83359250602084013567ffffffffffffffff81111561192757600080fd5b611933868287016116ce565b9497909650939450505050565b600181811c9082168061195457607f821691505b6020821081141561197557634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526021908201527f4552433737373a2063616c6c6572206973206e6f7420616e206f70657261746f6040820152603960f91b606082015260800190565b6000602082840312156119ce57600080fd5b815161095d81611649565b6001600160a01b0387811682528681166020830152851660408201526060810184905260c060808201819052600090611a14908301856115e9565b82810360a0840152611a2681856115e9565b9998505050505050505050565b838152606060208201526000611a4c60608301856115e9565b8281036040840152611a5e81856115e9565b9695505050505050565b634e487b7160e01b600052601160045260246000fd5b600082821015611a9057611a90611a68565b500390565b60008219821115611aa857611aa8611a68565b50019056fe4552433737373a207472616e7366657220616d6f756e7420657863656564732062616c616e63654552433737373a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654552433737373a206275726e20616d6f756e7420657863656564732062616c616e6365a2646970667358221220d599207468b3ad7662c75ca9bc158bdcb36544458e22bf99af0889486fb8b0a464736f6c63430008090033a2646970667358221220b9ce5ea052dbc591f06afbe7425fd3d24ea8414050ee0193959c313433d2d31764736f6c63430008090033", + "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": 12884, + "contract": "contracts/SideTokenFactory/SideTokenFactoryV1.sol:SideTokenFactoryV1", + "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/alphanet/WRBTC.json b/bridge/deployments/alphanet/WRBTC.json new file mode 100644 index 000000000..e6befa0c1 --- /dev/null +++ b/bridge/deployments/alphanet/WRBTC.json @@ -0,0 +1,401 @@ +{ + "address": "0x511fCB17cE64E1Fb0DDc25310ad469B95b6877b4", + "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": "0x7477edb7d340a54de2c58dcb95773c1e429db7e4c28e0c4f9b18d46e8f79773d", + "receipt": { + "to": null, + "from": "0x49A2731C440B0A217f817dB99145Ef5c2e3c9f4E", + "contractAddress": "0x511fCB17cE64E1Fb0DDc25310ad469B95b6877b4", + "transactionIndex": 0, + "gasUsed": "749615", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xaa3f996fac86e26a8b1219e88168ed0d4264e132e8518e14a960be76b45afe46", + "transactionHash": "0x7477edb7d340a54de2c58dcb95773c1e429db7e4c28e0c4f9b18d46e8f79773d", + "logs": [], + "blockNumber": 103931, + "cumulativeGasUsed": "749615", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "bfc96d5f60348b72136d284c7b5c1536", + "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": 10973, + "contract": "contracts/test/WRBTC.sol:WRBTC", + "label": "name", + "offset": 0, + "slot": "0", + "type": "t_string_storage" + }, + { + "astId": 10976, + "contract": "contracts/test/WRBTC.sol:WRBTC", + "label": "symbol", + "offset": 0, + "slot": "1", + "type": "t_string_storage" + }, + { + "astId": 10979, + "contract": "contracts/test/WRBTC.sol:WRBTC", + "label": "decimals", + "offset": 0, + "slot": "2", + "type": "t_uint8" + }, + { + "astId": 11012, + "contract": "contracts/test/WRBTC.sol:WRBTC", + "label": "balanceOf", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 11018, + "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/alphanet/solcInputs/710a63f3b7163326f2263e80f2d9698b.json b/bridge/deployments/alphanet/solcInputs/710a63f3b7163326f2263e80f2d9698b.json new file mode 100644 index 000000000..d4adbf7b8 --- /dev/null +++ b/bridge/deployments/alphanet/solcInputs/710a63f3b7163326f2263e80f2d9698b.json @@ -0,0 +1,99 @@ +{ + "language": "Solidity", + "sources": { + "contracts/Bridge/BridgeV4.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 \"./IBridgeV4.sol\";\nimport \"../interface/ISideToken.sol\";\nimport \"../interface/ISideTokenFactory.sol\";\nimport \"../interface/IAllowTokens.sol\";\nimport \"../interface/IWrapped.sol\";\n\n\ncontract BridgeV4 is Initializable, IBridgeV4, 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(0xdd343Ef491B9520BB5efFC2A7154B133893840Ea);\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 address private feeCollectorAddress = 0x803c3910f339ee570A3fB9dB8a5A8143d284c5c5;\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_v4 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 event FeeCollectorAddressChanged(address indexed sender, address oldAddress, address newAddress);\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 \"v4\";\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 function setFeeCollectorAddress(address _newAddress) public onlyOwner {\n address oldAddress = feeCollectorAddress;\n feeCollectorAddress = _newAddress;\n emit FeeCollectorAddressChanged(_msgSender(), oldAddress, _newAddress);\n }\n\n function getFeeCollectorAddress() public view returns(address) {\n return feeCollectorAddress;\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(IBridgeV4, 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(payable(feeCollectorAddress), 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}\n" + }, + "contracts/Bridge/IBridgeV4.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IBridgeV4 {\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}\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/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/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/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/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/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/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/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/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/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/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/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/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/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/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" + } + }, + "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/alphanet/solcInputs/bfc96d5f60348b72136d284c7b5c1536.json b/bridge/deployments/alphanet/solcInputs/bfc96d5f60348b72136d284c7b5c1536.json new file mode 100644 index 000000000..486303e3f --- /dev/null +++ b/bridge/deployments/alphanet/solcInputs/bfc96d5f60348b72136d284c7b5c1536.json @@ -0,0 +1,291 @@ +{ + "language": "Solidity", + "sources": { + "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/AllowTokens/AllowTokensV1.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 AllowTokensV1 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/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/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/Bridge/BridgeV4.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 \"./IBridgeV4.sol\";\nimport \"../interface/ISideToken.sol\";\nimport \"../interface/ISideTokenFactory.sol\";\nimport \"../interface/IAllowTokens.sol\";\nimport \"../interface/IWrapped.sol\";\n\n\ncontract BridgeV4 is Initializable, IBridgeV4, 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 address private feeCollectorAddress = 0x803c3910f339ee570A3fB9dB8a5A8143d284c5c5;\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_v4 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 event FeeCollectorAddressChanged(address indexed sender, address oldAddress, address newAddress);\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 \"v4\";\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 function setFeeCollectorAddress(address _newAddress) public onlyOwner {\n address oldAddress = feeCollectorAddress;\n feeCollectorAddress = _newAddress;\n emit FeeCollectorAddressChanged(_msgSender(), oldAddress, _newAddress);\n }\n\n function getFeeCollectorAddress() public view returns(address) {\n return feeCollectorAddress;\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(IBridgeV4, 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(payable(feeCollectorAddress), 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}\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/Bridge/IBridgeV4.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IBridgeV4 {\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}\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/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/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/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/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/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/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/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/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/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}" + }, + "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/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}\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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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" + }, + "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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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" + } + }, + "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 8164bd2b8..652bfe901 100644 --- a/bridge/hardhat.config.js +++ b/bridge/hardhat.config.js @@ -125,6 +125,18 @@ module.exports = { }, tags: ['prod'], }, + alphanet: { + live: true, + url: '<--Alphanet node URL-->', + gas: 6800000, + gasPrice: 60000000, + network_id: chains.RSK_ALPHA_NET_CHAIN_ID, + token_symbol: 'r', + accounts: { + mnemonic: MNEMONIC, + }, + tags: ['prod'], + }, //Ethereum kovan: { live: true, @@ -144,7 +156,7 @@ module.exports = { network_id: chains.SEPOLIA_TEST_NET_CHAIN_ID, token_symbol: 'e', gas: 6700000, - gasPrice: 10000000000, + gasPrice: 30000000000, accounts: { mnemonic: MNEMONIC, }, diff --git a/bridge/hardhat/helper/chains.js b/bridge/hardhat/helper/chains.js index fa27d7d0c..b3ec1b010 100644 --- a/bridge/hardhat/helper/chains.js +++ b/bridge/hardhat/helper/chains.js @@ -1,5 +1,6 @@ const ETHEREUM_MAIN_NET_CHAIN_ID = 1; const RSK_MAIN_NET_CHAIN_ID = 30; +const RSK_ALPHA_NET_CHAIN_ID = 78; const RSK_TEST_NET_CHAIN_ID = 31; const KOVAN_TEST_NET_CHAIN_ID = 42; const RINKEBY_TEST_NET_CHAIN_ID = 4; @@ -23,7 +24,7 @@ const SEPOLIA_TEST_NET_CHAIN_ID = 11155111; */ function isRSK(network) { const chainID = network.config.network_id; - return [RSK_MAIN_NET_CHAIN_ID, RSK_TEST_NET_CHAIN_ID].includes(chainID); + return [RSK_MAIN_NET_CHAIN_ID, RSK_TEST_NET_CHAIN_ID, RSK_ALPHA_NET_CHAIN_ID].includes(chainID); } function tokenSymbol(network) { @@ -32,12 +33,13 @@ function tokenSymbol(network) { function isMainnet(network) { const chainID = network.config.network_id; - return [ETHEREUM_MAIN_NET_CHAIN_ID, RSK_MAIN_NET_CHAIN_ID, BSC_MAIN_NET_CHAIN_ID].includes(chainID); + return [ETHEREUM_MAIN_NET_CHAIN_ID, RSK_MAIN_NET_CHAIN_ID, BSC_MAIN_NET_CHAIN_ID, RSK_ALPHA_NET_CHAIN_ID].includes(chainID); } module.exports = { ETHEREUM_MAIN_NET_CHAIN_ID: ETHEREUM_MAIN_NET_CHAIN_ID, RSK_MAIN_NET_CHAIN_ID: RSK_MAIN_NET_CHAIN_ID, + RSK_ALPHA_NET_CHAIN_ID: RSK_ALPHA_NET_CHAIN_ID, RSK_TEST_NET_CHAIN_ID: RSK_TEST_NET_CHAIN_ID, KOVAN_TEST_NET_CHAIN_ID: KOVAN_TEST_NET_CHAIN_ID, RINKEBY_TEST_NET_CHAIN_ID: RINKEBY_TEST_NET_CHAIN_ID, diff --git a/bridge/hardhat/helper/tokens.js b/bridge/hardhat/helper/tokens.js index 67cfb7917..a88ab336a 100644 --- a/bridge/hardhat/helper/tokens.js +++ b/bridge/hardhat/helper/tokens.js @@ -58,6 +58,16 @@ const rskTestnet = { rLINK: {address: '0x2d850c8E369F26bc02fF4c9fFbaE2d50107395CB', typeId: '3', isSideToken: true, decimals: 18, symbol: 'rKovLINK'}, //rKovLINK } +const rskAlphanet = { + DOC: {address: '0xeD8413b2493F27121e4BC1222aB287316ad29716', typeId: '5', isSideToken: false, decimals: 18, symbol: 'DOC'}, //DOC + RIF: {address: '0x19f64674d8a5b4e652319f5e239efd3bc969a1fe', typeId: '6', isSideToken: false, decimals: 18, symbol: 'RIF'}, //RIF + BPro: {address: '0x6905711e16AFBC51d8cf2a714479D14FB3e03281', typeId: '0', isSideToken: false, decimals: 18, symbol: 'BPro'}, //BPro + // Side Tokens + rDAI: {address: '0x8384952Dc2A3e413800e9D4EE89d7383FA12Af10', typeId: '4', isSideToken: true, decimals: 18, symbol: 'rKovDAI'}, //rKovDAI + rUSDT: {address: '0x52b0108b38Ae80305F92FC461026e4c200ed673E', typeId: '4', isSideToken: true, decimals: 18, symbol: 'rKovUSDT'}, //rKovUSDT + rLINK: {address: '0x2d850c8E369F26bc02fF4c9fFbaE2d50107395CB', typeId: '3', isSideToken: true, decimals: 18, symbol: 'rKovLINK'}, //rKovLINK +} + const tokensByChainId = (chainId) => { switch (chainId) { case chains.RSK_TEST_NET_CHAIN_ID: @@ -68,10 +78,13 @@ const tokensByChainId = (chainId) => { case chains.RSK_MAIN_NET_CHAIN_ID: return rskMainnet; - + case chains.ETHEREUM_MAIN_NET_CHAIN_ID: return ethereum; + case chains.RSK_ALPHA_NET_CHAIN_ID: + return rskAlphanet; + default: return []; }