From 760eeafd4e2763c41b72f3d7b54eda9b3cd7dce9 Mon Sep 17 00:00:00 2001 From: Pablo Carranza Velez Date: Fri, 2 Jun 2023 19:16:47 -0300 Subject: [PATCH 1/5] feat: tooling for L2 and transfer tools deployment --- .../{2_deploy.ts => 2_l1_manager_wallet.ts} | 42 +--------- deploy/3_l2_wallet.ts | 38 +++++++++ deploy/4_l1_transfer_tool.ts | 81 +++++++++++++++++++ deploy/5_l2_manager.ts | 79 ++++++++++++++++++ deploy/6_l2_transfer_tool.ts | 69 ++++++++++++++++ deploy/lib/utils.ts | 41 ++++++++++ 6 files changed, 312 insertions(+), 38 deletions(-) rename deploy/{2_deploy.ts => 2_l1_manager_wallet.ts} (70%) create mode 100644 deploy/3_l2_wallet.ts create mode 100644 deploy/4_l1_transfer_tool.ts create mode 100644 deploy/5_l2_manager.ts create mode 100644 deploy/6_l2_transfer_tool.ts create mode 100644 deploy/lib/utils.ts diff --git a/deploy/2_deploy.ts b/deploy/2_l1_manager_wallet.ts similarity index 70% rename from deploy/2_deploy.ts rename to deploy/2_l1_manager_wallet.ts index 83cb304..66cbc3a 100644 --- a/deploy/2_deploy.ts +++ b/deploy/2_l1_manager_wallet.ts @@ -1,5 +1,4 @@ import consola from 'consola' -import inquirer from 'inquirer' import { utils } from 'ethers' import '@nomiclabs/hardhat-ethers' @@ -8,45 +7,12 @@ import { DeployFunction } from 'hardhat-deploy/types' import { GraphTokenMock } from '../build/typechain/contracts/GraphTokenMock' import { GraphTokenLockManager } from '../build/typechain/contracts/GraphTokenLockManager' +import { askConfirm, getDeploymentName, promptContractAddress } from './lib/utils' -const { getAddress, parseEther, formatEther } = utils +const { parseEther, formatEther } = utils const logger = consola.create({}) -const askConfirm = async (message: string) => { - const res = await inquirer.prompt({ - name: 'confirm', - type: 'confirm', - message, - }) - return res.confirm -} - -const getTokenAddress = async (): Promise => { - const res1 = await inquirer.prompt({ - name: 'token', - type: 'input', - message: 'What is the GRT token address?', - }) - - try { - return getAddress(res1.token) - } catch (err) { - logger.error(err) - process.exit(1) - } -} - -const getDeploymentName = async (defaultName: string): Promise => { - const res = await inquirer.prompt({ - name: 'deployment-name', - type: 'input', - default: defaultName, - message: 'Save deployment as?', - }) - return res['deployment-name'] -} - const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deploy } = hre.deployments const { deployer } = await hre.getNamedAccounts() @@ -54,7 +20,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { // -- Graph Token -- // Get the token address we will use - const tokenAddress = await getTokenAddress() + const tokenAddress = await promptContractAddress('L1 GRT', logger) if (!tokenAddress) { logger.warn('No token address provided') process.exit(1) @@ -102,6 +68,6 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { } } -func.tags = ['manager'] +func.tags = ['manager', 'l1', 'l1-manager', 'l1-wallet'] export default func diff --git a/deploy/3_l2_wallet.ts b/deploy/3_l2_wallet.ts new file mode 100644 index 0000000..9f71645 --- /dev/null +++ b/deploy/3_l2_wallet.ts @@ -0,0 +1,38 @@ +import consola from 'consola' +import '@nomiclabs/hardhat-ethers' +import { HardhatRuntimeEnvironment } from 'hardhat/types' +import { DeployFunction } from 'hardhat-deploy/types' + +import { getDeploymentName, promptContractAddress } from './lib/utils' + + +const logger = consola.create({}) + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deploy } = hre.deployments + const { deployer } = await hre.getNamedAccounts() + + // -- Graph Token -- + + // Get the token address we will use + const tokenAddress = await promptContractAddress('L2 GRT', logger) + if (!tokenAddress) { + logger.warn('No token address provided') + process.exit(1) + } + + // -- L2 Token Lock Manager -- + + // Deploy the master copy of GraphTokenLockWallet + logger.info('Deploying L2GraphTokenLockWallet master copy...') + const masterCopySaveName = await getDeploymentName('L2GraphTokenLockWallet') + await deploy(masterCopySaveName, { + from: deployer, + log: true, + contract: 'L2GraphTokenLockWallet', + }) +} + +func.tags = ['l2-wallet', 'l2'] + +export default func diff --git a/deploy/4_l1_transfer_tool.ts b/deploy/4_l1_transfer_tool.ts new file mode 100644 index 0000000..60ae8f4 --- /dev/null +++ b/deploy/4_l1_transfer_tool.ts @@ -0,0 +1,81 @@ +import consola from 'consola' +import { utils } from 'ethers' + +import '@nomiclabs/hardhat-ethers' +import { HardhatRuntimeEnvironment } from 'hardhat/types' +import { DeployFunction } from 'hardhat-deploy/types' + +import { getDeploymentName, promptContractAddress } from './lib/utils' +import { ethers, upgrades } from 'hardhat' +import { L1GraphTokenLockTransferTool } from '../build/typechain/contracts/L1GraphTokenLockTransferTool' +import path from 'path' +import { Artifacts } from 'hardhat/internal/artifacts' + +const logger = consola.create({}) + +const ARTIFACTS_PATH = path.resolve('build/artifacts') +const artifacts = new Artifacts(ARTIFACTS_PATH) +const l1TransferToolAbi = artifacts.readArtifactSync('L1GraphTokenLockTransferTool').abi + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployer } = await hre.getNamedAccounts() + + // -- Graph Token -- + + // Get the addresses we will use + const tokenAddress = await promptContractAddress('L1 GRT', logger) + if (!tokenAddress) { + logger.warn('No token address provided') + process.exit(1) + } + + const l2Implementation = await promptContractAddress('L2GraphTokenLockWallet implementation', logger) + if (!l2Implementation) { + logger.warn('No L2 implementation address provided') + process.exit(1) + } + + const l1Gateway = await promptContractAddress('L1 token gateway', logger) + if (!l1Gateway) { + logger.warn('No L1 gateway address provided') + process.exit(1) + } + + const l1Staking = await promptContractAddress('L1 Staking', logger) + if (!l1Staking) { + logger.warn('No L1 Staking address provided') + process.exit(1) + } + + let owner = await promptContractAddress('owner (optional)', logger) + if (!owner) { + logger.warn('No owner address provided, will use the deployer address as owner') + owner = deployer.address + } + + // Deploy the L1GraphTokenLockTransferTool with a proxy. + // hardhat-deploy doesn't get along with constructor arguments in the implementation + // combined with an OpenZeppelin transparent proxy, so we need to do this using + // the OpenZeppelin hardhat-upgrades tooling, and save the deployment manually. + + // TODO modify this to use upgradeProxy if a deployment already exists? + logger.info('Deploying L1GraphTokenLockTransferTool proxy...') + const transferToolFactory = await ethers.getContractFactory('L1GraphTokenLockTransferTool') + const transferTool = (await upgrades.deployProxy(transferToolFactory, [owner], { + kind: 'transparent', + unsafeAllow: ['state-variable-immutable', 'constructor'], + constructorArgs: [tokenAddress, l2Implementation, l1Gateway, l1Staking], + })) as L1GraphTokenLockTransferTool + + // Save the deployment + const deploymentName = await getDeploymentName('L1GraphTokenLockTransferTool') + await hre.deployments.save(deploymentName, { + abi: l1TransferToolAbi, + address: transferTool.address, + transactionHash: transferTool.deployTransaction.hash, + }) +} + +func.tags = ['l1', 'l1-transfer-tool'] + +export default func diff --git a/deploy/5_l2_manager.ts b/deploy/5_l2_manager.ts new file mode 100644 index 0000000..55606c2 --- /dev/null +++ b/deploy/5_l2_manager.ts @@ -0,0 +1,79 @@ +import consola from 'consola' +import { utils } from 'ethers' + +import '@nomiclabs/hardhat-ethers' +import { HardhatRuntimeEnvironment } from 'hardhat/types' +import { DeployFunction } from 'hardhat-deploy/types' + +import { GraphTokenMock } from '../build/typechain/contracts/GraphTokenMock' +import { askConfirm, getDeploymentName, promptContractAddress } from './lib/utils' +import { L2GraphTokenLockManager } from '../build/typechain/contracts/L2GraphTokenLockManager' + +const { parseEther, formatEther } = utils + +const logger = consola.create({}) + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deploy } = hre.deployments + const { deployer } = await hre.getNamedAccounts() + + // -- Graph Token -- + + // Get the token address we will use + const tokenAddress = await promptContractAddress('L1 GRT', logger) + if (!tokenAddress) { + logger.warn('No token address provided') + process.exit(1) + } + + const l2Gateway = await promptContractAddress('L2 Gateway', logger) + if (!l2Gateway) { + logger.warn('No L2 Gateway address provided') + process.exit(1) + } + + const l1TransferTool = await promptContractAddress('L1 Transfer Tool', logger) + if (!l1TransferTool) { + logger.warn('No L1 Transfer Tool address provided') + process.exit(1) + } + + // -- L2 Token Lock Manager -- + // Get the deployed L2GraphTokenLockWallet master copy address + const masterCopyDeploy = await hre.deployments.get('L2GraphTokenLockWallet') + + // Deploy the Manager that uses the master copy to clone contracts + logger.info('Deploying L2GraphTokenLockManager...') + const managerSaveName = await getDeploymentName('L2GraphTokenLockManager') + const managerDeploy = await deploy(managerSaveName, { + from: deployer, + args: [tokenAddress, masterCopyDeploy.address, l2Gateway, l1TransferTool], + log: true, + contract: 'L2GraphTokenLockManager', + }) + + // -- Fund -- + + if (await askConfirm('Do you want to fund the L2 manager?')) { + const fundAmount = parseEther('100000000') + logger.info(`Funding ${managerDeploy.address} with ${formatEther(fundAmount)} GRT...`) + + // Approve + const grt = (await hre.ethers.getContractAt('GraphTokenMock', tokenAddress)) as GraphTokenMock + await grt.approve(managerDeploy.address, fundAmount) + + // Deposit + const manager = (await hre.ethers.getContractAt( + 'L2GraphTokenLockManager', + managerDeploy.address, + )) as L2GraphTokenLockManager + await manager.deposit(fundAmount) + + logger.success('Done!') + } +} + +func.tags = ['l2-manager', 'l2'] +func.dependencies = ['l2-wallet'] + +export default func diff --git a/deploy/6_l2_transfer_tool.ts b/deploy/6_l2_transfer_tool.ts new file mode 100644 index 0000000..f03de5b --- /dev/null +++ b/deploy/6_l2_transfer_tool.ts @@ -0,0 +1,69 @@ +import consola from 'consola' +import { utils } from 'ethers' + +import '@nomiclabs/hardhat-ethers' +import { HardhatRuntimeEnvironment } from 'hardhat/types' +import { DeployFunction } from 'hardhat-deploy/types' + +import { getDeploymentName, promptContractAddress } from './lib/utils' +import { ethers, upgrades } from 'hardhat' +import { L1GraphTokenLockTransferTool } from '../build/typechain/contracts/L1GraphTokenLockTransferTool' +import path from 'path' +import { Artifacts } from 'hardhat/internal/artifacts' + +const logger = consola.create({}) + +const ARTIFACTS_PATH = path.resolve('build/artifacts') +const artifacts = new Artifacts(ARTIFACTS_PATH) +const l2TransferToolAbi = artifacts.readArtifactSync('L2GraphTokenLockTransferTool').abi + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployer } = await hre.getNamedAccounts() + + // -- Graph Token -- + + // Get the addresses we will use + const tokenAddress = await promptContractAddress('L2 GRT', logger) + if (!tokenAddress) { + logger.warn('No token address provided') + process.exit(1) + } + + const l2Gateway = await promptContractAddress('L2 token gateway', logger) + if (!l2Gateway) { + logger.warn('No L2 gateway address provided') + process.exit(1) + } + + const l1Token = await promptContractAddress('L1 GRT', logger) + if (!l1Token) { + logger.warn('No L1 GRT address provided') + process.exit(1) + } + + // Deploy the L2GraphTokenLockTransferTool with a proxy. + // hardhat-deploy doesn't get along with constructor arguments in the implementation + // combined with an OpenZeppelin transparent proxy, so we need to do this using + // the OpenZeppelin hardhat-upgrades tooling, and save the deployment manually. + + // TODO modify this to use upgradeProxy if a deployment already exists? + logger.info('Deploying L2GraphTokenLockTransferTool proxy...') + const transferToolFactory = await ethers.getContractFactory('L2GraphTokenLockTransferTool') + const transferTool = (await upgrades.deployProxy(transferToolFactory, [], { + kind: 'transparent', + unsafeAllow: ['state-variable-immutable', 'constructor'], + constructorArgs: [tokenAddress, l2Gateway, l1Token], + })) as L1GraphTokenLockTransferTool + + // Save the deployment + const deploymentName = await getDeploymentName('L1GraphTokenLockTransferTool') + await hre.deployments.save(deploymentName, { + abi: l2TransferToolAbi, + address: transferTool.address, + transactionHash: transferTool.deployTransaction.hash, + }) +} + +func.tags = ['l2', 'l2-transfer-tool'] + +export default func diff --git a/deploy/lib/utils.ts b/deploy/lib/utils.ts new file mode 100644 index 0000000..c230376 --- /dev/null +++ b/deploy/lib/utils.ts @@ -0,0 +1,41 @@ +import { Consola } from 'consola' +import inquirer from 'inquirer' +import { utils } from 'ethers' + +import '@nomiclabs/hardhat-ethers' + +const { getAddress } = utils + +export const askConfirm = async (message: string) => { + const res = await inquirer.prompt({ + name: 'confirm', + type: 'confirm', + message, + }) + return res.confirm +} + +export const promptContractAddress = async (name: string, logger: Consola): Promise => { + const res1 = await inquirer.prompt({ + name: 'contract', + type: 'input', + message: `What is the ${name} address?`, + }) + + try { + return getAddress(res1.contract) + } catch (err) { + logger.error(err) + process.exit(1) + } +} + +export const getDeploymentName = async (defaultName: string): Promise => { + const res = await inquirer.prompt({ + name: 'deployment-name', + type: 'input', + default: defaultName, + message: 'Save deployment as?', + }) + return res['deployment-name'] +} From 1caedf2029ce359275dea7081c6be0fdb98b052b Mon Sep 17 00:00:00 2001 From: Pablo Carranza Velez Date: Tue, 6 Jun 2023 20:11:43 -0300 Subject: [PATCH 2/5] chore: add scratch 6 deployment from tmigone/deploy-scratch-6 --- deployments/goerli/Scratch-6-Copy-Old.json | 968 +++++++++++++++ deployments/goerli/Scratch-6-Copy.json | 1083 +++++++++++++++++ deployments/goerli/Scratch-6-Manager-Old.json | 926 ++++++++++++++ deployments/goerli/Scratch-6-Manager.json | 926 ++++++++++++++ .../0b3ac4290e5ed652698ff31ab3f44c7f.json | 95 ++ .../ccc82ccc102007017cf322f5b7601563.json | 89 ++ 6 files changed, 4087 insertions(+) create mode 100644 deployments/goerli/Scratch-6-Copy-Old.json create mode 100644 deployments/goerli/Scratch-6-Copy.json create mode 100644 deployments/goerli/Scratch-6-Manager-Old.json create mode 100644 deployments/goerli/Scratch-6-Manager.json create mode 100644 deployments/goerli/solcInputs/0b3ac4290e5ed652698ff31ab3f44c7f.json create mode 100644 deployments/goerli/solcInputs/ccc82ccc102007017cf322f5b7601563.json diff --git a/deployments/goerli/Scratch-6-Copy-Old.json b/deployments/goerli/Scratch-6-Copy-Old.json new file mode 100644 index 0000000..7be10cc --- /dev/null +++ b/deployments/goerli/Scratch-6-Copy-Old.json @@ -0,0 +1,968 @@ +{ + "address": "0xd3A52F21b4EA66eAf0270C58799d339884be7823", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_oldManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "ManagerUpdated", + "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": [], + "name": "TokenDestinationsApproved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "amountPerPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "approveProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "availableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "beneficiary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "duration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "endTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRevoked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "contract IGraphTokenLockManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "passedPeriods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periodDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "release", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "releaseStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revocable", + "outputs": [ + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "revoke", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokeProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "setManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sinceStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "startTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "surplusAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalOutstandingAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "usedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestingCliffTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawSurplus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xad6672a356ade35072a1f3d32fe1da6e8c46cbd53b4315494d8972fc6586aac7", + "receipt": { + "to": null, + "from": "0xBc7f4d3a85B820fDB1058FD93073Eb6bc9AAF59b", + "contractAddress": "0xd3A52F21b4EA66eAf0270C58799d339884be7823", + "transactionIndex": 62, + "gasUsed": "3091658", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x01b61164b5bd3afd986a4a0248d640d7a95a7983aed138344da1b249879cac3b", + "transactionHash": "0xad6672a356ade35072a1f3d32fe1da6e8c46cbd53b4315494d8972fc6586aac7", + "logs": [], + "blockNumber": 9092668, + "cumulativeGasUsed": "29932201", + "status": 1, + "byzantium": true + }, + "args": [], + "solcInputHash": "ccc82ccc102007017cf322f5b7601563", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_oldManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"ManagerUpdated\",\"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\":[],\"name\":\"TokenDestinationsApproved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"amountPerPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"approveProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"availableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"beneficiary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"duration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"endTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isInitialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isRevoked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"contract IGraphTokenLockManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"passedPeriods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periodDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"release\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releaseStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revocable\",\"outputs\":[{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revoke\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokeProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sinceStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"surplusAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalOutstandingAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"usedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestingCliffTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawSurplus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"amountPerPeriod()\":{\"returns\":{\"_0\":\"Amount of tokens available after each period\"}},\"approveProtocol()\":{\"details\":\"Approves all token destinations registered in the manager to pull tokens\"},\"availableAmount()\":{\"details\":\"Implements the step-by-step schedule based on periods for available tokens\",\"returns\":{\"_0\":\"Amount of tokens available according to the schedule\"}},\"currentBalance()\":{\"returns\":{\"_0\":\"Tokens held in the contract\"}},\"currentPeriod()\":{\"returns\":{\"_0\":\"A number that represents the current period\"}},\"currentTime()\":{\"returns\":{\"_0\":\"Current block timestamp\"}},\"duration()\":{\"returns\":{\"_0\":\"Amount of seconds from contract startTime to endTime\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"passedPeriods()\":{\"returns\":{\"_0\":\"A number of periods that passed since the schedule started\"}},\"periodDuration()\":{\"returns\":{\"_0\":\"Duration of each period in seconds\"}},\"releasableAmount()\":{\"details\":\"Considers the schedule and takes into account already released tokens\",\"returns\":{\"_0\":\"Amount of tokens ready to be released\"}},\"release()\":{\"details\":\"All available releasable tokens are transferred to beneficiary\"},\"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.\"},\"revoke()\":{\"details\":\"Vesting schedule is always calculated based on managed tokens\"},\"revokeProtocol()\":{\"details\":\"Revokes approval to all token destinations in the manager to pull tokens\"},\"setManager(address)\":{\"params\":{\"_newManager\":\"Address of the new manager\"}},\"sinceStartTime()\":{\"details\":\"Returns zero if called before conctract starTime\",\"returns\":{\"_0\":\"Seconds elapsed from contract startTime\"}},\"surplusAmount()\":{\"details\":\"All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary\",\"returns\":{\"_0\":\"Amount of tokens considered as surplus\"}},\"totalOutstandingAmount()\":{\"details\":\"Does not consider schedule but just global amounts tracked\",\"returns\":{\"_0\":\"Amount of outstanding tokens for the lifetime of the contract\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"vestedAmount()\":{\"details\":\"Similar to available amount, but is fully vested when contract is non-revocable\",\"returns\":{\"_0\":\"Amount of tokens already vested\"}},\"withdrawSurplus(uint256)\":{\"details\":\"Tokens in the contract over outstanding amount are considered as surplus\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"GraphTokenLockWallet\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"amountPerPeriod()\":{\"notice\":\"Returns amount available to be released after each period according to schedule\"},\"approveProtocol()\":{\"notice\":\"Approves protocol access of the tokens managed by this contract\"},\"availableAmount()\":{\"notice\":\"Gets the currently available token according to the schedule\"},\"currentBalance()\":{\"notice\":\"Returns the amount of tokens currently held by the contract\"},\"currentPeriod()\":{\"notice\":\"Gets the current period based on the schedule\"},\"currentTime()\":{\"notice\":\"Returns the current block timestamp\"},\"duration()\":{\"notice\":\"Gets duration of contract from start to end in seconds\"},\"passedPeriods()\":{\"notice\":\"Gets the number of periods that passed since the first period\"},\"periodDuration()\":{\"notice\":\"Returns the duration of each period in seconds\"},\"releasableAmount()\":{\"notice\":\"Gets tokens currently available for release\"},\"release()\":{\"notice\":\"Releases tokens based on the configured schedule\"},\"revoke()\":{\"notice\":\"Revokes a vesting schedule and return the unvested tokens to the owner\"},\"revokeProtocol()\":{\"notice\":\"Revokes protocol access of the tokens managed by this contract\"},\"setManager(address)\":{\"notice\":\"Sets a new manager for this contract\"},\"sinceStartTime()\":{\"notice\":\"Gets time elapsed since the start of the contract\"},\"surplusAmount()\":{\"notice\":\"Gets surplus amount in the contract based on outstanding amount to release\"},\"totalOutstandingAmount()\":{\"notice\":\"Gets the outstanding amount yet to be released based on the whole contract lifetime\"},\"vestedAmount()\":{\"notice\":\"Gets the amount of currently vested tokens\"},\"withdrawSurplus(uint256)\":{\"notice\":\"Withdraws surplus, unmanaged tokens from the contract\"}},\"notice\":\"This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GraphTokenLockWallet.sol\":\"GraphTokenLockWallet\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\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, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, 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) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\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 *\\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 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 *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\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 *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting 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 *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting 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 *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\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 * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\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 *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\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 *\\n * - The divisor cannot be zero.\\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\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\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\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\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 IERC20;` 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 /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\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 from 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. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\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\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\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\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"contracts/GraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport \\\"./Ownable.sol\\\";\\nimport \\\"./MathUtils.sol\\\";\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\n/**\\n * @title GraphTokenLock\\n * @notice Contract that manages an unlocking schedule of tokens.\\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\\n * they can only be released under certain time conditions.\\n *\\n * This contract implements a release scheduled based on periods and tokens are released in steps\\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\\n * It also supports revocation to be used for vesting schedules.\\n *\\n * The contract supports receiving extra funds than the managed tokens ones that can be\\n * withdrawn by the beneficiary at any time.\\n *\\n * A releaseStartTime parameter is included to override the default release schedule and\\n * perform the first release on the configured time. After that it will continue with the\\n * default schedule.\\n */\\nabstract contract GraphTokenLock is Ownable, IGraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n uint256 private constant MIN_PERIOD = 1;\\n\\n // -- State --\\n\\n IERC20 public token;\\n address public beneficiary;\\n\\n // Configuration\\n\\n // Amount of tokens managed by the contract schedule\\n uint256 public managedAmount;\\n\\n uint256 public startTime; // Start datetime (in unixtimestamp)\\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\\n uint256 public periods; // Number of vesting/release periods\\n\\n // First release date for tokens (in unixtimestamp)\\n // If set, no tokens will be released before releaseStartTime ignoring\\n // the amount to release each period\\n uint256 public releaseStartTime;\\n // A cliff set a date to which a beneficiary needs to get to vest\\n // all preceding periods\\n uint256 public vestingCliffTime;\\n Revocability public revocable; // Whether to use vesting for locked funds\\n\\n // State\\n\\n bool public isRevoked;\\n bool public isInitialized;\\n uint256 public releasedAmount;\\n\\n // -- Events --\\n\\n event TokensReleased(address indexed beneficiary, uint256 amount);\\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\\n event TokensRevoked(address indexed beneficiary, uint256 amount);\\n\\n /**\\n * @dev Only allow calls from the beneficiary of the contract\\n */\\n modifier onlyBeneficiary() {\\n require(msg.sender == beneficiary, \\\"!auth\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the contract\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _vestingCliffTime Override time for when the vesting start\\n * @param _revocable Whether the contract is revocable\\n */\\n function _initialize(\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) internal {\\n require(!isInitialized, \\\"Already initialized\\\");\\n require(_owner != address(0), \\\"Owner cannot be zero\\\");\\n require(_beneficiary != address(0), \\\"Beneficiary cannot be zero\\\");\\n require(_token != address(0), \\\"Token cannot be zero\\\");\\n require(_managedAmount > 0, \\\"Managed tokens cannot be zero\\\");\\n require(_startTime != 0, \\\"Start time must be set\\\");\\n require(_startTime < _endTime, \\\"Start time > end time\\\");\\n require(_periods >= MIN_PERIOD, \\\"Periods cannot be below minimum\\\");\\n require(_revocable != Revocability.NotSet, \\\"Must set a revocability option\\\");\\n require(_releaseStartTime < _endTime, \\\"Release start time must be before end time\\\");\\n require(_vestingCliffTime < _endTime, \\\"Cliff time must be before end time\\\");\\n\\n isInitialized = true;\\n\\n Ownable.initialize(_owner);\\n beneficiary = _beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _managedAmount;\\n\\n startTime = _startTime;\\n endTime = _endTime;\\n periods = _periods;\\n\\n // Optionals\\n releaseStartTime = _releaseStartTime;\\n vestingCliffTime = _vestingCliffTime;\\n revocable = _revocable;\\n }\\n\\n // -- Balances --\\n\\n /**\\n * @notice Returns the amount of tokens currently held by the contract\\n * @return Tokens held in the contract\\n */\\n function currentBalance() public override view returns (uint256) {\\n return token.balanceOf(address(this));\\n }\\n\\n // -- Time & Periods --\\n\\n /**\\n * @notice Returns the current block timestamp\\n * @return Current block timestamp\\n */\\n function currentTime() public override view returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @notice Gets duration of contract from start to end in seconds\\n * @return Amount of seconds from contract startTime to endTime\\n */\\n function duration() public override view returns (uint256) {\\n return endTime.sub(startTime);\\n }\\n\\n /**\\n * @notice Gets time elapsed since the start of the contract\\n * @dev Returns zero if called before conctract starTime\\n * @return Seconds elapsed from contract startTime\\n */\\n function sinceStartTime() public override view returns (uint256) {\\n uint256 current = currentTime();\\n if (current <= startTime) {\\n return 0;\\n }\\n return current.sub(startTime);\\n }\\n\\n /**\\n * @notice Returns amount available to be released after each period according to schedule\\n * @return Amount of tokens available after each period\\n */\\n function amountPerPeriod() public override view returns (uint256) {\\n return managedAmount.div(periods);\\n }\\n\\n /**\\n * @notice Returns the duration of each period in seconds\\n * @return Duration of each period in seconds\\n */\\n function periodDuration() public override view returns (uint256) {\\n return duration().div(periods);\\n }\\n\\n /**\\n * @notice Gets the current period based on the schedule\\n * @return A number that represents the current period\\n */\\n function currentPeriod() public override view returns (uint256) {\\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\\n }\\n\\n /**\\n * @notice Gets the number of periods that passed since the first period\\n * @return A number of periods that passed since the schedule started\\n */\\n function passedPeriods() public override view returns (uint256) {\\n return currentPeriod().sub(MIN_PERIOD);\\n }\\n\\n // -- Locking & Release Schedule --\\n\\n /**\\n * @notice Gets the currently available token according to the schedule\\n * @dev Implements the step-by-step schedule based on periods for available tokens\\n * @return Amount of tokens available according to the schedule\\n */\\n function availableAmount() public override view returns (uint256) {\\n uint256 current = currentTime();\\n\\n // Before contract start no funds are available\\n if (current < startTime) {\\n return 0;\\n }\\n\\n // After contract ended all funds are available\\n if (current > endTime) {\\n return managedAmount;\\n }\\n\\n // Get available amount based on period\\n return passedPeriods().mul(amountPerPeriod());\\n }\\n\\n /**\\n * @notice Gets the amount of currently vested tokens\\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\\n * @return Amount of tokens already vested\\n */\\n function vestedAmount() public override view returns (uint256) {\\n // If non-revocable it is fully vested\\n if (revocable == Revocability.Disabled) {\\n return managedAmount;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n return availableAmount();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule and takes into account already released tokens\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public override view returns (uint256) {\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n uint256 releasable = availableAmount().sub(releasedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\\n * @dev Does not consider schedule but just global amounts tracked\\n * @return Amount of outstanding tokens for the lifetime of the contract\\n */\\n function totalOutstandingAmount() public override view returns (uint256) {\\n return managedAmount.sub(releasedAmount);\\n }\\n\\n /**\\n * @notice Gets surplus amount in the contract based on outstanding amount to release\\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary\\n * @return Amount of tokens considered as surplus\\n */\\n function surplusAmount() public override view returns (uint256) {\\n uint256 balance = currentBalance();\\n uint256 outstandingAmount = totalOutstandingAmount();\\n if (balance > outstandingAmount) {\\n return balance.sub(outstandingAmount);\\n }\\n return 0;\\n }\\n\\n // -- Value Transfer --\\n\\n /**\\n * @notice Releases tokens based on the configured schedule\\n * @dev All available releasable tokens are transferred to beneficiary\\n */\\n function release() external override onlyBeneficiary {\\n uint256 amountToRelease = releasableAmount();\\n require(amountToRelease > 0, \\\"No available releasable amount\\\");\\n\\n releasedAmount = releasedAmount.add(amountToRelease);\\n\\n token.safeTransfer(beneficiary, amountToRelease);\\n\\n emit TokensReleased(beneficiary, amountToRelease);\\n }\\n\\n /**\\n * @notice Withdraws surplus, unmanaged tokens from the contract\\n * @dev Tokens in the contract over outstanding amount are considered as surplus\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n require(surplusAmount() >= _amount, \\\"Amount requested > surplus available\\\");\\n\\n token.safeTransfer(beneficiary, _amount);\\n\\n emit TokensWithdrawn(beneficiary, _amount);\\n }\\n\\n /**\\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\\n * @dev Vesting schedule is always calculated based on managed tokens\\n */\\n function revoke() external override onlyOwner {\\n require(revocable == Revocability.Enabled, \\\"Contract is non-revocable\\\");\\n require(isRevoked == false, \\\"Already revoked\\\");\\n\\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\\n require(unvestedAmount > 0, \\\"No available unvested amount\\\");\\n\\n isRevoked = true;\\n\\n token.safeTransfer(owner(), unvestedAmount);\\n\\n emit TokensRevoked(beneficiary, unvestedAmount);\\n }\\n}\\n\",\"keccak256\":\"0x4bb186cde23ff896ec75e825b3944e480bd56ec6055cf68b704ba9e44e3aa495\",\"license\":\"MIT\"},\"contracts/GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport \\\"./GraphTokenLock.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n */\\ncontract GraphTokenLockWallet is GraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n // -- State --\\n\\n IGraphTokenLockManager public manager;\\n uint256 public usedAmount;\\n\\n uint256 private constant MAX_UINT256 = 2**256 - 1;\\n\\n // -- Events --\\n\\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\\n event TokenDestinationsApproved();\\n event TokenDestinationsRevoked();\\n\\n // Initializer\\n function initialize(\\n address _manager,\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) external {\\n _initialize(\\n _owner,\\n _beneficiary,\\n _token,\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n _setManager(_manager);\\n }\\n\\n // -- Admin --\\n\\n /**\\n * @notice Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function setManager(address _newManager) external onlyOwner {\\n _setManager(_newManager);\\n }\\n\\n /**\\n * @dev Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function _setManager(address _newManager) private {\\n require(_newManager != address(0), \\\"Manager cannot be empty\\\");\\n require(Address.isContract(_newManager), \\\"Manager must be a contract\\\");\\n\\n address oldManager = address(manager);\\n manager = IGraphTokenLockManager(_newManager);\\n\\n emit ManagerUpdated(oldManager, _newManager);\\n }\\n\\n // -- Beneficiary --\\n\\n /**\\n * @notice Approves protocol access of the tokens managed by this contract\\n * @dev Approves all token destinations registered in the manager to pull tokens\\n */\\n function approveProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n token.safeApprove(dstList[i], MAX_UINT256);\\n }\\n emit TokenDestinationsApproved();\\n }\\n\\n /**\\n * @notice Revokes protocol access of the tokens managed by this contract\\n * @dev Revokes approval to all token destinations in the manager to pull tokens\\n */\\n function revokeProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n token.safeApprove(dstList[i], 0);\\n }\\n emit TokenDestinationsRevoked();\\n }\\n\\n /**\\n * @notice Forward authorized contract calls to protocol contracts\\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\\n */\\n fallback() external payable {\\n // Only beneficiary can forward calls\\n require(msg.sender == beneficiary, \\\"Unauthorized caller\\\");\\n\\n // Function call validation\\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\\n require(_target != address(0), \\\"Unauthorized function\\\");\\n\\n uint256 oldBalance = currentBalance();\\n\\n // Call function with data\\n Address.functionCall(_target, msg.data);\\n\\n // Tracked used tokens in the protocol\\n // We do this check after balances were updated by the forwarded call\\n // Check is only enforced for revocable contracts to save some gas\\n if (revocable == Revocability.Enabled) {\\n // Track contract balance change\\n uint256 newBalance = currentBalance();\\n if (newBalance < oldBalance) {\\n // Outflow\\n uint256 diff = oldBalance.sub(newBalance);\\n usedAmount = usedAmount.add(diff);\\n } else {\\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\\n // underflow. We set it to zero in that case.\\n uint256 diff = newBalance.sub(oldBalance);\\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\\n }\\n require(usedAmount <= vestedAmount(), \\\"Cannot use more tokens than vested amount\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc9615104e2bb94e163e6db227089b950e33de804ad811b5d45242f2beca192b4\",\"license\":\"MIT\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability { NotSet, Enabled, Disabled }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0x396f8102fb03d884d599831989d9753a69f0d9b65538c8206c81e0067827c5a2\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nlibrary MathUtils {\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0xe2512e1da48bc8363acd15f66229564b02d66706665d7da740604566913c1400\",\"license\":\"MIT\"},\"contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\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 * The owner account will be passed on initialization of the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\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 owner) internal {\\n _owner = owner;\\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(_owner == msg.sender, \\\"Ownable: caller is not the owner\\\");\\n _;\\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() external virtual 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) external virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xc93c7362ac4d74b624b48517985f92c277ce90ae6e5ccb706e70a61af5752077\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b5061373e806100206000396000f3fe60806040526004361061021e5760003560e01c806386d00e0211610123578063bc0163c1116100ab578063e8dda6f51161006f578063e8dda6f514610c51578063e97d87d514610c7c578063ebbab99214610ca7578063f2fde38b14610cd2578063fc0c546a14610d235761021f565b8063bc0163c114610a84578063bd896dcb14610aaf578063ce845d1d14610baa578063d0ebdbe714610bd5578063d18e81b314610c265761021f565b806391f7cfb9116100f257806391f7cfb9146109b1578063a4caeb42146109dc578063b0d1818c14610a07578063b470aade14610a42578063b6549f7514610a6d5761021f565b806386d00e02146108f857806386d1a69f14610923578063872a78101461093a5780638da5cb5b146109705761021f565b8063398057a3116101a65780635b940081116101755780635b9400811461084957806360e7994414610874578063715018a61461088b57806378e97925146108a25780637bdf05af146108cd5761021f565b8063398057a31461078757806344b1231f146107b257806345d30a17146107dd578063481c6a75146108085761021f565b80632a627814116101ed5780632a627814146106aa5780632bc9ed02146106c15780633197cbb6146106ee57806338af3eed14610719578063392e53cd1461075a5761021f565b8063029c6c9f146105fe57806306040618146106295780630dff24d5146106545780630fb5a6b41461067f5761021f565b5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146102e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f556e617574686f72697a65642063616c6c65720000000000000000000000000081525060200191505060405180910390fd5b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b15801561039a57600080fd5b505afa1580156103ae573d6000803e3d6000fd5b505050506040513d60208110156103c457600080fd5b81019080805190602001909291905050509050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561047a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f556e617574686f72697a65642066756e6374696f6e000000000000000000000081525060200191505060405180910390fd5b6000610484610d64565b90506104d5826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610e2f565b50600160028111156104e357fe5b600960009054906101000a900460ff1660028111156104fe57fe5b14156105fa57600061050e610d64565b90508181101561055057600061052d8284610e7990919063ffffffff16565b905061054481600c54610efc90919063ffffffff16565b600c8190555050610596565b60006105658383610e7990919063ffffffff16565b9050600c5481101561058b5761058681600c54610e7990919063ffffffff16565b61058e565b60005b600c81905550505b61059e610f84565b600c5411156105f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806136116029913960400191505060405180910390fd5b505b5050005b34801561060a57600080fd5b50610613610ff3565b6040518082815260200191505060405180910390f35b34801561063557600080fd5b5061063e611011565b6040518082815260200191505060405180910390f35b34801561066057600080fd5b5061066961104c565b6040518082815260200191505060405180910390f35b34801561068b57600080fd5b50610694611093565b6040518082815260200191505060405180910390f35b3480156106b657600080fd5b506106bf6110b1565b005b3480156106cd57600080fd5b506106d661137e565b60405180821515815260200191505060405180910390f35b3480156106fa57600080fd5b50610703611391565b6040518082815260200191505060405180910390f35b34801561072557600080fd5b5061072e611397565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561076657600080fd5b5061076f6113bd565b60405180821515815260200191505060405180910390f35b34801561079357600080fd5b5061079c6113d0565b6040518082815260200191505060405180910390f35b3480156107be57600080fd5b506107c7610f84565b6040518082815260200191505060405180910390f35b3480156107e957600080fd5b506107f26113d6565b6040518082815260200191505060405180910390f35b34801561081457600080fd5b5061081d6113dc565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561085557600080fd5b5061085e611402565b6040518082815260200191505060405180910390f35b34801561088057600080fd5b506108896114bc565b005b34801561089757600080fd5b506108a061176a565b005b3480156108ae57600080fd5b506108b76118e9565b6040518082815260200191505060405180910390f35b3480156108d957600080fd5b506108e26118ef565b6040518082815260200191505060405180910390f35b34801561090457600080fd5b5061090d61192b565b6040518082815260200191505060405180910390f35b34801561092f57600080fd5b50610938611931565b005b34801561094657600080fd5b5061094f611b73565b6040518082600281111561095f57fe5b815260200191505060405180910390f35b34801561097c57600080fd5b50610985611b86565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109bd57600080fd5b506109c6611baf565b6040518082815260200191505060405180910390f35b3480156109e857600080fd5b506109f1611c0d565b6040518082815260200191505060405180910390f35b348015610a1357600080fd5b50610a4060048036036020811015610a2a57600080fd5b8101908080359060200190929190505050611c13565b005b348015610a4e57600080fd5b50610a57611e8e565b6040518082815260200191505060405180910390f35b348015610a7957600080fd5b50610a82611eb1565b005b348015610a9057600080fd5b50610a9961220e565b6040518082815260200191505060405180910390f35b348015610abb57600080fd5b50610ba86004803603610160811015610ad357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803560ff16906020019092919050505061222c565b005b348015610bb657600080fd5b50610bbf610d64565b6040518082815260200191505060405180910390f35b348015610be157600080fd5b50610c2460048036036020811015610bf857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612254565b005b348015610c3257600080fd5b50610c3b612321565b6040518082815260200191505060405180910390f35b348015610c5d57600080fd5b50610c66612329565b6040518082815260200191505060405180910390f35b348015610c8857600080fd5b50610c9161232f565b6040518082815260200191505060405180910390f35b348015610cb357600080fd5b50610cbc612335565b6040518082815260200191505060405180910390f35b348015610cde57600080fd5b50610d2160048036036020811015610cf557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612357565b005b348015610d2f57600080fd5b50610d3861255b565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610def57600080fd5b505afa158015610e03573d6000803e3d6000fd5b505050506040513d6020811015610e1957600080fd5b8101908080519060200190929190505050905090565b6060610e7183836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612581565b905092915050565b600082821115610ef1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b818303905092915050565b600080828401905083811015610f7a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000600280811115610f9257fe5b600960009054906101000a900460ff166002811115610fad57fe5b1415610fbd576003549050610ff0565b6000600854118015610fd75750600854610fd5612321565b105b15610fe55760009050610ff0565b610fed611baf565b90505b90565b600061100c60065460035461259990919063ffffffff16565b905090565b60006110476001611039611023611e8e565b61102b6118ef565b61259990919063ffffffff16565b610efc90919063ffffffff16565b905090565b600080611057610d64565b9050600061106361220e565b905080821115611089576110808183610e7990919063ffffffff16565b92505050611090565b6000925050505b90565b60006110ac600454600554610e7990919063ffffffff16565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611174576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156111de57600080fd5b505afa1580156111f2573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561121c57600080fd5b810190808051604051939291908464010000000082111561123c57600080fd5b8382019150602082018581111561125257600080fd5b825186602082028301116401000000008211171561126f57600080fd5b8083526020830192505050908051906020019060200280838360005b838110156112a657808201518184015260208101905061128b565b50505050905001604052505050905060005b815181101561134e576113418282815181106112d057fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166126229092919063ffffffff16565b80806001019150506112b8565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b600960019054906101000a900460ff1681565b60055481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960029054906101000a900460ff1681565b60035481565b600a5481565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060075411801561141d575060075461141b612321565b105b1561142b57600090506114b9565b6001600281111561143857fe5b600960009054906101000a900460ff16600281111561145357fe5b14801561146257506000600854115b80156114765750600854611474612321565b105b1561148457600090506114b9565b60006114a2600a54611494611baf565b610e7990919063ffffffff16565b90506114b56114af610d64565b826127e7565b9150505b90565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461157f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156115e957600080fd5b505afa1580156115fd573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561162757600080fd5b810190808051604051939291908464010000000082111561164757600080fd5b8382019150602082018581111561165d57600080fd5b825186602082028301116401000000008211171561167a57600080fd5b8083526020830192505050908051906020019060200280838360005b838110156116b1578082015181840152602081019050611696565b50505050905001604052505050905060005b815181101561173a5761172d8282815181106116db57fe5b60200260200101516000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166126229092919063ffffffff16565b80806001019150506116c3565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461182b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60045481565b6000806118fa612321565b9050600454811161190f576000915050611928565b61192460045482610e7990919063ffffffff16565b9150505b90565b60085481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146119f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60006119fe611402565b905060008111611a76576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e74000081525060200191505060405180910390fd5b611a8b81600a54610efc90919063ffffffff16565b600a81905550611b00600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166128009092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df93179826040518082815260200191505060405180910390a250565b600960009054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080611bba612321565b9050600454811015611bd0576000915050611c0a565b600554811115611be557600354915050611c0a565b611c06611bf0610ff3565b611bf8612335565b6128a290919063ffffffff16565b9150505b90565b60065481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611cd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008111611d4c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f416d6f756e742063616e6e6f74206265207a65726f000000000000000000000081525060200191505060405180910390fd5b80611d5561104c565b1015611dac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061365b6024913960400191505060405180910390fd5b611e1b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166128009092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040518082815260200191505060405180910390a250565b6000611eac600654611e9e611093565b61259990919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611f72576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60016002811115611f7f57fe5b600960009054906101000a900460ff166002811115611f9a57fe5b1461200d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f436f6e7472616374206973206e6f6e2d7265766f6361626c650000000000000081525060200191505060405180910390fd5b60001515600960019054906101000a900460ff16151514612096576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f416c7265616479207265766f6b6564000000000000000000000000000000000081525060200191505060405180910390fd5b60006120b46120a3610f84565b600354610e7990919063ffffffff16565b90506000811161212c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4e6f20617661696c61626c6520756e76657374656420616d6f756e740000000081525060200191505060405180910390fd5b6001600960016101000a81548160ff02191690831515021790555061219b612152611b86565b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166128009092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040518082815260200191505060405180910390a250565b6000612227600a54600354610e7990919063ffffffff16565b905090565b61223e8a8a8a8a8a8a8a8a8a8a612928565b6122478b612fa9565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612315576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61231e81612fa9565b50565b600042905090565b600c5481565b60075481565b60006123526001612344611011565b610e7990919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612418576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561249e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806135c56026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060612590848460008561318d565b90509392505050565b6000808211612610576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b81838161261957fe5b04905092915050565b60008114806126f0575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b1580156126b357600080fd5b505afa1580156126c7573d6000803e3d6000fd5b505050506040513d60208110156126dd57600080fd5b8101908080519060200190929190505050145b612745576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806136d36036913960400191505060405180910390fd5b6127e28363095ea7b360e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613336565b505050565b60008183106127f657816127f8565b825b905092915050565b61289d8363a9059cbb60e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613336565b505050565b6000808314156128b55760009050612922565b60008284029050828482816128c657fe5b041461291d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061363a6021913960400191505060405180910390fd5b809150505b92915050565b600960029054906101000a900460ff16156129ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e697469616c697a65640000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415612a4e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4f776e65722063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff161415612af1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f42656e65666963696172792063616e6e6f74206265207a65726f00000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff161415612b94576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f546f6b656e2063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b60008711612c0a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f00000081525060200191505060405180910390fd5b6000861415612c81576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53746172742074696d65206d757374206265207365740000000000000000000081525060200191505060405180910390fd5b848610612cf6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f53746172742074696d65203e20656e642074696d65000000000000000000000081525060200191505060405180910390fd5b6001841015612d6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d0081525060200191505060405180910390fd5b60006002811115612d7a57fe5b816002811115612d8657fe5b1415612dfa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4d757374207365742061207265766f636162696c697479206f7074696f6e000081525060200191505060405180910390fd5b848310612e52576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a81526020018061367f602a913960400191505060405180910390fd5b848210612eaa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806135a36022913960400191505060405180910390fd5b6001600960026101000a81548160ff021916908315150217905550612ece8a613425565b88600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555086600381905550856004819055508460058190555083600681905550826007819055508160088190555080600960006101000a81548160ff02191690836002811115612f9857fe5b021790555050505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561304c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4d616e616765722063616e6e6f7420626520656d70747900000000000000000081525060200191505060405180910390fd5b613055816134c3565b6130c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4d616e61676572206d757374206265206120636f6e747261637400000000000081525060200191505060405180910390fd5b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b6060824710156131e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806135eb6026913960400191505060405180910390fd5b6131f1856134c3565b613263576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081525060200191505060405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b602083106132b35780518252602082019150602081019050602083039250613290565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613315576040519150601f19603f3d011682016040523d82523d6000602084013e61331a565b606091505b509150915061332a8282866134d6565b92505050949350505050565b6060613398826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166125819092919063ffffffff16565b9050600081511115613420578080602001905160208110156133b957600080fd5b810190808051906020019092919050505061341f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001806136a9602a913960400191505060405180910390fd5b5b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080823b905060008111915050919050565b606083156134e65782905061359b565b6000835111156134f95782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613560578082015181840152602081019050613545565b50505050905090810190601f16801561358d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b939250505056fe436c6966662074696d65206d757374206265206265666f726520656e642074696d654f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c43616e6e6f7420757365206d6f726520746f6b656e73207468616e2076657374656420616d6f756e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77416d6f756e7420726571756573746564203e20737572706c757320617661696c61626c6552656c656173652073746172742074696d65206d757374206265206265666f726520656e642074696d655361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a2646970667358221220cc48d739e1a8482b566f43de0163a50f30dfe854c89a88c2aff9c3746523e8f964736f6c63430007030033", + "deployedBytecode": "0x60806040526004361061021e5760003560e01c806386d00e0211610123578063bc0163c1116100ab578063e8dda6f51161006f578063e8dda6f514610c51578063e97d87d514610c7c578063ebbab99214610ca7578063f2fde38b14610cd2578063fc0c546a14610d235761021f565b8063bc0163c114610a84578063bd896dcb14610aaf578063ce845d1d14610baa578063d0ebdbe714610bd5578063d18e81b314610c265761021f565b806391f7cfb9116100f257806391f7cfb9146109b1578063a4caeb42146109dc578063b0d1818c14610a07578063b470aade14610a42578063b6549f7514610a6d5761021f565b806386d00e02146108f857806386d1a69f14610923578063872a78101461093a5780638da5cb5b146109705761021f565b8063398057a3116101a65780635b940081116101755780635b9400811461084957806360e7994414610874578063715018a61461088b57806378e97925146108a25780637bdf05af146108cd5761021f565b8063398057a31461078757806344b1231f146107b257806345d30a17146107dd578063481c6a75146108085761021f565b80632a627814116101ed5780632a627814146106aa5780632bc9ed02146106c15780633197cbb6146106ee57806338af3eed14610719578063392e53cd1461075a5761021f565b8063029c6c9f146105fe57806306040618146106295780630dff24d5146106545780630fb5a6b41461067f5761021f565b5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146102e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f556e617574686f72697a65642063616c6c65720000000000000000000000000081525060200191505060405180910390fd5b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b15801561039a57600080fd5b505afa1580156103ae573d6000803e3d6000fd5b505050506040513d60208110156103c457600080fd5b81019080805190602001909291905050509050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561047a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f556e617574686f72697a65642066756e6374696f6e000000000000000000000081525060200191505060405180910390fd5b6000610484610d64565b90506104d5826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610e2f565b50600160028111156104e357fe5b600960009054906101000a900460ff1660028111156104fe57fe5b14156105fa57600061050e610d64565b90508181101561055057600061052d8284610e7990919063ffffffff16565b905061054481600c54610efc90919063ffffffff16565b600c8190555050610596565b60006105658383610e7990919063ffffffff16565b9050600c5481101561058b5761058681600c54610e7990919063ffffffff16565b61058e565b60005b600c81905550505b61059e610f84565b600c5411156105f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806136116029913960400191505060405180910390fd5b505b5050005b34801561060a57600080fd5b50610613610ff3565b6040518082815260200191505060405180910390f35b34801561063557600080fd5b5061063e611011565b6040518082815260200191505060405180910390f35b34801561066057600080fd5b5061066961104c565b6040518082815260200191505060405180910390f35b34801561068b57600080fd5b50610694611093565b6040518082815260200191505060405180910390f35b3480156106b657600080fd5b506106bf6110b1565b005b3480156106cd57600080fd5b506106d661137e565b60405180821515815260200191505060405180910390f35b3480156106fa57600080fd5b50610703611391565b6040518082815260200191505060405180910390f35b34801561072557600080fd5b5061072e611397565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561076657600080fd5b5061076f6113bd565b60405180821515815260200191505060405180910390f35b34801561079357600080fd5b5061079c6113d0565b6040518082815260200191505060405180910390f35b3480156107be57600080fd5b506107c7610f84565b6040518082815260200191505060405180910390f35b3480156107e957600080fd5b506107f26113d6565b6040518082815260200191505060405180910390f35b34801561081457600080fd5b5061081d6113dc565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561085557600080fd5b5061085e611402565b6040518082815260200191505060405180910390f35b34801561088057600080fd5b506108896114bc565b005b34801561089757600080fd5b506108a061176a565b005b3480156108ae57600080fd5b506108b76118e9565b6040518082815260200191505060405180910390f35b3480156108d957600080fd5b506108e26118ef565b6040518082815260200191505060405180910390f35b34801561090457600080fd5b5061090d61192b565b6040518082815260200191505060405180910390f35b34801561092f57600080fd5b50610938611931565b005b34801561094657600080fd5b5061094f611b73565b6040518082600281111561095f57fe5b815260200191505060405180910390f35b34801561097c57600080fd5b50610985611b86565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109bd57600080fd5b506109c6611baf565b6040518082815260200191505060405180910390f35b3480156109e857600080fd5b506109f1611c0d565b6040518082815260200191505060405180910390f35b348015610a1357600080fd5b50610a4060048036036020811015610a2a57600080fd5b8101908080359060200190929190505050611c13565b005b348015610a4e57600080fd5b50610a57611e8e565b6040518082815260200191505060405180910390f35b348015610a7957600080fd5b50610a82611eb1565b005b348015610a9057600080fd5b50610a9961220e565b6040518082815260200191505060405180910390f35b348015610abb57600080fd5b50610ba86004803603610160811015610ad357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803560ff16906020019092919050505061222c565b005b348015610bb657600080fd5b50610bbf610d64565b6040518082815260200191505060405180910390f35b348015610be157600080fd5b50610c2460048036036020811015610bf857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612254565b005b348015610c3257600080fd5b50610c3b612321565b6040518082815260200191505060405180910390f35b348015610c5d57600080fd5b50610c66612329565b6040518082815260200191505060405180910390f35b348015610c8857600080fd5b50610c9161232f565b6040518082815260200191505060405180910390f35b348015610cb357600080fd5b50610cbc612335565b6040518082815260200191505060405180910390f35b348015610cde57600080fd5b50610d2160048036036020811015610cf557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612357565b005b348015610d2f57600080fd5b50610d3861255b565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610def57600080fd5b505afa158015610e03573d6000803e3d6000fd5b505050506040513d6020811015610e1957600080fd5b8101908080519060200190929190505050905090565b6060610e7183836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612581565b905092915050565b600082821115610ef1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b818303905092915050565b600080828401905083811015610f7a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000600280811115610f9257fe5b600960009054906101000a900460ff166002811115610fad57fe5b1415610fbd576003549050610ff0565b6000600854118015610fd75750600854610fd5612321565b105b15610fe55760009050610ff0565b610fed611baf565b90505b90565b600061100c60065460035461259990919063ffffffff16565b905090565b60006110476001611039611023611e8e565b61102b6118ef565b61259990919063ffffffff16565b610efc90919063ffffffff16565b905090565b600080611057610d64565b9050600061106361220e565b905080821115611089576110808183610e7990919063ffffffff16565b92505050611090565b6000925050505b90565b60006110ac600454600554610e7990919063ffffffff16565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611174576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156111de57600080fd5b505afa1580156111f2573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561121c57600080fd5b810190808051604051939291908464010000000082111561123c57600080fd5b8382019150602082018581111561125257600080fd5b825186602082028301116401000000008211171561126f57600080fd5b8083526020830192505050908051906020019060200280838360005b838110156112a657808201518184015260208101905061128b565b50505050905001604052505050905060005b815181101561134e576113418282815181106112d057fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166126229092919063ffffffff16565b80806001019150506112b8565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b600960019054906101000a900460ff1681565b60055481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960029054906101000a900460ff1681565b60035481565b600a5481565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060075411801561141d575060075461141b612321565b105b1561142b57600090506114b9565b6001600281111561143857fe5b600960009054906101000a900460ff16600281111561145357fe5b14801561146257506000600854115b80156114765750600854611474612321565b105b1561148457600090506114b9565b60006114a2600a54611494611baf565b610e7990919063ffffffff16565b90506114b56114af610d64565b826127e7565b9150505b90565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461157f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156115e957600080fd5b505afa1580156115fd573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561162757600080fd5b810190808051604051939291908464010000000082111561164757600080fd5b8382019150602082018581111561165d57600080fd5b825186602082028301116401000000008211171561167a57600080fd5b8083526020830192505050908051906020019060200280838360005b838110156116b1578082015181840152602081019050611696565b50505050905001604052505050905060005b815181101561173a5761172d8282815181106116db57fe5b60200260200101516000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166126229092919063ffffffff16565b80806001019150506116c3565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461182b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60045481565b6000806118fa612321565b9050600454811161190f576000915050611928565b61192460045482610e7990919063ffffffff16565b9150505b90565b60085481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146119f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60006119fe611402565b905060008111611a76576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e74000081525060200191505060405180910390fd5b611a8b81600a54610efc90919063ffffffff16565b600a81905550611b00600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166128009092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df93179826040518082815260200191505060405180910390a250565b600960009054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080611bba612321565b9050600454811015611bd0576000915050611c0a565b600554811115611be557600354915050611c0a565b611c06611bf0610ff3565b611bf8612335565b6128a290919063ffffffff16565b9150505b90565b60065481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611cd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008111611d4c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f416d6f756e742063616e6e6f74206265207a65726f000000000000000000000081525060200191505060405180910390fd5b80611d5561104c565b1015611dac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061365b6024913960400191505060405180910390fd5b611e1b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166128009092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040518082815260200191505060405180910390a250565b6000611eac600654611e9e611093565b61259990919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611f72576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60016002811115611f7f57fe5b600960009054906101000a900460ff166002811115611f9a57fe5b1461200d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f436f6e7472616374206973206e6f6e2d7265766f6361626c650000000000000081525060200191505060405180910390fd5b60001515600960019054906101000a900460ff16151514612096576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f416c7265616479207265766f6b6564000000000000000000000000000000000081525060200191505060405180910390fd5b60006120b46120a3610f84565b600354610e7990919063ffffffff16565b90506000811161212c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4e6f20617661696c61626c6520756e76657374656420616d6f756e740000000081525060200191505060405180910390fd5b6001600960016101000a81548160ff02191690831515021790555061219b612152611b86565b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166128009092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040518082815260200191505060405180910390a250565b6000612227600a54600354610e7990919063ffffffff16565b905090565b61223e8a8a8a8a8a8a8a8a8a8a612928565b6122478b612fa9565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612315576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61231e81612fa9565b50565b600042905090565b600c5481565b60075481565b60006123526001612344611011565b610e7990919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612418576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561249e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806135c56026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060612590848460008561318d565b90509392505050565b6000808211612610576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b81838161261957fe5b04905092915050565b60008114806126f0575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b1580156126b357600080fd5b505afa1580156126c7573d6000803e3d6000fd5b505050506040513d60208110156126dd57600080fd5b8101908080519060200190929190505050145b612745576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806136d36036913960400191505060405180910390fd5b6127e28363095ea7b360e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613336565b505050565b60008183106127f657816127f8565b825b905092915050565b61289d8363a9059cbb60e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613336565b505050565b6000808314156128b55760009050612922565b60008284029050828482816128c657fe5b041461291d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061363a6021913960400191505060405180910390fd5b809150505b92915050565b600960029054906101000a900460ff16156129ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e697469616c697a65640000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415612a4e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4f776e65722063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff161415612af1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f42656e65666963696172792063616e6e6f74206265207a65726f00000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff161415612b94576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f546f6b656e2063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b60008711612c0a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f00000081525060200191505060405180910390fd5b6000861415612c81576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53746172742074696d65206d757374206265207365740000000000000000000081525060200191505060405180910390fd5b848610612cf6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f53746172742074696d65203e20656e642074696d65000000000000000000000081525060200191505060405180910390fd5b6001841015612d6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d0081525060200191505060405180910390fd5b60006002811115612d7a57fe5b816002811115612d8657fe5b1415612dfa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4d757374207365742061207265766f636162696c697479206f7074696f6e000081525060200191505060405180910390fd5b848310612e52576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a81526020018061367f602a913960400191505060405180910390fd5b848210612eaa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806135a36022913960400191505060405180910390fd5b6001600960026101000a81548160ff021916908315150217905550612ece8a613425565b88600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555086600381905550856004819055508460058190555083600681905550826007819055508160088190555080600960006101000a81548160ff02191690836002811115612f9857fe5b021790555050505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561304c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4d616e616765722063616e6e6f7420626520656d70747900000000000000000081525060200191505060405180910390fd5b613055816134c3565b6130c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4d616e61676572206d757374206265206120636f6e747261637400000000000081525060200191505060405180910390fd5b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b6060824710156131e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806135eb6026913960400191505060405180910390fd5b6131f1856134c3565b613263576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081525060200191505060405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b602083106132b35780518252602082019150602081019050602083039250613290565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613315576040519150601f19603f3d011682016040523d82523d6000602084013e61331a565b606091505b509150915061332a8282866134d6565b92505050949350505050565b6060613398826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166125819092919063ffffffff16565b9050600081511115613420578080602001905160208110156133b957600080fd5b810190808051906020019092919050505061341f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001806136a9602a913960400191505060405180910390fd5b5b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080823b905060008111915050919050565b606083156134e65782905061359b565b6000835111156134f95782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613560578082015181840152602081019050613545565b50505050905090810190601f16801561358d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b939250505056fe436c6966662074696d65206d757374206265206265666f726520656e642074696d654f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c43616e6e6f7420757365206d6f726520746f6b656e73207468616e2076657374656420616d6f756e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77416d6f756e7420726571756573746564203e20737572706c757320617661696c61626c6552656c656173652073746172742074696d65206d757374206265206265666f726520656e642074696d655361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a2646970667358221220cc48d739e1a8482b566f43de0163a50f30dfe854c89a88c2aff9c3746523e8f964736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "amountPerPeriod()": { + "returns": { + "_0": "Amount of tokens available after each period" + } + }, + "approveProtocol()": { + "details": "Approves all token destinations registered in the manager to pull tokens" + }, + "availableAmount()": { + "details": "Implements the step-by-step schedule based on periods for available tokens", + "returns": { + "_0": "Amount of tokens available according to the schedule" + } + }, + "currentBalance()": { + "returns": { + "_0": "Tokens held in the contract" + } + }, + "currentPeriod()": { + "returns": { + "_0": "A number that represents the current period" + } + }, + "currentTime()": { + "returns": { + "_0": "Current block timestamp" + } + }, + "duration()": { + "returns": { + "_0": "Amount of seconds from contract startTime to endTime" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "passedPeriods()": { + "returns": { + "_0": "A number of periods that passed since the schedule started" + } + }, + "periodDuration()": { + "returns": { + "_0": "Duration of each period in seconds" + } + }, + "releasableAmount()": { + "details": "Considers the schedule and takes into account already released tokens", + "returns": { + "_0": "Amount of tokens ready to be released" + } + }, + "release()": { + "details": "All available releasable tokens are transferred to beneficiary" + }, + "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." + }, + "revoke()": { + "details": "Vesting schedule is always calculated based on managed tokens" + }, + "revokeProtocol()": { + "details": "Revokes approval to all token destinations in the manager to pull tokens" + }, + "setManager(address)": { + "params": { + "_newManager": "Address of the new manager" + } + }, + "sinceStartTime()": { + "details": "Returns zero if called before conctract starTime", + "returns": { + "_0": "Seconds elapsed from contract startTime" + } + }, + "surplusAmount()": { + "details": "All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary", + "returns": { + "_0": "Amount of tokens considered as surplus" + } + }, + "totalOutstandingAmount()": { + "details": "Does not consider schedule but just global amounts tracked", + "returns": { + "_0": "Amount of outstanding tokens for the lifetime of the contract" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "vestedAmount()": { + "details": "Similar to available amount, but is fully vested when contract is non-revocable", + "returns": { + "_0": "Amount of tokens already vested" + } + }, + "withdrawSurplus(uint256)": { + "details": "Tokens in the contract over outstanding amount are considered as surplus", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "GraphTokenLockWallet", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "amountPerPeriod()": { + "notice": "Returns amount available to be released after each period according to schedule" + }, + "approveProtocol()": { + "notice": "Approves protocol access of the tokens managed by this contract" + }, + "availableAmount()": { + "notice": "Gets the currently available token according to the schedule" + }, + "currentBalance()": { + "notice": "Returns the amount of tokens currently held by the contract" + }, + "currentPeriod()": { + "notice": "Gets the current period based on the schedule" + }, + "currentTime()": { + "notice": "Returns the current block timestamp" + }, + "duration()": { + "notice": "Gets duration of contract from start to end in seconds" + }, + "passedPeriods()": { + "notice": "Gets the number of periods that passed since the first period" + }, + "periodDuration()": { + "notice": "Returns the duration of each period in seconds" + }, + "releasableAmount()": { + "notice": "Gets tokens currently available for release" + }, + "release()": { + "notice": "Releases tokens based on the configured schedule" + }, + "revoke()": { + "notice": "Revokes a vesting schedule and return the unvested tokens to the owner" + }, + "revokeProtocol()": { + "notice": "Revokes protocol access of the tokens managed by this contract" + }, + "setManager(address)": { + "notice": "Sets a new manager for this contract" + }, + "sinceStartTime()": { + "notice": "Gets time elapsed since the start of the contract" + }, + "surplusAmount()": { + "notice": "Gets surplus amount in the contract based on outstanding amount to release" + }, + "totalOutstandingAmount()": { + "notice": "Gets the outstanding amount yet to be released based on the whole contract lifetime" + }, + "vestedAmount()": { + "notice": "Gets the amount of currently vested tokens" + }, + "withdrawSurplus(uint256)": { + "notice": "Withdraws surplus, unmanaged tokens from the contract" + } + }, + "notice": "This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 3693, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 1701, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "token", + "offset": 0, + "slot": "1", + "type": "t_contract(IERC20)542" + }, + { + "astId": 1703, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "beneficiary", + "offset": 0, + "slot": "2", + "type": "t_address" + }, + { + "astId": 1705, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "managedAmount", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 1707, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "startTime", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 1709, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "endTime", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 1711, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "periods", + "offset": 0, + "slot": "6", + "type": "t_uint256" + }, + { + "astId": 1713, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "releaseStartTime", + "offset": 0, + "slot": "7", + "type": "t_uint256" + }, + { + "astId": 1715, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "vestingCliffTime", + "offset": 0, + "slot": "8", + "type": "t_uint256" + }, + { + "astId": 1717, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "revocable", + "offset": 0, + "slot": "9", + "type": "t_enum(Revocability)3370" + }, + { + "astId": 1719, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isRevoked", + "offset": 1, + "slot": "9", + "type": "t_bool" + }, + { + "astId": 1721, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isInitialized", + "offset": 2, + "slot": "9", + "type": "t_bool" + }, + { + "astId": 1723, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "releasedAmount", + "offset": 0, + "slot": "10", + "type": "t_uint256" + }, + { + "astId": 3058, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "manager", + "offset": 0, + "slot": "11", + "type": "t_contract(IGraphTokenLockManager)3552" + }, + { + "astId": 3060, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "usedAmount", + "offset": 0, + "slot": "12", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IERC20)542": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(IGraphTokenLockManager)3552": { + "encoding": "inplace", + "label": "contract IGraphTokenLockManager", + "numberOfBytes": "20" + }, + "t_enum(Revocability)3370": { + "encoding": "inplace", + "label": "enum IGraphTokenLock.Revocability", + "numberOfBytes": "1" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/deployments/goerli/Scratch-6-Copy.json b/deployments/goerli/Scratch-6-Copy.json new file mode 100644 index 0000000..09a77ff --- /dev/null +++ b/deployments/goerli/Scratch-6-Copy.json @@ -0,0 +1,1083 @@ +{ + "address": "0xe57e45C97e01A5C1e50AeF7202e81cD199a3C4B2", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newBeneficiary", + "type": "address" + } + ], + "name": "BeneficiaryChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "LockAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "LockCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_oldManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "ManagerUpdated", + "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": [], + "name": "TokenDestinationsApproved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "acceptLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "amountPerPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "approveProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "availableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "beneficiary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "cancelLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newBeneficiary", + "type": "address" + } + ], + "name": "changeBeneficiary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "currentBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "duration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "endTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isAccepted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRevoked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "contract IGraphTokenLockManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "passedPeriods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periodDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "release", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "releaseStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revocable", + "outputs": [ + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "revoke", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokeProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "setManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sinceStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "startTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "surplusAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalOutstandingAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "usedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestingCliffTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawSurplus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x511be2dc09f36c0a7b1b4ce033bba4cbe5e407e4fd65e09d69c339925d9226d7", + "receipt": { + "to": null, + "from": "0xBc7f4d3a85B820fDB1058FD93073Eb6bc9AAF59b", + "contractAddress": "0xe57e45C97e01A5C1e50AeF7202e81cD199a3C4B2", + "transactionIndex": 20, + "gasUsed": "3483945", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x2d4d446e7043c456bb45307b0ad23e993455efcfc08817fde07cd2e8607a2be0", + "transactionHash": "0x511be2dc09f36c0a7b1b4ce033bba4cbe5e407e4fd65e09d69c339925d9226d7", + "logs": [], + "blockNumber": 9092518, + "cumulativeGasUsed": "9696841", + "status": 1, + "byzantium": true + }, + "args": [], + "solcInputHash": "0b3ac4290e5ed652698ff31ab3f44c7f", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newBeneficiary\",\"type\":\"address\"}],\"name\":\"BeneficiaryChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"LockAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"LockCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_oldManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"ManagerUpdated\",\"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\":[],\"name\":\"TokenDestinationsApproved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"acceptLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"amountPerPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"approveProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"availableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"beneficiary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"cancelLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newBeneficiary\",\"type\":\"address\"}],\"name\":\"changeBeneficiary\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"duration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"endTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isAccepted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isInitialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isRevoked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"contract IGraphTokenLockManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"passedPeriods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periodDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"release\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releaseStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revocable\",\"outputs\":[{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revoke\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokeProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sinceStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"surplusAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalOutstandingAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"usedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestingCliffTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawSurplus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"acceptLock()\":{\"details\":\"Can only be called by the beneficiary\"},\"amountPerPeriod()\":{\"returns\":{\"_0\":\"Amount of tokens available after each period\"}},\"approveProtocol()\":{\"details\":\"Approves all token destinations registered in the manager to pull tokens\"},\"availableAmount()\":{\"details\":\"Implements the step-by-step schedule based on periods for available tokens\",\"returns\":{\"_0\":\"Amount of tokens available according to the schedule\"}},\"cancelLock()\":{\"details\":\"Can only be called by the owner\"},\"changeBeneficiary(address)\":{\"details\":\"Can only be called by the beneficiary\",\"params\":{\"_newBeneficiary\":\"Address of the new beneficiary address\"}},\"currentBalance()\":{\"returns\":{\"_0\":\"Tokens held in the contract\"}},\"currentPeriod()\":{\"returns\":{\"_0\":\"A number that represents the current period\"}},\"currentTime()\":{\"returns\":{\"_0\":\"Current block timestamp\"}},\"duration()\":{\"returns\":{\"_0\":\"Amount of seconds from contract startTime to endTime\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"passedPeriods()\":{\"returns\":{\"_0\":\"A number of periods that passed since the schedule started\"}},\"periodDuration()\":{\"returns\":{\"_0\":\"Duration of each period in seconds\"}},\"releasableAmount()\":{\"details\":\"Considers the schedule, takes into account already released tokens and used amount\",\"returns\":{\"_0\":\"Amount of tokens ready to be released\"}},\"release()\":{\"details\":\"All available releasable tokens are transferred to beneficiary\"},\"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.\"},\"revoke()\":{\"details\":\"Vesting schedule is always calculated based on managed tokens\"},\"revokeProtocol()\":{\"details\":\"Revokes approval to all token destinations in the manager to pull tokens\"},\"setManager(address)\":{\"params\":{\"_newManager\":\"Address of the new manager\"}},\"sinceStartTime()\":{\"details\":\"Returns zero if called before conctract starTime\",\"returns\":{\"_0\":\"Seconds elapsed from contract startTime\"}},\"surplusAmount()\":{\"details\":\"All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary\",\"returns\":{\"_0\":\"Amount of tokens considered as surplus\"}},\"totalOutstandingAmount()\":{\"details\":\"Does not consider schedule but just global amounts tracked\",\"returns\":{\"_0\":\"Amount of outstanding tokens for the lifetime of the contract\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"vestedAmount()\":{\"details\":\"Similar to available amount, but is fully vested when contract is non-revocable\",\"returns\":{\"_0\":\"Amount of tokens already vested\"}},\"withdrawSurplus(uint256)\":{\"details\":\"Tokens in the contract over outstanding amount are considered as surplus\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"GraphTokenLockWallet\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"acceptLock()\":{\"notice\":\"Beneficiary accepts the lock, the owner cannot retrieve back the tokens\"},\"amountPerPeriod()\":{\"notice\":\"Returns amount available to be released after each period according to schedule\"},\"approveProtocol()\":{\"notice\":\"Approves protocol access of the tokens managed by this contract\"},\"availableAmount()\":{\"notice\":\"Gets the currently available token according to the schedule\"},\"cancelLock()\":{\"notice\":\"Owner cancel the lock and return the balance in the contract\"},\"changeBeneficiary(address)\":{\"notice\":\"Change the beneficiary of funds managed by the contract\"},\"currentBalance()\":{\"notice\":\"Returns the amount of tokens currently held by the contract\"},\"currentPeriod()\":{\"notice\":\"Gets the current period based on the schedule\"},\"currentTime()\":{\"notice\":\"Returns the current block timestamp\"},\"duration()\":{\"notice\":\"Gets duration of contract from start to end in seconds\"},\"passedPeriods()\":{\"notice\":\"Gets the number of periods that passed since the first period\"},\"periodDuration()\":{\"notice\":\"Returns the duration of each period in seconds\"},\"releasableAmount()\":{\"notice\":\"Gets tokens currently available for release\"},\"release()\":{\"notice\":\"Releases tokens based on the configured schedule\"},\"revoke()\":{\"notice\":\"Revokes a vesting schedule and return the unvested tokens to the owner\"},\"revokeProtocol()\":{\"notice\":\"Revokes protocol access of the tokens managed by this contract\"},\"setManager(address)\":{\"notice\":\"Sets a new manager for this contract\"},\"sinceStartTime()\":{\"notice\":\"Gets time elapsed since the start of the contract\"},\"surplusAmount()\":{\"notice\":\"Gets surplus amount in the contract based on outstanding amount to release\"},\"totalOutstandingAmount()\":{\"notice\":\"Gets the outstanding amount yet to be released based on the whole contract lifetime\"},\"vestedAmount()\":{\"notice\":\"Gets the amount of currently vested tokens\"},\"withdrawSurplus(uint256)\":{\"notice\":\"Withdraws surplus, unmanaged tokens from the contract\"}},\"notice\":\"This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GraphTokenLockWallet.sol\":\"GraphTokenLockWallet\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\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, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, 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) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\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 *\\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 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 *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\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 *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting 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 *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting 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 *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\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 * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\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 *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\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 *\\n * - The divisor cannot be zero.\\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\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\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\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\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 IERC20;` 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 /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\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 from 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. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\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\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\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\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"contracts/GraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport \\\"./Ownable.sol\\\";\\nimport \\\"./MathUtils.sol\\\";\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\n/**\\n * @title GraphTokenLock\\n * @notice Contract that manages an unlocking schedule of tokens.\\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\\n * they can only be released under certain time conditions.\\n *\\n * This contract implements a release scheduled based on periods and tokens are released in steps\\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\\n * It also supports revocation to be used for vesting schedules.\\n *\\n * The contract supports receiving extra funds than the managed tokens ones that can be\\n * withdrawn by the beneficiary at any time.\\n *\\n * A releaseStartTime parameter is included to override the default release schedule and\\n * perform the first release on the configured time. After that it will continue with the\\n * default schedule.\\n */\\nabstract contract GraphTokenLock is Ownable, IGraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n uint256 private constant MIN_PERIOD = 1;\\n\\n // -- State --\\n\\n IERC20 public token;\\n address public beneficiary;\\n\\n // Configuration\\n\\n // Amount of tokens managed by the contract schedule\\n uint256 public managedAmount;\\n\\n uint256 public startTime; // Start datetime (in unixtimestamp)\\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\\n uint256 public periods; // Number of vesting/release periods\\n\\n // First release date for tokens (in unixtimestamp)\\n // If set, no tokens will be released before releaseStartTime ignoring\\n // the amount to release each period\\n uint256 public releaseStartTime;\\n // A cliff set a date to which a beneficiary needs to get to vest\\n // all preceding periods\\n uint256 public vestingCliffTime;\\n Revocability public revocable; // Whether to use vesting for locked funds\\n\\n // State\\n\\n bool public isRevoked;\\n bool public isInitialized;\\n bool public isAccepted;\\n uint256 public releasedAmount;\\n uint256 public revokedAmount;\\n\\n // -- Events --\\n\\n event TokensReleased(address indexed beneficiary, uint256 amount);\\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\\n event TokensRevoked(address indexed beneficiary, uint256 amount);\\n event BeneficiaryChanged(address newBeneficiary);\\n event LockAccepted();\\n event LockCanceled();\\n\\n /**\\n * @dev Only allow calls from the beneficiary of the contract\\n */\\n modifier onlyBeneficiary() {\\n require(msg.sender == beneficiary, \\\"!auth\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the contract\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _vestingCliffTime Override time for when the vesting start\\n * @param _revocable Whether the contract is revocable\\n */\\n function _initialize(\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) internal {\\n require(!isInitialized, \\\"Already initialized\\\");\\n require(_owner != address(0), \\\"Owner cannot be zero\\\");\\n require(_beneficiary != address(0), \\\"Beneficiary cannot be zero\\\");\\n require(_token != address(0), \\\"Token cannot be zero\\\");\\n require(_managedAmount > 0, \\\"Managed tokens cannot be zero\\\");\\n require(_startTime != 0, \\\"Start time must be set\\\");\\n require(_startTime < _endTime, \\\"Start time > end time\\\");\\n require(_periods >= MIN_PERIOD, \\\"Periods cannot be below minimum\\\");\\n require(_revocable != Revocability.NotSet, \\\"Must set a revocability option\\\");\\n require(_releaseStartTime < _endTime, \\\"Release start time must be before end time\\\");\\n require(_vestingCliffTime < _endTime, \\\"Cliff time must be before end time\\\");\\n\\n isInitialized = true;\\n\\n Ownable.initialize(_owner);\\n beneficiary = _beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _managedAmount;\\n\\n startTime = _startTime;\\n endTime = _endTime;\\n periods = _periods;\\n\\n // Optionals\\n releaseStartTime = _releaseStartTime;\\n vestingCliffTime = _vestingCliffTime;\\n revocable = _revocable;\\n }\\n\\n /**\\n * @notice Change the beneficiary of funds managed by the contract\\n * @dev Can only be called by the beneficiary\\n * @param _newBeneficiary Address of the new beneficiary address\\n */\\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\\n require(_newBeneficiary != address(0), \\\"Empty beneficiary\\\");\\n beneficiary = _newBeneficiary;\\n emit BeneficiaryChanged(_newBeneficiary);\\n }\\n\\n /**\\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\\n * @dev Can only be called by the beneficiary\\n */\\n function acceptLock() external onlyBeneficiary {\\n isAccepted = true;\\n emit LockAccepted();\\n }\\n\\n /**\\n * @notice Owner cancel the lock and return the balance in the contract\\n * @dev Can only be called by the owner\\n */\\n function cancelLock() external onlyOwner {\\n require(isAccepted == false, \\\"Cannot cancel accepted contract\\\");\\n\\n token.safeTransfer(owner(), currentBalance());\\n\\n emit LockCanceled();\\n }\\n\\n // -- Balances --\\n\\n /**\\n * @notice Returns the amount of tokens currently held by the contract\\n * @return Tokens held in the contract\\n */\\n function currentBalance() public view override returns (uint256) {\\n return token.balanceOf(address(this));\\n }\\n\\n // -- Time & Periods --\\n\\n /**\\n * @notice Returns the current block timestamp\\n * @return Current block timestamp\\n */\\n function currentTime() public view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @notice Gets duration of contract from start to end in seconds\\n * @return Amount of seconds from contract startTime to endTime\\n */\\n function duration() public view override returns (uint256) {\\n return endTime.sub(startTime);\\n }\\n\\n /**\\n * @notice Gets time elapsed since the start of the contract\\n * @dev Returns zero if called before conctract starTime\\n * @return Seconds elapsed from contract startTime\\n */\\n function sinceStartTime() public view override returns (uint256) {\\n uint256 current = currentTime();\\n if (current <= startTime) {\\n return 0;\\n }\\n return current.sub(startTime);\\n }\\n\\n /**\\n * @notice Returns amount available to be released after each period according to schedule\\n * @return Amount of tokens available after each period\\n */\\n function amountPerPeriod() public view override returns (uint256) {\\n return managedAmount.div(periods);\\n }\\n\\n /**\\n * @notice Returns the duration of each period in seconds\\n * @return Duration of each period in seconds\\n */\\n function periodDuration() public view override returns (uint256) {\\n return duration().div(periods);\\n }\\n\\n /**\\n * @notice Gets the current period based on the schedule\\n * @return A number that represents the current period\\n */\\n function currentPeriod() public view override returns (uint256) {\\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\\n }\\n\\n /**\\n * @notice Gets the number of periods that passed since the first period\\n * @return A number of periods that passed since the schedule started\\n */\\n function passedPeriods() public view override returns (uint256) {\\n return currentPeriod().sub(MIN_PERIOD);\\n }\\n\\n // -- Locking & Release Schedule --\\n\\n /**\\n * @notice Gets the currently available token according to the schedule\\n * @dev Implements the step-by-step schedule based on periods for available tokens\\n * @return Amount of tokens available according to the schedule\\n */\\n function availableAmount() public view override returns (uint256) {\\n uint256 current = currentTime();\\n\\n // Before contract start no funds are available\\n if (current < startTime) {\\n return 0;\\n }\\n\\n // After contract ended all funds are available\\n if (current > endTime) {\\n return managedAmount;\\n }\\n\\n // Get available amount based on period\\n return passedPeriods().mul(amountPerPeriod());\\n }\\n\\n /**\\n * @notice Gets the amount of currently vested tokens\\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\\n * @return Amount of tokens already vested\\n */\\n function vestedAmount() public view override returns (uint256) {\\n // If non-revocable it is fully vested\\n if (revocable == Revocability.Disabled) {\\n return managedAmount;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n return availableAmount();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule and takes into account already released tokens\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view virtual override returns (uint256) {\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n uint256 releasable = availableAmount().sub(releasedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\\n * @dev Does not consider schedule but just global amounts tracked\\n * @return Amount of outstanding tokens for the lifetime of the contract\\n */\\n function totalOutstandingAmount() public view override returns (uint256) {\\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\\n }\\n\\n /**\\n * @notice Gets surplus amount in the contract based on outstanding amount to release\\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary\\n * @return Amount of tokens considered as surplus\\n */\\n function surplusAmount() public view override returns (uint256) {\\n uint256 balance = currentBalance();\\n uint256 outstandingAmount = totalOutstandingAmount();\\n if (balance > outstandingAmount) {\\n return balance.sub(outstandingAmount);\\n }\\n return 0;\\n }\\n\\n // -- Value Transfer --\\n\\n /**\\n * @notice Releases tokens based on the configured schedule\\n * @dev All available releasable tokens are transferred to beneficiary\\n */\\n function release() external override onlyBeneficiary {\\n uint256 amountToRelease = releasableAmount();\\n require(amountToRelease > 0, \\\"No available releasable amount\\\");\\n\\n releasedAmount = releasedAmount.add(amountToRelease);\\n\\n token.safeTransfer(beneficiary, amountToRelease);\\n\\n emit TokensReleased(beneficiary, amountToRelease);\\n }\\n\\n /**\\n * @notice Withdraws surplus, unmanaged tokens from the contract\\n * @dev Tokens in the contract over outstanding amount are considered as surplus\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n require(surplusAmount() >= _amount, \\\"Amount requested > surplus available\\\");\\n\\n token.safeTransfer(beneficiary, _amount);\\n\\n emit TokensWithdrawn(beneficiary, _amount);\\n }\\n\\n /**\\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\\n * @dev Vesting schedule is always calculated based on managed tokens\\n */\\n function revoke() external override onlyOwner {\\n require(revocable == Revocability.Enabled, \\\"Contract is non-revocable\\\");\\n require(isRevoked == false, \\\"Already revoked\\\");\\n\\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\\n require(unvestedAmount > 0, \\\"No available unvested amount\\\");\\n\\n revokedAmount = unvestedAmount;\\n isRevoked = true;\\n\\n token.safeTransfer(owner(), unvestedAmount);\\n\\n emit TokensRevoked(beneficiary, unvestedAmount);\\n }\\n}\\n\",\"keccak256\":\"0x21a1dae4105ba9ff6d9bc38bf983ee853976346562fa284f4b67a3c7ca91a2bf\",\"license\":\"MIT\"},\"contracts/GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport \\\"./GraphTokenLock.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n */\\ncontract GraphTokenLockWallet is GraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n // -- State --\\n\\n IGraphTokenLockManager public manager;\\n uint256 public usedAmount;\\n\\n uint256 private constant MAX_UINT256 = 2**256 - 1;\\n\\n // -- Events --\\n\\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\\n event TokenDestinationsApproved();\\n event TokenDestinationsRevoked();\\n\\n // Initializer\\n function initialize(\\n address _manager,\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) external {\\n _initialize(\\n _owner,\\n _beneficiary,\\n _token,\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n _setManager(_manager);\\n }\\n\\n // -- Admin --\\n\\n /**\\n * @notice Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function setManager(address _newManager) external onlyOwner {\\n _setManager(_newManager);\\n }\\n\\n /**\\n * @dev Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function _setManager(address _newManager) private {\\n require(_newManager != address(0), \\\"Manager cannot be empty\\\");\\n require(Address.isContract(_newManager), \\\"Manager must be a contract\\\");\\n\\n address oldManager = address(manager);\\n manager = IGraphTokenLockManager(_newManager);\\n\\n emit ManagerUpdated(oldManager, _newManager);\\n }\\n\\n // -- Beneficiary --\\n\\n /**\\n * @notice Approves protocol access of the tokens managed by this contract\\n * @dev Approves all token destinations registered in the manager to pull tokens\\n */\\n function approveProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n token.safeApprove(dstList[i], MAX_UINT256);\\n }\\n emit TokenDestinationsApproved();\\n }\\n\\n /**\\n * @notice Revokes protocol access of the tokens managed by this contract\\n * @dev Revokes approval to all token destinations in the manager to pull tokens\\n */\\n function revokeProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n token.safeApprove(dstList[i], 0);\\n }\\n emit TokenDestinationsRevoked();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule, takes into account already released tokens and used amount\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view override returns (uint256) {\\n if (revocable == Revocability.Disabled) {\\n return super.releasableAmount();\\n }\\n\\n // -- Revocability enabled logic\\n // This needs to deal with additional considerations for when tokens are used in the protocol\\n\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n // We consider the `usedAmount` in the protocol as part of the calculations\\n // the beneficiary should not release funds that are used.\\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Forward authorized contract calls to protocol contracts\\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\\n */\\n fallback() external payable {\\n // Only beneficiary can forward calls\\n require(msg.sender == beneficiary, \\\"Unauthorized caller\\\");\\n\\n // Function call validation\\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\\n require(_target != address(0), \\\"Unauthorized function\\\");\\n\\n uint256 oldBalance = currentBalance();\\n\\n // Call function with data\\n Address.functionCall(_target, msg.data);\\n\\n // Tracked used tokens in the protocol\\n // We do this check after balances were updated by the forwarded call\\n // Check is only enforced for revocable contracts to save some gas\\n if (revocable == Revocability.Enabled) {\\n // Track contract balance change\\n uint256 newBalance = currentBalance();\\n if (newBalance < oldBalance) {\\n // Outflow\\n uint256 diff = oldBalance.sub(newBalance);\\n usedAmount = usedAmount.add(diff);\\n } else {\\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\\n // underflow. We set it to zero in that case.\\n uint256 diff = newBalance.sub(oldBalance);\\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\\n }\\n require(usedAmount <= vestedAmount(), \\\"Cannot use more tokens than vested amount\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5efc82d408fe81193664e67d614ca6299eafb00163ecc7819fad77cf0d35a2eb\",\"license\":\"MIT\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nlibrary MathUtils {\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0xe2512e1da48bc8363acd15f66229564b02d66706665d7da740604566913c1400\",\"license\":\"MIT\"},\"contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\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 * The owner account will be passed on initialization of the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\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 owner) internal {\\n _owner = owner;\\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(_owner == msg.sender, \\\"Ownable: caller is not the owner\\\");\\n _;\\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() external virtual 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) external virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xc93c7362ac4d74b624b48517985f92c277ce90ae6e5ccb706e70a61af5752077\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50613e61806100206000396000f3fe6080604052600436106102555760003560e01c806386d00e0211610139578063bc0163c1116100b6578063dc0706571161007a578063dc07065714610d0e578063e8dda6f514610d5f578063e97d87d514610d8a578063ebbab99214610db5578063f2fde38b14610de0578063fc0c546a14610e3157610256565b8063bc0163c114610b41578063bd896dcb14610b6c578063ce845d1d14610c67578063d0ebdbe714610c92578063d18e81b314610ce357610256565b806391f7cfb9116100fd57806391f7cfb914610a6e578063a4caeb4214610a99578063b0d1818c14610ac4578063b470aade14610aff578063b6549f7514610b2a57610256565b806386d00e021461099e57806386d1a69f146109c9578063872a7810146109e05780638a5bdf5c14610a165780638da5cb5b14610a2d57610256565b8063392e53cd116101d25780635051a5ec116101965780635051a5ec146108c25780635b940081146108ef57806360e799441461091a578063715018a61461093157806378e97925146109485780637bdf05af1461097357610256565b8063392e53cd146107d3578063398057a31461080057806344b1231f1461082b57806345d30a1714610856578063481c6a751461088157610256565b80632a627814116102195780632a627814146106f85780632bc9ed021461070f5780633197cbb61461073c57806337aeb0861461076757806338af3eed1461079257610256565b8063029c6c9f1461063557806306040618146106605780630b80f7771461068b5780630dff24d5146106a25780630fb5a6b4146106cd57610256565b5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610319576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f556e617574686f72697a65642063616c6c65720000000000000000000000000081525060200191505060405180910390fd5b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b1580156103d157600080fd5b505afa1580156103e5573d6000803e3d6000fd5b505050506040513d60208110156103fb57600080fd5b81019080805190602001909291905050509050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f556e617574686f72697a65642066756e6374696f6e000000000000000000000081525060200191505060405180910390fd5b60006104bb610e72565b905061050c826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610f3d565b506001600281111561051a57fe5b600960009054906101000a900460ff16600281111561053557fe5b1415610631576000610545610e72565b9050818110156105875760006105648284610f8790919063ffffffff16565b905061057b81600d5461100a90919063ffffffff16565b600d81905550506105cd565b600061059c8383610f8790919063ffffffff16565b9050600d548110156105c2576105bd81600d54610f8790919063ffffffff16565b6105c5565b60005b600d81905550505b6105d5611092565b600d54111561062f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d346029913960400191505060405180910390fd5b505b5050005b34801561064157600080fd5b5061064a611101565b6040518082815260200191505060405180910390f35b34801561066c57600080fd5b5061067561111f565b6040518082815260200191505060405180910390f35b34801561069757600080fd5b506106a061115a565b005b3480156106ae57600080fd5b506106b761132d565b6040518082815260200191505060405180910390f35b3480156106d957600080fd5b506106e2611374565b6040518082815260200191505060405180910390f35b34801561070457600080fd5b5061070d611392565b005b34801561071b57600080fd5b5061072461165f565b60405180821515815260200191505060405180910390f35b34801561074857600080fd5b50610751611672565b6040518082815260200191505060405180910390f35b34801561077357600080fd5b5061077c611678565b6040518082815260200191505060405180910390f35b34801561079e57600080fd5b506107a761167e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107df57600080fd5b506107e86116a4565b60405180821515815260200191505060405180910390f35b34801561080c57600080fd5b506108156116b7565b6040518082815260200191505060405180910390f35b34801561083757600080fd5b50610840611092565b6040518082815260200191505060405180910390f35b34801561086257600080fd5b5061086b6116bd565b6040518082815260200191505060405180910390f35b34801561088d57600080fd5b506108966116c3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108ce57600080fd5b506108d76116e9565b60405180821515815260200191505060405180910390f35b3480156108fb57600080fd5b506109046116fc565b6040518082815260200191505060405180910390f35b34801561092657600080fd5b5061092f611807565b005b34801561093d57600080fd5b50610946611ab5565b005b34801561095457600080fd5b5061095d611c34565b6040518082815260200191505060405180910390f35b34801561097f57600080fd5b50610988611c3a565b6040518082815260200191505060405180910390f35b3480156109aa57600080fd5b506109b3611c76565b6040518082815260200191505060405180910390f35b3480156109d557600080fd5b506109de611c7c565b005b3480156109ec57600080fd5b506109f5611ebe565b60405180826002811115610a0557fe5b815260200191505060405180910390f35b348015610a2257600080fd5b50610a2b611ed1565b005b348015610a3957600080fd5b50610a42611fdd565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a7a57600080fd5b50610a83612006565b6040518082815260200191505060405180910390f35b348015610aa557600080fd5b50610aae612064565b6040518082815260200191505060405180910390f35b348015610ad057600080fd5b50610afd60048036036020811015610ae757600080fd5b810190808035906020019092919050505061206a565b005b348015610b0b57600080fd5b50610b146122e5565b6040518082815260200191505060405180910390f35b348015610b3657600080fd5b50610b3f612308565b005b348015610b4d57600080fd5b50610b5661266c565b6040518082815260200191505060405180910390f35b348015610b7857600080fd5b50610c656004803603610160811015610b9057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803560ff16906020019092919050505061269e565b005b348015610c7357600080fd5b50610c7c610e72565b6040518082815260200191505060405180910390f35b348015610c9e57600080fd5b50610ce160048036036020811015610cb557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506126c6565b005b348015610cef57600080fd5b50610cf8612793565b6040518082815260200191505060405180910390f35b348015610d1a57600080fd5b50610d5d60048036036020811015610d3157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061279b565b005b348015610d6b57600080fd5b50610d74612992565b6040518082815260200191505060405180910390f35b348015610d9657600080fd5b50610d9f612998565b6040518082815260200191505060405180910390f35b348015610dc157600080fd5b50610dca61299e565b6040518082815260200191505060405180910390f35b348015610dec57600080fd5b50610e2f60048036036020811015610e0357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506129c0565b005b348015610e3d57600080fd5b50610e46612bc4565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610efd57600080fd5b505afa158015610f11573d6000803e3d6000fd5b505050506040513d6020811015610f2757600080fd5b8101908080519060200190929190505050905090565b6060610f7f83836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612bea565b905092915050565b600082821115610fff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b818303905092915050565b600080828401905083811015611088576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006002808111156110a057fe5b600960009054906101000a900460ff1660028111156110bb57fe5b14156110cb5760035490506110fe565b60006008541180156110e557506008546110e3612793565b105b156110f357600090506110fe565b6110fb612006565b90505b90565b600061111a600654600354612c0290919063ffffffff16565b905090565b600061115560016111476111316122e5565b611139611c3a565b612c0290919063ffffffff16565b61100a90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461121b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60001515600960039054906101000a900460ff161515146112a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f43616e6e6f742063616e63656c20616363657074656420636f6e74726163740081525060200191505060405180910390fd5b6112ff6112af611fdd565b6112b7610e72565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b7f171f0bcbda3370351cea17f3b164bee87d77c2503b94abdf2720a814ebe7e9df60405160405180910390a1565b600080611338610e72565b9050600061134461266c565b90508082111561136a576113618183610f8790919063ffffffff16565b92505050611371565b6000925050505b90565b600061138d600454600554610f8790919063ffffffff16565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611455576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156114bf57600080fd5b505afa1580156114d3573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156114fd57600080fd5b810190808051604051939291908464010000000082111561151d57600080fd5b8382019150602082018581111561153357600080fd5b825186602082028301116401000000008211171561155057600080fd5b8083526020830192505050908051906020019060200280838360005b8381101561158757808201518184015260208101905061156c565b50505050905001604052505050905060005b815181101561162f576116228282815181106115b157fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612d2d9092919063ffffffff16565b8080600101915050611599565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b600960019054906101000a900460ff1681565b60055481565b600b5481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960029054906101000a900460ff1681565b60035481565b600a5481565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960039054906101000a900460ff1681565b600060028081111561170a57fe5b600960009054906101000a900460ff16600281111561172557fe5b141561173a57611733612ef2565b9050611804565b60006007541180156117545750600754611752612793565b105b156117625760009050611804565b6001600281111561176f57fe5b600960009054906101000a900460ff16600281111561178a57fe5b14801561179957506000600854115b80156117ad57506008546117ab612793565b105b156117bb5760009050611804565b60006117ed600d546117df600a546117d1612006565b610f8790919063ffffffff16565b610f8790919063ffffffff16565b90506118006117fa610e72565b82612fac565b9150505b90565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b15801561193457600080fd5b505afa158015611948573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561197257600080fd5b810190808051604051939291908464010000000082111561199257600080fd5b838201915060208201858111156119a857600080fd5b82518660208202830111640100000000821117156119c557600080fd5b8083526020830192505050908051906020019060200280838360005b838110156119fc5780820151818401526020810190506119e1565b50505050905001604052505050905060005b8151811015611a8557611a78828281518110611a2657fe5b60200260200101516000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612d2d9092919063ffffffff16565b8080600101915050611a0e565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611b76576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60045481565b600080611c45612793565b90506004548111611c5a576000915050611c73565b611c6f60045482610f8790919063ffffffff16565b9150505b90565b60085481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000611d496116fc565b905060008111611dc1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e74000081525060200191505060405180910390fd5b611dd681600a5461100a90919063ffffffff16565b600a81905550611e4b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df93179826040518082815260200191505060405180910390a250565b600960009054906101000a900460ff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f94576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600960036101000a81548160ff0219169083151502179055507fbeb3313724453131feb0a765a03e6715bb720e0f973a31fcbafa2d2f048c188b60405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080612011612793565b9050600454811015612027576000915050612061565b60055481111561203c57600354915050612061565b61205d612047611101565b61204f61299e565b612fc590919063ffffffff16565b9150505b90565b60065481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461212d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600081116121a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f416d6f756e742063616e6e6f74206265207a65726f000000000000000000000081525060200191505060405180910390fd5b806121ac61132d565b1015612203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613d7e6024913960400191505060405180910390fd5b612272600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040518082815260200191505060405180910390a250565b60006123036006546122f5611374565b612c0290919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146123c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600160028111156123d657fe5b600960009054906101000a900460ff1660028111156123f157fe5b14612464576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f436f6e7472616374206973206e6f6e2d7265766f6361626c650000000000000081525060200191505060405180910390fd5b60001515600960019054906101000a900460ff161515146124ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f416c7265616479207265766f6b6564000000000000000000000000000000000081525060200191505060405180910390fd5b600061250b6124fa611092565b600354610f8790919063ffffffff16565b905060008111612583576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4e6f20617661696c61626c6520756e76657374656420616d6f756e740000000081525060200191505060405180910390fd5b80600b819055506001600960016101000a81548160ff0219169083151502179055506125f96125b0611fdd565b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040518082815260200191505060405180910390a250565b6000612699600b5461268b600a54600354610f8790919063ffffffff16565b610f8790919063ffffffff16565b905090565b6126b08a8a8a8a8a8a8a8a8a8a61304b565b6126b98b6136cc565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612787576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b612790816136cc565b50565b600042905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461285e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612901576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f456d7074792062656e656669636961727900000000000000000000000000000081525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d81604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600d5481565b60075481565b60006129bb60016129ad61111f565b610f8790919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612a81576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612b07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180613ce86026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060612bf984846000856138b0565b90509392505050565b6000808211612c79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b818381612c8257fe5b04905092915050565b612d288363a9059cbb60e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613a59565b505050565b6000811480612dfb575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015612dbe57600080fd5b505afa158015612dd2573d6000803e3d6000fd5b505050506040513d6020811015612de857600080fd5b8101908080519060200190929190505050145b612e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180613df66036913960400191505060405180910390fd5b612eed8363095ea7b360e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613a59565b505050565b600080600754118015612f0d5750600754612f0b612793565b105b15612f1b5760009050612fa9565b60016002811115612f2857fe5b600960009054906101000a900460ff166002811115612f4357fe5b148015612f5257506000600854115b8015612f665750600854612f64612793565b105b15612f745760009050612fa9565b6000612f92600a54612f84612006565b610f8790919063ffffffff16565b9050612fa5612f9f610e72565b82612fac565b9150505b90565b6000818310612fbb5781612fbd565b825b905092915050565b600080831415612fd85760009050613045565b6000828402905082848281612fe957fe5b0414613040576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d5d6021913960400191505060405180910390fd5b809150505b92915050565b600960029054906101000a900460ff16156130ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e697469616c697a65640000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415613171576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4f776e65722063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff161415613214576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f42656e65666963696172792063616e6e6f74206265207a65726f00000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614156132b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f546f6b656e2063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b6000871161332d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f00000081525060200191505060405180910390fd5b60008614156133a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53746172742074696d65206d757374206265207365740000000000000000000081525060200191505060405180910390fd5b848610613419576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f53746172742074696d65203e20656e642074696d65000000000000000000000081525060200191505060405180910390fd5b6001841015613490576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d0081525060200191505060405180910390fd5b6000600281111561349d57fe5b8160028111156134a957fe5b141561351d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4d757374207365742061207265766f636162696c697479206f7074696f6e000081525060200191505060405180910390fd5b848310613575576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613da2602a913960400191505060405180910390fd5b8482106135cd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cc66022913960400191505060405180910390fd5b6001600960026101000a81548160ff0219169083151502179055506135f18a613b48565b88600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555086600381905550856004819055508460058190555083600681905550826007819055508160088190555080600960006101000a81548160ff021916908360028111156136bb57fe5b021790555050505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561376f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4d616e616765722063616e6e6f7420626520656d70747900000000000000000081525060200191505060405180910390fd5b61377881613be6565b6137ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4d616e61676572206d757374206265206120636f6e747261637400000000000081525060200191505060405180910390fd5b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b60608247101561390b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180613d0e6026913960400191505060405180910390fd5b61391485613be6565b613986576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081525060200191505060405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b602083106139d657805182526020820191506020810190506020830392506139b3565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613a38576040519150601f19603f3d011682016040523d82523d6000602084013e613a3d565b606091505b5091509150613a4d828286613bf9565b92505050949350505050565b6060613abb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612bea9092919063ffffffff16565b9050600081511115613b4357808060200190516020811015613adc57600080fd5b8101908080519060200190929190505050613b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613dcc602a913960400191505060405180910390fd5b5b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080823b905060008111915050919050565b60608315613c0957829050613cbe565b600083511115613c1c5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613c83578082015181840152602081019050613c68565b50505050905090810190601f168015613cb05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b939250505056fe436c6966662074696d65206d757374206265206265666f726520656e642074696d654f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c43616e6e6f7420757365206d6f726520746f6b656e73207468616e2076657374656420616d6f756e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77416d6f756e7420726571756573746564203e20737572706c757320617661696c61626c6552656c656173652073746172742074696d65206d757374206265206265666f726520656e642074696d655361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a26469706673582212203c6b20b5a223b9b9c9f0008dfba22c9fb703c6524c0f0a76a2b156733f6d573464736f6c63430007030033", + "deployedBytecode": "0x6080604052600436106102555760003560e01c806386d00e0211610139578063bc0163c1116100b6578063dc0706571161007a578063dc07065714610d0e578063e8dda6f514610d5f578063e97d87d514610d8a578063ebbab99214610db5578063f2fde38b14610de0578063fc0c546a14610e3157610256565b8063bc0163c114610b41578063bd896dcb14610b6c578063ce845d1d14610c67578063d0ebdbe714610c92578063d18e81b314610ce357610256565b806391f7cfb9116100fd57806391f7cfb914610a6e578063a4caeb4214610a99578063b0d1818c14610ac4578063b470aade14610aff578063b6549f7514610b2a57610256565b806386d00e021461099e57806386d1a69f146109c9578063872a7810146109e05780638a5bdf5c14610a165780638da5cb5b14610a2d57610256565b8063392e53cd116101d25780635051a5ec116101965780635051a5ec146108c25780635b940081146108ef57806360e799441461091a578063715018a61461093157806378e97925146109485780637bdf05af1461097357610256565b8063392e53cd146107d3578063398057a31461080057806344b1231f1461082b57806345d30a1714610856578063481c6a751461088157610256565b80632a627814116102195780632a627814146106f85780632bc9ed021461070f5780633197cbb61461073c57806337aeb0861461076757806338af3eed1461079257610256565b8063029c6c9f1461063557806306040618146106605780630b80f7771461068b5780630dff24d5146106a25780630fb5a6b4146106cd57610256565b5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610319576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f556e617574686f72697a65642063616c6c65720000000000000000000000000081525060200191505060405180910390fd5b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b815260040180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060206040518083038186803b1580156103d157600080fd5b505afa1580156103e5573d6000803e3d6000fd5b505050506040513d60208110156103fb57600080fd5b81019080805190602001909291905050509050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f556e617574686f72697a65642066756e6374696f6e000000000000000000000081525060200191505060405180910390fd5b60006104bb610e72565b905061050c826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610f3d565b506001600281111561051a57fe5b600960009054906101000a900460ff16600281111561053557fe5b1415610631576000610545610e72565b9050818110156105875760006105648284610f8790919063ffffffff16565b905061057b81600d5461100a90919063ffffffff16565b600d81905550506105cd565b600061059c8383610f8790919063ffffffff16565b9050600d548110156105c2576105bd81600d54610f8790919063ffffffff16565b6105c5565b60005b600d81905550505b6105d5611092565b600d54111561062f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d346029913960400191505060405180910390fd5b505b5050005b34801561064157600080fd5b5061064a611101565b6040518082815260200191505060405180910390f35b34801561066c57600080fd5b5061067561111f565b6040518082815260200191505060405180910390f35b34801561069757600080fd5b506106a061115a565b005b3480156106ae57600080fd5b506106b761132d565b6040518082815260200191505060405180910390f35b3480156106d957600080fd5b506106e2611374565b6040518082815260200191505060405180910390f35b34801561070457600080fd5b5061070d611392565b005b34801561071b57600080fd5b5061072461165f565b60405180821515815260200191505060405180910390f35b34801561074857600080fd5b50610751611672565b6040518082815260200191505060405180910390f35b34801561077357600080fd5b5061077c611678565b6040518082815260200191505060405180910390f35b34801561079e57600080fd5b506107a761167e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107df57600080fd5b506107e86116a4565b60405180821515815260200191505060405180910390f35b34801561080c57600080fd5b506108156116b7565b6040518082815260200191505060405180910390f35b34801561083757600080fd5b50610840611092565b6040518082815260200191505060405180910390f35b34801561086257600080fd5b5061086b6116bd565b6040518082815260200191505060405180910390f35b34801561088d57600080fd5b506108966116c3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108ce57600080fd5b506108d76116e9565b60405180821515815260200191505060405180910390f35b3480156108fb57600080fd5b506109046116fc565b6040518082815260200191505060405180910390f35b34801561092657600080fd5b5061092f611807565b005b34801561093d57600080fd5b50610946611ab5565b005b34801561095457600080fd5b5061095d611c34565b6040518082815260200191505060405180910390f35b34801561097f57600080fd5b50610988611c3a565b6040518082815260200191505060405180910390f35b3480156109aa57600080fd5b506109b3611c76565b6040518082815260200191505060405180910390f35b3480156109d557600080fd5b506109de611c7c565b005b3480156109ec57600080fd5b506109f5611ebe565b60405180826002811115610a0557fe5b815260200191505060405180910390f35b348015610a2257600080fd5b50610a2b611ed1565b005b348015610a3957600080fd5b50610a42611fdd565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a7a57600080fd5b50610a83612006565b6040518082815260200191505060405180910390f35b348015610aa557600080fd5b50610aae612064565b6040518082815260200191505060405180910390f35b348015610ad057600080fd5b50610afd60048036036020811015610ae757600080fd5b810190808035906020019092919050505061206a565b005b348015610b0b57600080fd5b50610b146122e5565b6040518082815260200191505060405180910390f35b348015610b3657600080fd5b50610b3f612308565b005b348015610b4d57600080fd5b50610b5661266c565b6040518082815260200191505060405180910390f35b348015610b7857600080fd5b50610c656004803603610160811015610b9057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803560ff16906020019092919050505061269e565b005b348015610c7357600080fd5b50610c7c610e72565b6040518082815260200191505060405180910390f35b348015610c9e57600080fd5b50610ce160048036036020811015610cb557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506126c6565b005b348015610cef57600080fd5b50610cf8612793565b6040518082815260200191505060405180910390f35b348015610d1a57600080fd5b50610d5d60048036036020811015610d3157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061279b565b005b348015610d6b57600080fd5b50610d74612992565b6040518082815260200191505060405180910390f35b348015610d9657600080fd5b50610d9f612998565b6040518082815260200191505060405180910390f35b348015610dc157600080fd5b50610dca61299e565b6040518082815260200191505060405180910390f35b348015610dec57600080fd5b50610e2f60048036036020811015610e0357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506129c0565b005b348015610e3d57600080fd5b50610e46612bc4565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610efd57600080fd5b505afa158015610f11573d6000803e3d6000fd5b505050506040513d6020811015610f2757600080fd5b8101908080519060200190929190505050905090565b6060610f7f83836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612bea565b905092915050565b600082821115610fff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b818303905092915050565b600080828401905083811015611088576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006002808111156110a057fe5b600960009054906101000a900460ff1660028111156110bb57fe5b14156110cb5760035490506110fe565b60006008541180156110e557506008546110e3612793565b105b156110f357600090506110fe565b6110fb612006565b90505b90565b600061111a600654600354612c0290919063ffffffff16565b905090565b600061115560016111476111316122e5565b611139611c3a565b612c0290919063ffffffff16565b61100a90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461121b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60001515600960039054906101000a900460ff161515146112a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f43616e6e6f742063616e63656c20616363657074656420636f6e74726163740081525060200191505060405180910390fd5b6112ff6112af611fdd565b6112b7610e72565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b7f171f0bcbda3370351cea17f3b164bee87d77c2503b94abdf2720a814ebe7e9df60405160405180910390a1565b600080611338610e72565b9050600061134461266c565b90508082111561136a576113618183610f8790919063ffffffff16565b92505050611371565b6000925050505b90565b600061138d600454600554610f8790919063ffffffff16565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611455576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156114bf57600080fd5b505afa1580156114d3573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156114fd57600080fd5b810190808051604051939291908464010000000082111561151d57600080fd5b8382019150602082018581111561153357600080fd5b825186602082028301116401000000008211171561155057600080fd5b8083526020830192505050908051906020019060200280838360005b8381101561158757808201518184015260208101905061156c565b50505050905001604052505050905060005b815181101561162f576116228282815181106115b157fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612d2d9092919063ffffffff16565b8080600101915050611599565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b600960019054906101000a900460ff1681565b60055481565b600b5481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960029054906101000a900460ff1681565b60035481565b600a5481565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960039054906101000a900460ff1681565b600060028081111561170a57fe5b600960009054906101000a900460ff16600281111561172557fe5b141561173a57611733612ef2565b9050611804565b60006007541180156117545750600754611752612793565b105b156117625760009050611804565b6001600281111561176f57fe5b600960009054906101000a900460ff16600281111561178a57fe5b14801561179957506000600854115b80156117ad57506008546117ab612793565b105b156117bb5760009050611804565b60006117ed600d546117df600a546117d1612006565b610f8790919063ffffffff16565b610f8790919063ffffffff16565b90506118006117fa610e72565b82612fac565b9150505b90565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6060600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b15801561193457600080fd5b505afa158015611948573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561197257600080fd5b810190808051604051939291908464010000000082111561199257600080fd5b838201915060208201858111156119a857600080fd5b82518660208202830111640100000000821117156119c557600080fd5b8083526020830192505050908051906020019060200280838360005b838110156119fc5780820151818401526020810190506119e1565b50505050905001604052505050905060005b8151811015611a8557611a78828281518110611a2657fe5b60200260200101516000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612d2d9092919063ffffffff16565b8080600101915050611a0e565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611b76576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60045481565b600080611c45612793565b90506004548111611c5a576000915050611c73565b611c6f60045482610f8790919063ffffffff16565b9150505b90565b60085481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000611d496116fc565b905060008111611dc1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e74000081525060200191505060405180910390fd5b611dd681600a5461100a90919063ffffffff16565b600a81905550611e4b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df93179826040518082815260200191505060405180910390a250565b600960009054906101000a900460ff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f94576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600960036101000a81548160ff0219169083151502179055507fbeb3313724453131feb0a765a03e6715bb720e0f973a31fcbafa2d2f048c188b60405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080612011612793565b9050600454811015612027576000915050612061565b60055481111561203c57600354915050612061565b61205d612047611101565b61204f61299e565b612fc590919063ffffffff16565b9150505b90565b60065481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461212d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600081116121a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f416d6f756e742063616e6e6f74206265207a65726f000000000000000000000081525060200191505060405180910390fd5b806121ac61132d565b1015612203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613d7e6024913960400191505060405180910390fd5b612272600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040518082815260200191505060405180910390a250565b60006123036006546122f5611374565b612c0290919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146123c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600160028111156123d657fe5b600960009054906101000a900460ff1660028111156123f157fe5b14612464576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f436f6e7472616374206973206e6f6e2d7265766f6361626c650000000000000081525060200191505060405180910390fd5b60001515600960019054906101000a900460ff161515146124ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f416c7265616479207265766f6b6564000000000000000000000000000000000081525060200191505060405180910390fd5b600061250b6124fa611092565b600354610f8790919063ffffffff16565b905060008111612583576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4e6f20617661696c61626c6520756e76657374656420616d6f756e740000000081525060200191505060405180910390fd5b80600b819055506001600960016101000a81548160ff0219169083151502179055506125f96125b0611fdd565b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c8b9092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040518082815260200191505060405180910390a250565b6000612699600b5461268b600a54600354610f8790919063ffffffff16565b610f8790919063ffffffff16565b905090565b6126b08a8a8a8a8a8a8a8a8a8a61304b565b6126b98b6136cc565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612787576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b612790816136cc565b50565b600042905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461285e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f216175746800000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612901576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f456d7074792062656e656669636961727900000000000000000000000000000081525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d81604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600d5481565b60075481565b60006129bb60016129ad61111f565b610f8790919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612a81576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612b07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180613ce86026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060612bf984846000856138b0565b90509392505050565b6000808211612c79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b818381612c8257fe5b04905092915050565b612d288363a9059cbb60e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613a59565b505050565b6000811480612dfb575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015612dbe57600080fd5b505afa158015612dd2573d6000803e3d6000fd5b505050506040513d6020811015612de857600080fd5b8101908080519060200190929190505050145b612e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180613df66036913960400191505060405180910390fd5b612eed8363095ea7b360e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613a59565b505050565b600080600754118015612f0d5750600754612f0b612793565b105b15612f1b5760009050612fa9565b60016002811115612f2857fe5b600960009054906101000a900460ff166002811115612f4357fe5b148015612f5257506000600854115b8015612f665750600854612f64612793565b105b15612f745760009050612fa9565b6000612f92600a54612f84612006565b610f8790919063ffffffff16565b9050612fa5612f9f610e72565b82612fac565b9150505b90565b6000818310612fbb5781612fbd565b825b905092915050565b600080831415612fd85760009050613045565b6000828402905082848281612fe957fe5b0414613040576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d5d6021913960400191505060405180910390fd5b809150505b92915050565b600960029054906101000a900460ff16156130ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e697469616c697a65640000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415613171576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4f776e65722063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff161415613214576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f42656e65666963696172792063616e6e6f74206265207a65726f00000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1614156132b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f546f6b656e2063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b6000871161332d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f00000081525060200191505060405180910390fd5b60008614156133a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f53746172742074696d65206d757374206265207365740000000000000000000081525060200191505060405180910390fd5b848610613419576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f53746172742074696d65203e20656e642074696d65000000000000000000000081525060200191505060405180910390fd5b6001841015613490576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d0081525060200191505060405180910390fd5b6000600281111561349d57fe5b8160028111156134a957fe5b141561351d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4d757374207365742061207265766f636162696c697479206f7074696f6e000081525060200191505060405180910390fd5b848310613575576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613da2602a913960400191505060405180910390fd5b8482106135cd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cc66022913960400191505060405180910390fd5b6001600960026101000a81548160ff0219169083151502179055506135f18a613b48565b88600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555086600381905550856004819055508460058190555083600681905550826007819055508160088190555080600960006101000a81548160ff021916908360028111156136bb57fe5b021790555050505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561376f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4d616e616765722063616e6e6f7420626520656d70747900000000000000000081525060200191505060405180910390fd5b61377881613be6565b6137ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4d616e61676572206d757374206265206120636f6e747261637400000000000081525060200191505060405180910390fd5b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b60608247101561390b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180613d0e6026913960400191505060405180910390fd5b61391485613be6565b613986576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081525060200191505060405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b602083106139d657805182526020820191506020810190506020830392506139b3565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613a38576040519150601f19603f3d011682016040523d82523d6000602084013e613a3d565b606091505b5091509150613a4d828286613bf9565b92505050949350505050565b6060613abb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612bea9092919063ffffffff16565b9050600081511115613b4357808060200190516020811015613adc57600080fd5b8101908080519060200190929190505050613b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613dcc602a913960400191505060405180910390fd5b5b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600080823b905060008111915050919050565b60608315613c0957829050613cbe565b600083511115613c1c5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613c83578082015181840152602081019050613c68565b50505050905090810190601f168015613cb05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b939250505056fe436c6966662074696d65206d757374206265206265666f726520656e642074696d654f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c43616e6e6f7420757365206d6f726520746f6b656e73207468616e2076657374656420616d6f756e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77416d6f756e7420726571756573746564203e20737572706c757320617661696c61626c6552656c656173652073746172742074696d65206d757374206265206265666f726520656e642074696d655361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a26469706673582212203c6b20b5a223b9b9c9f0008dfba22c9fb703c6524c0f0a76a2b156733f6d573464736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "acceptLock()": { + "details": "Can only be called by the beneficiary" + }, + "amountPerPeriod()": { + "returns": { + "_0": "Amount of tokens available after each period" + } + }, + "approveProtocol()": { + "details": "Approves all token destinations registered in the manager to pull tokens" + }, + "availableAmount()": { + "details": "Implements the step-by-step schedule based on periods for available tokens", + "returns": { + "_0": "Amount of tokens available according to the schedule" + } + }, + "cancelLock()": { + "details": "Can only be called by the owner" + }, + "changeBeneficiary(address)": { + "details": "Can only be called by the beneficiary", + "params": { + "_newBeneficiary": "Address of the new beneficiary address" + } + }, + "currentBalance()": { + "returns": { + "_0": "Tokens held in the contract" + } + }, + "currentPeriod()": { + "returns": { + "_0": "A number that represents the current period" + } + }, + "currentTime()": { + "returns": { + "_0": "Current block timestamp" + } + }, + "duration()": { + "returns": { + "_0": "Amount of seconds from contract startTime to endTime" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "passedPeriods()": { + "returns": { + "_0": "A number of periods that passed since the schedule started" + } + }, + "periodDuration()": { + "returns": { + "_0": "Duration of each period in seconds" + } + }, + "releasableAmount()": { + "details": "Considers the schedule, takes into account already released tokens and used amount", + "returns": { + "_0": "Amount of tokens ready to be released" + } + }, + "release()": { + "details": "All available releasable tokens are transferred to beneficiary" + }, + "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." + }, + "revoke()": { + "details": "Vesting schedule is always calculated based on managed tokens" + }, + "revokeProtocol()": { + "details": "Revokes approval to all token destinations in the manager to pull tokens" + }, + "setManager(address)": { + "params": { + "_newManager": "Address of the new manager" + } + }, + "sinceStartTime()": { + "details": "Returns zero if called before conctract starTime", + "returns": { + "_0": "Seconds elapsed from contract startTime" + } + }, + "surplusAmount()": { + "details": "All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary", + "returns": { + "_0": "Amount of tokens considered as surplus" + } + }, + "totalOutstandingAmount()": { + "details": "Does not consider schedule but just global amounts tracked", + "returns": { + "_0": "Amount of outstanding tokens for the lifetime of the contract" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "vestedAmount()": { + "details": "Similar to available amount, but is fully vested when contract is non-revocable", + "returns": { + "_0": "Amount of tokens already vested" + } + }, + "withdrawSurplus(uint256)": { + "details": "Tokens in the contract over outstanding amount are considered as surplus", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "GraphTokenLockWallet", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "acceptLock()": { + "notice": "Beneficiary accepts the lock, the owner cannot retrieve back the tokens" + }, + "amountPerPeriod()": { + "notice": "Returns amount available to be released after each period according to schedule" + }, + "approveProtocol()": { + "notice": "Approves protocol access of the tokens managed by this contract" + }, + "availableAmount()": { + "notice": "Gets the currently available token according to the schedule" + }, + "cancelLock()": { + "notice": "Owner cancel the lock and return the balance in the contract" + }, + "changeBeneficiary(address)": { + "notice": "Change the beneficiary of funds managed by the contract" + }, + "currentBalance()": { + "notice": "Returns the amount of tokens currently held by the contract" + }, + "currentPeriod()": { + "notice": "Gets the current period based on the schedule" + }, + "currentTime()": { + "notice": "Returns the current block timestamp" + }, + "duration()": { + "notice": "Gets duration of contract from start to end in seconds" + }, + "passedPeriods()": { + "notice": "Gets the number of periods that passed since the first period" + }, + "periodDuration()": { + "notice": "Returns the duration of each period in seconds" + }, + "releasableAmount()": { + "notice": "Gets tokens currently available for release" + }, + "release()": { + "notice": "Releases tokens based on the configured schedule" + }, + "revoke()": { + "notice": "Revokes a vesting schedule and return the unvested tokens to the owner" + }, + "revokeProtocol()": { + "notice": "Revokes protocol access of the tokens managed by this contract" + }, + "setManager(address)": { + "notice": "Sets a new manager for this contract" + }, + "sinceStartTime()": { + "notice": "Gets time elapsed since the start of the contract" + }, + "surplusAmount()": { + "notice": "Gets surplus amount in the contract based on outstanding amount to release" + }, + "totalOutstandingAmount()": { + "notice": "Gets the outstanding amount yet to be released based on the whole contract lifetime" + }, + "vestedAmount()": { + "notice": "Gets the amount of currently vested tokens" + }, + "withdrawSurplus(uint256)": { + "notice": "Withdraws surplus, unmanaged tokens from the contract" + } + }, + "notice": "This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 4375, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 2204, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "token", + "offset": 0, + "slot": "1", + "type": "t_contract(IERC20)1045" + }, + { + "astId": 2206, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "beneficiary", + "offset": 0, + "slot": "2", + "type": "t_address" + }, + { + "astId": 2208, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "managedAmount", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 2210, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "startTime", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 2212, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "endTime", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 2214, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "periods", + "offset": 0, + "slot": "6", + "type": "t_uint256" + }, + { + "astId": 2216, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "releaseStartTime", + "offset": 0, + "slot": "7", + "type": "t_uint256" + }, + { + "astId": 2218, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "vestingCliffTime", + "offset": 0, + "slot": "8", + "type": "t_uint256" + }, + { + "astId": 2220, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "revocable", + "offset": 0, + "slot": "9", + "type": "t_enum(Revocability)4052" + }, + { + "astId": 2222, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isRevoked", + "offset": 1, + "slot": "9", + "type": "t_bool" + }, + { + "astId": 2224, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isInitialized", + "offset": 2, + "slot": "9", + "type": "t_bool" + }, + { + "astId": 2226, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "isAccepted", + "offset": 3, + "slot": "9", + "type": "t_bool" + }, + { + "astId": 2228, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "releasedAmount", + "offset": 0, + "slot": "10", + "type": "t_uint256" + }, + { + "astId": 2230, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "revokedAmount", + "offset": 0, + "slot": "11", + "type": "t_uint256" + }, + { + "astId": 3647, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "manager", + "offset": 0, + "slot": "12", + "type": "t_contract(IGraphTokenLockManager)4234" + }, + { + "astId": 3649, + "contract": "contracts/GraphTokenLockWallet.sol:GraphTokenLockWallet", + "label": "usedAmount", + "offset": 0, + "slot": "13", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IERC20)1045": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(IGraphTokenLockManager)4234": { + "encoding": "inplace", + "label": "contract IGraphTokenLockManager", + "numberOfBytes": "20" + }, + "t_enum(Revocability)4052": { + "encoding": "inplace", + "label": "enum IGraphTokenLock.Revocability", + "numberOfBytes": "1" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/deployments/goerli/Scratch-6-Manager-Old.json b/deployments/goerli/Scratch-6-Manager-Old.json new file mode 100644 index 0000000..831c871 --- /dev/null +++ b/deployments/goerli/Scratch-6-Manager-Old.json @@ -0,0 +1,926 @@ +{ + "address": "0x17A2fAbF010c0fb096f21ea7fc846fe77D1e14b2", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes4", + "name": "sigHash", + "type": "bytes4" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "signature", + "type": "string" + } + ], + "name": "FunctionCallAuth", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "masterCopy", + "type": "address" + } + ], + "name": "MasterCopyUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "TokenDestinationAllowed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "initHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "periods", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseStartTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "vestingCliffTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IGraphTokenLock.Revocability", + "name": "revocable", + "type": "uint8" + } + ], + "name": "TokenLockCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "addTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "name": "authFnCalls", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "createTokenLockWallet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "getAuthFunctionCallTarget", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + } + ], + "name": "getDeploymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTokenDestinations", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "isAuthFunctionCall", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "isTokenDestination", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "masterCopy", + "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": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "removeTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "_signatures", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "_targets", + "type": "address[]" + } + ], + "name": "setAuthFunctionCallMany", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "name": "setMasterCopy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + } + ], + "name": "unsetAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x5a11f74a33525044aca9461a2d02702c8e0fd6226f83593b5d20f6d55aec0321", + "receipt": { + "to": null, + "from": "0xBc7f4d3a85B820fDB1058FD93073Eb6bc9AAF59b", + "contractAddress": "0x17A2fAbF010c0fb096f21ea7fc846fe77D1e14b2", + "transactionIndex": 24, + "gasUsed": "3167254", + "logsBloom": "0x00000000000000000000000000000000000004000000000140800000000000000000000000000000000000000000000000800000000000000000000000002000000000000000000000000000000000000001000000000000000000400000000000000000020000000000200000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000040040000000000000000000000000000000000000000000000000000000020008020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xe8b6e18e8129ac5261737bf62249b9f2b4cbad1bb95dcb596723dc240ea60457", + "transactionHash": "0x5a11f74a33525044aca9461a2d02702c8e0fd6226f83593b5d20f6d55aec0321", + "logs": [ + { + "transactionIndex": 24, + "blockNumber": 9092673, + "transactionHash": "0x5a11f74a33525044aca9461a2d02702c8e0fd6226f83593b5d20f6d55aec0321", + "address": "0x17A2fAbF010c0fb096f21ea7fc846fe77D1e14b2", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000bc7f4d3a85b820fdb1058fd93073eb6bc9aaf59b" + ], + "data": "0x", + "logIndex": 286, + "blockHash": "0xe8b6e18e8129ac5261737bf62249b9f2b4cbad1bb95dcb596723dc240ea60457" + }, + { + "transactionIndex": 24, + "blockNumber": 9092673, + "transactionHash": "0x5a11f74a33525044aca9461a2d02702c8e0fd6226f83593b5d20f6d55aec0321", + "address": "0x17A2fAbF010c0fb096f21ea7fc846fe77D1e14b2", + "topics": [ + "0x30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de", + "0x000000000000000000000000d3a52f21b4ea66eaf0270c58799d339884be7823" + ], + "data": "0x", + "logIndex": 287, + "blockHash": "0xe8b6e18e8129ac5261737bf62249b9f2b4cbad1bb95dcb596723dc240ea60457" + } + ], + "blockNumber": 9092673, + "cumulativeGasUsed": "13672903", + "status": 1, + "byzantium": true + }, + "args": [ + "0xC43fD0358A983C2E986a301462C60db717Cb88e1", + "0xd3A52F21b4EA66eAf0270C58799d339884be7823" + ], + "solcInputHash": "ccc82ccc102007017cf322f5b7601563", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_graphToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes4\",\"name\":\"sigHash\",\"type\":\"bytes4\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"signature\",\"type\":\"string\"}],\"name\":\"FunctionCallAuth\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"masterCopy\",\"type\":\"address\"}],\"name\":\"MasterCopyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"}],\"name\":\"ProxyCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"TokenDestinationAllowed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"initHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"periods\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releaseStartTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vestingCliffTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"revocable\",\"type\":\"uint8\"}],\"name\":\"TokenLockCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"addTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"name\":\"authFnCalls\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"createTokenLockWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"getAuthFunctionCallTarget\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_salt\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"}],\"name\":\"getDeploymentAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenDestinations\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"isAuthFunctionCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"isTokenDestination\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"masterCopy\",\"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\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"removeTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"setAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"_signatures\",\"type\":\"string[]\"},{\"internalType\":\"address[]\",\"name\":\"_targets\",\"type\":\"address[]\"}],\"name\":\"setAuthFunctionCallMany\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"name\":\"setMasterCopy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"}],\"name\":\"unsetAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"addTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"constructor\":{\"params\":{\"_graphToken\":\"Token to use for deposits and withdrawals\",\"_masterCopy\":\"Address of the master copy to use to clone proxies\"}},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"params\":{\"_beneficiary\":\"Address of the beneficiary of locked tokens\",\"_endTime\":\"End time of the release schedule\",\"_managedAmount\":\"Amount of tokens to be managed by the lock contract\",\"_owner\":\"Address of the contract owner\",\"_periods\":\"Number of periods between start time and end time\",\"_releaseStartTime\":\"Override time for when the releases start\",\"_revocable\":\"Whether the contract is revocable\",\"_startTime\":\"Start time of the release schedule\"}},\"deposit(uint256)\":{\"details\":\"Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes\",\"params\":{\"_amount\":\"Amount to deposit\"}},\"getAuthFunctionCallTarget(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"Address of the target contract where to send the call\"}},\"getDeploymentAddress(bytes32,address)\":{\"params\":{\"_implementation\":\"Address of the proxy target implementation\",\"_salt\":\"Bytes32 salt to use for CREATE2\"},\"returns\":{\"_0\":\"Address of the counterfactual MinimalProxy\"}},\"getTokenDestinations()\":{\"returns\":{\"_0\":\"Array of addresses authorized to pull funds from a token lock\"}},\"isAuthFunctionCall(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"True if authorized\"}},\"isTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"},\"returns\":{\"_0\":\"True if authorized\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"removeTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"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.\"},\"setAuthFunctionCall(string,address)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\",\"_target\":\"Address of the destination contract to call\"}},\"setAuthFunctionCallMany(string[],address[])\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signatures\":\"Function signatures\",\"_targets\":\"Address of the destination contract to call\"}},\"setMasterCopy(address)\":{\"params\":{\"_masterCopy\":\"Address of contract bytecode to factory clone\"}},\"token()\":{\"returns\":{\"_0\":\"Token used for transfers and approvals\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unsetAuthFunctionCall(string)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\"}},\"withdraw(uint256)\":{\"details\":\"Escape hatch in case of mistakes or to recover remaining funds\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"GraphTokenLockManager\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"addTokenDestination(address)\":{\"notice\":\"Adds an address that can be allowed by a token lock to pull funds\"},\"constructor\":{\"notice\":\"Constructor.\"},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"notice\":\"Creates and fund a new token lock wallet using a minimum proxy\"},\"deposit(uint256)\":{\"notice\":\"Deposits tokens into the contract\"},\"getAuthFunctionCallTarget(bytes4)\":{\"notice\":\"Gets the target contract to call for a particular function signature\"},\"getDeploymentAddress(bytes32,address)\":{\"notice\":\"Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\"},\"getTokenDestinations()\":{\"notice\":\"Returns an array of authorized destination addresses\"},\"isAuthFunctionCall(bytes4)\":{\"notice\":\"Returns true if the function call is authorized\"},\"isTokenDestination(address)\":{\"notice\":\"Returns True if the address is authorized to be a destination of tokens\"},\"removeTokenDestination(address)\":{\"notice\":\"Removes an address that can be allowed by a token lock to pull funds\"},\"setAuthFunctionCall(string,address)\":{\"notice\":\"Sets an authorized function call to target\"},\"setAuthFunctionCallMany(string[],address[])\":{\"notice\":\"Sets an authorized function call to target in bulk\"},\"setMasterCopy(address)\":{\"notice\":\"Sets the masterCopy bytecode to use to create clones of TokenLock contracts\"},\"token()\":{\"notice\":\"Gets the GRT token address\"},\"unsetAuthFunctionCall(string)\":{\"notice\":\"Unsets an authorized function call to target\"},\"withdraw(uint256)\":{\"notice\":\"Withdraws tokens from the contract\"}},\"notice\":\"This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GraphTokenLockManager.sol\":\"GraphTokenLockManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/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 * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\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 virtual 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 virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\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, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, 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) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\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 *\\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 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 *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\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 *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting 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 *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting 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 *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\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 * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\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 *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\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 *\\n * - The divisor cannot be zero.\\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\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\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\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\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 IERC20;` 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 /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\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 from 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. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\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\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\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\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with 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 function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual 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\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\\n address addr;\\n require(address(this).balance >= amount, \\\"Create2: insufficient balance\\\");\\n require(bytecode.length != 0, \\\"Create2: bytecode length is zero\\\");\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n }\\n require(addr != address(0), \\\"Create2: Failed on deploy\\\");\\n return addr;\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\\n bytes32 _data = keccak256(\\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\\n );\\n return address(uint160(uint256(_data)));\\n }\\n}\\n\",\"keccak256\":\"0x0a0b021149946014fe1cd04af11e7a937a29986c47e8b1b718c2d50d729472db\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <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\",\"keccak256\":\"0x1562cd9922fbf739edfb979f506809e2743789cbde3177515542161c3d04b164\",\"license\":\"MIT\"},\"contracts/GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/EnumerableSet.sol\\\";\\n\\nimport \\\"./MinimalProxyFactory.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract GraphTokenLockManager is MinimalProxyFactory, IGraphTokenLockManager {\\n using SafeERC20 for IERC20;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n // -- State --\\n\\n mapping(bytes4 => address) public authFnCalls;\\n EnumerableSet.AddressSet private _tokenDestinations;\\n\\n address public masterCopy;\\n IERC20 private _token;\\n\\n // -- Events --\\n\\n event MasterCopyUpdated(address indexed masterCopy);\\n event TokenLockCreated(\\n address indexed contractAddress,\\n bytes32 indexed initHash,\\n address indexed beneficiary,\\n address token,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n uint256 periods,\\n uint256 releaseStartTime,\\n uint256 vestingCliffTime,\\n IGraphTokenLock.Revocability revocable\\n );\\n\\n event TokensDeposited(address indexed sender, uint256 amount);\\n event TokensWithdrawn(address indexed sender, uint256 amount);\\n\\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\\n event TokenDestinationAllowed(address indexed dst, bool allowed);\\n\\n /**\\n * Constructor.\\n * @param _graphToken Token to use for deposits and withdrawals\\n * @param _masterCopy Address of the master copy to use to clone proxies\\n */\\n constructor(IERC20 _graphToken, address _masterCopy) {\\n require(address(_graphToken) != address(0), \\\"Token cannot be zero\\\");\\n _token = _graphToken;\\n setMasterCopy(_masterCopy);\\n }\\n\\n // -- Factory --\\n\\n /**\\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\\n * @param _masterCopy Address of contract bytecode to factory clone\\n */\\n function setMasterCopy(address _masterCopy) public override onlyOwner {\\n require(_masterCopy != address(0), \\\"MasterCopy cannot be zero\\\");\\n masterCopy = _masterCopy;\\n emit MasterCopyUpdated(_masterCopy);\\n }\\n\\n /**\\n * @notice Creates and fund a new token lock wallet using a minimum proxy\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _revocable Whether the contract is revocable\\n */\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external override onlyOwner {\\n require(_token.balanceOf(address(this)) >= _managedAmount, \\\"Not enough tokens to create lock\\\");\\n\\n // Create contract using a minimal proxy and call initializer\\n bytes memory initializer = abi.encodeWithSignature(\\n \\\"initialize(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\\\",\\n address(this),\\n _owner,\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _managedAmount);\\n\\n emit TokenLockCreated(\\n contractAddress,\\n keccak256(initializer),\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n }\\n\\n // -- Funds Management --\\n\\n /**\\n * @notice Gets the GRT token address\\n * @return Token used for transfers and approvals\\n */\\n function token() external view override returns (IERC20) {\\n return _token;\\n }\\n\\n /**\\n * @notice Deposits tokens into the contract\\n * @dev Even if the ERC20 token can be transferred directly to the contract\\n * this function provide a safe interface to do the transfer and avoid mistakes\\n * @param _amount Amount to deposit\\n */\\n function deposit(uint256 _amount) external override {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransferFrom(msg.sender, address(this), _amount);\\n emit TokensDeposited(msg.sender, _amount);\\n }\\n\\n /**\\n * @notice Withdraws tokens from the contract\\n * @dev Escape hatch in case of mistakes or to recover remaining funds\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdraw(uint256 _amount) external override onlyOwner {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransfer(msg.sender, _amount);\\n emit TokensWithdrawn(msg.sender, _amount);\\n }\\n\\n // -- Token Destinations --\\n\\n /**\\n * @notice Adds an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function addTokenDestination(address _dst) external override onlyOwner {\\n require(_dst != address(0), \\\"Destination cannot be zero\\\");\\n require(_tokenDestinations.add(_dst), \\\"Destination already added\\\");\\n emit TokenDestinationAllowed(_dst, true);\\n }\\n\\n /**\\n * @notice Removes an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function removeTokenDestination(address _dst) external override onlyOwner {\\n require(_tokenDestinations.remove(_dst), \\\"Destination already removed\\\");\\n emit TokenDestinationAllowed(_dst, false);\\n }\\n\\n /**\\n * @notice Returns True if the address is authorized to be a destination of tokens\\n * @param _dst Destination address\\n * @return True if authorized\\n */\\n function isTokenDestination(address _dst) external view override returns (bool) {\\n return _tokenDestinations.contains(_dst);\\n }\\n\\n /**\\n * @notice Returns an array of authorized destination addresses\\n * @return Array of addresses authorized to pull funds from a token lock\\n */\\n function getTokenDestinations() external view override returns (address[] memory) {\\n address[] memory dstList = new address[](_tokenDestinations.length());\\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\\n dstList[i] = _tokenDestinations.at(i);\\n }\\n return dstList;\\n }\\n\\n // -- Function Call Authorization --\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\\n _setAuthFunctionCall(_signature, _target);\\n }\\n\\n /**\\n * @notice Unsets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n */\\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = address(0);\\n\\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target in bulk\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signatures Function signatures\\n * @param _targets Address of the destination contract to call\\n */\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets)\\n external\\n override\\n onlyOwner\\n {\\n require(_signatures.length == _targets.length, \\\"Array length mismatch\\\");\\n\\n for (uint256 i = 0; i < _signatures.length; i++) {\\n _setAuthFunctionCall(_signatures[i], _targets[i]);\\n }\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\\n require(_target != address(this), \\\"Target must be other contract\\\");\\n require(Address.isContract(_target), \\\"Target must be a contract\\\");\\n\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = _target;\\n\\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\\n }\\n\\n /**\\n * @notice Gets the target contract to call for a particular function signature\\n * @param _sigHash Function signature hash\\n * @return Address of the target contract where to send the call\\n */\\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\\n return authFnCalls[_sigHash];\\n }\\n\\n /**\\n * @notice Returns true if the function call is authorized\\n * @param _sigHash Function signature hash\\n * @return True if authorized\\n */\\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\\n return getAuthFunctionCallTarget(_sigHash) != address(0);\\n }\\n\\n /**\\n * @dev Converts a function signature string to 4-bytes hash\\n * @param _signature Function signature string\\n * @return Function signature hash\\n */\\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\\n return _convertToBytes4(abi.encodeWithSignature(_signature));\\n }\\n\\n /**\\n * @dev Converts function signature bytes to function signature hash (bytes4)\\n * @param _signature Function signature\\n * @return Function signature in bytes4\\n */\\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\\n require(_signature.length == 4, \\\"Invalid method signature\\\");\\n bytes4 sigHash;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n sigHash := mload(add(_signature, 32))\\n }\\n return sigHash;\\n }\\n}\\n\",\"keccak256\":\"0x0384d62cb600eb4128baacf5bca60ea2cb0b68d2d013479daef65ed5f15446ef\",\"license\":\"MIT\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability { NotSet, Enabled, Disabled }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0x396f8102fb03d884d599831989d9753a69f0d9b65538c8206c81e0067827c5a2\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/MinimalProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Create2.sol\\\";\\n\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\\n// Based on https://eips.ethereum.org/EIPS/eip-1167\\ncontract MinimalProxyFactory is Ownable {\\n // -- Events --\\n\\n event ProxyCreated(address indexed proxy);\\n\\n /**\\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @return Address of the counterfactual MinimalProxy\\n */\\n function getDeploymentAddress(bytes32 _salt, address _implementation) external view returns (address) {\\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), address(this));\\n }\\n\\n /**\\n * @notice Deploys a MinimalProxy with CREATE2\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _data Bytes with the initializer call\\n * @return Address of the deployed MinimalProxy\\n */\\n function _deployProxy2(\\n bytes32 _salt,\\n address _implementation,\\n bytes memory _data\\n ) internal returns (address) {\\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\\n\\n emit ProxyCreated(proxyAddress);\\n\\n // Call function with data\\n if (_data.length > 0) {\\n Address.functionCall(proxyAddress, _data);\\n }\\n\\n return proxyAddress;\\n }\\n\\n /**\\n * @notice Gets the MinimalProxy bytecode\\n * @param _implementation Address of the proxy target implementation\\n * @return MinimalProxy bytecode\\n */\\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\\n bytes10 creation = 0x3d602d80600a3d3981f3;\\n bytes10 prefix = 0x363d3d373d3d3d363d73;\\n bytes20 targetBytes = bytes20(_implementation);\\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\\n }\\n}\\n\",\"keccak256\":\"0x8aa3d50e714f92dc0ed6cc6d88fa8a18c948493103928f6092f98815b2c046ca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162003c9338038062003c9383398181016040528101906200003791906200039c565b600062000049620001b460201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156200015a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200015190620004e7565b60405180910390fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550620001ac81620001bc60201b60201c565b505062000596565b600033905090565b620001cc620001b460201b60201c565b73ffffffffffffffffffffffffffffffffffffffff16620001f26200034560201b60201c565b73ffffffffffffffffffffffffffffffffffffffff16146200024b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200024290620004c5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415620002be576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002b590620004a3565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000815190506200037f8162000562565b92915050565b60008151905062000396816200057c565b92915050565b60008060408385031215620003b057600080fd5b6000620003c08582860162000385565b9250506020620003d3858286016200036e565b9150509250929050565b6000620003ec60198362000509565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b60006200042e60208362000509565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006200047060148362000509565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b60006020820190508181036000830152620004be81620003dd565b9050919050565b60006020820190508181036000830152620004e0816200041f565b9050919050565b60006020820190508181036000830152620005028162000461565b9050919050565b600082825260208201905092915050565b6000620005278262000542565b9050919050565b60006200053b826200051a565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6200056d816200051a565b81146200057957600080fd5b50565b62000587816200052e565b81146200059357600080fd5b50565b6136ed80620005a66000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c80639c05fc60116100ad578063c1ab13db11610071578063c1ab13db14610319578063cf497e6c14610335578063f1d24c4514610351578063f2fde38b14610381578063fc0c546a1461039d5761012c565b80639c05fc6014610275578063a345746614610291578063a619486e146102af578063b6b55f25146102cd578063bdb62fbe146102e95761012c565b806368d30c2e116100f457806368d30c2e146101d15780636e03b8dc146101ed578063715018a61461021d57806379ee1bdf146102275780638da5cb5b146102575761012c565b806303990a6c146101315780630602ba2b1461014d5780632e1a7d4d1461017d578063463013a2146101995780635975e00c146101b5575b600080fd5b61014b6004803603810190610146919061253e565b6103bb565b005b61016760048036038101906101629190612515565b610563565b604051610174919061302d565b60405180910390f35b610197600480360381019061019291906125db565b6105a4565b005b6101b360048036038101906101ae9190612583565b610701565b005b6101cf60048036038101906101ca919061234c565b61078d565b005b6101eb60048036038101906101e69190612375565b61091e565b005b61020760048036038101906102029190612515565b610c7e565b6040516102149190612e67565b60405180910390f35b610225610cb1565b005b610241600480360381019061023c919061234c565b610deb565b60405161024e919061302d565b60405180910390f35b61025f610e08565b60405161026c9190612e67565b60405180910390f35b61028f600480360381019061028a919061243b565b610e31565b005b610299610f5e565b6040516102a6919061300b565b60405180910390f35b6102b7611036565b6040516102c49190612e67565b60405180910390f35b6102e760048036038101906102e291906125db565b61105c565b005b61030360048036038101906102fe91906124d9565b61113f565b6040516103109190612e67565b60405180910390f35b610333600480360381019061032e919061234c565b611163565b005b61034f600480360381019061034a919061234c565b611284565b005b61036b60048036038101906103669190612515565b6113f7565b6040516103789190612e67565b60405180910390f35b61039b6004803603810190610396919061234c565b611472565b005b6103a561161b565b6040516103b29190613048565b60405180910390f35b6103c3611645565b73ffffffffffffffffffffffffffffffffffffffff166103e1610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610437576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042e90613229565b60405180910390fd5b6000610443838361164d565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98686604051610556929190613063565b60405180910390a4505050565b60008073ffffffffffffffffffffffffffffffffffffffff16610585836113f7565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6105ac611645565b73ffffffffffffffffffffffffffffffffffffffff166105ca610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610620576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061790613229565b60405180910390fd5b60008111610663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065a90613209565b60405180910390fd5b6106b03382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116db9092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040516106f69190613309565b60405180910390a250565b610709611645565b73ffffffffffffffffffffffffffffffffffffffff16610727610e08565b73ffffffffffffffffffffffffffffffffffffffff161461077d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077490613229565b60405180910390fd5b610788838383611761565b505050565b610795611645565b73ffffffffffffffffffffffffffffffffffffffff166107b3610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610809576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080090613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610879576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087090613109565b60405180910390fd5b61088d81600261194390919063ffffffff16565b6108cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c390613269565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610913919061302d565b60405180910390a250565b610926611645565b73ffffffffffffffffffffffffffffffffffffffff16610944610e08565b73ffffffffffffffffffffffffffffffffffffffff161461099a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099190613229565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109f69190612e67565b60206040518083038186803b158015610a0e57600080fd5b505afa158015610a22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a469190612604565b1015610a87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7e90613149565b60405180910390fd5b6060308a8a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168b8b8b8b8b8b8b604051602401610ad09b9a99989796959493929190612e82565b6040516020818303038152906040527fbd896dcb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610b858280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611973565b9050610bd4818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116db9092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610c69989796959493929190612f8d565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610cb9611645565b73ffffffffffffffffffffffffffffffffffffffff16610cd7610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610d2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2490613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610e018260026119ef90919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610e39611645565b73ffffffffffffffffffffffffffffffffffffffff16610e57610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610ead576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea490613229565b60405180910390fd5b818190508484905014610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec906130e9565b60405180910390fd5b60005b84849050811015610f5757610f4a858583818110610f1257fe5b9050602002810190610f249190613324565b858585818110610f3057fe5b9050602002016020810190610f45919061234c565b611761565b8080600101915050610ef8565b5050505050565b606080610f6b6002611a1f565b67ffffffffffffffff81118015610f8157600080fd5b50604051908082528060200260200182016040528015610fb05781602001602082028036833780820191505090505b50905060005b610fc06002611a1f565b81101561102e57610fdb816002611a3490919063ffffffff16565b828281518110610fe757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050610fb6565b508091505090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000811161109f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109690613209565b60405180910390fd5b6110ee333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611a4e909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516111349190613309565b60405180910390a250565b600061115b8361114e84611ad7565b8051906020012030611b4d565b905092915050565b61116b611645565b73ffffffffffffffffffffffffffffffffffffffff16611189610e08565b73ffffffffffffffffffffffffffffffffffffffff16146111df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d690613229565b60405180910390fd5b6111f3816002611b9190919063ffffffff16565b611232576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122990613189565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796000604051611279919061302d565b60405180910390a250565b61128c611645565b73ffffffffffffffffffffffffffffffffffffffff166112aa610e08565b73ffffffffffffffffffffffffffffffffffffffff1614611300576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f790613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611370576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611367906131a9565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61147a611645565b73ffffffffffffffffffffffffffffffffffffffff16611498610e08565b73ffffffffffffffffffffffffffffffffffffffff16146114ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e590613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561155e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155590613129565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b60006116d383836040516024016040516020818303038152906040529190604051611679929190612e4e565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611bc1565b905092915050565b61175c8363a9059cbb60e01b84846040516024016116fa929190612f64565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c19565b505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156117d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117c7906131c9565b60405180910390fd5b6117d981611ce0565b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f906132e9565b60405180910390fd5b6000611824848461164d565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98787604051611935929190613063565b60405180910390a450505050565b600061196b836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611cf3565b905092915050565b60008061198a60008661198587611ad7565b611d63565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a26000835111156119e4576119e28184611e74565b505b809150509392505050565b6000611a17836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ebe565b905092915050565b6000611a2d82600001611ee1565b9050919050565b6000611a438360000183611ef2565b60001c905092915050565b611ad1846323b872dd60e01b858585604051602401611a6f93929190612f2d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c19565b50505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611b339493929190612d9b565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611b6b9493929190612de9565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b6000611bb9836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611f5f565b905092915050565b60006004825114611c07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bfe90613249565b60405180910390fd5b60006020830151905080915050919050565b6060611c7b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166120479092919063ffffffff16565b9050600081511115611cdb5780806020019051810190611c9b91906124b0565b611cda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd1906132a9565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b6000611cff8383611ebe565b611d58578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611d5d565b600090505b92915050565b60008084471015611da9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da0906132c9565b60405180910390fd5b600083511415611dee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de5906130c9565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611e69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e60906131e9565b60405180910390fd5b809150509392505050565b6060611eb683836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612047565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011611f3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f34906130a9565b60405180910390fd5b826000018281548110611f4c57fe5b9060005260206000200154905092915050565b6000808360010160008481526020019081526020016000205490506000811461203b5760006001820390506000600186600001805490500390506000866000018281548110611faa57fe5b9060005260206000200154905080876000018481548110611fc757fe5b9060005260206000200181905550600183018760010160008381526020019081526020016000208190555086600001805480611fff57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612041565b60009150505b92915050565b6060612056848460008561205f565b90509392505050565b6060824710156120a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209b90613169565b60405180910390fd5b6120ad85611ce0565b6120ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e390613289565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516121169190612e37565b60006040518083038185875af1925050503d8060008114612153576040519150601f19603f3d011682016040523d82523d6000602084013e612158565b606091505b5091509150612168828286612174565b92505050949350505050565b60608315612184578290506121d4565b6000835111156121975782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121cb9190613087565b60405180910390fd5b9392505050565b6000813590506121ea81613634565b92915050565b60008083601f84011261220257600080fd5b8235905067ffffffffffffffff81111561221b57600080fd5b60208301915083602082028301111561223357600080fd5b9250929050565b60008083601f84011261224c57600080fd5b8235905067ffffffffffffffff81111561226557600080fd5b60208301915083602082028301111561227d57600080fd5b9250929050565b6000815190506122938161364b565b92915050565b6000813590506122a881613662565b92915050565b6000813590506122bd81613679565b92915050565b6000813590506122d281613690565b92915050565b60008083601f8401126122ea57600080fd5b8235905067ffffffffffffffff81111561230357600080fd5b60208301915083600182028301111561231b57600080fd5b9250929050565b600081359050612331816136a0565b92915050565b600081519050612346816136a0565b92915050565b60006020828403121561235e57600080fd5b600061236c848285016121db565b91505092915050565b60008060008060008060008060006101208a8c03121561239457600080fd5b60006123a28c828d016121db565b99505060206123b38c828d016121db565b98505060406123c48c828d01612322565b97505060606123d58c828d01612322565b96505060806123e68c828d01612322565b95505060a06123f78c828d01612322565b94505060c06124088c828d01612322565b93505060e06124198c828d01612322565b92505061010061242b8c828d016122c3565b9150509295985092959850929598565b6000806000806040858703121561245157600080fd5b600085013567ffffffffffffffff81111561246b57600080fd5b6124778782880161223a565b9450945050602085013567ffffffffffffffff81111561249657600080fd5b6124a2878288016121f0565b925092505092959194509250565b6000602082840312156124c257600080fd5b60006124d084828501612284565b91505092915050565b600080604083850312156124ec57600080fd5b60006124fa85828601612299565b925050602061250b858286016121db565b9150509250929050565b60006020828403121561252757600080fd5b6000612535848285016122ae565b91505092915050565b6000806020838503121561255157600080fd5b600083013567ffffffffffffffff81111561256b57600080fd5b612577858286016122d8565b92509250509250929050565b60008060006040848603121561259857600080fd5b600084013567ffffffffffffffff8111156125b257600080fd5b6125be868287016122d8565b935093505060206125d1868287016121db565b9150509250925092565b6000602082840312156125ed57600080fd5b60006125fb84828501612322565b91505092915050565b60006020828403121561261657600080fd5b600061262484828501612337565b91505092915050565b60006126398383612645565b60208301905092915050565b61264e816133f1565b82525050565b61265d816133f1565b82525050565b61267461266f826133f1565b6135aa565b82525050565b60006126858261338b565b61268f81856133b9565b935061269a8361337b565b8060005b838110156126cb5781516126b2888261262d565b97506126bd836133ac565b92505060018101905061269e565b5085935050505092915050565b6126e181613403565b82525050565b6126f86126f38261343b565b6135c6565b82525050565b61270f61270a82613467565b6135d0565b82525050565b6127266127218261340f565b6135bc565b82525050565b61273d61273882613493565b6135da565b82525050565b61275461274f826134bf565b6135e4565b82525050565b600061276582613396565b61276f81856133ca565b935061277f818560208601613577565b80840191505092915050565b61279481613532565b82525050565b6127a381613556565b82525050565b60006127b583856133d5565b93506127c2838584613568565b6127cb83613602565b840190509392505050565b60006127e283856133e6565b93506127ef838584613568565b82840190509392505050565b6000612806826133a1565b61281081856133d5565b9350612820818560208601613577565b61282981613602565b840191505092915050565b60006128416022836133d5565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006128a76020836133d5565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b60006128e76015836133d5565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000612927601a836133d5565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006129676026836133d5565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006129cd6020836133d5565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b6000612a0d6026836133d5565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612a73601b836133d5565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000612ab36019836133d5565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000612af3601d836133d5565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b6000612b336019836133d5565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000612b736015836133d5565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000612bb36020836133d5565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000612bf36018836133d5565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b6000612c336019836133d5565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000612c73601d836133d5565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000612cb3602a836133d5565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000612d19601d836133d5565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b6000612d596019836133d5565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b612d9581613528565b82525050565b6000612da782876126e7565b600a82019150612db782866126e7565b600a82019150612dc7828561272c565b601482019150612dd782846126fe565b600f8201915081905095945050505050565b6000612df58287612715565b600182019150612e058286612663565b601482019150612e158285612743565b602082019150612e258284612743565b60208201915081905095945050505050565b6000612e43828461275a565b915081905092915050565b6000612e5b8284866127d6565b91508190509392505050565b6000602082019050612e7c6000830184612654565b92915050565b600061016082019050612e98600083018e612654565b612ea5602083018d612654565b612eb2604083018c612654565b612ebf606083018b612654565b612ecc608083018a612d8c565b612ed960a0830189612d8c565b612ee660c0830188612d8c565b612ef360e0830187612d8c565b612f01610100830186612d8c565b612f0f610120830185612d8c565b612f1d61014083018461279a565b9c9b505050505050505050505050565b6000606082019050612f426000830186612654565b612f4f6020830185612654565b612f5c6040830184612d8c565b949350505050565b6000604082019050612f796000830185612654565b612f866020830184612d8c565b9392505050565b600061010082019050612fa3600083018b612654565b612fb0602083018a612d8c565b612fbd6040830189612d8c565b612fca6060830188612d8c565b612fd76080830187612d8c565b612fe460a0830186612d8c565b612ff160c0830185612d8c565b612ffe60e083018461279a565b9998505050505050505050565b60006020820190508181036000830152613025818461267a565b905092915050565b600060208201905061304260008301846126d8565b92915050565b600060208201905061305d600083018461278b565b92915050565b6000602082019050818103600083015261307e8184866127a9565b90509392505050565b600060208201905081810360008301526130a181846127fb565b905092915050565b600060208201905081810360008301526130c281612834565b9050919050565b600060208201905081810360008301526130e28161289a565b9050919050565b60006020820190508181036000830152613102816128da565b9050919050565b600060208201905081810360008301526131228161291a565b9050919050565b600060208201905081810360008301526131428161295a565b9050919050565b60006020820190508181036000830152613162816129c0565b9050919050565b6000602082019050818103600083015261318281612a00565b9050919050565b600060208201905081810360008301526131a281612a66565b9050919050565b600060208201905081810360008301526131c281612aa6565b9050919050565b600060208201905081810360008301526131e281612ae6565b9050919050565b6000602082019050818103600083015261320281612b26565b9050919050565b6000602082019050818103600083015261322281612b66565b9050919050565b6000602082019050818103600083015261324281612ba6565b9050919050565b6000602082019050818103600083015261326281612be6565b9050919050565b6000602082019050818103600083015261328281612c26565b9050919050565b600060208201905081810360008301526132a281612c66565b9050919050565b600060208201905081810360008301526132c281612ca6565b9050919050565b600060208201905081810360008301526132e281612d0c565b9050919050565b6000602082019050818103600083015261330281612d4c565b9050919050565b600060208201905061331e6000830184612d8c565b92915050565b6000808335600160200384360303811261333d57600080fd5b80840192508235915067ffffffffffffffff82111561335b57600080fd5b60208301925060018202360383131561337357600080fd5b509250929050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006133fc82613508565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061350382613620565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061353d82613544565b9050919050565b600061354f82613508565b9050919050565b6000613561826134f5565b9050919050565b82818337600083830152505050565b60005b8381101561359557808201518184015260208101905061357a565b838111156135a4576000848401525b50505050565b60006135b5826135ee565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b60006135f982613613565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061363157613630613600565b5b50565b61363d816133f1565b811461364857600080fd5b50565b61365481613403565b811461365f57600080fd5b50565b61366b816134bf565b811461367657600080fd5b50565b613682816134c9565b811461368d57600080fd5b50565b6003811061369d57600080fd5b50565b6136a981613528565b81146136b457600080fd5b5056fea2646970667358221220152609a861bb04032144a137df9ef03f075e9714c19116356852d3eaaf8c005f64736f6c63430007030033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80639c05fc60116100ad578063c1ab13db11610071578063c1ab13db14610319578063cf497e6c14610335578063f1d24c4514610351578063f2fde38b14610381578063fc0c546a1461039d5761012c565b80639c05fc6014610275578063a345746614610291578063a619486e146102af578063b6b55f25146102cd578063bdb62fbe146102e95761012c565b806368d30c2e116100f457806368d30c2e146101d15780636e03b8dc146101ed578063715018a61461021d57806379ee1bdf146102275780638da5cb5b146102575761012c565b806303990a6c146101315780630602ba2b1461014d5780632e1a7d4d1461017d578063463013a2146101995780635975e00c146101b5575b600080fd5b61014b6004803603810190610146919061253e565b6103bb565b005b61016760048036038101906101629190612515565b610563565b604051610174919061302d565b60405180910390f35b610197600480360381019061019291906125db565b6105a4565b005b6101b360048036038101906101ae9190612583565b610701565b005b6101cf60048036038101906101ca919061234c565b61078d565b005b6101eb60048036038101906101e69190612375565b61091e565b005b61020760048036038101906102029190612515565b610c7e565b6040516102149190612e67565b60405180910390f35b610225610cb1565b005b610241600480360381019061023c919061234c565b610deb565b60405161024e919061302d565b60405180910390f35b61025f610e08565b60405161026c9190612e67565b60405180910390f35b61028f600480360381019061028a919061243b565b610e31565b005b610299610f5e565b6040516102a6919061300b565b60405180910390f35b6102b7611036565b6040516102c49190612e67565b60405180910390f35b6102e760048036038101906102e291906125db565b61105c565b005b61030360048036038101906102fe91906124d9565b61113f565b6040516103109190612e67565b60405180910390f35b610333600480360381019061032e919061234c565b611163565b005b61034f600480360381019061034a919061234c565b611284565b005b61036b60048036038101906103669190612515565b6113f7565b6040516103789190612e67565b60405180910390f35b61039b6004803603810190610396919061234c565b611472565b005b6103a561161b565b6040516103b29190613048565b60405180910390f35b6103c3611645565b73ffffffffffffffffffffffffffffffffffffffff166103e1610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610437576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042e90613229565b60405180910390fd5b6000610443838361164d565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98686604051610556929190613063565b60405180910390a4505050565b60008073ffffffffffffffffffffffffffffffffffffffff16610585836113f7565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6105ac611645565b73ffffffffffffffffffffffffffffffffffffffff166105ca610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610620576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061790613229565b60405180910390fd5b60008111610663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065a90613209565b60405180910390fd5b6106b03382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116db9092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040516106f69190613309565b60405180910390a250565b610709611645565b73ffffffffffffffffffffffffffffffffffffffff16610727610e08565b73ffffffffffffffffffffffffffffffffffffffff161461077d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077490613229565b60405180910390fd5b610788838383611761565b505050565b610795611645565b73ffffffffffffffffffffffffffffffffffffffff166107b3610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610809576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080090613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610879576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087090613109565b60405180910390fd5b61088d81600261194390919063ffffffff16565b6108cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c390613269565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610913919061302d565b60405180910390a250565b610926611645565b73ffffffffffffffffffffffffffffffffffffffff16610944610e08565b73ffffffffffffffffffffffffffffffffffffffff161461099a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099190613229565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109f69190612e67565b60206040518083038186803b158015610a0e57600080fd5b505afa158015610a22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a469190612604565b1015610a87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7e90613149565b60405180910390fd5b6060308a8a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168b8b8b8b8b8b8b604051602401610ad09b9a99989796959493929190612e82565b6040516020818303038152906040527fbd896dcb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610b858280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611973565b9050610bd4818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116db9092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610c69989796959493929190612f8d565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610cb9611645565b73ffffffffffffffffffffffffffffffffffffffff16610cd7610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610d2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2490613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610e018260026119ef90919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610e39611645565b73ffffffffffffffffffffffffffffffffffffffff16610e57610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610ead576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea490613229565b60405180910390fd5b818190508484905014610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec906130e9565b60405180910390fd5b60005b84849050811015610f5757610f4a858583818110610f1257fe5b9050602002810190610f249190613324565b858585818110610f3057fe5b9050602002016020810190610f45919061234c565b611761565b8080600101915050610ef8565b5050505050565b606080610f6b6002611a1f565b67ffffffffffffffff81118015610f8157600080fd5b50604051908082528060200260200182016040528015610fb05781602001602082028036833780820191505090505b50905060005b610fc06002611a1f565b81101561102e57610fdb816002611a3490919063ffffffff16565b828281518110610fe757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050610fb6565b508091505090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000811161109f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109690613209565b60405180910390fd5b6110ee333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611a4e909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516111349190613309565b60405180910390a250565b600061115b8361114e84611ad7565b8051906020012030611b4d565b905092915050565b61116b611645565b73ffffffffffffffffffffffffffffffffffffffff16611189610e08565b73ffffffffffffffffffffffffffffffffffffffff16146111df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d690613229565b60405180910390fd5b6111f3816002611b9190919063ffffffff16565b611232576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122990613189565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796000604051611279919061302d565b60405180910390a250565b61128c611645565b73ffffffffffffffffffffffffffffffffffffffff166112aa610e08565b73ffffffffffffffffffffffffffffffffffffffff1614611300576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f790613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611370576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611367906131a9565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61147a611645565b73ffffffffffffffffffffffffffffffffffffffff16611498610e08565b73ffffffffffffffffffffffffffffffffffffffff16146114ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e590613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561155e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155590613129565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b60006116d383836040516024016040516020818303038152906040529190604051611679929190612e4e565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611bc1565b905092915050565b61175c8363a9059cbb60e01b84846040516024016116fa929190612f64565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c19565b505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156117d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117c7906131c9565b60405180910390fd5b6117d981611ce0565b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f906132e9565b60405180910390fd5b6000611824848461164d565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98787604051611935929190613063565b60405180910390a450505050565b600061196b836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611cf3565b905092915050565b60008061198a60008661198587611ad7565b611d63565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a26000835111156119e4576119e28184611e74565b505b809150509392505050565b6000611a17836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ebe565b905092915050565b6000611a2d82600001611ee1565b9050919050565b6000611a438360000183611ef2565b60001c905092915050565b611ad1846323b872dd60e01b858585604051602401611a6f93929190612f2d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c19565b50505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611b339493929190612d9b565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611b6b9493929190612de9565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b6000611bb9836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611f5f565b905092915050565b60006004825114611c07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bfe90613249565b60405180910390fd5b60006020830151905080915050919050565b6060611c7b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166120479092919063ffffffff16565b9050600081511115611cdb5780806020019051810190611c9b91906124b0565b611cda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd1906132a9565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b6000611cff8383611ebe565b611d58578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611d5d565b600090505b92915050565b60008084471015611da9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da0906132c9565b60405180910390fd5b600083511415611dee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de5906130c9565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611e69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e60906131e9565b60405180910390fd5b809150509392505050565b6060611eb683836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612047565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011611f3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f34906130a9565b60405180910390fd5b826000018281548110611f4c57fe5b9060005260206000200154905092915050565b6000808360010160008481526020019081526020016000205490506000811461203b5760006001820390506000600186600001805490500390506000866000018281548110611faa57fe5b9060005260206000200154905080876000018481548110611fc757fe5b9060005260206000200181905550600183018760010160008381526020019081526020016000208190555086600001805480611fff57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612041565b60009150505b92915050565b6060612056848460008561205f565b90509392505050565b6060824710156120a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209b90613169565b60405180910390fd5b6120ad85611ce0565b6120ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e390613289565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516121169190612e37565b60006040518083038185875af1925050503d8060008114612153576040519150601f19603f3d011682016040523d82523d6000602084013e612158565b606091505b5091509150612168828286612174565b92505050949350505050565b60608315612184578290506121d4565b6000835111156121975782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121cb9190613087565b60405180910390fd5b9392505050565b6000813590506121ea81613634565b92915050565b60008083601f84011261220257600080fd5b8235905067ffffffffffffffff81111561221b57600080fd5b60208301915083602082028301111561223357600080fd5b9250929050565b60008083601f84011261224c57600080fd5b8235905067ffffffffffffffff81111561226557600080fd5b60208301915083602082028301111561227d57600080fd5b9250929050565b6000815190506122938161364b565b92915050565b6000813590506122a881613662565b92915050565b6000813590506122bd81613679565b92915050565b6000813590506122d281613690565b92915050565b60008083601f8401126122ea57600080fd5b8235905067ffffffffffffffff81111561230357600080fd5b60208301915083600182028301111561231b57600080fd5b9250929050565b600081359050612331816136a0565b92915050565b600081519050612346816136a0565b92915050565b60006020828403121561235e57600080fd5b600061236c848285016121db565b91505092915050565b60008060008060008060008060006101208a8c03121561239457600080fd5b60006123a28c828d016121db565b99505060206123b38c828d016121db565b98505060406123c48c828d01612322565b97505060606123d58c828d01612322565b96505060806123e68c828d01612322565b95505060a06123f78c828d01612322565b94505060c06124088c828d01612322565b93505060e06124198c828d01612322565b92505061010061242b8c828d016122c3565b9150509295985092959850929598565b6000806000806040858703121561245157600080fd5b600085013567ffffffffffffffff81111561246b57600080fd5b6124778782880161223a565b9450945050602085013567ffffffffffffffff81111561249657600080fd5b6124a2878288016121f0565b925092505092959194509250565b6000602082840312156124c257600080fd5b60006124d084828501612284565b91505092915050565b600080604083850312156124ec57600080fd5b60006124fa85828601612299565b925050602061250b858286016121db565b9150509250929050565b60006020828403121561252757600080fd5b6000612535848285016122ae565b91505092915050565b6000806020838503121561255157600080fd5b600083013567ffffffffffffffff81111561256b57600080fd5b612577858286016122d8565b92509250509250929050565b60008060006040848603121561259857600080fd5b600084013567ffffffffffffffff8111156125b257600080fd5b6125be868287016122d8565b935093505060206125d1868287016121db565b9150509250925092565b6000602082840312156125ed57600080fd5b60006125fb84828501612322565b91505092915050565b60006020828403121561261657600080fd5b600061262484828501612337565b91505092915050565b60006126398383612645565b60208301905092915050565b61264e816133f1565b82525050565b61265d816133f1565b82525050565b61267461266f826133f1565b6135aa565b82525050565b60006126858261338b565b61268f81856133b9565b935061269a8361337b565b8060005b838110156126cb5781516126b2888261262d565b97506126bd836133ac565b92505060018101905061269e565b5085935050505092915050565b6126e181613403565b82525050565b6126f86126f38261343b565b6135c6565b82525050565b61270f61270a82613467565b6135d0565b82525050565b6127266127218261340f565b6135bc565b82525050565b61273d61273882613493565b6135da565b82525050565b61275461274f826134bf565b6135e4565b82525050565b600061276582613396565b61276f81856133ca565b935061277f818560208601613577565b80840191505092915050565b61279481613532565b82525050565b6127a381613556565b82525050565b60006127b583856133d5565b93506127c2838584613568565b6127cb83613602565b840190509392505050565b60006127e283856133e6565b93506127ef838584613568565b82840190509392505050565b6000612806826133a1565b61281081856133d5565b9350612820818560208601613577565b61282981613602565b840191505092915050565b60006128416022836133d5565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006128a76020836133d5565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b60006128e76015836133d5565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000612927601a836133d5565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006129676026836133d5565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006129cd6020836133d5565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b6000612a0d6026836133d5565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612a73601b836133d5565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000612ab36019836133d5565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000612af3601d836133d5565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b6000612b336019836133d5565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000612b736015836133d5565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000612bb36020836133d5565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000612bf36018836133d5565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b6000612c336019836133d5565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000612c73601d836133d5565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000612cb3602a836133d5565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000612d19601d836133d5565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b6000612d596019836133d5565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b612d9581613528565b82525050565b6000612da782876126e7565b600a82019150612db782866126e7565b600a82019150612dc7828561272c565b601482019150612dd782846126fe565b600f8201915081905095945050505050565b6000612df58287612715565b600182019150612e058286612663565b601482019150612e158285612743565b602082019150612e258284612743565b60208201915081905095945050505050565b6000612e43828461275a565b915081905092915050565b6000612e5b8284866127d6565b91508190509392505050565b6000602082019050612e7c6000830184612654565b92915050565b600061016082019050612e98600083018e612654565b612ea5602083018d612654565b612eb2604083018c612654565b612ebf606083018b612654565b612ecc608083018a612d8c565b612ed960a0830189612d8c565b612ee660c0830188612d8c565b612ef360e0830187612d8c565b612f01610100830186612d8c565b612f0f610120830185612d8c565b612f1d61014083018461279a565b9c9b505050505050505050505050565b6000606082019050612f426000830186612654565b612f4f6020830185612654565b612f5c6040830184612d8c565b949350505050565b6000604082019050612f796000830185612654565b612f866020830184612d8c565b9392505050565b600061010082019050612fa3600083018b612654565b612fb0602083018a612d8c565b612fbd6040830189612d8c565b612fca6060830188612d8c565b612fd76080830187612d8c565b612fe460a0830186612d8c565b612ff160c0830185612d8c565b612ffe60e083018461279a565b9998505050505050505050565b60006020820190508181036000830152613025818461267a565b905092915050565b600060208201905061304260008301846126d8565b92915050565b600060208201905061305d600083018461278b565b92915050565b6000602082019050818103600083015261307e8184866127a9565b90509392505050565b600060208201905081810360008301526130a181846127fb565b905092915050565b600060208201905081810360008301526130c281612834565b9050919050565b600060208201905081810360008301526130e28161289a565b9050919050565b60006020820190508181036000830152613102816128da565b9050919050565b600060208201905081810360008301526131228161291a565b9050919050565b600060208201905081810360008301526131428161295a565b9050919050565b60006020820190508181036000830152613162816129c0565b9050919050565b6000602082019050818103600083015261318281612a00565b9050919050565b600060208201905081810360008301526131a281612a66565b9050919050565b600060208201905081810360008301526131c281612aa6565b9050919050565b600060208201905081810360008301526131e281612ae6565b9050919050565b6000602082019050818103600083015261320281612b26565b9050919050565b6000602082019050818103600083015261322281612b66565b9050919050565b6000602082019050818103600083015261324281612ba6565b9050919050565b6000602082019050818103600083015261326281612be6565b9050919050565b6000602082019050818103600083015261328281612c26565b9050919050565b600060208201905081810360008301526132a281612c66565b9050919050565b600060208201905081810360008301526132c281612ca6565b9050919050565b600060208201905081810360008301526132e281612d0c565b9050919050565b6000602082019050818103600083015261330281612d4c565b9050919050565b600060208201905061331e6000830184612d8c565b92915050565b6000808335600160200384360303811261333d57600080fd5b80840192508235915067ffffffffffffffff82111561335b57600080fd5b60208301925060018202360383131561337357600080fd5b509250929050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006133fc82613508565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061350382613620565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061353d82613544565b9050919050565b600061354f82613508565b9050919050565b6000613561826134f5565b9050919050565b82818337600083830152505050565b60005b8381101561359557808201518184015260208101905061357a565b838111156135a4576000848401525b50505050565b60006135b5826135ee565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b60006135f982613613565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061363157613630613600565b5b50565b61363d816133f1565b811461364857600080fd5b50565b61365481613403565b811461365f57600080fd5b50565b61366b816134bf565b811461367657600080fd5b50565b613682816134c9565b811461368d57600080fd5b50565b6003811061369d57600080fd5b50565b6136a981613528565b81146136b457600080fd5b5056fea2646970667358221220152609a861bb04032144a137df9ef03f075e9714c19116356852d3eaaf8c005f64736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "addTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "constructor": { + "params": { + "_graphToken": "Token to use for deposits and withdrawals", + "_masterCopy": "Address of the master copy to use to clone proxies" + } + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "params": { + "_beneficiary": "Address of the beneficiary of locked tokens", + "_endTime": "End time of the release schedule", + "_managedAmount": "Amount of tokens to be managed by the lock contract", + "_owner": "Address of the contract owner", + "_periods": "Number of periods between start time and end time", + "_releaseStartTime": "Override time for when the releases start", + "_revocable": "Whether the contract is revocable", + "_startTime": "Start time of the release schedule" + } + }, + "deposit(uint256)": { + "details": "Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes", + "params": { + "_amount": "Amount to deposit" + } + }, + "getAuthFunctionCallTarget(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "Address of the target contract where to send the call" + } + }, + "getDeploymentAddress(bytes32,address)": { + "params": { + "_implementation": "Address of the proxy target implementation", + "_salt": "Bytes32 salt to use for CREATE2" + }, + "returns": { + "_0": "Address of the counterfactual MinimalProxy" + } + }, + "getTokenDestinations()": { + "returns": { + "_0": "Array of addresses authorized to pull funds from a token lock" + } + }, + "isAuthFunctionCall(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "True if authorized" + } + }, + "isTokenDestination(address)": { + "params": { + "_dst": "Destination address" + }, + "returns": { + "_0": "True if authorized" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "removeTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "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." + }, + "setAuthFunctionCall(string,address)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature", + "_target": "Address of the destination contract to call" + } + }, + "setAuthFunctionCallMany(string[],address[])": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signatures": "Function signatures", + "_targets": "Address of the destination contract to call" + } + }, + "setMasterCopy(address)": { + "params": { + "_masterCopy": "Address of contract bytecode to factory clone" + } + }, + "token()": { + "returns": { + "_0": "Token used for transfers and approvals" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "unsetAuthFunctionCall(string)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature" + } + }, + "withdraw(uint256)": { + "details": "Escape hatch in case of mistakes or to recover remaining funds", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "GraphTokenLockManager", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "addTokenDestination(address)": { + "notice": "Adds an address that can be allowed by a token lock to pull funds" + }, + "constructor": { + "notice": "Constructor." + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "notice": "Creates and fund a new token lock wallet using a minimum proxy" + }, + "deposit(uint256)": { + "notice": "Deposits tokens into the contract" + }, + "getAuthFunctionCallTarget(bytes4)": { + "notice": "Gets the target contract to call for a particular function signature" + }, + "getDeploymentAddress(bytes32,address)": { + "notice": "Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation" + }, + "getTokenDestinations()": { + "notice": "Returns an array of authorized destination addresses" + }, + "isAuthFunctionCall(bytes4)": { + "notice": "Returns true if the function call is authorized" + }, + "isTokenDestination(address)": { + "notice": "Returns True if the address is authorized to be a destination of tokens" + }, + "removeTokenDestination(address)": { + "notice": "Removes an address that can be allowed by a token lock to pull funds" + }, + "setAuthFunctionCall(string,address)": { + "notice": "Sets an authorized function call to target" + }, + "setAuthFunctionCallMany(string[],address[])": { + "notice": "Sets an authorized function call to target in bulk" + }, + "setMasterCopy(address)": { + "notice": "Sets the masterCopy bytecode to use to create clones of TokenLock contracts" + }, + "token()": { + "notice": "Gets the GRT token address" + }, + "unsetAuthFunctionCall(string)": { + "notice": "Unsets an authorized function call to target" + }, + "withdraw(uint256)": { + "notice": "Withdraws tokens from the contract" + } + }, + "notice": "This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 7, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 2353, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "authFnCalls", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes4,t_address)" + }, + { + "astId": 2355, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_tokenDestinations", + "offset": 0, + "slot": "2", + "type": "t_struct(AddressSet)1461_storage" + }, + { + "astId": 2357, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "masterCopy", + "offset": 0, + "slot": "4", + "type": "t_address" + }, + { + "astId": 2359, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_token", + "offset": 0, + "slot": "5", + "type": "t_contract(IERC20)542" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "base": "t_bytes32", + "encoding": "dynamic_array", + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes4": { + "encoding": "inplace", + "label": "bytes4", + "numberOfBytes": "4" + }, + "t_contract(IERC20)542": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes4,t_address)": { + "encoding": "mapping", + "key": "t_bytes4", + "label": "mapping(bytes4 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_struct(AddressSet)1461_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.AddressSet", + "members": [ + { + "astId": 1460, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_inner", + "offset": 0, + "slot": "0", + "type": "t_struct(Set)1196_storage" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)1196_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.Set", + "members": [ + { + "astId": 1191, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_values", + "offset": 0, + "slot": "0", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "astId": 1195, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_indexes", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/deployments/goerli/Scratch-6-Manager.json b/deployments/goerli/Scratch-6-Manager.json new file mode 100644 index 0000000..d95fb27 --- /dev/null +++ b/deployments/goerli/Scratch-6-Manager.json @@ -0,0 +1,926 @@ +{ + "address": "0x97D3008043eC5f877bfee9A7e55437A43F846046", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes4", + "name": "sigHash", + "type": "bytes4" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "signature", + "type": "string" + } + ], + "name": "FunctionCallAuth", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "masterCopy", + "type": "address" + } + ], + "name": "MasterCopyUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "TokenDestinationAllowed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "initHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "periods", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseStartTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "vestingCliffTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IGraphTokenLock.Revocability", + "name": "revocable", + "type": "uint8" + } + ], + "name": "TokenLockCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "addTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "name": "authFnCalls", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "createTokenLockWallet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "getAuthFunctionCallTarget", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + } + ], + "name": "getDeploymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTokenDestinations", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "isAuthFunctionCall", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "isTokenDestination", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "masterCopy", + "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": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "removeTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "_signatures", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "_targets", + "type": "address[]" + } + ], + "name": "setAuthFunctionCallMany", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "name": "setMasterCopy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + } + ], + "name": "unsetAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x3490f7529b06c6c578dc3b0c7e4601ca0496f4c3650957f44f811a1b63970054", + "receipt": { + "to": null, + "from": "0xBc7f4d3a85B820fDB1058FD93073Eb6bc9AAF59b", + "contractAddress": "0x97D3008043eC5f877bfee9A7e55437A43F846046", + "transactionIndex": 54, + "gasUsed": "3167266", + "logsBloom": "0x00000000000000000000000000000000000004000000000100800000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000400000000000000000020000000000200000000800000000000000000000000000000000400000000200000000000000000000000000000000000000000000000002001000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000100000000800000000000000020000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xadcba4e29fd9b086be860d2dcb16a35ae60305160314e12e296102f47f46adaf", + "transactionHash": "0x3490f7529b06c6c578dc3b0c7e4601ca0496f4c3650957f44f811a1b63970054", + "logs": [ + { + "transactionIndex": 54, + "blockNumber": 9092520, + "transactionHash": "0x3490f7529b06c6c578dc3b0c7e4601ca0496f4c3650957f44f811a1b63970054", + "address": "0x97D3008043eC5f877bfee9A7e55437A43F846046", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000bc7f4d3a85b820fdb1058fd93073eb6bc9aaf59b" + ], + "data": "0x", + "logIndex": 105, + "blockHash": "0xadcba4e29fd9b086be860d2dcb16a35ae60305160314e12e296102f47f46adaf" + }, + { + "transactionIndex": 54, + "blockNumber": 9092520, + "transactionHash": "0x3490f7529b06c6c578dc3b0c7e4601ca0496f4c3650957f44f811a1b63970054", + "address": "0x97D3008043eC5f877bfee9A7e55437A43F846046", + "topics": [ + "0x30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de", + "0x000000000000000000000000e57e45c97e01a5c1e50aef7202e81cd199a3c4b2" + ], + "data": "0x", + "logIndex": 106, + "blockHash": "0xadcba4e29fd9b086be860d2dcb16a35ae60305160314e12e296102f47f46adaf" + } + ], + "blockNumber": 9092520, + "cumulativeGasUsed": "20509478", + "status": 1, + "byzantium": true + }, + "args": [ + "0xC43fD0358A983C2E986a301462C60db717Cb88e1", + "0xe57e45C97e01A5C1e50AeF7202e81cD199a3C4B2" + ], + "solcInputHash": "0b3ac4290e5ed652698ff31ab3f44c7f", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_graphToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes4\",\"name\":\"sigHash\",\"type\":\"bytes4\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"signature\",\"type\":\"string\"}],\"name\":\"FunctionCallAuth\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"masterCopy\",\"type\":\"address\"}],\"name\":\"MasterCopyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"}],\"name\":\"ProxyCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"TokenDestinationAllowed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"initHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"periods\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releaseStartTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vestingCliffTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"revocable\",\"type\":\"uint8\"}],\"name\":\"TokenLockCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"addTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"name\":\"authFnCalls\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"createTokenLockWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"getAuthFunctionCallTarget\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_salt\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"}],\"name\":\"getDeploymentAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenDestinations\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"isAuthFunctionCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"isTokenDestination\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"masterCopy\",\"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\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"removeTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"setAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"_signatures\",\"type\":\"string[]\"},{\"internalType\":\"address[]\",\"name\":\"_targets\",\"type\":\"address[]\"}],\"name\":\"setAuthFunctionCallMany\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"name\":\"setMasterCopy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"}],\"name\":\"unsetAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"addTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"constructor\":{\"params\":{\"_graphToken\":\"Token to use for deposits and withdrawals\",\"_masterCopy\":\"Address of the master copy to use to clone proxies\"}},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"params\":{\"_beneficiary\":\"Address of the beneficiary of locked tokens\",\"_endTime\":\"End time of the release schedule\",\"_managedAmount\":\"Amount of tokens to be managed by the lock contract\",\"_owner\":\"Address of the contract owner\",\"_periods\":\"Number of periods between start time and end time\",\"_releaseStartTime\":\"Override time for when the releases start\",\"_revocable\":\"Whether the contract is revocable\",\"_startTime\":\"Start time of the release schedule\"}},\"deposit(uint256)\":{\"details\":\"Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes\",\"params\":{\"_amount\":\"Amount to deposit\"}},\"getAuthFunctionCallTarget(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"Address of the target contract where to send the call\"}},\"getDeploymentAddress(bytes32,address)\":{\"params\":{\"_implementation\":\"Address of the proxy target implementation\",\"_salt\":\"Bytes32 salt to use for CREATE2\"},\"returns\":{\"_0\":\"Address of the counterfactual MinimalProxy\"}},\"getTokenDestinations()\":{\"returns\":{\"_0\":\"Array of addresses authorized to pull funds from a token lock\"}},\"isAuthFunctionCall(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"True if authorized\"}},\"isTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"},\"returns\":{\"_0\":\"True if authorized\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"removeTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"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.\"},\"setAuthFunctionCall(string,address)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\",\"_target\":\"Address of the destination contract to call\"}},\"setAuthFunctionCallMany(string[],address[])\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signatures\":\"Function signatures\",\"_targets\":\"Address of the destination contract to call\"}},\"setMasterCopy(address)\":{\"params\":{\"_masterCopy\":\"Address of contract bytecode to factory clone\"}},\"token()\":{\"returns\":{\"_0\":\"Token used for transfers and approvals\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unsetAuthFunctionCall(string)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\"}},\"withdraw(uint256)\":{\"details\":\"Escape hatch in case of mistakes or to recover remaining funds\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"GraphTokenLockManager\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"addTokenDestination(address)\":{\"notice\":\"Adds an address that can be allowed by a token lock to pull funds\"},\"constructor\":{\"notice\":\"Constructor.\"},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"notice\":\"Creates and fund a new token lock wallet using a minimum proxy\"},\"deposit(uint256)\":{\"notice\":\"Deposits tokens into the contract\"},\"getAuthFunctionCallTarget(bytes4)\":{\"notice\":\"Gets the target contract to call for a particular function signature\"},\"getDeploymentAddress(bytes32,address)\":{\"notice\":\"Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\"},\"getTokenDestinations()\":{\"notice\":\"Returns an array of authorized destination addresses\"},\"isAuthFunctionCall(bytes4)\":{\"notice\":\"Returns true if the function call is authorized\"},\"isTokenDestination(address)\":{\"notice\":\"Returns True if the address is authorized to be a destination of tokens\"},\"removeTokenDestination(address)\":{\"notice\":\"Removes an address that can be allowed by a token lock to pull funds\"},\"setAuthFunctionCall(string,address)\":{\"notice\":\"Sets an authorized function call to target\"},\"setAuthFunctionCallMany(string[],address[])\":{\"notice\":\"Sets an authorized function call to target in bulk\"},\"setMasterCopy(address)\":{\"notice\":\"Sets the masterCopy bytecode to use to create clones of TokenLock contracts\"},\"token()\":{\"notice\":\"Gets the GRT token address\"},\"unsetAuthFunctionCall(string)\":{\"notice\":\"Unsets an authorized function call to target\"},\"withdraw(uint256)\":{\"notice\":\"Withdraws tokens from the contract\"}},\"notice\":\"This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/GraphTokenLockManager.sol\":\"GraphTokenLockManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/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 * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\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 virtual 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 virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\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, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, 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) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\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 *\\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 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 *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\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 *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting 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 *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting 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 *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\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 * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\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 *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\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 *\\n * - The divisor cannot be zero.\\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\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\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\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\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 IERC20;` 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 /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\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 from 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. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\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\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\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\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with 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 function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual 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\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\\n address addr;\\n require(address(this).balance >= amount, \\\"Create2: insufficient balance\\\");\\n require(bytecode.length != 0, \\\"Create2: bytecode length is zero\\\");\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n }\\n require(addr != address(0), \\\"Create2: Failed on deploy\\\");\\n return addr;\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\\n bytes32 _data = keccak256(\\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\\n );\\n return address(uint160(uint256(_data)));\\n }\\n}\\n\",\"keccak256\":\"0x0a0b021149946014fe1cd04af11e7a937a29986c47e8b1b718c2d50d729472db\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <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\",\"keccak256\":\"0x1562cd9922fbf739edfb979f506809e2743789cbde3177515542161c3d04b164\",\"license\":\"MIT\"},\"contracts/GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/EnumerableSet.sol\\\";\\n\\nimport \\\"./MinimalProxyFactory.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract GraphTokenLockManager is MinimalProxyFactory, IGraphTokenLockManager {\\n using SafeERC20 for IERC20;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n // -- State --\\n\\n mapping(bytes4 => address) public authFnCalls;\\n EnumerableSet.AddressSet private _tokenDestinations;\\n\\n address public masterCopy;\\n IERC20 private _token;\\n\\n // -- Events --\\n\\n event MasterCopyUpdated(address indexed masterCopy);\\n event TokenLockCreated(\\n address indexed contractAddress,\\n bytes32 indexed initHash,\\n address indexed beneficiary,\\n address token,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n uint256 periods,\\n uint256 releaseStartTime,\\n uint256 vestingCliffTime,\\n IGraphTokenLock.Revocability revocable\\n );\\n\\n event TokensDeposited(address indexed sender, uint256 amount);\\n event TokensWithdrawn(address indexed sender, uint256 amount);\\n\\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\\n event TokenDestinationAllowed(address indexed dst, bool allowed);\\n\\n /**\\n * Constructor.\\n * @param _graphToken Token to use for deposits and withdrawals\\n * @param _masterCopy Address of the master copy to use to clone proxies\\n */\\n constructor(IERC20 _graphToken, address _masterCopy) {\\n require(address(_graphToken) != address(0), \\\"Token cannot be zero\\\");\\n _token = _graphToken;\\n setMasterCopy(_masterCopy);\\n }\\n\\n // -- Factory --\\n\\n /**\\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\\n * @param _masterCopy Address of contract bytecode to factory clone\\n */\\n function setMasterCopy(address _masterCopy) public override onlyOwner {\\n require(_masterCopy != address(0), \\\"MasterCopy cannot be zero\\\");\\n masterCopy = _masterCopy;\\n emit MasterCopyUpdated(_masterCopy);\\n }\\n\\n /**\\n * @notice Creates and fund a new token lock wallet using a minimum proxy\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _revocable Whether the contract is revocable\\n */\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external override onlyOwner {\\n require(_token.balanceOf(address(this)) >= _managedAmount, \\\"Not enough tokens to create lock\\\");\\n\\n // Create contract using a minimal proxy and call initializer\\n bytes memory initializer = abi.encodeWithSignature(\\n \\\"initialize(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\\\",\\n address(this),\\n _owner,\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _managedAmount);\\n\\n emit TokenLockCreated(\\n contractAddress,\\n keccak256(initializer),\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n }\\n\\n // -- Funds Management --\\n\\n /**\\n * @notice Gets the GRT token address\\n * @return Token used for transfers and approvals\\n */\\n function token() external view override returns (IERC20) {\\n return _token;\\n }\\n\\n /**\\n * @notice Deposits tokens into the contract\\n * @dev Even if the ERC20 token can be transferred directly to the contract\\n * this function provide a safe interface to do the transfer and avoid mistakes\\n * @param _amount Amount to deposit\\n */\\n function deposit(uint256 _amount) external override {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransferFrom(msg.sender, address(this), _amount);\\n emit TokensDeposited(msg.sender, _amount);\\n }\\n\\n /**\\n * @notice Withdraws tokens from the contract\\n * @dev Escape hatch in case of mistakes or to recover remaining funds\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdraw(uint256 _amount) external override onlyOwner {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransfer(msg.sender, _amount);\\n emit TokensWithdrawn(msg.sender, _amount);\\n }\\n\\n // -- Token Destinations --\\n\\n /**\\n * @notice Adds an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function addTokenDestination(address _dst) external override onlyOwner {\\n require(_dst != address(0), \\\"Destination cannot be zero\\\");\\n require(_tokenDestinations.add(_dst), \\\"Destination already added\\\");\\n emit TokenDestinationAllowed(_dst, true);\\n }\\n\\n /**\\n * @notice Removes an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function removeTokenDestination(address _dst) external override onlyOwner {\\n require(_tokenDestinations.remove(_dst), \\\"Destination already removed\\\");\\n emit TokenDestinationAllowed(_dst, false);\\n }\\n\\n /**\\n * @notice Returns True if the address is authorized to be a destination of tokens\\n * @param _dst Destination address\\n * @return True if authorized\\n */\\n function isTokenDestination(address _dst) external view override returns (bool) {\\n return _tokenDestinations.contains(_dst);\\n }\\n\\n /**\\n * @notice Returns an array of authorized destination addresses\\n * @return Array of addresses authorized to pull funds from a token lock\\n */\\n function getTokenDestinations() external view override returns (address[] memory) {\\n address[] memory dstList = new address[](_tokenDestinations.length());\\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\\n dstList[i] = _tokenDestinations.at(i);\\n }\\n return dstList;\\n }\\n\\n // -- Function Call Authorization --\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\\n _setAuthFunctionCall(_signature, _target);\\n }\\n\\n /**\\n * @notice Unsets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n */\\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = address(0);\\n\\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target in bulk\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signatures Function signatures\\n * @param _targets Address of the destination contract to call\\n */\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets)\\n external\\n override\\n onlyOwner\\n {\\n require(_signatures.length == _targets.length, \\\"Array length mismatch\\\");\\n\\n for (uint256 i = 0; i < _signatures.length; i++) {\\n _setAuthFunctionCall(_signatures[i], _targets[i]);\\n }\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\\n require(_target != address(this), \\\"Target must be other contract\\\");\\n require(Address.isContract(_target), \\\"Target must be a contract\\\");\\n\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = _target;\\n\\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\\n }\\n\\n /**\\n * @notice Gets the target contract to call for a particular function signature\\n * @param _sigHash Function signature hash\\n * @return Address of the target contract where to send the call\\n */\\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\\n return authFnCalls[_sigHash];\\n }\\n\\n /**\\n * @notice Returns true if the function call is authorized\\n * @param _sigHash Function signature hash\\n * @return True if authorized\\n */\\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\\n return getAuthFunctionCallTarget(_sigHash) != address(0);\\n }\\n\\n /**\\n * @dev Converts a function signature string to 4-bytes hash\\n * @param _signature Function signature string\\n * @return Function signature hash\\n */\\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\\n return _convertToBytes4(abi.encodeWithSignature(_signature));\\n }\\n\\n /**\\n * @dev Converts function signature bytes to function signature hash (bytes4)\\n * @param _signature Function signature\\n * @return Function signature in bytes4\\n */\\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\\n require(_signature.length == 4, \\\"Invalid method signature\\\");\\n bytes4 sigHash;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n sigHash := mload(add(_signature, 32))\\n }\\n return sigHash;\\n }\\n}\\n\",\"keccak256\":\"0x0384d62cb600eb4128baacf5bca60ea2cb0b68d2d013479daef65ed5f15446ef\",\"license\":\"MIT\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/MinimalProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Create2.sol\\\";\\n\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\\n// Based on https://eips.ethereum.org/EIPS/eip-1167\\ncontract MinimalProxyFactory is Ownable {\\n // -- Events --\\n\\n event ProxyCreated(address indexed proxy);\\n\\n /**\\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @return Address of the counterfactual MinimalProxy\\n */\\n function getDeploymentAddress(bytes32 _salt, address _implementation) external view returns (address) {\\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), address(this));\\n }\\n\\n /**\\n * @notice Deploys a MinimalProxy with CREATE2\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _data Bytes with the initializer call\\n * @return Address of the deployed MinimalProxy\\n */\\n function _deployProxy2(\\n bytes32 _salt,\\n address _implementation,\\n bytes memory _data\\n ) internal returns (address) {\\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\\n\\n emit ProxyCreated(proxyAddress);\\n\\n // Call function with data\\n if (_data.length > 0) {\\n Address.functionCall(proxyAddress, _data);\\n }\\n\\n return proxyAddress;\\n }\\n\\n /**\\n * @notice Gets the MinimalProxy bytecode\\n * @param _implementation Address of the proxy target implementation\\n * @return MinimalProxy bytecode\\n */\\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\\n bytes10 creation = 0x3d602d80600a3d3981f3;\\n bytes10 prefix = 0x363d3d373d3d3d363d73;\\n bytes20 targetBytes = bytes20(_implementation);\\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\\n }\\n}\\n\",\"keccak256\":\"0x8aa3d50e714f92dc0ed6cc6d88fa8a18c948493103928f6092f98815b2c046ca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162003c9338038062003c9383398181016040528101906200003791906200039c565b600062000049620001b460201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156200015a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200015190620004e7565b60405180910390fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550620001ac81620001bc60201b60201c565b505062000596565b600033905090565b620001cc620001b460201b60201c565b73ffffffffffffffffffffffffffffffffffffffff16620001f26200034560201b60201c565b73ffffffffffffffffffffffffffffffffffffffff16146200024b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200024290620004c5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415620002be576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002b590620004a3565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000815190506200037f8162000562565b92915050565b60008151905062000396816200057c565b92915050565b60008060408385031215620003b057600080fd5b6000620003c08582860162000385565b9250506020620003d3858286016200036e565b9150509250929050565b6000620003ec60198362000509565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b60006200042e60208362000509565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006200047060148362000509565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b60006020820190508181036000830152620004be81620003dd565b9050919050565b60006020820190508181036000830152620004e0816200041f565b9050919050565b60006020820190508181036000830152620005028162000461565b9050919050565b600082825260208201905092915050565b6000620005278262000542565b9050919050565b60006200053b826200051a565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6200056d816200051a565b81146200057957600080fd5b50565b62000587816200052e565b81146200059357600080fd5b50565b6136ed80620005a66000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c80639c05fc60116100ad578063c1ab13db11610071578063c1ab13db14610319578063cf497e6c14610335578063f1d24c4514610351578063f2fde38b14610381578063fc0c546a1461039d5761012c565b80639c05fc6014610275578063a345746614610291578063a619486e146102af578063b6b55f25146102cd578063bdb62fbe146102e95761012c565b806368d30c2e116100f457806368d30c2e146101d15780636e03b8dc146101ed578063715018a61461021d57806379ee1bdf146102275780638da5cb5b146102575761012c565b806303990a6c146101315780630602ba2b1461014d5780632e1a7d4d1461017d578063463013a2146101995780635975e00c146101b5575b600080fd5b61014b6004803603810190610146919061253e565b6103bb565b005b61016760048036038101906101629190612515565b610563565b604051610174919061302d565b60405180910390f35b610197600480360381019061019291906125db565b6105a4565b005b6101b360048036038101906101ae9190612583565b610701565b005b6101cf60048036038101906101ca919061234c565b61078d565b005b6101eb60048036038101906101e69190612375565b61091e565b005b61020760048036038101906102029190612515565b610c7e565b6040516102149190612e67565b60405180910390f35b610225610cb1565b005b610241600480360381019061023c919061234c565b610deb565b60405161024e919061302d565b60405180910390f35b61025f610e08565b60405161026c9190612e67565b60405180910390f35b61028f600480360381019061028a919061243b565b610e31565b005b610299610f5e565b6040516102a6919061300b565b60405180910390f35b6102b7611036565b6040516102c49190612e67565b60405180910390f35b6102e760048036038101906102e291906125db565b61105c565b005b61030360048036038101906102fe91906124d9565b61113f565b6040516103109190612e67565b60405180910390f35b610333600480360381019061032e919061234c565b611163565b005b61034f600480360381019061034a919061234c565b611284565b005b61036b60048036038101906103669190612515565b6113f7565b6040516103789190612e67565b60405180910390f35b61039b6004803603810190610396919061234c565b611472565b005b6103a561161b565b6040516103b29190613048565b60405180910390f35b6103c3611645565b73ffffffffffffffffffffffffffffffffffffffff166103e1610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610437576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042e90613229565b60405180910390fd5b6000610443838361164d565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98686604051610556929190613063565b60405180910390a4505050565b60008073ffffffffffffffffffffffffffffffffffffffff16610585836113f7565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6105ac611645565b73ffffffffffffffffffffffffffffffffffffffff166105ca610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610620576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061790613229565b60405180910390fd5b60008111610663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065a90613209565b60405180910390fd5b6106b03382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116db9092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040516106f69190613309565b60405180910390a250565b610709611645565b73ffffffffffffffffffffffffffffffffffffffff16610727610e08565b73ffffffffffffffffffffffffffffffffffffffff161461077d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077490613229565b60405180910390fd5b610788838383611761565b505050565b610795611645565b73ffffffffffffffffffffffffffffffffffffffff166107b3610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610809576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080090613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610879576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087090613109565b60405180910390fd5b61088d81600261194390919063ffffffff16565b6108cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c390613269565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610913919061302d565b60405180910390a250565b610926611645565b73ffffffffffffffffffffffffffffffffffffffff16610944610e08565b73ffffffffffffffffffffffffffffffffffffffff161461099a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099190613229565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109f69190612e67565b60206040518083038186803b158015610a0e57600080fd5b505afa158015610a22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a469190612604565b1015610a87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7e90613149565b60405180910390fd5b6060308a8a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168b8b8b8b8b8b8b604051602401610ad09b9a99989796959493929190612e82565b6040516020818303038152906040527fbd896dcb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610b858280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611973565b9050610bd4818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116db9092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610c69989796959493929190612f8d565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610cb9611645565b73ffffffffffffffffffffffffffffffffffffffff16610cd7610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610d2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2490613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610e018260026119ef90919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610e39611645565b73ffffffffffffffffffffffffffffffffffffffff16610e57610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610ead576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea490613229565b60405180910390fd5b818190508484905014610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec906130e9565b60405180910390fd5b60005b84849050811015610f5757610f4a858583818110610f1257fe5b9050602002810190610f249190613324565b858585818110610f3057fe5b9050602002016020810190610f45919061234c565b611761565b8080600101915050610ef8565b5050505050565b606080610f6b6002611a1f565b67ffffffffffffffff81118015610f8157600080fd5b50604051908082528060200260200182016040528015610fb05781602001602082028036833780820191505090505b50905060005b610fc06002611a1f565b81101561102e57610fdb816002611a3490919063ffffffff16565b828281518110610fe757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050610fb6565b508091505090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000811161109f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109690613209565b60405180910390fd5b6110ee333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611a4e909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516111349190613309565b60405180910390a250565b600061115b8361114e84611ad7565b8051906020012030611b4d565b905092915050565b61116b611645565b73ffffffffffffffffffffffffffffffffffffffff16611189610e08565b73ffffffffffffffffffffffffffffffffffffffff16146111df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d690613229565b60405180910390fd5b6111f3816002611b9190919063ffffffff16565b611232576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122990613189565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796000604051611279919061302d565b60405180910390a250565b61128c611645565b73ffffffffffffffffffffffffffffffffffffffff166112aa610e08565b73ffffffffffffffffffffffffffffffffffffffff1614611300576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f790613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611370576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611367906131a9565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61147a611645565b73ffffffffffffffffffffffffffffffffffffffff16611498610e08565b73ffffffffffffffffffffffffffffffffffffffff16146114ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e590613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561155e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155590613129565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b60006116d383836040516024016040516020818303038152906040529190604051611679929190612e4e565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611bc1565b905092915050565b61175c8363a9059cbb60e01b84846040516024016116fa929190612f64565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c19565b505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156117d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117c7906131c9565b60405180910390fd5b6117d981611ce0565b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f906132e9565b60405180910390fd5b6000611824848461164d565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98787604051611935929190613063565b60405180910390a450505050565b600061196b836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611cf3565b905092915050565b60008061198a60008661198587611ad7565b611d63565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a26000835111156119e4576119e28184611e74565b505b809150509392505050565b6000611a17836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ebe565b905092915050565b6000611a2d82600001611ee1565b9050919050565b6000611a438360000183611ef2565b60001c905092915050565b611ad1846323b872dd60e01b858585604051602401611a6f93929190612f2d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c19565b50505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611b339493929190612d9b565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611b6b9493929190612de9565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b6000611bb9836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611f5f565b905092915050565b60006004825114611c07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bfe90613249565b60405180910390fd5b60006020830151905080915050919050565b6060611c7b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166120479092919063ffffffff16565b9050600081511115611cdb5780806020019051810190611c9b91906124b0565b611cda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd1906132a9565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b6000611cff8383611ebe565b611d58578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611d5d565b600090505b92915050565b60008084471015611da9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da0906132c9565b60405180910390fd5b600083511415611dee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de5906130c9565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611e69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e60906131e9565b60405180910390fd5b809150509392505050565b6060611eb683836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612047565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011611f3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f34906130a9565b60405180910390fd5b826000018281548110611f4c57fe5b9060005260206000200154905092915050565b6000808360010160008481526020019081526020016000205490506000811461203b5760006001820390506000600186600001805490500390506000866000018281548110611faa57fe5b9060005260206000200154905080876000018481548110611fc757fe5b9060005260206000200181905550600183018760010160008381526020019081526020016000208190555086600001805480611fff57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612041565b60009150505b92915050565b6060612056848460008561205f565b90509392505050565b6060824710156120a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209b90613169565b60405180910390fd5b6120ad85611ce0565b6120ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e390613289565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516121169190612e37565b60006040518083038185875af1925050503d8060008114612153576040519150601f19603f3d011682016040523d82523d6000602084013e612158565b606091505b5091509150612168828286612174565b92505050949350505050565b60608315612184578290506121d4565b6000835111156121975782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121cb9190613087565b60405180910390fd5b9392505050565b6000813590506121ea81613634565b92915050565b60008083601f84011261220257600080fd5b8235905067ffffffffffffffff81111561221b57600080fd5b60208301915083602082028301111561223357600080fd5b9250929050565b60008083601f84011261224c57600080fd5b8235905067ffffffffffffffff81111561226557600080fd5b60208301915083602082028301111561227d57600080fd5b9250929050565b6000815190506122938161364b565b92915050565b6000813590506122a881613662565b92915050565b6000813590506122bd81613679565b92915050565b6000813590506122d281613690565b92915050565b60008083601f8401126122ea57600080fd5b8235905067ffffffffffffffff81111561230357600080fd5b60208301915083600182028301111561231b57600080fd5b9250929050565b600081359050612331816136a0565b92915050565b600081519050612346816136a0565b92915050565b60006020828403121561235e57600080fd5b600061236c848285016121db565b91505092915050565b60008060008060008060008060006101208a8c03121561239457600080fd5b60006123a28c828d016121db565b99505060206123b38c828d016121db565b98505060406123c48c828d01612322565b97505060606123d58c828d01612322565b96505060806123e68c828d01612322565b95505060a06123f78c828d01612322565b94505060c06124088c828d01612322565b93505060e06124198c828d01612322565b92505061010061242b8c828d016122c3565b9150509295985092959850929598565b6000806000806040858703121561245157600080fd5b600085013567ffffffffffffffff81111561246b57600080fd5b6124778782880161223a565b9450945050602085013567ffffffffffffffff81111561249657600080fd5b6124a2878288016121f0565b925092505092959194509250565b6000602082840312156124c257600080fd5b60006124d084828501612284565b91505092915050565b600080604083850312156124ec57600080fd5b60006124fa85828601612299565b925050602061250b858286016121db565b9150509250929050565b60006020828403121561252757600080fd5b6000612535848285016122ae565b91505092915050565b6000806020838503121561255157600080fd5b600083013567ffffffffffffffff81111561256b57600080fd5b612577858286016122d8565b92509250509250929050565b60008060006040848603121561259857600080fd5b600084013567ffffffffffffffff8111156125b257600080fd5b6125be868287016122d8565b935093505060206125d1868287016121db565b9150509250925092565b6000602082840312156125ed57600080fd5b60006125fb84828501612322565b91505092915050565b60006020828403121561261657600080fd5b600061262484828501612337565b91505092915050565b60006126398383612645565b60208301905092915050565b61264e816133f1565b82525050565b61265d816133f1565b82525050565b61267461266f826133f1565b6135aa565b82525050565b60006126858261338b565b61268f81856133b9565b935061269a8361337b565b8060005b838110156126cb5781516126b2888261262d565b97506126bd836133ac565b92505060018101905061269e565b5085935050505092915050565b6126e181613403565b82525050565b6126f86126f38261343b565b6135c6565b82525050565b61270f61270a82613467565b6135d0565b82525050565b6127266127218261340f565b6135bc565b82525050565b61273d61273882613493565b6135da565b82525050565b61275461274f826134bf565b6135e4565b82525050565b600061276582613396565b61276f81856133ca565b935061277f818560208601613577565b80840191505092915050565b61279481613532565b82525050565b6127a381613556565b82525050565b60006127b583856133d5565b93506127c2838584613568565b6127cb83613602565b840190509392505050565b60006127e283856133e6565b93506127ef838584613568565b82840190509392505050565b6000612806826133a1565b61281081856133d5565b9350612820818560208601613577565b61282981613602565b840191505092915050565b60006128416022836133d5565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006128a76020836133d5565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b60006128e76015836133d5565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000612927601a836133d5565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006129676026836133d5565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006129cd6020836133d5565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b6000612a0d6026836133d5565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612a73601b836133d5565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000612ab36019836133d5565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000612af3601d836133d5565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b6000612b336019836133d5565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000612b736015836133d5565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000612bb36020836133d5565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000612bf36018836133d5565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b6000612c336019836133d5565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000612c73601d836133d5565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000612cb3602a836133d5565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000612d19601d836133d5565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b6000612d596019836133d5565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b612d9581613528565b82525050565b6000612da782876126e7565b600a82019150612db782866126e7565b600a82019150612dc7828561272c565b601482019150612dd782846126fe565b600f8201915081905095945050505050565b6000612df58287612715565b600182019150612e058286612663565b601482019150612e158285612743565b602082019150612e258284612743565b60208201915081905095945050505050565b6000612e43828461275a565b915081905092915050565b6000612e5b8284866127d6565b91508190509392505050565b6000602082019050612e7c6000830184612654565b92915050565b600061016082019050612e98600083018e612654565b612ea5602083018d612654565b612eb2604083018c612654565b612ebf606083018b612654565b612ecc608083018a612d8c565b612ed960a0830189612d8c565b612ee660c0830188612d8c565b612ef360e0830187612d8c565b612f01610100830186612d8c565b612f0f610120830185612d8c565b612f1d61014083018461279a565b9c9b505050505050505050505050565b6000606082019050612f426000830186612654565b612f4f6020830185612654565b612f5c6040830184612d8c565b949350505050565b6000604082019050612f796000830185612654565b612f866020830184612d8c565b9392505050565b600061010082019050612fa3600083018b612654565b612fb0602083018a612d8c565b612fbd6040830189612d8c565b612fca6060830188612d8c565b612fd76080830187612d8c565b612fe460a0830186612d8c565b612ff160c0830185612d8c565b612ffe60e083018461279a565b9998505050505050505050565b60006020820190508181036000830152613025818461267a565b905092915050565b600060208201905061304260008301846126d8565b92915050565b600060208201905061305d600083018461278b565b92915050565b6000602082019050818103600083015261307e8184866127a9565b90509392505050565b600060208201905081810360008301526130a181846127fb565b905092915050565b600060208201905081810360008301526130c281612834565b9050919050565b600060208201905081810360008301526130e28161289a565b9050919050565b60006020820190508181036000830152613102816128da565b9050919050565b600060208201905081810360008301526131228161291a565b9050919050565b600060208201905081810360008301526131428161295a565b9050919050565b60006020820190508181036000830152613162816129c0565b9050919050565b6000602082019050818103600083015261318281612a00565b9050919050565b600060208201905081810360008301526131a281612a66565b9050919050565b600060208201905081810360008301526131c281612aa6565b9050919050565b600060208201905081810360008301526131e281612ae6565b9050919050565b6000602082019050818103600083015261320281612b26565b9050919050565b6000602082019050818103600083015261322281612b66565b9050919050565b6000602082019050818103600083015261324281612ba6565b9050919050565b6000602082019050818103600083015261326281612be6565b9050919050565b6000602082019050818103600083015261328281612c26565b9050919050565b600060208201905081810360008301526132a281612c66565b9050919050565b600060208201905081810360008301526132c281612ca6565b9050919050565b600060208201905081810360008301526132e281612d0c565b9050919050565b6000602082019050818103600083015261330281612d4c565b9050919050565b600060208201905061331e6000830184612d8c565b92915050565b6000808335600160200384360303811261333d57600080fd5b80840192508235915067ffffffffffffffff82111561335b57600080fd5b60208301925060018202360383131561337357600080fd5b509250929050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006133fc82613508565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061350382613620565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061353d82613544565b9050919050565b600061354f82613508565b9050919050565b6000613561826134f5565b9050919050565b82818337600083830152505050565b60005b8381101561359557808201518184015260208101905061357a565b838111156135a4576000848401525b50505050565b60006135b5826135ee565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b60006135f982613613565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061363157613630613600565b5b50565b61363d816133f1565b811461364857600080fd5b50565b61365481613403565b811461365f57600080fd5b50565b61366b816134bf565b811461367657600080fd5b50565b613682816134c9565b811461368d57600080fd5b50565b6003811061369d57600080fd5b50565b6136a981613528565b81146136b457600080fd5b5056fea26469706673582212202d3d549e01583bc5460844b73df152769c2a77e8b1ca88724d847dbd95e3af7964736f6c63430007030033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80639c05fc60116100ad578063c1ab13db11610071578063c1ab13db14610319578063cf497e6c14610335578063f1d24c4514610351578063f2fde38b14610381578063fc0c546a1461039d5761012c565b80639c05fc6014610275578063a345746614610291578063a619486e146102af578063b6b55f25146102cd578063bdb62fbe146102e95761012c565b806368d30c2e116100f457806368d30c2e146101d15780636e03b8dc146101ed578063715018a61461021d57806379ee1bdf146102275780638da5cb5b146102575761012c565b806303990a6c146101315780630602ba2b1461014d5780632e1a7d4d1461017d578063463013a2146101995780635975e00c146101b5575b600080fd5b61014b6004803603810190610146919061253e565b6103bb565b005b61016760048036038101906101629190612515565b610563565b604051610174919061302d565b60405180910390f35b610197600480360381019061019291906125db565b6105a4565b005b6101b360048036038101906101ae9190612583565b610701565b005b6101cf60048036038101906101ca919061234c565b61078d565b005b6101eb60048036038101906101e69190612375565b61091e565b005b61020760048036038101906102029190612515565b610c7e565b6040516102149190612e67565b60405180910390f35b610225610cb1565b005b610241600480360381019061023c919061234c565b610deb565b60405161024e919061302d565b60405180910390f35b61025f610e08565b60405161026c9190612e67565b60405180910390f35b61028f600480360381019061028a919061243b565b610e31565b005b610299610f5e565b6040516102a6919061300b565b60405180910390f35b6102b7611036565b6040516102c49190612e67565b60405180910390f35b6102e760048036038101906102e291906125db565b61105c565b005b61030360048036038101906102fe91906124d9565b61113f565b6040516103109190612e67565b60405180910390f35b610333600480360381019061032e919061234c565b611163565b005b61034f600480360381019061034a919061234c565b611284565b005b61036b60048036038101906103669190612515565b6113f7565b6040516103789190612e67565b60405180910390f35b61039b6004803603810190610396919061234c565b611472565b005b6103a561161b565b6040516103b29190613048565b60405180910390f35b6103c3611645565b73ffffffffffffffffffffffffffffffffffffffff166103e1610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610437576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042e90613229565b60405180910390fd5b6000610443838361164d565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98686604051610556929190613063565b60405180910390a4505050565b60008073ffffffffffffffffffffffffffffffffffffffff16610585836113f7565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6105ac611645565b73ffffffffffffffffffffffffffffffffffffffff166105ca610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610620576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061790613229565b60405180910390fd5b60008111610663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065a90613209565b60405180910390fd5b6106b03382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116db9092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b826040516106f69190613309565b60405180910390a250565b610709611645565b73ffffffffffffffffffffffffffffffffffffffff16610727610e08565b73ffffffffffffffffffffffffffffffffffffffff161461077d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077490613229565b60405180910390fd5b610788838383611761565b505050565b610795611645565b73ffffffffffffffffffffffffffffffffffffffff166107b3610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610809576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080090613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610879576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087090613109565b60405180910390fd5b61088d81600261194390919063ffffffff16565b6108cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c390613269565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610913919061302d565b60405180910390a250565b610926611645565b73ffffffffffffffffffffffffffffffffffffffff16610944610e08565b73ffffffffffffffffffffffffffffffffffffffff161461099a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099190613229565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109f69190612e67565b60206040518083038186803b158015610a0e57600080fd5b505afa158015610a22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a469190612604565b1015610a87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7e90613149565b60405180910390fd5b6060308a8a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168b8b8b8b8b8b8b604051602401610ad09b9a99989796959493929190612e82565b6040516020818303038152906040527fbd896dcb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610b858280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611973565b9050610bd4818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116db9092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610c69989796959493929190612f8d565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610cb9611645565b73ffffffffffffffffffffffffffffffffffffffff16610cd7610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610d2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2490613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610e018260026119ef90919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610e39611645565b73ffffffffffffffffffffffffffffffffffffffff16610e57610e08565b73ffffffffffffffffffffffffffffffffffffffff1614610ead576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea490613229565b60405180910390fd5b818190508484905014610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec906130e9565b60405180910390fd5b60005b84849050811015610f5757610f4a858583818110610f1257fe5b9050602002810190610f249190613324565b858585818110610f3057fe5b9050602002016020810190610f45919061234c565b611761565b8080600101915050610ef8565b5050505050565b606080610f6b6002611a1f565b67ffffffffffffffff81118015610f8157600080fd5b50604051908082528060200260200182016040528015610fb05781602001602082028036833780820191505090505b50905060005b610fc06002611a1f565b81101561102e57610fdb816002611a3490919063ffffffff16565b828281518110610fe757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050610fb6565b508091505090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000811161109f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109690613209565b60405180910390fd5b6110ee333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611a4e909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516111349190613309565b60405180910390a250565b600061115b8361114e84611ad7565b8051906020012030611b4d565b905092915050565b61116b611645565b73ffffffffffffffffffffffffffffffffffffffff16611189610e08565b73ffffffffffffffffffffffffffffffffffffffff16146111df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d690613229565b60405180910390fd5b6111f3816002611b9190919063ffffffff16565b611232576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122990613189565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796000604051611279919061302d565b60405180910390a250565b61128c611645565b73ffffffffffffffffffffffffffffffffffffffff166112aa610e08565b73ffffffffffffffffffffffffffffffffffffffff1614611300576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f790613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611370576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611367906131a9565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61147a611645565b73ffffffffffffffffffffffffffffffffffffffff16611498610e08565b73ffffffffffffffffffffffffffffffffffffffff16146114ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e590613229565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561155e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155590613129565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b60006116d383836040516024016040516020818303038152906040529190604051611679929190612e4e565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611bc1565b905092915050565b61175c8363a9059cbb60e01b84846040516024016116fa929190612f64565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c19565b505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156117d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117c7906131c9565b60405180910390fd5b6117d981611ce0565b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f906132e9565b60405180910390fd5b6000611824848461164d565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98787604051611935929190613063565b60405180910390a450505050565b600061196b836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611cf3565b905092915050565b60008061198a60008661198587611ad7565b611d63565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a26000835111156119e4576119e28184611e74565b505b809150509392505050565b6000611a17836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ebe565b905092915050565b6000611a2d82600001611ee1565b9050919050565b6000611a438360000183611ef2565b60001c905092915050565b611ad1846323b872dd60e01b858585604051602401611a6f93929190612f2d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c19565b50505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611b339493929190612d9b565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611b6b9493929190612de9565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b6000611bb9836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611f5f565b905092915050565b60006004825114611c07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bfe90613249565b60405180910390fd5b60006020830151905080915050919050565b6060611c7b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166120479092919063ffffffff16565b9050600081511115611cdb5780806020019051810190611c9b91906124b0565b611cda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd1906132a9565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b6000611cff8383611ebe565b611d58578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611d5d565b600090505b92915050565b60008084471015611da9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da0906132c9565b60405180910390fd5b600083511415611dee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de5906130c9565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611e69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e60906131e9565b60405180910390fd5b809150509392505050565b6060611eb683836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612047565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011611f3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f34906130a9565b60405180910390fd5b826000018281548110611f4c57fe5b9060005260206000200154905092915050565b6000808360010160008481526020019081526020016000205490506000811461203b5760006001820390506000600186600001805490500390506000866000018281548110611faa57fe5b9060005260206000200154905080876000018481548110611fc757fe5b9060005260206000200181905550600183018760010160008381526020019081526020016000208190555086600001805480611fff57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612041565b60009150505b92915050565b6060612056848460008561205f565b90509392505050565b6060824710156120a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209b90613169565b60405180910390fd5b6120ad85611ce0565b6120ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e390613289565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516121169190612e37565b60006040518083038185875af1925050503d8060008114612153576040519150601f19603f3d011682016040523d82523d6000602084013e612158565b606091505b5091509150612168828286612174565b92505050949350505050565b60608315612184578290506121d4565b6000835111156121975782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121cb9190613087565b60405180910390fd5b9392505050565b6000813590506121ea81613634565b92915050565b60008083601f84011261220257600080fd5b8235905067ffffffffffffffff81111561221b57600080fd5b60208301915083602082028301111561223357600080fd5b9250929050565b60008083601f84011261224c57600080fd5b8235905067ffffffffffffffff81111561226557600080fd5b60208301915083602082028301111561227d57600080fd5b9250929050565b6000815190506122938161364b565b92915050565b6000813590506122a881613662565b92915050565b6000813590506122bd81613679565b92915050565b6000813590506122d281613690565b92915050565b60008083601f8401126122ea57600080fd5b8235905067ffffffffffffffff81111561230357600080fd5b60208301915083600182028301111561231b57600080fd5b9250929050565b600081359050612331816136a0565b92915050565b600081519050612346816136a0565b92915050565b60006020828403121561235e57600080fd5b600061236c848285016121db565b91505092915050565b60008060008060008060008060006101208a8c03121561239457600080fd5b60006123a28c828d016121db565b99505060206123b38c828d016121db565b98505060406123c48c828d01612322565b97505060606123d58c828d01612322565b96505060806123e68c828d01612322565b95505060a06123f78c828d01612322565b94505060c06124088c828d01612322565b93505060e06124198c828d01612322565b92505061010061242b8c828d016122c3565b9150509295985092959850929598565b6000806000806040858703121561245157600080fd5b600085013567ffffffffffffffff81111561246b57600080fd5b6124778782880161223a565b9450945050602085013567ffffffffffffffff81111561249657600080fd5b6124a2878288016121f0565b925092505092959194509250565b6000602082840312156124c257600080fd5b60006124d084828501612284565b91505092915050565b600080604083850312156124ec57600080fd5b60006124fa85828601612299565b925050602061250b858286016121db565b9150509250929050565b60006020828403121561252757600080fd5b6000612535848285016122ae565b91505092915050565b6000806020838503121561255157600080fd5b600083013567ffffffffffffffff81111561256b57600080fd5b612577858286016122d8565b92509250509250929050565b60008060006040848603121561259857600080fd5b600084013567ffffffffffffffff8111156125b257600080fd5b6125be868287016122d8565b935093505060206125d1868287016121db565b9150509250925092565b6000602082840312156125ed57600080fd5b60006125fb84828501612322565b91505092915050565b60006020828403121561261657600080fd5b600061262484828501612337565b91505092915050565b60006126398383612645565b60208301905092915050565b61264e816133f1565b82525050565b61265d816133f1565b82525050565b61267461266f826133f1565b6135aa565b82525050565b60006126858261338b565b61268f81856133b9565b935061269a8361337b565b8060005b838110156126cb5781516126b2888261262d565b97506126bd836133ac565b92505060018101905061269e565b5085935050505092915050565b6126e181613403565b82525050565b6126f86126f38261343b565b6135c6565b82525050565b61270f61270a82613467565b6135d0565b82525050565b6127266127218261340f565b6135bc565b82525050565b61273d61273882613493565b6135da565b82525050565b61275461274f826134bf565b6135e4565b82525050565b600061276582613396565b61276f81856133ca565b935061277f818560208601613577565b80840191505092915050565b61279481613532565b82525050565b6127a381613556565b82525050565b60006127b583856133d5565b93506127c2838584613568565b6127cb83613602565b840190509392505050565b60006127e283856133e6565b93506127ef838584613568565b82840190509392505050565b6000612806826133a1565b61281081856133d5565b9350612820818560208601613577565b61282981613602565b840191505092915050565b60006128416022836133d5565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006128a76020836133d5565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b60006128e76015836133d5565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000612927601a836133d5565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006129676026836133d5565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006129cd6020836133d5565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b6000612a0d6026836133d5565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612a73601b836133d5565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000612ab36019836133d5565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000612af3601d836133d5565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b6000612b336019836133d5565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000612b736015836133d5565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000612bb36020836133d5565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000612bf36018836133d5565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b6000612c336019836133d5565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000612c73601d836133d5565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000612cb3602a836133d5565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000612d19601d836133d5565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b6000612d596019836133d5565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b612d9581613528565b82525050565b6000612da782876126e7565b600a82019150612db782866126e7565b600a82019150612dc7828561272c565b601482019150612dd782846126fe565b600f8201915081905095945050505050565b6000612df58287612715565b600182019150612e058286612663565b601482019150612e158285612743565b602082019150612e258284612743565b60208201915081905095945050505050565b6000612e43828461275a565b915081905092915050565b6000612e5b8284866127d6565b91508190509392505050565b6000602082019050612e7c6000830184612654565b92915050565b600061016082019050612e98600083018e612654565b612ea5602083018d612654565b612eb2604083018c612654565b612ebf606083018b612654565b612ecc608083018a612d8c565b612ed960a0830189612d8c565b612ee660c0830188612d8c565b612ef360e0830187612d8c565b612f01610100830186612d8c565b612f0f610120830185612d8c565b612f1d61014083018461279a565b9c9b505050505050505050505050565b6000606082019050612f426000830186612654565b612f4f6020830185612654565b612f5c6040830184612d8c565b949350505050565b6000604082019050612f796000830185612654565b612f866020830184612d8c565b9392505050565b600061010082019050612fa3600083018b612654565b612fb0602083018a612d8c565b612fbd6040830189612d8c565b612fca6060830188612d8c565b612fd76080830187612d8c565b612fe460a0830186612d8c565b612ff160c0830185612d8c565b612ffe60e083018461279a565b9998505050505050505050565b60006020820190508181036000830152613025818461267a565b905092915050565b600060208201905061304260008301846126d8565b92915050565b600060208201905061305d600083018461278b565b92915050565b6000602082019050818103600083015261307e8184866127a9565b90509392505050565b600060208201905081810360008301526130a181846127fb565b905092915050565b600060208201905081810360008301526130c281612834565b9050919050565b600060208201905081810360008301526130e28161289a565b9050919050565b60006020820190508181036000830152613102816128da565b9050919050565b600060208201905081810360008301526131228161291a565b9050919050565b600060208201905081810360008301526131428161295a565b9050919050565b60006020820190508181036000830152613162816129c0565b9050919050565b6000602082019050818103600083015261318281612a00565b9050919050565b600060208201905081810360008301526131a281612a66565b9050919050565b600060208201905081810360008301526131c281612aa6565b9050919050565b600060208201905081810360008301526131e281612ae6565b9050919050565b6000602082019050818103600083015261320281612b26565b9050919050565b6000602082019050818103600083015261322281612b66565b9050919050565b6000602082019050818103600083015261324281612ba6565b9050919050565b6000602082019050818103600083015261326281612be6565b9050919050565b6000602082019050818103600083015261328281612c26565b9050919050565b600060208201905081810360008301526132a281612c66565b9050919050565b600060208201905081810360008301526132c281612ca6565b9050919050565b600060208201905081810360008301526132e281612d0c565b9050919050565b6000602082019050818103600083015261330281612d4c565b9050919050565b600060208201905061331e6000830184612d8c565b92915050565b6000808335600160200384360303811261333d57600080fd5b80840192508235915067ffffffffffffffff82111561335b57600080fd5b60208301925060018202360383131561337357600080fd5b509250929050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006133fc82613508565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061350382613620565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061353d82613544565b9050919050565b600061354f82613508565b9050919050565b6000613561826134f5565b9050919050565b82818337600083830152505050565b60005b8381101561359557808201518184015260208101905061357a565b838111156135a4576000848401525b50505050565b60006135b5826135ee565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b60006135f982613613565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061363157613630613600565b5b50565b61363d816133f1565b811461364857600080fd5b50565b61365481613403565b811461365f57600080fd5b50565b61366b816134bf565b811461367657600080fd5b50565b613682816134c9565b811461368d57600080fd5b50565b6003811061369d57600080fd5b50565b6136a981613528565b81146136b457600080fd5b5056fea26469706673582212202d3d549e01583bc5460844b73df152769c2a77e8b1ca88724d847dbd95e3af7964736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "addTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "constructor": { + "params": { + "_graphToken": "Token to use for deposits and withdrawals", + "_masterCopy": "Address of the master copy to use to clone proxies" + } + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "params": { + "_beneficiary": "Address of the beneficiary of locked tokens", + "_endTime": "End time of the release schedule", + "_managedAmount": "Amount of tokens to be managed by the lock contract", + "_owner": "Address of the contract owner", + "_periods": "Number of periods between start time and end time", + "_releaseStartTime": "Override time for when the releases start", + "_revocable": "Whether the contract is revocable", + "_startTime": "Start time of the release schedule" + } + }, + "deposit(uint256)": { + "details": "Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes", + "params": { + "_amount": "Amount to deposit" + } + }, + "getAuthFunctionCallTarget(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "Address of the target contract where to send the call" + } + }, + "getDeploymentAddress(bytes32,address)": { + "params": { + "_implementation": "Address of the proxy target implementation", + "_salt": "Bytes32 salt to use for CREATE2" + }, + "returns": { + "_0": "Address of the counterfactual MinimalProxy" + } + }, + "getTokenDestinations()": { + "returns": { + "_0": "Array of addresses authorized to pull funds from a token lock" + } + }, + "isAuthFunctionCall(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "True if authorized" + } + }, + "isTokenDestination(address)": { + "params": { + "_dst": "Destination address" + }, + "returns": { + "_0": "True if authorized" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "removeTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "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." + }, + "setAuthFunctionCall(string,address)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature", + "_target": "Address of the destination contract to call" + } + }, + "setAuthFunctionCallMany(string[],address[])": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signatures": "Function signatures", + "_targets": "Address of the destination contract to call" + } + }, + "setMasterCopy(address)": { + "params": { + "_masterCopy": "Address of contract bytecode to factory clone" + } + }, + "token()": { + "returns": { + "_0": "Token used for transfers and approvals" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "unsetAuthFunctionCall(string)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature" + } + }, + "withdraw(uint256)": { + "details": "Escape hatch in case of mistakes or to recover remaining funds", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "GraphTokenLockManager", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "addTokenDestination(address)": { + "notice": "Adds an address that can be allowed by a token lock to pull funds" + }, + "constructor": { + "notice": "Constructor." + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "notice": "Creates and fund a new token lock wallet using a minimum proxy" + }, + "deposit(uint256)": { + "notice": "Deposits tokens into the contract" + }, + "getAuthFunctionCallTarget(bytes4)": { + "notice": "Gets the target contract to call for a particular function signature" + }, + "getDeploymentAddress(bytes32,address)": { + "notice": "Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation" + }, + "getTokenDestinations()": { + "notice": "Returns an array of authorized destination addresses" + }, + "isAuthFunctionCall(bytes4)": { + "notice": "Returns true if the function call is authorized" + }, + "isTokenDestination(address)": { + "notice": "Returns True if the address is authorized to be a destination of tokens" + }, + "removeTokenDestination(address)": { + "notice": "Removes an address that can be allowed by a token lock to pull funds" + }, + "setAuthFunctionCall(string,address)": { + "notice": "Sets an authorized function call to target" + }, + "setAuthFunctionCallMany(string[],address[])": { + "notice": "Sets an authorized function call to target in bulk" + }, + "setMasterCopy(address)": { + "notice": "Sets the masterCopy bytecode to use to create clones of TokenLock contracts" + }, + "token()": { + "notice": "Gets the GRT token address" + }, + "unsetAuthFunctionCall(string)": { + "notice": "Unsets an authorized function call to target" + }, + "withdraw(uint256)": { + "notice": "Withdraws tokens from the contract" + } + }, + "notice": "This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 7, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 2942, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "authFnCalls", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes4,t_address)" + }, + { + "astId": 2944, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_tokenDestinations", + "offset": 0, + "slot": "2", + "type": "t_struct(AddressSet)1964_storage" + }, + { + "astId": 2946, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "masterCopy", + "offset": 0, + "slot": "4", + "type": "t_address" + }, + { + "astId": 2948, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_token", + "offset": 0, + "slot": "5", + "type": "t_contract(IERC20)1045" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "base": "t_bytes32", + "encoding": "dynamic_array", + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes4": { + "encoding": "inplace", + "label": "bytes4", + "numberOfBytes": "4" + }, + "t_contract(IERC20)1045": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes4,t_address)": { + "encoding": "mapping", + "key": "t_bytes4", + "label": "mapping(bytes4 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_struct(AddressSet)1964_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.AddressSet", + "members": [ + { + "astId": 1963, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_inner", + "offset": 0, + "slot": "0", + "type": "t_struct(Set)1699_storage" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)1699_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.Set", + "members": [ + { + "astId": 1694, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_values", + "offset": 0, + "slot": "0", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "astId": 1698, + "contract": "contracts/GraphTokenLockManager.sol:GraphTokenLockManager", + "label": "_indexes", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/deployments/goerli/solcInputs/0b3ac4290e5ed652698ff31ab3f44c7f.json b/deployments/goerli/solcInputs/0b3ac4290e5ed652698ff31ab3f44c7f.json new file mode 100644 index 0000000..617af49 --- /dev/null +++ b/deployments/goerli/solcInputs/0b3ac4290e5ed652698ff31ab3f44c7f.json @@ -0,0 +1,95 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../utils/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 * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor () internal {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\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 virtual 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 virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "@openzeppelin/contracts/math/SafeMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\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, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, 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) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n\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 *\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 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 *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n return a - b;\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 *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) return 0;\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting 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 *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting 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 *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: modulo by zero\");\n return a % b;\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 * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n return a - b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryDiv}.\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 *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\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 *\n * - The divisor cannot be zero.\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" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../../utils/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 {ERC20PresetMinterPauser}.\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 string private _name;\n string private _symbol;\n uint8 private _decimals;\n\n /**\n * @dev Sets the values for {name} and {symbol}, initializes {decimals} with\n * a default value of 18.\n *\n * To select a different value for {decimals}, use {_setupDecimals}.\n *\n * All three of these values are immutable: they can only be set once during\n * construction.\n */\n constructor (string memory name_, string memory symbol_) public {\n _name = name_;\n _symbol = symbol_;\n _decimals = 18;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5,05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is\n * called.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `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) public virtual override 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) public view virtual override 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) public virtual override 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 *\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) public virtual override 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 virtual 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 virtual 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 virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\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 virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\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 virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\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 internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(address owner, address spender, uint256 amount) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Sets {decimals} to a value other than the default one of 18.\n *\n * WARNING: This function should only be called from the constructor. Most\n * applications that interact with token contracts will not expect\n * {decimals} to ever change, and may work incorrectly if it does.\n */\n function _setupDecimals(uint8 decimals_) internal virtual {\n _decimals = decimals_;\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be to transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\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" + }, + "@openzeppelin/contracts/token/ERC20/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\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 IERC20;` 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 /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\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 from 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. We use {Address.functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\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" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <0.8.0;\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" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with 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 function _msgSender() internal view virtual returns (address payable) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual 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" + }, + "@openzeppelin/contracts/utils/Create2.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\n * `CREATE2` can be used to compute in advance the address where a smart\n * contract will be deployed, which allows for interesting new mechanisms known\n * as 'counterfactual interactions'.\n *\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\n * information.\n */\nlibrary Create2 {\n /**\n * @dev Deploys a contract using `CREATE2`. The address where the contract\n * will be deployed can be known in advance via {computeAddress}.\n *\n * The bytecode for a contract can be obtained from Solidity with\n * `type(contractName).creationCode`.\n *\n * Requirements:\n *\n * - `bytecode` must not be empty.\n * - `salt` must have not been used for `bytecode` already.\n * - the factory must have a balance of at least `amount`.\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\n */\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\n address addr;\n require(address(this).balance >= amount, \"Create2: insufficient balance\");\n require(bytecode.length != 0, \"Create2: bytecode length is zero\");\n // solhint-disable-next-line no-inline-assembly\n assembly {\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n }\n require(addr != address(0), \"Create2: Failed on deploy\");\n return addr;\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\n * `bytecodeHash` or `salt` will result in a new destination address.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\n return computeAddress(salt, bytecodeHash, address(this));\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\n bytes32 _data = keccak256(\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\n );\n return address(uint160(uint256(_data)));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/EnumerableSet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <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/GraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport \"./Ownable.sol\";\nimport \"./MathUtils.sol\";\nimport \"./IGraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLock\n * @notice Contract that manages an unlocking schedule of tokens.\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\n * they can only be released under certain time conditions.\n *\n * This contract implements a release scheduled based on periods and tokens are released in steps\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\n * It also supports revocation to be used for vesting schedules.\n *\n * The contract supports receiving extra funds than the managed tokens ones that can be\n * withdrawn by the beneficiary at any time.\n *\n * A releaseStartTime parameter is included to override the default release schedule and\n * perform the first release on the configured time. After that it will continue with the\n * default schedule.\n */\nabstract contract GraphTokenLock is Ownable, IGraphTokenLock {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n uint256 private constant MIN_PERIOD = 1;\n\n // -- State --\n\n IERC20 public token;\n address public beneficiary;\n\n // Configuration\n\n // Amount of tokens managed by the contract schedule\n uint256 public managedAmount;\n\n uint256 public startTime; // Start datetime (in unixtimestamp)\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\n uint256 public periods; // Number of vesting/release periods\n\n // First release date for tokens (in unixtimestamp)\n // If set, no tokens will be released before releaseStartTime ignoring\n // the amount to release each period\n uint256 public releaseStartTime;\n // A cliff set a date to which a beneficiary needs to get to vest\n // all preceding periods\n uint256 public vestingCliffTime;\n Revocability public revocable; // Whether to use vesting for locked funds\n\n // State\n\n bool public isRevoked;\n bool public isInitialized;\n bool public isAccepted;\n uint256 public releasedAmount;\n uint256 public revokedAmount;\n\n // -- Events --\n\n event TokensReleased(address indexed beneficiary, uint256 amount);\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\n event TokensRevoked(address indexed beneficiary, uint256 amount);\n event BeneficiaryChanged(address newBeneficiary);\n event LockAccepted();\n event LockCanceled();\n\n /**\n * @dev Only allow calls from the beneficiary of the contract\n */\n modifier onlyBeneficiary() {\n require(msg.sender == beneficiary, \"!auth\");\n _;\n }\n\n /**\n * @notice Initializes the contract\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _vestingCliffTime Override time for when the vesting start\n * @param _revocable Whether the contract is revocable\n */\n function _initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) internal {\n require(!isInitialized, \"Already initialized\");\n require(_owner != address(0), \"Owner cannot be zero\");\n require(_beneficiary != address(0), \"Beneficiary cannot be zero\");\n require(_token != address(0), \"Token cannot be zero\");\n require(_managedAmount > 0, \"Managed tokens cannot be zero\");\n require(_startTime != 0, \"Start time must be set\");\n require(_startTime < _endTime, \"Start time > end time\");\n require(_periods >= MIN_PERIOD, \"Periods cannot be below minimum\");\n require(_revocable != Revocability.NotSet, \"Must set a revocability option\");\n require(_releaseStartTime < _endTime, \"Release start time must be before end time\");\n require(_vestingCliffTime < _endTime, \"Cliff time must be before end time\");\n\n isInitialized = true;\n\n Ownable.initialize(_owner);\n beneficiary = _beneficiary;\n token = IERC20(_token);\n\n managedAmount = _managedAmount;\n\n startTime = _startTime;\n endTime = _endTime;\n periods = _periods;\n\n // Optionals\n releaseStartTime = _releaseStartTime;\n vestingCliffTime = _vestingCliffTime;\n revocable = _revocable;\n }\n\n /**\n * @notice Change the beneficiary of funds managed by the contract\n * @dev Can only be called by the beneficiary\n * @param _newBeneficiary Address of the new beneficiary address\n */\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\n require(_newBeneficiary != address(0), \"Empty beneficiary\");\n beneficiary = _newBeneficiary;\n emit BeneficiaryChanged(_newBeneficiary);\n }\n\n /**\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\n * @dev Can only be called by the beneficiary\n */\n function acceptLock() external onlyBeneficiary {\n isAccepted = true;\n emit LockAccepted();\n }\n\n /**\n * @notice Owner cancel the lock and return the balance in the contract\n * @dev Can only be called by the owner\n */\n function cancelLock() external onlyOwner {\n require(isAccepted == false, \"Cannot cancel accepted contract\");\n\n token.safeTransfer(owner(), currentBalance());\n\n emit LockCanceled();\n }\n\n // -- Balances --\n\n /**\n * @notice Returns the amount of tokens currently held by the contract\n * @return Tokens held in the contract\n */\n function currentBalance() public view override returns (uint256) {\n return token.balanceOf(address(this));\n }\n\n // -- Time & Periods --\n\n /**\n * @notice Returns the current block timestamp\n * @return Current block timestamp\n */\n function currentTime() public view override returns (uint256) {\n return block.timestamp;\n }\n\n /**\n * @notice Gets duration of contract from start to end in seconds\n * @return Amount of seconds from contract startTime to endTime\n */\n function duration() public view override returns (uint256) {\n return endTime.sub(startTime);\n }\n\n /**\n * @notice Gets time elapsed since the start of the contract\n * @dev Returns zero if called before conctract starTime\n * @return Seconds elapsed from contract startTime\n */\n function sinceStartTime() public view override returns (uint256) {\n uint256 current = currentTime();\n if (current <= startTime) {\n return 0;\n }\n return current.sub(startTime);\n }\n\n /**\n * @notice Returns amount available to be released after each period according to schedule\n * @return Amount of tokens available after each period\n */\n function amountPerPeriod() public view override returns (uint256) {\n return managedAmount.div(periods);\n }\n\n /**\n * @notice Returns the duration of each period in seconds\n * @return Duration of each period in seconds\n */\n function periodDuration() public view override returns (uint256) {\n return duration().div(periods);\n }\n\n /**\n * @notice Gets the current period based on the schedule\n * @return A number that represents the current period\n */\n function currentPeriod() public view override returns (uint256) {\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\n }\n\n /**\n * @notice Gets the number of periods that passed since the first period\n * @return A number of periods that passed since the schedule started\n */\n function passedPeriods() public view override returns (uint256) {\n return currentPeriod().sub(MIN_PERIOD);\n }\n\n // -- Locking & Release Schedule --\n\n /**\n * @notice Gets the currently available token according to the schedule\n * @dev Implements the step-by-step schedule based on periods for available tokens\n * @return Amount of tokens available according to the schedule\n */\n function availableAmount() public view override returns (uint256) {\n uint256 current = currentTime();\n\n // Before contract start no funds are available\n if (current < startTime) {\n return 0;\n }\n\n // After contract ended all funds are available\n if (current > endTime) {\n return managedAmount;\n }\n\n // Get available amount based on period\n return passedPeriods().mul(amountPerPeriod());\n }\n\n /**\n * @notice Gets the amount of currently vested tokens\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\n * @return Amount of tokens already vested\n */\n function vestedAmount() public view override returns (uint256) {\n // If non-revocable it is fully vested\n if (revocable == Revocability.Disabled) {\n return managedAmount;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n return availableAmount();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule and takes into account already released tokens\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public view virtual override returns (uint256) {\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n uint256 releasable = availableAmount().sub(releasedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\n * @dev Does not consider schedule but just global amounts tracked\n * @return Amount of outstanding tokens for the lifetime of the contract\n */\n function totalOutstandingAmount() public view override returns (uint256) {\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\n }\n\n /**\n * @notice Gets surplus amount in the contract based on outstanding amount to release\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary\n * @return Amount of tokens considered as surplus\n */\n function surplusAmount() public view override returns (uint256) {\n uint256 balance = currentBalance();\n uint256 outstandingAmount = totalOutstandingAmount();\n if (balance > outstandingAmount) {\n return balance.sub(outstandingAmount);\n }\n return 0;\n }\n\n // -- Value Transfer --\n\n /**\n * @notice Releases tokens based on the configured schedule\n * @dev All available releasable tokens are transferred to beneficiary\n */\n function release() external override onlyBeneficiary {\n uint256 amountToRelease = releasableAmount();\n require(amountToRelease > 0, \"No available releasable amount\");\n\n releasedAmount = releasedAmount.add(amountToRelease);\n\n token.safeTransfer(beneficiary, amountToRelease);\n\n emit TokensReleased(beneficiary, amountToRelease);\n }\n\n /**\n * @notice Withdraws surplus, unmanaged tokens from the contract\n * @dev Tokens in the contract over outstanding amount are considered as surplus\n * @param _amount Amount of tokens to withdraw\n */\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\n require(_amount > 0, \"Amount cannot be zero\");\n require(surplusAmount() >= _amount, \"Amount requested > surplus available\");\n\n token.safeTransfer(beneficiary, _amount);\n\n emit TokensWithdrawn(beneficiary, _amount);\n }\n\n /**\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\n * @dev Vesting schedule is always calculated based on managed tokens\n */\n function revoke() external override onlyOwner {\n require(revocable == Revocability.Enabled, \"Contract is non-revocable\");\n require(isRevoked == false, \"Already revoked\");\n\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\n require(unvestedAmount > 0, \"No available unvested amount\");\n\n revokedAmount = unvestedAmount;\n isRevoked = true;\n\n token.safeTransfer(owner(), unvestedAmount);\n\n emit TokensRevoked(beneficiary, unvestedAmount);\n }\n}\n" + }, + "contracts/GraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/utils/EnumerableSet.sol\";\n\nimport \"./MinimalProxyFactory.sol\";\nimport \"./IGraphTokenLockManager.sol\";\n\n/**\n * @title GraphTokenLockManager\n * @notice This contract manages a list of authorized function calls and targets that can be called\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\n *\n * This contract receives funds to make the process of creating TokenLockWallet contracts\n * easier by distributing them the initial tokens to be managed.\n *\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\n * will manipulate users funds.\n */\ncontract GraphTokenLockManager is MinimalProxyFactory, IGraphTokenLockManager {\n using SafeERC20 for IERC20;\n using EnumerableSet for EnumerableSet.AddressSet;\n\n // -- State --\n\n mapping(bytes4 => address) public authFnCalls;\n EnumerableSet.AddressSet private _tokenDestinations;\n\n address public masterCopy;\n IERC20 private _token;\n\n // -- Events --\n\n event MasterCopyUpdated(address indexed masterCopy);\n event TokenLockCreated(\n address indexed contractAddress,\n bytes32 indexed initHash,\n address indexed beneficiary,\n address token,\n uint256 managedAmount,\n uint256 startTime,\n uint256 endTime,\n uint256 periods,\n uint256 releaseStartTime,\n uint256 vestingCliffTime,\n IGraphTokenLock.Revocability revocable\n );\n\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\n event TokenDestinationAllowed(address indexed dst, bool allowed);\n\n /**\n * Constructor.\n * @param _graphToken Token to use for deposits and withdrawals\n * @param _masterCopy Address of the master copy to use to clone proxies\n */\n constructor(IERC20 _graphToken, address _masterCopy) {\n require(address(_graphToken) != address(0), \"Token cannot be zero\");\n _token = _graphToken;\n setMasterCopy(_masterCopy);\n }\n\n // -- Factory --\n\n /**\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\n * @param _masterCopy Address of contract bytecode to factory clone\n */\n function setMasterCopy(address _masterCopy) public override onlyOwner {\n require(_masterCopy != address(0), \"MasterCopy cannot be zero\");\n masterCopy = _masterCopy;\n emit MasterCopyUpdated(_masterCopy);\n }\n\n /**\n * @notice Creates and fund a new token lock wallet using a minimum proxy\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _revocable Whether the contract is revocable\n */\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external override onlyOwner {\n require(_token.balanceOf(address(this)) >= _managedAmount, \"Not enough tokens to create lock\");\n\n // Create contract using a minimal proxy and call initializer\n bytes memory initializer = abi.encodeWithSignature(\n \"initialize(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\",\n address(this),\n _owner,\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\n\n // Send managed amount to the created contract\n _token.safeTransfer(contractAddress, _managedAmount);\n\n emit TokenLockCreated(\n contractAddress,\n keccak256(initializer),\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n\n // -- Funds Management --\n\n /**\n * @notice Gets the GRT token address\n * @return Token used for transfers and approvals\n */\n function token() external view override returns (IERC20) {\n return _token;\n }\n\n /**\n * @notice Deposits tokens into the contract\n * @dev Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external override {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n /**\n * @notice Withdraws tokens from the contract\n * @dev Escape hatch in case of mistakes or to recover remaining funds\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external override onlyOwner {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Token Destinations --\n\n /**\n * @notice Adds an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function addTokenDestination(address _dst) external override onlyOwner {\n require(_dst != address(0), \"Destination cannot be zero\");\n require(_tokenDestinations.add(_dst), \"Destination already added\");\n emit TokenDestinationAllowed(_dst, true);\n }\n\n /**\n * @notice Removes an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function removeTokenDestination(address _dst) external override onlyOwner {\n require(_tokenDestinations.remove(_dst), \"Destination already removed\");\n emit TokenDestinationAllowed(_dst, false);\n }\n\n /**\n * @notice Returns True if the address is authorized to be a destination of tokens\n * @param _dst Destination address\n * @return True if authorized\n */\n function isTokenDestination(address _dst) external view override returns (bool) {\n return _tokenDestinations.contains(_dst);\n }\n\n /**\n * @notice Returns an array of authorized destination addresses\n * @return Array of addresses authorized to pull funds from a token lock\n */\n function getTokenDestinations() external view override returns (address[] memory) {\n address[] memory dstList = new address[](_tokenDestinations.length());\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\n dstList[i] = _tokenDestinations.at(i);\n }\n return dstList;\n }\n\n // -- Function Call Authorization --\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\n _setAuthFunctionCall(_signature, _target);\n }\n\n /**\n * @notice Unsets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n */\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = address(0);\n\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\n }\n\n /**\n * @notice Sets an authorized function call to target in bulk\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signatures Function signatures\n * @param _targets Address of the destination contract to call\n */\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets)\n external\n override\n onlyOwner\n {\n require(_signatures.length == _targets.length, \"Array length mismatch\");\n\n for (uint256 i = 0; i < _signatures.length; i++) {\n _setAuthFunctionCall(_signatures[i], _targets[i]);\n }\n }\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\n require(_target != address(this), \"Target must be other contract\");\n require(Address.isContract(_target), \"Target must be a contract\");\n\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = _target;\n\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\n }\n\n /**\n * @notice Gets the target contract to call for a particular function signature\n * @param _sigHash Function signature hash\n * @return Address of the target contract where to send the call\n */\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\n return authFnCalls[_sigHash];\n }\n\n /**\n * @notice Returns true if the function call is authorized\n * @param _sigHash Function signature hash\n * @return True if authorized\n */\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\n return getAuthFunctionCallTarget(_sigHash) != address(0);\n }\n\n /**\n * @dev Converts a function signature string to 4-bytes hash\n * @param _signature Function signature string\n * @return Function signature hash\n */\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\n return _convertToBytes4(abi.encodeWithSignature(_signature));\n }\n\n /**\n * @dev Converts function signature bytes to function signature hash (bytes4)\n * @param _signature Function signature\n * @return Function signature in bytes4\n */\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\n require(_signature.length == 4, \"Invalid method signature\");\n bytes4 sigHash;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n sigHash := mload(add(_signature, 32))\n }\n return sigHash;\n }\n}\n" + }, + "contracts/GraphTokenLockSimple.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"./GraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLockSimple\n * @notice This contract is the concrete simple implementation built on top of the base\n * GraphTokenLock functionality for use when we only need the token lock schedule\n * features but no interaction with the network.\n *\n * This contract is designed to be deployed without the use of a TokenManager.\n */\ncontract GraphTokenLockSimple is GraphTokenLock {\n // Constructor\n constructor() {\n Ownable.initialize(msg.sender);\n }\n\n // Initializer\n function initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external onlyOwner {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n}\n" + }, + "contracts/GraphTokenLockWallet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport \"./GraphTokenLock.sol\";\nimport \"./IGraphTokenLockManager.sol\";\n\n/**\n * @title GraphTokenLockWallet\n * @notice This contract is built on top of the base GraphTokenLock functionality.\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\n * on specific contracts.\n *\n * The idea is that supporters with locked tokens can participate in the protocol\n * but disallow any release before the vesting/lock schedule.\n * The beneficiary can issue authorized function calls to this contract that will\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\n * The function calls allowed are queried to the GraphTokenLockManager, this way\n * the same configuration can be shared for all the created lock wallet contracts.\n *\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\n * with any of this contract functions.\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\n * the maximum amount of tokens is authorized.\n */\ncontract GraphTokenLockWallet is GraphTokenLock {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n // -- State --\n\n IGraphTokenLockManager public manager;\n uint256 public usedAmount;\n\n uint256 private constant MAX_UINT256 = 2**256 - 1;\n\n // -- Events --\n\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\n event TokenDestinationsApproved();\n event TokenDestinationsRevoked();\n\n // Initializer\n function initialize(\n address _manager,\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n _setManager(_manager);\n }\n\n // -- Admin --\n\n /**\n * @notice Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function setManager(address _newManager) external onlyOwner {\n _setManager(_newManager);\n }\n\n /**\n * @dev Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function _setManager(address _newManager) private {\n require(_newManager != address(0), \"Manager cannot be empty\");\n require(Address.isContract(_newManager), \"Manager must be a contract\");\n\n address oldManager = address(manager);\n manager = IGraphTokenLockManager(_newManager);\n\n emit ManagerUpdated(oldManager, _newManager);\n }\n\n // -- Beneficiary --\n\n /**\n * @notice Approves protocol access of the tokens managed by this contract\n * @dev Approves all token destinations registered in the manager to pull tokens\n */\n function approveProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n token.safeApprove(dstList[i], MAX_UINT256);\n }\n emit TokenDestinationsApproved();\n }\n\n /**\n * @notice Revokes protocol access of the tokens managed by this contract\n * @dev Revokes approval to all token destinations in the manager to pull tokens\n */\n function revokeProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n token.safeApprove(dstList[i], 0);\n }\n emit TokenDestinationsRevoked();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule, takes into account already released tokens and used amount\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public view override returns (uint256) {\n if (revocable == Revocability.Disabled) {\n return super.releasableAmount();\n }\n\n // -- Revocability enabled logic\n // This needs to deal with additional considerations for when tokens are used in the protocol\n\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n // We consider the `usedAmount` in the protocol as part of the calculations\n // the beneficiary should not release funds that are used.\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Forward authorized contract calls to protocol contracts\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\n */\n fallback() external payable {\n // Only beneficiary can forward calls\n require(msg.sender == beneficiary, \"Unauthorized caller\");\n\n // Function call validation\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\n require(_target != address(0), \"Unauthorized function\");\n\n uint256 oldBalance = currentBalance();\n\n // Call function with data\n Address.functionCall(_target, msg.data);\n\n // Tracked used tokens in the protocol\n // We do this check after balances were updated by the forwarded call\n // Check is only enforced for revocable contracts to save some gas\n if (revocable == Revocability.Enabled) {\n // Track contract balance change\n uint256 newBalance = currentBalance();\n if (newBalance < oldBalance) {\n // Outflow\n uint256 diff = oldBalance.sub(newBalance);\n usedAmount = usedAmount.add(diff);\n } else {\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\n // underflow. We set it to zero in that case.\n uint256 diff = newBalance.sub(oldBalance);\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\n }\n require(usedAmount <= vestedAmount(), \"Cannot use more tokens than vested amount\");\n }\n }\n}\n" + }, + "contracts/GraphTokenMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\n/**\n * @title Graph Token Mock\n */\ncontract GraphTokenMock is Ownable, ERC20 {\n /**\n * @dev Contract Constructor.\n * @param _initialSupply Initial supply\n */\n constructor(uint256 _initialSupply, address _mintTo) ERC20(\"Graph Token Mock\", \"GRT-Mock\") {\n // Deploy to mint address\n _mint(_mintTo, _initialSupply);\n }\n}\n" + }, + "contracts/IGraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IGraphTokenLock {\n enum Revocability {\n NotSet,\n Enabled,\n Disabled\n }\n\n // -- Balances --\n\n function currentBalance() external view returns (uint256);\n\n // -- Time & Periods --\n\n function currentTime() external view returns (uint256);\n\n function duration() external view returns (uint256);\n\n function sinceStartTime() external view returns (uint256);\n\n function amountPerPeriod() external view returns (uint256);\n\n function periodDuration() external view returns (uint256);\n\n function currentPeriod() external view returns (uint256);\n\n function passedPeriods() external view returns (uint256);\n\n // -- Locking & Release Schedule --\n\n function availableAmount() external view returns (uint256);\n\n function vestedAmount() external view returns (uint256);\n\n function releasableAmount() external view returns (uint256);\n\n function totalOutstandingAmount() external view returns (uint256);\n\n function surplusAmount() external view returns (uint256);\n\n // -- Value Transfer --\n\n function release() external;\n\n function withdrawSurplus(uint256 _amount) external;\n\n function revoke() external;\n}\n" + }, + "contracts/IGraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./IGraphTokenLock.sol\";\n\ninterface IGraphTokenLockManager {\n // -- Factory --\n\n function setMasterCopy(address _masterCopy) external;\n\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external;\n\n // -- Funds Management --\n\n function token() external returns (IERC20);\n\n function deposit(uint256 _amount) external;\n\n function withdraw(uint256 _amount) external;\n\n // -- Allowed Funds Destinations --\n\n function addTokenDestination(address _dst) external;\n\n function removeTokenDestination(address _dst) external;\n\n function isTokenDestination(address _dst) external view returns (bool);\n\n function getTokenDestinations() external view returns (address[] memory);\n\n // -- Function Call Authorization --\n\n function setAuthFunctionCall(string calldata _signature, address _target) external;\n\n function unsetAuthFunctionCall(string calldata _signature) external;\n\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\n\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\n\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\n}\n" + }, + "contracts/MathUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nlibrary MathUtils {\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n}\n" + }, + "contracts/MinimalProxyFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/Create2.sol\";\n\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\n// Based on https://eips.ethereum.org/EIPS/eip-1167\ncontract MinimalProxyFactory is Ownable {\n // -- Events --\n\n event ProxyCreated(address indexed proxy);\n\n /**\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @return Address of the counterfactual MinimalProxy\n */\n function getDeploymentAddress(bytes32 _salt, address _implementation) external view returns (address) {\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), address(this));\n }\n\n /**\n * @notice Deploys a MinimalProxy with CREATE2\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @param _data Bytes with the initializer call\n * @return Address of the deployed MinimalProxy\n */\n function _deployProxy2(\n bytes32 _salt,\n address _implementation,\n bytes memory _data\n ) internal returns (address) {\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\n\n emit ProxyCreated(proxyAddress);\n\n // Call function with data\n if (_data.length > 0) {\n Address.functionCall(proxyAddress, _data);\n }\n\n return proxyAddress;\n }\n\n /**\n * @notice Gets the MinimalProxy bytecode\n * @param _implementation Address of the proxy target implementation\n * @return MinimalProxy bytecode\n */\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\n bytes10 creation = 0x3d602d80600a3d3981f3;\n bytes10 prefix = 0x363d3d373d3d3d363d73;\n bytes20 targetBytes = bytes20(_implementation);\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\n }\n}\n" + }, + "contracts/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\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 * The owner account will be passed on initialization of the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\ncontract Ownable {\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 owner) internal {\n _owner = owner;\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(_owner == msg.sender, \"Ownable: caller is not the owner\");\n _;\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() external virtual 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) external virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "contracts/Stakes.sol": { + "content": "pragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\n\n/**\n * @title A collection of data structures and functions to manage the Indexer Stake state.\n * Used for low-level state changes, require() conditions should be evaluated\n * at the caller function scope.\n */\nlibrary Stakes {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n struct Indexer {\n uint256 tokensStaked; // Tokens on the indexer stake (staked by the indexer)\n uint256 tokensAllocated; // Tokens used in allocations\n uint256 tokensLocked; // Tokens locked for withdrawal subject to thawing period\n uint256 tokensLockedUntil; // Block when locked tokens can be withdrawn\n }\n\n /**\n * @dev Deposit tokens to the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to deposit\n */\n function deposit(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.add(_tokens);\n }\n\n /**\n * @dev Release tokens from the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to release\n */\n function release(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.sub(_tokens);\n }\n\n /**\n * @dev Allocate tokens from the main stack to a SubgraphDeployment.\n * @param stake Stake data\n * @param _tokens Amount of tokens to allocate\n */\n function allocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.add(_tokens);\n }\n\n /**\n * @dev Unallocate tokens from a SubgraphDeployment back to the main stack.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unallocate\n */\n function unallocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.sub(_tokens);\n }\n\n /**\n * @dev Lock tokens until a thawing period pass.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _period Period in blocks that need to pass before withdrawal\n */\n function lockTokens(\n Stakes.Indexer storage stake,\n uint256 _tokens,\n uint256 _period\n ) internal {\n // Take into account period averaging for multiple unstake requests\n uint256 lockingPeriod = _period;\n if (stake.tokensLocked > 0) {\n lockingPeriod = stake.getLockingPeriod(_tokens, _period);\n }\n\n // Update balances\n stake.tokensLocked = stake.tokensLocked.add(_tokens);\n stake.tokensLockedUntil = block.number.add(lockingPeriod);\n }\n\n /**\n * @dev Unlock tokens.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unkock\n */\n function unlockTokens(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensLocked = stake.tokensLocked.sub(_tokens);\n if (stake.tokensLocked == 0) {\n stake.tokensLockedUntil = 0;\n }\n }\n\n /**\n * @dev Take all tokens out from the locked stake for withdrawal.\n * @param stake Stake data\n * @return Amount of tokens being withdrawn\n */\n function withdrawTokens(Stakes.Indexer storage stake) internal returns (uint256) {\n // Calculate tokens that can be released\n uint256 tokensToWithdraw = stake.tokensWithdrawable();\n\n if (tokensToWithdraw > 0) {\n // Reset locked tokens\n stake.unlockTokens(tokensToWithdraw);\n\n // Decrease indexer stake\n stake.release(tokensToWithdraw);\n }\n\n return tokensToWithdraw;\n }\n\n /**\n * @dev Get the locking period of the tokens to unstake.\n * If already unstaked before calculate the weighted average.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _thawingPeriod Period in blocks that need to pass before withdrawal\n * @return True if staked\n */\n function getLockingPeriod(\n Stakes.Indexer memory stake,\n uint256 _tokens,\n uint256 _thawingPeriod\n ) internal view returns (uint256) {\n uint256 blockNum = block.number;\n uint256 periodA = (stake.tokensLockedUntil > blockNum) ? stake.tokensLockedUntil.sub(blockNum) : 0;\n uint256 periodB = _thawingPeriod;\n uint256 stakeA = stake.tokensLocked;\n uint256 stakeB = _tokens;\n return periodA.mul(stakeA).add(periodB.mul(stakeB)).div(stakeA.add(stakeB));\n }\n\n /**\n * @dev Return true if there are tokens staked by the Indexer.\n * @param stake Stake data\n * @return True if staked\n */\n function hasTokens(Stakes.Indexer memory stake) internal pure returns (bool) {\n return stake.tokensStaked > 0;\n }\n\n /**\n * @dev Return the amount of tokens used in allocations and locked for withdrawal.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensUsed(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAllocated.add(stake.tokensLocked);\n }\n\n /**\n * @dev Return the amount of tokens staked not considering the ones that are already going\n * through the thawing period or are ready for withdrawal. We call it secure stake because\n * it is not subject to change by a withdraw call from the indexer.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensSecureStake(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensStaked.sub(stake.tokensLocked);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for any purpose.\n * Any token that is allocated cannot be used as well as tokens that are going through the\n * thawing period or are withdrawable\n * Calc: tokensStaked - tokensAllocated - tokensLocked\n * @param stake Stake data\n * @return Token amount\n */\n function tokensAvailable(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAvailableWithDelegation(0);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for allocations.\n * This function accepts a parameter for extra delegated capacity that takes into\n * account delegated tokens\n * @param stake Stake data\n * @param _delegatedCapacity Amount of tokens used from delegators to calculate availability\n * @return Token amount\n */\n function tokensAvailableWithDelegation(Stakes.Indexer memory stake, uint256 _delegatedCapacity)\n internal\n pure\n returns (uint256)\n {\n uint256 tokensCapacity = stake.tokensStaked.add(_delegatedCapacity);\n uint256 _tokensUsed = stake.tokensUsed();\n // If more tokens are used than the current capacity, the indexer is overallocated.\n // This means the indexer doesn't have available capacity to create new allocations.\n // We can reach this state when the indexer has funds allocated and then any\n // of these conditions happen:\n // - The delegationCapacity ratio is reduced.\n // - The indexer stake is slashed.\n // - A delegator removes enough stake.\n if (_tokensUsed > tokensCapacity) {\n // Indexer stake is over allocated: return 0 to avoid stake to be used until\n // the overallocation is restored by staking more tokens, unallocating tokens\n // or using more delegated funds\n return 0;\n }\n return tokensCapacity.sub(_tokensUsed);\n }\n\n /**\n * @dev Tokens available for withdrawal after thawing period.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensWithdrawable(Stakes.Indexer memory stake) internal view returns (uint256) {\n // No tokens to withdraw before locking period\n if (stake.tokensLockedUntil == 0 || block.number < stake.tokensLockedUntil) {\n return 0;\n }\n return stake.tokensLocked;\n }\n}\n" + }, + "contracts/StakingMock.sol": { + "content": "pragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./Stakes.sol\";\n\ncontract StakingMock {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n // -- State --\n\n uint256 public minimumIndexerStake = 100e18;\n uint256 public thawingPeriod = 10; // 10 blocks\n IERC20 public token;\n\n // Indexer stakes : indexer => Stake\n mapping(address => Stakes.Indexer) public stakes;\n\n /**\n * @dev Emitted when `indexer` stake `tokens` amount.\n */\n event StakeDeposited(address indexed indexer, uint256 tokens);\n\n /**\n * @dev Emitted when `indexer` unstaked and locked `tokens` amount `until` block.\n */\n event StakeLocked(address indexed indexer, uint256 tokens, uint256 until);\n\n /**\n * @dev Emitted when `indexer` withdrew `tokens` staked.\n */\n event StakeWithdrawn(address indexed indexer, uint256 tokens);\n\n // Contract constructor.\n constructor(IERC20 _token) {\n require(address(_token) != address(0), \"!token\");\n token = _token;\n }\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _tokens Amount of tokens to stake\n */\n function stake(uint256 _tokens) external {\n stakeTo(msg.sender, _tokens);\n }\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _indexer Address of the indexer\n * @param _tokens Amount of tokens to stake\n */\n function stakeTo(address _indexer, uint256 _tokens) public {\n require(_tokens > 0, \"!tokens\");\n\n // Ensure minimum stake\n require(stakes[_indexer].tokensSecureStake().add(_tokens) >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Transfer tokens to stake from caller to this contract\n require(token.transferFrom(msg.sender, address(this), _tokens), \"!transfer\");\n\n // Stake the transferred tokens\n _stake(_indexer, _tokens);\n }\n\n /**\n * @dev Unstake tokens from the indexer stake, lock them until thawing period expires.\n * @param _tokens Amount of tokens to unstake\n */\n function unstake(uint256 _tokens) external {\n address indexer = msg.sender;\n Stakes.Indexer storage indexerStake = stakes[indexer];\n\n require(_tokens > 0, \"!tokens\");\n require(indexerStake.hasTokens(), \"!stake\");\n require(indexerStake.tokensAvailable() >= _tokens, \"!stake-avail\");\n\n // Ensure minimum stake\n uint256 newStake = indexerStake.tokensSecureStake().sub(_tokens);\n require(newStake == 0 || newStake >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Before locking more tokens, withdraw any unlocked ones\n uint256 tokensToWithdraw = indexerStake.tokensWithdrawable();\n if (tokensToWithdraw > 0) {\n _withdraw(indexer);\n }\n\n indexerStake.lockTokens(_tokens, thawingPeriod);\n\n emit StakeLocked(indexer, indexerStake.tokensLocked, indexerStake.tokensLockedUntil);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n */\n function withdraw() external {\n _withdraw(msg.sender);\n }\n\n function _stake(address _indexer, uint256 _tokens) internal {\n // Deposit tokens into the indexer stake\n Stakes.Indexer storage indexerStake = stakes[_indexer];\n indexerStake.deposit(_tokens);\n\n emit StakeDeposited(_indexer, _tokens);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n * @param _indexer Address of indexer to withdraw funds from\n */\n function _withdraw(address _indexer) private {\n // Get tokens available for withdraw and update balance\n uint256 tokensToWithdraw = stakes[_indexer].withdrawTokens();\n require(tokensToWithdraw > 0, \"!tokens\");\n\n // Return tokens to the indexer\n require(token.transfer(_indexer, tokensToWithdraw), \"!transfer\");\n\n emit StakeWithdrawn(_indexer, tokensToWithdraw);\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": false, + "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/deployments/goerli/solcInputs/ccc82ccc102007017cf322f5b7601563.json b/deployments/goerli/solcInputs/ccc82ccc102007017cf322f5b7601563.json new file mode 100644 index 0000000..9c2407a --- /dev/null +++ b/deployments/goerli/solcInputs/ccc82ccc102007017cf322f5b7601563.json @@ -0,0 +1,89 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../utils/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 * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor () internal {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\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 virtual 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 virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "@openzeppelin/contracts/math/SafeMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\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, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, 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) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n\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 *\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 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 *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n return a - b;\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 *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) return 0;\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting 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 *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting 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 *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: modulo by zero\");\n return a % b;\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 * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n return a - b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryDiv}.\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 *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\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 *\n * - The divisor cannot be zero.\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" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\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" + }, + "@openzeppelin/contracts/token/ERC20/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\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 IERC20;` 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 /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\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 from 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. We use {Address.functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\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" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <0.8.0;\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" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with 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 function _msgSender() internal view virtual returns (address payable) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual 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" + }, + "@openzeppelin/contracts/utils/Create2.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\n * `CREATE2` can be used to compute in advance the address where a smart\n * contract will be deployed, which allows for interesting new mechanisms known\n * as 'counterfactual interactions'.\n *\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\n * information.\n */\nlibrary Create2 {\n /**\n * @dev Deploys a contract using `CREATE2`. The address where the contract\n * will be deployed can be known in advance via {computeAddress}.\n *\n * The bytecode for a contract can be obtained from Solidity with\n * `type(contractName).creationCode`.\n *\n * Requirements:\n *\n * - `bytecode` must not be empty.\n * - `salt` must have not been used for `bytecode` already.\n * - the factory must have a balance of at least `amount`.\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\n */\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\n address addr;\n require(address(this).balance >= amount, \"Create2: insufficient balance\");\n require(bytecode.length != 0, \"Create2: bytecode length is zero\");\n // solhint-disable-next-line no-inline-assembly\n assembly {\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n }\n require(addr != address(0), \"Create2: Failed on deploy\");\n return addr;\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\n * `bytecodeHash` or `salt` will result in a new destination address.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\n return computeAddress(salt, bytecodeHash, address(this));\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\n bytes32 _data = keccak256(\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\n );\n return address(uint160(uint256(_data)));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/EnumerableSet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <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/GraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport \"./Ownable.sol\";\nimport \"./MathUtils.sol\";\nimport \"./IGraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLock\n * @notice Contract that manages an unlocking schedule of tokens.\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\n * they can only be released under certain time conditions.\n *\n * This contract implements a release scheduled based on periods and tokens are released in steps\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\n * It also supports revocation to be used for vesting schedules.\n *\n * The contract supports receiving extra funds than the managed tokens ones that can be\n * withdrawn by the beneficiary at any time.\n *\n * A releaseStartTime parameter is included to override the default release schedule and\n * perform the first release on the configured time. After that it will continue with the\n * default schedule.\n */\nabstract contract GraphTokenLock is Ownable, IGraphTokenLock {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n uint256 private constant MIN_PERIOD = 1;\n\n // -- State --\n\n IERC20 public token;\n address public beneficiary;\n\n // Configuration\n\n // Amount of tokens managed by the contract schedule\n uint256 public managedAmount;\n\n uint256 public startTime; // Start datetime (in unixtimestamp)\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\n uint256 public periods; // Number of vesting/release periods\n\n // First release date for tokens (in unixtimestamp)\n // If set, no tokens will be released before releaseStartTime ignoring\n // the amount to release each period\n uint256 public releaseStartTime;\n // A cliff set a date to which a beneficiary needs to get to vest\n // all preceding periods\n uint256 public vestingCliffTime;\n Revocability public revocable; // Whether to use vesting for locked funds\n\n // State\n\n bool public isRevoked;\n bool public isInitialized;\n uint256 public releasedAmount;\n\n // -- Events --\n\n event TokensReleased(address indexed beneficiary, uint256 amount);\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\n event TokensRevoked(address indexed beneficiary, uint256 amount);\n\n /**\n * @dev Only allow calls from the beneficiary of the contract\n */\n modifier onlyBeneficiary() {\n require(msg.sender == beneficiary, \"!auth\");\n _;\n }\n\n /**\n * @notice Initializes the contract\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _vestingCliffTime Override time for when the vesting start\n * @param _revocable Whether the contract is revocable\n */\n function _initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) internal {\n require(!isInitialized, \"Already initialized\");\n require(_owner != address(0), \"Owner cannot be zero\");\n require(_beneficiary != address(0), \"Beneficiary cannot be zero\");\n require(_token != address(0), \"Token cannot be zero\");\n require(_managedAmount > 0, \"Managed tokens cannot be zero\");\n require(_startTime != 0, \"Start time must be set\");\n require(_startTime < _endTime, \"Start time > end time\");\n require(_periods >= MIN_PERIOD, \"Periods cannot be below minimum\");\n require(_revocable != Revocability.NotSet, \"Must set a revocability option\");\n require(_releaseStartTime < _endTime, \"Release start time must be before end time\");\n require(_vestingCliffTime < _endTime, \"Cliff time must be before end time\");\n\n isInitialized = true;\n\n Ownable.initialize(_owner);\n beneficiary = _beneficiary;\n token = IERC20(_token);\n\n managedAmount = _managedAmount;\n\n startTime = _startTime;\n endTime = _endTime;\n periods = _periods;\n\n // Optionals\n releaseStartTime = _releaseStartTime;\n vestingCliffTime = _vestingCliffTime;\n revocable = _revocable;\n }\n\n // -- Balances --\n\n /**\n * @notice Returns the amount of tokens currently held by the contract\n * @return Tokens held in the contract\n */\n function currentBalance() public override view returns (uint256) {\n return token.balanceOf(address(this));\n }\n\n // -- Time & Periods --\n\n /**\n * @notice Returns the current block timestamp\n * @return Current block timestamp\n */\n function currentTime() public override view returns (uint256) {\n return block.timestamp;\n }\n\n /**\n * @notice Gets duration of contract from start to end in seconds\n * @return Amount of seconds from contract startTime to endTime\n */\n function duration() public override view returns (uint256) {\n return endTime.sub(startTime);\n }\n\n /**\n * @notice Gets time elapsed since the start of the contract\n * @dev Returns zero if called before conctract starTime\n * @return Seconds elapsed from contract startTime\n */\n function sinceStartTime() public override view returns (uint256) {\n uint256 current = currentTime();\n if (current <= startTime) {\n return 0;\n }\n return current.sub(startTime);\n }\n\n /**\n * @notice Returns amount available to be released after each period according to schedule\n * @return Amount of tokens available after each period\n */\n function amountPerPeriod() public override view returns (uint256) {\n return managedAmount.div(periods);\n }\n\n /**\n * @notice Returns the duration of each period in seconds\n * @return Duration of each period in seconds\n */\n function periodDuration() public override view returns (uint256) {\n return duration().div(periods);\n }\n\n /**\n * @notice Gets the current period based on the schedule\n * @return A number that represents the current period\n */\n function currentPeriod() public override view returns (uint256) {\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\n }\n\n /**\n * @notice Gets the number of periods that passed since the first period\n * @return A number of periods that passed since the schedule started\n */\n function passedPeriods() public override view returns (uint256) {\n return currentPeriod().sub(MIN_PERIOD);\n }\n\n // -- Locking & Release Schedule --\n\n /**\n * @notice Gets the currently available token according to the schedule\n * @dev Implements the step-by-step schedule based on periods for available tokens\n * @return Amount of tokens available according to the schedule\n */\n function availableAmount() public override view returns (uint256) {\n uint256 current = currentTime();\n\n // Before contract start no funds are available\n if (current < startTime) {\n return 0;\n }\n\n // After contract ended all funds are available\n if (current > endTime) {\n return managedAmount;\n }\n\n // Get available amount based on period\n return passedPeriods().mul(amountPerPeriod());\n }\n\n /**\n * @notice Gets the amount of currently vested tokens\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\n * @return Amount of tokens already vested\n */\n function vestedAmount() public override view returns (uint256) {\n // If non-revocable it is fully vested\n if (revocable == Revocability.Disabled) {\n return managedAmount;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n return availableAmount();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule and takes into account already released tokens\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public override view returns (uint256) {\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n uint256 releasable = availableAmount().sub(releasedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\n * @dev Does not consider schedule but just global amounts tracked\n * @return Amount of outstanding tokens for the lifetime of the contract\n */\n function totalOutstandingAmount() public override view returns (uint256) {\n return managedAmount.sub(releasedAmount);\n }\n\n /**\n * @notice Gets surplus amount in the contract based on outstanding amount to release\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary\n * @return Amount of tokens considered as surplus\n */\n function surplusAmount() public override view returns (uint256) {\n uint256 balance = currentBalance();\n uint256 outstandingAmount = totalOutstandingAmount();\n if (balance > outstandingAmount) {\n return balance.sub(outstandingAmount);\n }\n return 0;\n }\n\n // -- Value Transfer --\n\n /**\n * @notice Releases tokens based on the configured schedule\n * @dev All available releasable tokens are transferred to beneficiary\n */\n function release() external override onlyBeneficiary {\n uint256 amountToRelease = releasableAmount();\n require(amountToRelease > 0, \"No available releasable amount\");\n\n releasedAmount = releasedAmount.add(amountToRelease);\n\n token.safeTransfer(beneficiary, amountToRelease);\n\n emit TokensReleased(beneficiary, amountToRelease);\n }\n\n /**\n * @notice Withdraws surplus, unmanaged tokens from the contract\n * @dev Tokens in the contract over outstanding amount are considered as surplus\n * @param _amount Amount of tokens to withdraw\n */\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\n require(_amount > 0, \"Amount cannot be zero\");\n require(surplusAmount() >= _amount, \"Amount requested > surplus available\");\n\n token.safeTransfer(beneficiary, _amount);\n\n emit TokensWithdrawn(beneficiary, _amount);\n }\n\n /**\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\n * @dev Vesting schedule is always calculated based on managed tokens\n */\n function revoke() external override onlyOwner {\n require(revocable == Revocability.Enabled, \"Contract is non-revocable\");\n require(isRevoked == false, \"Already revoked\");\n\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\n require(unvestedAmount > 0, \"No available unvested amount\");\n\n isRevoked = true;\n\n token.safeTransfer(owner(), unvestedAmount);\n\n emit TokensRevoked(beneficiary, unvestedAmount);\n }\n}\n" + }, + "contracts/GraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/utils/EnumerableSet.sol\";\n\nimport \"./MinimalProxyFactory.sol\";\nimport \"./IGraphTokenLockManager.sol\";\n\n/**\n * @title GraphTokenLockManager\n * @notice This contract manages a list of authorized function calls and targets that can be called\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\n *\n * This contract receives funds to make the process of creating TokenLockWallet contracts\n * easier by distributing them the initial tokens to be managed.\n *\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\n * will manipulate users funds.\n */\ncontract GraphTokenLockManager is MinimalProxyFactory, IGraphTokenLockManager {\n using SafeERC20 for IERC20;\n using EnumerableSet for EnumerableSet.AddressSet;\n\n // -- State --\n\n mapping(bytes4 => address) public authFnCalls;\n EnumerableSet.AddressSet private _tokenDestinations;\n\n address public masterCopy;\n IERC20 private _token;\n\n // -- Events --\n\n event MasterCopyUpdated(address indexed masterCopy);\n event TokenLockCreated(\n address indexed contractAddress,\n bytes32 indexed initHash,\n address indexed beneficiary,\n address token,\n uint256 managedAmount,\n uint256 startTime,\n uint256 endTime,\n uint256 periods,\n uint256 releaseStartTime,\n uint256 vestingCliffTime,\n IGraphTokenLock.Revocability revocable\n );\n\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\n event TokenDestinationAllowed(address indexed dst, bool allowed);\n\n /**\n * Constructor.\n * @param _graphToken Token to use for deposits and withdrawals\n * @param _masterCopy Address of the master copy to use to clone proxies\n */\n constructor(IERC20 _graphToken, address _masterCopy) {\n require(address(_graphToken) != address(0), \"Token cannot be zero\");\n _token = _graphToken;\n setMasterCopy(_masterCopy);\n }\n\n // -- Factory --\n\n /**\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\n * @param _masterCopy Address of contract bytecode to factory clone\n */\n function setMasterCopy(address _masterCopy) public override onlyOwner {\n require(_masterCopy != address(0), \"MasterCopy cannot be zero\");\n masterCopy = _masterCopy;\n emit MasterCopyUpdated(_masterCopy);\n }\n\n /**\n * @notice Creates and fund a new token lock wallet using a minimum proxy\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _revocable Whether the contract is revocable\n */\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external override onlyOwner {\n require(_token.balanceOf(address(this)) >= _managedAmount, \"Not enough tokens to create lock\");\n\n // Create contract using a minimal proxy and call initializer\n bytes memory initializer = abi.encodeWithSignature(\n \"initialize(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\",\n address(this),\n _owner,\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\n\n // Send managed amount to the created contract\n _token.safeTransfer(contractAddress, _managedAmount);\n\n emit TokenLockCreated(\n contractAddress,\n keccak256(initializer),\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n\n // -- Funds Management --\n\n /**\n * @notice Gets the GRT token address\n * @return Token used for transfers and approvals\n */\n function token() external view override returns (IERC20) {\n return _token;\n }\n\n /**\n * @notice Deposits tokens into the contract\n * @dev Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external override {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n /**\n * @notice Withdraws tokens from the contract\n * @dev Escape hatch in case of mistakes or to recover remaining funds\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external override onlyOwner {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Token Destinations --\n\n /**\n * @notice Adds an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function addTokenDestination(address _dst) external override onlyOwner {\n require(_dst != address(0), \"Destination cannot be zero\");\n require(_tokenDestinations.add(_dst), \"Destination already added\");\n emit TokenDestinationAllowed(_dst, true);\n }\n\n /**\n * @notice Removes an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function removeTokenDestination(address _dst) external override onlyOwner {\n require(_tokenDestinations.remove(_dst), \"Destination already removed\");\n emit TokenDestinationAllowed(_dst, false);\n }\n\n /**\n * @notice Returns True if the address is authorized to be a destination of tokens\n * @param _dst Destination address\n * @return True if authorized\n */\n function isTokenDestination(address _dst) external view override returns (bool) {\n return _tokenDestinations.contains(_dst);\n }\n\n /**\n * @notice Returns an array of authorized destination addresses\n * @return Array of addresses authorized to pull funds from a token lock\n */\n function getTokenDestinations() external view override returns (address[] memory) {\n address[] memory dstList = new address[](_tokenDestinations.length());\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\n dstList[i] = _tokenDestinations.at(i);\n }\n return dstList;\n }\n\n // -- Function Call Authorization --\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\n _setAuthFunctionCall(_signature, _target);\n }\n\n /**\n * @notice Unsets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n */\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = address(0);\n\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\n }\n\n /**\n * @notice Sets an authorized function call to target in bulk\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signatures Function signatures\n * @param _targets Address of the destination contract to call\n */\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets)\n external\n override\n onlyOwner\n {\n require(_signatures.length == _targets.length, \"Array length mismatch\");\n\n for (uint256 i = 0; i < _signatures.length; i++) {\n _setAuthFunctionCall(_signatures[i], _targets[i]);\n }\n }\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\n require(_target != address(this), \"Target must be other contract\");\n require(Address.isContract(_target), \"Target must be a contract\");\n\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = _target;\n\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\n }\n\n /**\n * @notice Gets the target contract to call for a particular function signature\n * @param _sigHash Function signature hash\n * @return Address of the target contract where to send the call\n */\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\n return authFnCalls[_sigHash];\n }\n\n /**\n * @notice Returns true if the function call is authorized\n * @param _sigHash Function signature hash\n * @return True if authorized\n */\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\n return getAuthFunctionCallTarget(_sigHash) != address(0);\n }\n\n /**\n * @dev Converts a function signature string to 4-bytes hash\n * @param _signature Function signature string\n * @return Function signature hash\n */\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\n return _convertToBytes4(abi.encodeWithSignature(_signature));\n }\n\n /**\n * @dev Converts function signature bytes to function signature hash (bytes4)\n * @param _signature Function signature\n * @return Function signature in bytes4\n */\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\n require(_signature.length == 4, \"Invalid method signature\");\n bytes4 sigHash;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n sigHash := mload(add(_signature, 32))\n }\n return sigHash;\n }\n}\n" + }, + "contracts/GraphTokenLockSimple.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"./GraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLockSimple\n * @notice This contract is the concrete simple implementation built on top of the base\n * GraphTokenLock functionality for use when we only need the token lock schedule\n * features but no interaction with the network.\n * \n * This contract is designed to be deployed without the use of a TokenManager.\n */\ncontract GraphTokenLockSimple is GraphTokenLock {\n // Constructor\n constructor() {\n Ownable.initialize(msg.sender);\n }\n\n // Initializer\n function initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external onlyOwner {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n}\n" + }, + "contracts/GraphTokenLockWallet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport \"./GraphTokenLock.sol\";\nimport \"./IGraphTokenLockManager.sol\";\n\n/**\n * @title GraphTokenLockWallet\n * @notice This contract is built on top of the base GraphTokenLock functionality.\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\n * on specific contracts.\n *\n * The idea is that supporters with locked tokens can participate in the protocol\n * but disallow any release before the vesting/lock schedule.\n * The beneficiary can issue authorized function calls to this contract that will\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\n * The function calls allowed are queried to the GraphTokenLockManager, this way\n * the same configuration can be shared for all the created lock wallet contracts.\n *\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\n * with any of this contract functions.\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\n * the maximum amount of tokens is authorized.\n */\ncontract GraphTokenLockWallet is GraphTokenLock {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n // -- State --\n\n IGraphTokenLockManager public manager;\n uint256 public usedAmount;\n\n uint256 private constant MAX_UINT256 = 2**256 - 1;\n\n // -- Events --\n\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\n event TokenDestinationsApproved();\n event TokenDestinationsRevoked();\n\n // Initializer\n function initialize(\n address _manager,\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n _setManager(_manager);\n }\n\n // -- Admin --\n\n /**\n * @notice Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function setManager(address _newManager) external onlyOwner {\n _setManager(_newManager);\n }\n\n /**\n * @dev Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function _setManager(address _newManager) private {\n require(_newManager != address(0), \"Manager cannot be empty\");\n require(Address.isContract(_newManager), \"Manager must be a contract\");\n\n address oldManager = address(manager);\n manager = IGraphTokenLockManager(_newManager);\n\n emit ManagerUpdated(oldManager, _newManager);\n }\n\n // -- Beneficiary --\n\n /**\n * @notice Approves protocol access of the tokens managed by this contract\n * @dev Approves all token destinations registered in the manager to pull tokens\n */\n function approveProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n token.safeApprove(dstList[i], MAX_UINT256);\n }\n emit TokenDestinationsApproved();\n }\n\n /**\n * @notice Revokes protocol access of the tokens managed by this contract\n * @dev Revokes approval to all token destinations in the manager to pull tokens\n */\n function revokeProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n token.safeApprove(dstList[i], 0);\n }\n emit TokenDestinationsRevoked();\n }\n\n /**\n * @notice Forward authorized contract calls to protocol contracts\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\n */\n fallback() external payable {\n // Only beneficiary can forward calls\n require(msg.sender == beneficiary, \"Unauthorized caller\");\n\n // Function call validation\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\n require(_target != address(0), \"Unauthorized function\");\n\n uint256 oldBalance = currentBalance();\n\n // Call function with data\n Address.functionCall(_target, msg.data);\n\n // Tracked used tokens in the protocol\n // We do this check after balances were updated by the forwarded call\n // Check is only enforced for revocable contracts to save some gas\n if (revocable == Revocability.Enabled) {\n // Track contract balance change\n uint256 newBalance = currentBalance();\n if (newBalance < oldBalance) {\n // Outflow\n uint256 diff = oldBalance.sub(newBalance);\n usedAmount = usedAmount.add(diff);\n } else {\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\n // underflow. We set it to zero in that case.\n uint256 diff = newBalance.sub(oldBalance);\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\n }\n require(usedAmount <= vestedAmount(), \"Cannot use more tokens than vested amount\");\n }\n }\n}\n" + }, + "contracts/IGraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IGraphTokenLock {\n enum Revocability { NotSet, Enabled, Disabled }\n\n // -- Balances --\n\n function currentBalance() external view returns (uint256);\n\n // -- Time & Periods --\n\n function currentTime() external view returns (uint256);\n\n function duration() external view returns (uint256);\n\n function sinceStartTime() external view returns (uint256);\n\n function amountPerPeriod() external view returns (uint256);\n\n function periodDuration() external view returns (uint256);\n\n function currentPeriod() external view returns (uint256);\n\n function passedPeriods() external view returns (uint256);\n\n // -- Locking & Release Schedule --\n\n function availableAmount() external view returns (uint256);\n\n function vestedAmount() external view returns (uint256);\n\n function releasableAmount() external view returns (uint256);\n\n function totalOutstandingAmount() external view returns (uint256);\n\n function surplusAmount() external view returns (uint256);\n\n // -- Value Transfer --\n\n function release() external;\n\n function withdrawSurplus(uint256 _amount) external;\n\n function revoke() external;\n}\n" + }, + "contracts/IGraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./IGraphTokenLock.sol\";\n\ninterface IGraphTokenLockManager {\n // -- Factory --\n\n function setMasterCopy(address _masterCopy) external;\n\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external;\n\n // -- Funds Management --\n\n function token() external returns (IERC20);\n\n function deposit(uint256 _amount) external;\n\n function withdraw(uint256 _amount) external;\n\n // -- Allowed Funds Destinations --\n\n function addTokenDestination(address _dst) external;\n\n function removeTokenDestination(address _dst) external;\n\n function isTokenDestination(address _dst) external view returns (bool);\n\n function getTokenDestinations() external view returns (address[] memory);\n\n // -- Function Call Authorization --\n\n function setAuthFunctionCall(string calldata _signature, address _target) external;\n\n function unsetAuthFunctionCall(string calldata _signature) external;\n\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\n\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\n\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\n}\n" + }, + "contracts/MathUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nlibrary MathUtils {\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n}\n" + }, + "contracts/MinimalProxyFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/Create2.sol\";\n\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\n// Based on https://eips.ethereum.org/EIPS/eip-1167\ncontract MinimalProxyFactory is Ownable {\n // -- Events --\n\n event ProxyCreated(address indexed proxy);\n\n /**\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @return Address of the counterfactual MinimalProxy\n */\n function getDeploymentAddress(bytes32 _salt, address _implementation) external view returns (address) {\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), address(this));\n }\n\n /**\n * @notice Deploys a MinimalProxy with CREATE2\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @param _data Bytes with the initializer call\n * @return Address of the deployed MinimalProxy\n */\n function _deployProxy2(\n bytes32 _salt,\n address _implementation,\n bytes memory _data\n ) internal returns (address) {\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\n\n emit ProxyCreated(proxyAddress);\n\n // Call function with data\n if (_data.length > 0) {\n Address.functionCall(proxyAddress, _data);\n }\n\n return proxyAddress;\n }\n\n /**\n * @notice Gets the MinimalProxy bytecode\n * @param _implementation Address of the proxy target implementation\n * @return MinimalProxy bytecode\n */\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\n bytes10 creation = 0x3d602d80600a3d3981f3;\n bytes10 prefix = 0x363d3d373d3d3d363d73;\n bytes20 targetBytes = bytes20(_implementation);\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\n }\n}\n" + }, + "contracts/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\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 * The owner account will be passed on initialization of the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\ncontract Ownable {\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 owner) internal {\n _owner = owner;\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(_owner == msg.sender, \"Ownable: caller is not the owner\");\n _;\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() external virtual 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) external virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "contracts/Stakes.sol": { + "content": "pragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\n\n/**\n * @title A collection of data structures and functions to manage the Indexer Stake state.\n * Used for low-level state changes, require() conditions should be evaluated\n * at the caller function scope.\n */\nlibrary Stakes {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n struct Indexer {\n uint256 tokensStaked; // Tokens on the indexer stake (staked by the indexer)\n uint256 tokensAllocated; // Tokens used in allocations\n uint256 tokensLocked; // Tokens locked for withdrawal subject to thawing period\n uint256 tokensLockedUntil; // Block when locked tokens can be withdrawn\n }\n\n /**\n * @dev Deposit tokens to the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to deposit\n */\n function deposit(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.add(_tokens);\n }\n\n /**\n * @dev Release tokens from the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to release\n */\n function release(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.sub(_tokens);\n }\n\n /**\n * @dev Allocate tokens from the main stack to a SubgraphDeployment.\n * @param stake Stake data\n * @param _tokens Amount of tokens to allocate\n */\n function allocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.add(_tokens);\n }\n\n /**\n * @dev Unallocate tokens from a SubgraphDeployment back to the main stack.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unallocate\n */\n function unallocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.sub(_tokens);\n }\n\n /**\n * @dev Lock tokens until a thawing period pass.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _period Period in blocks that need to pass before withdrawal\n */\n function lockTokens(\n Stakes.Indexer storage stake,\n uint256 _tokens,\n uint256 _period\n ) internal {\n // Take into account period averaging for multiple unstake requests\n uint256 lockingPeriod = _period;\n if (stake.tokensLocked > 0) {\n lockingPeriod = stake.getLockingPeriod(_tokens, _period);\n }\n\n // Update balances\n stake.tokensLocked = stake.tokensLocked.add(_tokens);\n stake.tokensLockedUntil = block.number.add(lockingPeriod);\n }\n\n /**\n * @dev Unlock tokens.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unkock\n */\n function unlockTokens(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensLocked = stake.tokensLocked.sub(_tokens);\n if (stake.tokensLocked == 0) {\n stake.tokensLockedUntil = 0;\n }\n }\n\n /**\n * @dev Take all tokens out from the locked stake for withdrawal.\n * @param stake Stake data\n * @return Amount of tokens being withdrawn\n */\n function withdrawTokens(Stakes.Indexer storage stake) internal returns (uint256) {\n // Calculate tokens that can be released\n uint256 tokensToWithdraw = stake.tokensWithdrawable();\n\n if (tokensToWithdraw > 0) {\n // Reset locked tokens\n stake.unlockTokens(tokensToWithdraw);\n\n // Decrease indexer stake\n stake.release(tokensToWithdraw);\n }\n\n return tokensToWithdraw;\n }\n\n /**\n * @dev Get the locking period of the tokens to unstake.\n * If already unstaked before calculate the weighted average.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _thawingPeriod Period in blocks that need to pass before withdrawal\n * @return True if staked\n */\n function getLockingPeriod(\n Stakes.Indexer memory stake,\n uint256 _tokens,\n uint256 _thawingPeriod\n ) internal view returns (uint256) {\n uint256 blockNum = block.number;\n uint256 periodA = (stake.tokensLockedUntil > blockNum) ? stake.tokensLockedUntil.sub(blockNum) : 0;\n uint256 periodB = _thawingPeriod;\n uint256 stakeA = stake.tokensLocked;\n uint256 stakeB = _tokens;\n return periodA.mul(stakeA).add(periodB.mul(stakeB)).div(stakeA.add(stakeB));\n }\n\n /**\n * @dev Return true if there are tokens staked by the Indexer.\n * @param stake Stake data\n * @return True if staked\n */\n function hasTokens(Stakes.Indexer memory stake) internal pure returns (bool) {\n return stake.tokensStaked > 0;\n }\n\n /**\n * @dev Return the amount of tokens used in allocations and locked for withdrawal.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensUsed(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAllocated.add(stake.tokensLocked);\n }\n\n /**\n * @dev Return the amount of tokens staked not considering the ones that are already going\n * through the thawing period or are ready for withdrawal. We call it secure stake because\n * it is not subject to change by a withdraw call from the indexer.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensSecureStake(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensStaked.sub(stake.tokensLocked);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for any purpose.\n * Any token that is allocated cannot be used as well as tokens that are going through the\n * thawing period or are withdrawable\n * Calc: tokensStaked - tokensAllocated - tokensLocked\n * @param stake Stake data\n * @return Token amount\n */\n function tokensAvailable(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAvailableWithDelegation(0);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for allocations.\n * This function accepts a parameter for extra delegated capacity that takes into\n * account delegated tokens\n * @param stake Stake data\n * @param _delegatedCapacity Amount of tokens used from delegators to calculate availability\n * @return Token amount\n */\n function tokensAvailableWithDelegation(Stakes.Indexer memory stake, uint256 _delegatedCapacity)\n internal\n pure\n returns (uint256)\n {\n uint256 tokensCapacity = stake.tokensStaked.add(_delegatedCapacity);\n uint256 _tokensUsed = stake.tokensUsed();\n // If more tokens are used than the current capacity, the indexer is overallocated.\n // This means the indexer doesn't have available capacity to create new allocations.\n // We can reach this state when the indexer has funds allocated and then any\n // of these conditions happen:\n // - The delegationCapacity ratio is reduced.\n // - The indexer stake is slashed.\n // - A delegator removes enough stake.\n if (_tokensUsed > tokensCapacity) {\n // Indexer stake is over allocated: return 0 to avoid stake to be used until\n // the overallocation is restored by staking more tokens, unallocating tokens\n // or using more delegated funds\n return 0;\n }\n return tokensCapacity.sub(_tokensUsed);\n }\n\n /**\n * @dev Tokens available for withdrawal after thawing period.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensWithdrawable(Stakes.Indexer memory stake) internal view returns (uint256) {\n // No tokens to withdraw before locking period\n if (stake.tokensLockedUntil == 0 || block.number < stake.tokensLockedUntil) {\n return 0;\n }\n return stake.tokensLocked;\n }\n}\n" + }, + "contracts/StakingMock.sol": { + "content": "pragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./Stakes.sol\";\n\ncontract StakingMock {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n // -- State --\n\n uint256 public minimumIndexerStake = 100e18;\n uint256 public thawingPeriod = 10; // 10 blocks\n IERC20 public token;\n\n // Indexer stakes : indexer => Stake\n mapping(address => Stakes.Indexer) public stakes;\n\n /**\n * @dev Emitted when `indexer` stake `tokens` amount.\n */\n event StakeDeposited(address indexed indexer, uint256 tokens);\n\n /**\n * @dev Emitted when `indexer` unstaked and locked `tokens` amount `until` block.\n */\n event StakeLocked(address indexed indexer, uint256 tokens, uint256 until);\n\n /**\n * @dev Emitted when `indexer` withdrew `tokens` staked.\n */\n event StakeWithdrawn(address indexed indexer, uint256 tokens);\n\n // Contract constructor.\n constructor(IERC20 _token) {\n require(address(_token) != address(0), \"!token\");\n token = _token;\n }\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _tokens Amount of tokens to stake\n */\n function stake(uint256 _tokens) external {\n stakeTo(msg.sender, _tokens);\n }\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _indexer Address of the indexer\n * @param _tokens Amount of tokens to stake\n */\n function stakeTo(address _indexer, uint256 _tokens) public {\n require(_tokens > 0, \"!tokens\");\n\n // Ensure minimum stake\n require(stakes[_indexer].tokensSecureStake().add(_tokens) >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Transfer tokens to stake from caller to this contract\n require(token.transferFrom(msg.sender, address(this), _tokens), \"!transfer\");\n\n // Stake the transferred tokens\n _stake(_indexer, _tokens);\n }\n\n /**\n * @dev Unstake tokens from the indexer stake, lock them until thawing period expires.\n * @param _tokens Amount of tokens to unstake\n */\n function unstake(uint256 _tokens) external {\n address indexer = msg.sender;\n Stakes.Indexer storage indexerStake = stakes[indexer];\n\n require(_tokens > 0, \"!tokens\");\n require(indexerStake.hasTokens(), \"!stake\");\n require(indexerStake.tokensAvailable() >= _tokens, \"!stake-avail\");\n\n // Ensure minimum stake\n uint256 newStake = indexerStake.tokensSecureStake().sub(_tokens);\n require(newStake == 0 || newStake >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Before locking more tokens, withdraw any unlocked ones\n uint256 tokensToWithdraw = indexerStake.tokensWithdrawable();\n if (tokensToWithdraw > 0) {\n _withdraw(indexer);\n }\n\n indexerStake.lockTokens(_tokens, thawingPeriod);\n\n emit StakeLocked(indexer, indexerStake.tokensLocked, indexerStake.tokensLockedUntil);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n */\n function withdraw() external {\n _withdraw(msg.sender);\n }\n\n function _stake(address _indexer, uint256 _tokens) internal {\n // Deposit tokens into the indexer stake\n Stakes.Indexer storage indexerStake = stakes[_indexer];\n indexerStake.deposit(_tokens);\n\n emit StakeDeposited(_indexer, _tokens);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n * @param _indexer Address of indexer to withdraw funds from\n */\n function _withdraw(address _indexer) private {\n // Get tokens available for withdraw and update balance\n uint256 tokensToWithdraw = stakes[_indexer].withdrawTokens();\n require(tokensToWithdraw > 0, \"!tokens\");\n\n // Return tokens to the indexer\n require(token.transfer(_indexer, tokensToWithdraw), \"!transfer\");\n\n emit StakeWithdrawn(_indexer, tokensToWithdraw);\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": false, + "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 From 6f0c60ae96c8d7dc6a9b54564f632c0f091d9abc Mon Sep 17 00:00:00 2001 From: Pablo Carranza Velez Date: Mon, 19 Jun 2023 10:10:38 -0300 Subject: [PATCH 3/5] fix: make L2 deployment actually work --- deploy/3_l2_wallet.ts | 13 +------------ deploy/4_l1_transfer_tool.ts | 6 ++---- deploy/5_l2_manager.ts | 4 ++-- deploy/6_l2_transfer_tool.ts | 2 +- deploy/lib/utils.ts | 4 ++-- hardhat.config.ts | 13 ++++++++++++- package.json | 2 +- yarn.lock | 2 +- 8 files changed, 22 insertions(+), 24 deletions(-) diff --git a/deploy/3_l2_wallet.ts b/deploy/3_l2_wallet.ts index 9f71645..53a9f7f 100644 --- a/deploy/3_l2_wallet.ts +++ b/deploy/3_l2_wallet.ts @@ -3,7 +3,7 @@ import '@nomiclabs/hardhat-ethers' import { HardhatRuntimeEnvironment } from 'hardhat/types' import { DeployFunction } from 'hardhat-deploy/types' -import { getDeploymentName, promptContractAddress } from './lib/utils' +import { getDeploymentName } from './lib/utils' const logger = consola.create({}) @@ -12,17 +12,6 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deploy } = hre.deployments const { deployer } = await hre.getNamedAccounts() - // -- Graph Token -- - - // Get the token address we will use - const tokenAddress = await promptContractAddress('L2 GRT', logger) - if (!tokenAddress) { - logger.warn('No token address provided') - process.exit(1) - } - - // -- L2 Token Lock Manager -- - // Deploy the master copy of GraphTokenLockWallet logger.info('Deploying L2GraphTokenLockWallet master copy...') const masterCopySaveName = await getDeploymentName('L2GraphTokenLockWallet') diff --git a/deploy/4_l1_transfer_tool.ts b/deploy/4_l1_transfer_tool.ts index 60ae8f4..b8fb044 100644 --- a/deploy/4_l1_transfer_tool.ts +++ b/deploy/4_l1_transfer_tool.ts @@ -20,8 +20,6 @@ const l1TransferToolAbi = artifacts.readArtifactSync('L1GraphTokenLockTransferTo const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployer } = await hre.getNamedAccounts() - // -- Graph Token -- - // Get the addresses we will use const tokenAddress = await promptContractAddress('L1 GRT', logger) if (!tokenAddress) { @@ -49,8 +47,8 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { let owner = await promptContractAddress('owner (optional)', logger) if (!owner) { - logger.warn('No owner address provided, will use the deployer address as owner') - owner = deployer.address + owner = deployer + logger.warn(`No owner address provided, will use the deployer address as owner: ${owner}`) } // Deploy the L1GraphTokenLockTransferTool with a proxy. diff --git a/deploy/5_l2_manager.ts b/deploy/5_l2_manager.ts index 55606c2..5572345 100644 --- a/deploy/5_l2_manager.ts +++ b/deploy/5_l2_manager.ts @@ -20,7 +20,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { // -- Graph Token -- // Get the token address we will use - const tokenAddress = await promptContractAddress('L1 GRT', logger) + const tokenAddress = await promptContractAddress('L2 GRT', logger) if (!tokenAddress) { logger.warn('No token address provided') process.exit(1) @@ -42,6 +42,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { // Get the deployed L2GraphTokenLockWallet master copy address const masterCopyDeploy = await hre.deployments.get('L2GraphTokenLockWallet') + logger.info(`Using L2GraphTokenLockWallet at address: ${masterCopyDeploy.address}`) // Deploy the Manager that uses the master copy to clone contracts logger.info('Deploying L2GraphTokenLockManager...') const managerSaveName = await getDeploymentName('L2GraphTokenLockManager') @@ -74,6 +75,5 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { } func.tags = ['l2-manager', 'l2'] -func.dependencies = ['l2-wallet'] export default func diff --git a/deploy/6_l2_transfer_tool.ts b/deploy/6_l2_transfer_tool.ts index f03de5b..659a104 100644 --- a/deploy/6_l2_transfer_tool.ts +++ b/deploy/6_l2_transfer_tool.ts @@ -56,7 +56,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { })) as L1GraphTokenLockTransferTool // Save the deployment - const deploymentName = await getDeploymentName('L1GraphTokenLockTransferTool') + const deploymentName = await getDeploymentName('L2GraphTokenLockTransferTool') await hre.deployments.save(deploymentName, { abi: l2TransferToolAbi, address: transferTool.address, diff --git a/deploy/lib/utils.ts b/deploy/lib/utils.ts index c230376..7330f4e 100644 --- a/deploy/lib/utils.ts +++ b/deploy/lib/utils.ts @@ -15,7 +15,7 @@ export const askConfirm = async (message: string) => { return res.confirm } -export const promptContractAddress = async (name: string, logger: Consola): Promise => { +export const promptContractAddress = async (name: string, logger: Consola): Promise => { const res1 = await inquirer.prompt({ name: 'contract', type: 'input', @@ -26,7 +26,7 @@ export const promptContractAddress = async (name: string, logger: Consola): Prom return getAddress(res1.contract) } catch (err) { logger.error(err) - process.exit(1) + return null } } diff --git a/hardhat.config.ts b/hardhat.config.ts index 7500008..adeef70 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -38,6 +38,16 @@ const networkConfigs: NetworkConfig[] = [ { network: 'rinkeby', chainId: 4 }, { network: 'goerli', chainId: 5 }, { network: 'kovan', chainId: 42 }, + { + network: 'arbitrum-one', + chainId: 42161, + url: 'https://arb1.arbitrum.io/rpc', + }, + { + network: 'arbitrum-goerli', + chainId: 421613, + url: 'https://goerli-rollup.arbitrum.io/rpc', + }, ] function getAccountMnemonic() { @@ -136,8 +146,9 @@ const config = { }, }, etherscan: { - url: process.env.ETHERSCAN_API_URL, + //url: process.env.ETHERSCAN_API_URL, apiKey: process.env.ETHERSCAN_API_KEY, + customChains: [] }, typechain: { outDir: 'build/typechain/contracts', diff --git a/package.json b/package.json index e98fa1d..62e7111 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@graphprotocol/client-cli": "^2.0.2", "@graphprotocol/contracts": "^1.1.0", "@nomiclabs/hardhat-ethers": "^2.0.0", - "@nomiclabs/hardhat-etherscan": "^3.0.3", + "@nomiclabs/hardhat-etherscan": "^3.1.7", "@nomiclabs/hardhat-waffle": "^2.0.0", "@openzeppelin/contracts": "^3.3.0-solc-0.7", "@openzeppelin/contracts-upgradeable": "3.4.2", diff --git a/yarn.lock b/yarn.lock index 2a5e4b9..1892afd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2172,7 +2172,7 @@ resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.2.3.tgz#b41053e360c31a32c2640c9a45ee981a7e603fe0" integrity sha512-YhzPdzb612X591FOe68q+qXVXGG2ANZRvDo0RRUtimev85rCrAlv/TLMEZw5c+kq9AbzocLTVX/h2jVIFPL9Xg== -"@nomiclabs/hardhat-etherscan@^3.0.3": +"@nomiclabs/hardhat-etherscan@^3.1.7": version "3.1.7" resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-3.1.7.tgz#72e3d5bd5d0ceb695e097a7f6f5ff6fcbf062b9a" integrity sha512-tZ3TvSgpvsQ6B6OGmo1/Au6u8BrAkvs1mIC/eURA3xgIfznUZBhmpne8hv7BXUzw9xNL3fXdpOYgOQlVMTcoHQ== From 4c3df3349c8ce3258bba2c4089096db1ae0fdc57 Mon Sep 17 00:00:00 2001 From: Pablo Carranza Velez Date: Mon, 19 Jun 2023 10:10:52 -0300 Subject: [PATCH 4/5] chore: scratch 6 L2 deployments --- .openzeppelin/goerli.json | 135 ++ .openzeppelin/unknown-421613.json | 25 + deployments/arbitrum-goerli/.chainId | 1 + .../L2GraphTokenLockTransferTool.json | 110 ++ .../L2GraphTokenLockWallet.json | 1156 ++++++++++++++++ .../Scratch-6-L2-Manager-Old.json | 1161 +++++++++++++++++ .../arbitrum-goerli/Scratch-6-L2-Manager.json | 1161 +++++++++++++++++ .../b33621afedc711c06b58b28e08a7cfc9.json | 152 +++ .../goerli/L1GraphTokenLockTransferTool.json | 593 +++++++++ 9 files changed, 4494 insertions(+) create mode 100644 .openzeppelin/goerli.json create mode 100644 .openzeppelin/unknown-421613.json create mode 100644 deployments/arbitrum-goerli/.chainId create mode 100644 deployments/arbitrum-goerli/L2GraphTokenLockTransferTool.json create mode 100644 deployments/arbitrum-goerli/L2GraphTokenLockWallet.json create mode 100644 deployments/arbitrum-goerli/Scratch-6-L2-Manager-Old.json create mode 100644 deployments/arbitrum-goerli/Scratch-6-L2-Manager.json create mode 100644 deployments/arbitrum-goerli/solcInputs/b33621afedc711c06b58b28e08a7cfc9.json create mode 100644 deployments/goerli/L1GraphTokenLockTransferTool.json diff --git a/.openzeppelin/goerli.json b/.openzeppelin/goerli.json new file mode 100644 index 0000000..7d1d156 --- /dev/null +++ b/.openzeppelin/goerli.json @@ -0,0 +1,135 @@ +{ + "manifestVersion": "3.2", + "admin": { + "address": "0xae7689F1cd6F1058367112Aa3cB6551FA295c5e8", + "txHash": "0x33dbc2995f3e462d67ded698e102b526b52acca47ef54edbb0516256d47ae90c" + }, + "proxies": [ + { + "address": "0x739a6BC599347adA0Cec67520559F46eA8B9155E", + "txHash": "0xb5573f00c85aa1e6030e886539169f1ac1efd2685cb6176d5a33ae92a4e6be34", + "kind": "transparent" + } + ], + "impls": { + "341eb5d6655192ae31d6d3c7a80564f55f0b10c7b348ec97068ce47b70185003": { + "address": "0xc05C97797B868F0DB09E67370948bDD224792764", + "txHash": "0xd2ab63d5cf4f56b983c077f8373e86553876b4c2a65deac0ebf46f74e95c03c2", + "layout": { + "solcVersion": "0.7.3", + "storage": [ + { + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address", + "contract": "Ownable", + "src": "contracts/Ownable.sol:19" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "Ownable", + "src": "contracts/Ownable.sol:22" + }, + { + "label": "_initialized", + "offset": 0, + "slot": "51", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:25" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "51", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:30" + }, + { + "label": "l2LockManager", + "offset": 0, + "slot": "52", + "type": "t_mapping(t_address,t_address)", + "contract": "L1GraphTokenLockTransferTool", + "src": "contracts/L1GraphTokenLockTransferTool.sol:50" + }, + { + "label": "l2WalletOwner", + "offset": 0, + "slot": "53", + "type": "t_mapping(t_address,t_address)", + "contract": "L1GraphTokenLockTransferTool", + "src": "contracts/L1GraphTokenLockTransferTool.sol:53" + }, + { + "label": "l2WalletAddress", + "offset": 0, + "slot": "54", + "type": "t_mapping(t_address,t_address)", + "contract": "L1GraphTokenLockTransferTool", + "src": "contracts/L1GraphTokenLockTransferTool.sol:56" + }, + { + "label": "tokenLockETHBalances", + "offset": 0, + "slot": "55", + "type": "t_mapping(t_address,t_uint256)", + "contract": "L1GraphTokenLockTransferTool", + "src": "contracts/L1GraphTokenLockTransferTool.sol:59" + }, + { + "label": "l2Beneficiary", + "offset": 0, + "slot": "56", + "type": "t_mapping(t_address,t_address)", + "contract": "L1GraphTokenLockTransferTool", + "src": "contracts/L1GraphTokenLockTransferTool.sol:62" + }, + { + "label": "l2WalletAddressSetManually", + "offset": 0, + "slot": "57", + "type": "t_mapping(t_address,t_bool)", + "contract": "L1GraphTokenLockTransferTool", + "src": "contracts/L1GraphTokenLockTransferTool.sol:66" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_address)": { + "label": "mapping(address => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + } + } + } + } + } +} diff --git a/.openzeppelin/unknown-421613.json b/.openzeppelin/unknown-421613.json new file mode 100644 index 0000000..13fe9f7 --- /dev/null +++ b/.openzeppelin/unknown-421613.json @@ -0,0 +1,25 @@ +{ + "manifestVersion": "3.2", + "admin": { + "address": "0x71F1917472AF194fDDbD53D37843366075e0AB85", + "txHash": "0x4860fd3ed4a04ec03185e46bf1460bd7442cb06f71f8c8916c141b8cb4d2a512" + }, + "proxies": [ + { + "address": "0xf45306Cfef49B86A2D8964918FE33f780C76cAC2", + "txHash": "0xd2150150fe059eb6f0ea3323b71457bc54c7ee4294c2d82d539b4d2ab11fb958", + "kind": "transparent" + } + ], + "impls": { + "f41636e76bf4c9ffd1fc601ec54f31d61e3ff3d0ac46012d6c0b957d81bd812a": { + "address": "0x893728151DB307E2034516Aa7602c240c4f114b2", + "txHash": "0x7ee6681bdf3c07a8ed9478dae1a9273e1a94c819b494919254b14a5d5161f4ae", + "layout": { + "solcVersion": "0.7.3", + "storage": [], + "types": {} + } + } + } +} diff --git a/deployments/arbitrum-goerli/.chainId b/deployments/arbitrum-goerli/.chainId new file mode 100644 index 0000000..16be23a --- /dev/null +++ b/deployments/arbitrum-goerli/.chainId @@ -0,0 +1 @@ +421613 \ No newline at end of file diff --git a/deployments/arbitrum-goerli/L2GraphTokenLockTransferTool.json b/deployments/arbitrum-goerli/L2GraphTokenLockTransferTool.json new file mode 100644 index 0000000..7009aa9 --- /dev/null +++ b/deployments/arbitrum-goerli/L2GraphTokenLockTransferTool.json @@ -0,0 +1,110 @@ +{ + "address": "0xf45306Cfef49B86A2D8964918FE33f780C76cAC2", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "contract ITokenGateway", + "name": "_l2Gateway", + "type": "address" + }, + { + "internalType": "address", + "name": "_l1GraphToken", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Wallet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Wallet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2LockManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "LockedFundsSentToL1", + "type": "event" + }, + { + "inputs": [], + "name": "graphToken", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l1GraphToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2Gateway", + "outputs": [ + { + "internalType": "contract ITokenGateway", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawToL1Locked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xd2150150fe059eb6f0ea3323b71457bc54c7ee4294c2d82d539b4d2ab11fb958" +} \ No newline at end of file diff --git a/deployments/arbitrum-goerli/L2GraphTokenLockWallet.json b/deployments/arbitrum-goerli/L2GraphTokenLockWallet.json new file mode 100644 index 0000000..9df61fb --- /dev/null +++ b/deployments/arbitrum-goerli/L2GraphTokenLockWallet.json @@ -0,0 +1,1156 @@ +{ + "address": "0xd56945477322829aBD094A5343486bF75135DB73", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newBeneficiary", + "type": "address" + } + ], + "name": "BeneficiaryChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "LockAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "LockCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_oldManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "ManagerUpdated", + "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": [], + "name": "TokenDestinationsApproved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "TokenDestinationsRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "acceptLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "amountPerPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "approveProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "availableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "beneficiary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "cancelLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newBeneficiary", + "type": "address" + } + ], + "name": "changeBeneficiary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "currentBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "duration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "endTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_manager", + "type": "address" + }, + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "l1Address", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + } + ], + "internalType": "struct L2GraphTokenLockManager.TransferredWalletData", + "name": "_walletData", + "type": "tuple" + } + ], + "name": "initializeFromL1", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isAccepted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRevoked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "managedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "contract IGraphTokenLockManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "passedPeriods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periodDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periods", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasableAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "release", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "releaseStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "releasedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revocable", + "outputs": [ + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "revoke", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokeProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "revokedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newManager", + "type": "address" + } + ], + "name": "setManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sinceStartTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "startTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "surplusAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalOutstandingAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "usedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vestingCliffTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawSurplus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x80f733cbca37d9d8e146c30c031417f1ae63122e99d22875f44b5d242bb5374f", + "receipt": { + "to": null, + "from": "0x48Ed1128A24fe9053E3F0C8358eC43D86A18c121", + "contractAddress": "0xd56945477322829aBD094A5343486bF75135DB73", + "transactionIndex": 1, + "gasUsed": "4063753", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x7b94330a726ea1cc1b663395619379e70b49956d59a91254a55ecb0b76f85ba1", + "transactionHash": "0x80f733cbca37d9d8e146c30c031417f1ae63122e99d22875f44b5d242bb5374f", + "logs": [], + "blockNumber": 24578478, + "cumulativeGasUsed": "4063753", + "status": 1, + "byzantium": true + }, + "args": [], + "solcInputHash": "b33621afedc711c06b58b28e08a7cfc9", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newBeneficiary\",\"type\":\"address\"}],\"name\":\"BeneficiaryChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"LockAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"LockCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_oldManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"ManagerUpdated\",\"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\":[],\"name\":\"TokenDestinationsApproved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"TokenDestinationsRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"acceptLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"amountPerPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"approveProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"availableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"beneficiary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"cancelLock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newBeneficiary\",\"type\":\"address\"}],\"name\":\"changeBeneficiary\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"duration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"endTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"l1Address\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"}],\"internalType\":\"struct L2GraphTokenLockManager.TransferredWalletData\",\"name\":\"_walletData\",\"type\":\"tuple\"}],\"name\":\"initializeFromL1\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isAccepted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isInitialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isRevoked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"managedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"contract IGraphTokenLockManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"passedPeriods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periodDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"periods\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"release\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releaseStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releasedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revocable\",\"outputs\":[{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revoke\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokeProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revokedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newManager\",\"type\":\"address\"}],\"name\":\"setManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sinceStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"surplusAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalOutstandingAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"usedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vestingCliffTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdrawSurplus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"acceptLock()\":{\"details\":\"Can only be called by the beneficiary\"},\"amountPerPeriod()\":{\"returns\":{\"_0\":\"Amount of tokens available after each period\"}},\"approveProtocol()\":{\"details\":\"Approves all token destinations registered in the manager to pull tokens\"},\"availableAmount()\":{\"details\":\"Implements the step-by-step schedule based on periods for available tokens\",\"returns\":{\"_0\":\"Amount of tokens available according to the schedule\"}},\"cancelLock()\":{\"details\":\"Can only be called by the owner\"},\"changeBeneficiary(address)\":{\"details\":\"Can only be called by the beneficiary\",\"params\":{\"_newBeneficiary\":\"Address of the new beneficiary address\"}},\"currentBalance()\":{\"returns\":{\"_0\":\"Tokens held in the contract\"}},\"currentPeriod()\":{\"returns\":{\"_0\":\"A number that represents the current period\"}},\"currentTime()\":{\"returns\":{\"_0\":\"Current block timestamp\"}},\"duration()\":{\"returns\":{\"_0\":\"Amount of seconds from contract startTime to endTime\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"passedPeriods()\":{\"returns\":{\"_0\":\"A number of periods that passed since the schedule started\"}},\"periodDuration()\":{\"returns\":{\"_0\":\"Duration of each period in seconds\"}},\"releasableAmount()\":{\"details\":\"Considers the schedule, takes into account already released tokens and used amount\",\"returns\":{\"_0\":\"Amount of tokens ready to be released\"}},\"release()\":{\"details\":\"All available releasable tokens are transferred to beneficiary\"},\"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.\"},\"revoke()\":{\"details\":\"Vesting schedule is always calculated based on managed tokens\"},\"revokeProtocol()\":{\"details\":\"Revokes approval to all token destinations in the manager to pull tokens\"},\"setManager(address)\":{\"params\":{\"_newManager\":\"Address of the new manager\"}},\"sinceStartTime()\":{\"details\":\"Returns zero if called before conctract starTime\",\"returns\":{\"_0\":\"Seconds elapsed from contract startTime\"}},\"surplusAmount()\":{\"details\":\"All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary. Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\",\"returns\":{\"_0\":\"Amount of tokens considered as surplus\"}},\"totalOutstandingAmount()\":{\"details\":\"Does not consider schedule but just global amounts tracked\",\"returns\":{\"_0\":\"Amount of outstanding tokens for the lifetime of the contract\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"vestedAmount()\":{\"details\":\"Similar to available amount, but is fully vested when contract is non-revocable\",\"returns\":{\"_0\":\"Amount of tokens already vested\"}},\"withdrawSurplus(uint256)\":{\"details\":\"Tokens in the contract over outstanding amount are considered as surplus\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"L2GraphTokenLockWallet\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"acceptLock()\":{\"notice\":\"Beneficiary accepts the lock, the owner cannot retrieve back the tokens\"},\"amountPerPeriod()\":{\"notice\":\"Returns amount available to be released after each period according to schedule\"},\"approveProtocol()\":{\"notice\":\"Approves protocol access of the tokens managed by this contract\"},\"availableAmount()\":{\"notice\":\"Gets the currently available token according to the schedule\"},\"cancelLock()\":{\"notice\":\"Owner cancel the lock and return the balance in the contract\"},\"changeBeneficiary(address)\":{\"notice\":\"Change the beneficiary of funds managed by the contract\"},\"currentBalance()\":{\"notice\":\"Returns the amount of tokens currently held by the contract\"},\"currentPeriod()\":{\"notice\":\"Gets the current period based on the schedule\"},\"currentTime()\":{\"notice\":\"Returns the current block timestamp\"},\"duration()\":{\"notice\":\"Gets duration of contract from start to end in seconds\"},\"passedPeriods()\":{\"notice\":\"Gets the number of periods that passed since the first period\"},\"periodDuration()\":{\"notice\":\"Returns the duration of each period in seconds\"},\"releasableAmount()\":{\"notice\":\"Gets tokens currently available for release\"},\"release()\":{\"notice\":\"Releases tokens based on the configured schedule\"},\"revoke()\":{\"notice\":\"Revokes a vesting schedule and return the unvested tokens to the owner\"},\"revokeProtocol()\":{\"notice\":\"Revokes protocol access of the tokens managed by this contract\"},\"setManager(address)\":{\"notice\":\"Sets a new manager for this contract\"},\"sinceStartTime()\":{\"notice\":\"Gets time elapsed since the start of the contract\"},\"surplusAmount()\":{\"notice\":\"Gets surplus amount in the contract based on outstanding amount to release\"},\"totalOutstandingAmount()\":{\"notice\":\"Gets the outstanding amount yet to be released based on the whole contract lifetime\"},\"vestedAmount()\":{\"notice\":\"Gets the amount of currently vested tokens\"},\"withdrawSurplus(uint256)\":{\"notice\":\"Withdraws surplus, unmanaged tokens from the contract\"}},\"notice\":\"This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. This L2 variant includes a special initializer so that it can be created from a wallet's data received from L1. These transferred wallets will not allow releasing funds in L2 until the end of the vesting timeline, but they can allow withdrawing funds back to L1 using the L2GraphTokenLockTransferTool contract. Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1, so releasing surplus tokens might also only be possible by bridging tokens back to L1. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized. Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/L2GraphTokenLockWallet.sol\":\"L2GraphTokenLockWallet\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/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 * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\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 virtual 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 virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\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, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, 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) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\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 *\\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 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 *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\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 *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting 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 *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting 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 *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\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 * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\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 *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\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 *\\n * - The divisor cannot be zero.\\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\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\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\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\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 IERC20;` 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 /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\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 from 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. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\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\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\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\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with 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 function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual 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\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\\n address addr;\\n require(address(this).balance >= amount, \\\"Create2: insufficient balance\\\");\\n require(bytecode.length != 0, \\\"Create2: bytecode length is zero\\\");\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n }\\n require(addr != address(0), \\\"Create2: Failed on deploy\\\");\\n return addr;\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\\n bytes32 _data = keccak256(\\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\\n );\\n return address(uint160(uint256(_data)));\\n }\\n}\\n\",\"keccak256\":\"0x0a0b021149946014fe1cd04af11e7a937a29986c47e8b1b718c2d50d729472db\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <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\",\"keccak256\":\"0x1562cd9922fbf739edfb979f506809e2743789cbde3177515542161c3d04b164\",\"license\":\"MIT\"},\"contracts/GraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport \\\"./MathUtils.sol\\\";\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\n/**\\n * @title GraphTokenLock\\n * @notice Contract that manages an unlocking schedule of tokens.\\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\\n * they can only be released under certain time conditions.\\n *\\n * This contract implements a release scheduled based on periods and tokens are released in steps\\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\\n * It also supports revocation to be used for vesting schedules.\\n *\\n * The contract supports receiving extra funds than the managed tokens ones that can be\\n * withdrawn by the beneficiary at any time.\\n *\\n * A releaseStartTime parameter is included to override the default release schedule and\\n * perform the first release on the configured time. After that it will continue with the\\n * default schedule.\\n */\\nabstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n uint256 private constant MIN_PERIOD = 1;\\n\\n // -- State --\\n\\n IERC20 public token;\\n address public beneficiary;\\n\\n // Configuration\\n\\n // Amount of tokens managed by the contract schedule\\n uint256 public managedAmount;\\n\\n uint256 public startTime; // Start datetime (in unixtimestamp)\\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\\n uint256 public periods; // Number of vesting/release periods\\n\\n // First release date for tokens (in unixtimestamp)\\n // If set, no tokens will be released before releaseStartTime ignoring\\n // the amount to release each period\\n uint256 public releaseStartTime;\\n // A cliff set a date to which a beneficiary needs to get to vest\\n // all preceding periods\\n uint256 public vestingCliffTime;\\n Revocability public revocable; // Whether to use vesting for locked funds\\n\\n // State\\n\\n bool public isRevoked;\\n bool public isInitialized;\\n bool public isAccepted;\\n uint256 public releasedAmount;\\n uint256 public revokedAmount;\\n\\n // -- Events --\\n\\n event TokensReleased(address indexed beneficiary, uint256 amount);\\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\\n event TokensRevoked(address indexed beneficiary, uint256 amount);\\n event BeneficiaryChanged(address newBeneficiary);\\n event LockAccepted();\\n event LockCanceled();\\n\\n /**\\n * @dev Only allow calls from the beneficiary of the contract\\n */\\n modifier onlyBeneficiary() {\\n require(msg.sender == beneficiary, \\\"!auth\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the contract\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _vestingCliffTime Override time for when the vesting start\\n * @param _revocable Whether the contract is revocable\\n */\\n function _initialize(\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) internal {\\n require(!isInitialized, \\\"Already initialized\\\");\\n require(_owner != address(0), \\\"Owner cannot be zero\\\");\\n require(_beneficiary != address(0), \\\"Beneficiary cannot be zero\\\");\\n require(_token != address(0), \\\"Token cannot be zero\\\");\\n require(_managedAmount > 0, \\\"Managed tokens cannot be zero\\\");\\n require(_startTime != 0, \\\"Start time must be set\\\");\\n require(_startTime < _endTime, \\\"Start time > end time\\\");\\n require(_periods >= MIN_PERIOD, \\\"Periods cannot be below minimum\\\");\\n require(_revocable != Revocability.NotSet, \\\"Must set a revocability option\\\");\\n require(_releaseStartTime < _endTime, \\\"Release start time must be before end time\\\");\\n require(_vestingCliffTime < _endTime, \\\"Cliff time must be before end time\\\");\\n\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_owner);\\n beneficiary = _beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _managedAmount;\\n\\n startTime = _startTime;\\n endTime = _endTime;\\n periods = _periods;\\n\\n // Optionals\\n releaseStartTime = _releaseStartTime;\\n vestingCliffTime = _vestingCliffTime;\\n revocable = _revocable;\\n }\\n\\n /**\\n * @notice Change the beneficiary of funds managed by the contract\\n * @dev Can only be called by the beneficiary\\n * @param _newBeneficiary Address of the new beneficiary address\\n */\\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\\n require(_newBeneficiary != address(0), \\\"Empty beneficiary\\\");\\n beneficiary = _newBeneficiary;\\n emit BeneficiaryChanged(_newBeneficiary);\\n }\\n\\n /**\\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\\n * @dev Can only be called by the beneficiary\\n */\\n function acceptLock() external onlyBeneficiary {\\n isAccepted = true;\\n emit LockAccepted();\\n }\\n\\n /**\\n * @notice Owner cancel the lock and return the balance in the contract\\n * @dev Can only be called by the owner\\n */\\n function cancelLock() external onlyOwner {\\n require(isAccepted == false, \\\"Cannot cancel accepted contract\\\");\\n\\n token.safeTransfer(owner(), currentBalance());\\n\\n emit LockCanceled();\\n }\\n\\n // -- Balances --\\n\\n /**\\n * @notice Returns the amount of tokens currently held by the contract\\n * @return Tokens held in the contract\\n */\\n function currentBalance() public view override returns (uint256) {\\n return token.balanceOf(address(this));\\n }\\n\\n // -- Time & Periods --\\n\\n /**\\n * @notice Returns the current block timestamp\\n * @return Current block timestamp\\n */\\n function currentTime() public view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @notice Gets duration of contract from start to end in seconds\\n * @return Amount of seconds from contract startTime to endTime\\n */\\n function duration() public view override returns (uint256) {\\n return endTime.sub(startTime);\\n }\\n\\n /**\\n * @notice Gets time elapsed since the start of the contract\\n * @dev Returns zero if called before conctract starTime\\n * @return Seconds elapsed from contract startTime\\n */\\n function sinceStartTime() public view override returns (uint256) {\\n uint256 current = currentTime();\\n if (current <= startTime) {\\n return 0;\\n }\\n return current.sub(startTime);\\n }\\n\\n /**\\n * @notice Returns amount available to be released after each period according to schedule\\n * @return Amount of tokens available after each period\\n */\\n function amountPerPeriod() public view override returns (uint256) {\\n return managedAmount.div(periods);\\n }\\n\\n /**\\n * @notice Returns the duration of each period in seconds\\n * @return Duration of each period in seconds\\n */\\n function periodDuration() public view override returns (uint256) {\\n return duration().div(periods);\\n }\\n\\n /**\\n * @notice Gets the current period based on the schedule\\n * @return A number that represents the current period\\n */\\n function currentPeriod() public view override returns (uint256) {\\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\\n }\\n\\n /**\\n * @notice Gets the number of periods that passed since the first period\\n * @return A number of periods that passed since the schedule started\\n */\\n function passedPeriods() public view override returns (uint256) {\\n return currentPeriod().sub(MIN_PERIOD);\\n }\\n\\n // -- Locking & Release Schedule --\\n\\n /**\\n * @notice Gets the currently available token according to the schedule\\n * @dev Implements the step-by-step schedule based on periods for available tokens\\n * @return Amount of tokens available according to the schedule\\n */\\n function availableAmount() public view override returns (uint256) {\\n uint256 current = currentTime();\\n\\n // Before contract start no funds are available\\n if (current < startTime) {\\n return 0;\\n }\\n\\n // After contract ended all funds are available\\n if (current > endTime) {\\n return managedAmount;\\n }\\n\\n // Get available amount based on period\\n return passedPeriods().mul(amountPerPeriod());\\n }\\n\\n /**\\n * @notice Gets the amount of currently vested tokens\\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\\n * @return Amount of tokens already vested\\n */\\n function vestedAmount() public view override returns (uint256) {\\n // If non-revocable it is fully vested\\n if (revocable == Revocability.Disabled) {\\n return managedAmount;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n return availableAmount();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule and takes into account already released tokens\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view virtual override returns (uint256) {\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n uint256 releasable = availableAmount().sub(releasedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\\n * @dev Does not consider schedule but just global amounts tracked\\n * @return Amount of outstanding tokens for the lifetime of the contract\\n */\\n function totalOutstandingAmount() public view override returns (uint256) {\\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\\n }\\n\\n /**\\n * @notice Gets surplus amount in the contract based on outstanding amount to release\\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary.\\n * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be\\n * skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\\n * @return Amount of tokens considered as surplus\\n */\\n function surplusAmount() public view override returns (uint256) {\\n uint256 balance = currentBalance();\\n uint256 outstandingAmount = totalOutstandingAmount();\\n if (balance > outstandingAmount) {\\n return balance.sub(outstandingAmount);\\n }\\n return 0;\\n }\\n\\n // -- Value Transfer --\\n\\n /**\\n * @notice Releases tokens based on the configured schedule\\n * @dev All available releasable tokens are transferred to beneficiary\\n */\\n function release() external override onlyBeneficiary {\\n uint256 amountToRelease = releasableAmount();\\n require(amountToRelease > 0, \\\"No available releasable amount\\\");\\n\\n releasedAmount = releasedAmount.add(amountToRelease);\\n\\n token.safeTransfer(beneficiary, amountToRelease);\\n\\n emit TokensReleased(beneficiary, amountToRelease);\\n }\\n\\n /**\\n * @notice Withdraws surplus, unmanaged tokens from the contract\\n * @dev Tokens in the contract over outstanding amount are considered as surplus\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n require(surplusAmount() >= _amount, \\\"Amount requested > surplus available\\\");\\n\\n token.safeTransfer(beneficiary, _amount);\\n\\n emit TokensWithdrawn(beneficiary, _amount);\\n }\\n\\n /**\\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\\n * @dev Vesting schedule is always calculated based on managed tokens\\n */\\n function revoke() external override onlyOwner {\\n require(revocable == Revocability.Enabled, \\\"Contract is non-revocable\\\");\\n require(isRevoked == false, \\\"Already revoked\\\");\\n\\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\\n require(unvestedAmount > 0, \\\"No available unvested amount\\\");\\n\\n revokedAmount = unvestedAmount;\\n isRevoked = true;\\n\\n token.safeTransfer(owner(), unvestedAmount);\\n\\n emit TokensRevoked(beneficiary, unvestedAmount);\\n }\\n}\\n\",\"keccak256\":\"0xd89470956a476c2fcf4a09625775573f95ba2c60a57fe866d90f65de1bcf5f2d\",\"license\":\"MIT\"},\"contracts/GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/EnumerableSet.sol\\\";\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport \\\"./MinimalProxyFactory.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract GraphTokenLockManager is Ownable, MinimalProxyFactory, IGraphTokenLockManager {\\n using SafeERC20 for IERC20;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n // -- State --\\n\\n mapping(bytes4 => address) public authFnCalls;\\n EnumerableSet.AddressSet private _tokenDestinations;\\n\\n address public masterCopy;\\n IERC20 internal _token;\\n\\n // -- Events --\\n\\n event MasterCopyUpdated(address indexed masterCopy);\\n event TokenLockCreated(\\n address indexed contractAddress,\\n bytes32 indexed initHash,\\n address indexed beneficiary,\\n address token,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n uint256 periods,\\n uint256 releaseStartTime,\\n uint256 vestingCliffTime,\\n IGraphTokenLock.Revocability revocable\\n );\\n\\n event TokensDeposited(address indexed sender, uint256 amount);\\n event TokensWithdrawn(address indexed sender, uint256 amount);\\n\\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\\n event TokenDestinationAllowed(address indexed dst, bool allowed);\\n\\n /**\\n * Constructor.\\n * @param _graphToken Token to use for deposits and withdrawals\\n * @param _masterCopy Address of the master copy to use to clone proxies\\n */\\n constructor(IERC20 _graphToken, address _masterCopy) {\\n require(address(_graphToken) != address(0), \\\"Token cannot be zero\\\");\\n _token = _graphToken;\\n setMasterCopy(_masterCopy);\\n }\\n\\n // -- Factory --\\n\\n /**\\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\\n * @param _masterCopy Address of contract bytecode to factory clone\\n */\\n function setMasterCopy(address _masterCopy) public override onlyOwner {\\n require(_masterCopy != address(0), \\\"MasterCopy cannot be zero\\\");\\n masterCopy = _masterCopy;\\n emit MasterCopyUpdated(_masterCopy);\\n }\\n\\n /**\\n * @notice Creates and fund a new token lock wallet using a minimum proxy\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _revocable Whether the contract is revocable\\n */\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external override onlyOwner {\\n require(_token.balanceOf(address(this)) >= _managedAmount, \\\"Not enough tokens to create lock\\\");\\n\\n // Create contract using a minimal proxy and call initializer\\n bytes memory initializer = abi.encodeWithSelector(\\n GraphTokenLockWallet.initialize.selector,\\n address(this),\\n _owner,\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _managedAmount);\\n\\n emit TokenLockCreated(\\n contractAddress,\\n keccak256(initializer),\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n }\\n\\n // -- Funds Management --\\n\\n /**\\n * @notice Gets the GRT token address\\n * @return Token used for transfers and approvals\\n */\\n function token() external view override returns (IERC20) {\\n return _token;\\n }\\n\\n /**\\n * @notice Deposits tokens into the contract\\n * @dev Even if the ERC20 token can be transferred directly to the contract\\n * this function provide a safe interface to do the transfer and avoid mistakes\\n * @param _amount Amount to deposit\\n */\\n function deposit(uint256 _amount) external override {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransferFrom(msg.sender, address(this), _amount);\\n emit TokensDeposited(msg.sender, _amount);\\n }\\n\\n /**\\n * @notice Withdraws tokens from the contract\\n * @dev Escape hatch in case of mistakes or to recover remaining funds\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdraw(uint256 _amount) external override onlyOwner {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransfer(msg.sender, _amount);\\n emit TokensWithdrawn(msg.sender, _amount);\\n }\\n\\n // -- Token Destinations --\\n\\n /**\\n * @notice Adds an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function addTokenDestination(address _dst) external override onlyOwner {\\n require(_dst != address(0), \\\"Destination cannot be zero\\\");\\n require(_tokenDestinations.add(_dst), \\\"Destination already added\\\");\\n emit TokenDestinationAllowed(_dst, true);\\n }\\n\\n /**\\n * @notice Removes an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function removeTokenDestination(address _dst) external override onlyOwner {\\n require(_tokenDestinations.remove(_dst), \\\"Destination already removed\\\");\\n emit TokenDestinationAllowed(_dst, false);\\n }\\n\\n /**\\n * @notice Returns True if the address is authorized to be a destination of tokens\\n * @param _dst Destination address\\n * @return True if authorized\\n */\\n function isTokenDestination(address _dst) external view override returns (bool) {\\n return _tokenDestinations.contains(_dst);\\n }\\n\\n /**\\n * @notice Returns an array of authorized destination addresses\\n * @return Array of addresses authorized to pull funds from a token lock\\n */\\n function getTokenDestinations() external view override returns (address[] memory) {\\n address[] memory dstList = new address[](_tokenDestinations.length());\\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\\n dstList[i] = _tokenDestinations.at(i);\\n }\\n return dstList;\\n }\\n\\n // -- Function Call Authorization --\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\\n _setAuthFunctionCall(_signature, _target);\\n }\\n\\n /**\\n * @notice Unsets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n */\\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = address(0);\\n\\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target in bulk\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signatures Function signatures\\n * @param _targets Address of the destination contract to call\\n */\\n function setAuthFunctionCallMany(\\n string[] calldata _signatures,\\n address[] calldata _targets\\n ) external override onlyOwner {\\n require(_signatures.length == _targets.length, \\\"Array length mismatch\\\");\\n\\n for (uint256 i = 0; i < _signatures.length; i++) {\\n _setAuthFunctionCall(_signatures[i], _targets[i]);\\n }\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\\n require(_target != address(this), \\\"Target must be other contract\\\");\\n require(Address.isContract(_target), \\\"Target must be a contract\\\");\\n\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = _target;\\n\\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\\n }\\n\\n /**\\n * @notice Gets the target contract to call for a particular function signature\\n * @param _sigHash Function signature hash\\n * @return Address of the target contract where to send the call\\n */\\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\\n return authFnCalls[_sigHash];\\n }\\n\\n /**\\n * @notice Returns true if the function call is authorized\\n * @param _sigHash Function signature hash\\n * @return True if authorized\\n */\\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\\n return getAuthFunctionCallTarget(_sigHash) != address(0);\\n }\\n\\n /**\\n * @dev Converts a function signature string to 4-bytes hash\\n * @param _signature Function signature string\\n * @return Function signature hash\\n */\\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\\n return _convertToBytes4(abi.encodeWithSignature(_signature));\\n }\\n\\n /**\\n * @dev Converts function signature bytes to function signature hash (bytes4)\\n * @param _signature Function signature\\n * @return Function signature in bytes4\\n */\\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\\n require(_signature.length == 4, \\\"Invalid method signature\\\");\\n bytes4 sigHash;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sigHash := mload(add(_signature, 32))\\n }\\n return sigHash;\\n }\\n}\\n\",\"keccak256\":\"0x2bb51cc1a18bd88113fd6947067ad2fff33048c8904cb54adfda8e2ab86752f2\",\"license\":\"MIT\"},\"contracts/GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./GraphTokenLock.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract GraphTokenLockWallet is GraphTokenLock {\\n using SafeMath for uint256;\\n\\n // -- State --\\n\\n IGraphTokenLockManager public manager;\\n uint256 public usedAmount;\\n\\n // -- Events --\\n\\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\\n event TokenDestinationsApproved();\\n event TokenDestinationsRevoked();\\n\\n // Initializer\\n function initialize(\\n address _manager,\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) external {\\n _initialize(\\n _owner,\\n _beneficiary,\\n _token,\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n _setManager(_manager);\\n }\\n\\n // -- Admin --\\n\\n /**\\n * @notice Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function setManager(address _newManager) external onlyOwner {\\n _setManager(_newManager);\\n }\\n\\n /**\\n * @dev Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function _setManager(address _newManager) internal {\\n require(_newManager != address(0), \\\"Manager cannot be empty\\\");\\n require(Address.isContract(_newManager), \\\"Manager must be a contract\\\");\\n\\n address oldManager = address(manager);\\n manager = IGraphTokenLockManager(_newManager);\\n\\n emit ManagerUpdated(oldManager, _newManager);\\n }\\n\\n // -- Beneficiary --\\n\\n /**\\n * @notice Approves protocol access of the tokens managed by this contract\\n * @dev Approves all token destinations registered in the manager to pull tokens\\n */\\n function approveProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe because we are using the max uint256 value\\n token.approve(dstList[i], type(uint256).max);\\n }\\n emit TokenDestinationsApproved();\\n }\\n\\n /**\\n * @notice Revokes protocol access of the tokens managed by this contract\\n * @dev Revokes approval to all token destinations in the manager to pull tokens\\n */\\n function revokeProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe cause we're using 0 as the amount\\n token.approve(dstList[i], 0);\\n }\\n emit TokenDestinationsRevoked();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule, takes into account already released tokens and used amount\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view override returns (uint256) {\\n if (revocable == Revocability.Disabled) {\\n return super.releasableAmount();\\n }\\n\\n // -- Revocability enabled logic\\n // This needs to deal with additional considerations for when tokens are used in the protocol\\n\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n // We consider the `usedAmount` in the protocol as part of the calculations\\n // the beneficiary should not release funds that are used.\\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Forward authorized contract calls to protocol contracts\\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\\n */\\n // solhint-disable-next-line no-complex-fallback\\n fallback() external payable {\\n // Only beneficiary can forward calls\\n require(msg.sender == beneficiary, \\\"Unauthorized caller\\\");\\n require(msg.value == 0, \\\"ETH transfers not supported\\\");\\n\\n // Function call validation\\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\\n require(_target != address(0), \\\"Unauthorized function\\\");\\n\\n uint256 oldBalance = currentBalance();\\n\\n // Call function with data\\n Address.functionCall(_target, msg.data);\\n\\n // Tracked used tokens in the protocol\\n // We do this check after balances were updated by the forwarded call\\n // Check is only enforced for revocable contracts to save some gas\\n if (revocable == Revocability.Enabled) {\\n // Track contract balance change\\n uint256 newBalance = currentBalance();\\n if (newBalance < oldBalance) {\\n // Outflow\\n uint256 diff = oldBalance.sub(newBalance);\\n usedAmount = usedAmount.add(diff);\\n } else {\\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\\n // underflow. We set it to zero in that case.\\n uint256 diff = newBalance.sub(oldBalance);\\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\\n }\\n require(usedAmount <= vestedAmount(), \\\"Cannot use more tokens than vested amount\\\");\\n }\\n }\\n\\n /**\\n * @notice Receive function that always reverts.\\n * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159\\n */\\n receive() external payable {\\n revert(\\\"Bad call\\\");\\n }\\n}\\n\",\"keccak256\":\"0x976c2ba4c1503a81ea02bd84539c516e99af611ff767968ee25456b50a6deb7b\",\"license\":\"MIT\"},\"contracts/ICallhookReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\n\\n// Copied from graphprotocol/contracts, changed solidity version to 0.7.3\\n\\n/**\\n * @title Interface for contracts that can receive callhooks through the Arbitrum GRT bridge\\n * @dev Any contract that can receive a callhook on L2, sent through the bridge from L1, must\\n * be allowlisted by the governor, but also implement this interface that contains\\n * the function that will actually be called by the L2GraphTokenGateway.\\n */\\npragma solidity ^0.7.3;\\n\\ninterface ICallhookReceiver {\\n /**\\n * @notice Receive tokens with a callhook from the bridge\\n * @param _from Token sender in L1\\n * @param _amount Amount of tokens that were transferred\\n * @param _data ABI-encoded callhook data\\n */\\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external;\\n}\\n\",\"keccak256\":\"0xb90eae14e8bac012a4b99fabe7a1110f70143eb78476ea0d6b52557ef979fa0e\",\"license\":\"GPL-2.0-or-later\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/L2GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { ICallhookReceiver } from \\\"./ICallhookReceiver.sol\\\";\\nimport { GraphTokenLockManager } from \\\"./GraphTokenLockManager.sol\\\";\\nimport { L2GraphTokenLockWallet } from \\\"./L2GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title L2GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * In particular, this L2 variant is designed to receive token lock wallets from L1,\\n * through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until\\n * the end of the vesting timeline, but they can allow withdrawing funds back to L1 using\\n * the L2GraphTokenLockTransferTool contract.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract L2GraphTokenLockManager is GraphTokenLockManager, ICallhookReceiver {\\n using SafeERC20 for IERC20;\\n\\n /// @dev Struct to hold the data of a transferred wallet; this is\\n /// the data that must be encoded in L1 to send a wallet to L2.\\n struct TransferredWalletData {\\n address l1Address;\\n address owner;\\n address beneficiary;\\n uint256 managedAmount;\\n uint256 startTime;\\n uint256 endTime;\\n }\\n\\n /// Address of the L2GraphTokenGateway\\n address public immutable l2Gateway;\\n /// Address of the L1 transfer tool contract (in L1, no aliasing)\\n address public immutable l1TransferTool;\\n /// Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received)\\n /// L1 address => L2 address\\n mapping(address => address) public l1WalletToL2Wallet;\\n /// Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received)\\n /// L2 address => L1 address\\n mapping(address => address) public l2WalletToL1Wallet;\\n\\n /// @dev Event emitted when a wallet is received and created from L1\\n event TokenLockCreatedFromL1(\\n address indexed contractAddress,\\n bytes32 initHash,\\n address indexed beneficiary,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n address indexed l1Address\\n );\\n\\n /// @dev Emitted when locked tokens are received from L1 (whether the wallet\\n /// had already been received or not)\\n event LockedTokensReceivedFromL1(address indexed l1Address, address indexed l2Address, uint256 amount);\\n\\n /**\\n * @dev Checks that the sender is the L2GraphTokenGateway.\\n */\\n modifier onlyL2Gateway() {\\n require(msg.sender == l2Gateway, \\\"ONLY_GATEWAY\\\");\\n _;\\n }\\n\\n /**\\n * @notice Constructor for the L2GraphTokenLockManager contract.\\n * @param _graphToken Address of the L2 GRT token contract\\n * @param _masterCopy Address of the master copy of the L2GraphTokenLockWallet implementation\\n * @param _l2Gateway Address of the L2GraphTokenGateway contract\\n * @param _l1TransferTool Address of the L1 transfer tool contract (in L1, without aliasing)\\n */\\n constructor(\\n IERC20 _graphToken,\\n address _masterCopy,\\n address _l2Gateway,\\n address _l1TransferTool\\n ) GraphTokenLockManager(_graphToken, _masterCopy) {\\n l2Gateway = _l2Gateway;\\n l1TransferTool = _l1TransferTool;\\n }\\n\\n /**\\n * @notice This function is called by the L2GraphTokenGateway when tokens are sent from L1.\\n * @dev This function will create a new wallet if it doesn't exist yet, or send the tokens to\\n * the existing wallet if it does.\\n * @param _from Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\\n * @param _amount Amount of tokens received\\n * @param _data Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\\n */\\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external override onlyL2Gateway {\\n require(_from == l1TransferTool, \\\"ONLY_TRANSFER_TOOL\\\");\\n TransferredWalletData memory walletData = abi.decode(_data, (TransferredWalletData));\\n\\n if (l1WalletToL2Wallet[walletData.l1Address] != address(0)) {\\n // If the wallet was already received, just send the tokens to the L2 address\\n _token.safeTransfer(l1WalletToL2Wallet[walletData.l1Address], _amount);\\n } else {\\n // Create contract using a minimal proxy and call initializer\\n (bytes32 initHash, address contractAddress) = _deployFromL1(keccak256(_data), walletData);\\n l1WalletToL2Wallet[walletData.l1Address] = contractAddress;\\n l2WalletToL1Wallet[contractAddress] = walletData.l1Address;\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _amount);\\n\\n emit TokenLockCreatedFromL1(\\n contractAddress,\\n initHash,\\n walletData.beneficiary,\\n walletData.managedAmount,\\n walletData.startTime,\\n walletData.endTime,\\n walletData.l1Address\\n );\\n }\\n emit LockedTokensReceivedFromL1(walletData.l1Address, l1WalletToL2Wallet[walletData.l1Address], _amount);\\n }\\n\\n /**\\n * @dev Deploy a token lock wallet with data received from L1\\n * @param _salt Salt for the CREATE2 call, which must be the hash of the wallet data\\n * @param _walletData Data of the wallet to be created\\n * @return Hash of the initialization calldata\\n * @return Address of the created contract\\n */\\n function _deployFromL1(bytes32 _salt, TransferredWalletData memory _walletData) internal returns (bytes32, address) {\\n bytes memory initializer = _encodeInitializer(_walletData);\\n address contractAddress = _deployProxy2(_salt, masterCopy, initializer);\\n return (keccak256(initializer), contractAddress);\\n }\\n\\n /**\\n * @dev Encode the initializer for the token lock wallet received from L1\\n * @param _walletData Data of the wallet to be created\\n * @return Encoded initializer calldata, including the function signature\\n */\\n function _encodeInitializer(TransferredWalletData memory _walletData) internal view returns (bytes memory) {\\n return\\n abi.encodeWithSelector(\\n L2GraphTokenLockWallet.initializeFromL1.selector,\\n address(this),\\n address(_token),\\n _walletData\\n );\\n }\\n}\\n\",\"keccak256\":\"0x34ca0ffc898ce3615a000d53a9c58708354b8cd8093b3c61decfe7388f0c16e0\",\"license\":\"MIT\"},\"contracts/L2GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport { L2GraphTokenLockManager } from \\\"./L2GraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title L2GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * This L2 variant includes a special initializer so that it can be created from\\n * a wallet's data received from L1. These transferred wallets will not allow releasing\\n * funds in L2 until the end of the vesting timeline, but they can allow withdrawing\\n * funds back to L1 using the L2GraphTokenLockTransferTool contract.\\n *\\n * Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1,\\n * so releasing surplus tokens might also only be possible by bridging tokens back to L1.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract L2GraphTokenLockWallet is GraphTokenLockWallet {\\n // Initializer when created from a message from L1\\n function initializeFromL1(\\n address _manager,\\n address _token,\\n L2GraphTokenLockManager.TransferredWalletData calldata _walletData\\n ) external {\\n require(!isInitialized, \\\"Already initialized\\\");\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_walletData.owner);\\n beneficiary = _walletData.beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _walletData.managedAmount;\\n\\n startTime = _walletData.startTime;\\n endTime = _walletData.endTime;\\n periods = 1;\\n isAccepted = true;\\n\\n // Optionals\\n releaseStartTime = _walletData.endTime;\\n revocable = Revocability.Disabled;\\n\\n _setManager(_manager);\\n }\\n}\\n\",\"keccak256\":\"0x8842140c2c7924be4ab1bca71e0b0ad6dd1dba6433cfdc523bfd204288b25d20\",\"license\":\"MIT\"},\"contracts/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nlibrary MathUtils {\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0xe2512e1da48bc8363acd15f66229564b02d66706665d7da740604566913c1400\",\"license\":\"MIT\"},\"contracts/MinimalProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport { Address } from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport { Create2 } from \\\"@openzeppelin/contracts/utils/Create2.sol\\\";\\n\\n/**\\n * @title MinimalProxyFactory: a factory contract for creating minimal proxies\\n * @notice Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\\n * Based on https://eips.ethereum.org/EIPS/eip-1167\\n */\\ncontract MinimalProxyFactory {\\n /// @dev Emitted when a new proxy is created\\n event ProxyCreated(address indexed proxy);\\n\\n /**\\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _deployer Address of the deployer that creates the contract\\n * @return Address of the counterfactual MinimalProxy\\n */\\n function getDeploymentAddress(\\n bytes32 _salt,\\n address _implementation,\\n address _deployer\\n ) public pure returns (address) {\\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), _deployer);\\n }\\n\\n /**\\n * @dev Deploys a MinimalProxy with CREATE2\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _data Bytes with the initializer call\\n * @return Address of the deployed MinimalProxy\\n */\\n function _deployProxy2(bytes32 _salt, address _implementation, bytes memory _data) internal returns (address) {\\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\\n\\n emit ProxyCreated(proxyAddress);\\n\\n // Call function with data\\n if (_data.length > 0) {\\n Address.functionCall(proxyAddress, _data);\\n }\\n\\n return proxyAddress;\\n }\\n\\n /**\\n * @dev Gets the MinimalProxy bytecode\\n * @param _implementation Address of the proxy target implementation\\n * @return MinimalProxy bytecode\\n */\\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\\n bytes10 creation = 0x3d602d80600a3d3981f3;\\n bytes10 prefix = 0x363d3d373d3d3d363d73;\\n bytes20 targetBytes = bytes20(_implementation);\\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\\n }\\n}\\n\",\"keccak256\":\"0x67d67a567bceb363ddb199b1e4ab06e7a99f16e034e03086971a332c09ec5c0e\",\"license\":\"MIT\"},\"contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\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 * The owner account will be passed on initialization of the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\n /// @dev Owner of the contract, can be retrieved with the public owner() function\\n address private _owner;\\n /// @dev Since upgradeable contracts might inherit this, we add a storage gap\\n /// to allow adding variables here without breaking the proxy storage layout\\n uint256[50] private __gap;\\n\\n /// @dev Emitted when ownership of the contract is transferred\\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 owner) internal {\\n _owner = owner;\\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(_owner == msg.sender, \\\"Ownable: caller is not the owner\\\");\\n _;\\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() external virtual 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) external virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xe8750687082e8e24b620dbf58c3a08eee591ed7b4d5a3e13cc93554ec647fd09\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506148f5806100206000396000f3fe6080604052600436106102605760003560e01c80637bdf05af11610144578063bc0163c1116100b6578063dc0706571161007a578063dc07065714610bc7578063e8dda6f514610bf0578063e97d87d514610c1b578063ebbab99214610c46578063f2fde38b14610c71578063fc0c546a14610c9a576102a0565b8063bc0163c114610af4578063bd896dcb14610b1f578063ce845d1d14610b48578063d0ebdbe714610b73578063d18e81b314610b9c576102a0565b80638da5cb5b116101085780638da5cb5b14610a0857806391f7cfb914610a33578063a4caeb4214610a5e578063b0d1818c14610a89578063b470aade14610ab2578063b6549f7514610add576102a0565b80637bdf05af1461095957806386d00e021461098457806386d1a69f146109af578063872a7810146109c65780638a5bdf5c146109f1576102a0565b806338af3eed116101dd578063481c6a75116101a1578063481c6a751461087f5780635051a5ec146108aa5780635b940081146108d557806360e7994414610900578063715018a61461091757806378e979251461092e576102a0565b806338af3eed146107a8578063392e53cd146107d3578063398057a3146107fe57806344b1231f1461082957806345d30a1714610854576102a0565b806320dc203d1161022457806320dc203d146106e75780632a627814146107105780632bc9ed02146107275780633197cbb61461075257806337aeb0861461077d576102a0565b8063029c6c9f14610624578063060406181461064f5780630b80f7771461067a5780630dff24d5146106915780630fb5a6b4146106bc576102a0565b366102a0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610297906141f3565b60405180910390fd5b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610330576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610327906143d3565b60405180910390fd5b60003414610373576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036a90614213565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b81526004016103f49190614165565b60206040518083038186803b15801561040c57600080fd5b505afa158015610420573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610444919061338f565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ad906144d3565b60405180910390fd5b60006104c0610cc5565b9050610511826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610d77565b506001600281111561051f57fe5b603b60009054906101000a900460ff16600281111561053a57fe5b141561062057600061054a610cc5565b90508181101561058c5760006105698284610dc190919063ffffffff16565b905061058081603f54610e1190919063ffffffff16565b603f81905550506105d2565b60006105a18383610dc190919063ffffffff16565b9050603f548110156105c7576105c281603f54610dc190919063ffffffff16565b6105ca565b60005b603f81905550505b6105da610e66565b603f54111561061e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061590614433565b60405180910390fd5b505b5050005b34801561063057600080fd5b50610639610ed5565b6040516106469190614673565b60405180910390f35b34801561065b57600080fd5b50610664610ef3565b6040516106719190614673565b60405180910390f35b34801561068657600080fd5b5061068f610f2e565b005b34801561069d57600080fd5b506106a661109b565b6040516106b39190614673565b60405180910390f35b3480156106c857600080fd5b506106d16110e2565b6040516106de9190614673565b60405180910390f35b3480156106f357600080fd5b5061070e600480360381019061070991906134a8565b611100565b005b34801561071c57600080fd5b5061072561129b565b005b34801561073357600080fd5b5061073c611500565b604051610749919061414a565b60405180910390f35b34801561075e57600080fd5b50610767611513565b6040516107749190614673565b60405180910390f35b34801561078957600080fd5b50610792611519565b60405161079f9190614673565b60405180910390f35b3480156107b457600080fd5b506107bd61151f565b6040516107ca91906140dd565b60405180910390f35b3480156107df57600080fd5b506107e8611545565b6040516107f5919061414a565b60405180910390f35b34801561080a57600080fd5b50610813611558565b6040516108209190614673565b60405180910390f35b34801561083557600080fd5b5061083e610e66565b60405161084b9190614673565b60405180910390f35b34801561086057600080fd5b5061086961155e565b6040516108769190614673565b60405180910390f35b34801561088b57600080fd5b50610894611564565b6040516108a1919061419b565b60405180910390f35b3480156108b657600080fd5b506108bf61158a565b6040516108cc919061414a565b60405180910390f35b3480156108e157600080fd5b506108ea61159d565b6040516108f79190614673565b60405180910390f35b34801561090c57600080fd5b506109156116a8565b005b34801561092357600080fd5b5061092c6118ee565b005b34801561093a57600080fd5b50610943611a3a565b6040516109509190614673565b60405180910390f35b34801561096557600080fd5b5061096e611a40565b60405161097b9190614673565b60405180910390f35b34801561099057600080fd5b50610999611a7c565b6040516109a69190614673565b60405180910390f35b3480156109bb57600080fd5b506109c4611a82565b005b3480156109d257600080fd5b506109db611c5e565b6040516109e891906141b6565b60405180910390f35b3480156109fd57600080fd5b50610a06611c71565b005b348015610a1457600080fd5b50610a1d611d4a565b604051610a2a91906140dd565b60405180910390f35b348015610a3f57600080fd5b50610a48611d73565b604051610a559190614673565b60405180910390f35b348015610a6a57600080fd5b50610a73611dd1565b604051610a809190614673565b60405180910390f35b348015610a9557600080fd5b50610ab06004803603810190610aab9190613562565b611dd7565b005b348015610abe57600080fd5b50610ac7611fd6565b604051610ad49190614673565b60405180910390f35b348015610ae957600080fd5b50610af2611ff9565b005b348015610b0057600080fd5b50610b09612291565b604051610b169190614673565b60405180910390f35b348015610b2b57600080fd5b50610b466004803603810190610b4191906133b8565b6122c3565b005b348015610b5457600080fd5b50610b5d610cc5565b604051610b6a9190614673565b60405180910390f35b348015610b7f57600080fd5b50610b9a6004803603810190610b959190613366565b6122eb565b005b348015610ba857600080fd5b50610bb1612385565b604051610bbe9190614673565b60405180910390f35b348015610bd357600080fd5b50610bee6004803603810190610be99190613366565b61238d565b005b348015610bfc57600080fd5b50610c05612508565b604051610c129190614673565b60405180910390f35b348015610c2757600080fd5b50610c3061250e565b604051610c3d9190614673565b60405180910390f35b348015610c5257600080fd5b50610c5b612514565b604051610c689190614673565b60405180910390f35b348015610c7d57600080fd5b50610c986004803603810190610c939190613366565b612536565b005b348015610ca657600080fd5b50610caf6126f1565b604051610cbc9190614180565b60405180910390f35b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610d2291906140dd565b60206040518083038186803b158015610d3a57600080fd5b505afa158015610d4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d72919061358b565b905090565b6060610db983836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612717565b905092915050565b600082821115610e06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dfd90614333565b60405180910390fd5b818303905092915050565b600080828401905083811015610e5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e53906142b3565b60405180910390fd5b8091505092915050565b6000600280811115610e7457fe5b603b60009054906101000a900460ff166002811115610e8f57fe5b1415610e9f576035549050610ed2565b6000603a54118015610eb95750603a54610eb7612385565b105b15610ec75760009050610ed2565b610ecf611d73565b90505b90565b6000610eee60385460355461272f90919063ffffffff16565b905090565b6000610f296001610f1b610f05611fd6565b610f0d611a40565b61272f90919063ffffffff16565b610e1190919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb390614493565b60405180910390fd5b60001515603b60039054906101000a900460ff16151514611012576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100990614313565b60405180910390fd5b61106d61101d611d4a565b611025610cc5565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b7f171f0bcbda3370351cea17f3b164bee87d77c2503b94abdf2720a814ebe7e9df60405160405180910390a1565b6000806110a6610cc5565b905060006110b2612291565b9050808211156110d8576110cf8183610dc190919063ffffffff16565b925050506110df565b6000925050505b90565b60006110fb603654603754610dc190919063ffffffff16565b905090565b603b60029054906101000a900460ff1615611150576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114790614533565b60405180910390fd5b6001603b60026101000a81548160ff0219169083151502179055506111868160200160208101906111819190613366565b61280b565b8060400160208101906111999190613366565b603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806060013560358190555080608001356036819055508060a0013560378190555060016038819055506001603b60036101000a81548160ff0219169083151502179055508060a001356039819055506002603b60006101000a81548160ff0219169083600281111561128857fe5b0217905550611296836128a9565b505050565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461132b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132290614593565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b15801561139557600080fd5b505afa1580156113a9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906113d291906134f8565b905060005b81518110156114d057603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061142a57fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611470929190614121565b602060405180830381600087803b15801561148a57600080fd5b505af115801561149e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c29190613539565b5080806001019150506113d7565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b603b60019054906101000a900460ff1681565b60375481565b603d5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60029054906101000a900460ff1681565b60355481565b603c5481565b603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60039054906101000a900460ff1681565b60006002808111156115ab57fe5b603b60009054906101000a900460ff1660028111156115c657fe5b14156115db576115d4612a27565b90506116a5565b60006039541180156115f557506039546115f3612385565b105b1561160357600090506116a5565b6001600281111561161057fe5b603b60009054906101000a900460ff16600281111561162b57fe5b14801561163a57506000603a54115b801561164e5750603a5461164c612385565b105b1561165c57600090506116a5565b600061168e603f54611680603c54611672611d73565b610dc190919063ffffffff16565b610dc190919063ffffffff16565b90506116a161169b610cc5565b82612ae1565b9150505b90565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611738576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172f90614593565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156117a257600080fd5b505afa1580156117b6573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906117df91906134f8565b905060005b81518110156118be57603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061183757fe5b602002602001015160006040518363ffffffff1660e01b815260040161185e9291906140f8565b602060405180830381600087803b15801561187857600080fd5b505af115801561188c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118b09190613539565b5080806001019150506117e4565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461197c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197390614493565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60365481565b600080611a4b612385565b90506036548111611a60576000915050611a79565b611a7560365482610dc190919063ffffffff16565b9150505b90565b603a5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b0990614593565b60405180910390fd5b6000611b1c61159d565b905060008111611b61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b58906145f3565b60405180910390fd5b611b7681603c54610e1190919063ffffffff16565b603c81905550611beb603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df9317982604051611c539190614673565b60405180910390a250565b603b60009054906101000a900460ff1681565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cf890614593565b60405180910390fd5b6001603b60036101000a81548160ff0219169083151502179055507fbeb3313724453131feb0a765a03e6715bb720e0f973a31fcbafa2d2f048c188b60405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080611d7e612385565b9050603654811015611d94576000915050611dce565b603754811115611da957603554915050611dce565b611dca611db4610ed5565b611dbc612514565b612afa90919063ffffffff16565b9150505b90565b60385481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e5e90614593565b60405180910390fd5b60008111611eaa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea190614413565b60405180910390fd5b80611eb361109b565b1015611ef4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eeb90614513565b60405180910390fd5b611f63603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b82604051611fcb9190614673565b60405180910390a250565b6000611ff4603854611fe66110e2565b61272f90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612087576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161207e90614493565b60405180910390fd5b6001600281111561209457fe5b603b60009054906101000a900460ff1660028111156120af57fe5b146120ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e690614553565b60405180910390fd5b60001515603b60019054906101000a900460ff16151514612145576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161213c90614653565b60405180910390fd5b6000612163612152610e66565b603554610dc190919063ffffffff16565b9050600081116121a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161219f906142d3565b60405180910390fd5b80603d819055506001603b60016101000a81548160ff02191690831515021790555061221e6121d5611d4a565b82603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040516122869190614673565b60405180910390a250565b60006122be603d546122b0603c54603554610dc190919063ffffffff16565b610dc190919063ffffffff16565b905090565b6122d58a8a8a8a8a8a8a8a8a8a612b6a565b6122de8b6128a9565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612379576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161237090614493565b60405180910390fd5b612382816128a9565b50565b600042905090565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461241d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161241490614593565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561248d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612484906143b3565b60405180910390fd5b80603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d816040516124fd91906140dd565b60405180910390a150565b603f5481565b60395481565b60006125316001612523610ef3565b610dc190919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146125c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125bb90614493565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612634576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161262b90614293565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606127268484600085612ff4565b90509392505050565b6000808211612773576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276a90614393565b60405180910390fd5b81838161277c57fe5b04905092915050565b6128068363a9059cbb60e01b84846040516024016127a4929190614121565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613109565b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612919576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161291090614573565b60405180910390fd5b612922816131d0565b612961576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612958906143f3565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b600080603954118015612a425750603954612a40612385565b105b15612a505760009050612ade565b60016002811115612a5d57fe5b603b60009054906101000a900460ff166002811115612a7857fe5b148015612a8757506000603a54115b8015612a9b5750603a54612a99612385565b105b15612aa95760009050612ade565b6000612ac7603c54612ab9611d73565b610dc190919063ffffffff16565b9050612ada612ad4610cc5565b82612ae1565b9150505b90565b6000818310612af05781612af2565b825b905092915050565b600080831415612b0d5760009050612b64565b6000828402905082848281612b1e57fe5b0414612b5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b5690614473565b60405180910390fd5b809150505b92915050565b603b60029054906101000a900460ff1615612bba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bb190614533565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415612c2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c21906142f3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff161415612c9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c9190614633565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff161415612d0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d0190614613565b60405180910390fd5b60008711612d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d4490614373565b60405180910390fd5b6000861415612d91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d88906144b3565b60405180910390fd5b848610612dd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dca90614253565b60405180910390fd5b6001841015612e17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0e90614453565b60405180910390fd5b60006002811115612e2457fe5b816002811115612e3057fe5b1415612e71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e6890614273565b60405180910390fd5b848310612eb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eaa906145b3565b60405180910390fd5b848210612ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eec90614233565b60405180910390fd5b6001603b60026101000a81548160ff021916908315150217905550612f198a61280b565b88603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550866035819055508560368190555084603781905550836038819055508260398190555081603a8190555080603b60006101000a81548160ff02191690836002811115612fe357fe5b021790555050505050505050505050565b606082471015613039576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161303090614353565b60405180910390fd5b613042856131d0565b613081576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613078906144f3565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516130ab91906140c6565b60006040518083038185875af1925050503d80600081146130e8576040519150601f19603f3d011682016040523d82523d6000602084013e6130ed565b606091505b50915091506130fd8282866131e3565b92505050949350505050565b606061316b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166127179092919063ffffffff16565b90506000815111156131cb578080602001905181019061318b9190613539565b6131ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131c1906145d3565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b606083156131f357829050613243565b6000835111156132065782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161323a91906141d1565b60405180910390fd5b9392505050565b6000813590506132598161486a565b92915050565b60008151905061326e8161486a565b92915050565b600082601f83011261328557600080fd5b8151613298613293826146bf565b61468e565b915081818352602084019350602081019050838560208402820111156132bd57600080fd5b60005b838110156132ed57816132d3888261325f565b8452602084019350602083019250506001810190506132c0565b5050505092915050565b60008151905061330681614881565b92915050565b60008135905061331b81614898565b92915050565b600060c0828403121561333357600080fd5b81905092915050565b60008135905061334b816148a8565b92915050565b600081519050613360816148a8565b92915050565b60006020828403121561337857600080fd5b60006133868482850161324a565b91505092915050565b6000602082840312156133a157600080fd5b60006133af8482850161325f565b91505092915050565b60008060008060008060008060008060006101608c8e0312156133da57600080fd5b60006133e88e828f0161324a565b9b505060206133f98e828f0161324a565b9a5050604061340a8e828f0161324a565b995050606061341b8e828f0161324a565b985050608061342c8e828f0161333c565b97505060a061343d8e828f0161333c565b96505060c061344e8e828f0161333c565b95505060e061345f8e828f0161333c565b9450506101006134718e828f0161333c565b9350506101206134838e828f0161333c565b9250506101406134958e828f0161330c565b9150509295989b509295989b9093969950565b600080600061010084860312156134be57600080fd5b60006134cc8682870161324a565b93505060206134dd8682870161324a565b92505060406134ee86828701613321565b9150509250925092565b60006020828403121561350a57600080fd5b600082015167ffffffffffffffff81111561352457600080fd5b61353084828501613274565b91505092915050565b60006020828403121561354b57600080fd5b6000613559848285016132f7565b91505092915050565b60006020828403121561357457600080fd5b60006135828482850161333c565b91505092915050565b60006020828403121561359d57600080fd5b60006135ab84828501613351565b91505092915050565b6135bd8161471d565b82525050565b6135cc8161472f565b82525050565b6135db8161473b565b82525050565b60006135ec826146eb565b6135f68185614701565b9350613606818560208601614810565b80840191505092915050565b61361b816147a4565b82525050565b61362a816147c8565b82525050565b613639816147ec565b82525050565b613648816147fe565b82525050565b6000613659826146f6565b613663818561470c565b9350613673818560208601614810565b61367c81614845565b840191505092915050565b600061369460088361470c565b91507f4261642063616c6c0000000000000000000000000000000000000000000000006000830152602082019050919050565b60006136d4601b8361470c565b91507f455448207472616e7366657273206e6f7420737570706f7274656400000000006000830152602082019050919050565b600061371460228361470c565b91507f436c6966662074696d65206d757374206265206265666f726520656e6420746960008301527f6d650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061377a60158361470c565b91507f53746172742074696d65203e20656e642074696d6500000000000000000000006000830152602082019050919050565b60006137ba601e8361470c565b91507f4d757374207365742061207265766f636162696c697479206f7074696f6e00006000830152602082019050919050565b60006137fa60268361470c565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613860601b8361470c565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b60006138a0601c8361470c565b91507f4e6f20617661696c61626c6520756e76657374656420616d6f756e74000000006000830152602082019050919050565b60006138e060148361470c565b91507f4f776e65722063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b6000613920601f8361470c565b91507f43616e6e6f742063616e63656c20616363657074656420636f6e7472616374006000830152602082019050919050565b6000613960601e8361470c565b91507f536166654d6174683a207375627472616374696f6e206f766572666c6f7700006000830152602082019050919050565b60006139a060268361470c565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613a06601d8361470c565b91507f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f0000006000830152602082019050919050565b6000613a46601a8361470c565b91507f536166654d6174683a206469766973696f6e206279207a65726f0000000000006000830152602082019050919050565b6000613a8660118361470c565b91507f456d7074792062656e65666963696172790000000000000000000000000000006000830152602082019050919050565b6000613ac660138361470c565b91507f556e617574686f72697a65642063616c6c6572000000000000000000000000006000830152602082019050919050565b6000613b06601a8361470c565b91507f4d616e61676572206d757374206265206120636f6e74726163740000000000006000830152602082019050919050565b6000613b4660158361470c565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000613b8660298361470c565b91507f43616e6e6f7420757365206d6f726520746f6b656e73207468616e207665737460008301527f656420616d6f756e7400000000000000000000000000000000000000000000006020830152604082019050919050565b6000613bec601f8361470c565b91507f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d006000830152602082019050919050565b6000613c2c60218361470c565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613c9260208361470c565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000613cd260168361470c565b91507f53746172742074696d65206d75737420626520736574000000000000000000006000830152602082019050919050565b6000613d1260158361470c565b91507f556e617574686f72697a65642066756e6374696f6e00000000000000000000006000830152602082019050919050565b6000613d52601d8361470c565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613d9260248361470c565b91507f416d6f756e7420726571756573746564203e20737572706c757320617661696c60008301527f61626c65000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613df860138361470c565b91507f416c726561647920696e697469616c697a6564000000000000000000000000006000830152602082019050919050565b6000613e3860198361470c565b91507f436f6e7472616374206973206e6f6e2d7265766f6361626c65000000000000006000830152602082019050919050565b6000613e7860178361470c565b91507f4d616e616765722063616e6e6f7420626520656d7074790000000000000000006000830152602082019050919050565b6000613eb860058361470c565b91507f21617574680000000000000000000000000000000000000000000000000000006000830152602082019050919050565b6000613ef8602a8361470c565b91507f52656c656173652073746172742074696d65206d757374206265206265666f7260008301527f6520656e642074696d65000000000000000000000000000000000000000000006020830152604082019050919050565b6000613f5e602a8361470c565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000613fc4601e8361470c565b91507f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e7400006000830152602082019050919050565b600061400460148361470c565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b6000614044601a8361470c565b91507f42656e65666963696172792063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b6000614084600f8361470c565b91507f416c7265616479207265766f6b656400000000000000000000000000000000006000830152602082019050919050565b6140c08161479a565b82525050565b60006140d282846135e1565b915081905092915050565b60006020820190506140f260008301846135b4565b92915050565b600060408201905061410d60008301856135b4565b61411a602083018461363f565b9392505050565b600060408201905061413660008301856135b4565b61414360208301846140b7565b9392505050565b600060208201905061415f60008301846135c3565b92915050565b600060208201905061417a60008301846135d2565b92915050565b60006020820190506141956000830184613612565b92915050565b60006020820190506141b06000830184613621565b92915050565b60006020820190506141cb6000830184613630565b92915050565b600060208201905081810360008301526141eb818461364e565b905092915050565b6000602082019050818103600083015261420c81613687565b9050919050565b6000602082019050818103600083015261422c816136c7565b9050919050565b6000602082019050818103600083015261424c81613707565b9050919050565b6000602082019050818103600083015261426c8161376d565b9050919050565b6000602082019050818103600083015261428c816137ad565b9050919050565b600060208201905081810360008301526142ac816137ed565b9050919050565b600060208201905081810360008301526142cc81613853565b9050919050565b600060208201905081810360008301526142ec81613893565b9050919050565b6000602082019050818103600083015261430c816138d3565b9050919050565b6000602082019050818103600083015261432c81613913565b9050919050565b6000602082019050818103600083015261434c81613953565b9050919050565b6000602082019050818103600083015261436c81613993565b9050919050565b6000602082019050818103600083015261438c816139f9565b9050919050565b600060208201905081810360008301526143ac81613a39565b9050919050565b600060208201905081810360008301526143cc81613a79565b9050919050565b600060208201905081810360008301526143ec81613ab9565b9050919050565b6000602082019050818103600083015261440c81613af9565b9050919050565b6000602082019050818103600083015261442c81613b39565b9050919050565b6000602082019050818103600083015261444c81613b79565b9050919050565b6000602082019050818103600083015261446c81613bdf565b9050919050565b6000602082019050818103600083015261448c81613c1f565b9050919050565b600060208201905081810360008301526144ac81613c85565b9050919050565b600060208201905081810360008301526144cc81613cc5565b9050919050565b600060208201905081810360008301526144ec81613d05565b9050919050565b6000602082019050818103600083015261450c81613d45565b9050919050565b6000602082019050818103600083015261452c81613d85565b9050919050565b6000602082019050818103600083015261454c81613deb565b9050919050565b6000602082019050818103600083015261456c81613e2b565b9050919050565b6000602082019050818103600083015261458c81613e6b565b9050919050565b600060208201905081810360008301526145ac81613eab565b9050919050565b600060208201905081810360008301526145cc81613eeb565b9050919050565b600060208201905081810360008301526145ec81613f51565b9050919050565b6000602082019050818103600083015261460c81613fb7565b9050919050565b6000602082019050818103600083015261462c81613ff7565b9050919050565b6000602082019050818103600083015261464c81614037565b9050919050565b6000602082019050818103600083015261466c81614077565b9050919050565b600060208201905061468860008301846140b7565b92915050565b6000604051905081810181811067ffffffffffffffff821117156146b5576146b4614843565b5b8060405250919050565b600067ffffffffffffffff8211156146da576146d9614843565b5b602082029050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006147288261477a565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061477582614856565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006147af826147b6565b9050919050565b60006147c18261477a565b9050919050565b60006147d3826147da565b9050919050565b60006147e58261477a565b9050919050565b60006147f782614767565b9050919050565b60006148098261479a565b9050919050565b60005b8381101561482e578082015181840152602081019050614813565b8381111561483d576000848401525b50505050565bfe5b6000601f19601f8301169050919050565b6003811061486757614866614843565b5b50565b6148738161471d565b811461487e57600080fd5b50565b61488a8161472f565b811461489557600080fd5b50565b600381106148a557600080fd5b50565b6148b18161479a565b81146148bc57600080fd5b5056fea2646970667358221220e7181b2ba4d1c3bb9e57d12c063690ecc18fa07966017865e716378e6ce1068c64736f6c63430007030033", + "deployedBytecode": "0x6080604052600436106102605760003560e01c80637bdf05af11610144578063bc0163c1116100b6578063dc0706571161007a578063dc07065714610bc7578063e8dda6f514610bf0578063e97d87d514610c1b578063ebbab99214610c46578063f2fde38b14610c71578063fc0c546a14610c9a576102a0565b8063bc0163c114610af4578063bd896dcb14610b1f578063ce845d1d14610b48578063d0ebdbe714610b73578063d18e81b314610b9c576102a0565b80638da5cb5b116101085780638da5cb5b14610a0857806391f7cfb914610a33578063a4caeb4214610a5e578063b0d1818c14610a89578063b470aade14610ab2578063b6549f7514610add576102a0565b80637bdf05af1461095957806386d00e021461098457806386d1a69f146109af578063872a7810146109c65780638a5bdf5c146109f1576102a0565b806338af3eed116101dd578063481c6a75116101a1578063481c6a751461087f5780635051a5ec146108aa5780635b940081146108d557806360e7994414610900578063715018a61461091757806378e979251461092e576102a0565b806338af3eed146107a8578063392e53cd146107d3578063398057a3146107fe57806344b1231f1461082957806345d30a1714610854576102a0565b806320dc203d1161022457806320dc203d146106e75780632a627814146107105780632bc9ed02146107275780633197cbb61461075257806337aeb0861461077d576102a0565b8063029c6c9f14610624578063060406181461064f5780630b80f7771461067a5780630dff24d5146106915780630fb5a6b4146106bc576102a0565b366102a0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610297906141f3565b60405180910390fd5b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610330576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610327906143d3565b60405180910390fd5b60003414610373576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036a90614213565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f1d24c456000357fffffffff00000000000000000000000000000000000000000000000000000000166040518263ffffffff1660e01b81526004016103f49190614165565b60206040518083038186803b15801561040c57600080fd5b505afa158015610420573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610444919061338f565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156104b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ad906144d3565b60405180910390fd5b60006104c0610cc5565b9050610511826000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610d77565b506001600281111561051f57fe5b603b60009054906101000a900460ff16600281111561053a57fe5b141561062057600061054a610cc5565b90508181101561058c5760006105698284610dc190919063ffffffff16565b905061058081603f54610e1190919063ffffffff16565b603f81905550506105d2565b60006105a18383610dc190919063ffffffff16565b9050603f548110156105c7576105c281603f54610dc190919063ffffffff16565b6105ca565b60005b603f81905550505b6105da610e66565b603f54111561061e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061590614433565b60405180910390fd5b505b5050005b34801561063057600080fd5b50610639610ed5565b6040516106469190614673565b60405180910390f35b34801561065b57600080fd5b50610664610ef3565b6040516106719190614673565b60405180910390f35b34801561068657600080fd5b5061068f610f2e565b005b34801561069d57600080fd5b506106a661109b565b6040516106b39190614673565b60405180910390f35b3480156106c857600080fd5b506106d16110e2565b6040516106de9190614673565b60405180910390f35b3480156106f357600080fd5b5061070e600480360381019061070991906134a8565b611100565b005b34801561071c57600080fd5b5061072561129b565b005b34801561073357600080fd5b5061073c611500565b604051610749919061414a565b60405180910390f35b34801561075e57600080fd5b50610767611513565b6040516107749190614673565b60405180910390f35b34801561078957600080fd5b50610792611519565b60405161079f9190614673565b60405180910390f35b3480156107b457600080fd5b506107bd61151f565b6040516107ca91906140dd565b60405180910390f35b3480156107df57600080fd5b506107e8611545565b6040516107f5919061414a565b60405180910390f35b34801561080a57600080fd5b50610813611558565b6040516108209190614673565b60405180910390f35b34801561083557600080fd5b5061083e610e66565b60405161084b9190614673565b60405180910390f35b34801561086057600080fd5b5061086961155e565b6040516108769190614673565b60405180910390f35b34801561088b57600080fd5b50610894611564565b6040516108a1919061419b565b60405180910390f35b3480156108b657600080fd5b506108bf61158a565b6040516108cc919061414a565b60405180910390f35b3480156108e157600080fd5b506108ea61159d565b6040516108f79190614673565b60405180910390f35b34801561090c57600080fd5b506109156116a8565b005b34801561092357600080fd5b5061092c6118ee565b005b34801561093a57600080fd5b50610943611a3a565b6040516109509190614673565b60405180910390f35b34801561096557600080fd5b5061096e611a40565b60405161097b9190614673565b60405180910390f35b34801561099057600080fd5b50610999611a7c565b6040516109a69190614673565b60405180910390f35b3480156109bb57600080fd5b506109c4611a82565b005b3480156109d257600080fd5b506109db611c5e565b6040516109e891906141b6565b60405180910390f35b3480156109fd57600080fd5b50610a06611c71565b005b348015610a1457600080fd5b50610a1d611d4a565b604051610a2a91906140dd565b60405180910390f35b348015610a3f57600080fd5b50610a48611d73565b604051610a559190614673565b60405180910390f35b348015610a6a57600080fd5b50610a73611dd1565b604051610a809190614673565b60405180910390f35b348015610a9557600080fd5b50610ab06004803603810190610aab9190613562565b611dd7565b005b348015610abe57600080fd5b50610ac7611fd6565b604051610ad49190614673565b60405180910390f35b348015610ae957600080fd5b50610af2611ff9565b005b348015610b0057600080fd5b50610b09612291565b604051610b169190614673565b60405180910390f35b348015610b2b57600080fd5b50610b466004803603810190610b4191906133b8565b6122c3565b005b348015610b5457600080fd5b50610b5d610cc5565b604051610b6a9190614673565b60405180910390f35b348015610b7f57600080fd5b50610b9a6004803603810190610b959190613366565b6122eb565b005b348015610ba857600080fd5b50610bb1612385565b604051610bbe9190614673565b60405180910390f35b348015610bd357600080fd5b50610bee6004803603810190610be99190613366565b61238d565b005b348015610bfc57600080fd5b50610c05612508565b604051610c129190614673565b60405180910390f35b348015610c2757600080fd5b50610c3061250e565b604051610c3d9190614673565b60405180910390f35b348015610c5257600080fd5b50610c5b612514565b604051610c689190614673565b60405180910390f35b348015610c7d57600080fd5b50610c986004803603810190610c939190613366565b612536565b005b348015610ca657600080fd5b50610caf6126f1565b604051610cbc9190614180565b60405180910390f35b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610d2291906140dd565b60206040518083038186803b158015610d3a57600080fd5b505afa158015610d4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d72919061358b565b905090565b6060610db983836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250612717565b905092915050565b600082821115610e06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dfd90614333565b60405180910390fd5b818303905092915050565b600080828401905083811015610e5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e53906142b3565b60405180910390fd5b8091505092915050565b6000600280811115610e7457fe5b603b60009054906101000a900460ff166002811115610e8f57fe5b1415610e9f576035549050610ed2565b6000603a54118015610eb95750603a54610eb7612385565b105b15610ec75760009050610ed2565b610ecf611d73565b90505b90565b6000610eee60385460355461272f90919063ffffffff16565b905090565b6000610f296001610f1b610f05611fd6565b610f0d611a40565b61272f90919063ffffffff16565b610e1190919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb390614493565b60405180910390fd5b60001515603b60039054906101000a900460ff16151514611012576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100990614313565b60405180910390fd5b61106d61101d611d4a565b611025610cc5565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b7f171f0bcbda3370351cea17f3b164bee87d77c2503b94abdf2720a814ebe7e9df60405160405180910390a1565b6000806110a6610cc5565b905060006110b2612291565b9050808211156110d8576110cf8183610dc190919063ffffffff16565b925050506110df565b6000925050505b90565b60006110fb603654603754610dc190919063ffffffff16565b905090565b603b60029054906101000a900460ff1615611150576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114790614533565b60405180910390fd5b6001603b60026101000a81548160ff0219169083151502179055506111868160200160208101906111819190613366565b61280b565b8060400160208101906111999190613366565b603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806060013560358190555080608001356036819055508060a0013560378190555060016038819055506001603b60036101000a81548160ff0219169083151502179055508060a001356039819055506002603b60006101000a81548160ff0219169083600281111561128857fe5b0217905550611296836128a9565b505050565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461132b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132290614593565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b15801561139557600080fd5b505afa1580156113a9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906113d291906134f8565b905060005b81518110156114d057603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061142a57fe5b60200260200101517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611470929190614121565b602060405180830381600087803b15801561148a57600080fd5b505af115801561149e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c29190613539565b5080806001019150506113d7565b507fb837fd51506ba3cc623a37c78ed22fd521f2f6e9f69a34d5c2a4a9474f27579360405160405180910390a150565b603b60019054906101000a900460ff1681565b60375481565b603d5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60029054906101000a900460ff1681565b60355481565b603c5481565b603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b603b60039054906101000a900460ff1681565b60006002808111156115ab57fe5b603b60009054906101000a900460ff1660028111156115c657fe5b14156115db576115d4612a27565b90506116a5565b60006039541180156115f557506039546115f3612385565b105b1561160357600090506116a5565b6001600281111561161057fe5b603b60009054906101000a900460ff16600281111561162b57fe5b14801561163a57506000603a54115b801561164e5750603a5461164c612385565b105b1561165c57600090506116a5565b600061168e603f54611680603c54611672611d73565b610dc190919063ffffffff16565b610dc190919063ffffffff16565b90506116a161169b610cc5565b82612ae1565b9150505b90565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611738576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172f90614593565b60405180910390fd5b6060603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a34574666040518163ffffffff1660e01b815260040160006040518083038186803b1580156117a257600080fd5b505afa1580156117b6573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906117df91906134f8565b905060005b81518110156118be57603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b383838151811061183757fe5b602002602001015160006040518363ffffffff1660e01b815260040161185e9291906140f8565b602060405180830381600087803b15801561187857600080fd5b505af115801561188c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118b09190613539565b5080806001019150506117e4565b507f6d317a20ba9d790014284bef285283cd61fde92e0f2711050f563a9d2cf4171160405160405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461197c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197390614493565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60365481565b600080611a4b612385565b90506036548111611a60576000915050611a79565b611a7560365482610dc190919063ffffffff16565b9150505b90565b603a5481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b0990614593565b60405180910390fd5b6000611b1c61159d565b905060008111611b61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b58906145f3565b60405180910390fd5b611b7681603c54610e1190919063ffffffff16565b603c81905550611beb603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df9317982604051611c539190614673565b60405180910390a250565b603b60009054906101000a900460ff1681565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cf890614593565b60405180910390fd5b6001603b60036101000a81548160ff0219169083151502179055507fbeb3313724453131feb0a765a03e6715bb720e0f973a31fcbafa2d2f048c188b60405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080611d7e612385565b9050603654811015611d94576000915050611dce565b603754811115611da957603554915050611dce565b611dca611db4610ed5565b611dbc612514565b612afa90919063ffffffff16565b9150505b90565b60385481565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e5e90614593565b60405180910390fd5b60008111611eaa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea190614413565b60405180910390fd5b80611eb361109b565b1015611ef4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eeb90614513565b60405180910390fd5b611f63603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b82604051611fcb9190614673565b60405180910390a250565b6000611ff4603854611fe66110e2565b61272f90919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612087576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161207e90614493565b60405180910390fd5b6001600281111561209457fe5b603b60009054906101000a900460ff1660028111156120af57fe5b146120ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e690614553565b60405180910390fd5b60001515603b60019054906101000a900460ff16151514612145576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161213c90614653565b60405180910390fd5b6000612163612152610e66565b603554610dc190919063ffffffff16565b9050600081116121a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161219f906142d3565b60405180910390fd5b80603d819055506001603b60016101000a81548160ff02191690831515021790555061221e6121d5611d4a565b82603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166127859092919063ffffffff16565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb73c49a3a37a7aca291ba0ceaa41657012def406106a7fc386888f0f66e941cf826040516122869190614673565b60405180910390a250565b60006122be603d546122b0603c54603554610dc190919063ffffffff16565b610dc190919063ffffffff16565b905090565b6122d58a8a8a8a8a8a8a8a8a8a612b6a565b6122de8b6128a9565b5050505050505050505050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612379576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161237090614493565b60405180910390fd5b612382816128a9565b50565b600042905090565b603460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461241d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161241490614593565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561248d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612484906143b3565b60405180910390fd5b80603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f373c72efabe4ef3e552ff77838be729f3bc3d8c586df0012902d1baa2377fa1d816040516124fd91906140dd565b60405180910390a150565b603f5481565b60395481565b60006125316001612523610ef3565b610dc190919063ffffffff16565b905090565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146125c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125bb90614493565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612634576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161262b90614293565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606127268484600085612ff4565b90509392505050565b6000808211612773576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276a90614393565b60405180910390fd5b81838161277c57fe5b04905092915050565b6128068363a9059cbb60e01b84846040516024016127a4929190614121565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613109565b505050565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612919576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161291090614573565b60405180910390fd5b612922816131d0565b612961576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612958906143f3565b60405180910390fd5b6000603e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fdac3632743b879638fd2d51c4d3c1dd796615b4758a55b50b0c19b971ba9fbc760405160405180910390a35050565b600080603954118015612a425750603954612a40612385565b105b15612a505760009050612ade565b60016002811115612a5d57fe5b603b60009054906101000a900460ff166002811115612a7857fe5b148015612a8757506000603a54115b8015612a9b5750603a54612a99612385565b105b15612aa95760009050612ade565b6000612ac7603c54612ab9611d73565b610dc190919063ffffffff16565b9050612ada612ad4610cc5565b82612ae1565b9150505b90565b6000818310612af05781612af2565b825b905092915050565b600080831415612b0d5760009050612b64565b6000828402905082848281612b1e57fe5b0414612b5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b5690614473565b60405180910390fd5b809150505b92915050565b603b60029054906101000a900460ff1615612bba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bb190614533565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415612c2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c21906142f3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff161415612c9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c9190614633565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff161415612d0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d0190614613565b60405180910390fd5b60008711612d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d4490614373565b60405180910390fd5b6000861415612d91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d88906144b3565b60405180910390fd5b848610612dd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dca90614253565b60405180910390fd5b6001841015612e17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0e90614453565b60405180910390fd5b60006002811115612e2457fe5b816002811115612e3057fe5b1415612e71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e6890614273565b60405180910390fd5b848310612eb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eaa906145b3565b60405180910390fd5b848210612ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eec90614233565b60405180910390fd5b6001603b60026101000a81548160ff021916908315150217905550612f198a61280b565b88603460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550866035819055508560368190555084603781905550836038819055508260398190555081603a8190555080603b60006101000a81548160ff02191690836002811115612fe357fe5b021790555050505050505050505050565b606082471015613039576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161303090614353565b60405180910390fd5b613042856131d0565b613081576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613078906144f3565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516130ab91906140c6565b60006040518083038185875af1925050503d80600081146130e8576040519150601f19603f3d011682016040523d82523d6000602084013e6130ed565b606091505b50915091506130fd8282866131e3565b92505050949350505050565b606061316b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166127179092919063ffffffff16565b90506000815111156131cb578080602001905181019061318b9190613539565b6131ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131c1906145d3565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b606083156131f357829050613243565b6000835111156132065782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161323a91906141d1565b60405180910390fd5b9392505050565b6000813590506132598161486a565b92915050565b60008151905061326e8161486a565b92915050565b600082601f83011261328557600080fd5b8151613298613293826146bf565b61468e565b915081818352602084019350602081019050838560208402820111156132bd57600080fd5b60005b838110156132ed57816132d3888261325f565b8452602084019350602083019250506001810190506132c0565b5050505092915050565b60008151905061330681614881565b92915050565b60008135905061331b81614898565b92915050565b600060c0828403121561333357600080fd5b81905092915050565b60008135905061334b816148a8565b92915050565b600081519050613360816148a8565b92915050565b60006020828403121561337857600080fd5b60006133868482850161324a565b91505092915050565b6000602082840312156133a157600080fd5b60006133af8482850161325f565b91505092915050565b60008060008060008060008060008060006101608c8e0312156133da57600080fd5b60006133e88e828f0161324a565b9b505060206133f98e828f0161324a565b9a5050604061340a8e828f0161324a565b995050606061341b8e828f0161324a565b985050608061342c8e828f0161333c565b97505060a061343d8e828f0161333c565b96505060c061344e8e828f0161333c565b95505060e061345f8e828f0161333c565b9450506101006134718e828f0161333c565b9350506101206134838e828f0161333c565b9250506101406134958e828f0161330c565b9150509295989b509295989b9093969950565b600080600061010084860312156134be57600080fd5b60006134cc8682870161324a565b93505060206134dd8682870161324a565b92505060406134ee86828701613321565b9150509250925092565b60006020828403121561350a57600080fd5b600082015167ffffffffffffffff81111561352457600080fd5b61353084828501613274565b91505092915050565b60006020828403121561354b57600080fd5b6000613559848285016132f7565b91505092915050565b60006020828403121561357457600080fd5b60006135828482850161333c565b91505092915050565b60006020828403121561359d57600080fd5b60006135ab84828501613351565b91505092915050565b6135bd8161471d565b82525050565b6135cc8161472f565b82525050565b6135db8161473b565b82525050565b60006135ec826146eb565b6135f68185614701565b9350613606818560208601614810565b80840191505092915050565b61361b816147a4565b82525050565b61362a816147c8565b82525050565b613639816147ec565b82525050565b613648816147fe565b82525050565b6000613659826146f6565b613663818561470c565b9350613673818560208601614810565b61367c81614845565b840191505092915050565b600061369460088361470c565b91507f4261642063616c6c0000000000000000000000000000000000000000000000006000830152602082019050919050565b60006136d4601b8361470c565b91507f455448207472616e7366657273206e6f7420737570706f7274656400000000006000830152602082019050919050565b600061371460228361470c565b91507f436c6966662074696d65206d757374206265206265666f726520656e6420746960008301527f6d650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061377a60158361470c565b91507f53746172742074696d65203e20656e642074696d6500000000000000000000006000830152602082019050919050565b60006137ba601e8361470c565b91507f4d757374207365742061207265766f636162696c697479206f7074696f6e00006000830152602082019050919050565b60006137fa60268361470c565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613860601b8361470c565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b60006138a0601c8361470c565b91507f4e6f20617661696c61626c6520756e76657374656420616d6f756e74000000006000830152602082019050919050565b60006138e060148361470c565b91507f4f776e65722063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b6000613920601f8361470c565b91507f43616e6e6f742063616e63656c20616363657074656420636f6e7472616374006000830152602082019050919050565b6000613960601e8361470c565b91507f536166654d6174683a207375627472616374696f6e206f766572666c6f7700006000830152602082019050919050565b60006139a060268361470c565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613a06601d8361470c565b91507f4d616e6167656420746f6b656e732063616e6e6f74206265207a65726f0000006000830152602082019050919050565b6000613a46601a8361470c565b91507f536166654d6174683a206469766973696f6e206279207a65726f0000000000006000830152602082019050919050565b6000613a8660118361470c565b91507f456d7074792062656e65666963696172790000000000000000000000000000006000830152602082019050919050565b6000613ac660138361470c565b91507f556e617574686f72697a65642063616c6c6572000000000000000000000000006000830152602082019050919050565b6000613b06601a8361470c565b91507f4d616e61676572206d757374206265206120636f6e74726163740000000000006000830152602082019050919050565b6000613b4660158361470c565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000613b8660298361470c565b91507f43616e6e6f7420757365206d6f726520746f6b656e73207468616e207665737460008301527f656420616d6f756e7400000000000000000000000000000000000000000000006020830152604082019050919050565b6000613bec601f8361470c565b91507f506572696f64732063616e6e6f742062652062656c6f77206d696e696d756d006000830152602082019050919050565b6000613c2c60218361470c565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613c9260208361470c565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000613cd260168361470c565b91507f53746172742074696d65206d75737420626520736574000000000000000000006000830152602082019050919050565b6000613d1260158361470c565b91507f556e617574686f72697a65642066756e6374696f6e00000000000000000000006000830152602082019050919050565b6000613d52601d8361470c565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613d9260248361470c565b91507f416d6f756e7420726571756573746564203e20737572706c757320617661696c60008301527f61626c65000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613df860138361470c565b91507f416c726561647920696e697469616c697a6564000000000000000000000000006000830152602082019050919050565b6000613e3860198361470c565b91507f436f6e7472616374206973206e6f6e2d7265766f6361626c65000000000000006000830152602082019050919050565b6000613e7860178361470c565b91507f4d616e616765722063616e6e6f7420626520656d7074790000000000000000006000830152602082019050919050565b6000613eb860058361470c565b91507f21617574680000000000000000000000000000000000000000000000000000006000830152602082019050919050565b6000613ef8602a8361470c565b91507f52656c656173652073746172742074696d65206d757374206265206265666f7260008301527f6520656e642074696d65000000000000000000000000000000000000000000006020830152604082019050919050565b6000613f5e602a8361470c565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b6000613fc4601e8361470c565b91507f4e6f20617661696c61626c652072656c65617361626c6520616d6f756e7400006000830152602082019050919050565b600061400460148361470c565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b6000614044601a8361470c565b91507f42656e65666963696172792063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b6000614084600f8361470c565b91507f416c7265616479207265766f6b656400000000000000000000000000000000006000830152602082019050919050565b6140c08161479a565b82525050565b60006140d282846135e1565b915081905092915050565b60006020820190506140f260008301846135b4565b92915050565b600060408201905061410d60008301856135b4565b61411a602083018461363f565b9392505050565b600060408201905061413660008301856135b4565b61414360208301846140b7565b9392505050565b600060208201905061415f60008301846135c3565b92915050565b600060208201905061417a60008301846135d2565b92915050565b60006020820190506141956000830184613612565b92915050565b60006020820190506141b06000830184613621565b92915050565b60006020820190506141cb6000830184613630565b92915050565b600060208201905081810360008301526141eb818461364e565b905092915050565b6000602082019050818103600083015261420c81613687565b9050919050565b6000602082019050818103600083015261422c816136c7565b9050919050565b6000602082019050818103600083015261424c81613707565b9050919050565b6000602082019050818103600083015261426c8161376d565b9050919050565b6000602082019050818103600083015261428c816137ad565b9050919050565b600060208201905081810360008301526142ac816137ed565b9050919050565b600060208201905081810360008301526142cc81613853565b9050919050565b600060208201905081810360008301526142ec81613893565b9050919050565b6000602082019050818103600083015261430c816138d3565b9050919050565b6000602082019050818103600083015261432c81613913565b9050919050565b6000602082019050818103600083015261434c81613953565b9050919050565b6000602082019050818103600083015261436c81613993565b9050919050565b6000602082019050818103600083015261438c816139f9565b9050919050565b600060208201905081810360008301526143ac81613a39565b9050919050565b600060208201905081810360008301526143cc81613a79565b9050919050565b600060208201905081810360008301526143ec81613ab9565b9050919050565b6000602082019050818103600083015261440c81613af9565b9050919050565b6000602082019050818103600083015261442c81613b39565b9050919050565b6000602082019050818103600083015261444c81613b79565b9050919050565b6000602082019050818103600083015261446c81613bdf565b9050919050565b6000602082019050818103600083015261448c81613c1f565b9050919050565b600060208201905081810360008301526144ac81613c85565b9050919050565b600060208201905081810360008301526144cc81613cc5565b9050919050565b600060208201905081810360008301526144ec81613d05565b9050919050565b6000602082019050818103600083015261450c81613d45565b9050919050565b6000602082019050818103600083015261452c81613d85565b9050919050565b6000602082019050818103600083015261454c81613deb565b9050919050565b6000602082019050818103600083015261456c81613e2b565b9050919050565b6000602082019050818103600083015261458c81613e6b565b9050919050565b600060208201905081810360008301526145ac81613eab565b9050919050565b600060208201905081810360008301526145cc81613eeb565b9050919050565b600060208201905081810360008301526145ec81613f51565b9050919050565b6000602082019050818103600083015261460c81613fb7565b9050919050565b6000602082019050818103600083015261462c81613ff7565b9050919050565b6000602082019050818103600083015261464c81614037565b9050919050565b6000602082019050818103600083015261466c81614077565b9050919050565b600060208201905061468860008301846140b7565b92915050565b6000604051905081810181811067ffffffffffffffff821117156146b5576146b4614843565b5b8060405250919050565b600067ffffffffffffffff8211156146da576146d9614843565b5b602082029050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006147288261477a565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061477582614856565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006147af826147b6565b9050919050565b60006147c18261477a565b9050919050565b60006147d3826147da565b9050919050565b60006147e58261477a565b9050919050565b60006147f782614767565b9050919050565b60006148098261479a565b9050919050565b60005b8381101561482e578082015181840152602081019050614813565b8381111561483d576000848401525b50505050565bfe5b6000601f19601f8301169050919050565b6003811061486757614866614843565b5b50565b6148738161471d565b811461487e57600080fd5b50565b61488a8161472f565b811461489557600080fd5b50565b600381106148a557600080fd5b50565b6148b18161479a565b81146148bc57600080fd5b5056fea2646970667358221220e7181b2ba4d1c3bb9e57d12c063690ecc18fa07966017865e716378e6ce1068c64736f6c63430007030033", + "devdoc": { + "kind": "dev", + "methods": { + "acceptLock()": { + "details": "Can only be called by the beneficiary" + }, + "amountPerPeriod()": { + "returns": { + "_0": "Amount of tokens available after each period" + } + }, + "approveProtocol()": { + "details": "Approves all token destinations registered in the manager to pull tokens" + }, + "availableAmount()": { + "details": "Implements the step-by-step schedule based on periods for available tokens", + "returns": { + "_0": "Amount of tokens available according to the schedule" + } + }, + "cancelLock()": { + "details": "Can only be called by the owner" + }, + "changeBeneficiary(address)": { + "details": "Can only be called by the beneficiary", + "params": { + "_newBeneficiary": "Address of the new beneficiary address" + } + }, + "currentBalance()": { + "returns": { + "_0": "Tokens held in the contract" + } + }, + "currentPeriod()": { + "returns": { + "_0": "A number that represents the current period" + } + }, + "currentTime()": { + "returns": { + "_0": "Current block timestamp" + } + }, + "duration()": { + "returns": { + "_0": "Amount of seconds from contract startTime to endTime" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "passedPeriods()": { + "returns": { + "_0": "A number of periods that passed since the schedule started" + } + }, + "periodDuration()": { + "returns": { + "_0": "Duration of each period in seconds" + } + }, + "releasableAmount()": { + "details": "Considers the schedule, takes into account already released tokens and used amount", + "returns": { + "_0": "Amount of tokens ready to be released" + } + }, + "release()": { + "details": "All available releasable tokens are transferred to beneficiary" + }, + "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." + }, + "revoke()": { + "details": "Vesting schedule is always calculated based on managed tokens" + }, + "revokeProtocol()": { + "details": "Revokes approval to all token destinations in the manager to pull tokens" + }, + "setManager(address)": { + "params": { + "_newManager": "Address of the new manager" + } + }, + "sinceStartTime()": { + "details": "Returns zero if called before conctract starTime", + "returns": { + "_0": "Seconds elapsed from contract startTime" + } + }, + "surplusAmount()": { + "details": "All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary. Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be skewed, so the beneficiary might have to bridge back to L1 to release the surplus.", + "returns": { + "_0": "Amount of tokens considered as surplus" + } + }, + "totalOutstandingAmount()": { + "details": "Does not consider schedule but just global amounts tracked", + "returns": { + "_0": "Amount of outstanding tokens for the lifetime of the contract" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "vestedAmount()": { + "details": "Similar to available amount, but is fully vested when contract is non-revocable", + "returns": { + "_0": "Amount of tokens already vested" + } + }, + "withdrawSurplus(uint256)": { + "details": "Tokens in the contract over outstanding amount are considered as surplus", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "L2GraphTokenLockWallet", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "acceptLock()": { + "notice": "Beneficiary accepts the lock, the owner cannot retrieve back the tokens" + }, + "amountPerPeriod()": { + "notice": "Returns amount available to be released after each period according to schedule" + }, + "approveProtocol()": { + "notice": "Approves protocol access of the tokens managed by this contract" + }, + "availableAmount()": { + "notice": "Gets the currently available token according to the schedule" + }, + "cancelLock()": { + "notice": "Owner cancel the lock and return the balance in the contract" + }, + "changeBeneficiary(address)": { + "notice": "Change the beneficiary of funds managed by the contract" + }, + "currentBalance()": { + "notice": "Returns the amount of tokens currently held by the contract" + }, + "currentPeriod()": { + "notice": "Gets the current period based on the schedule" + }, + "currentTime()": { + "notice": "Returns the current block timestamp" + }, + "duration()": { + "notice": "Gets duration of contract from start to end in seconds" + }, + "passedPeriods()": { + "notice": "Gets the number of periods that passed since the first period" + }, + "periodDuration()": { + "notice": "Returns the duration of each period in seconds" + }, + "releasableAmount()": { + "notice": "Gets tokens currently available for release" + }, + "release()": { + "notice": "Releases tokens based on the configured schedule" + }, + "revoke()": { + "notice": "Revokes a vesting schedule and return the unvested tokens to the owner" + }, + "revokeProtocol()": { + "notice": "Revokes protocol access of the tokens managed by this contract" + }, + "setManager(address)": { + "notice": "Sets a new manager for this contract" + }, + "sinceStartTime()": { + "notice": "Gets time elapsed since the start of the contract" + }, + "surplusAmount()": { + "notice": "Gets surplus amount in the contract based on outstanding amount to release" + }, + "totalOutstandingAmount()": { + "notice": "Gets the outstanding amount yet to be released based on the whole contract lifetime" + }, + "vestedAmount()": { + "notice": "Gets the amount of currently vested tokens" + }, + "withdrawSurplus(uint256)": { + "notice": "Withdraws surplus, unmanaged tokens from the contract" + } + }, + "notice": "This contract is built on top of the base GraphTokenLock functionality. It allows wallet beneficiaries to use the deposited funds to perform specific function calls on specific contracts. The idea is that supporters with locked tokens can participate in the protocol but disallow any release before the vesting/lock schedule. The beneficiary can issue authorized function calls to this contract that will get forwarded to a target contract. A target contract is any of our protocol contracts. The function calls allowed are queried to the GraphTokenLockManager, this way the same configuration can be shared for all the created lock wallet contracts. This L2 variant includes a special initializer so that it can be created from a wallet's data received from L1. These transferred wallets will not allow releasing funds in L2 until the end of the vesting timeline, but they can allow withdrawing funds back to L1 using the L2GraphTokenLockTransferTool contract. Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1, so releasing surplus tokens might also only be possible by bridging tokens back to L1. NOTE: Contracts used as target must have its function signatures checked to avoid collisions with any of this contract functions. Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience the maximum amount of tokens is authorized. Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 6778, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 6783, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 3244, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "token", + "offset": 0, + "slot": "51", + "type": "t_contract(IERC20)1710" + }, + { + "astId": 3246, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "beneficiary", + "offset": 0, + "slot": "52", + "type": "t_address" + }, + { + "astId": 3248, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "managedAmount", + "offset": 0, + "slot": "53", + "type": "t_uint256" + }, + { + "astId": 3250, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "startTime", + "offset": 0, + "slot": "54", + "type": "t_uint256" + }, + { + "astId": 3252, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "endTime", + "offset": 0, + "slot": "55", + "type": "t_uint256" + }, + { + "astId": 3254, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "periods", + "offset": 0, + "slot": "56", + "type": "t_uint256" + }, + { + "astId": 3256, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "releaseStartTime", + "offset": 0, + "slot": "57", + "type": "t_uint256" + }, + { + "astId": 3258, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "vestingCliffTime", + "offset": 0, + "slot": "58", + "type": "t_uint256" + }, + { + "astId": 3260, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "revocable", + "offset": 0, + "slot": "59", + "type": "t_enum(Revocability)5096" + }, + { + "astId": 3262, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "isRevoked", + "offset": 1, + "slot": "59", + "type": "t_bool" + }, + { + "astId": 3264, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "isInitialized", + "offset": 2, + "slot": "59", + "type": "t_bool" + }, + { + "astId": 3266, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "isAccepted", + "offset": 3, + "slot": "59", + "type": "t_bool" + }, + { + "astId": 3268, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "releasedAmount", + "offset": 0, + "slot": "60", + "type": "t_uint256" + }, + { + "astId": 3270, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "revokedAmount", + "offset": 0, + "slot": "61", + "type": "t_uint256" + }, + { + "astId": 4692, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "manager", + "offset": 0, + "slot": "62", + "type": "t_contract(IGraphTokenLockManager)5278" + }, + { + "astId": 4694, + "contract": "contracts/L2GraphTokenLockWallet.sol:L2GraphTokenLockWallet", + "label": "usedAmount", + "offset": 0, + "slot": "63", + "type": "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_contract(IERC20)1710": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(IGraphTokenLockManager)5278": { + "encoding": "inplace", + "label": "contract IGraphTokenLockManager", + "numberOfBytes": "20" + }, + "t_enum(Revocability)5096": { + "encoding": "inplace", + "label": "enum IGraphTokenLock.Revocability", + "numberOfBytes": "1" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/deployments/arbitrum-goerli/Scratch-6-L2-Manager-Old.json b/deployments/arbitrum-goerli/Scratch-6-L2-Manager-Old.json new file mode 100644 index 0000000..97637ab --- /dev/null +++ b/deployments/arbitrum-goerli/Scratch-6-L2-Manager-Old.json @@ -0,0 +1,1161 @@ +{ + "address": "0x55D90ba449646D17cDBAe1E74F631D8eaAE3B1ff", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + }, + { + "internalType": "address", + "name": "_l2Gateway", + "type": "address" + }, + { + "internalType": "address", + "name": "_l1TransferTool", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes4", + "name": "sigHash", + "type": "bytes4" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "signature", + "type": "string" + } + ], + "name": "FunctionCallAuth", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Address", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "LockedTokensReceivedFromL1", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "masterCopy", + "type": "address" + } + ], + "name": "MasterCopyUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "TokenDestinationAllowed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "initHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "periods", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseStartTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "vestingCliffTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IGraphTokenLock.Revocability", + "name": "revocable", + "type": "uint8" + } + ], + "name": "TokenLockCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "initHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "l1Address", + "type": "address" + } + ], + "name": "TokenLockCreatedFromL1", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "addTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "name": "authFnCalls", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "createTokenLockWallet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "getAuthFunctionCallTarget", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "address", + "name": "_deployer", + "type": "address" + } + ], + "name": "getDeploymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "getTokenDestinations", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "isAuthFunctionCall", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "isTokenDestination", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l1TransferTool", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l1WalletToL2Wallet", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2Gateway", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2WalletToL1Wallet", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "masterCopy", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "onTokenTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "removeTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "_signatures", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "_targets", + "type": "address[]" + } + ], + "name": "setAuthFunctionCallMany", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "name": "setMasterCopy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + } + ], + "name": "unsetAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x8cd1be1f66049448426ee0a95872ec4c8dee5be5b558f49667795eabbc3ef991", + "receipt": { + "to": null, + "from": "0x48Ed1128A24fe9053E3F0C8358eC43D86A18c121", + "contractAddress": "0x55D90ba449646D17cDBAe1E74F631D8eaAE3B1ff", + "transactionIndex": 1, + "gasUsed": "4147754", + "logsBloom": "0x00000000000000000000000000000000000004000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000400000000200000000020000000000000000000800000000000000001000000000000000400000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000400000000000000000010000000000000000000000000000020000020000000000000800000000000000040000000000000000000000000000000000000", + "blockHash": "0x4cba879595eabae378a107b82ed8b5cebc9756220fa3b7d96420c42de050b3e1", + "transactionHash": "0x8cd1be1f66049448426ee0a95872ec4c8dee5be5b558f49667795eabbc3ef991", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 26829862, + "transactionHash": "0x8cd1be1f66049448426ee0a95872ec4c8dee5be5b558f49667795eabbc3ef991", + "address": "0x55D90ba449646D17cDBAe1E74F631D8eaAE3B1ff", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000048ed1128a24fe9053e3f0c8358ec43d86a18c121" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x4cba879595eabae378a107b82ed8b5cebc9756220fa3b7d96420c42de050b3e1" + }, + { + "transactionIndex": 1, + "blockNumber": 26829862, + "transactionHash": "0x8cd1be1f66049448426ee0a95872ec4c8dee5be5b558f49667795eabbc3ef991", + "address": "0x55D90ba449646D17cDBAe1E74F631D8eaAE3B1ff", + "topics": [ + "0x30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de", + "0x000000000000000000000000d56945477322829abd094a5343486bf75135db73" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x4cba879595eabae378a107b82ed8b5cebc9756220fa3b7d96420c42de050b3e1" + } + ], + "blockNumber": 26829862, + "cumulativeGasUsed": "4147754", + "status": 1, + "byzantium": true + }, + "args": [ + "0xE65eCAf166336Bd7aeAeb868B34E4e46b3AB62d4", + "0xd56945477322829aBD094A5343486bF75135DB73", + "0x3B912f084ACae83e0b749073377616b441F22Cf1", + "0x739a6BC599347adA0Cec67520559F46eA8B9155E" + ], + "solcInputHash": "b33621afedc711c06b58b28e08a7cfc9", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_graphToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l2Gateway\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l1TransferTool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes4\",\"name\":\"sigHash\",\"type\":\"bytes4\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"signature\",\"type\":\"string\"}],\"name\":\"FunctionCallAuth\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"l1Address\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"l2Address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"LockedTokensReceivedFromL1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"masterCopy\",\"type\":\"address\"}],\"name\":\"MasterCopyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"}],\"name\":\"ProxyCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"TokenDestinationAllowed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"initHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"periods\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releaseStartTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vestingCliffTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"revocable\",\"type\":\"uint8\"}],\"name\":\"TokenLockCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"initHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"l1Address\",\"type\":\"address\"}],\"name\":\"TokenLockCreatedFromL1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"addTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"name\":\"authFnCalls\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"createTokenLockWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"getAuthFunctionCallTarget\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_salt\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_deployer\",\"type\":\"address\"}],\"name\":\"getDeploymentAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenDestinations\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"isAuthFunctionCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"isTokenDestination\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1TransferTool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"l1WalletToL2Wallet\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l2Gateway\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"l2WalletToL1Wallet\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"masterCopy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"removeTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"setAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"_signatures\",\"type\":\"string[]\"},{\"internalType\":\"address[]\",\"name\":\"_targets\",\"type\":\"address[]\"}],\"name\":\"setAuthFunctionCallMany\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"name\":\"setMasterCopy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"}],\"name\":\"unsetAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"LockedTokensReceivedFromL1(address,address,uint256)\":{\"details\":\"Emitted when locked tokens are received from L1 (whether the wallet had already been received or not)\"},\"TokenLockCreatedFromL1(address,bytes32,address,uint256,uint256,uint256,address)\":{\"details\":\"Event emitted when a wallet is received and created from L1\"}},\"kind\":\"dev\",\"methods\":{\"addTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"constructor\":{\"params\":{\"_graphToken\":\"Address of the L2 GRT token contract\",\"_l1TransferTool\":\"Address of the L1 transfer tool contract (in L1, without aliasing)\",\"_l2Gateway\":\"Address of the L2GraphTokenGateway contract\",\"_masterCopy\":\"Address of the master copy of the L2GraphTokenLockWallet implementation\"}},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"params\":{\"_beneficiary\":\"Address of the beneficiary of locked tokens\",\"_endTime\":\"End time of the release schedule\",\"_managedAmount\":\"Amount of tokens to be managed by the lock contract\",\"_owner\":\"Address of the contract owner\",\"_periods\":\"Number of periods between start time and end time\",\"_releaseStartTime\":\"Override time for when the releases start\",\"_revocable\":\"Whether the contract is revocable\",\"_startTime\":\"Start time of the release schedule\"}},\"deposit(uint256)\":{\"details\":\"Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes\",\"params\":{\"_amount\":\"Amount to deposit\"}},\"getAuthFunctionCallTarget(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"Address of the target contract where to send the call\"}},\"getDeploymentAddress(bytes32,address,address)\":{\"params\":{\"_deployer\":\"Address of the deployer that creates the contract\",\"_implementation\":\"Address of the proxy target implementation\",\"_salt\":\"Bytes32 salt to use for CREATE2\"},\"returns\":{\"_0\":\"Address of the counterfactual MinimalProxy\"}},\"getTokenDestinations()\":{\"returns\":{\"_0\":\"Array of addresses authorized to pull funds from a token lock\"}},\"isAuthFunctionCall(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"True if authorized\"}},\"isTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"},\"returns\":{\"_0\":\"True if authorized\"}},\"onTokenTransfer(address,uint256,bytes)\":{\"details\":\"This function will create a new wallet if it doesn't exist yet, or send the tokens to the existing wallet if it does.\",\"params\":{\"_amount\":\"Amount of tokens received\",\"_data\":\"Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\",\"_from\":\"Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"removeTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"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.\"},\"setAuthFunctionCall(string,address)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\",\"_target\":\"Address of the destination contract to call\"}},\"setAuthFunctionCallMany(string[],address[])\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signatures\":\"Function signatures\",\"_targets\":\"Address of the destination contract to call\"}},\"setMasterCopy(address)\":{\"params\":{\"_masterCopy\":\"Address of contract bytecode to factory clone\"}},\"token()\":{\"returns\":{\"_0\":\"Token used for transfers and approvals\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unsetAuthFunctionCall(string)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\"}},\"withdraw(uint256)\":{\"details\":\"Escape hatch in case of mistakes or to recover remaining funds\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"L2GraphTokenLockManager\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"addTokenDestination(address)\":{\"notice\":\"Adds an address that can be allowed by a token lock to pull funds\"},\"constructor\":{\"notice\":\"Constructor for the L2GraphTokenLockManager contract.\"},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"notice\":\"Creates and fund a new token lock wallet using a minimum proxy\"},\"deposit(uint256)\":{\"notice\":\"Deposits tokens into the contract\"},\"getAuthFunctionCallTarget(bytes4)\":{\"notice\":\"Gets the target contract to call for a particular function signature\"},\"getDeploymentAddress(bytes32,address,address)\":{\"notice\":\"Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\"},\"getTokenDestinations()\":{\"notice\":\"Returns an array of authorized destination addresses\"},\"isAuthFunctionCall(bytes4)\":{\"notice\":\"Returns true if the function call is authorized\"},\"isTokenDestination(address)\":{\"notice\":\"Returns True if the address is authorized to be a destination of tokens\"},\"l1TransferTool()\":{\"notice\":\"Address of the L1 transfer tool contract (in L1, no aliasing)\"},\"l1WalletToL2Wallet(address)\":{\"notice\":\"Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received) L1 address => L2 address\"},\"l2Gateway()\":{\"notice\":\"Address of the L2GraphTokenGateway\"},\"l2WalletToL1Wallet(address)\":{\"notice\":\"Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received) L2 address => L1 address\"},\"onTokenTransfer(address,uint256,bytes)\":{\"notice\":\"This function is called by the L2GraphTokenGateway when tokens are sent from L1.\"},\"removeTokenDestination(address)\":{\"notice\":\"Removes an address that can be allowed by a token lock to pull funds\"},\"setAuthFunctionCall(string,address)\":{\"notice\":\"Sets an authorized function call to target\"},\"setAuthFunctionCallMany(string[],address[])\":{\"notice\":\"Sets an authorized function call to target in bulk\"},\"setMasterCopy(address)\":{\"notice\":\"Sets the masterCopy bytecode to use to create clones of TokenLock contracts\"},\"token()\":{\"notice\":\"Gets the GRT token address\"},\"unsetAuthFunctionCall(string)\":{\"notice\":\"Unsets an authorized function call to target\"},\"withdraw(uint256)\":{\"notice\":\"Withdraws tokens from the contract\"}},\"notice\":\"This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. In particular, this L2 variant is designed to receive token lock wallets from L1, through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until the end of the vesting timeline, but they can allow withdrawing funds back to L1 using the L2GraphTokenLockTransferTool contract. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/L2GraphTokenLockManager.sol\":\"L2GraphTokenLockManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/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 * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\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 virtual 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 virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\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, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, 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) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\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 *\\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 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 *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\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 *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting 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 *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting 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 *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\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 * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\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 *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\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 *\\n * - The divisor cannot be zero.\\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\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\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\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\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 IERC20;` 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 /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\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 from 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. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\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\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\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\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with 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 function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual 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\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\\n address addr;\\n require(address(this).balance >= amount, \\\"Create2: insufficient balance\\\");\\n require(bytecode.length != 0, \\\"Create2: bytecode length is zero\\\");\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n }\\n require(addr != address(0), \\\"Create2: Failed on deploy\\\");\\n return addr;\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\\n bytes32 _data = keccak256(\\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\\n );\\n return address(uint160(uint256(_data)));\\n }\\n}\\n\",\"keccak256\":\"0x0a0b021149946014fe1cd04af11e7a937a29986c47e8b1b718c2d50d729472db\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <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\",\"keccak256\":\"0x1562cd9922fbf739edfb979f506809e2743789cbde3177515542161c3d04b164\",\"license\":\"MIT\"},\"contracts/GraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport \\\"./MathUtils.sol\\\";\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\n/**\\n * @title GraphTokenLock\\n * @notice Contract that manages an unlocking schedule of tokens.\\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\\n * they can only be released under certain time conditions.\\n *\\n * This contract implements a release scheduled based on periods and tokens are released in steps\\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\\n * It also supports revocation to be used for vesting schedules.\\n *\\n * The contract supports receiving extra funds than the managed tokens ones that can be\\n * withdrawn by the beneficiary at any time.\\n *\\n * A releaseStartTime parameter is included to override the default release schedule and\\n * perform the first release on the configured time. After that it will continue with the\\n * default schedule.\\n */\\nabstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n uint256 private constant MIN_PERIOD = 1;\\n\\n // -- State --\\n\\n IERC20 public token;\\n address public beneficiary;\\n\\n // Configuration\\n\\n // Amount of tokens managed by the contract schedule\\n uint256 public managedAmount;\\n\\n uint256 public startTime; // Start datetime (in unixtimestamp)\\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\\n uint256 public periods; // Number of vesting/release periods\\n\\n // First release date for tokens (in unixtimestamp)\\n // If set, no tokens will be released before releaseStartTime ignoring\\n // the amount to release each period\\n uint256 public releaseStartTime;\\n // A cliff set a date to which a beneficiary needs to get to vest\\n // all preceding periods\\n uint256 public vestingCliffTime;\\n Revocability public revocable; // Whether to use vesting for locked funds\\n\\n // State\\n\\n bool public isRevoked;\\n bool public isInitialized;\\n bool public isAccepted;\\n uint256 public releasedAmount;\\n uint256 public revokedAmount;\\n\\n // -- Events --\\n\\n event TokensReleased(address indexed beneficiary, uint256 amount);\\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\\n event TokensRevoked(address indexed beneficiary, uint256 amount);\\n event BeneficiaryChanged(address newBeneficiary);\\n event LockAccepted();\\n event LockCanceled();\\n\\n /**\\n * @dev Only allow calls from the beneficiary of the contract\\n */\\n modifier onlyBeneficiary() {\\n require(msg.sender == beneficiary, \\\"!auth\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the contract\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _vestingCliffTime Override time for when the vesting start\\n * @param _revocable Whether the contract is revocable\\n */\\n function _initialize(\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) internal {\\n require(!isInitialized, \\\"Already initialized\\\");\\n require(_owner != address(0), \\\"Owner cannot be zero\\\");\\n require(_beneficiary != address(0), \\\"Beneficiary cannot be zero\\\");\\n require(_token != address(0), \\\"Token cannot be zero\\\");\\n require(_managedAmount > 0, \\\"Managed tokens cannot be zero\\\");\\n require(_startTime != 0, \\\"Start time must be set\\\");\\n require(_startTime < _endTime, \\\"Start time > end time\\\");\\n require(_periods >= MIN_PERIOD, \\\"Periods cannot be below minimum\\\");\\n require(_revocable != Revocability.NotSet, \\\"Must set a revocability option\\\");\\n require(_releaseStartTime < _endTime, \\\"Release start time must be before end time\\\");\\n require(_vestingCliffTime < _endTime, \\\"Cliff time must be before end time\\\");\\n\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_owner);\\n beneficiary = _beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _managedAmount;\\n\\n startTime = _startTime;\\n endTime = _endTime;\\n periods = _periods;\\n\\n // Optionals\\n releaseStartTime = _releaseStartTime;\\n vestingCliffTime = _vestingCliffTime;\\n revocable = _revocable;\\n }\\n\\n /**\\n * @notice Change the beneficiary of funds managed by the contract\\n * @dev Can only be called by the beneficiary\\n * @param _newBeneficiary Address of the new beneficiary address\\n */\\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\\n require(_newBeneficiary != address(0), \\\"Empty beneficiary\\\");\\n beneficiary = _newBeneficiary;\\n emit BeneficiaryChanged(_newBeneficiary);\\n }\\n\\n /**\\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\\n * @dev Can only be called by the beneficiary\\n */\\n function acceptLock() external onlyBeneficiary {\\n isAccepted = true;\\n emit LockAccepted();\\n }\\n\\n /**\\n * @notice Owner cancel the lock and return the balance in the contract\\n * @dev Can only be called by the owner\\n */\\n function cancelLock() external onlyOwner {\\n require(isAccepted == false, \\\"Cannot cancel accepted contract\\\");\\n\\n token.safeTransfer(owner(), currentBalance());\\n\\n emit LockCanceled();\\n }\\n\\n // -- Balances --\\n\\n /**\\n * @notice Returns the amount of tokens currently held by the contract\\n * @return Tokens held in the contract\\n */\\n function currentBalance() public view override returns (uint256) {\\n return token.balanceOf(address(this));\\n }\\n\\n // -- Time & Periods --\\n\\n /**\\n * @notice Returns the current block timestamp\\n * @return Current block timestamp\\n */\\n function currentTime() public view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @notice Gets duration of contract from start to end in seconds\\n * @return Amount of seconds from contract startTime to endTime\\n */\\n function duration() public view override returns (uint256) {\\n return endTime.sub(startTime);\\n }\\n\\n /**\\n * @notice Gets time elapsed since the start of the contract\\n * @dev Returns zero if called before conctract starTime\\n * @return Seconds elapsed from contract startTime\\n */\\n function sinceStartTime() public view override returns (uint256) {\\n uint256 current = currentTime();\\n if (current <= startTime) {\\n return 0;\\n }\\n return current.sub(startTime);\\n }\\n\\n /**\\n * @notice Returns amount available to be released after each period according to schedule\\n * @return Amount of tokens available after each period\\n */\\n function amountPerPeriod() public view override returns (uint256) {\\n return managedAmount.div(periods);\\n }\\n\\n /**\\n * @notice Returns the duration of each period in seconds\\n * @return Duration of each period in seconds\\n */\\n function periodDuration() public view override returns (uint256) {\\n return duration().div(periods);\\n }\\n\\n /**\\n * @notice Gets the current period based on the schedule\\n * @return A number that represents the current period\\n */\\n function currentPeriod() public view override returns (uint256) {\\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\\n }\\n\\n /**\\n * @notice Gets the number of periods that passed since the first period\\n * @return A number of periods that passed since the schedule started\\n */\\n function passedPeriods() public view override returns (uint256) {\\n return currentPeriod().sub(MIN_PERIOD);\\n }\\n\\n // -- Locking & Release Schedule --\\n\\n /**\\n * @notice Gets the currently available token according to the schedule\\n * @dev Implements the step-by-step schedule based on periods for available tokens\\n * @return Amount of tokens available according to the schedule\\n */\\n function availableAmount() public view override returns (uint256) {\\n uint256 current = currentTime();\\n\\n // Before contract start no funds are available\\n if (current < startTime) {\\n return 0;\\n }\\n\\n // After contract ended all funds are available\\n if (current > endTime) {\\n return managedAmount;\\n }\\n\\n // Get available amount based on period\\n return passedPeriods().mul(amountPerPeriod());\\n }\\n\\n /**\\n * @notice Gets the amount of currently vested tokens\\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\\n * @return Amount of tokens already vested\\n */\\n function vestedAmount() public view override returns (uint256) {\\n // If non-revocable it is fully vested\\n if (revocable == Revocability.Disabled) {\\n return managedAmount;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n return availableAmount();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule and takes into account already released tokens\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view virtual override returns (uint256) {\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n uint256 releasable = availableAmount().sub(releasedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\\n * @dev Does not consider schedule but just global amounts tracked\\n * @return Amount of outstanding tokens for the lifetime of the contract\\n */\\n function totalOutstandingAmount() public view override returns (uint256) {\\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\\n }\\n\\n /**\\n * @notice Gets surplus amount in the contract based on outstanding amount to release\\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary.\\n * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be\\n * skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\\n * @return Amount of tokens considered as surplus\\n */\\n function surplusAmount() public view override returns (uint256) {\\n uint256 balance = currentBalance();\\n uint256 outstandingAmount = totalOutstandingAmount();\\n if (balance > outstandingAmount) {\\n return balance.sub(outstandingAmount);\\n }\\n return 0;\\n }\\n\\n // -- Value Transfer --\\n\\n /**\\n * @notice Releases tokens based on the configured schedule\\n * @dev All available releasable tokens are transferred to beneficiary\\n */\\n function release() external override onlyBeneficiary {\\n uint256 amountToRelease = releasableAmount();\\n require(amountToRelease > 0, \\\"No available releasable amount\\\");\\n\\n releasedAmount = releasedAmount.add(amountToRelease);\\n\\n token.safeTransfer(beneficiary, amountToRelease);\\n\\n emit TokensReleased(beneficiary, amountToRelease);\\n }\\n\\n /**\\n * @notice Withdraws surplus, unmanaged tokens from the contract\\n * @dev Tokens in the contract over outstanding amount are considered as surplus\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n require(surplusAmount() >= _amount, \\\"Amount requested > surplus available\\\");\\n\\n token.safeTransfer(beneficiary, _amount);\\n\\n emit TokensWithdrawn(beneficiary, _amount);\\n }\\n\\n /**\\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\\n * @dev Vesting schedule is always calculated based on managed tokens\\n */\\n function revoke() external override onlyOwner {\\n require(revocable == Revocability.Enabled, \\\"Contract is non-revocable\\\");\\n require(isRevoked == false, \\\"Already revoked\\\");\\n\\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\\n require(unvestedAmount > 0, \\\"No available unvested amount\\\");\\n\\n revokedAmount = unvestedAmount;\\n isRevoked = true;\\n\\n token.safeTransfer(owner(), unvestedAmount);\\n\\n emit TokensRevoked(beneficiary, unvestedAmount);\\n }\\n}\\n\",\"keccak256\":\"0xd89470956a476c2fcf4a09625775573f95ba2c60a57fe866d90f65de1bcf5f2d\",\"license\":\"MIT\"},\"contracts/GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/EnumerableSet.sol\\\";\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport \\\"./MinimalProxyFactory.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract GraphTokenLockManager is Ownable, MinimalProxyFactory, IGraphTokenLockManager {\\n using SafeERC20 for IERC20;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n // -- State --\\n\\n mapping(bytes4 => address) public authFnCalls;\\n EnumerableSet.AddressSet private _tokenDestinations;\\n\\n address public masterCopy;\\n IERC20 internal _token;\\n\\n // -- Events --\\n\\n event MasterCopyUpdated(address indexed masterCopy);\\n event TokenLockCreated(\\n address indexed contractAddress,\\n bytes32 indexed initHash,\\n address indexed beneficiary,\\n address token,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n uint256 periods,\\n uint256 releaseStartTime,\\n uint256 vestingCliffTime,\\n IGraphTokenLock.Revocability revocable\\n );\\n\\n event TokensDeposited(address indexed sender, uint256 amount);\\n event TokensWithdrawn(address indexed sender, uint256 amount);\\n\\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\\n event TokenDestinationAllowed(address indexed dst, bool allowed);\\n\\n /**\\n * Constructor.\\n * @param _graphToken Token to use for deposits and withdrawals\\n * @param _masterCopy Address of the master copy to use to clone proxies\\n */\\n constructor(IERC20 _graphToken, address _masterCopy) {\\n require(address(_graphToken) != address(0), \\\"Token cannot be zero\\\");\\n _token = _graphToken;\\n setMasterCopy(_masterCopy);\\n }\\n\\n // -- Factory --\\n\\n /**\\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\\n * @param _masterCopy Address of contract bytecode to factory clone\\n */\\n function setMasterCopy(address _masterCopy) public override onlyOwner {\\n require(_masterCopy != address(0), \\\"MasterCopy cannot be zero\\\");\\n masterCopy = _masterCopy;\\n emit MasterCopyUpdated(_masterCopy);\\n }\\n\\n /**\\n * @notice Creates and fund a new token lock wallet using a minimum proxy\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _revocable Whether the contract is revocable\\n */\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external override onlyOwner {\\n require(_token.balanceOf(address(this)) >= _managedAmount, \\\"Not enough tokens to create lock\\\");\\n\\n // Create contract using a minimal proxy and call initializer\\n bytes memory initializer = abi.encodeWithSelector(\\n GraphTokenLockWallet.initialize.selector,\\n address(this),\\n _owner,\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _managedAmount);\\n\\n emit TokenLockCreated(\\n contractAddress,\\n keccak256(initializer),\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n }\\n\\n // -- Funds Management --\\n\\n /**\\n * @notice Gets the GRT token address\\n * @return Token used for transfers and approvals\\n */\\n function token() external view override returns (IERC20) {\\n return _token;\\n }\\n\\n /**\\n * @notice Deposits tokens into the contract\\n * @dev Even if the ERC20 token can be transferred directly to the contract\\n * this function provide a safe interface to do the transfer and avoid mistakes\\n * @param _amount Amount to deposit\\n */\\n function deposit(uint256 _amount) external override {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransferFrom(msg.sender, address(this), _amount);\\n emit TokensDeposited(msg.sender, _amount);\\n }\\n\\n /**\\n * @notice Withdraws tokens from the contract\\n * @dev Escape hatch in case of mistakes or to recover remaining funds\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdraw(uint256 _amount) external override onlyOwner {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransfer(msg.sender, _amount);\\n emit TokensWithdrawn(msg.sender, _amount);\\n }\\n\\n // -- Token Destinations --\\n\\n /**\\n * @notice Adds an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function addTokenDestination(address _dst) external override onlyOwner {\\n require(_dst != address(0), \\\"Destination cannot be zero\\\");\\n require(_tokenDestinations.add(_dst), \\\"Destination already added\\\");\\n emit TokenDestinationAllowed(_dst, true);\\n }\\n\\n /**\\n * @notice Removes an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function removeTokenDestination(address _dst) external override onlyOwner {\\n require(_tokenDestinations.remove(_dst), \\\"Destination already removed\\\");\\n emit TokenDestinationAllowed(_dst, false);\\n }\\n\\n /**\\n * @notice Returns True if the address is authorized to be a destination of tokens\\n * @param _dst Destination address\\n * @return True if authorized\\n */\\n function isTokenDestination(address _dst) external view override returns (bool) {\\n return _tokenDestinations.contains(_dst);\\n }\\n\\n /**\\n * @notice Returns an array of authorized destination addresses\\n * @return Array of addresses authorized to pull funds from a token lock\\n */\\n function getTokenDestinations() external view override returns (address[] memory) {\\n address[] memory dstList = new address[](_tokenDestinations.length());\\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\\n dstList[i] = _tokenDestinations.at(i);\\n }\\n return dstList;\\n }\\n\\n // -- Function Call Authorization --\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\\n _setAuthFunctionCall(_signature, _target);\\n }\\n\\n /**\\n * @notice Unsets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n */\\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = address(0);\\n\\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target in bulk\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signatures Function signatures\\n * @param _targets Address of the destination contract to call\\n */\\n function setAuthFunctionCallMany(\\n string[] calldata _signatures,\\n address[] calldata _targets\\n ) external override onlyOwner {\\n require(_signatures.length == _targets.length, \\\"Array length mismatch\\\");\\n\\n for (uint256 i = 0; i < _signatures.length; i++) {\\n _setAuthFunctionCall(_signatures[i], _targets[i]);\\n }\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\\n require(_target != address(this), \\\"Target must be other contract\\\");\\n require(Address.isContract(_target), \\\"Target must be a contract\\\");\\n\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = _target;\\n\\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\\n }\\n\\n /**\\n * @notice Gets the target contract to call for a particular function signature\\n * @param _sigHash Function signature hash\\n * @return Address of the target contract where to send the call\\n */\\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\\n return authFnCalls[_sigHash];\\n }\\n\\n /**\\n * @notice Returns true if the function call is authorized\\n * @param _sigHash Function signature hash\\n * @return True if authorized\\n */\\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\\n return getAuthFunctionCallTarget(_sigHash) != address(0);\\n }\\n\\n /**\\n * @dev Converts a function signature string to 4-bytes hash\\n * @param _signature Function signature string\\n * @return Function signature hash\\n */\\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\\n return _convertToBytes4(abi.encodeWithSignature(_signature));\\n }\\n\\n /**\\n * @dev Converts function signature bytes to function signature hash (bytes4)\\n * @param _signature Function signature\\n * @return Function signature in bytes4\\n */\\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\\n require(_signature.length == 4, \\\"Invalid method signature\\\");\\n bytes4 sigHash;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sigHash := mload(add(_signature, 32))\\n }\\n return sigHash;\\n }\\n}\\n\",\"keccak256\":\"0x2bb51cc1a18bd88113fd6947067ad2fff33048c8904cb54adfda8e2ab86752f2\",\"license\":\"MIT\"},\"contracts/GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./GraphTokenLock.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract GraphTokenLockWallet is GraphTokenLock {\\n using SafeMath for uint256;\\n\\n // -- State --\\n\\n IGraphTokenLockManager public manager;\\n uint256 public usedAmount;\\n\\n // -- Events --\\n\\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\\n event TokenDestinationsApproved();\\n event TokenDestinationsRevoked();\\n\\n // Initializer\\n function initialize(\\n address _manager,\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) external {\\n _initialize(\\n _owner,\\n _beneficiary,\\n _token,\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n _setManager(_manager);\\n }\\n\\n // -- Admin --\\n\\n /**\\n * @notice Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function setManager(address _newManager) external onlyOwner {\\n _setManager(_newManager);\\n }\\n\\n /**\\n * @dev Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function _setManager(address _newManager) internal {\\n require(_newManager != address(0), \\\"Manager cannot be empty\\\");\\n require(Address.isContract(_newManager), \\\"Manager must be a contract\\\");\\n\\n address oldManager = address(manager);\\n manager = IGraphTokenLockManager(_newManager);\\n\\n emit ManagerUpdated(oldManager, _newManager);\\n }\\n\\n // -- Beneficiary --\\n\\n /**\\n * @notice Approves protocol access of the tokens managed by this contract\\n * @dev Approves all token destinations registered in the manager to pull tokens\\n */\\n function approveProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe because we are using the max uint256 value\\n token.approve(dstList[i], type(uint256).max);\\n }\\n emit TokenDestinationsApproved();\\n }\\n\\n /**\\n * @notice Revokes protocol access of the tokens managed by this contract\\n * @dev Revokes approval to all token destinations in the manager to pull tokens\\n */\\n function revokeProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe cause we're using 0 as the amount\\n token.approve(dstList[i], 0);\\n }\\n emit TokenDestinationsRevoked();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule, takes into account already released tokens and used amount\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view override returns (uint256) {\\n if (revocable == Revocability.Disabled) {\\n return super.releasableAmount();\\n }\\n\\n // -- Revocability enabled logic\\n // This needs to deal with additional considerations for when tokens are used in the protocol\\n\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n // We consider the `usedAmount` in the protocol as part of the calculations\\n // the beneficiary should not release funds that are used.\\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Forward authorized contract calls to protocol contracts\\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\\n */\\n // solhint-disable-next-line no-complex-fallback\\n fallback() external payable {\\n // Only beneficiary can forward calls\\n require(msg.sender == beneficiary, \\\"Unauthorized caller\\\");\\n require(msg.value == 0, \\\"ETH transfers not supported\\\");\\n\\n // Function call validation\\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\\n require(_target != address(0), \\\"Unauthorized function\\\");\\n\\n uint256 oldBalance = currentBalance();\\n\\n // Call function with data\\n Address.functionCall(_target, msg.data);\\n\\n // Tracked used tokens in the protocol\\n // We do this check after balances were updated by the forwarded call\\n // Check is only enforced for revocable contracts to save some gas\\n if (revocable == Revocability.Enabled) {\\n // Track contract balance change\\n uint256 newBalance = currentBalance();\\n if (newBalance < oldBalance) {\\n // Outflow\\n uint256 diff = oldBalance.sub(newBalance);\\n usedAmount = usedAmount.add(diff);\\n } else {\\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\\n // underflow. We set it to zero in that case.\\n uint256 diff = newBalance.sub(oldBalance);\\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\\n }\\n require(usedAmount <= vestedAmount(), \\\"Cannot use more tokens than vested amount\\\");\\n }\\n }\\n\\n /**\\n * @notice Receive function that always reverts.\\n * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159\\n */\\n receive() external payable {\\n revert(\\\"Bad call\\\");\\n }\\n}\\n\",\"keccak256\":\"0x976c2ba4c1503a81ea02bd84539c516e99af611ff767968ee25456b50a6deb7b\",\"license\":\"MIT\"},\"contracts/ICallhookReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\n\\n// Copied from graphprotocol/contracts, changed solidity version to 0.7.3\\n\\n/**\\n * @title Interface for contracts that can receive callhooks through the Arbitrum GRT bridge\\n * @dev Any contract that can receive a callhook on L2, sent through the bridge from L1, must\\n * be allowlisted by the governor, but also implement this interface that contains\\n * the function that will actually be called by the L2GraphTokenGateway.\\n */\\npragma solidity ^0.7.3;\\n\\ninterface ICallhookReceiver {\\n /**\\n * @notice Receive tokens with a callhook from the bridge\\n * @param _from Token sender in L1\\n * @param _amount Amount of tokens that were transferred\\n * @param _data ABI-encoded callhook data\\n */\\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external;\\n}\\n\",\"keccak256\":\"0xb90eae14e8bac012a4b99fabe7a1110f70143eb78476ea0d6b52557ef979fa0e\",\"license\":\"GPL-2.0-or-later\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/L2GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { ICallhookReceiver } from \\\"./ICallhookReceiver.sol\\\";\\nimport { GraphTokenLockManager } from \\\"./GraphTokenLockManager.sol\\\";\\nimport { L2GraphTokenLockWallet } from \\\"./L2GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title L2GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * In particular, this L2 variant is designed to receive token lock wallets from L1,\\n * through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until\\n * the end of the vesting timeline, but they can allow withdrawing funds back to L1 using\\n * the L2GraphTokenLockTransferTool contract.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract L2GraphTokenLockManager is GraphTokenLockManager, ICallhookReceiver {\\n using SafeERC20 for IERC20;\\n\\n /// @dev Struct to hold the data of a transferred wallet; this is\\n /// the data that must be encoded in L1 to send a wallet to L2.\\n struct TransferredWalletData {\\n address l1Address;\\n address owner;\\n address beneficiary;\\n uint256 managedAmount;\\n uint256 startTime;\\n uint256 endTime;\\n }\\n\\n /// Address of the L2GraphTokenGateway\\n address public immutable l2Gateway;\\n /// Address of the L1 transfer tool contract (in L1, no aliasing)\\n address public immutable l1TransferTool;\\n /// Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received)\\n /// L1 address => L2 address\\n mapping(address => address) public l1WalletToL2Wallet;\\n /// Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received)\\n /// L2 address => L1 address\\n mapping(address => address) public l2WalletToL1Wallet;\\n\\n /// @dev Event emitted when a wallet is received and created from L1\\n event TokenLockCreatedFromL1(\\n address indexed contractAddress,\\n bytes32 initHash,\\n address indexed beneficiary,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n address indexed l1Address\\n );\\n\\n /// @dev Emitted when locked tokens are received from L1 (whether the wallet\\n /// had already been received or not)\\n event LockedTokensReceivedFromL1(address indexed l1Address, address indexed l2Address, uint256 amount);\\n\\n /**\\n * @dev Checks that the sender is the L2GraphTokenGateway.\\n */\\n modifier onlyL2Gateway() {\\n require(msg.sender == l2Gateway, \\\"ONLY_GATEWAY\\\");\\n _;\\n }\\n\\n /**\\n * @notice Constructor for the L2GraphTokenLockManager contract.\\n * @param _graphToken Address of the L2 GRT token contract\\n * @param _masterCopy Address of the master copy of the L2GraphTokenLockWallet implementation\\n * @param _l2Gateway Address of the L2GraphTokenGateway contract\\n * @param _l1TransferTool Address of the L1 transfer tool contract (in L1, without aliasing)\\n */\\n constructor(\\n IERC20 _graphToken,\\n address _masterCopy,\\n address _l2Gateway,\\n address _l1TransferTool\\n ) GraphTokenLockManager(_graphToken, _masterCopy) {\\n l2Gateway = _l2Gateway;\\n l1TransferTool = _l1TransferTool;\\n }\\n\\n /**\\n * @notice This function is called by the L2GraphTokenGateway when tokens are sent from L1.\\n * @dev This function will create a new wallet if it doesn't exist yet, or send the tokens to\\n * the existing wallet if it does.\\n * @param _from Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\\n * @param _amount Amount of tokens received\\n * @param _data Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\\n */\\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external override onlyL2Gateway {\\n require(_from == l1TransferTool, \\\"ONLY_TRANSFER_TOOL\\\");\\n TransferredWalletData memory walletData = abi.decode(_data, (TransferredWalletData));\\n\\n if (l1WalletToL2Wallet[walletData.l1Address] != address(0)) {\\n // If the wallet was already received, just send the tokens to the L2 address\\n _token.safeTransfer(l1WalletToL2Wallet[walletData.l1Address], _amount);\\n } else {\\n // Create contract using a minimal proxy and call initializer\\n (bytes32 initHash, address contractAddress) = _deployFromL1(keccak256(_data), walletData);\\n l1WalletToL2Wallet[walletData.l1Address] = contractAddress;\\n l2WalletToL1Wallet[contractAddress] = walletData.l1Address;\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _amount);\\n\\n emit TokenLockCreatedFromL1(\\n contractAddress,\\n initHash,\\n walletData.beneficiary,\\n walletData.managedAmount,\\n walletData.startTime,\\n walletData.endTime,\\n walletData.l1Address\\n );\\n }\\n emit LockedTokensReceivedFromL1(walletData.l1Address, l1WalletToL2Wallet[walletData.l1Address], _amount);\\n }\\n\\n /**\\n * @dev Deploy a token lock wallet with data received from L1\\n * @param _salt Salt for the CREATE2 call, which must be the hash of the wallet data\\n * @param _walletData Data of the wallet to be created\\n * @return Hash of the initialization calldata\\n * @return Address of the created contract\\n */\\n function _deployFromL1(bytes32 _salt, TransferredWalletData memory _walletData) internal returns (bytes32, address) {\\n bytes memory initializer = _encodeInitializer(_walletData);\\n address contractAddress = _deployProxy2(_salt, masterCopy, initializer);\\n return (keccak256(initializer), contractAddress);\\n }\\n\\n /**\\n * @dev Encode the initializer for the token lock wallet received from L1\\n * @param _walletData Data of the wallet to be created\\n * @return Encoded initializer calldata, including the function signature\\n */\\n function _encodeInitializer(TransferredWalletData memory _walletData) internal view returns (bytes memory) {\\n return\\n abi.encodeWithSelector(\\n L2GraphTokenLockWallet.initializeFromL1.selector,\\n address(this),\\n address(_token),\\n _walletData\\n );\\n }\\n}\\n\",\"keccak256\":\"0x34ca0ffc898ce3615a000d53a9c58708354b8cd8093b3c61decfe7388f0c16e0\",\"license\":\"MIT\"},\"contracts/L2GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport { L2GraphTokenLockManager } from \\\"./L2GraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title L2GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * This L2 variant includes a special initializer so that it can be created from\\n * a wallet's data received from L1. These transferred wallets will not allow releasing\\n * funds in L2 until the end of the vesting timeline, but they can allow withdrawing\\n * funds back to L1 using the L2GraphTokenLockTransferTool contract.\\n *\\n * Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1,\\n * so releasing surplus tokens might also only be possible by bridging tokens back to L1.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract L2GraphTokenLockWallet is GraphTokenLockWallet {\\n // Initializer when created from a message from L1\\n function initializeFromL1(\\n address _manager,\\n address _token,\\n L2GraphTokenLockManager.TransferredWalletData calldata _walletData\\n ) external {\\n require(!isInitialized, \\\"Already initialized\\\");\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_walletData.owner);\\n beneficiary = _walletData.beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _walletData.managedAmount;\\n\\n startTime = _walletData.startTime;\\n endTime = _walletData.endTime;\\n periods = 1;\\n isAccepted = true;\\n\\n // Optionals\\n releaseStartTime = _walletData.endTime;\\n revocable = Revocability.Disabled;\\n\\n _setManager(_manager);\\n }\\n}\\n\",\"keccak256\":\"0x8842140c2c7924be4ab1bca71e0b0ad6dd1dba6433cfdc523bfd204288b25d20\",\"license\":\"MIT\"},\"contracts/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nlibrary MathUtils {\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0xe2512e1da48bc8363acd15f66229564b02d66706665d7da740604566913c1400\",\"license\":\"MIT\"},\"contracts/MinimalProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport { Address } from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport { Create2 } from \\\"@openzeppelin/contracts/utils/Create2.sol\\\";\\n\\n/**\\n * @title MinimalProxyFactory: a factory contract for creating minimal proxies\\n * @notice Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\\n * Based on https://eips.ethereum.org/EIPS/eip-1167\\n */\\ncontract MinimalProxyFactory {\\n /// @dev Emitted when a new proxy is created\\n event ProxyCreated(address indexed proxy);\\n\\n /**\\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _deployer Address of the deployer that creates the contract\\n * @return Address of the counterfactual MinimalProxy\\n */\\n function getDeploymentAddress(\\n bytes32 _salt,\\n address _implementation,\\n address _deployer\\n ) public pure returns (address) {\\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), _deployer);\\n }\\n\\n /**\\n * @dev Deploys a MinimalProxy with CREATE2\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _data Bytes with the initializer call\\n * @return Address of the deployed MinimalProxy\\n */\\n function _deployProxy2(bytes32 _salt, address _implementation, bytes memory _data) internal returns (address) {\\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\\n\\n emit ProxyCreated(proxyAddress);\\n\\n // Call function with data\\n if (_data.length > 0) {\\n Address.functionCall(proxyAddress, _data);\\n }\\n\\n return proxyAddress;\\n }\\n\\n /**\\n * @dev Gets the MinimalProxy bytecode\\n * @param _implementation Address of the proxy target implementation\\n * @return MinimalProxy bytecode\\n */\\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\\n bytes10 creation = 0x3d602d80600a3d3981f3;\\n bytes10 prefix = 0x363d3d373d3d3d363d73;\\n bytes20 targetBytes = bytes20(_implementation);\\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\\n }\\n}\\n\",\"keccak256\":\"0x67d67a567bceb363ddb199b1e4ab06e7a99f16e034e03086971a332c09ec5c0e\",\"license\":\"MIT\"},\"contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\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 * The owner account will be passed on initialization of the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\n /// @dev Owner of the contract, can be retrieved with the public owner() function\\n address private _owner;\\n /// @dev Since upgradeable contracts might inherit this, we add a storage gap\\n /// to allow adding variables here without breaking the proxy storage layout\\n uint256[50] private __gap;\\n\\n /// @dev Emitted when ownership of the contract is transferred\\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 owner) internal {\\n _owner = owner;\\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(_owner == msg.sender, \\\"Ownable: caller is not the owner\\\");\\n _;\\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() external virtual 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) external virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xe8750687082e8e24b620dbf58c3a08eee591ed7b4d5a3e13cc93554ec647fd09\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60c06040523480156200001157600080fd5b506040516200499938038062004999833981810160405281019062000037919062000410565b838360006200004b6200022860201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156200015c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001539062000586565b60405180910390fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550620001ae816200023060201b60201c565b50508173ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b815250508073ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff1660601b815250505050505062000635565b600033905090565b620002406200022860201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1662000266620003b960201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1614620002bf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002b69062000564565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141562000332576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620003299062000542565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600081519050620003f38162000601565b92915050565b6000815190506200040a816200061b565b92915050565b600080600080608085870312156200042757600080fd5b60006200043787828801620003f9565b94505060206200044a87828801620003e2565b93505060406200045d87828801620003e2565b92505060606200047087828801620003e2565b91505092959194509250565b60006200048b601983620005a8565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000620004cd602083620005a8565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006200050f601483620005a8565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b600060208201905081810360008301526200055d816200047c565b9050919050565b600060208201905081810360008301526200057f81620004be565b9050919050565b60006020820190508181036000830152620005a18162000500565b9050919050565b600082825260208201905092915050565b6000620005c682620005e1565b9050919050565b6000620005da82620005b9565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6200060c81620005b9565b81146200061857600080fd5b50565b6200062681620005cd565b81146200063257600080fd5b50565b60805160601c60a05160601c61433062000669600039806109195280611280525080610fc952806111f252506143306000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c806379ee1bdf116100de578063a619486e11610097578063cf497e6c11610071578063cf497e6c14610434578063f1d24c4514610450578063f2fde38b14610480578063fc0c546a1461049c57610173565b8063a619486e146103de578063b6b55f25146103fc578063c1ab13db1461041857610173565b806379ee1bdf1461031c5780638da5cb5b1461034c5780638fa74a0e1461036a5780639c05fc6014610388578063a3457466146103a4578063a4c0ed36146103c257610173565b8063463013a211610130578063463013a214610270578063586a53531461028c5780635975e00c146102aa57806368d30c2e146102c65780636e03b8dc146102e2578063715018a61461031257610173565b806303990a6c14610178578063045b7fe2146101945780630602ba2b146101c45780630cd6178f146101f45780632e1a7d4d1461022457806343fb93d914610240575b600080fd5b610192600480360381019061018d9190612f13565b6104ba565b005b6101ae60048036038101906101a99190612ca2565b610662565b6040516101bb91906139bc565b60405180910390f35b6101de60048036038101906101d99190612eea565b610695565b6040516101eb9190613bba565b60405180910390f35b61020e60048036038101906102099190612ca2565b6106d6565b60405161021b91906139bc565b60405180910390f35b61023e60048036038101906102399190612fd9565b610709565b005b61025a60048036038101906102559190612e9b565b610866565b60405161026791906139bc565b60405180910390f35b61028a60048036038101906102859190612f58565b61088b565b005b610294610917565b6040516102a191906139bc565b60405180910390f35b6102c460048036038101906102bf9190612ca2565b61093b565b005b6102e060048036038101906102db9190612ccb565b610acc565b005b6102fc60048036038101906102f79190612eea565b610e14565b60405161030991906139bc565b60405180910390f35b61031a610e47565b005b61033660048036038101906103319190612ca2565b610f81565b6040516103439190613bba565b60405180910390f35b610354610f9e565b60405161036191906139bc565b60405180910390f35b610372610fc7565b60405161037f91906139bc565b60405180910390f35b6103a2600480360381019061039d9190612dfd565b610feb565b005b6103ac611118565b6040516103b99190613b98565b60405180910390f35b6103dc60048036038101906103d79190612d91565b6111f0565b005b6103e6611756565b6040516103f391906139bc565b60405180910390f35b61041660048036038101906104119190612fd9565b61177c565b005b610432600480360381019061042d9190612ca2565b61185f565b005b61044e60048036038101906104499190612ca2565b611980565b005b61046a60048036038101906104659190612eea565b611af3565b60405161047791906139bc565b60405180910390f35b61049a60048036038101906104959190612ca2565b611b6e565b005b6104a4611d17565b6040516104b19190613c1a565b60405180910390f35b6104c2611d41565b73ffffffffffffffffffffffffffffffffffffffff166104e0610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052d90613e3b565b60405180910390fd5b60006105428383611d49565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98686604051610655929190613c35565b60405180910390a4505050565b60076020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff166106b783611af3565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b60066020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610711611d41565b73ffffffffffffffffffffffffffffffffffffffff1661072f610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610785576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077c90613e3b565b60405180910390fd5b600081116107c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107bf90613e1b565b60405180910390fd5b6108153382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b8260405161085b9190613f1b565b60405180910390a250565b60006108828461087585611e5d565b8051906020012084611ed3565b90509392505050565b610893611d41565b73ffffffffffffffffffffffffffffffffffffffff166108b1610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610907576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108fe90613e3b565b60405180910390fd5b610912838383611f17565b505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b610943611d41565b73ffffffffffffffffffffffffffffffffffffffff16610961610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146109b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ae90613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1e90613cfb565b60405180910390fd5b610a3b8160026120f990919063ffffffff16565b610a7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7190613e7b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610ac19190613bba565b60405180910390a250565b610ad4611d41565b73ffffffffffffffffffffffffffffffffffffffff16610af2610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610b48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3f90613e3b565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610ba491906139bc565b60206040518083038186803b158015610bbc57600080fd5b505afa158015610bd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf49190613002565b1015610c35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2c90613d3b565b60405180910390fd5b606063bd896dcb60e01b308b8b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168c8c8c8c8c8c8c604051602401610c869b9a999897969594939291906139d7565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610d1b8280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612129565b9050610d6a818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610dff989796959493929190613b1a565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e4f611d41565b73ffffffffffffffffffffffffffffffffffffffff16610e6d610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610ec3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eba90613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610f978260026121a590919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b610ff3611d41565b73ffffffffffffffffffffffffffffffffffffffff16611011610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105e90613e3b565b60405180910390fd5b8181905084849050146110af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a690613cbb565b60405180910390fd5b60005b84849050811015611111576111048585838181106110cc57fe5b90506020028101906110de9190613f36565b8585858181106110ea57fe5b90506020020160208101906110ff9190612ca2565b611f17565b80806001019150506110b2565b5050505050565b60608061112560026121d5565b67ffffffffffffffff8111801561113b57600080fd5b5060405190808252806020026020018201604052801561116a5781602001602082028036833780820191505090505b50905060005b61117a60026121d5565b8110156111e8576111958160026121ea90919063ffffffff16565b8282815181106111a157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611170565b508091505090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461127e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127590613cdb565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161461130c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130390613d7b565b60405180910390fd5b6113146129d3565b82828101906113239190612fb0565b9050600073ffffffffffffffffffffffffffffffffffffffff1660066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114715761146c60066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b611683565b6000806114958585604051611487929190613973565b604051809103902084612204565b915091508060066000856000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260000151600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506115ea8187600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b826000015173ffffffffffffffffffffffffffffffffffffffff16836040015173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fd74fe60cbf1e5bf07ef3fad0e00c45f66345c5226474786d8dc086527dc8414785876060015188608001518960a001516040516116789493929190613bd5565b60405180910390a450505b60066000826000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff167fe34903cfa4ad8362651171309d05bcbc2fc581a5ec83ca7b0c8d10743de766e2866040516117479190613f1b565b60405180910390a35050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081116117bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117b690613e1b565b60405180910390fd5b61180e333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661225b909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516118549190613f1b565b60405180910390a250565b611867611d41565b73ffffffffffffffffffffffffffffffffffffffff16611885610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146118db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d290613e3b565b60405180910390fd5b6118ef8160026122e490919063ffffffff16565b61192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192590613d9b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960006040516119759190613bba565b60405180910390a250565b611988611d41565b73ffffffffffffffffffffffffffffffffffffffff166119a6610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146119fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f390613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611a6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6390613dbb565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b611b76611d41565b73ffffffffffffffffffffffffffffffffffffffff16611b94610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614611bea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be190613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5190613d1b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b6000611dcf83836040516024016040516020818303038152906040529190604051611d759291906139a3565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612314565b905092915050565b611e588363a9059cbb60e01b8484604051602401611df6929190613af1565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061236c565b505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611eb994939291906138d7565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611ef19493929190613925565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611f86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f7d90613ddb565b60405180910390fd5b611f8f81612433565b611fce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc590613efb565b60405180910390fd5b6000611fda8484611d49565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c987876040516120eb929190613c35565b60405180910390a450505050565b6000612121836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612446565b905092915050565b60008061214060008661213b87611e5d565b6124b6565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a260008351111561219a5761219881846125c7565b505b809150509392505050565b60006121cd836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612611565b905092915050565b60006121e382600001612634565b9050919050565b60006121f98360000183612645565b60001c905092915050565b6000806060612212846126b2565b9050600061224386600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612129565b90508180519060200120819350935050509250929050565b6122de846323b872dd60e01b85858560405160240161227c93929190613aba565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061236c565b50505050565b600061230c836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612757565b905092915050565b6000600482511461235a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235190613e5b565b60405180910390fd5b60006020830151905080915050919050565b60606123ce826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661283f9092919063ffffffff16565b905060008151111561242e57808060200190518101906123ee9190612e72565b61242d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161242490613ebb565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b60006124528383612611565b6124ab5782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506124b0565b600090505b92915050565b600080844710156124fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f390613edb565b60405180910390fd5b600083511415612541576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161253890613c9b565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156125bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125b390613dfb565b60405180910390fd5b809150509392505050565b606061260983836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061283f565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011612690576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161268790613c7b565b60405180910390fd5b82600001828154811061269f57fe5b9060005260206000200154905092915050565b60606320dc203d60e01b30600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040516024016126f393929190613a82565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050509050919050565b6000808360010160008481526020019081526020016000205490506000811461283357600060018203905060006001866000018054905003905060008660000182815481106127a257fe5b90600052602060002001549050808760000184815481106127bf57fe5b90600052602060002001819055506001830187600101600083815260200190815260200160002081905550866000018054806127f757fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612839565b60009150505b92915050565b606061284e8484600085612857565b90509392505050565b60608247101561289c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161289390613d5b565b60405180910390fd5b6128a585612433565b6128e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128db90613e9b565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff16858760405161290e919061398c565b60006040518083038185875af1925050503d806000811461294b576040519150601f19603f3d011682016040523d82523d6000602084013e612950565b606091505b509150915061296082828661296c565b92505050949350505050565b6060831561297c578290506129cc565b60008351111561298f5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129c39190613c59565b60405180910390fd5b9392505050565b6040518060c00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081525090565b600081359050612a5a81614277565b92915050565b60008083601f840112612a7257600080fd5b8235905067ffffffffffffffff811115612a8b57600080fd5b602083019150836020820283011115612aa357600080fd5b9250929050565b60008083601f840112612abc57600080fd5b8235905067ffffffffffffffff811115612ad557600080fd5b602083019150836020820283011115612aed57600080fd5b9250929050565b600081519050612b038161428e565b92915050565b600081359050612b18816142a5565b92915050565b600081359050612b2d816142bc565b92915050565b60008083601f840112612b4557600080fd5b8235905067ffffffffffffffff811115612b5e57600080fd5b602083019150836001820283011115612b7657600080fd5b9250929050565b600081359050612b8c816142d3565b92915050565b60008083601f840112612ba457600080fd5b8235905067ffffffffffffffff811115612bbd57600080fd5b602083019150836001820283011115612bd557600080fd5b9250929050565b600060c08284031215612bee57600080fd5b612bf860c0613f8d565b90506000612c0884828501612a4b565b6000830152506020612c1c84828501612a4b565b6020830152506040612c3084828501612a4b565b6040830152506060612c4484828501612c78565b6060830152506080612c5884828501612c78565b60808301525060a0612c6c84828501612c78565b60a08301525092915050565b600081359050612c87816142e3565b92915050565b600081519050612c9c816142e3565b92915050565b600060208284031215612cb457600080fd5b6000612cc284828501612a4b565b91505092915050565b60008060008060008060008060006101208a8c031215612cea57600080fd5b6000612cf88c828d01612a4b565b9950506020612d098c828d01612a4b565b9850506040612d1a8c828d01612c78565b9750506060612d2b8c828d01612c78565b9650506080612d3c8c828d01612c78565b95505060a0612d4d8c828d01612c78565b94505060c0612d5e8c828d01612c78565b93505060e0612d6f8c828d01612c78565b925050610100612d818c828d01612b7d565b9150509295985092959850929598565b60008060008060608587031215612da757600080fd5b6000612db587828801612a4b565b9450506020612dc687828801612c78565b935050604085013567ffffffffffffffff811115612de357600080fd5b612def87828801612b33565b925092505092959194509250565b60008060008060408587031215612e1357600080fd5b600085013567ffffffffffffffff811115612e2d57600080fd5b612e3987828801612aaa565b9450945050602085013567ffffffffffffffff811115612e5857600080fd5b612e6487828801612a60565b925092505092959194509250565b600060208284031215612e8457600080fd5b6000612e9284828501612af4565b91505092915050565b600080600060608486031215612eb057600080fd5b6000612ebe86828701612b09565b9350506020612ecf86828701612a4b565b9250506040612ee086828701612a4b565b9150509250925092565b600060208284031215612efc57600080fd5b6000612f0a84828501612b1e565b91505092915050565b60008060208385031215612f2657600080fd5b600083013567ffffffffffffffff811115612f4057600080fd5b612f4c85828601612b92565b92509250509250929050565b600080600060408486031215612f6d57600080fd5b600084013567ffffffffffffffff811115612f8757600080fd5b612f9386828701612b92565b93509350506020612fa686828701612a4b565b9150509250925092565b600060c08284031215612fc257600080fd5b6000612fd084828501612bdc565b91505092915050565b600060208284031215612feb57600080fd5b6000612ff984828501612c78565b91505092915050565b60006020828403121561301457600080fd5b600061302284828501612c8d565b91505092915050565b60006130378383613043565b60208301905092915050565b61304c81614034565b82525050565b61305b81614034565b82525050565b61307261306d82614034565b6141ed565b82525050565b600061308382613fce565b61308d8185613ffc565b935061309883613fbe565b8060005b838110156130c95781516130b0888261302b565b97506130bb83613fef565b92505060018101905061309c565b5085935050505092915050565b6130df81614046565b82525050565b6130f66130f18261407e565b614209565b82525050565b61310d613108826140aa565b614213565b82525050565b61312461311f82614052565b6141ff565b82525050565b61313b613136826140d6565b61421d565b82525050565b61314a81614102565b82525050565b61316161315c82614102565b614227565b82525050565b6000613173838561400d565b93506131808385846141ab565b82840190509392505050565b600061319782613fd9565b6131a1818561400d565b93506131b18185602086016141ba565b80840191505092915050565b6131c681614175565b82525050565b6131d581614199565b82525050565b60006131e78385614018565b93506131f48385846141ab565b6131fd83614245565b840190509392505050565b60006132148385614029565b93506132218385846141ab565b82840190509392505050565b600061323882613fe4565b6132428185614018565b93506132528185602086016141ba565b61325b81614245565b840191505092915050565b6000613273602283614018565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006132d9602083614018565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b6000613319601583614018565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000613359600c83614018565b91507f4f4e4c595f4741544557415900000000000000000000000000000000000000006000830152602082019050919050565b6000613399601a83614018565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006133d9602683614018565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061343f602083614018565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b600061347f602683614018565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006134e5601283614018565b91507f4f4e4c595f5452414e534645525f544f4f4c00000000000000000000000000006000830152602082019050919050565b6000613525601b83614018565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000613565601983614018565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b60006135a5601d83614018565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b60006135e5601983614018565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000613625601583614018565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000613665602083614018565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006136a5601883614018565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b60006136e5601983614018565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000613725601d83614018565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613765602a83614018565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b60006137cb601d83614018565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b600061380b601983614018565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b60c0820160008201516138546000850182613043565b5060208201516138676020850182613043565b50604082015161387a6040850182613043565b50606082015161388d60608501826138b9565b5060808201516138a060808501826138b9565b5060a08201516138b360a08501826138b9565b50505050565b6138c28161416b565b82525050565b6138d18161416b565b82525050565b60006138e382876130e5565b600a820191506138f382866130e5565b600a82019150613903828561312a565b60148201915061391382846130fc565b600f8201915081905095945050505050565b60006139318287613113565b6001820191506139418286613061565b6014820191506139518285613150565b6020820191506139618284613150565b60208201915081905095945050505050565b6000613980828486613167565b91508190509392505050565b6000613998828461318c565b915081905092915050565b60006139b0828486613208565b91508190509392505050565b60006020820190506139d16000830184613052565b92915050565b6000610160820190506139ed600083018e613052565b6139fa602083018d613052565b613a07604083018c613052565b613a14606083018b613052565b613a21608083018a6138c8565b613a2e60a08301896138c8565b613a3b60c08301886138c8565b613a4860e08301876138c8565b613a566101008301866138c8565b613a646101208301856138c8565b613a726101408301846131cc565b9c9b505050505050505050505050565b600061010082019050613a986000830186613052565b613aa56020830185613052565b613ab2604083018461383e565b949350505050565b6000606082019050613acf6000830186613052565b613adc6020830185613052565b613ae960408301846138c8565b949350505050565b6000604082019050613b066000830185613052565b613b1360208301846138c8565b9392505050565b600061010082019050613b30600083018b613052565b613b3d602083018a6138c8565b613b4a60408301896138c8565b613b5760608301886138c8565b613b6460808301876138c8565b613b7160a08301866138c8565b613b7e60c08301856138c8565b613b8b60e08301846131cc565b9998505050505050505050565b60006020820190508181036000830152613bb28184613078565b905092915050565b6000602082019050613bcf60008301846130d6565b92915050565b6000608082019050613bea6000830187613141565b613bf760208301866138c8565b613c0460408301856138c8565b613c1160608301846138c8565b95945050505050565b6000602082019050613c2f60008301846131bd565b92915050565b60006020820190508181036000830152613c508184866131db565b90509392505050565b60006020820190508181036000830152613c73818461322d565b905092915050565b60006020820190508181036000830152613c9481613266565b9050919050565b60006020820190508181036000830152613cb4816132cc565b9050919050565b60006020820190508181036000830152613cd48161330c565b9050919050565b60006020820190508181036000830152613cf48161334c565b9050919050565b60006020820190508181036000830152613d148161338c565b9050919050565b60006020820190508181036000830152613d34816133cc565b9050919050565b60006020820190508181036000830152613d5481613432565b9050919050565b60006020820190508181036000830152613d7481613472565b9050919050565b60006020820190508181036000830152613d94816134d8565b9050919050565b60006020820190508181036000830152613db481613518565b9050919050565b60006020820190508181036000830152613dd481613558565b9050919050565b60006020820190508181036000830152613df481613598565b9050919050565b60006020820190508181036000830152613e14816135d8565b9050919050565b60006020820190508181036000830152613e3481613618565b9050919050565b60006020820190508181036000830152613e5481613658565b9050919050565b60006020820190508181036000830152613e7481613698565b9050919050565b60006020820190508181036000830152613e94816136d8565b9050919050565b60006020820190508181036000830152613eb481613718565b9050919050565b60006020820190508181036000830152613ed481613758565b9050919050565b60006020820190508181036000830152613ef4816137be565b9050919050565b60006020820190508181036000830152613f14816137fe565b9050919050565b6000602082019050613f3060008301846138c8565b92915050565b60008083356001602003843603038112613f4f57600080fd5b80840192508235915067ffffffffffffffff821115613f6d57600080fd5b602083019250600182023603831315613f8557600080fd5b509250929050565b6000604051905081810181811067ffffffffffffffff82111715613fb457613fb3614243565b5b8060405250919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061403f8261414b565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061414682614263565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061418082614187565b9050919050565b60006141928261414b565b9050919050565b60006141a482614138565b9050919050565b82818337600083830152505050565b60005b838110156141d85780820151818401526020810190506141bd565b838111156141e7576000848401525b50505050565b60006141f882614231565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b600061423c82614256565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061427457614273614243565b5b50565b61428081614034565b811461428b57600080fd5b50565b61429781614046565b81146142a257600080fd5b50565b6142ae81614102565b81146142b957600080fd5b50565b6142c58161410c565b81146142d057600080fd5b50565b600381106142e057600080fd5b50565b6142ec8161416b565b81146142f757600080fd5b5056fea264697066735822122010f167ec85dbd4b07aedb6960f9f6ac5ae1b0f5473409617dcd319393591837164736f6c63430007030033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101735760003560e01c806379ee1bdf116100de578063a619486e11610097578063cf497e6c11610071578063cf497e6c14610434578063f1d24c4514610450578063f2fde38b14610480578063fc0c546a1461049c57610173565b8063a619486e146103de578063b6b55f25146103fc578063c1ab13db1461041857610173565b806379ee1bdf1461031c5780638da5cb5b1461034c5780638fa74a0e1461036a5780639c05fc6014610388578063a3457466146103a4578063a4c0ed36146103c257610173565b8063463013a211610130578063463013a214610270578063586a53531461028c5780635975e00c146102aa57806368d30c2e146102c65780636e03b8dc146102e2578063715018a61461031257610173565b806303990a6c14610178578063045b7fe2146101945780630602ba2b146101c45780630cd6178f146101f45780632e1a7d4d1461022457806343fb93d914610240575b600080fd5b610192600480360381019061018d9190612f13565b6104ba565b005b6101ae60048036038101906101a99190612ca2565b610662565b6040516101bb91906139bc565b60405180910390f35b6101de60048036038101906101d99190612eea565b610695565b6040516101eb9190613bba565b60405180910390f35b61020e60048036038101906102099190612ca2565b6106d6565b60405161021b91906139bc565b60405180910390f35b61023e60048036038101906102399190612fd9565b610709565b005b61025a60048036038101906102559190612e9b565b610866565b60405161026791906139bc565b60405180910390f35b61028a60048036038101906102859190612f58565b61088b565b005b610294610917565b6040516102a191906139bc565b60405180910390f35b6102c460048036038101906102bf9190612ca2565b61093b565b005b6102e060048036038101906102db9190612ccb565b610acc565b005b6102fc60048036038101906102f79190612eea565b610e14565b60405161030991906139bc565b60405180910390f35b61031a610e47565b005b61033660048036038101906103319190612ca2565b610f81565b6040516103439190613bba565b60405180910390f35b610354610f9e565b60405161036191906139bc565b60405180910390f35b610372610fc7565b60405161037f91906139bc565b60405180910390f35b6103a2600480360381019061039d9190612dfd565b610feb565b005b6103ac611118565b6040516103b99190613b98565b60405180910390f35b6103dc60048036038101906103d79190612d91565b6111f0565b005b6103e6611756565b6040516103f391906139bc565b60405180910390f35b61041660048036038101906104119190612fd9565b61177c565b005b610432600480360381019061042d9190612ca2565b61185f565b005b61044e60048036038101906104499190612ca2565b611980565b005b61046a60048036038101906104659190612eea565b611af3565b60405161047791906139bc565b60405180910390f35b61049a60048036038101906104959190612ca2565b611b6e565b005b6104a4611d17565b6040516104b19190613c1a565b60405180910390f35b6104c2611d41565b73ffffffffffffffffffffffffffffffffffffffff166104e0610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052d90613e3b565b60405180910390fd5b60006105428383611d49565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98686604051610655929190613c35565b60405180910390a4505050565b60076020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff166106b783611af3565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b60066020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610711611d41565b73ffffffffffffffffffffffffffffffffffffffff1661072f610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610785576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077c90613e3b565b60405180910390fd5b600081116107c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107bf90613e1b565b60405180910390fd5b6108153382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b8260405161085b9190613f1b565b60405180910390a250565b60006108828461087585611e5d565b8051906020012084611ed3565b90509392505050565b610893611d41565b73ffffffffffffffffffffffffffffffffffffffff166108b1610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610907576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108fe90613e3b565b60405180910390fd5b610912838383611f17565b505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b610943611d41565b73ffffffffffffffffffffffffffffffffffffffff16610961610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146109b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ae90613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1e90613cfb565b60405180910390fd5b610a3b8160026120f990919063ffffffff16565b610a7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7190613e7b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610ac19190613bba565b60405180910390a250565b610ad4611d41565b73ffffffffffffffffffffffffffffffffffffffff16610af2610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610b48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3f90613e3b565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610ba491906139bc565b60206040518083038186803b158015610bbc57600080fd5b505afa158015610bd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf49190613002565b1015610c35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2c90613d3b565b60405180910390fd5b606063bd896dcb60e01b308b8b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168c8c8c8c8c8c8c604051602401610c869b9a999897969594939291906139d7565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610d1b8280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612129565b9050610d6a818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610dff989796959493929190613b1a565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e4f611d41565b73ffffffffffffffffffffffffffffffffffffffff16610e6d610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610ec3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eba90613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610f978260026121a590919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b610ff3611d41565b73ffffffffffffffffffffffffffffffffffffffff16611011610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105e90613e3b565b60405180910390fd5b8181905084849050146110af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a690613cbb565b60405180910390fd5b60005b84849050811015611111576111048585838181106110cc57fe5b90506020028101906110de9190613f36565b8585858181106110ea57fe5b90506020020160208101906110ff9190612ca2565b611f17565b80806001019150506110b2565b5050505050565b60608061112560026121d5565b67ffffffffffffffff8111801561113b57600080fd5b5060405190808252806020026020018201604052801561116a5781602001602082028036833780820191505090505b50905060005b61117a60026121d5565b8110156111e8576111958160026121ea90919063ffffffff16565b8282815181106111a157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611170565b508091505090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461127e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127590613cdb565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161461130c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130390613d7b565b60405180910390fd5b6113146129d3565b82828101906113239190612fb0565b9050600073ffffffffffffffffffffffffffffffffffffffff1660066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114715761146c60066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b611683565b6000806114958585604051611487929190613973565b604051809103902084612204565b915091508060066000856000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260000151600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506115ea8187600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b826000015173ffffffffffffffffffffffffffffffffffffffff16836040015173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fd74fe60cbf1e5bf07ef3fad0e00c45f66345c5226474786d8dc086527dc8414785876060015188608001518960a001516040516116789493929190613bd5565b60405180910390a450505b60066000826000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff167fe34903cfa4ad8362651171309d05bcbc2fc581a5ec83ca7b0c8d10743de766e2866040516117479190613f1b565b60405180910390a35050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081116117bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117b690613e1b565b60405180910390fd5b61180e333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661225b909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516118549190613f1b565b60405180910390a250565b611867611d41565b73ffffffffffffffffffffffffffffffffffffffff16611885610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146118db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d290613e3b565b60405180910390fd5b6118ef8160026122e490919063ffffffff16565b61192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192590613d9b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960006040516119759190613bba565b60405180910390a250565b611988611d41565b73ffffffffffffffffffffffffffffffffffffffff166119a6610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146119fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f390613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611a6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6390613dbb565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b611b76611d41565b73ffffffffffffffffffffffffffffffffffffffff16611b94610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614611bea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be190613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5190613d1b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b6000611dcf83836040516024016040516020818303038152906040529190604051611d759291906139a3565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612314565b905092915050565b611e588363a9059cbb60e01b8484604051602401611df6929190613af1565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061236c565b505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611eb994939291906138d7565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611ef19493929190613925565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611f86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f7d90613ddb565b60405180910390fd5b611f8f81612433565b611fce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc590613efb565b60405180910390fd5b6000611fda8484611d49565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c987876040516120eb929190613c35565b60405180910390a450505050565b6000612121836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612446565b905092915050565b60008061214060008661213b87611e5d565b6124b6565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a260008351111561219a5761219881846125c7565b505b809150509392505050565b60006121cd836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612611565b905092915050565b60006121e382600001612634565b9050919050565b60006121f98360000183612645565b60001c905092915050565b6000806060612212846126b2565b9050600061224386600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612129565b90508180519060200120819350935050509250929050565b6122de846323b872dd60e01b85858560405160240161227c93929190613aba565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061236c565b50505050565b600061230c836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612757565b905092915050565b6000600482511461235a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235190613e5b565b60405180910390fd5b60006020830151905080915050919050565b60606123ce826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661283f9092919063ffffffff16565b905060008151111561242e57808060200190518101906123ee9190612e72565b61242d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161242490613ebb565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b60006124528383612611565b6124ab5782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506124b0565b600090505b92915050565b600080844710156124fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f390613edb565b60405180910390fd5b600083511415612541576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161253890613c9b565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156125bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125b390613dfb565b60405180910390fd5b809150509392505050565b606061260983836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061283f565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011612690576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161268790613c7b565b60405180910390fd5b82600001828154811061269f57fe5b9060005260206000200154905092915050565b60606320dc203d60e01b30600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040516024016126f393929190613a82565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050509050919050565b6000808360010160008481526020019081526020016000205490506000811461283357600060018203905060006001866000018054905003905060008660000182815481106127a257fe5b90600052602060002001549050808760000184815481106127bf57fe5b90600052602060002001819055506001830187600101600083815260200190815260200160002081905550866000018054806127f757fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612839565b60009150505b92915050565b606061284e8484600085612857565b90509392505050565b60608247101561289c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161289390613d5b565b60405180910390fd5b6128a585612433565b6128e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128db90613e9b565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff16858760405161290e919061398c565b60006040518083038185875af1925050503d806000811461294b576040519150601f19603f3d011682016040523d82523d6000602084013e612950565b606091505b509150915061296082828661296c565b92505050949350505050565b6060831561297c578290506129cc565b60008351111561298f5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129c39190613c59565b60405180910390fd5b9392505050565b6040518060c00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081525090565b600081359050612a5a81614277565b92915050565b60008083601f840112612a7257600080fd5b8235905067ffffffffffffffff811115612a8b57600080fd5b602083019150836020820283011115612aa357600080fd5b9250929050565b60008083601f840112612abc57600080fd5b8235905067ffffffffffffffff811115612ad557600080fd5b602083019150836020820283011115612aed57600080fd5b9250929050565b600081519050612b038161428e565b92915050565b600081359050612b18816142a5565b92915050565b600081359050612b2d816142bc565b92915050565b60008083601f840112612b4557600080fd5b8235905067ffffffffffffffff811115612b5e57600080fd5b602083019150836001820283011115612b7657600080fd5b9250929050565b600081359050612b8c816142d3565b92915050565b60008083601f840112612ba457600080fd5b8235905067ffffffffffffffff811115612bbd57600080fd5b602083019150836001820283011115612bd557600080fd5b9250929050565b600060c08284031215612bee57600080fd5b612bf860c0613f8d565b90506000612c0884828501612a4b565b6000830152506020612c1c84828501612a4b565b6020830152506040612c3084828501612a4b565b6040830152506060612c4484828501612c78565b6060830152506080612c5884828501612c78565b60808301525060a0612c6c84828501612c78565b60a08301525092915050565b600081359050612c87816142e3565b92915050565b600081519050612c9c816142e3565b92915050565b600060208284031215612cb457600080fd5b6000612cc284828501612a4b565b91505092915050565b60008060008060008060008060006101208a8c031215612cea57600080fd5b6000612cf88c828d01612a4b565b9950506020612d098c828d01612a4b565b9850506040612d1a8c828d01612c78565b9750506060612d2b8c828d01612c78565b9650506080612d3c8c828d01612c78565b95505060a0612d4d8c828d01612c78565b94505060c0612d5e8c828d01612c78565b93505060e0612d6f8c828d01612c78565b925050610100612d818c828d01612b7d565b9150509295985092959850929598565b60008060008060608587031215612da757600080fd5b6000612db587828801612a4b565b9450506020612dc687828801612c78565b935050604085013567ffffffffffffffff811115612de357600080fd5b612def87828801612b33565b925092505092959194509250565b60008060008060408587031215612e1357600080fd5b600085013567ffffffffffffffff811115612e2d57600080fd5b612e3987828801612aaa565b9450945050602085013567ffffffffffffffff811115612e5857600080fd5b612e6487828801612a60565b925092505092959194509250565b600060208284031215612e8457600080fd5b6000612e9284828501612af4565b91505092915050565b600080600060608486031215612eb057600080fd5b6000612ebe86828701612b09565b9350506020612ecf86828701612a4b565b9250506040612ee086828701612a4b565b9150509250925092565b600060208284031215612efc57600080fd5b6000612f0a84828501612b1e565b91505092915050565b60008060208385031215612f2657600080fd5b600083013567ffffffffffffffff811115612f4057600080fd5b612f4c85828601612b92565b92509250509250929050565b600080600060408486031215612f6d57600080fd5b600084013567ffffffffffffffff811115612f8757600080fd5b612f9386828701612b92565b93509350506020612fa686828701612a4b565b9150509250925092565b600060c08284031215612fc257600080fd5b6000612fd084828501612bdc565b91505092915050565b600060208284031215612feb57600080fd5b6000612ff984828501612c78565b91505092915050565b60006020828403121561301457600080fd5b600061302284828501612c8d565b91505092915050565b60006130378383613043565b60208301905092915050565b61304c81614034565b82525050565b61305b81614034565b82525050565b61307261306d82614034565b6141ed565b82525050565b600061308382613fce565b61308d8185613ffc565b935061309883613fbe565b8060005b838110156130c95781516130b0888261302b565b97506130bb83613fef565b92505060018101905061309c565b5085935050505092915050565b6130df81614046565b82525050565b6130f66130f18261407e565b614209565b82525050565b61310d613108826140aa565b614213565b82525050565b61312461311f82614052565b6141ff565b82525050565b61313b613136826140d6565b61421d565b82525050565b61314a81614102565b82525050565b61316161315c82614102565b614227565b82525050565b6000613173838561400d565b93506131808385846141ab565b82840190509392505050565b600061319782613fd9565b6131a1818561400d565b93506131b18185602086016141ba565b80840191505092915050565b6131c681614175565b82525050565b6131d581614199565b82525050565b60006131e78385614018565b93506131f48385846141ab565b6131fd83614245565b840190509392505050565b60006132148385614029565b93506132218385846141ab565b82840190509392505050565b600061323882613fe4565b6132428185614018565b93506132528185602086016141ba565b61325b81614245565b840191505092915050565b6000613273602283614018565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006132d9602083614018565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b6000613319601583614018565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000613359600c83614018565b91507f4f4e4c595f4741544557415900000000000000000000000000000000000000006000830152602082019050919050565b6000613399601a83614018565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006133d9602683614018565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061343f602083614018565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b600061347f602683614018565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006134e5601283614018565b91507f4f4e4c595f5452414e534645525f544f4f4c00000000000000000000000000006000830152602082019050919050565b6000613525601b83614018565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000613565601983614018565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b60006135a5601d83614018565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b60006135e5601983614018565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000613625601583614018565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000613665602083614018565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006136a5601883614018565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b60006136e5601983614018565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000613725601d83614018565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613765602a83614018565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b60006137cb601d83614018565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b600061380b601983614018565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b60c0820160008201516138546000850182613043565b5060208201516138676020850182613043565b50604082015161387a6040850182613043565b50606082015161388d60608501826138b9565b5060808201516138a060808501826138b9565b5060a08201516138b360a08501826138b9565b50505050565b6138c28161416b565b82525050565b6138d18161416b565b82525050565b60006138e382876130e5565b600a820191506138f382866130e5565b600a82019150613903828561312a565b60148201915061391382846130fc565b600f8201915081905095945050505050565b60006139318287613113565b6001820191506139418286613061565b6014820191506139518285613150565b6020820191506139618284613150565b60208201915081905095945050505050565b6000613980828486613167565b91508190509392505050565b6000613998828461318c565b915081905092915050565b60006139b0828486613208565b91508190509392505050565b60006020820190506139d16000830184613052565b92915050565b6000610160820190506139ed600083018e613052565b6139fa602083018d613052565b613a07604083018c613052565b613a14606083018b613052565b613a21608083018a6138c8565b613a2e60a08301896138c8565b613a3b60c08301886138c8565b613a4860e08301876138c8565b613a566101008301866138c8565b613a646101208301856138c8565b613a726101408301846131cc565b9c9b505050505050505050505050565b600061010082019050613a986000830186613052565b613aa56020830185613052565b613ab2604083018461383e565b949350505050565b6000606082019050613acf6000830186613052565b613adc6020830185613052565b613ae960408301846138c8565b949350505050565b6000604082019050613b066000830185613052565b613b1360208301846138c8565b9392505050565b600061010082019050613b30600083018b613052565b613b3d602083018a6138c8565b613b4a60408301896138c8565b613b5760608301886138c8565b613b6460808301876138c8565b613b7160a08301866138c8565b613b7e60c08301856138c8565b613b8b60e08301846131cc565b9998505050505050505050565b60006020820190508181036000830152613bb28184613078565b905092915050565b6000602082019050613bcf60008301846130d6565b92915050565b6000608082019050613bea6000830187613141565b613bf760208301866138c8565b613c0460408301856138c8565b613c1160608301846138c8565b95945050505050565b6000602082019050613c2f60008301846131bd565b92915050565b60006020820190508181036000830152613c508184866131db565b90509392505050565b60006020820190508181036000830152613c73818461322d565b905092915050565b60006020820190508181036000830152613c9481613266565b9050919050565b60006020820190508181036000830152613cb4816132cc565b9050919050565b60006020820190508181036000830152613cd48161330c565b9050919050565b60006020820190508181036000830152613cf48161334c565b9050919050565b60006020820190508181036000830152613d148161338c565b9050919050565b60006020820190508181036000830152613d34816133cc565b9050919050565b60006020820190508181036000830152613d5481613432565b9050919050565b60006020820190508181036000830152613d7481613472565b9050919050565b60006020820190508181036000830152613d94816134d8565b9050919050565b60006020820190508181036000830152613db481613518565b9050919050565b60006020820190508181036000830152613dd481613558565b9050919050565b60006020820190508181036000830152613df481613598565b9050919050565b60006020820190508181036000830152613e14816135d8565b9050919050565b60006020820190508181036000830152613e3481613618565b9050919050565b60006020820190508181036000830152613e5481613658565b9050919050565b60006020820190508181036000830152613e7481613698565b9050919050565b60006020820190508181036000830152613e94816136d8565b9050919050565b60006020820190508181036000830152613eb481613718565b9050919050565b60006020820190508181036000830152613ed481613758565b9050919050565b60006020820190508181036000830152613ef4816137be565b9050919050565b60006020820190508181036000830152613f14816137fe565b9050919050565b6000602082019050613f3060008301846138c8565b92915050565b60008083356001602003843603038112613f4f57600080fd5b80840192508235915067ffffffffffffffff821115613f6d57600080fd5b602083019250600182023603831315613f8557600080fd5b509250929050565b6000604051905081810181811067ffffffffffffffff82111715613fb457613fb3614243565b5b8060405250919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061403f8261414b565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061414682614263565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061418082614187565b9050919050565b60006141928261414b565b9050919050565b60006141a482614138565b9050919050565b82818337600083830152505050565b60005b838110156141d85780820151818401526020810190506141bd565b838111156141e7576000848401525b50505050565b60006141f882614231565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b600061423c82614256565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061427457614273614243565b5b50565b61428081614034565b811461428b57600080fd5b50565b61429781614046565b81146142a257600080fd5b50565b6142ae81614102565b81146142b957600080fd5b50565b6142c58161410c565b81146142d057600080fd5b50565b600381106142e057600080fd5b50565b6142ec8161416b565b81146142f757600080fd5b5056fea264697066735822122010f167ec85dbd4b07aedb6960f9f6ac5ae1b0f5473409617dcd319393591837164736f6c63430007030033", + "devdoc": { + "events": { + "LockedTokensReceivedFromL1(address,address,uint256)": { + "details": "Emitted when locked tokens are received from L1 (whether the wallet had already been received or not)" + }, + "TokenLockCreatedFromL1(address,bytes32,address,uint256,uint256,uint256,address)": { + "details": "Event emitted when a wallet is received and created from L1" + } + }, + "kind": "dev", + "methods": { + "addTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "constructor": { + "params": { + "_graphToken": "Address of the L2 GRT token contract", + "_l1TransferTool": "Address of the L1 transfer tool contract (in L1, without aliasing)", + "_l2Gateway": "Address of the L2GraphTokenGateway contract", + "_masterCopy": "Address of the master copy of the L2GraphTokenLockWallet implementation" + } + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "params": { + "_beneficiary": "Address of the beneficiary of locked tokens", + "_endTime": "End time of the release schedule", + "_managedAmount": "Amount of tokens to be managed by the lock contract", + "_owner": "Address of the contract owner", + "_periods": "Number of periods between start time and end time", + "_releaseStartTime": "Override time for when the releases start", + "_revocable": "Whether the contract is revocable", + "_startTime": "Start time of the release schedule" + } + }, + "deposit(uint256)": { + "details": "Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes", + "params": { + "_amount": "Amount to deposit" + } + }, + "getAuthFunctionCallTarget(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "Address of the target contract where to send the call" + } + }, + "getDeploymentAddress(bytes32,address,address)": { + "params": { + "_deployer": "Address of the deployer that creates the contract", + "_implementation": "Address of the proxy target implementation", + "_salt": "Bytes32 salt to use for CREATE2" + }, + "returns": { + "_0": "Address of the counterfactual MinimalProxy" + } + }, + "getTokenDestinations()": { + "returns": { + "_0": "Array of addresses authorized to pull funds from a token lock" + } + }, + "isAuthFunctionCall(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "True if authorized" + } + }, + "isTokenDestination(address)": { + "params": { + "_dst": "Destination address" + }, + "returns": { + "_0": "True if authorized" + } + }, + "onTokenTransfer(address,uint256,bytes)": { + "details": "This function will create a new wallet if it doesn't exist yet, or send the tokens to the existing wallet if it does.", + "params": { + "_amount": "Amount of tokens received", + "_data": "Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct", + "_from": "Address of the sender in L1, which must be the L1GraphTokenLockTransferTool" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "removeTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "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." + }, + "setAuthFunctionCall(string,address)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature", + "_target": "Address of the destination contract to call" + } + }, + "setAuthFunctionCallMany(string[],address[])": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signatures": "Function signatures", + "_targets": "Address of the destination contract to call" + } + }, + "setMasterCopy(address)": { + "params": { + "_masterCopy": "Address of contract bytecode to factory clone" + } + }, + "token()": { + "returns": { + "_0": "Token used for transfers and approvals" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "unsetAuthFunctionCall(string)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature" + } + }, + "withdraw(uint256)": { + "details": "Escape hatch in case of mistakes or to recover remaining funds", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "L2GraphTokenLockManager", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "addTokenDestination(address)": { + "notice": "Adds an address that can be allowed by a token lock to pull funds" + }, + "constructor": { + "notice": "Constructor for the L2GraphTokenLockManager contract." + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "notice": "Creates and fund a new token lock wallet using a minimum proxy" + }, + "deposit(uint256)": { + "notice": "Deposits tokens into the contract" + }, + "getAuthFunctionCallTarget(bytes4)": { + "notice": "Gets the target contract to call for a particular function signature" + }, + "getDeploymentAddress(bytes32,address,address)": { + "notice": "Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation" + }, + "getTokenDestinations()": { + "notice": "Returns an array of authorized destination addresses" + }, + "isAuthFunctionCall(bytes4)": { + "notice": "Returns true if the function call is authorized" + }, + "isTokenDestination(address)": { + "notice": "Returns True if the address is authorized to be a destination of tokens" + }, + "l1TransferTool()": { + "notice": "Address of the L1 transfer tool contract (in L1, no aliasing)" + }, + "l1WalletToL2Wallet(address)": { + "notice": "Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received) L1 address => L2 address" + }, + "l2Gateway()": { + "notice": "Address of the L2GraphTokenGateway" + }, + "l2WalletToL1Wallet(address)": { + "notice": "Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received) L2 address => L1 address" + }, + "onTokenTransfer(address,uint256,bytes)": { + "notice": "This function is called by the L2GraphTokenGateway when tokens are sent from L1." + }, + "removeTokenDestination(address)": { + "notice": "Removes an address that can be allowed by a token lock to pull funds" + }, + "setAuthFunctionCall(string,address)": { + "notice": "Sets an authorized function call to target" + }, + "setAuthFunctionCallMany(string[],address[])": { + "notice": "Sets an authorized function call to target in bulk" + }, + "setMasterCopy(address)": { + "notice": "Sets the masterCopy bytecode to use to create clones of TokenLock contracts" + }, + "token()": { + "notice": "Gets the GRT token address" + }, + "unsetAuthFunctionCall(string)": { + "notice": "Unsets an authorized function call to target" + }, + "withdraw(uint256)": { + "notice": "Withdraws tokens from the contract" + } + }, + "notice": "This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. In particular, this L2 variant is designed to receive token lock wallets from L1, through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until the end of the vesting timeline, but they can allow withdrawing funds back to L1 using the L2GraphTokenLockTransferTool contract. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 672, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 3988, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "authFnCalls", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes4,t_address)" + }, + { + "astId": 3990, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_tokenDestinations", + "offset": 0, + "slot": "2", + "type": "t_struct(AddressSet)2629_storage" + }, + { + "astId": 3992, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "masterCopy", + "offset": 0, + "slot": "4", + "type": "t_address" + }, + { + "astId": 3994, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_token", + "offset": 0, + "slot": "5", + "type": "t_contract(IERC20)1710" + }, + { + "astId": 6135, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "l1WalletToL2Wallet", + "offset": 0, + "slot": "6", + "type": "t_mapping(t_address,t_address)" + }, + { + "astId": 6140, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "l2WalletToL1Wallet", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_address,t_address)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "base": "t_bytes32", + "encoding": "dynamic_array", + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes4": { + "encoding": "inplace", + "label": "bytes4", + "numberOfBytes": "4" + }, + "t_contract(IERC20)1710": { + "encoding": "inplace", + "label": "contract IERC20", + "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_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes4,t_address)": { + "encoding": "mapping", + "key": "t_bytes4", + "label": "mapping(bytes4 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_struct(AddressSet)2629_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.AddressSet", + "members": [ + { + "astId": 2628, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_inner", + "offset": 0, + "slot": "0", + "type": "t_struct(Set)2364_storage" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)2364_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.Set", + "members": [ + { + "astId": 2359, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_values", + "offset": 0, + "slot": "0", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "astId": 2363, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_indexes", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/deployments/arbitrum-goerli/Scratch-6-L2-Manager.json b/deployments/arbitrum-goerli/Scratch-6-L2-Manager.json new file mode 100644 index 0000000..bf736a0 --- /dev/null +++ b/deployments/arbitrum-goerli/Scratch-6-L2-Manager.json @@ -0,0 +1,1161 @@ +{ + "address": "0x6eB121A2eD40559f1f2b925C69dC98B8D129C532", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + }, + { + "internalType": "address", + "name": "_l2Gateway", + "type": "address" + }, + { + "internalType": "address", + "name": "_l1TransferTool", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes4", + "name": "sigHash", + "type": "bytes4" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "signature", + "type": "string" + } + ], + "name": "FunctionCallAuth", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Address", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Address", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "LockedTokensReceivedFromL1", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "masterCopy", + "type": "address" + } + ], + "name": "MasterCopyUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "TokenDestinationAllowed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "initHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "periods", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseStartTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "vestingCliffTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IGraphTokenLock.Revocability", + "name": "revocable", + "type": "uint8" + } + ], + "name": "TokenLockCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "initHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "managedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "l1Address", + "type": "address" + } + ], + "name": "TokenLockCreatedFromL1", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "addTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "name": "authFnCalls", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_managedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_periods", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_releaseStartTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_vestingCliffTime", + "type": "uint256" + }, + { + "internalType": "enum IGraphTokenLock.Revocability", + "name": "_revocable", + "type": "uint8" + } + ], + "name": "createTokenLockWallet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "getAuthFunctionCallTarget", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "address", + "name": "_deployer", + "type": "address" + } + ], + "name": "getDeploymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "getTokenDestinations", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_sigHash", + "type": "bytes4" + } + ], + "name": "isAuthFunctionCall", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "isTokenDestination", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l1TransferTool", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l1WalletToL2Wallet", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2Gateway", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2WalletToL1Wallet", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "masterCopy", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "onTokenTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dst", + "type": "address" + } + ], + "name": "removeTokenDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + }, + { + "internalType": "address", + "name": "_target", + "type": "address" + } + ], + "name": "setAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "_signatures", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "_targets", + "type": "address[]" + } + ], + "name": "setAuthFunctionCallMany", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_masterCopy", + "type": "address" + } + ], + "name": "setMasterCopy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_signature", + "type": "string" + } + ], + "name": "unsetAuthFunctionCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x675f9b0acaee5d03194d072708bcec87d769ca640c9f2a1005a58d1f2d1eee4b", + "receipt": { + "to": null, + "from": "0x48Ed1128A24fe9053E3F0C8358eC43D86A18c121", + "contractAddress": "0x6eB121A2eD40559f1f2b925C69dC98B8D129C532", + "transactionIndex": 2, + "gasUsed": "4073006", + "logsBloom": "0x00000000000000000000000000000000000004000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000400000000200000000020000000000000000000800000000000000001800000000000000400000000000000000000000000000000000004000000002000000000000000020000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000020000000000000800000000000000000000000000000000000000000000000000000", + "blockHash": "0xe3542f21b7a54ed820302d6d30f1277bc2e4e8b38742e2bbb2d7082ba5efb8e6", + "transactionHash": "0x675f9b0acaee5d03194d072708bcec87d769ca640c9f2a1005a58d1f2d1eee4b", + "logs": [ + { + "transactionIndex": 2, + "blockNumber": 26830264, + "transactionHash": "0x675f9b0acaee5d03194d072708bcec87d769ca640c9f2a1005a58d1f2d1eee4b", + "address": "0x6eB121A2eD40559f1f2b925C69dC98B8D129C532", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000048ed1128a24fe9053e3f0c8358ec43d86a18c121" + ], + "data": "0x", + "logIndex": 3, + "blockHash": "0xe3542f21b7a54ed820302d6d30f1277bc2e4e8b38742e2bbb2d7082ba5efb8e6" + }, + { + "transactionIndex": 2, + "blockNumber": 26830264, + "transactionHash": "0x675f9b0acaee5d03194d072708bcec87d769ca640c9f2a1005a58d1f2d1eee4b", + "address": "0x6eB121A2eD40559f1f2b925C69dC98B8D129C532", + "topics": [ + "0x30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de", + "0x000000000000000000000000d56945477322829abd094a5343486bf75135db73" + ], + "data": "0x", + "logIndex": 4, + "blockHash": "0xe3542f21b7a54ed820302d6d30f1277bc2e4e8b38742e2bbb2d7082ba5efb8e6" + } + ], + "blockNumber": 26830264, + "cumulativeGasUsed": "4217292", + "status": 1, + "byzantium": true + }, + "args": [ + "0xE65eCAf166336Bd7aeAeb868B34E4e46b3AB62d4", + "0xd56945477322829aBD094A5343486bF75135DB73", + "0x3B912f084ACae83e0b749073377616b441F22Cf1", + "0x739a6BC599347adA0Cec67520559F46eA8B9155E" + ], + "solcInputHash": "b33621afedc711c06b58b28e08a7cfc9", + "metadata": "{\"compiler\":{\"version\":\"0.7.3+commit.9bfce1f6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_graphToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l2Gateway\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_l1TransferTool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes4\",\"name\":\"sigHash\",\"type\":\"bytes4\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"signature\",\"type\":\"string\"}],\"name\":\"FunctionCallAuth\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"l1Address\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"l2Address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"LockedTokensReceivedFromL1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"masterCopy\",\"type\":\"address\"}],\"name\":\"MasterCopyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"}],\"name\":\"ProxyCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"allowed\",\"type\":\"bool\"}],\"name\":\"TokenDestinationAllowed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"initHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"periods\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releaseStartTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"vestingCliffTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"revocable\",\"type\":\"uint8\"}],\"name\":\"TokenLockCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"initHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"managedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"l1Address\",\"type\":\"address\"}],\"name\":\"TokenLockCreatedFromL1\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"addTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"name\":\"authFnCalls\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_managedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_periods\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseStartTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_vestingCliffTime\",\"type\":\"uint256\"},{\"internalType\":\"enum IGraphTokenLock.Revocability\",\"name\":\"_revocable\",\"type\":\"uint8\"}],\"name\":\"createTokenLockWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"getAuthFunctionCallTarget\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_salt\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_deployer\",\"type\":\"address\"}],\"name\":\"getDeploymentAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTokenDestinations\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_sigHash\",\"type\":\"bytes4\"}],\"name\":\"isAuthFunctionCall\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"isTokenDestination\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1TransferTool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"l1WalletToL2Wallet\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l2Gateway\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"l2WalletToL1Wallet\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"masterCopy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onTokenTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dst\",\"type\":\"address\"}],\"name\":\"removeTokenDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"}],\"name\":\"setAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"_signatures\",\"type\":\"string[]\"},{\"internalType\":\"address[]\",\"name\":\"_targets\",\"type\":\"address[]\"}],\"name\":\"setAuthFunctionCallMany\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_masterCopy\",\"type\":\"address\"}],\"name\":\"setMasterCopy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_signature\",\"type\":\"string\"}],\"name\":\"unsetAuthFunctionCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"LockedTokensReceivedFromL1(address,address,uint256)\":{\"details\":\"Emitted when locked tokens are received from L1 (whether the wallet had already been received or not)\"},\"TokenLockCreatedFromL1(address,bytes32,address,uint256,uint256,uint256,address)\":{\"details\":\"Event emitted when a wallet is received and created from L1\"}},\"kind\":\"dev\",\"methods\":{\"addTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"constructor\":{\"params\":{\"_graphToken\":\"Address of the L2 GRT token contract\",\"_l1TransferTool\":\"Address of the L1 transfer tool contract (in L1, without aliasing)\",\"_l2Gateway\":\"Address of the L2GraphTokenGateway contract\",\"_masterCopy\":\"Address of the master copy of the L2GraphTokenLockWallet implementation\"}},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"params\":{\"_beneficiary\":\"Address of the beneficiary of locked tokens\",\"_endTime\":\"End time of the release schedule\",\"_managedAmount\":\"Amount of tokens to be managed by the lock contract\",\"_owner\":\"Address of the contract owner\",\"_periods\":\"Number of periods between start time and end time\",\"_releaseStartTime\":\"Override time for when the releases start\",\"_revocable\":\"Whether the contract is revocable\",\"_startTime\":\"Start time of the release schedule\"}},\"deposit(uint256)\":{\"details\":\"Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes\",\"params\":{\"_amount\":\"Amount to deposit\"}},\"getAuthFunctionCallTarget(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"Address of the target contract where to send the call\"}},\"getDeploymentAddress(bytes32,address,address)\":{\"params\":{\"_deployer\":\"Address of the deployer that creates the contract\",\"_implementation\":\"Address of the proxy target implementation\",\"_salt\":\"Bytes32 salt to use for CREATE2\"},\"returns\":{\"_0\":\"Address of the counterfactual MinimalProxy\"}},\"getTokenDestinations()\":{\"returns\":{\"_0\":\"Array of addresses authorized to pull funds from a token lock\"}},\"isAuthFunctionCall(bytes4)\":{\"params\":{\"_sigHash\":\"Function signature hash\"},\"returns\":{\"_0\":\"True if authorized\"}},\"isTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"},\"returns\":{\"_0\":\"True if authorized\"}},\"onTokenTransfer(address,uint256,bytes)\":{\"details\":\"This function will create a new wallet if it doesn't exist yet, or send the tokens to the existing wallet if it does.\",\"params\":{\"_amount\":\"Amount of tokens received\",\"_data\":\"Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\",\"_from\":\"Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"removeTokenDestination(address)\":{\"params\":{\"_dst\":\"Destination address\"}},\"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.\"},\"setAuthFunctionCall(string,address)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\",\"_target\":\"Address of the destination contract to call\"}},\"setAuthFunctionCallMany(string[],address[])\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signatures\":\"Function signatures\",\"_targets\":\"Address of the destination contract to call\"}},\"setMasterCopy(address)\":{\"params\":{\"_masterCopy\":\"Address of contract bytecode to factory clone\"}},\"token()\":{\"returns\":{\"_0\":\"Token used for transfers and approvals\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unsetAuthFunctionCall(string)\":{\"details\":\"Input expected is the function signature as 'transfer(address,uint256)'\",\"params\":{\"_signature\":\"Function signature\"}},\"withdraw(uint256)\":{\"details\":\"Escape hatch in case of mistakes or to recover remaining funds\",\"params\":{\"_amount\":\"Amount of tokens to withdraw\"}}},\"title\":\"L2GraphTokenLockManager\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"addTokenDestination(address)\":{\"notice\":\"Adds an address that can be allowed by a token lock to pull funds\"},\"constructor\":{\"notice\":\"Constructor for the L2GraphTokenLockManager contract.\"},\"createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)\":{\"notice\":\"Creates and fund a new token lock wallet using a minimum proxy\"},\"deposit(uint256)\":{\"notice\":\"Deposits tokens into the contract\"},\"getAuthFunctionCallTarget(bytes4)\":{\"notice\":\"Gets the target contract to call for a particular function signature\"},\"getDeploymentAddress(bytes32,address,address)\":{\"notice\":\"Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\"},\"getTokenDestinations()\":{\"notice\":\"Returns an array of authorized destination addresses\"},\"isAuthFunctionCall(bytes4)\":{\"notice\":\"Returns true if the function call is authorized\"},\"isTokenDestination(address)\":{\"notice\":\"Returns True if the address is authorized to be a destination of tokens\"},\"l1TransferTool()\":{\"notice\":\"Address of the L1 transfer tool contract (in L1, no aliasing)\"},\"l1WalletToL2Wallet(address)\":{\"notice\":\"Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received) L1 address => L2 address\"},\"l2Gateway()\":{\"notice\":\"Address of the L2GraphTokenGateway\"},\"l2WalletToL1Wallet(address)\":{\"notice\":\"Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received) L2 address => L1 address\"},\"onTokenTransfer(address,uint256,bytes)\":{\"notice\":\"This function is called by the L2GraphTokenGateway when tokens are sent from L1.\"},\"removeTokenDestination(address)\":{\"notice\":\"Removes an address that can be allowed by a token lock to pull funds\"},\"setAuthFunctionCall(string,address)\":{\"notice\":\"Sets an authorized function call to target\"},\"setAuthFunctionCallMany(string[],address[])\":{\"notice\":\"Sets an authorized function call to target in bulk\"},\"setMasterCopy(address)\":{\"notice\":\"Sets the masterCopy bytecode to use to create clones of TokenLock contracts\"},\"token()\":{\"notice\":\"Gets the GRT token address\"},\"unsetAuthFunctionCall(string)\":{\"notice\":\"Unsets an authorized function call to target\"},\"withdraw(uint256)\":{\"notice\":\"Withdraws tokens from the contract\"}},\"notice\":\"This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. In particular, this L2 variant is designed to receive token lock wallets from L1, through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until the end of the vesting timeline, but they can allow withdrawing funds back to L1 using the L2GraphTokenLockTransferTool contract. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/L2GraphTokenLockManager.sol\":\"L2GraphTokenLockManager\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../utils/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 * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor () internal {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\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 virtual 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 virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x15e2d5bd4c28a88548074c54d220e8086f638a71ed07e6b3ba5a70066fcf458d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\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, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, 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) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n\\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 *\\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 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 *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\n return a - b;\\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 *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0) return 0;\\n uint256 c = a * b;\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting 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 *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: division by zero\\\");\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting 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 *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b > 0, \\\"SafeMath: modulo by zero\\\");\\n return a % b;\\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 * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryDiv}.\\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 *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\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 *\\n * - The divisor cannot be zero.\\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\":\"0xcc78a17dd88fa5a2edc60c8489e2f405c0913b377216a5b26b35656b2d0dab52\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\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\":\"0x5f02220344881ce43204ae4a6281145a67bc52c2bb1290a791857df3d19d78f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\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 IERC20;` 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 /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\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 from 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. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\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\":\"0xf12dfbe97e6276980b83d2830bb0eb75e0cf4f3e626c2471137f82158ae6a0fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\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\":\"0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with 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 function _msgSender() internal view virtual returns (address payable) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual 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\":\"0x8d3cb350f04ff49cfb10aef08d87f19dcbaecc8027b0bed12f3275cd12f38cf0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\\n address addr;\\n require(address(this).balance >= amount, \\\"Create2: insufficient balance\\\");\\n require(bytecode.length != 0, \\\"Create2: bytecode length is zero\\\");\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n }\\n require(addr != address(0), \\\"Create2: Failed on deploy\\\");\\n return addr;\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\\n bytes32 _data = keccak256(\\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\\n );\\n return address(uint160(uint256(_data)));\\n }\\n}\\n\",\"keccak256\":\"0x0a0b021149946014fe1cd04af11e7a937a29986c47e8b1b718c2d50d729472db\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <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\",\"keccak256\":\"0x1562cd9922fbf739edfb979f506809e2743789cbde3177515542161c3d04b164\",\"license\":\"MIT\"},\"contracts/GraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport \\\"./MathUtils.sol\\\";\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\n/**\\n * @title GraphTokenLock\\n * @notice Contract that manages an unlocking schedule of tokens.\\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\\n * they can only be released under certain time conditions.\\n *\\n * This contract implements a release scheduled based on periods and tokens are released in steps\\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\\n * It also supports revocation to be used for vesting schedules.\\n *\\n * The contract supports receiving extra funds than the managed tokens ones that can be\\n * withdrawn by the beneficiary at any time.\\n *\\n * A releaseStartTime parameter is included to override the default release schedule and\\n * perform the first release on the configured time. After that it will continue with the\\n * default schedule.\\n */\\nabstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock {\\n using SafeMath for uint256;\\n using SafeERC20 for IERC20;\\n\\n uint256 private constant MIN_PERIOD = 1;\\n\\n // -- State --\\n\\n IERC20 public token;\\n address public beneficiary;\\n\\n // Configuration\\n\\n // Amount of tokens managed by the contract schedule\\n uint256 public managedAmount;\\n\\n uint256 public startTime; // Start datetime (in unixtimestamp)\\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\\n uint256 public periods; // Number of vesting/release periods\\n\\n // First release date for tokens (in unixtimestamp)\\n // If set, no tokens will be released before releaseStartTime ignoring\\n // the amount to release each period\\n uint256 public releaseStartTime;\\n // A cliff set a date to which a beneficiary needs to get to vest\\n // all preceding periods\\n uint256 public vestingCliffTime;\\n Revocability public revocable; // Whether to use vesting for locked funds\\n\\n // State\\n\\n bool public isRevoked;\\n bool public isInitialized;\\n bool public isAccepted;\\n uint256 public releasedAmount;\\n uint256 public revokedAmount;\\n\\n // -- Events --\\n\\n event TokensReleased(address indexed beneficiary, uint256 amount);\\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\\n event TokensRevoked(address indexed beneficiary, uint256 amount);\\n event BeneficiaryChanged(address newBeneficiary);\\n event LockAccepted();\\n event LockCanceled();\\n\\n /**\\n * @dev Only allow calls from the beneficiary of the contract\\n */\\n modifier onlyBeneficiary() {\\n require(msg.sender == beneficiary, \\\"!auth\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the contract\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _vestingCliffTime Override time for when the vesting start\\n * @param _revocable Whether the contract is revocable\\n */\\n function _initialize(\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) internal {\\n require(!isInitialized, \\\"Already initialized\\\");\\n require(_owner != address(0), \\\"Owner cannot be zero\\\");\\n require(_beneficiary != address(0), \\\"Beneficiary cannot be zero\\\");\\n require(_token != address(0), \\\"Token cannot be zero\\\");\\n require(_managedAmount > 0, \\\"Managed tokens cannot be zero\\\");\\n require(_startTime != 0, \\\"Start time must be set\\\");\\n require(_startTime < _endTime, \\\"Start time > end time\\\");\\n require(_periods >= MIN_PERIOD, \\\"Periods cannot be below minimum\\\");\\n require(_revocable != Revocability.NotSet, \\\"Must set a revocability option\\\");\\n require(_releaseStartTime < _endTime, \\\"Release start time must be before end time\\\");\\n require(_vestingCliffTime < _endTime, \\\"Cliff time must be before end time\\\");\\n\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_owner);\\n beneficiary = _beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _managedAmount;\\n\\n startTime = _startTime;\\n endTime = _endTime;\\n periods = _periods;\\n\\n // Optionals\\n releaseStartTime = _releaseStartTime;\\n vestingCliffTime = _vestingCliffTime;\\n revocable = _revocable;\\n }\\n\\n /**\\n * @notice Change the beneficiary of funds managed by the contract\\n * @dev Can only be called by the beneficiary\\n * @param _newBeneficiary Address of the new beneficiary address\\n */\\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\\n require(_newBeneficiary != address(0), \\\"Empty beneficiary\\\");\\n beneficiary = _newBeneficiary;\\n emit BeneficiaryChanged(_newBeneficiary);\\n }\\n\\n /**\\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\\n * @dev Can only be called by the beneficiary\\n */\\n function acceptLock() external onlyBeneficiary {\\n isAccepted = true;\\n emit LockAccepted();\\n }\\n\\n /**\\n * @notice Owner cancel the lock and return the balance in the contract\\n * @dev Can only be called by the owner\\n */\\n function cancelLock() external onlyOwner {\\n require(isAccepted == false, \\\"Cannot cancel accepted contract\\\");\\n\\n token.safeTransfer(owner(), currentBalance());\\n\\n emit LockCanceled();\\n }\\n\\n // -- Balances --\\n\\n /**\\n * @notice Returns the amount of tokens currently held by the contract\\n * @return Tokens held in the contract\\n */\\n function currentBalance() public view override returns (uint256) {\\n return token.balanceOf(address(this));\\n }\\n\\n // -- Time & Periods --\\n\\n /**\\n * @notice Returns the current block timestamp\\n * @return Current block timestamp\\n */\\n function currentTime() public view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @notice Gets duration of contract from start to end in seconds\\n * @return Amount of seconds from contract startTime to endTime\\n */\\n function duration() public view override returns (uint256) {\\n return endTime.sub(startTime);\\n }\\n\\n /**\\n * @notice Gets time elapsed since the start of the contract\\n * @dev Returns zero if called before conctract starTime\\n * @return Seconds elapsed from contract startTime\\n */\\n function sinceStartTime() public view override returns (uint256) {\\n uint256 current = currentTime();\\n if (current <= startTime) {\\n return 0;\\n }\\n return current.sub(startTime);\\n }\\n\\n /**\\n * @notice Returns amount available to be released after each period according to schedule\\n * @return Amount of tokens available after each period\\n */\\n function amountPerPeriod() public view override returns (uint256) {\\n return managedAmount.div(periods);\\n }\\n\\n /**\\n * @notice Returns the duration of each period in seconds\\n * @return Duration of each period in seconds\\n */\\n function periodDuration() public view override returns (uint256) {\\n return duration().div(periods);\\n }\\n\\n /**\\n * @notice Gets the current period based on the schedule\\n * @return A number that represents the current period\\n */\\n function currentPeriod() public view override returns (uint256) {\\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\\n }\\n\\n /**\\n * @notice Gets the number of periods that passed since the first period\\n * @return A number of periods that passed since the schedule started\\n */\\n function passedPeriods() public view override returns (uint256) {\\n return currentPeriod().sub(MIN_PERIOD);\\n }\\n\\n // -- Locking & Release Schedule --\\n\\n /**\\n * @notice Gets the currently available token according to the schedule\\n * @dev Implements the step-by-step schedule based on periods for available tokens\\n * @return Amount of tokens available according to the schedule\\n */\\n function availableAmount() public view override returns (uint256) {\\n uint256 current = currentTime();\\n\\n // Before contract start no funds are available\\n if (current < startTime) {\\n return 0;\\n }\\n\\n // After contract ended all funds are available\\n if (current > endTime) {\\n return managedAmount;\\n }\\n\\n // Get available amount based on period\\n return passedPeriods().mul(amountPerPeriod());\\n }\\n\\n /**\\n * @notice Gets the amount of currently vested tokens\\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\\n * @return Amount of tokens already vested\\n */\\n function vestedAmount() public view override returns (uint256) {\\n // If non-revocable it is fully vested\\n if (revocable == Revocability.Disabled) {\\n return managedAmount;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n return availableAmount();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule and takes into account already released tokens\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view virtual override returns (uint256) {\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n uint256 releasable = availableAmount().sub(releasedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\\n * @dev Does not consider schedule but just global amounts tracked\\n * @return Amount of outstanding tokens for the lifetime of the contract\\n */\\n function totalOutstandingAmount() public view override returns (uint256) {\\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\\n }\\n\\n /**\\n * @notice Gets surplus amount in the contract based on outstanding amount to release\\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary.\\n * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be\\n * skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\\n * @return Amount of tokens considered as surplus\\n */\\n function surplusAmount() public view override returns (uint256) {\\n uint256 balance = currentBalance();\\n uint256 outstandingAmount = totalOutstandingAmount();\\n if (balance > outstandingAmount) {\\n return balance.sub(outstandingAmount);\\n }\\n return 0;\\n }\\n\\n // -- Value Transfer --\\n\\n /**\\n * @notice Releases tokens based on the configured schedule\\n * @dev All available releasable tokens are transferred to beneficiary\\n */\\n function release() external override onlyBeneficiary {\\n uint256 amountToRelease = releasableAmount();\\n require(amountToRelease > 0, \\\"No available releasable amount\\\");\\n\\n releasedAmount = releasedAmount.add(amountToRelease);\\n\\n token.safeTransfer(beneficiary, amountToRelease);\\n\\n emit TokensReleased(beneficiary, amountToRelease);\\n }\\n\\n /**\\n * @notice Withdraws surplus, unmanaged tokens from the contract\\n * @dev Tokens in the contract over outstanding amount are considered as surplus\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n require(surplusAmount() >= _amount, \\\"Amount requested > surplus available\\\");\\n\\n token.safeTransfer(beneficiary, _amount);\\n\\n emit TokensWithdrawn(beneficiary, _amount);\\n }\\n\\n /**\\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\\n * @dev Vesting schedule is always calculated based on managed tokens\\n */\\n function revoke() external override onlyOwner {\\n require(revocable == Revocability.Enabled, \\\"Contract is non-revocable\\\");\\n require(isRevoked == false, \\\"Already revoked\\\");\\n\\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\\n require(unvestedAmount > 0, \\\"No available unvested amount\\\");\\n\\n revokedAmount = unvestedAmount;\\n isRevoked = true;\\n\\n token.safeTransfer(owner(), unvestedAmount);\\n\\n emit TokensRevoked(beneficiary, unvestedAmount);\\n }\\n}\\n\",\"keccak256\":\"0xd89470956a476c2fcf4a09625775573f95ba2c60a57fe866d90f65de1bcf5f2d\",\"license\":\"MIT\"},\"contracts/GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/EnumerableSet.sol\\\";\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport \\\"./MinimalProxyFactory.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract GraphTokenLockManager is Ownable, MinimalProxyFactory, IGraphTokenLockManager {\\n using SafeERC20 for IERC20;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n // -- State --\\n\\n mapping(bytes4 => address) public authFnCalls;\\n EnumerableSet.AddressSet private _tokenDestinations;\\n\\n address public masterCopy;\\n IERC20 internal _token;\\n\\n // -- Events --\\n\\n event MasterCopyUpdated(address indexed masterCopy);\\n event TokenLockCreated(\\n address indexed contractAddress,\\n bytes32 indexed initHash,\\n address indexed beneficiary,\\n address token,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n uint256 periods,\\n uint256 releaseStartTime,\\n uint256 vestingCliffTime,\\n IGraphTokenLock.Revocability revocable\\n );\\n\\n event TokensDeposited(address indexed sender, uint256 amount);\\n event TokensWithdrawn(address indexed sender, uint256 amount);\\n\\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\\n event TokenDestinationAllowed(address indexed dst, bool allowed);\\n\\n /**\\n * Constructor.\\n * @param _graphToken Token to use for deposits and withdrawals\\n * @param _masterCopy Address of the master copy to use to clone proxies\\n */\\n constructor(IERC20 _graphToken, address _masterCopy) {\\n require(address(_graphToken) != address(0), \\\"Token cannot be zero\\\");\\n _token = _graphToken;\\n setMasterCopy(_masterCopy);\\n }\\n\\n // -- Factory --\\n\\n /**\\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\\n * @param _masterCopy Address of contract bytecode to factory clone\\n */\\n function setMasterCopy(address _masterCopy) public override onlyOwner {\\n require(_masterCopy != address(0), \\\"MasterCopy cannot be zero\\\");\\n masterCopy = _masterCopy;\\n emit MasterCopyUpdated(_masterCopy);\\n }\\n\\n /**\\n * @notice Creates and fund a new token lock wallet using a minimum proxy\\n * @param _owner Address of the contract owner\\n * @param _beneficiary Address of the beneficiary of locked tokens\\n * @param _managedAmount Amount of tokens to be managed by the lock contract\\n * @param _startTime Start time of the release schedule\\n * @param _endTime End time of the release schedule\\n * @param _periods Number of periods between start time and end time\\n * @param _releaseStartTime Override time for when the releases start\\n * @param _revocable Whether the contract is revocable\\n */\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external override onlyOwner {\\n require(_token.balanceOf(address(this)) >= _managedAmount, \\\"Not enough tokens to create lock\\\");\\n\\n // Create contract using a minimal proxy and call initializer\\n bytes memory initializer = abi.encodeWithSelector(\\n GraphTokenLockWallet.initialize.selector,\\n address(this),\\n _owner,\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _managedAmount);\\n\\n emit TokenLockCreated(\\n contractAddress,\\n keccak256(initializer),\\n _beneficiary,\\n address(_token),\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n }\\n\\n // -- Funds Management --\\n\\n /**\\n * @notice Gets the GRT token address\\n * @return Token used for transfers and approvals\\n */\\n function token() external view override returns (IERC20) {\\n return _token;\\n }\\n\\n /**\\n * @notice Deposits tokens into the contract\\n * @dev Even if the ERC20 token can be transferred directly to the contract\\n * this function provide a safe interface to do the transfer and avoid mistakes\\n * @param _amount Amount to deposit\\n */\\n function deposit(uint256 _amount) external override {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransferFrom(msg.sender, address(this), _amount);\\n emit TokensDeposited(msg.sender, _amount);\\n }\\n\\n /**\\n * @notice Withdraws tokens from the contract\\n * @dev Escape hatch in case of mistakes or to recover remaining funds\\n * @param _amount Amount of tokens to withdraw\\n */\\n function withdraw(uint256 _amount) external override onlyOwner {\\n require(_amount > 0, \\\"Amount cannot be zero\\\");\\n _token.safeTransfer(msg.sender, _amount);\\n emit TokensWithdrawn(msg.sender, _amount);\\n }\\n\\n // -- Token Destinations --\\n\\n /**\\n * @notice Adds an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function addTokenDestination(address _dst) external override onlyOwner {\\n require(_dst != address(0), \\\"Destination cannot be zero\\\");\\n require(_tokenDestinations.add(_dst), \\\"Destination already added\\\");\\n emit TokenDestinationAllowed(_dst, true);\\n }\\n\\n /**\\n * @notice Removes an address that can be allowed by a token lock to pull funds\\n * @param _dst Destination address\\n */\\n function removeTokenDestination(address _dst) external override onlyOwner {\\n require(_tokenDestinations.remove(_dst), \\\"Destination already removed\\\");\\n emit TokenDestinationAllowed(_dst, false);\\n }\\n\\n /**\\n * @notice Returns True if the address is authorized to be a destination of tokens\\n * @param _dst Destination address\\n * @return True if authorized\\n */\\n function isTokenDestination(address _dst) external view override returns (bool) {\\n return _tokenDestinations.contains(_dst);\\n }\\n\\n /**\\n * @notice Returns an array of authorized destination addresses\\n * @return Array of addresses authorized to pull funds from a token lock\\n */\\n function getTokenDestinations() external view override returns (address[] memory) {\\n address[] memory dstList = new address[](_tokenDestinations.length());\\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\\n dstList[i] = _tokenDestinations.at(i);\\n }\\n return dstList;\\n }\\n\\n // -- Function Call Authorization --\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\\n _setAuthFunctionCall(_signature, _target);\\n }\\n\\n /**\\n * @notice Unsets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signature Function signature\\n */\\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = address(0);\\n\\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target in bulk\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @param _signatures Function signatures\\n * @param _targets Address of the destination contract to call\\n */\\n function setAuthFunctionCallMany(\\n string[] calldata _signatures,\\n address[] calldata _targets\\n ) external override onlyOwner {\\n require(_signatures.length == _targets.length, \\\"Array length mismatch\\\");\\n\\n for (uint256 i = 0; i < _signatures.length; i++) {\\n _setAuthFunctionCall(_signatures[i], _targets[i]);\\n }\\n }\\n\\n /**\\n * @notice Sets an authorized function call to target\\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\\n * @param _signature Function signature\\n * @param _target Address of the destination contract to call\\n */\\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\\n require(_target != address(this), \\\"Target must be other contract\\\");\\n require(Address.isContract(_target), \\\"Target must be a contract\\\");\\n\\n bytes4 sigHash = _toFunctionSigHash(_signature);\\n authFnCalls[sigHash] = _target;\\n\\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\\n }\\n\\n /**\\n * @notice Gets the target contract to call for a particular function signature\\n * @param _sigHash Function signature hash\\n * @return Address of the target contract where to send the call\\n */\\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\\n return authFnCalls[_sigHash];\\n }\\n\\n /**\\n * @notice Returns true if the function call is authorized\\n * @param _sigHash Function signature hash\\n * @return True if authorized\\n */\\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\\n return getAuthFunctionCallTarget(_sigHash) != address(0);\\n }\\n\\n /**\\n * @dev Converts a function signature string to 4-bytes hash\\n * @param _signature Function signature string\\n * @return Function signature hash\\n */\\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\\n return _convertToBytes4(abi.encodeWithSignature(_signature));\\n }\\n\\n /**\\n * @dev Converts function signature bytes to function signature hash (bytes4)\\n * @param _signature Function signature\\n * @return Function signature in bytes4\\n */\\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\\n require(_signature.length == 4, \\\"Invalid method signature\\\");\\n bytes4 sigHash;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sigHash := mload(add(_signature, 32))\\n }\\n return sigHash;\\n }\\n}\\n\",\"keccak256\":\"0x2bb51cc1a18bd88113fd6947067ad2fff33048c8904cb54adfda8e2ab86752f2\",\"license\":\"MIT\"},\"contracts/GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"@openzeppelin/contracts/math/SafeMath.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./GraphTokenLock.sol\\\";\\nimport \\\"./IGraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract GraphTokenLockWallet is GraphTokenLock {\\n using SafeMath for uint256;\\n\\n // -- State --\\n\\n IGraphTokenLockManager public manager;\\n uint256 public usedAmount;\\n\\n // -- Events --\\n\\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\\n event TokenDestinationsApproved();\\n event TokenDestinationsRevoked();\\n\\n // Initializer\\n function initialize(\\n address _manager,\\n address _owner,\\n address _beneficiary,\\n address _token,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n Revocability _revocable\\n ) external {\\n _initialize(\\n _owner,\\n _beneficiary,\\n _token,\\n _managedAmount,\\n _startTime,\\n _endTime,\\n _periods,\\n _releaseStartTime,\\n _vestingCliffTime,\\n _revocable\\n );\\n _setManager(_manager);\\n }\\n\\n // -- Admin --\\n\\n /**\\n * @notice Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function setManager(address _newManager) external onlyOwner {\\n _setManager(_newManager);\\n }\\n\\n /**\\n * @dev Sets a new manager for this contract\\n * @param _newManager Address of the new manager\\n */\\n function _setManager(address _newManager) internal {\\n require(_newManager != address(0), \\\"Manager cannot be empty\\\");\\n require(Address.isContract(_newManager), \\\"Manager must be a contract\\\");\\n\\n address oldManager = address(manager);\\n manager = IGraphTokenLockManager(_newManager);\\n\\n emit ManagerUpdated(oldManager, _newManager);\\n }\\n\\n // -- Beneficiary --\\n\\n /**\\n * @notice Approves protocol access of the tokens managed by this contract\\n * @dev Approves all token destinations registered in the manager to pull tokens\\n */\\n function approveProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe because we are using the max uint256 value\\n token.approve(dstList[i], type(uint256).max);\\n }\\n emit TokenDestinationsApproved();\\n }\\n\\n /**\\n * @notice Revokes protocol access of the tokens managed by this contract\\n * @dev Revokes approval to all token destinations in the manager to pull tokens\\n */\\n function revokeProtocol() external onlyBeneficiary {\\n address[] memory dstList = manager.getTokenDestinations();\\n for (uint256 i = 0; i < dstList.length; i++) {\\n // Note this is only safe cause we're using 0 as the amount\\n token.approve(dstList[i], 0);\\n }\\n emit TokenDestinationsRevoked();\\n }\\n\\n /**\\n * @notice Gets tokens currently available for release\\n * @dev Considers the schedule, takes into account already released tokens and used amount\\n * @return Amount of tokens ready to be released\\n */\\n function releasableAmount() public view override returns (uint256) {\\n if (revocable == Revocability.Disabled) {\\n return super.releasableAmount();\\n }\\n\\n // -- Revocability enabled logic\\n // This needs to deal with additional considerations for when tokens are used in the protocol\\n\\n // If a release start time is set no tokens are available for release before this date\\n // If not set it follows the default schedule and tokens are available on\\n // the first period passed\\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\\n return 0;\\n }\\n\\n // Vesting cliff is activated and it has not passed means nothing is vested yet\\n // so funds cannot be released\\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\\n return 0;\\n }\\n\\n // A beneficiary can never have more releasable tokens than the contract balance\\n // We consider the `usedAmount` in the protocol as part of the calculations\\n // the beneficiary should not release funds that are used.\\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\\n return MathUtils.min(currentBalance(), releasable);\\n }\\n\\n /**\\n * @notice Forward authorized contract calls to protocol contracts\\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\\n */\\n // solhint-disable-next-line no-complex-fallback\\n fallback() external payable {\\n // Only beneficiary can forward calls\\n require(msg.sender == beneficiary, \\\"Unauthorized caller\\\");\\n require(msg.value == 0, \\\"ETH transfers not supported\\\");\\n\\n // Function call validation\\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\\n require(_target != address(0), \\\"Unauthorized function\\\");\\n\\n uint256 oldBalance = currentBalance();\\n\\n // Call function with data\\n Address.functionCall(_target, msg.data);\\n\\n // Tracked used tokens in the protocol\\n // We do this check after balances were updated by the forwarded call\\n // Check is only enforced for revocable contracts to save some gas\\n if (revocable == Revocability.Enabled) {\\n // Track contract balance change\\n uint256 newBalance = currentBalance();\\n if (newBalance < oldBalance) {\\n // Outflow\\n uint256 diff = oldBalance.sub(newBalance);\\n usedAmount = usedAmount.add(diff);\\n } else {\\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\\n // underflow. We set it to zero in that case.\\n uint256 diff = newBalance.sub(oldBalance);\\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\\n }\\n require(usedAmount <= vestedAmount(), \\\"Cannot use more tokens than vested amount\\\");\\n }\\n }\\n\\n /**\\n * @notice Receive function that always reverts.\\n * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159\\n */\\n receive() external payable {\\n revert(\\\"Bad call\\\");\\n }\\n}\\n\",\"keccak256\":\"0x976c2ba4c1503a81ea02bd84539c516e99af611ff767968ee25456b50a6deb7b\",\"license\":\"MIT\"},\"contracts/ICallhookReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\n\\n// Copied from graphprotocol/contracts, changed solidity version to 0.7.3\\n\\n/**\\n * @title Interface for contracts that can receive callhooks through the Arbitrum GRT bridge\\n * @dev Any contract that can receive a callhook on L2, sent through the bridge from L1, must\\n * be allowlisted by the governor, but also implement this interface that contains\\n * the function that will actually be called by the L2GraphTokenGateway.\\n */\\npragma solidity ^0.7.3;\\n\\ninterface ICallhookReceiver {\\n /**\\n * @notice Receive tokens with a callhook from the bridge\\n * @param _from Token sender in L1\\n * @param _amount Amount of tokens that were transferred\\n * @param _data ABI-encoded callhook data\\n */\\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external;\\n}\\n\",\"keccak256\":\"0xb90eae14e8bac012a4b99fabe7a1110f70143eb78476ea0d6b52557ef979fa0e\",\"license\":\"GPL-2.0-or-later\"},\"contracts/IGraphTokenLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IGraphTokenLock {\\n enum Revocability {\\n NotSet,\\n Enabled,\\n Disabled\\n }\\n\\n // -- Balances --\\n\\n function currentBalance() external view returns (uint256);\\n\\n // -- Time & Periods --\\n\\n function currentTime() external view returns (uint256);\\n\\n function duration() external view returns (uint256);\\n\\n function sinceStartTime() external view returns (uint256);\\n\\n function amountPerPeriod() external view returns (uint256);\\n\\n function periodDuration() external view returns (uint256);\\n\\n function currentPeriod() external view returns (uint256);\\n\\n function passedPeriods() external view returns (uint256);\\n\\n // -- Locking & Release Schedule --\\n\\n function availableAmount() external view returns (uint256);\\n\\n function vestedAmount() external view returns (uint256);\\n\\n function releasableAmount() external view returns (uint256);\\n\\n function totalOutstandingAmount() external view returns (uint256);\\n\\n function surplusAmount() external view returns (uint256);\\n\\n // -- Value Transfer --\\n\\n function release() external;\\n\\n function withdrawSurplus(uint256 _amount) external;\\n\\n function revoke() external;\\n}\\n\",\"keccak256\":\"0xceb9d258276fe25ec858191e1deae5778f1b2f612a669fb7b37bab1a064756ab\",\"license\":\"MIT\"},\"contracts/IGraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IGraphTokenLock.sol\\\";\\n\\ninterface IGraphTokenLockManager {\\n // -- Factory --\\n\\n function setMasterCopy(address _masterCopy) external;\\n\\n function createTokenLockWallet(\\n address _owner,\\n address _beneficiary,\\n uint256 _managedAmount,\\n uint256 _startTime,\\n uint256 _endTime,\\n uint256 _periods,\\n uint256 _releaseStartTime,\\n uint256 _vestingCliffTime,\\n IGraphTokenLock.Revocability _revocable\\n ) external;\\n\\n // -- Funds Management --\\n\\n function token() external returns (IERC20);\\n\\n function deposit(uint256 _amount) external;\\n\\n function withdraw(uint256 _amount) external;\\n\\n // -- Allowed Funds Destinations --\\n\\n function addTokenDestination(address _dst) external;\\n\\n function removeTokenDestination(address _dst) external;\\n\\n function isTokenDestination(address _dst) external view returns (bool);\\n\\n function getTokenDestinations() external view returns (address[] memory);\\n\\n // -- Function Call Authorization --\\n\\n function setAuthFunctionCall(string calldata _signature, address _target) external;\\n\\n function unsetAuthFunctionCall(string calldata _signature) external;\\n\\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\\n\\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\\n\\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2d78d41909a6de5b316ac39b100ea087a8f317cf306379888a045523e15c4d9a\",\"license\":\"MIT\"},\"contracts/L2GraphTokenLockManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\\\";\\n\\nimport { ICallhookReceiver } from \\\"./ICallhookReceiver.sol\\\";\\nimport { GraphTokenLockManager } from \\\"./GraphTokenLockManager.sol\\\";\\nimport { L2GraphTokenLockWallet } from \\\"./L2GraphTokenLockWallet.sol\\\";\\n\\n/**\\n * @title L2GraphTokenLockManager\\n * @notice This contract manages a list of authorized function calls and targets that can be called\\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\\n *\\n * This contract receives funds to make the process of creating TokenLockWallet contracts\\n * easier by distributing them the initial tokens to be managed.\\n *\\n * In particular, this L2 variant is designed to receive token lock wallets from L1,\\n * through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until\\n * the end of the vesting timeline, but they can allow withdrawing funds back to L1 using\\n * the L2GraphTokenLockTransferTool contract.\\n *\\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\\n * will manipulate users funds.\\n */\\ncontract L2GraphTokenLockManager is GraphTokenLockManager, ICallhookReceiver {\\n using SafeERC20 for IERC20;\\n\\n /// @dev Struct to hold the data of a transferred wallet; this is\\n /// the data that must be encoded in L1 to send a wallet to L2.\\n struct TransferredWalletData {\\n address l1Address;\\n address owner;\\n address beneficiary;\\n uint256 managedAmount;\\n uint256 startTime;\\n uint256 endTime;\\n }\\n\\n /// Address of the L2GraphTokenGateway\\n address public immutable l2Gateway;\\n /// Address of the L1 transfer tool contract (in L1, no aliasing)\\n address public immutable l1TransferTool;\\n /// Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received)\\n /// L1 address => L2 address\\n mapping(address => address) public l1WalletToL2Wallet;\\n /// Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received)\\n /// L2 address => L1 address\\n mapping(address => address) public l2WalletToL1Wallet;\\n\\n /// @dev Event emitted when a wallet is received and created from L1\\n event TokenLockCreatedFromL1(\\n address indexed contractAddress,\\n bytes32 initHash,\\n address indexed beneficiary,\\n uint256 managedAmount,\\n uint256 startTime,\\n uint256 endTime,\\n address indexed l1Address\\n );\\n\\n /// @dev Emitted when locked tokens are received from L1 (whether the wallet\\n /// had already been received or not)\\n event LockedTokensReceivedFromL1(address indexed l1Address, address indexed l2Address, uint256 amount);\\n\\n /**\\n * @dev Checks that the sender is the L2GraphTokenGateway.\\n */\\n modifier onlyL2Gateway() {\\n require(msg.sender == l2Gateway, \\\"ONLY_GATEWAY\\\");\\n _;\\n }\\n\\n /**\\n * @notice Constructor for the L2GraphTokenLockManager contract.\\n * @param _graphToken Address of the L2 GRT token contract\\n * @param _masterCopy Address of the master copy of the L2GraphTokenLockWallet implementation\\n * @param _l2Gateway Address of the L2GraphTokenGateway contract\\n * @param _l1TransferTool Address of the L1 transfer tool contract (in L1, without aliasing)\\n */\\n constructor(\\n IERC20 _graphToken,\\n address _masterCopy,\\n address _l2Gateway,\\n address _l1TransferTool\\n ) GraphTokenLockManager(_graphToken, _masterCopy) {\\n l2Gateway = _l2Gateway;\\n l1TransferTool = _l1TransferTool;\\n }\\n\\n /**\\n * @notice This function is called by the L2GraphTokenGateway when tokens are sent from L1.\\n * @dev This function will create a new wallet if it doesn't exist yet, or send the tokens to\\n * the existing wallet if it does.\\n * @param _from Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\\n * @param _amount Amount of tokens received\\n * @param _data Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\\n */\\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external override onlyL2Gateway {\\n require(_from == l1TransferTool, \\\"ONLY_TRANSFER_TOOL\\\");\\n TransferredWalletData memory walletData = abi.decode(_data, (TransferredWalletData));\\n\\n if (l1WalletToL2Wallet[walletData.l1Address] != address(0)) {\\n // If the wallet was already received, just send the tokens to the L2 address\\n _token.safeTransfer(l1WalletToL2Wallet[walletData.l1Address], _amount);\\n } else {\\n // Create contract using a minimal proxy and call initializer\\n (bytes32 initHash, address contractAddress) = _deployFromL1(keccak256(_data), walletData);\\n l1WalletToL2Wallet[walletData.l1Address] = contractAddress;\\n l2WalletToL1Wallet[contractAddress] = walletData.l1Address;\\n\\n // Send managed amount to the created contract\\n _token.safeTransfer(contractAddress, _amount);\\n\\n emit TokenLockCreatedFromL1(\\n contractAddress,\\n initHash,\\n walletData.beneficiary,\\n walletData.managedAmount,\\n walletData.startTime,\\n walletData.endTime,\\n walletData.l1Address\\n );\\n }\\n emit LockedTokensReceivedFromL1(walletData.l1Address, l1WalletToL2Wallet[walletData.l1Address], _amount);\\n }\\n\\n /**\\n * @dev Deploy a token lock wallet with data received from L1\\n * @param _salt Salt for the CREATE2 call, which must be the hash of the wallet data\\n * @param _walletData Data of the wallet to be created\\n * @return Hash of the initialization calldata\\n * @return Address of the created contract\\n */\\n function _deployFromL1(bytes32 _salt, TransferredWalletData memory _walletData) internal returns (bytes32, address) {\\n bytes memory initializer = _encodeInitializer(_walletData);\\n address contractAddress = _deployProxy2(_salt, masterCopy, initializer);\\n return (keccak256(initializer), contractAddress);\\n }\\n\\n /**\\n * @dev Encode the initializer for the token lock wallet received from L1\\n * @param _walletData Data of the wallet to be created\\n * @return Encoded initializer calldata, including the function signature\\n */\\n function _encodeInitializer(TransferredWalletData memory _walletData) internal view returns (bytes memory) {\\n return\\n abi.encodeWithSelector(\\n L2GraphTokenLockWallet.initializeFromL1.selector,\\n address(this),\\n address(_token),\\n _walletData\\n );\\n }\\n}\\n\",\"keccak256\":\"0x34ca0ffc898ce3615a000d53a9c58708354b8cd8093b3c61decfe7388f0c16e0\",\"license\":\"MIT\"},\"contracts/L2GraphTokenLockWallet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\npragma experimental ABIEncoderV2;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport { GraphTokenLockWallet } from \\\"./GraphTokenLockWallet.sol\\\";\\nimport { Ownable as OwnableInitializable } from \\\"./Ownable.sol\\\";\\nimport { L2GraphTokenLockManager } from \\\"./L2GraphTokenLockManager.sol\\\";\\n\\n/**\\n * @title L2GraphTokenLockWallet\\n * @notice This contract is built on top of the base GraphTokenLock functionality.\\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\\n * on specific contracts.\\n *\\n * The idea is that supporters with locked tokens can participate in the protocol\\n * but disallow any release before the vesting/lock schedule.\\n * The beneficiary can issue authorized function calls to this contract that will\\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\\n * The function calls allowed are queried to the GraphTokenLockManager, this way\\n * the same configuration can be shared for all the created lock wallet contracts.\\n *\\n * This L2 variant includes a special initializer so that it can be created from\\n * a wallet's data received from L1. These transferred wallets will not allow releasing\\n * funds in L2 until the end of the vesting timeline, but they can allow withdrawing\\n * funds back to L1 using the L2GraphTokenLockTransferTool contract.\\n *\\n * Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1,\\n * so releasing surplus tokens might also only be possible by bridging tokens back to L1.\\n *\\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\\n * with any of this contract functions.\\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\\n * the maximum amount of tokens is authorized.\\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\\n */\\ncontract L2GraphTokenLockWallet is GraphTokenLockWallet {\\n // Initializer when created from a message from L1\\n function initializeFromL1(\\n address _manager,\\n address _token,\\n L2GraphTokenLockManager.TransferredWalletData calldata _walletData\\n ) external {\\n require(!isInitialized, \\\"Already initialized\\\");\\n isInitialized = true;\\n\\n OwnableInitializable._initialize(_walletData.owner);\\n beneficiary = _walletData.beneficiary;\\n token = IERC20(_token);\\n\\n managedAmount = _walletData.managedAmount;\\n\\n startTime = _walletData.startTime;\\n endTime = _walletData.endTime;\\n periods = 1;\\n isAccepted = true;\\n\\n // Optionals\\n releaseStartTime = _walletData.endTime;\\n revocable = Revocability.Disabled;\\n\\n _setManager(_manager);\\n }\\n}\\n\",\"keccak256\":\"0x8842140c2c7924be4ab1bca71e0b0ad6dd1dba6433cfdc523bfd204288b25d20\",\"license\":\"MIT\"},\"contracts/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nlibrary MathUtils {\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0xe2512e1da48bc8363acd15f66229564b02d66706665d7da740604566913c1400\",\"license\":\"MIT\"},\"contracts/MinimalProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\n\\nimport { Address } from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport { Create2 } from \\\"@openzeppelin/contracts/utils/Create2.sol\\\";\\n\\n/**\\n * @title MinimalProxyFactory: a factory contract for creating minimal proxies\\n * @notice Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\\n * Based on https://eips.ethereum.org/EIPS/eip-1167\\n */\\ncontract MinimalProxyFactory {\\n /// @dev Emitted when a new proxy is created\\n event ProxyCreated(address indexed proxy);\\n\\n /**\\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _deployer Address of the deployer that creates the contract\\n * @return Address of the counterfactual MinimalProxy\\n */\\n function getDeploymentAddress(\\n bytes32 _salt,\\n address _implementation,\\n address _deployer\\n ) public pure returns (address) {\\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), _deployer);\\n }\\n\\n /**\\n * @dev Deploys a MinimalProxy with CREATE2\\n * @param _salt Bytes32 salt to use for CREATE2\\n * @param _implementation Address of the proxy target implementation\\n * @param _data Bytes with the initializer call\\n * @return Address of the deployed MinimalProxy\\n */\\n function _deployProxy2(bytes32 _salt, address _implementation, bytes memory _data) internal returns (address) {\\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\\n\\n emit ProxyCreated(proxyAddress);\\n\\n // Call function with data\\n if (_data.length > 0) {\\n Address.functionCall(proxyAddress, _data);\\n }\\n\\n return proxyAddress;\\n }\\n\\n /**\\n * @dev Gets the MinimalProxy bytecode\\n * @param _implementation Address of the proxy target implementation\\n * @return MinimalProxy bytecode\\n */\\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\\n bytes10 creation = 0x3d602d80600a3d3981f3;\\n bytes10 prefix = 0x363d3d373d3d3d363d73;\\n bytes20 targetBytes = bytes20(_implementation);\\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\\n }\\n}\\n\",\"keccak256\":\"0x67d67a567bceb363ddb199b1e4ab06e7a99f16e034e03086971a332c09ec5c0e\",\"license\":\"MIT\"},\"contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.7.3;\\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 * The owner account will be passed on initialization of the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable {\\n /// @dev Owner of the contract, can be retrieved with the public owner() function\\n address private _owner;\\n /// @dev Since upgradeable contracts might inherit this, we add a storage gap\\n /// to allow adding variables here without breaking the proxy storage layout\\n uint256[50] private __gap;\\n\\n /// @dev Emitted when ownership of the contract is transferred\\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 owner) internal {\\n _owner = owner;\\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(_owner == msg.sender, \\\"Ownable: caller is not the owner\\\");\\n _;\\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() external virtual 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) external virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xe8750687082e8e24b620dbf58c3a08eee591ed7b4d5a3e13cc93554ec647fd09\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60c06040523480156200001157600080fd5b506040516200499938038062004999833981810160405281019062000037919062000410565b838360006200004b6200022860201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156200015c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001539062000586565b60405180910390fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550620001ae816200023060201b60201c565b50508173ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b815250508073ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff1660601b815250505050505062000635565b600033905090565b620002406200022860201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1662000266620003b960201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1614620002bf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002b69062000564565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141562000332576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620003299062000542565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600081519050620003f38162000601565b92915050565b6000815190506200040a816200061b565b92915050565b600080600080608085870312156200042757600080fd5b60006200043787828801620003f9565b94505060206200044a87828801620003e2565b93505060406200045d87828801620003e2565b92505060606200047087828801620003e2565b91505092959194509250565b60006200048b601983620005a8565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b6000620004cd602083620005a8565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006200050f601483620005a8565b91507f546f6b656e2063616e6e6f74206265207a65726f0000000000000000000000006000830152602082019050919050565b600060208201905081810360008301526200055d816200047c565b9050919050565b600060208201905081810360008301526200057f81620004be565b9050919050565b60006020820190508181036000830152620005a18162000500565b9050919050565b600082825260208201905092915050565b6000620005c682620005e1565b9050919050565b6000620005da82620005b9565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6200060c81620005b9565b81146200061857600080fd5b50565b6200062681620005cd565b81146200063257600080fd5b50565b60805160601c60a05160601c61433062000669600039806109195280611280525080610fc952806111f252506143306000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c806379ee1bdf116100de578063a619486e11610097578063cf497e6c11610071578063cf497e6c14610434578063f1d24c4514610450578063f2fde38b14610480578063fc0c546a1461049c57610173565b8063a619486e146103de578063b6b55f25146103fc578063c1ab13db1461041857610173565b806379ee1bdf1461031c5780638da5cb5b1461034c5780638fa74a0e1461036a5780639c05fc6014610388578063a3457466146103a4578063a4c0ed36146103c257610173565b8063463013a211610130578063463013a214610270578063586a53531461028c5780635975e00c146102aa57806368d30c2e146102c65780636e03b8dc146102e2578063715018a61461031257610173565b806303990a6c14610178578063045b7fe2146101945780630602ba2b146101c45780630cd6178f146101f45780632e1a7d4d1461022457806343fb93d914610240575b600080fd5b610192600480360381019061018d9190612f13565b6104ba565b005b6101ae60048036038101906101a99190612ca2565b610662565b6040516101bb91906139bc565b60405180910390f35b6101de60048036038101906101d99190612eea565b610695565b6040516101eb9190613bba565b60405180910390f35b61020e60048036038101906102099190612ca2565b6106d6565b60405161021b91906139bc565b60405180910390f35b61023e60048036038101906102399190612fd9565b610709565b005b61025a60048036038101906102559190612e9b565b610866565b60405161026791906139bc565b60405180910390f35b61028a60048036038101906102859190612f58565b61088b565b005b610294610917565b6040516102a191906139bc565b60405180910390f35b6102c460048036038101906102bf9190612ca2565b61093b565b005b6102e060048036038101906102db9190612ccb565b610acc565b005b6102fc60048036038101906102f79190612eea565b610e14565b60405161030991906139bc565b60405180910390f35b61031a610e47565b005b61033660048036038101906103319190612ca2565b610f81565b6040516103439190613bba565b60405180910390f35b610354610f9e565b60405161036191906139bc565b60405180910390f35b610372610fc7565b60405161037f91906139bc565b60405180910390f35b6103a2600480360381019061039d9190612dfd565b610feb565b005b6103ac611118565b6040516103b99190613b98565b60405180910390f35b6103dc60048036038101906103d79190612d91565b6111f0565b005b6103e6611756565b6040516103f391906139bc565b60405180910390f35b61041660048036038101906104119190612fd9565b61177c565b005b610432600480360381019061042d9190612ca2565b61185f565b005b61044e60048036038101906104499190612ca2565b611980565b005b61046a60048036038101906104659190612eea565b611af3565b60405161047791906139bc565b60405180910390f35b61049a60048036038101906104959190612ca2565b611b6e565b005b6104a4611d17565b6040516104b19190613c1a565b60405180910390f35b6104c2611d41565b73ffffffffffffffffffffffffffffffffffffffff166104e0610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052d90613e3b565b60405180910390fd5b60006105428383611d49565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98686604051610655929190613c35565b60405180910390a4505050565b60076020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff166106b783611af3565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b60066020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610711611d41565b73ffffffffffffffffffffffffffffffffffffffff1661072f610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610785576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077c90613e3b565b60405180910390fd5b600081116107c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107bf90613e1b565b60405180910390fd5b6108153382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b8260405161085b9190613f1b565b60405180910390a250565b60006108828461087585611e5d565b8051906020012084611ed3565b90509392505050565b610893611d41565b73ffffffffffffffffffffffffffffffffffffffff166108b1610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610907576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108fe90613e3b565b60405180910390fd5b610912838383611f17565b505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b610943611d41565b73ffffffffffffffffffffffffffffffffffffffff16610961610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146109b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ae90613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1e90613cfb565b60405180910390fd5b610a3b8160026120f990919063ffffffff16565b610a7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7190613e7b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610ac19190613bba565b60405180910390a250565b610ad4611d41565b73ffffffffffffffffffffffffffffffffffffffff16610af2610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610b48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3f90613e3b565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610ba491906139bc565b60206040518083038186803b158015610bbc57600080fd5b505afa158015610bd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf49190613002565b1015610c35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2c90613d3b565b60405180910390fd5b606063bd896dcb60e01b308b8b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168c8c8c8c8c8c8c604051602401610c869b9a999897969594939291906139d7565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610d1b8280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612129565b9050610d6a818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610dff989796959493929190613b1a565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e4f611d41565b73ffffffffffffffffffffffffffffffffffffffff16610e6d610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610ec3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eba90613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610f978260026121a590919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b610ff3611d41565b73ffffffffffffffffffffffffffffffffffffffff16611011610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105e90613e3b565b60405180910390fd5b8181905084849050146110af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a690613cbb565b60405180910390fd5b60005b84849050811015611111576111048585838181106110cc57fe5b90506020028101906110de9190613f36565b8585858181106110ea57fe5b90506020020160208101906110ff9190612ca2565b611f17565b80806001019150506110b2565b5050505050565b60608061112560026121d5565b67ffffffffffffffff8111801561113b57600080fd5b5060405190808252806020026020018201604052801561116a5781602001602082028036833780820191505090505b50905060005b61117a60026121d5565b8110156111e8576111958160026121ea90919063ffffffff16565b8282815181106111a157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611170565b508091505090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461127e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127590613cdb565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161461130c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130390613d7b565b60405180910390fd5b6113146129d3565b82828101906113239190612fb0565b9050600073ffffffffffffffffffffffffffffffffffffffff1660066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114715761146c60066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b611683565b6000806114958585604051611487929190613973565b604051809103902084612204565b915091508060066000856000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260000151600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506115ea8187600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b826000015173ffffffffffffffffffffffffffffffffffffffff16836040015173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fd74fe60cbf1e5bf07ef3fad0e00c45f66345c5226474786d8dc086527dc8414785876060015188608001518960a001516040516116789493929190613bd5565b60405180910390a450505b60066000826000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff167fe34903cfa4ad8362651171309d05bcbc2fc581a5ec83ca7b0c8d10743de766e2866040516117479190613f1b565b60405180910390a35050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081116117bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117b690613e1b565b60405180910390fd5b61180e333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661225b909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516118549190613f1b565b60405180910390a250565b611867611d41565b73ffffffffffffffffffffffffffffffffffffffff16611885610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146118db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d290613e3b565b60405180910390fd5b6118ef8160026122e490919063ffffffff16565b61192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192590613d9b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960006040516119759190613bba565b60405180910390a250565b611988611d41565b73ffffffffffffffffffffffffffffffffffffffff166119a6610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146119fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f390613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611a6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6390613dbb565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b611b76611d41565b73ffffffffffffffffffffffffffffffffffffffff16611b94610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614611bea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be190613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5190613d1b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b6000611dcf83836040516024016040516020818303038152906040529190604051611d759291906139a3565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612314565b905092915050565b611e588363a9059cbb60e01b8484604051602401611df6929190613af1565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061236c565b505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611eb994939291906138d7565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611ef19493929190613925565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611f86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f7d90613ddb565b60405180910390fd5b611f8f81612433565b611fce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc590613efb565b60405180910390fd5b6000611fda8484611d49565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c987876040516120eb929190613c35565b60405180910390a450505050565b6000612121836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612446565b905092915050565b60008061214060008661213b87611e5d565b6124b6565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a260008351111561219a5761219881846125c7565b505b809150509392505050565b60006121cd836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612611565b905092915050565b60006121e382600001612634565b9050919050565b60006121f98360000183612645565b60001c905092915050565b6000806060612212846126b2565b9050600061224386600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612129565b90508180519060200120819350935050509250929050565b6122de846323b872dd60e01b85858560405160240161227c93929190613aba565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061236c565b50505050565b600061230c836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612757565b905092915050565b6000600482511461235a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235190613e5b565b60405180910390fd5b60006020830151905080915050919050565b60606123ce826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661283f9092919063ffffffff16565b905060008151111561242e57808060200190518101906123ee9190612e72565b61242d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161242490613ebb565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b60006124528383612611565b6124ab5782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506124b0565b600090505b92915050565b600080844710156124fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f390613edb565b60405180910390fd5b600083511415612541576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161253890613c9b565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156125bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125b390613dfb565b60405180910390fd5b809150509392505050565b606061260983836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061283f565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011612690576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161268790613c7b565b60405180910390fd5b82600001828154811061269f57fe5b9060005260206000200154905092915050565b60606320dc203d60e01b30600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040516024016126f393929190613a82565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050509050919050565b6000808360010160008481526020019081526020016000205490506000811461283357600060018203905060006001866000018054905003905060008660000182815481106127a257fe5b90600052602060002001549050808760000184815481106127bf57fe5b90600052602060002001819055506001830187600101600083815260200190815260200160002081905550866000018054806127f757fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612839565b60009150505b92915050565b606061284e8484600085612857565b90509392505050565b60608247101561289c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161289390613d5b565b60405180910390fd5b6128a585612433565b6128e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128db90613e9b565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff16858760405161290e919061398c565b60006040518083038185875af1925050503d806000811461294b576040519150601f19603f3d011682016040523d82523d6000602084013e612950565b606091505b509150915061296082828661296c565b92505050949350505050565b6060831561297c578290506129cc565b60008351111561298f5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129c39190613c59565b60405180910390fd5b9392505050565b6040518060c00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081525090565b600081359050612a5a81614277565b92915050565b60008083601f840112612a7257600080fd5b8235905067ffffffffffffffff811115612a8b57600080fd5b602083019150836020820283011115612aa357600080fd5b9250929050565b60008083601f840112612abc57600080fd5b8235905067ffffffffffffffff811115612ad557600080fd5b602083019150836020820283011115612aed57600080fd5b9250929050565b600081519050612b038161428e565b92915050565b600081359050612b18816142a5565b92915050565b600081359050612b2d816142bc565b92915050565b60008083601f840112612b4557600080fd5b8235905067ffffffffffffffff811115612b5e57600080fd5b602083019150836001820283011115612b7657600080fd5b9250929050565b600081359050612b8c816142d3565b92915050565b60008083601f840112612ba457600080fd5b8235905067ffffffffffffffff811115612bbd57600080fd5b602083019150836001820283011115612bd557600080fd5b9250929050565b600060c08284031215612bee57600080fd5b612bf860c0613f8d565b90506000612c0884828501612a4b565b6000830152506020612c1c84828501612a4b565b6020830152506040612c3084828501612a4b565b6040830152506060612c4484828501612c78565b6060830152506080612c5884828501612c78565b60808301525060a0612c6c84828501612c78565b60a08301525092915050565b600081359050612c87816142e3565b92915050565b600081519050612c9c816142e3565b92915050565b600060208284031215612cb457600080fd5b6000612cc284828501612a4b565b91505092915050565b60008060008060008060008060006101208a8c031215612cea57600080fd5b6000612cf88c828d01612a4b565b9950506020612d098c828d01612a4b565b9850506040612d1a8c828d01612c78565b9750506060612d2b8c828d01612c78565b9650506080612d3c8c828d01612c78565b95505060a0612d4d8c828d01612c78565b94505060c0612d5e8c828d01612c78565b93505060e0612d6f8c828d01612c78565b925050610100612d818c828d01612b7d565b9150509295985092959850929598565b60008060008060608587031215612da757600080fd5b6000612db587828801612a4b565b9450506020612dc687828801612c78565b935050604085013567ffffffffffffffff811115612de357600080fd5b612def87828801612b33565b925092505092959194509250565b60008060008060408587031215612e1357600080fd5b600085013567ffffffffffffffff811115612e2d57600080fd5b612e3987828801612aaa565b9450945050602085013567ffffffffffffffff811115612e5857600080fd5b612e6487828801612a60565b925092505092959194509250565b600060208284031215612e8457600080fd5b6000612e9284828501612af4565b91505092915050565b600080600060608486031215612eb057600080fd5b6000612ebe86828701612b09565b9350506020612ecf86828701612a4b565b9250506040612ee086828701612a4b565b9150509250925092565b600060208284031215612efc57600080fd5b6000612f0a84828501612b1e565b91505092915050565b60008060208385031215612f2657600080fd5b600083013567ffffffffffffffff811115612f4057600080fd5b612f4c85828601612b92565b92509250509250929050565b600080600060408486031215612f6d57600080fd5b600084013567ffffffffffffffff811115612f8757600080fd5b612f9386828701612b92565b93509350506020612fa686828701612a4b565b9150509250925092565b600060c08284031215612fc257600080fd5b6000612fd084828501612bdc565b91505092915050565b600060208284031215612feb57600080fd5b6000612ff984828501612c78565b91505092915050565b60006020828403121561301457600080fd5b600061302284828501612c8d565b91505092915050565b60006130378383613043565b60208301905092915050565b61304c81614034565b82525050565b61305b81614034565b82525050565b61307261306d82614034565b6141ed565b82525050565b600061308382613fce565b61308d8185613ffc565b935061309883613fbe565b8060005b838110156130c95781516130b0888261302b565b97506130bb83613fef565b92505060018101905061309c565b5085935050505092915050565b6130df81614046565b82525050565b6130f66130f18261407e565b614209565b82525050565b61310d613108826140aa565b614213565b82525050565b61312461311f82614052565b6141ff565b82525050565b61313b613136826140d6565b61421d565b82525050565b61314a81614102565b82525050565b61316161315c82614102565b614227565b82525050565b6000613173838561400d565b93506131808385846141ab565b82840190509392505050565b600061319782613fd9565b6131a1818561400d565b93506131b18185602086016141ba565b80840191505092915050565b6131c681614175565b82525050565b6131d581614199565b82525050565b60006131e78385614018565b93506131f48385846141ab565b6131fd83614245565b840190509392505050565b60006132148385614029565b93506132218385846141ab565b82840190509392505050565b600061323882613fe4565b6132428185614018565b93506132528185602086016141ba565b61325b81614245565b840191505092915050565b6000613273602283614018565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006132d9602083614018565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b6000613319601583614018565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000613359600c83614018565b91507f4f4e4c595f4741544557415900000000000000000000000000000000000000006000830152602082019050919050565b6000613399601a83614018565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006133d9602683614018565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061343f602083614018565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b600061347f602683614018565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006134e5601283614018565b91507f4f4e4c595f5452414e534645525f544f4f4c00000000000000000000000000006000830152602082019050919050565b6000613525601b83614018565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000613565601983614018565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b60006135a5601d83614018565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b60006135e5601983614018565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000613625601583614018565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000613665602083614018565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006136a5601883614018565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b60006136e5601983614018565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000613725601d83614018565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613765602a83614018565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b60006137cb601d83614018565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b600061380b601983614018565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b60c0820160008201516138546000850182613043565b5060208201516138676020850182613043565b50604082015161387a6040850182613043565b50606082015161388d60608501826138b9565b5060808201516138a060808501826138b9565b5060a08201516138b360a08501826138b9565b50505050565b6138c28161416b565b82525050565b6138d18161416b565b82525050565b60006138e382876130e5565b600a820191506138f382866130e5565b600a82019150613903828561312a565b60148201915061391382846130fc565b600f8201915081905095945050505050565b60006139318287613113565b6001820191506139418286613061565b6014820191506139518285613150565b6020820191506139618284613150565b60208201915081905095945050505050565b6000613980828486613167565b91508190509392505050565b6000613998828461318c565b915081905092915050565b60006139b0828486613208565b91508190509392505050565b60006020820190506139d16000830184613052565b92915050565b6000610160820190506139ed600083018e613052565b6139fa602083018d613052565b613a07604083018c613052565b613a14606083018b613052565b613a21608083018a6138c8565b613a2e60a08301896138c8565b613a3b60c08301886138c8565b613a4860e08301876138c8565b613a566101008301866138c8565b613a646101208301856138c8565b613a726101408301846131cc565b9c9b505050505050505050505050565b600061010082019050613a986000830186613052565b613aa56020830185613052565b613ab2604083018461383e565b949350505050565b6000606082019050613acf6000830186613052565b613adc6020830185613052565b613ae960408301846138c8565b949350505050565b6000604082019050613b066000830185613052565b613b1360208301846138c8565b9392505050565b600061010082019050613b30600083018b613052565b613b3d602083018a6138c8565b613b4a60408301896138c8565b613b5760608301886138c8565b613b6460808301876138c8565b613b7160a08301866138c8565b613b7e60c08301856138c8565b613b8b60e08301846131cc565b9998505050505050505050565b60006020820190508181036000830152613bb28184613078565b905092915050565b6000602082019050613bcf60008301846130d6565b92915050565b6000608082019050613bea6000830187613141565b613bf760208301866138c8565b613c0460408301856138c8565b613c1160608301846138c8565b95945050505050565b6000602082019050613c2f60008301846131bd565b92915050565b60006020820190508181036000830152613c508184866131db565b90509392505050565b60006020820190508181036000830152613c73818461322d565b905092915050565b60006020820190508181036000830152613c9481613266565b9050919050565b60006020820190508181036000830152613cb4816132cc565b9050919050565b60006020820190508181036000830152613cd48161330c565b9050919050565b60006020820190508181036000830152613cf48161334c565b9050919050565b60006020820190508181036000830152613d148161338c565b9050919050565b60006020820190508181036000830152613d34816133cc565b9050919050565b60006020820190508181036000830152613d5481613432565b9050919050565b60006020820190508181036000830152613d7481613472565b9050919050565b60006020820190508181036000830152613d94816134d8565b9050919050565b60006020820190508181036000830152613db481613518565b9050919050565b60006020820190508181036000830152613dd481613558565b9050919050565b60006020820190508181036000830152613df481613598565b9050919050565b60006020820190508181036000830152613e14816135d8565b9050919050565b60006020820190508181036000830152613e3481613618565b9050919050565b60006020820190508181036000830152613e5481613658565b9050919050565b60006020820190508181036000830152613e7481613698565b9050919050565b60006020820190508181036000830152613e94816136d8565b9050919050565b60006020820190508181036000830152613eb481613718565b9050919050565b60006020820190508181036000830152613ed481613758565b9050919050565b60006020820190508181036000830152613ef4816137be565b9050919050565b60006020820190508181036000830152613f14816137fe565b9050919050565b6000602082019050613f3060008301846138c8565b92915050565b60008083356001602003843603038112613f4f57600080fd5b80840192508235915067ffffffffffffffff821115613f6d57600080fd5b602083019250600182023603831315613f8557600080fd5b509250929050565b6000604051905081810181811067ffffffffffffffff82111715613fb457613fb3614243565b5b8060405250919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061403f8261414b565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061414682614263565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061418082614187565b9050919050565b60006141928261414b565b9050919050565b60006141a482614138565b9050919050565b82818337600083830152505050565b60005b838110156141d85780820151818401526020810190506141bd565b838111156141e7576000848401525b50505050565b60006141f882614231565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b600061423c82614256565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061427457614273614243565b5b50565b61428081614034565b811461428b57600080fd5b50565b61429781614046565b81146142a257600080fd5b50565b6142ae81614102565b81146142b957600080fd5b50565b6142c58161410c565b81146142d057600080fd5b50565b600381106142e057600080fd5b50565b6142ec8161416b565b81146142f757600080fd5b5056fea264697066735822122010f167ec85dbd4b07aedb6960f9f6ac5ae1b0f5473409617dcd319393591837164736f6c63430007030033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101735760003560e01c806379ee1bdf116100de578063a619486e11610097578063cf497e6c11610071578063cf497e6c14610434578063f1d24c4514610450578063f2fde38b14610480578063fc0c546a1461049c57610173565b8063a619486e146103de578063b6b55f25146103fc578063c1ab13db1461041857610173565b806379ee1bdf1461031c5780638da5cb5b1461034c5780638fa74a0e1461036a5780639c05fc6014610388578063a3457466146103a4578063a4c0ed36146103c257610173565b8063463013a211610130578063463013a214610270578063586a53531461028c5780635975e00c146102aa57806368d30c2e146102c65780636e03b8dc146102e2578063715018a61461031257610173565b806303990a6c14610178578063045b7fe2146101945780630602ba2b146101c45780630cd6178f146101f45780632e1a7d4d1461022457806343fb93d914610240575b600080fd5b610192600480360381019061018d9190612f13565b6104ba565b005b6101ae60048036038101906101a99190612ca2565b610662565b6040516101bb91906139bc565b60405180910390f35b6101de60048036038101906101d99190612eea565b610695565b6040516101eb9190613bba565b60405180910390f35b61020e60048036038101906102099190612ca2565b6106d6565b60405161021b91906139bc565b60405180910390f35b61023e60048036038101906102399190612fd9565b610709565b005b61025a60048036038101906102559190612e9b565b610866565b60405161026791906139bc565b60405180910390f35b61028a60048036038101906102859190612f58565b61088b565b005b610294610917565b6040516102a191906139bc565b60405180910390f35b6102c460048036038101906102bf9190612ca2565b61093b565b005b6102e060048036038101906102db9190612ccb565b610acc565b005b6102fc60048036038101906102f79190612eea565b610e14565b60405161030991906139bc565b60405180910390f35b61031a610e47565b005b61033660048036038101906103319190612ca2565b610f81565b6040516103439190613bba565b60405180910390f35b610354610f9e565b60405161036191906139bc565b60405180910390f35b610372610fc7565b60405161037f91906139bc565b60405180910390f35b6103a2600480360381019061039d9190612dfd565b610feb565b005b6103ac611118565b6040516103b99190613b98565b60405180910390f35b6103dc60048036038101906103d79190612d91565b6111f0565b005b6103e6611756565b6040516103f391906139bc565b60405180910390f35b61041660048036038101906104119190612fd9565b61177c565b005b610432600480360381019061042d9190612ca2565b61185f565b005b61044e60048036038101906104499190612ca2565b611980565b005b61046a60048036038101906104659190612eea565b611af3565b60405161047791906139bc565b60405180910390f35b61049a60048036038101906104959190612ca2565b611b6e565b005b6104a4611d17565b6040516104b19190613c1a565b60405180910390f35b6104c2611d41565b73ffffffffffffffffffffffffffffffffffffffff166104e0610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052d90613e3b565b60405180910390fd5b60006105428383611d49565b9050600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c98686604051610655929190613c35565b60405180910390a4505050565b60076020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff166106b783611af3565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b60066020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610711611d41565b73ffffffffffffffffffffffffffffffffffffffff1661072f610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610785576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077c90613e3b565b60405180910390fd5b600081116107c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107bf90613e1b565b60405180910390fd5b6108153382600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b8260405161085b9190613f1b565b60405180910390a250565b60006108828461087585611e5d565b8051906020012084611ed3565b90509392505050565b610893611d41565b73ffffffffffffffffffffffffffffffffffffffff166108b1610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610907576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108fe90613e3b565b60405180910390fd5b610912838383611f17565b505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b610943611d41565b73ffffffffffffffffffffffffffffffffffffffff16610961610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146109b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ae90613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1e90613cfb565b60405180910390fd5b610a3b8160026120f990919063ffffffff16565b610a7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7190613e7b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a796001604051610ac19190613bba565b60405180910390a250565b610ad4611d41565b73ffffffffffffffffffffffffffffffffffffffff16610af2610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610b48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3f90613e3b565b60405180910390fd5b86600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610ba491906139bc565b60206040518083038186803b158015610bbc57600080fd5b505afa158015610bd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf49190613002565b1015610c35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2c90613d3b565b60405180910390fd5b606063bd896dcb60e01b308b8b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168c8c8c8c8c8c8c604051602401610c869b9a999897969594939291906139d7565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000610d1b8280519060200120600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612129565b9050610d6a818a600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b8973ffffffffffffffffffffffffffffffffffffffff1682805190602001208273ffffffffffffffffffffffffffffffffffffffff167f3c7ff6acee351ed98200c285a04745858a107e16da2f13c3a81a43073c17d644600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168d8d8d8d8d8d8d604051610dff989796959493929190613b1a565b60405180910390a45050505050505050505050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e4f611d41565b73ffffffffffffffffffffffffffffffffffffffff16610e6d610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614610ec3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eba90613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610f978260026121a590919063ffffffff16565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b610ff3611d41565b73ffffffffffffffffffffffffffffffffffffffff16611011610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105e90613e3b565b60405180910390fd5b8181905084849050146110af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a690613cbb565b60405180910390fd5b60005b84849050811015611111576111048585838181106110cc57fe5b90506020028101906110de9190613f36565b8585858181106110ea57fe5b90506020020160208101906110ff9190612ca2565b611f17565b80806001019150506110b2565b5050505050565b60608061112560026121d5565b67ffffffffffffffff8111801561113b57600080fd5b5060405190808252806020026020018201604052801561116a5781602001602082028036833780820191505090505b50905060005b61117a60026121d5565b8110156111e8576111958160026121ea90919063ffffffff16565b8282815181106111a157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611170565b508091505090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461127e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127590613cdb565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161461130c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130390613d7b565b60405180910390fd5b6113146129d3565b82828101906113239190612fb0565b9050600073ffffffffffffffffffffffffffffffffffffffff1660066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114715761146c60066000836000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b611683565b6000806114958585604051611487929190613973565b604051809103902084612204565b915091508060066000856000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260000151600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506115ea8187600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dd79092919063ffffffff16565b826000015173ffffffffffffffffffffffffffffffffffffffff16836040015173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fd74fe60cbf1e5bf07ef3fad0e00c45f66345c5226474786d8dc086527dc8414785876060015188608001518960a001516040516116789493929190613bd5565b60405180910390a450505b60066000826000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff167fe34903cfa4ad8362651171309d05bcbc2fc581a5ec83ca7b0c8d10743de766e2866040516117479190613f1b565b60405180910390a35050505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081116117bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117b690613e1b565b60405180910390fd5b61180e333083600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661225b909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f59062170a285eb80e8c6b8ced60428442a51910635005233fc4ce084a475845e826040516118549190613f1b565b60405180910390a250565b611867611d41565b73ffffffffffffffffffffffffffffffffffffffff16611885610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146118db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d290613e3b565b60405180910390fd5b6118ef8160026122e490919063ffffffff16565b61192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192590613d9b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167f33442b8c13e72dd75a027f08f9bff4eed2dfd26e43cdea857365f5163b359a7960006040516119759190613bba565b60405180910390a250565b611988611d41565b73ffffffffffffffffffffffffffffffffffffffff166119a6610f9e565b73ffffffffffffffffffffffffffffffffffffffff16146119fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f390613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611a6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6390613dbb565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f30909084afc859121ffc3a5aef7fe37c540a9a1ef60bd4d8dcdb76376fadf9de60405160405180910390a250565b600060016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b611b76611d41565b73ffffffffffffffffffffffffffffffffffffffff16611b94610f9e565b73ffffffffffffffffffffffffffffffffffffffff1614611bea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be190613e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5190613d1b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b6000611dcf83836040516024016040516020818303038152906040529190604051611d759291906139a3565b60405180910390207bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612314565b905092915050565b611e588363a9059cbb60e01b8484604051602401611df6929190613af1565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061236c565b505050565b60606000693d602d80600a3d3981f360b01b9050600069363d3d373d3d3d363d7360b01b905060008460601b905060006e5af43d82803e903d91602b57fd5bf360881b905083838383604051602001611eb994939291906138d7565b604051602081830303815290604052945050505050919050565b60008060ff60f81b838686604051602001611ef19493929190613925565b6040516020818303038152906040528051906020012090508060001c9150509392505050565b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611f86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f7d90613ddb565b60405180910390fd5b611f8f81612433565b611fce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc590613efb565b60405180910390fd5b6000611fda8484611d49565b90508160016000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff167f450397a2db0e89eccfe664cc6cdfd274a88bc00d29aaec4d991754a42f19f8c987876040516120eb929190613c35565b60405180910390a450505050565b6000612121836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612446565b905092915050565b60008061214060008661213b87611e5d565b6124b6565b90508073ffffffffffffffffffffffffffffffffffffffff167efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e734960405160405180910390a260008351111561219a5761219881846125c7565b505b809150509392505050565b60006121cd836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612611565b905092915050565b60006121e382600001612634565b9050919050565b60006121f98360000183612645565b60001c905092915050565b6000806060612212846126b2565b9050600061224386600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684612129565b90508180519060200120819350935050509250929050565b6122de846323b872dd60e01b85858560405160240161227c93929190613aba565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061236c565b50505050565b600061230c836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612757565b905092915050565b6000600482511461235a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235190613e5b565b60405180910390fd5b60006020830151905080915050919050565b60606123ce826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661283f9092919063ffffffff16565b905060008151111561242e57808060200190518101906123ee9190612e72565b61242d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161242490613ebb565b60405180910390fd5b5b505050565b600080823b905060008111915050919050565b60006124528383612611565b6124ab5782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506124b0565b600090505b92915050565b600080844710156124fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f390613edb565b60405180910390fd5b600083511415612541576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161253890613c9b565b60405180910390fd5b8383516020850187f59050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156125bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125b390613dfb565b60405180910390fd5b809150509392505050565b606061260983836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061283f565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600081600001805490509050919050565b600081836000018054905011612690576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161268790613c7b565b60405180910390fd5b82600001828154811061269f57fe5b9060005260206000200154905092915050565b60606320dc203d60e01b30600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040516024016126f393929190613a82565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050509050919050565b6000808360010160008481526020019081526020016000205490506000811461283357600060018203905060006001866000018054905003905060008660000182815481106127a257fe5b90600052602060002001549050808760000184815481106127bf57fe5b90600052602060002001819055506001830187600101600083815260200190815260200160002081905550866000018054806127f757fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612839565b60009150505b92915050565b606061284e8484600085612857565b90509392505050565b60608247101561289c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161289390613d5b565b60405180910390fd5b6128a585612433565b6128e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128db90613e9b565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff16858760405161290e919061398c565b60006040518083038185875af1925050503d806000811461294b576040519150601f19603f3d011682016040523d82523d6000602084013e612950565b606091505b509150915061296082828661296c565b92505050949350505050565b6060831561297c578290506129cc565b60008351111561298f5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129c39190613c59565b60405180910390fd5b9392505050565b6040518060c00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081525090565b600081359050612a5a81614277565b92915050565b60008083601f840112612a7257600080fd5b8235905067ffffffffffffffff811115612a8b57600080fd5b602083019150836020820283011115612aa357600080fd5b9250929050565b60008083601f840112612abc57600080fd5b8235905067ffffffffffffffff811115612ad557600080fd5b602083019150836020820283011115612aed57600080fd5b9250929050565b600081519050612b038161428e565b92915050565b600081359050612b18816142a5565b92915050565b600081359050612b2d816142bc565b92915050565b60008083601f840112612b4557600080fd5b8235905067ffffffffffffffff811115612b5e57600080fd5b602083019150836001820283011115612b7657600080fd5b9250929050565b600081359050612b8c816142d3565b92915050565b60008083601f840112612ba457600080fd5b8235905067ffffffffffffffff811115612bbd57600080fd5b602083019150836001820283011115612bd557600080fd5b9250929050565b600060c08284031215612bee57600080fd5b612bf860c0613f8d565b90506000612c0884828501612a4b565b6000830152506020612c1c84828501612a4b565b6020830152506040612c3084828501612a4b565b6040830152506060612c4484828501612c78565b6060830152506080612c5884828501612c78565b60808301525060a0612c6c84828501612c78565b60a08301525092915050565b600081359050612c87816142e3565b92915050565b600081519050612c9c816142e3565b92915050565b600060208284031215612cb457600080fd5b6000612cc284828501612a4b565b91505092915050565b60008060008060008060008060006101208a8c031215612cea57600080fd5b6000612cf88c828d01612a4b565b9950506020612d098c828d01612a4b565b9850506040612d1a8c828d01612c78565b9750506060612d2b8c828d01612c78565b9650506080612d3c8c828d01612c78565b95505060a0612d4d8c828d01612c78565b94505060c0612d5e8c828d01612c78565b93505060e0612d6f8c828d01612c78565b925050610100612d818c828d01612b7d565b9150509295985092959850929598565b60008060008060608587031215612da757600080fd5b6000612db587828801612a4b565b9450506020612dc687828801612c78565b935050604085013567ffffffffffffffff811115612de357600080fd5b612def87828801612b33565b925092505092959194509250565b60008060008060408587031215612e1357600080fd5b600085013567ffffffffffffffff811115612e2d57600080fd5b612e3987828801612aaa565b9450945050602085013567ffffffffffffffff811115612e5857600080fd5b612e6487828801612a60565b925092505092959194509250565b600060208284031215612e8457600080fd5b6000612e9284828501612af4565b91505092915050565b600080600060608486031215612eb057600080fd5b6000612ebe86828701612b09565b9350506020612ecf86828701612a4b565b9250506040612ee086828701612a4b565b9150509250925092565b600060208284031215612efc57600080fd5b6000612f0a84828501612b1e565b91505092915050565b60008060208385031215612f2657600080fd5b600083013567ffffffffffffffff811115612f4057600080fd5b612f4c85828601612b92565b92509250509250929050565b600080600060408486031215612f6d57600080fd5b600084013567ffffffffffffffff811115612f8757600080fd5b612f9386828701612b92565b93509350506020612fa686828701612a4b565b9150509250925092565b600060c08284031215612fc257600080fd5b6000612fd084828501612bdc565b91505092915050565b600060208284031215612feb57600080fd5b6000612ff984828501612c78565b91505092915050565b60006020828403121561301457600080fd5b600061302284828501612c8d565b91505092915050565b60006130378383613043565b60208301905092915050565b61304c81614034565b82525050565b61305b81614034565b82525050565b61307261306d82614034565b6141ed565b82525050565b600061308382613fce565b61308d8185613ffc565b935061309883613fbe565b8060005b838110156130c95781516130b0888261302b565b97506130bb83613fef565b92505060018101905061309c565b5085935050505092915050565b6130df81614046565b82525050565b6130f66130f18261407e565b614209565b82525050565b61310d613108826140aa565b614213565b82525050565b61312461311f82614052565b6141ff565b82525050565b61313b613136826140d6565b61421d565b82525050565b61314a81614102565b82525050565b61316161315c82614102565b614227565b82525050565b6000613173838561400d565b93506131808385846141ab565b82840190509392505050565b600061319782613fd9565b6131a1818561400d565b93506131b18185602086016141ba565b80840191505092915050565b6131c681614175565b82525050565b6131d581614199565b82525050565b60006131e78385614018565b93506131f48385846141ab565b6131fd83614245565b840190509392505050565b60006132148385614029565b93506132218385846141ab565b82840190509392505050565b600061323882613fe4565b6132428185614018565b93506132528185602086016141ba565b61325b81614245565b840191505092915050565b6000613273602283614018565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006132d9602083614018565b91507f437265617465323a2062797465636f6465206c656e677468206973207a65726f6000830152602082019050919050565b6000613319601583614018565b91507f4172726179206c656e677468206d69736d6174636800000000000000000000006000830152602082019050919050565b6000613359600c83614018565b91507f4f4e4c595f4741544557415900000000000000000000000000000000000000006000830152602082019050919050565b6000613399601a83614018565b91507f44657374696e6174696f6e2063616e6e6f74206265207a65726f0000000000006000830152602082019050919050565b60006133d9602683614018565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061343f602083614018565b91507f4e6f7420656e6f75676820746f6b656e7320746f20637265617465206c6f636b6000830152602082019050919050565b600061347f602683614018565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006134e5601283614018565b91507f4f4e4c595f5452414e534645525f544f4f4c00000000000000000000000000006000830152602082019050919050565b6000613525601b83614018565b91507f44657374696e6174696f6e20616c72656164792072656d6f76656400000000006000830152602082019050919050565b6000613565601983614018565b91507f4d6173746572436f70792063616e6e6f74206265207a65726f000000000000006000830152602082019050919050565b60006135a5601d83614018565b91507f546172676574206d757374206265206f7468657220636f6e74726163740000006000830152602082019050919050565b60006135e5601983614018565b91507f437265617465323a204661696c6564206f6e206465706c6f79000000000000006000830152602082019050919050565b6000613625601583614018565b91507f416d6f756e742063616e6e6f74206265207a65726f00000000000000000000006000830152602082019050919050565b6000613665602083614018565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006136a5601883614018565b91507f496e76616c6964206d6574686f64207369676e617475726500000000000000006000830152602082019050919050565b60006136e5601983614018565b91507f44657374696e6174696f6e20616c7265616479206164646564000000000000006000830152602082019050919050565b6000613725601d83614018565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b6000613765602a83614018565b91507f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008301527f6f742073756363656564000000000000000000000000000000000000000000006020830152604082019050919050565b60006137cb601d83614018565b91507f437265617465323a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b600061380b601983614018565b91507f546172676574206d757374206265206120636f6e7472616374000000000000006000830152602082019050919050565b60c0820160008201516138546000850182613043565b5060208201516138676020850182613043565b50604082015161387a6040850182613043565b50606082015161388d60608501826138b9565b5060808201516138a060808501826138b9565b5060a08201516138b360a08501826138b9565b50505050565b6138c28161416b565b82525050565b6138d18161416b565b82525050565b60006138e382876130e5565b600a820191506138f382866130e5565b600a82019150613903828561312a565b60148201915061391382846130fc565b600f8201915081905095945050505050565b60006139318287613113565b6001820191506139418286613061565b6014820191506139518285613150565b6020820191506139618284613150565b60208201915081905095945050505050565b6000613980828486613167565b91508190509392505050565b6000613998828461318c565b915081905092915050565b60006139b0828486613208565b91508190509392505050565b60006020820190506139d16000830184613052565b92915050565b6000610160820190506139ed600083018e613052565b6139fa602083018d613052565b613a07604083018c613052565b613a14606083018b613052565b613a21608083018a6138c8565b613a2e60a08301896138c8565b613a3b60c08301886138c8565b613a4860e08301876138c8565b613a566101008301866138c8565b613a646101208301856138c8565b613a726101408301846131cc565b9c9b505050505050505050505050565b600061010082019050613a986000830186613052565b613aa56020830185613052565b613ab2604083018461383e565b949350505050565b6000606082019050613acf6000830186613052565b613adc6020830185613052565b613ae960408301846138c8565b949350505050565b6000604082019050613b066000830185613052565b613b1360208301846138c8565b9392505050565b600061010082019050613b30600083018b613052565b613b3d602083018a6138c8565b613b4a60408301896138c8565b613b5760608301886138c8565b613b6460808301876138c8565b613b7160a08301866138c8565b613b7e60c08301856138c8565b613b8b60e08301846131cc565b9998505050505050505050565b60006020820190508181036000830152613bb28184613078565b905092915050565b6000602082019050613bcf60008301846130d6565b92915050565b6000608082019050613bea6000830187613141565b613bf760208301866138c8565b613c0460408301856138c8565b613c1160608301846138c8565b95945050505050565b6000602082019050613c2f60008301846131bd565b92915050565b60006020820190508181036000830152613c508184866131db565b90509392505050565b60006020820190508181036000830152613c73818461322d565b905092915050565b60006020820190508181036000830152613c9481613266565b9050919050565b60006020820190508181036000830152613cb4816132cc565b9050919050565b60006020820190508181036000830152613cd48161330c565b9050919050565b60006020820190508181036000830152613cf48161334c565b9050919050565b60006020820190508181036000830152613d148161338c565b9050919050565b60006020820190508181036000830152613d34816133cc565b9050919050565b60006020820190508181036000830152613d5481613432565b9050919050565b60006020820190508181036000830152613d7481613472565b9050919050565b60006020820190508181036000830152613d94816134d8565b9050919050565b60006020820190508181036000830152613db481613518565b9050919050565b60006020820190508181036000830152613dd481613558565b9050919050565b60006020820190508181036000830152613df481613598565b9050919050565b60006020820190508181036000830152613e14816135d8565b9050919050565b60006020820190508181036000830152613e3481613618565b9050919050565b60006020820190508181036000830152613e5481613658565b9050919050565b60006020820190508181036000830152613e7481613698565b9050919050565b60006020820190508181036000830152613e94816136d8565b9050919050565b60006020820190508181036000830152613eb481613718565b9050919050565b60006020820190508181036000830152613ed481613758565b9050919050565b60006020820190508181036000830152613ef4816137be565b9050919050565b60006020820190508181036000830152613f14816137fe565b9050919050565b6000602082019050613f3060008301846138c8565b92915050565b60008083356001602003843603038112613f4f57600080fd5b80840192508235915067ffffffffffffffff821115613f6d57600080fd5b602083019250600182023603831315613f8557600080fd5b509250929050565b6000604051905081810181811067ffffffffffffffff82111715613fb457613fb3614243565b5b8060405250919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061403f8261414b565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffff0000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffff000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600081905061414682614263565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061418082614187565b9050919050565b60006141928261414b565b9050919050565b60006141a482614138565b9050919050565b82818337600083830152505050565b60005b838110156141d85780820151818401526020810190506141bd565b838111156141e7576000848401525b50505050565b60006141f882614231565b9050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050919050565b600061423c82614256565b9050919050565bfe5b6000601f19601f8301169050919050565b60008160601b9050919050565b6003811061427457614273614243565b5b50565b61428081614034565b811461428b57600080fd5b50565b61429781614046565b81146142a257600080fd5b50565b6142ae81614102565b81146142b957600080fd5b50565b6142c58161410c565b81146142d057600080fd5b50565b600381106142e057600080fd5b50565b6142ec8161416b565b81146142f757600080fd5b5056fea264697066735822122010f167ec85dbd4b07aedb6960f9f6ac5ae1b0f5473409617dcd319393591837164736f6c63430007030033", + "devdoc": { + "events": { + "LockedTokensReceivedFromL1(address,address,uint256)": { + "details": "Emitted when locked tokens are received from L1 (whether the wallet had already been received or not)" + }, + "TokenLockCreatedFromL1(address,bytes32,address,uint256,uint256,uint256,address)": { + "details": "Event emitted when a wallet is received and created from L1" + } + }, + "kind": "dev", + "methods": { + "addTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "constructor": { + "params": { + "_graphToken": "Address of the L2 GRT token contract", + "_l1TransferTool": "Address of the L1 transfer tool contract (in L1, without aliasing)", + "_l2Gateway": "Address of the L2GraphTokenGateway contract", + "_masterCopy": "Address of the master copy of the L2GraphTokenLockWallet implementation" + } + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "params": { + "_beneficiary": "Address of the beneficiary of locked tokens", + "_endTime": "End time of the release schedule", + "_managedAmount": "Amount of tokens to be managed by the lock contract", + "_owner": "Address of the contract owner", + "_periods": "Number of periods between start time and end time", + "_releaseStartTime": "Override time for when the releases start", + "_revocable": "Whether the contract is revocable", + "_startTime": "Start time of the release schedule" + } + }, + "deposit(uint256)": { + "details": "Even if the ERC20 token can be transferred directly to the contract this function provide a safe interface to do the transfer and avoid mistakes", + "params": { + "_amount": "Amount to deposit" + } + }, + "getAuthFunctionCallTarget(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "Address of the target contract where to send the call" + } + }, + "getDeploymentAddress(bytes32,address,address)": { + "params": { + "_deployer": "Address of the deployer that creates the contract", + "_implementation": "Address of the proxy target implementation", + "_salt": "Bytes32 salt to use for CREATE2" + }, + "returns": { + "_0": "Address of the counterfactual MinimalProxy" + } + }, + "getTokenDestinations()": { + "returns": { + "_0": "Array of addresses authorized to pull funds from a token lock" + } + }, + "isAuthFunctionCall(bytes4)": { + "params": { + "_sigHash": "Function signature hash" + }, + "returns": { + "_0": "True if authorized" + } + }, + "isTokenDestination(address)": { + "params": { + "_dst": "Destination address" + }, + "returns": { + "_0": "True if authorized" + } + }, + "onTokenTransfer(address,uint256,bytes)": { + "details": "This function will create a new wallet if it doesn't exist yet, or send the tokens to the existing wallet if it does.", + "params": { + "_amount": "Amount of tokens received", + "_data": "Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct", + "_from": "Address of the sender in L1, which must be the L1GraphTokenLockTransferTool" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "removeTokenDestination(address)": { + "params": { + "_dst": "Destination address" + } + }, + "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." + }, + "setAuthFunctionCall(string,address)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature", + "_target": "Address of the destination contract to call" + } + }, + "setAuthFunctionCallMany(string[],address[])": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signatures": "Function signatures", + "_targets": "Address of the destination contract to call" + } + }, + "setMasterCopy(address)": { + "params": { + "_masterCopy": "Address of contract bytecode to factory clone" + } + }, + "token()": { + "returns": { + "_0": "Token used for transfers and approvals" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "unsetAuthFunctionCall(string)": { + "details": "Input expected is the function signature as 'transfer(address,uint256)'", + "params": { + "_signature": "Function signature" + } + }, + "withdraw(uint256)": { + "details": "Escape hatch in case of mistakes or to recover remaining funds", + "params": { + "_amount": "Amount of tokens to withdraw" + } + } + }, + "title": "L2GraphTokenLockManager", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "addTokenDestination(address)": { + "notice": "Adds an address that can be allowed by a token lock to pull funds" + }, + "constructor": { + "notice": "Constructor for the L2GraphTokenLockManager contract." + }, + "createTokenLockWallet(address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint8)": { + "notice": "Creates and fund a new token lock wallet using a minimum proxy" + }, + "deposit(uint256)": { + "notice": "Deposits tokens into the contract" + }, + "getAuthFunctionCallTarget(bytes4)": { + "notice": "Gets the target contract to call for a particular function signature" + }, + "getDeploymentAddress(bytes32,address,address)": { + "notice": "Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation" + }, + "getTokenDestinations()": { + "notice": "Returns an array of authorized destination addresses" + }, + "isAuthFunctionCall(bytes4)": { + "notice": "Returns true if the function call is authorized" + }, + "isTokenDestination(address)": { + "notice": "Returns True if the address is authorized to be a destination of tokens" + }, + "l1TransferTool()": { + "notice": "Address of the L1 transfer tool contract (in L1, no aliasing)" + }, + "l1WalletToL2Wallet(address)": { + "notice": "Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received) L1 address => L2 address" + }, + "l2Gateway()": { + "notice": "Address of the L2GraphTokenGateway" + }, + "l2WalletToL1Wallet(address)": { + "notice": "Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received) L2 address => L1 address" + }, + "onTokenTransfer(address,uint256,bytes)": { + "notice": "This function is called by the L2GraphTokenGateway when tokens are sent from L1." + }, + "removeTokenDestination(address)": { + "notice": "Removes an address that can be allowed by a token lock to pull funds" + }, + "setAuthFunctionCall(string,address)": { + "notice": "Sets an authorized function call to target" + }, + "setAuthFunctionCallMany(string[],address[])": { + "notice": "Sets an authorized function call to target in bulk" + }, + "setMasterCopy(address)": { + "notice": "Sets the masterCopy bytecode to use to create clones of TokenLock contracts" + }, + "token()": { + "notice": "Gets the GRT token address" + }, + "unsetAuthFunctionCall(string)": { + "notice": "Unsets an authorized function call to target" + }, + "withdraw(uint256)": { + "notice": "Withdraws tokens from the contract" + } + }, + "notice": "This contract manages a list of authorized function calls and targets that can be called by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts. This contract receives funds to make the process of creating TokenLockWallet contracts easier by distributing them the initial tokens to be managed. In particular, this L2 variant is designed to receive token lock wallets from L1, through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until the end of the vesting timeline, but they can allow withdrawing funds back to L1 using the L2GraphTokenLockTransferTool contract. The owner can setup a list of token destinations that will be used by TokenLock contracts to approve the pulling of funds, this way in can be guaranteed that only protocol contracts will manipulate users funds.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 672, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 3988, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "authFnCalls", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes4,t_address)" + }, + { + "astId": 3990, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_tokenDestinations", + "offset": 0, + "slot": "2", + "type": "t_struct(AddressSet)2629_storage" + }, + { + "astId": 3992, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "masterCopy", + "offset": 0, + "slot": "4", + "type": "t_address" + }, + { + "astId": 3994, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_token", + "offset": 0, + "slot": "5", + "type": "t_contract(IERC20)1710" + }, + { + "astId": 6135, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "l1WalletToL2Wallet", + "offset": 0, + "slot": "6", + "type": "t_mapping(t_address,t_address)" + }, + { + "astId": 6140, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "l2WalletToL1Wallet", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_address,t_address)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "base": "t_bytes32", + "encoding": "dynamic_array", + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes4": { + "encoding": "inplace", + "label": "bytes4", + "numberOfBytes": "4" + }, + "t_contract(IERC20)1710": { + "encoding": "inplace", + "label": "contract IERC20", + "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_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes4,t_address)": { + "encoding": "mapping", + "key": "t_bytes4", + "label": "mapping(bytes4 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_struct(AddressSet)2629_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.AddressSet", + "members": [ + { + "astId": 2628, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_inner", + "offset": 0, + "slot": "0", + "type": "t_struct(Set)2364_storage" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)2364_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.Set", + "members": [ + { + "astId": 2359, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_values", + "offset": 0, + "slot": "0", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "astId": 2363, + "contract": "contracts/L2GraphTokenLockManager.sol:L2GraphTokenLockManager", + "label": "_indexes", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/deployments/arbitrum-goerli/solcInputs/b33621afedc711c06b58b28e08a7cfc9.json b/deployments/arbitrum-goerli/solcInputs/b33621afedc711c06b58b28e08a7cfc9.json new file mode 100644 index 0000000..517a4d6 --- /dev/null +++ b/deployments/arbitrum-goerli/solcInputs/b33621afedc711c06b58b28e08a7cfc9.json @@ -0,0 +1,152 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\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 SafeMathUpgradeable {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, 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) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n\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 *\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 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 *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n return a - b;\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 *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) return 0;\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting 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 *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting 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 *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: modulo by zero\");\n return a % b;\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 * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n return a - b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryDiv}.\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 *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\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 *\n * - The divisor cannot be zero.\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" + }, + "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable-next-line compiler-version\npragma solidity >=0.4.24 <0.8.0;\n\nimport \"../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n */\nabstract contract 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 protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n require(_initializing || _isConstructor() || !_initialized, \"Initializable: contract 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 /// @dev Returns true if and only if the function is running in the constructor\n function _isConstructor() private view returns (bool) {\n return !AddressUpgradeable.isContract(address(this));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\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 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" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../utils/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 * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor () internal {\n address msgSender = _msgSender();\n _owner = msgSender;\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\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 virtual 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 virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "@openzeppelin/contracts/math/SafeMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\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, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, 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) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n\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 *\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 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 *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n return a - b;\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 *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) return 0;\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting 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 *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: division by zero\");\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting 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 *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b > 0, \"SafeMath: modulo by zero\");\n return a % b;\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 * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b <= a, errorMessage);\n return a - b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryDiv}.\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 *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n require(b > 0, errorMessage);\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\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 *\n * - The divisor cannot be zero.\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" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../../utils/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 {ERC20PresetMinterPauser}.\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 string private _name;\n string private _symbol;\n uint8 private _decimals;\n\n /**\n * @dev Sets the values for {name} and {symbol}, initializes {decimals} with\n * a default value of 18.\n *\n * To select a different value for {decimals}, use {_setupDecimals}.\n *\n * All three of these values are immutable: they can only be set once during\n * construction.\n */\n constructor (string memory name_, string memory symbol_) public {\n _name = name_;\n _symbol = symbol_;\n _decimals = 18;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5,05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is\n * called.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `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) public virtual override 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) public view virtual override 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) public virtual override 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 *\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) public virtual override 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 virtual 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 virtual 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 virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\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 virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\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 virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\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 internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(address owner, address spender, uint256 amount) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Sets {decimals} to a value other than the default one of 18.\n *\n * WARNING: This function should only be called from the constructor. Most\n * applications that interact with token contracts will not expect\n * {decimals} to ever change, and may work incorrectly if it does.\n */\n function _setupDecimals(uint8 decimals_) internal virtual {\n _decimals = decimals_;\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be to transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\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" + }, + "@openzeppelin/contracts/token/ERC20/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\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 IERC20;` 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 /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\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 from 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. We use {Address.functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\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" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <0.8.0;\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" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with 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 function _msgSender() internal view virtual returns (address payable) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual 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" + }, + "@openzeppelin/contracts/utils/Create2.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\n * `CREATE2` can be used to compute in advance the address where a smart\n * contract will be deployed, which allows for interesting new mechanisms known\n * as 'counterfactual interactions'.\n *\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\n * information.\n */\nlibrary Create2 {\n /**\n * @dev Deploys a contract using `CREATE2`. The address where the contract\n * will be deployed can be known in advance via {computeAddress}.\n *\n * The bytecode for a contract can be obtained from Solidity with\n * `type(contractName).creationCode`.\n *\n * Requirements:\n *\n * - `bytecode` must not be empty.\n * - `salt` must have not been used for `bytecode` already.\n * - the factory must have a balance of at least `amount`.\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\n */\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {\n address addr;\n require(address(this).balance >= amount, \"Create2: insufficient balance\");\n require(bytecode.length != 0, \"Create2: bytecode length is zero\");\n // solhint-disable-next-line no-inline-assembly\n assembly {\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n }\n require(addr != address(0), \"Create2: Failed on deploy\");\n return addr;\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\n * `bytecodeHash` or `salt` will result in a new destination address.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\n return computeAddress(salt, bytecodeHash, address(this));\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {\n bytes32 _data = keccak256(\n abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)\n );\n return address(uint160(uint256(_data)));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/EnumerableSet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <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/arbitrum/ITokenGateway.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2020, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-peripherals\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.6 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\ninterface ITokenGateway {\n /// @notice event deprecated in favor of DepositInitiated and WithdrawalInitiated\n // event OutboundTransferInitiated(\n // address token,\n // address indexed _from,\n // address indexed _to,\n // uint256 indexed _transferId,\n // uint256 _amount,\n // bytes _data\n // );\n\n /// @notice event deprecated in favor of DepositFinalized and WithdrawalFinalized\n // event InboundTransferFinalized(\n // address token,\n // address indexed _from,\n // address indexed _to,\n // uint256 indexed _transferId,\n // uint256 _amount,\n // bytes _data\n // );\n\n function outboundTransfer(\n address _token,\n address _to,\n uint256 _amount,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n bytes calldata _data\n ) external payable returns (bytes memory);\n\n function finalizeInboundTransfer(\n address _token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external payable;\n\n /**\n * @notice Calculate the address used when bridging an ERC20 token\n * @dev the L1 and L2 address oracles may not always be in sync.\n * For example, a custom token may have been registered but not deployed or the contract self destructed.\n * @param l1ERC20 address of L1 token\n * @return L2 address of a bridged ERC20 token\n */\n function calculateL2TokenAddress(address l1ERC20) external view returns (address);\n}\n" + }, + "contracts/GraphTokenDistributor.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\n/**\n * @title GraphTokenDistributor\n * @dev Contract that allows distribution of tokens to multiple beneficiaries.\n * The contract accept deposits in the configured token by anyone.\n * The owner can setup the desired distribution by setting the amount of tokens\n * assigned to each beneficiary account.\n * Beneficiaries claim for their allocated tokens.\n * Only the owner can withdraw tokens from this contract without limitations.\n * For the distribution to work this contract must be unlocked by the owner.\n */\ncontract GraphTokenDistributor is Ownable {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n // -- State --\n\n bool public locked;\n mapping(address => uint256) public beneficiaries;\n\n IERC20 public token;\n\n // -- Events --\n\n event BeneficiaryUpdated(address indexed beneficiary, uint256 amount);\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n event TokensClaimed(address indexed beneficiary, address to, uint256 amount);\n event LockUpdated(bool locked);\n\n modifier whenNotLocked() {\n require(locked == false, \"Distributor: Claim is locked\");\n _;\n }\n\n /**\n * Constructor.\n * @param _token Token to use for deposits and withdrawals\n */\n constructor(IERC20 _token) {\n token = _token;\n locked = true;\n }\n\n /**\n * Deposit tokens into the contract.\n * Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external {\n token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n // -- Admin functions --\n\n /**\n * Add token balance available for account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function addBeneficiaryTokens(address _account, uint256 _amount) external onlyOwner {\n _setBeneficiaryTokens(_account, beneficiaries[_account].add(_amount));\n }\n\n /**\n * Add token balance available for multiple accounts.\n * @param _accounts Addresses to assign tokens to\n * @param _amounts Amounts of tokens to assign to beneficiary\n */\n function addBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner {\n require(_accounts.length == _amounts.length, \"Distributor: !length\");\n for (uint256 i = 0; i < _accounts.length; i++) {\n _setBeneficiaryTokens(_accounts[i], beneficiaries[_accounts[i]].add(_amounts[i]));\n }\n }\n\n /**\n * Remove token balance available for account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function subBeneficiaryTokens(address _account, uint256 _amount) external onlyOwner {\n _setBeneficiaryTokens(_account, beneficiaries[_account].sub(_amount));\n }\n\n /**\n * Remove token balance available for multiple accounts.\n * @param _accounts Addresses to assign tokens to\n * @param _amounts Amounts of tokens to assign to beneficiary\n */\n function subBeneficiaryTokensMulti(address[] calldata _accounts, uint256[] calldata _amounts) external onlyOwner {\n require(_accounts.length == _amounts.length, \"Distributor: !length\");\n for (uint256 i = 0; i < _accounts.length; i++) {\n _setBeneficiaryTokens(_accounts[i], beneficiaries[_accounts[i]].sub(_amounts[i]));\n }\n }\n\n /**\n * Set amount of tokens available for beneficiary account.\n * @param _account Address to assign tokens to\n * @param _amount Amount of tokens to assign to beneficiary\n */\n function _setBeneficiaryTokens(address _account, uint256 _amount) private {\n require(_account != address(0), \"Distributor: !account\");\n\n beneficiaries[_account] = _amount;\n emit BeneficiaryUpdated(_account, _amount);\n }\n\n /**\n * Set locked withdrawals.\n * @param _locked True to lock withdrawals\n */\n function setLocked(bool _locked) external onlyOwner {\n locked = _locked;\n emit LockUpdated(_locked);\n }\n\n /**\n * Withdraw tokens from the contract. This function is included as\n * a escape hatch in case of mistakes or to recover remaining funds.\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external onlyOwner {\n token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Beneficiary functions --\n\n /**\n * Claim tokens and send to caller.\n */\n function claim() external whenNotLocked {\n claimTo(msg.sender);\n }\n\n /**\n * Claim tokens and send to address.\n * @param _to Address where to send tokens\n */\n function claimTo(address _to) public whenNotLocked {\n uint256 claimableTokens = beneficiaries[msg.sender];\n require(claimableTokens > 0, \"Distributor: Unavailable funds\");\n\n _setBeneficiaryTokens(msg.sender, 0);\n\n token.safeTransfer(_to, claimableTokens);\n emit TokensClaimed(msg.sender, _to, claimableTokens);\n }\n}\n" + }, + "contracts/GraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport { Ownable as OwnableInitializable } from \"./Ownable.sol\";\nimport \"./MathUtils.sol\";\nimport \"./IGraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLock\n * @notice Contract that manages an unlocking schedule of tokens.\n * @dev The contract lock manage a number of tokens deposited into the contract to ensure that\n * they can only be released under certain time conditions.\n *\n * This contract implements a release scheduled based on periods and tokens are released in steps\n * after each period ends. It can be configured with one period in which case it is like a plain TimeLock.\n * It also supports revocation to be used for vesting schedules.\n *\n * The contract supports receiving extra funds than the managed tokens ones that can be\n * withdrawn by the beneficiary at any time.\n *\n * A releaseStartTime parameter is included to override the default release schedule and\n * perform the first release on the configured time. After that it will continue with the\n * default schedule.\n */\nabstract contract GraphTokenLock is OwnableInitializable, IGraphTokenLock {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n uint256 private constant MIN_PERIOD = 1;\n\n // -- State --\n\n IERC20 public token;\n address public beneficiary;\n\n // Configuration\n\n // Amount of tokens managed by the contract schedule\n uint256 public managedAmount;\n\n uint256 public startTime; // Start datetime (in unixtimestamp)\n uint256 public endTime; // Datetime after all funds are fully vested/unlocked (in unixtimestamp)\n uint256 public periods; // Number of vesting/release periods\n\n // First release date for tokens (in unixtimestamp)\n // If set, no tokens will be released before releaseStartTime ignoring\n // the amount to release each period\n uint256 public releaseStartTime;\n // A cliff set a date to which a beneficiary needs to get to vest\n // all preceding periods\n uint256 public vestingCliffTime;\n Revocability public revocable; // Whether to use vesting for locked funds\n\n // State\n\n bool public isRevoked;\n bool public isInitialized;\n bool public isAccepted;\n uint256 public releasedAmount;\n uint256 public revokedAmount;\n\n // -- Events --\n\n event TokensReleased(address indexed beneficiary, uint256 amount);\n event TokensWithdrawn(address indexed beneficiary, uint256 amount);\n event TokensRevoked(address indexed beneficiary, uint256 amount);\n event BeneficiaryChanged(address newBeneficiary);\n event LockAccepted();\n event LockCanceled();\n\n /**\n * @dev Only allow calls from the beneficiary of the contract\n */\n modifier onlyBeneficiary() {\n require(msg.sender == beneficiary, \"!auth\");\n _;\n }\n\n /**\n * @notice Initializes the contract\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _vestingCliffTime Override time for when the vesting start\n * @param _revocable Whether the contract is revocable\n */\n function _initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) internal {\n require(!isInitialized, \"Already initialized\");\n require(_owner != address(0), \"Owner cannot be zero\");\n require(_beneficiary != address(0), \"Beneficiary cannot be zero\");\n require(_token != address(0), \"Token cannot be zero\");\n require(_managedAmount > 0, \"Managed tokens cannot be zero\");\n require(_startTime != 0, \"Start time must be set\");\n require(_startTime < _endTime, \"Start time > end time\");\n require(_periods >= MIN_PERIOD, \"Periods cannot be below minimum\");\n require(_revocable != Revocability.NotSet, \"Must set a revocability option\");\n require(_releaseStartTime < _endTime, \"Release start time must be before end time\");\n require(_vestingCliffTime < _endTime, \"Cliff time must be before end time\");\n\n isInitialized = true;\n\n OwnableInitializable._initialize(_owner);\n beneficiary = _beneficiary;\n token = IERC20(_token);\n\n managedAmount = _managedAmount;\n\n startTime = _startTime;\n endTime = _endTime;\n periods = _periods;\n\n // Optionals\n releaseStartTime = _releaseStartTime;\n vestingCliffTime = _vestingCliffTime;\n revocable = _revocable;\n }\n\n /**\n * @notice Change the beneficiary of funds managed by the contract\n * @dev Can only be called by the beneficiary\n * @param _newBeneficiary Address of the new beneficiary address\n */\n function changeBeneficiary(address _newBeneficiary) external onlyBeneficiary {\n require(_newBeneficiary != address(0), \"Empty beneficiary\");\n beneficiary = _newBeneficiary;\n emit BeneficiaryChanged(_newBeneficiary);\n }\n\n /**\n * @notice Beneficiary accepts the lock, the owner cannot retrieve back the tokens\n * @dev Can only be called by the beneficiary\n */\n function acceptLock() external onlyBeneficiary {\n isAccepted = true;\n emit LockAccepted();\n }\n\n /**\n * @notice Owner cancel the lock and return the balance in the contract\n * @dev Can only be called by the owner\n */\n function cancelLock() external onlyOwner {\n require(isAccepted == false, \"Cannot cancel accepted contract\");\n\n token.safeTransfer(owner(), currentBalance());\n\n emit LockCanceled();\n }\n\n // -- Balances --\n\n /**\n * @notice Returns the amount of tokens currently held by the contract\n * @return Tokens held in the contract\n */\n function currentBalance() public view override returns (uint256) {\n return token.balanceOf(address(this));\n }\n\n // -- Time & Periods --\n\n /**\n * @notice Returns the current block timestamp\n * @return Current block timestamp\n */\n function currentTime() public view override returns (uint256) {\n return block.timestamp;\n }\n\n /**\n * @notice Gets duration of contract from start to end in seconds\n * @return Amount of seconds from contract startTime to endTime\n */\n function duration() public view override returns (uint256) {\n return endTime.sub(startTime);\n }\n\n /**\n * @notice Gets time elapsed since the start of the contract\n * @dev Returns zero if called before conctract starTime\n * @return Seconds elapsed from contract startTime\n */\n function sinceStartTime() public view override returns (uint256) {\n uint256 current = currentTime();\n if (current <= startTime) {\n return 0;\n }\n return current.sub(startTime);\n }\n\n /**\n * @notice Returns amount available to be released after each period according to schedule\n * @return Amount of tokens available after each period\n */\n function amountPerPeriod() public view override returns (uint256) {\n return managedAmount.div(periods);\n }\n\n /**\n * @notice Returns the duration of each period in seconds\n * @return Duration of each period in seconds\n */\n function periodDuration() public view override returns (uint256) {\n return duration().div(periods);\n }\n\n /**\n * @notice Gets the current period based on the schedule\n * @return A number that represents the current period\n */\n function currentPeriod() public view override returns (uint256) {\n return sinceStartTime().div(periodDuration()).add(MIN_PERIOD);\n }\n\n /**\n * @notice Gets the number of periods that passed since the first period\n * @return A number of periods that passed since the schedule started\n */\n function passedPeriods() public view override returns (uint256) {\n return currentPeriod().sub(MIN_PERIOD);\n }\n\n // -- Locking & Release Schedule --\n\n /**\n * @notice Gets the currently available token according to the schedule\n * @dev Implements the step-by-step schedule based on periods for available tokens\n * @return Amount of tokens available according to the schedule\n */\n function availableAmount() public view override returns (uint256) {\n uint256 current = currentTime();\n\n // Before contract start no funds are available\n if (current < startTime) {\n return 0;\n }\n\n // After contract ended all funds are available\n if (current > endTime) {\n return managedAmount;\n }\n\n // Get available amount based on period\n return passedPeriods().mul(amountPerPeriod());\n }\n\n /**\n * @notice Gets the amount of currently vested tokens\n * @dev Similar to available amount, but is fully vested when contract is non-revocable\n * @return Amount of tokens already vested\n */\n function vestedAmount() public view override returns (uint256) {\n // If non-revocable it is fully vested\n if (revocable == Revocability.Disabled) {\n return managedAmount;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n if (vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n return availableAmount();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule and takes into account already released tokens\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public view virtual override returns (uint256) {\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n uint256 releasable = availableAmount().sub(releasedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Gets the outstanding amount yet to be released based on the whole contract lifetime\n * @dev Does not consider schedule but just global amounts tracked\n * @return Amount of outstanding tokens for the lifetime of the contract\n */\n function totalOutstandingAmount() public view override returns (uint256) {\n return managedAmount.sub(releasedAmount).sub(revokedAmount);\n }\n\n /**\n * @notice Gets surplus amount in the contract based on outstanding amount to release\n * @dev All funds over outstanding amount is considered surplus that can be withdrawn by beneficiary.\n * Note this might not be the correct value for wallets transferred to L2 (i.e. an L2GraphTokenLockWallet), as the released amount will be\n * skewed, so the beneficiary might have to bridge back to L1 to release the surplus.\n * @return Amount of tokens considered as surplus\n */\n function surplusAmount() public view override returns (uint256) {\n uint256 balance = currentBalance();\n uint256 outstandingAmount = totalOutstandingAmount();\n if (balance > outstandingAmount) {\n return balance.sub(outstandingAmount);\n }\n return 0;\n }\n\n // -- Value Transfer --\n\n /**\n * @notice Releases tokens based on the configured schedule\n * @dev All available releasable tokens are transferred to beneficiary\n */\n function release() external override onlyBeneficiary {\n uint256 amountToRelease = releasableAmount();\n require(amountToRelease > 0, \"No available releasable amount\");\n\n releasedAmount = releasedAmount.add(amountToRelease);\n\n token.safeTransfer(beneficiary, amountToRelease);\n\n emit TokensReleased(beneficiary, amountToRelease);\n }\n\n /**\n * @notice Withdraws surplus, unmanaged tokens from the contract\n * @dev Tokens in the contract over outstanding amount are considered as surplus\n * @param _amount Amount of tokens to withdraw\n */\n function withdrawSurplus(uint256 _amount) external override onlyBeneficiary {\n require(_amount > 0, \"Amount cannot be zero\");\n require(surplusAmount() >= _amount, \"Amount requested > surplus available\");\n\n token.safeTransfer(beneficiary, _amount);\n\n emit TokensWithdrawn(beneficiary, _amount);\n }\n\n /**\n * @notice Revokes a vesting schedule and return the unvested tokens to the owner\n * @dev Vesting schedule is always calculated based on managed tokens\n */\n function revoke() external override onlyOwner {\n require(revocable == Revocability.Enabled, \"Contract is non-revocable\");\n require(isRevoked == false, \"Already revoked\");\n\n uint256 unvestedAmount = managedAmount.sub(vestedAmount());\n require(unvestedAmount > 0, \"No available unvested amount\");\n\n revokedAmount = unvestedAmount;\n isRevoked = true;\n\n token.safeTransfer(owner(), unvestedAmount);\n\n emit TokensRevoked(beneficiary, unvestedAmount);\n }\n}\n" + }, + "contracts/GraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/utils/EnumerableSet.sol\";\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\n\nimport \"./MinimalProxyFactory.sol\";\nimport \"./IGraphTokenLockManager.sol\";\nimport { GraphTokenLockWallet } from \"./GraphTokenLockWallet.sol\";\n\n/**\n * @title GraphTokenLockManager\n * @notice This contract manages a list of authorized function calls and targets that can be called\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\n *\n * This contract receives funds to make the process of creating TokenLockWallet contracts\n * easier by distributing them the initial tokens to be managed.\n *\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\n * will manipulate users funds.\n */\ncontract GraphTokenLockManager is Ownable, MinimalProxyFactory, IGraphTokenLockManager {\n using SafeERC20 for IERC20;\n using EnumerableSet for EnumerableSet.AddressSet;\n\n // -- State --\n\n mapping(bytes4 => address) public authFnCalls;\n EnumerableSet.AddressSet private _tokenDestinations;\n\n address public masterCopy;\n IERC20 internal _token;\n\n // -- Events --\n\n event MasterCopyUpdated(address indexed masterCopy);\n event TokenLockCreated(\n address indexed contractAddress,\n bytes32 indexed initHash,\n address indexed beneficiary,\n address token,\n uint256 managedAmount,\n uint256 startTime,\n uint256 endTime,\n uint256 periods,\n uint256 releaseStartTime,\n uint256 vestingCliffTime,\n IGraphTokenLock.Revocability revocable\n );\n\n event TokensDeposited(address indexed sender, uint256 amount);\n event TokensWithdrawn(address indexed sender, uint256 amount);\n\n event FunctionCallAuth(address indexed caller, bytes4 indexed sigHash, address indexed target, string signature);\n event TokenDestinationAllowed(address indexed dst, bool allowed);\n\n /**\n * Constructor.\n * @param _graphToken Token to use for deposits and withdrawals\n * @param _masterCopy Address of the master copy to use to clone proxies\n */\n constructor(IERC20 _graphToken, address _masterCopy) {\n require(address(_graphToken) != address(0), \"Token cannot be zero\");\n _token = _graphToken;\n setMasterCopy(_masterCopy);\n }\n\n // -- Factory --\n\n /**\n * @notice Sets the masterCopy bytecode to use to create clones of TokenLock contracts\n * @param _masterCopy Address of contract bytecode to factory clone\n */\n function setMasterCopy(address _masterCopy) public override onlyOwner {\n require(_masterCopy != address(0), \"MasterCopy cannot be zero\");\n masterCopy = _masterCopy;\n emit MasterCopyUpdated(_masterCopy);\n }\n\n /**\n * @notice Creates and fund a new token lock wallet using a minimum proxy\n * @param _owner Address of the contract owner\n * @param _beneficiary Address of the beneficiary of locked tokens\n * @param _managedAmount Amount of tokens to be managed by the lock contract\n * @param _startTime Start time of the release schedule\n * @param _endTime End time of the release schedule\n * @param _periods Number of periods between start time and end time\n * @param _releaseStartTime Override time for when the releases start\n * @param _revocable Whether the contract is revocable\n */\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external override onlyOwner {\n require(_token.balanceOf(address(this)) >= _managedAmount, \"Not enough tokens to create lock\");\n\n // Create contract using a minimal proxy and call initializer\n bytes memory initializer = abi.encodeWithSelector(\n GraphTokenLockWallet.initialize.selector,\n address(this),\n _owner,\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n address contractAddress = _deployProxy2(keccak256(initializer), masterCopy, initializer);\n\n // Send managed amount to the created contract\n _token.safeTransfer(contractAddress, _managedAmount);\n\n emit TokenLockCreated(\n contractAddress,\n keccak256(initializer),\n _beneficiary,\n address(_token),\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n\n // -- Funds Management --\n\n /**\n * @notice Gets the GRT token address\n * @return Token used for transfers and approvals\n */\n function token() external view override returns (IERC20) {\n return _token;\n }\n\n /**\n * @notice Deposits tokens into the contract\n * @dev Even if the ERC20 token can be transferred directly to the contract\n * this function provide a safe interface to do the transfer and avoid mistakes\n * @param _amount Amount to deposit\n */\n function deposit(uint256 _amount) external override {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransferFrom(msg.sender, address(this), _amount);\n emit TokensDeposited(msg.sender, _amount);\n }\n\n /**\n * @notice Withdraws tokens from the contract\n * @dev Escape hatch in case of mistakes or to recover remaining funds\n * @param _amount Amount of tokens to withdraw\n */\n function withdraw(uint256 _amount) external override onlyOwner {\n require(_amount > 0, \"Amount cannot be zero\");\n _token.safeTransfer(msg.sender, _amount);\n emit TokensWithdrawn(msg.sender, _amount);\n }\n\n // -- Token Destinations --\n\n /**\n * @notice Adds an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function addTokenDestination(address _dst) external override onlyOwner {\n require(_dst != address(0), \"Destination cannot be zero\");\n require(_tokenDestinations.add(_dst), \"Destination already added\");\n emit TokenDestinationAllowed(_dst, true);\n }\n\n /**\n * @notice Removes an address that can be allowed by a token lock to pull funds\n * @param _dst Destination address\n */\n function removeTokenDestination(address _dst) external override onlyOwner {\n require(_tokenDestinations.remove(_dst), \"Destination already removed\");\n emit TokenDestinationAllowed(_dst, false);\n }\n\n /**\n * @notice Returns True if the address is authorized to be a destination of tokens\n * @param _dst Destination address\n * @return True if authorized\n */\n function isTokenDestination(address _dst) external view override returns (bool) {\n return _tokenDestinations.contains(_dst);\n }\n\n /**\n * @notice Returns an array of authorized destination addresses\n * @return Array of addresses authorized to pull funds from a token lock\n */\n function getTokenDestinations() external view override returns (address[] memory) {\n address[] memory dstList = new address[](_tokenDestinations.length());\n for (uint256 i = 0; i < _tokenDestinations.length(); i++) {\n dstList[i] = _tokenDestinations.at(i);\n }\n return dstList;\n }\n\n // -- Function Call Authorization --\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function setAuthFunctionCall(string calldata _signature, address _target) external override onlyOwner {\n _setAuthFunctionCall(_signature, _target);\n }\n\n /**\n * @notice Unsets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signature Function signature\n */\n function unsetAuthFunctionCall(string calldata _signature) external override onlyOwner {\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = address(0);\n\n emit FunctionCallAuth(msg.sender, sigHash, address(0), _signature);\n }\n\n /**\n * @notice Sets an authorized function call to target in bulk\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @param _signatures Function signatures\n * @param _targets Address of the destination contract to call\n */\n function setAuthFunctionCallMany(\n string[] calldata _signatures,\n address[] calldata _targets\n ) external override onlyOwner {\n require(_signatures.length == _targets.length, \"Array length mismatch\");\n\n for (uint256 i = 0; i < _signatures.length; i++) {\n _setAuthFunctionCall(_signatures[i], _targets[i]);\n }\n }\n\n /**\n * @notice Sets an authorized function call to target\n * @dev Input expected is the function signature as 'transfer(address,uint256)'\n * @dev Function signatures of Graph Protocol contracts to be used are known ahead of time\n * @param _signature Function signature\n * @param _target Address of the destination contract to call\n */\n function _setAuthFunctionCall(string calldata _signature, address _target) internal {\n require(_target != address(this), \"Target must be other contract\");\n require(Address.isContract(_target), \"Target must be a contract\");\n\n bytes4 sigHash = _toFunctionSigHash(_signature);\n authFnCalls[sigHash] = _target;\n\n emit FunctionCallAuth(msg.sender, sigHash, _target, _signature);\n }\n\n /**\n * @notice Gets the target contract to call for a particular function signature\n * @param _sigHash Function signature hash\n * @return Address of the target contract where to send the call\n */\n function getAuthFunctionCallTarget(bytes4 _sigHash) public view override returns (address) {\n return authFnCalls[_sigHash];\n }\n\n /**\n * @notice Returns true if the function call is authorized\n * @param _sigHash Function signature hash\n * @return True if authorized\n */\n function isAuthFunctionCall(bytes4 _sigHash) external view override returns (bool) {\n return getAuthFunctionCallTarget(_sigHash) != address(0);\n }\n\n /**\n * @dev Converts a function signature string to 4-bytes hash\n * @param _signature Function signature string\n * @return Function signature hash\n */\n function _toFunctionSigHash(string calldata _signature) internal pure returns (bytes4) {\n return _convertToBytes4(abi.encodeWithSignature(_signature));\n }\n\n /**\n * @dev Converts function signature bytes to function signature hash (bytes4)\n * @param _signature Function signature\n * @return Function signature in bytes4\n */\n function _convertToBytes4(bytes memory _signature) internal pure returns (bytes4) {\n require(_signature.length == 4, \"Invalid method signature\");\n bytes4 sigHash;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sigHash := mload(add(_signature, 32))\n }\n return sigHash;\n }\n}\n" + }, + "contracts/GraphTokenLockSimple.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"./GraphTokenLock.sol\";\n\n/**\n * @title GraphTokenLockSimple\n * @notice This contract is the concrete simple implementation built on top of the base\n * GraphTokenLock functionality for use when we only need the token lock schedule\n * features but no interaction with the network.\n *\n * This contract is designed to be deployed without the use of a TokenManager.\n */\ncontract GraphTokenLockSimple is GraphTokenLock {\n // Constructor\n constructor() {\n OwnableInitializable._initialize(msg.sender);\n }\n\n // Initializer\n function initialize(\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external onlyOwner {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n }\n}\n" + }, + "contracts/GraphTokenLockWallet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./GraphTokenLock.sol\";\nimport \"./IGraphTokenLockManager.sol\";\n\n/**\n * @title GraphTokenLockWallet\n * @notice This contract is built on top of the base GraphTokenLock functionality.\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\n * on specific contracts.\n *\n * The idea is that supporters with locked tokens can participate in the protocol\n * but disallow any release before the vesting/lock schedule.\n * The beneficiary can issue authorized function calls to this contract that will\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\n * The function calls allowed are queried to the GraphTokenLockManager, this way\n * the same configuration can be shared for all the created lock wallet contracts.\n *\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\n * with any of this contract functions.\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\n * the maximum amount of tokens is authorized.\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\n */\ncontract GraphTokenLockWallet is GraphTokenLock {\n using SafeMath for uint256;\n\n // -- State --\n\n IGraphTokenLockManager public manager;\n uint256 public usedAmount;\n\n // -- Events --\n\n event ManagerUpdated(address indexed _oldManager, address indexed _newManager);\n event TokenDestinationsApproved();\n event TokenDestinationsRevoked();\n\n // Initializer\n function initialize(\n address _manager,\n address _owner,\n address _beneficiary,\n address _token,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n Revocability _revocable\n ) external {\n _initialize(\n _owner,\n _beneficiary,\n _token,\n _managedAmount,\n _startTime,\n _endTime,\n _periods,\n _releaseStartTime,\n _vestingCliffTime,\n _revocable\n );\n _setManager(_manager);\n }\n\n // -- Admin --\n\n /**\n * @notice Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function setManager(address _newManager) external onlyOwner {\n _setManager(_newManager);\n }\n\n /**\n * @dev Sets a new manager for this contract\n * @param _newManager Address of the new manager\n */\n function _setManager(address _newManager) internal {\n require(_newManager != address(0), \"Manager cannot be empty\");\n require(Address.isContract(_newManager), \"Manager must be a contract\");\n\n address oldManager = address(manager);\n manager = IGraphTokenLockManager(_newManager);\n\n emit ManagerUpdated(oldManager, _newManager);\n }\n\n // -- Beneficiary --\n\n /**\n * @notice Approves protocol access of the tokens managed by this contract\n * @dev Approves all token destinations registered in the manager to pull tokens\n */\n function approveProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n // Note this is only safe because we are using the max uint256 value\n token.approve(dstList[i], type(uint256).max);\n }\n emit TokenDestinationsApproved();\n }\n\n /**\n * @notice Revokes protocol access of the tokens managed by this contract\n * @dev Revokes approval to all token destinations in the manager to pull tokens\n */\n function revokeProtocol() external onlyBeneficiary {\n address[] memory dstList = manager.getTokenDestinations();\n for (uint256 i = 0; i < dstList.length; i++) {\n // Note this is only safe cause we're using 0 as the amount\n token.approve(dstList[i], 0);\n }\n emit TokenDestinationsRevoked();\n }\n\n /**\n * @notice Gets tokens currently available for release\n * @dev Considers the schedule, takes into account already released tokens and used amount\n * @return Amount of tokens ready to be released\n */\n function releasableAmount() public view override returns (uint256) {\n if (revocable == Revocability.Disabled) {\n return super.releasableAmount();\n }\n\n // -- Revocability enabled logic\n // This needs to deal with additional considerations for when tokens are used in the protocol\n\n // If a release start time is set no tokens are available for release before this date\n // If not set it follows the default schedule and tokens are available on\n // the first period passed\n if (releaseStartTime > 0 && currentTime() < releaseStartTime) {\n return 0;\n }\n\n // Vesting cliff is activated and it has not passed means nothing is vested yet\n // so funds cannot be released\n if (revocable == Revocability.Enabled && vestingCliffTime > 0 && currentTime() < vestingCliffTime) {\n return 0;\n }\n\n // A beneficiary can never have more releasable tokens than the contract balance\n // We consider the `usedAmount` in the protocol as part of the calculations\n // the beneficiary should not release funds that are used.\n uint256 releasable = availableAmount().sub(releasedAmount).sub(usedAmount);\n return MathUtils.min(currentBalance(), releasable);\n }\n\n /**\n * @notice Forward authorized contract calls to protocol contracts\n * @dev Fallback function can be called by the beneficiary only if function call is allowed\n */\n // solhint-disable-next-line no-complex-fallback\n fallback() external payable {\n // Only beneficiary can forward calls\n require(msg.sender == beneficiary, \"Unauthorized caller\");\n require(msg.value == 0, \"ETH transfers not supported\");\n\n // Function call validation\n address _target = manager.getAuthFunctionCallTarget(msg.sig);\n require(_target != address(0), \"Unauthorized function\");\n\n uint256 oldBalance = currentBalance();\n\n // Call function with data\n Address.functionCall(_target, msg.data);\n\n // Tracked used tokens in the protocol\n // We do this check after balances were updated by the forwarded call\n // Check is only enforced for revocable contracts to save some gas\n if (revocable == Revocability.Enabled) {\n // Track contract balance change\n uint256 newBalance = currentBalance();\n if (newBalance < oldBalance) {\n // Outflow\n uint256 diff = oldBalance.sub(newBalance);\n usedAmount = usedAmount.add(diff);\n } else {\n // Inflow: We can receive profits from the protocol, that could make usedAmount to\n // underflow. We set it to zero in that case.\n uint256 diff = newBalance.sub(oldBalance);\n usedAmount = (diff >= usedAmount) ? 0 : usedAmount.sub(diff);\n }\n require(usedAmount <= vestedAmount(), \"Cannot use more tokens than vested amount\");\n }\n }\n\n /**\n * @notice Receive function that always reverts.\n * @dev Only included to supress warnings, see https://github.com/ethereum/solidity/issues/10159\n */\n receive() external payable {\n revert(\"Bad call\");\n }\n}\n" + }, + "contracts/ICallhookReceiver.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\n// Copied from graphprotocol/contracts, changed solidity version to 0.7.3\n\n/**\n * @title Interface for contracts that can receive callhooks through the Arbitrum GRT bridge\n * @dev Any contract that can receive a callhook on L2, sent through the bridge from L1, must\n * be allowlisted by the governor, but also implement this interface that contains\n * the function that will actually be called by the L2GraphTokenGateway.\n */\npragma solidity ^0.7.3;\n\ninterface ICallhookReceiver {\n /**\n * @notice Receive tokens with a callhook from the bridge\n * @param _from Token sender in L1\n * @param _amount Amount of tokens that were transferred\n * @param _data ABI-encoded callhook data\n */\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external;\n}\n" + }, + "contracts/IGraphTokenLock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IGraphTokenLock {\n enum Revocability {\n NotSet,\n Enabled,\n Disabled\n }\n\n // -- Balances --\n\n function currentBalance() external view returns (uint256);\n\n // -- Time & Periods --\n\n function currentTime() external view returns (uint256);\n\n function duration() external view returns (uint256);\n\n function sinceStartTime() external view returns (uint256);\n\n function amountPerPeriod() external view returns (uint256);\n\n function periodDuration() external view returns (uint256);\n\n function currentPeriod() external view returns (uint256);\n\n function passedPeriods() external view returns (uint256);\n\n // -- Locking & Release Schedule --\n\n function availableAmount() external view returns (uint256);\n\n function vestedAmount() external view returns (uint256);\n\n function releasableAmount() external view returns (uint256);\n\n function totalOutstandingAmount() external view returns (uint256);\n\n function surplusAmount() external view returns (uint256);\n\n // -- Value Transfer --\n\n function release() external;\n\n function withdrawSurplus(uint256 _amount) external;\n\n function revoke() external;\n}\n" + }, + "contracts/IGraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./IGraphTokenLock.sol\";\n\ninterface IGraphTokenLockManager {\n // -- Factory --\n\n function setMasterCopy(address _masterCopy) external;\n\n function createTokenLockWallet(\n address _owner,\n address _beneficiary,\n uint256 _managedAmount,\n uint256 _startTime,\n uint256 _endTime,\n uint256 _periods,\n uint256 _releaseStartTime,\n uint256 _vestingCliffTime,\n IGraphTokenLock.Revocability _revocable\n ) external;\n\n // -- Funds Management --\n\n function token() external returns (IERC20);\n\n function deposit(uint256 _amount) external;\n\n function withdraw(uint256 _amount) external;\n\n // -- Allowed Funds Destinations --\n\n function addTokenDestination(address _dst) external;\n\n function removeTokenDestination(address _dst) external;\n\n function isTokenDestination(address _dst) external view returns (bool);\n\n function getTokenDestinations() external view returns (address[] memory);\n\n // -- Function Call Authorization --\n\n function setAuthFunctionCall(string calldata _signature, address _target) external;\n\n function unsetAuthFunctionCall(string calldata _signature) external;\n\n function setAuthFunctionCallMany(string[] calldata _signatures, address[] calldata _targets) external;\n\n function getAuthFunctionCallTarget(bytes4 _sigHash) external view returns (address);\n\n function isAuthFunctionCall(bytes4 _sigHash) external view returns (bool);\n}\n" + }, + "contracts/L1GraphTokenLockTransferTool.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { AddressUpgradeable } from \"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\";\nimport { ITokenGateway } from \"./arbitrum/ITokenGateway.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { L2GraphTokenLockManager } from \"./L2GraphTokenLockManager.sol\";\nimport { GraphTokenLockWallet } from \"./GraphTokenLockWallet.sol\";\nimport { MinimalProxyFactory } from \"./MinimalProxyFactory.sol\";\nimport { IGraphTokenLock } from \"./IGraphTokenLock.sol\";\nimport { Ownable as OwnableInitializable } from \"./Ownable.sol\";\nimport { SafeMathUpgradeable } from \"@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol\";\nimport { Initializable } from \"@openzeppelin/contracts-upgradeable/proxy/Initializable.sol\";\n\n/**\n * @title L1GraphTokenLockTransferTool contract\n * @notice This contract is used to transfer GRT from GraphTokenLockWallets\n * to a counterpart on L2. It is deployed on L1 and will send the GRT through\n * the L1GraphTokenGateway with a callhook to the L2GraphTokenLockManager, including\n * data to create a L2GraphTokenLockWallet on L2.\n *\n * Note that the L2GraphTokenLockWallet will not allow releasing any GRT until the end of\n * the vesting timeline, but will allow sending the GRT back to the L1 wallet.\n *\n * Beneficiaries for a GraphTokenLockWallet can perform the depositToL2Locked call\n * as many times as they want, and the GRT will be sent to the same L2GraphTokenLockWallet.\n *\n * Since all retryable tickets to send transactions to L2 require ETH for gas, this\n * contract also allows users to deposit ETH to be used for gas on L2, both for\n * the depositToL2Locked calls and for the transfer tools in the Staking contract for\n * The Graph.\n *\n * See GIP-0046 for more details: https://forum.thegraph.com/t/4023\n */\ncontract L1GraphTokenLockTransferTool is OwnableInitializable, Initializable, MinimalProxyFactory {\n using SafeMathUpgradeable for uint256;\n\n /// Address of the L1 GRT token contract\n IERC20 public immutable graphToken;\n /// Address of the L2GraphTokenLockWallet implementation in L2, used to compute L2 wallet addresses\n address public immutable l2Implementation;\n /// Address of the L1GraphTokenGateway contract\n ITokenGateway public immutable l1Gateway;\n /// Address of the Staking contract, used to pull ETH for L2 ticket gas\n address payable public immutable staking;\n /// L2 lock manager for each L1 lock manager.\n /// L1 GraphTokenLockManager => L2GraphTokenLockManager\n mapping(address => address) public l2LockManager;\n /// L2 wallet owner for each L1 wallet owner.\n /// L1 wallet owner => L2 wallet owner\n mapping(address => address) public l2WalletOwner;\n /// L2 wallet address for each L1 wallet address.\n /// L1 wallet => L2 wallet\n mapping(address => address) public l2WalletAddress;\n /// ETH balance from each token lock, used to pay for L2 gas:\n /// L1 wallet address => ETH balance\n mapping(address => uint256) public tokenLockETHBalances;\n /// L2 beneficiary corresponding to each L1 wallet address.\n /// L1 wallet => L2 beneficiary\n mapping(address => address) public l2Beneficiary;\n /// Indicates whether an L2 wallet address for a wallet\n /// has been set manually, in which case it can't call depositToL2Locked.\n /// L1 wallet => bool\n mapping(address => bool) public l2WalletAddressSetManually;\n\n /// @dev Emitted when the L2 lock manager for an L1 lock manager is set\n event L2LockManagerSet(address indexed l1LockManager, address indexed l2LockManager);\n /// @dev Emitted when the L2 wallet owner for an L1 wallet owner is set\n event L2WalletOwnerSet(address indexed l1WalletOwner, address indexed l2WalletOwner);\n /// @dev Emitted when GRT is sent to L2 from a token lock\n event LockedFundsSentToL2(\n address indexed l1Wallet,\n address indexed l2Wallet,\n address indexed l1LockManager,\n address l2LockManager,\n uint256 amount\n );\n /// @dev Emitted when an L2 wallet address is set for an L1 wallet\n event L2WalletAddressSet(address indexed l1Wallet, address indexed l2Wallet);\n /// @dev Emitted when ETH is deposited to a token lock's account\n event ETHDeposited(address indexed tokenLock, uint256 amount);\n /// @dev Emitted when ETH is withdrawn from a token lock's account\n event ETHWithdrawn(address indexed tokenLock, address indexed destination, uint256 amount);\n /// @dev Emitted when ETH is pulled from a token lock's account by the Staking contract\n event ETHPulled(address indexed tokenLock, uint256 amount);\n\n /**\n * @notice Construct a new L1GraphTokenLockTransferTool contract\n * @dev The deployer of the contract will become its owner.\n * Note this contract is meant to be deployed behind a transparent proxy,\n * so this will run at the implementation's storage context; it will set\n * immutable variables and make the implementation be owned by the deployer.\n * @param _graphToken Address of the L1 GRT token contract\n * @param _l2Implementation Address of the L2GraphTokenLockWallet implementation in L2\n * @param _l1Gateway Address of the L1GraphTokenGateway contract\n * @param _staking Address of the Staking contract\n */\n constructor(\n IERC20 _graphToken,\n address _l2Implementation,\n ITokenGateway _l1Gateway,\n address payable _staking\n ) initializer {\n OwnableInitializable._initialize(msg.sender);\n graphToken = _graphToken;\n l2Implementation = _l2Implementation;\n l1Gateway = _l1Gateway;\n staking = _staking;\n }\n\n /**\n * @notice Initialize the L1GraphTokenLockTransferTool contract\n * @dev This function will run in the proxy's storage context, so it will\n * set the owner of the proxy contract which can be different from the implementation owner.\n * @param _owner Address of the owner of the L1GraphTokenLockTransferTool contract\n */\n function initialize(address _owner) external initializer {\n OwnableInitializable._initialize(_owner);\n }\n\n /**\n * @notice Set the L2 lock manager that corresponds to an L1 lock manager\n * @param _l1LockManager Address of the L1 lock manager\n * @param _l2LockManager Address of the L2 lock manager (in L2)\n */\n function setL2LockManager(address _l1LockManager, address _l2LockManager) external onlyOwner {\n l2LockManager[_l1LockManager] = _l2LockManager;\n emit L2LockManagerSet(_l1LockManager, _l2LockManager);\n }\n\n /**\n * @notice Set the L2 wallet owner that corresponds to an L1 wallet owner\n * @param _l1WalletOwner Address of the L1 wallet owner\n * @param _l2WalletOwner Address of the L2 wallet owner (in L2)\n */\n function setL2WalletOwner(address _l1WalletOwner, address _l2WalletOwner) external onlyOwner {\n l2WalletOwner[_l1WalletOwner] = _l2WalletOwner;\n emit L2WalletOwnerSet(_l1WalletOwner, _l2WalletOwner);\n }\n\n /**\n * @notice Deposit ETH on a token lock's account, to be used for L2 retryable ticket gas.\n * This function can be called by anyone, but the ETH will be credited to the token lock.\n * DO NOT try to call this through the token lock, as locks do not forward ETH value (and the\n * function call should not be allowlisted).\n * @param _tokenLock Address of the L1 GraphTokenLockWallet that will own the ETH\n */\n function depositETH(address _tokenLock) external payable {\n tokenLockETHBalances[_tokenLock] = tokenLockETHBalances[_tokenLock].add(msg.value);\n emit ETHDeposited(_tokenLock, msg.value);\n }\n\n /**\n * @notice Withdraw ETH from a token lock's account.\n * This function must be called from the token lock contract, but the destination\n * _must_ be a different address, as any ETH sent to the token lock would otherwise be\n * lost.\n * @param _destination Address to send the ETH\n * @param _amount Amount of ETH to send\n */\n function withdrawETH(address _destination, uint256 _amount) external {\n require(_amount > 0, \"INVALID_AMOUNT\");\n // We can't send eth to a token lock or it will be stuck\n require(msg.sender != _destination, \"INVALID_DESTINATION\");\n require(tokenLockETHBalances[msg.sender] >= _amount, \"INSUFFICIENT_BALANCE\");\n tokenLockETHBalances[msg.sender] -= _amount;\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, ) = payable(_destination).call{ value: _amount }(\"\");\n require(success, \"TRANSFER_FAILED\");\n emit ETHWithdrawn(msg.sender, _destination, _amount);\n }\n\n /**\n * @notice Pull ETH from a token lock's account, to be used for L2 retryable ticket gas.\n * This can only be called by the Staking contract.\n * @param _tokenLock GraphTokenLockWallet that owns the ETH that will be debited\n * @param _amount Amount of ETH to pull\n */\n function pullETH(address _tokenLock, uint256 _amount) external {\n require(msg.sender == staking, \"ONLY_STAKING\");\n require(tokenLockETHBalances[_tokenLock] >= _amount, \"INSUFFICIENT_BALANCE\");\n tokenLockETHBalances[_tokenLock] -= _amount;\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, ) = staking.call{ value: _amount }(\"\");\n require(success, \"TRANSFER_FAILED\");\n emit ETHPulled(_tokenLock, _amount);\n }\n\n /**\n * @notice Deposit GRT to L2, from a token lock in L1 to a token lock in L2.\n * If the token lock in L2 does not exist, it will be created when the message is received\n * by the L2GraphTokenLockManager.\n * Before calling this (which must be done through the token lock wallet), make sure\n * there is enough ETH in the token lock's account to cover the L2 retryable ticket gas.\n * Note that L2 submission fee and gas refunds will be lost.\n * You can add ETH to the token lock's account by calling depositETH().\n * Note that after calling this, you will NOT be able to use setL2WalletAddressManually() to\n * set an L2 wallet address, as the L2 wallet address will be set automatically when the\n * message is received by the L2GraphTokenLockManager.\n * @dev The gas parameters for L2 can be estimated using the Arbitrum SDK.\n * @param _amount Amount of GRT to deposit\n * @param _l2Beneficiary Address of the beneficiary for the token lock in L2. Must be the same for subsequent calls of this function, and not an L1 contract.\n * @param _maxGas Maximum gas to use for the L2 retryable ticket\n * @param _gasPriceBid Gas price to use for the L2 retryable ticket\n * @param _maxSubmissionCost Max submission cost for the L2 retryable ticket\n */\n function depositToL2Locked(\n uint256 _amount,\n address _l2Beneficiary,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n uint256 _maxSubmissionCost\n ) external {\n // Check that msg.sender is a GraphTokenLockWallet\n // That uses GRT and has a corresponding manager set in L2.\n GraphTokenLockWallet wallet = GraphTokenLockWallet(msg.sender);\n require(wallet.token() == graphToken, \"INVALID_TOKEN\");\n address l1Manager = address(wallet.manager());\n address l2Manager = l2LockManager[l1Manager];\n require(l2Manager != address(0), \"INVALID_MANAGER\");\n require(wallet.isInitialized(), \"!INITIALIZED\");\n require(wallet.revocable() != IGraphTokenLock.Revocability.Enabled, \"REVOCABLE\");\n require(_amount <= graphToken.balanceOf(msg.sender), \"INSUFFICIENT_BALANCE\");\n require(_amount != 0, \"ZERO_AMOUNT\");\n\n if (l2Beneficiary[msg.sender] == address(0)) {\n require(_l2Beneficiary != address(0), \"INVALID_BENEFICIARY_ZERO\");\n require(!AddressUpgradeable.isContract(_l2Beneficiary), \"INVALID_BENEFICIARY_CONTRACT\");\n l2Beneficiary[msg.sender] = _l2Beneficiary;\n } else {\n require(l2Beneficiary[msg.sender] == _l2Beneficiary, \"INVALID_BENEFICIARY\");\n }\n\n uint256 expectedEth = _maxSubmissionCost.add(_maxGas.mul(_gasPriceBid));\n require(tokenLockETHBalances[msg.sender] >= expectedEth, \"INSUFFICIENT_ETH_BALANCE\");\n tokenLockETHBalances[msg.sender] -= expectedEth;\n\n bytes memory encodedData;\n {\n address l2Owner = l2WalletOwner[wallet.owner()];\n require(l2Owner != address(0), \"L2_OWNER_NOT_SET\");\n // Extract all the storage variables from the GraphTokenLockWallet\n L2GraphTokenLockManager.TransferredWalletData memory data = L2GraphTokenLockManager.TransferredWalletData({\n l1Address: msg.sender,\n owner: l2Owner,\n beneficiary: l2Beneficiary[msg.sender],\n managedAmount: wallet.managedAmount(),\n startTime: wallet.startTime(),\n endTime: wallet.endTime()\n });\n encodedData = abi.encode(data);\n }\n\n if (l2WalletAddress[msg.sender] == address(0)) {\n require(wallet.endTime() >= block.timestamp, \"FULLY_VESTED_USE_MANUAL_ADDRESS\");\n address newAddress = getDeploymentAddress(keccak256(encodedData), l2Implementation, l2Manager);\n l2WalletAddress[msg.sender] = newAddress;\n emit L2WalletAddressSet(msg.sender, newAddress);\n } else {\n require(!l2WalletAddressSetManually[msg.sender], \"CANT_DEPOSIT_TO_MANUAL_ADDRESS\");\n }\n\n graphToken.transferFrom(msg.sender, address(this), _amount);\n\n // Send the tokens with a message through the L1GraphTokenGateway to the L2GraphTokenLockManager\n graphToken.approve(address(l1Gateway), _amount);\n {\n bytes memory transferData = abi.encode(_maxSubmissionCost, encodedData);\n l1Gateway.outboundTransfer{ value: expectedEth }(\n address(graphToken),\n l2Manager,\n _amount,\n _maxGas,\n _gasPriceBid,\n transferData\n );\n }\n emit LockedFundsSentToL2(msg.sender, l2WalletAddress[msg.sender], l1Manager, l2Manager, _amount);\n }\n\n /**\n * @notice Manually set the L2 wallet address for a token lock in L1.\n * This will only work for token locks that have not been initialized in L2 yet, and\n * that are fully vested (endTime < current timestamp).\n * This address can then be used to send stake or delegation to L2 on the Staking contract.\n * After calling this, the vesting lock will NOT be allowed to use depositToL2Locked\n * to send GRT to L2, the beneficiary must withdraw the tokens and bridge them manually.\n * @param _l2Wallet Address of the L2 wallet\n */\n function setL2WalletAddressManually(address _l2Wallet) external {\n // Check that msg.sender is a GraphTokenLockWallet\n // That uses GRT and has a corresponding manager set in L2.\n GraphTokenLockWallet wallet = GraphTokenLockWallet(msg.sender);\n require(wallet.token() == graphToken, \"INVALID_TOKEN\");\n address l1Manager = address(wallet.manager());\n address l2Manager = l2LockManager[l1Manager];\n require(l2Manager != address(0), \"INVALID_MANAGER\");\n require(wallet.isInitialized(), \"!INITIALIZED\");\n\n // Check that the wallet is fully vested\n require(wallet.endTime() < block.timestamp, \"NOT_FULLY_VESTED\");\n\n // Check that the wallet has not set an L2 wallet yet\n require(l2WalletAddress[msg.sender] == address(0), \"L2_WALLET_ALREADY_SET\");\n\n // Check that the L2 address is not zero\n require(_l2Wallet != address(0), \"ZERO_ADDRESS\");\n // Set the L2 wallet address\n l2WalletAddress[msg.sender] = _l2Wallet;\n l2WalletAddressSetManually[msg.sender] = true;\n emit L2WalletAddressSet(msg.sender, _l2Wallet);\n }\n}\n" + }, + "contracts/L2GraphTokenLockManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/SafeERC20.sol\";\n\nimport { ICallhookReceiver } from \"./ICallhookReceiver.sol\";\nimport { GraphTokenLockManager } from \"./GraphTokenLockManager.sol\";\nimport { L2GraphTokenLockWallet } from \"./L2GraphTokenLockWallet.sol\";\n\n/**\n * @title L2GraphTokenLockManager\n * @notice This contract manages a list of authorized function calls and targets that can be called\n * by any TokenLockWallet contract and it is a factory of TokenLockWallet contracts.\n *\n * This contract receives funds to make the process of creating TokenLockWallet contracts\n * easier by distributing them the initial tokens to be managed.\n *\n * In particular, this L2 variant is designed to receive token lock wallets from L1,\n * through the GRT bridge. These transferred wallets will not allow releasing funds in L2 until\n * the end of the vesting timeline, but they can allow withdrawing funds back to L1 using\n * the L2GraphTokenLockTransferTool contract.\n *\n * The owner can setup a list of token destinations that will be used by TokenLock contracts to\n * approve the pulling of funds, this way in can be guaranteed that only protocol contracts\n * will manipulate users funds.\n */\ncontract L2GraphTokenLockManager is GraphTokenLockManager, ICallhookReceiver {\n using SafeERC20 for IERC20;\n\n /// @dev Struct to hold the data of a transferred wallet; this is\n /// the data that must be encoded in L1 to send a wallet to L2.\n struct TransferredWalletData {\n address l1Address;\n address owner;\n address beneficiary;\n uint256 managedAmount;\n uint256 startTime;\n uint256 endTime;\n }\n\n /// Address of the L2GraphTokenGateway\n address public immutable l2Gateway;\n /// Address of the L1 transfer tool contract (in L1, no aliasing)\n address public immutable l1TransferTool;\n /// Mapping of each L1 wallet to its L2 wallet counterpart (populated when each wallet is received)\n /// L1 address => L2 address\n mapping(address => address) public l1WalletToL2Wallet;\n /// Mapping of each L2 wallet to its L1 wallet counterpart (populated when each wallet is received)\n /// L2 address => L1 address\n mapping(address => address) public l2WalletToL1Wallet;\n\n /// @dev Event emitted when a wallet is received and created from L1\n event TokenLockCreatedFromL1(\n address indexed contractAddress,\n bytes32 initHash,\n address indexed beneficiary,\n uint256 managedAmount,\n uint256 startTime,\n uint256 endTime,\n address indexed l1Address\n );\n\n /// @dev Emitted when locked tokens are received from L1 (whether the wallet\n /// had already been received or not)\n event LockedTokensReceivedFromL1(address indexed l1Address, address indexed l2Address, uint256 amount);\n\n /**\n * @dev Checks that the sender is the L2GraphTokenGateway.\n */\n modifier onlyL2Gateway() {\n require(msg.sender == l2Gateway, \"ONLY_GATEWAY\");\n _;\n }\n\n /**\n * @notice Constructor for the L2GraphTokenLockManager contract.\n * @param _graphToken Address of the L2 GRT token contract\n * @param _masterCopy Address of the master copy of the L2GraphTokenLockWallet implementation\n * @param _l2Gateway Address of the L2GraphTokenGateway contract\n * @param _l1TransferTool Address of the L1 transfer tool contract (in L1, without aliasing)\n */\n constructor(\n IERC20 _graphToken,\n address _masterCopy,\n address _l2Gateway,\n address _l1TransferTool\n ) GraphTokenLockManager(_graphToken, _masterCopy) {\n l2Gateway = _l2Gateway;\n l1TransferTool = _l1TransferTool;\n }\n\n /**\n * @notice This function is called by the L2GraphTokenGateway when tokens are sent from L1.\n * @dev This function will create a new wallet if it doesn't exist yet, or send the tokens to\n * the existing wallet if it does.\n * @param _from Address of the sender in L1, which must be the L1GraphTokenLockTransferTool\n * @param _amount Amount of tokens received\n * @param _data Encoded data of the transferred wallet, which must be an ABI-encoded TransferredWalletData struct\n */\n function onTokenTransfer(address _from, uint256 _amount, bytes calldata _data) external override onlyL2Gateway {\n require(_from == l1TransferTool, \"ONLY_TRANSFER_TOOL\");\n TransferredWalletData memory walletData = abi.decode(_data, (TransferredWalletData));\n\n if (l1WalletToL2Wallet[walletData.l1Address] != address(0)) {\n // If the wallet was already received, just send the tokens to the L2 address\n _token.safeTransfer(l1WalletToL2Wallet[walletData.l1Address], _amount);\n } else {\n // Create contract using a minimal proxy and call initializer\n (bytes32 initHash, address contractAddress) = _deployFromL1(keccak256(_data), walletData);\n l1WalletToL2Wallet[walletData.l1Address] = contractAddress;\n l2WalletToL1Wallet[contractAddress] = walletData.l1Address;\n\n // Send managed amount to the created contract\n _token.safeTransfer(contractAddress, _amount);\n\n emit TokenLockCreatedFromL1(\n contractAddress,\n initHash,\n walletData.beneficiary,\n walletData.managedAmount,\n walletData.startTime,\n walletData.endTime,\n walletData.l1Address\n );\n }\n emit LockedTokensReceivedFromL1(walletData.l1Address, l1WalletToL2Wallet[walletData.l1Address], _amount);\n }\n\n /**\n * @dev Deploy a token lock wallet with data received from L1\n * @param _salt Salt for the CREATE2 call, which must be the hash of the wallet data\n * @param _walletData Data of the wallet to be created\n * @return Hash of the initialization calldata\n * @return Address of the created contract\n */\n function _deployFromL1(bytes32 _salt, TransferredWalletData memory _walletData) internal returns (bytes32, address) {\n bytes memory initializer = _encodeInitializer(_walletData);\n address contractAddress = _deployProxy2(_salt, masterCopy, initializer);\n return (keccak256(initializer), contractAddress);\n }\n\n /**\n * @dev Encode the initializer for the token lock wallet received from L1\n * @param _walletData Data of the wallet to be created\n * @return Encoded initializer calldata, including the function signature\n */\n function _encodeInitializer(TransferredWalletData memory _walletData) internal view returns (bytes memory) {\n return\n abi.encodeWithSelector(\n L2GraphTokenLockWallet.initializeFromL1.selector,\n address(this),\n address(_token),\n _walletData\n );\n }\n}\n" + }, + "contracts/L2GraphTokenLockTransferTool.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport { L2GraphTokenLockManager } from \"./L2GraphTokenLockManager.sol\";\nimport { L2GraphTokenLockWallet } from \"./L2GraphTokenLockWallet.sol\";\nimport { ITokenGateway } from \"./arbitrum/ITokenGateway.sol\";\n\n/**\n * @title L2GraphTokenLockTransferTool contract\n * @notice This contract is used to transfer GRT from L2 token lock wallets\n * back to their L1 counterparts.\n */\ncontract L2GraphTokenLockTransferTool {\n /// Address of the L2 GRT token\n IERC20 public immutable graphToken;\n /// Address of the L2GraphTokenGateway\n ITokenGateway public immutable l2Gateway;\n /// Address of the L1 GRT token (in L1, no aliasing)\n address public immutable l1GraphToken;\n\n /// @dev Emitted when GRT is sent to L1 from a token lock\n event LockedFundsSentToL1(\n address indexed l1Wallet,\n address indexed l2Wallet,\n address indexed l2LockManager,\n uint256 amount\n );\n\n /**\n * @notice Constructor for the L2GraphTokenLockTransferTool contract\n * @dev Note the L2GraphTokenLockTransferTool can be deployed behind a proxy,\n * and the constructor for the implementation will only set some immutable\n * variables.\n * @param _graphToken Address of the L2 GRT token\n * @param _l2Gateway Address of the L2GraphTokenGateway\n * @param _l1GraphToken Address of the L1 GRT token (in L1, no aliasing)\n */\n constructor(IERC20 _graphToken, ITokenGateway _l2Gateway, address _l1GraphToken) {\n graphToken = _graphToken;\n l2Gateway = _l2Gateway;\n l1GraphToken = _l1GraphToken;\n }\n\n /**\n * @notice Withdraw GRT from an L2 token lock wallet to its L1 counterpart.\n * This function must be called from an L2GraphTokenLockWallet contract.\n * The GRT will be sent to L1 and must be claimed using the Arbitrum Outbox on L1\n * after the standard Arbitrum withdrawal period (7 days).\n * @param _amount Amount of GRT to withdraw\n */\n function withdrawToL1Locked(uint256 _amount) external {\n L2GraphTokenLockWallet wallet = L2GraphTokenLockWallet(msg.sender);\n L2GraphTokenLockManager manager = L2GraphTokenLockManager(address(wallet.manager()));\n require(address(manager) != address(0), \"INVALID_SENDER\");\n address l1Wallet = manager.l2WalletToL1Wallet(msg.sender);\n require(l1Wallet != address(0), \"NOT_L1_WALLET\");\n require(_amount <= graphToken.balanceOf(msg.sender), \"INSUFFICIENT_BALANCE\");\n require(_amount != 0, \"ZERO_AMOUNT\");\n\n graphToken.transferFrom(msg.sender, address(this), _amount);\n graphToken.approve(address(l2Gateway), _amount);\n\n // Send the tokens through the L2GraphTokenGateway to the L1 wallet counterpart\n l2Gateway.outboundTransfer(l1GraphToken, l1Wallet, _amount, 0, 0, \"\");\n emit LockedFundsSentToL1(l1Wallet, msg.sender, address(manager), _amount);\n }\n}\n" + }, + "contracts/L2GraphTokenLockWallet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport { GraphTokenLockWallet } from \"./GraphTokenLockWallet.sol\";\nimport { Ownable as OwnableInitializable } from \"./Ownable.sol\";\nimport { L2GraphTokenLockManager } from \"./L2GraphTokenLockManager.sol\";\n\n/**\n * @title L2GraphTokenLockWallet\n * @notice This contract is built on top of the base GraphTokenLock functionality.\n * It allows wallet beneficiaries to use the deposited funds to perform specific function calls\n * on specific contracts.\n *\n * The idea is that supporters with locked tokens can participate in the protocol\n * but disallow any release before the vesting/lock schedule.\n * The beneficiary can issue authorized function calls to this contract that will\n * get forwarded to a target contract. A target contract is any of our protocol contracts.\n * The function calls allowed are queried to the GraphTokenLockManager, this way\n * the same configuration can be shared for all the created lock wallet contracts.\n *\n * This L2 variant includes a special initializer so that it can be created from\n * a wallet's data received from L1. These transferred wallets will not allow releasing\n * funds in L2 until the end of the vesting timeline, but they can allow withdrawing\n * funds back to L1 using the L2GraphTokenLockTransferTool contract.\n *\n * Note that surplusAmount and releasedAmount in L2 will be skewed for wallets received from L1,\n * so releasing surplus tokens might also only be possible by bridging tokens back to L1.\n *\n * NOTE: Contracts used as target must have its function signatures checked to avoid collisions\n * with any of this contract functions.\n * Beneficiaries need to approve the use of the tokens to the protocol contracts. For convenience\n * the maximum amount of tokens is authorized.\n * Function calls do not forward ETH value so DO NOT SEND ETH TO THIS CONTRACT.\n */\ncontract L2GraphTokenLockWallet is GraphTokenLockWallet {\n // Initializer when created from a message from L1\n function initializeFromL1(\n address _manager,\n address _token,\n L2GraphTokenLockManager.TransferredWalletData calldata _walletData\n ) external {\n require(!isInitialized, \"Already initialized\");\n isInitialized = true;\n\n OwnableInitializable._initialize(_walletData.owner);\n beneficiary = _walletData.beneficiary;\n token = IERC20(_token);\n\n managedAmount = _walletData.managedAmount;\n\n startTime = _walletData.startTime;\n endTime = _walletData.endTime;\n periods = 1;\n isAccepted = true;\n\n // Optionals\n releaseStartTime = _walletData.endTime;\n revocable = Revocability.Disabled;\n\n _setManager(_manager);\n }\n}\n" + }, + "contracts/MathUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nlibrary MathUtils {\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n}\n" + }, + "contracts/MinimalProxyFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\nimport { Create2 } from \"@openzeppelin/contracts/utils/Create2.sol\";\n\n/**\n * @title MinimalProxyFactory: a factory contract for creating minimal proxies\n * @notice Adapted from https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/upgradeability/ProxyFactory.sol\n * Based on https://eips.ethereum.org/EIPS/eip-1167\n */\ncontract MinimalProxyFactory {\n /// @dev Emitted when a new proxy is created\n event ProxyCreated(address indexed proxy);\n\n /**\n * @notice Gets the deterministic CREATE2 address for MinimalProxy with a particular implementation\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @param _deployer Address of the deployer that creates the contract\n * @return Address of the counterfactual MinimalProxy\n */\n function getDeploymentAddress(\n bytes32 _salt,\n address _implementation,\n address _deployer\n ) public pure returns (address) {\n return Create2.computeAddress(_salt, keccak256(_getContractCreationCode(_implementation)), _deployer);\n }\n\n /**\n * @dev Deploys a MinimalProxy with CREATE2\n * @param _salt Bytes32 salt to use for CREATE2\n * @param _implementation Address of the proxy target implementation\n * @param _data Bytes with the initializer call\n * @return Address of the deployed MinimalProxy\n */\n function _deployProxy2(bytes32 _salt, address _implementation, bytes memory _data) internal returns (address) {\n address proxyAddress = Create2.deploy(0, _salt, _getContractCreationCode(_implementation));\n\n emit ProxyCreated(proxyAddress);\n\n // Call function with data\n if (_data.length > 0) {\n Address.functionCall(proxyAddress, _data);\n }\n\n return proxyAddress;\n }\n\n /**\n * @dev Gets the MinimalProxy bytecode\n * @param _implementation Address of the proxy target implementation\n * @return MinimalProxy bytecode\n */\n function _getContractCreationCode(address _implementation) internal pure returns (bytes memory) {\n bytes10 creation = 0x3d602d80600a3d3981f3;\n bytes10 prefix = 0x363d3d373d3d3d363d73;\n bytes20 targetBytes = bytes20(_implementation);\n bytes15 suffix = 0x5af43d82803e903d91602b57fd5bf3;\n return abi.encodePacked(creation, prefix, targetBytes, suffix);\n }\n}\n" + }, + "contracts/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\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 * The owner account will be passed on initialization of the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\ncontract Ownable {\n /// @dev Owner of the contract, can be retrieved with the public owner() function\n address private _owner;\n /// @dev Since upgradeable contracts might inherit this, we add a storage gap\n /// to allow adding variables here without breaking the proxy storage layout\n uint256[50] private __gap;\n\n /// @dev Emitted when ownership of the contract is transferred\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 owner) internal {\n _owner = owner;\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(_owner == msg.sender, \"Ownable: caller is not the owner\");\n _;\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() external virtual 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) external virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" + }, + "contracts/tests/arbitrum/AddressAliasHelper.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2019-2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/84e64dee6ee82adbf8ec34fd4b86c207a61d9007/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\nlibrary AddressAliasHelper {\n uint160 constant offset = uint160(0x1111000000000000000000000000000000001111);\n\n /// @notice Utility function that converts the address in the L1 that submitted a tx to\n /// the inbox to the msg.sender viewed in the L2\n /// @param l1Address the address in the L1 that triggered the tx to L2\n /// @return l2Address L2 address as viewed in msg.sender\n function applyL1ToL2Alias(address l1Address) internal pure returns (address l2Address) {\n l2Address = address(uint160(l1Address) + offset);\n }\n\n /// @notice Utility function that converts the msg.sender viewed in the L2 to the\n /// address in the L1 that submitted a tx to the inbox\n /// @param l2Address L2 address as viewed in msg.sender\n /// @return l1Address the address in the L1 that triggered the tx to L2\n function undoL1ToL2Alias(address l2Address) internal pure returns (address l1Address) {\n l1Address = address(uint160(l2Address) - offset);\n }\n}\n" + }, + "contracts/tests/arbitrum/IBridge.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\ninterface IBridge {\n event MessageDelivered(\n uint256 indexed messageIndex,\n bytes32 indexed beforeInboxAcc,\n address inbox,\n uint8 kind,\n address sender,\n bytes32 messageDataHash\n );\n\n event BridgeCallTriggered(address indexed outbox, address indexed destAddr, uint256 amount, bytes data);\n\n event InboxToggle(address indexed inbox, bool enabled);\n\n event OutboxToggle(address indexed outbox, bool enabled);\n\n function deliverMessageToInbox(\n uint8 kind,\n address sender,\n bytes32 messageDataHash\n ) external payable returns (uint256);\n\n function executeCall(\n address destAddr,\n uint256 amount,\n bytes calldata data\n ) external returns (bool success, bytes memory returnData);\n\n // These are only callable by the admin\n function setInbox(address inbox, bool enabled) external;\n\n function setOutbox(address inbox, bool enabled) external;\n\n // View functions\n\n function activeOutbox() external view returns (address);\n\n function allowedInboxes(address inbox) external view returns (bool);\n\n function allowedOutboxes(address outbox) external view returns (bool);\n\n function inboxAccs(uint256 index) external view returns (bytes32);\n\n function messageCount() external view returns (uint256);\n}\n" + }, + "contracts/tests/arbitrum/IInbox.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\nimport \"./IBridge.sol\";\nimport \"./IMessageProvider.sol\";\n\ninterface IInbox is IMessageProvider {\n function sendL2Message(bytes calldata messageData) external returns (uint256);\n\n function sendUnsignedTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n uint256 nonce,\n address destAddr,\n uint256 amount,\n bytes calldata data\n ) external returns (uint256);\n\n function sendContractTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n address destAddr,\n uint256 amount,\n bytes calldata data\n ) external returns (uint256);\n\n function sendL1FundedUnsignedTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n uint256 nonce,\n address destAddr,\n bytes calldata data\n ) external payable returns (uint256);\n\n function sendL1FundedContractTransaction(\n uint256 maxGas,\n uint256 gasPriceBid,\n address destAddr,\n bytes calldata data\n ) external payable returns (uint256);\n\n function createRetryableTicket(\n address destAddr,\n uint256 arbTxCallValue,\n uint256 maxSubmissionCost,\n address submissionRefundAddress,\n address valueRefundAddress,\n uint256 maxGas,\n uint256 gasPriceBid,\n bytes calldata data\n ) external payable returns (uint256);\n\n function depositEth(uint256 maxSubmissionCost) external payable returns (uint256);\n\n function bridge() external view returns (IBridge);\n\n function pauseCreateRetryables() external;\n\n function unpauseCreateRetryables() external;\n\n function startRewriteAddress() external;\n\n function stopRewriteAddress() external;\n}\n" + }, + "contracts/tests/arbitrum/IMessageProvider.sol": { + "content": "// SPDX-License-Identifier: Apache-2.0\n\n/*\n * Copyright 2021, Offchain Labs, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Originally copied from:\n * https://github.com/OffchainLabs/arbitrum/tree/e3a6307ad8a2dc2cad35728a2a9908cfd8dd8ef9/packages/arb-bridge-eth\n *\n * MODIFIED from Offchain Labs' implementation:\n * - Changed solidity version to 0.7.3 (pablo@edgeandnode.com)\n *\n */\n\npragma solidity ^0.7.3;\n\ninterface IMessageProvider {\n event InboxMessageDelivered(uint256 indexed messageNum, bytes data);\n\n event InboxMessageDeliveredFromOrigin(uint256 indexed messageNum);\n}\n" + }, + "contracts/tests/BridgeMock.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.3;\n\nimport \"./arbitrum/IBridge.sol\";\n\n/**\n * @title Arbitrum Bridge mock contract\n * @dev This contract implements Arbitrum's IBridge interface for testing purposes\n */\ncontract BridgeMock is IBridge {\n /// Address of the (mock) Arbitrum Inbox\n address public inbox;\n /// Address of the (mock) Arbitrum Outbox\n address public outbox;\n /// Index of the next message on the inbox messages array\n uint256 public messageIndex;\n /// Inbox messages array\n bytes32[] public override inboxAccs;\n\n /**\n * @notice Deliver a message to the inbox. The encoded message will be\n * added to the inbox array, and messageIndex will be incremented.\n * @param _kind Type of the message\n * @param _sender Address that is sending the message\n * @param _messageDataHash keccak256 hash of the message data\n * @return The next index for the inbox array\n */\n function deliverMessageToInbox(\n uint8 _kind,\n address _sender,\n bytes32 _messageDataHash\n ) external payable override returns (uint256) {\n messageIndex = messageIndex + 1;\n inboxAccs.push(keccak256(abi.encodePacked(inbox, _kind, _sender, _messageDataHash)));\n emit MessageDelivered(messageIndex, inboxAccs[messageIndex - 1], msg.sender, _kind, _sender, _messageDataHash);\n return messageIndex;\n }\n\n /**\n * @notice Executes an L1 function call incoing from L2. This can only be called\n * by the Outbox.\n * @param _destAddr Contract to call\n * @param _amount ETH value to send\n * @param _data Calldata for the function call\n * @return True if the call was successful, false otherwise\n * @return Return data from the call\n */\n function executeCall(\n address _destAddr,\n uint256 _amount,\n bytes calldata _data\n ) external override returns (bool, bytes memory) {\n require(outbox == msg.sender, \"NOT_FROM_OUTBOX\");\n bool success;\n bytes memory returnData;\n\n // solhint-disable-next-line avoid-low-level-calls\n (success, returnData) = _destAddr.call{ value: _amount }(_data);\n emit BridgeCallTriggered(msg.sender, _destAddr, _amount, _data);\n return (success, returnData);\n }\n\n /**\n * @notice Set the address of the inbox. Anyone can call this, because it's a mock.\n * @param _inbox Address of the inbox\n * @param _enabled Enable the inbox (ignored)\n */\n function setInbox(address _inbox, bool _enabled) external override {\n inbox = _inbox;\n emit InboxToggle(inbox, _enabled);\n }\n\n /**\n * @notice Set the address of the outbox. Anyone can call this, because it's a mock.\n * @param _outbox Address of the outbox\n * @param _enabled Enable the outbox (ignored)\n */\n function setOutbox(address _outbox, bool _enabled) external override {\n outbox = _outbox;\n emit OutboxToggle(outbox, _enabled);\n }\n\n // View functions\n\n /**\n * @notice Getter for the active outbox (in this case there's only one)\n */\n function activeOutbox() external view override returns (address) {\n return outbox;\n }\n\n /**\n * @notice Getter for whether an address is an allowed inbox (in this case there's only one)\n * @param _inbox Address to check\n * @return True if the address is the allowed inbox, false otherwise\n */\n function allowedInboxes(address _inbox) external view override returns (bool) {\n return _inbox == inbox;\n }\n\n /**\n * @notice Getter for whether an address is an allowed outbox (in this case there's only one)\n * @param _outbox Address to check\n * @return True if the address is the allowed outbox, false otherwise\n */\n function allowedOutboxes(address _outbox) external view override returns (bool) {\n return _outbox == outbox;\n }\n\n /**\n * @notice Getter for the count of messages in the inboxAccs\n * @return Number of messages in inboxAccs\n */\n function messageCount() external view override returns (uint256) {\n return inboxAccs.length;\n }\n}\n" + }, + "contracts/tests/GraphTokenMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\n/**\n * @title Graph Token Mock contract.\n * @dev Used for testing purposes, DO NOT USE IN PRODUCTION\n */\ncontract GraphTokenMock is Ownable, ERC20 {\n /**\n * @notice Contract Constructor.\n * @param _initialSupply Initial supply\n * @param _mintTo Address to whitch to mint the initial supply\n */\n constructor(uint256 _initialSupply, address _mintTo) ERC20(\"Graph Token Mock\", \"GRT-Mock\") {\n // Deploy to mint address\n _mint(_mintTo, _initialSupply);\n }\n\n /**\n * @notice Mint tokens to an address from the bridge.\n * (The real one has an onlyGateway modifier)\n * @param _to Address to mint tokens to\n * @param _amount Amount of tokens to mint\n */\n function bridgeMint(address _to, uint256 _amount) external {\n _mint(_to, _amount);\n }\n\n /**\n * @notice Burn tokens from an address from the bridge.\n * (The real one has an onlyGateway modifier)\n * @param _from Address to burn tokens from\n * @param _amount Amount of tokens to burn\n */\n function bridgeBurn(address _from, uint256 _amount) external {\n _burn(_from, _amount);\n }\n}\n" + }, + "contracts/tests/InboxMock.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.3;\n\nimport \"./arbitrum/IInbox.sol\";\nimport \"./arbitrum/AddressAliasHelper.sol\";\n\n/**\n * @title Arbitrum Inbox mock contract\n * @dev This contract implements (a subset of) Arbitrum's IInbox interface for testing purposes\n */\ncontract InboxMock is IInbox {\n /// @dev Type indicator for a standard L2 message\n uint8 internal constant L2_MSG = 3;\n /// @dev Type indicator for a retryable ticket message\n // solhint-disable-next-line const-name-snakecase\n uint8 internal constant L1MessageType_submitRetryableTx = 9;\n /// Address of the Bridge (mock) contract\n IBridge public override bridge;\n\n /**\n * @notice Send a message to L2 (by delivering it to the Bridge)\n * @param _messageData Encoded data to send in the message\n * @return Message number returned by the inbox\n */\n function sendL2Message(bytes calldata _messageData) external override returns (uint256) {\n uint256 msgNum = deliverToBridge(L2_MSG, msg.sender, keccak256(_messageData));\n emit InboxMessageDelivered(msgNum, _messageData);\n return msgNum;\n }\n\n /**\n * @notice Set the address of the (mock) bridge\n * @param _bridge Address of the bridge\n */\n function setBridge(address _bridge) external {\n bridge = IBridge(_bridge);\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendUnsignedTransaction(\n uint256,\n uint256,\n uint256,\n address,\n uint256,\n bytes calldata\n ) external pure override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendContractTransaction(\n uint256,\n uint256,\n address,\n uint256,\n bytes calldata\n ) external pure override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendL1FundedUnsignedTransaction(\n uint256,\n uint256,\n uint256,\n address,\n bytes calldata\n ) external payable override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function sendL1FundedContractTransaction(\n uint256,\n uint256,\n address,\n bytes calldata\n ) external payable override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Creates a retryable ticket for an L2 transaction\n * @param _destAddr Address of the contract to call in L2\n * @param _arbTxCallValue Callvalue to use in the L2 transaction\n * @param _maxSubmissionCost Max cost of submitting the ticket, in Wei\n * @param _submissionRefundAddress L2 address to refund for any remaining value from the submission cost\n * @param _valueRefundAddress L2 address to refund if the ticket times out or gets cancelled\n * @param _maxGas Max gas for the L2 transcation\n * @param _gasPriceBid Gas price bid on L2\n * @param _data Encoded calldata for the L2 transaction (including function selector)\n * @return Message number returned by the bridge\n */\n function createRetryableTicket(\n address _destAddr,\n uint256 _arbTxCallValue,\n uint256 _maxSubmissionCost,\n address _submissionRefundAddress,\n address _valueRefundAddress,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n bytes calldata _data\n ) external payable override returns (uint256) {\n _submissionRefundAddress = AddressAliasHelper.applyL1ToL2Alias(_submissionRefundAddress);\n _valueRefundAddress = AddressAliasHelper.applyL1ToL2Alias(_valueRefundAddress);\n return\n _deliverMessage(\n L1MessageType_submitRetryableTx,\n msg.sender,\n abi.encodePacked(\n uint256(uint160(bytes20(_destAddr))),\n _arbTxCallValue,\n msg.value,\n _maxSubmissionCost,\n uint256(uint160(bytes20(_submissionRefundAddress))),\n uint256(uint160(bytes20(_valueRefundAddress))),\n _maxGas,\n _gasPriceBid,\n _data.length,\n _data\n )\n );\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function depositEth(uint256) external payable override returns (uint256) {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function pauseCreateRetryables() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function unpauseCreateRetryables() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function startRewriteAddress() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @notice Unimplemented in this mock\n */\n function stopRewriteAddress() external pure override {\n revert(\"Unimplemented\");\n }\n\n /**\n * @dev Deliver a message to the bridge\n * @param _kind Type of the message\n * @param _sender Address that is sending the message\n * @param _messageData Encoded message data\n * @return Message number returned by the bridge\n */\n function _deliverMessage(uint8 _kind, address _sender, bytes memory _messageData) internal returns (uint256) {\n uint256 msgNum = deliverToBridge(_kind, _sender, keccak256(_messageData));\n emit InboxMessageDelivered(msgNum, _messageData);\n return msgNum;\n }\n\n /**\n * @dev Deliver a message to the bridge\n * @param _kind Type of the message\n * @param _sender Address that is sending the message\n * @param _messageDataHash keccak256 hash of the encoded message data\n * @return Message number returned by the bridge\n */\n function deliverToBridge(uint8 _kind, address _sender, bytes32 _messageDataHash) internal returns (uint256) {\n return bridge.deliverMessageToInbox{ value: msg.value }(_kind, _sender, _messageDataHash);\n }\n}\n" + }, + "contracts/tests/L1TokenGatewayMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport { SafeMath } from \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport { ITokenGateway } from \"../arbitrum//ITokenGateway.sol\";\n\n/**\n * @title L1 Token Gateway mock contract\n * @dev Used for testing purposes, DO NOT USE IN PRODUCTION\n */\ncontract L1TokenGatewayMock is Ownable {\n using SafeMath for uint256;\n /// Next sequence number to return when outboundTransfer is called\n uint256 public nextSeqNum;\n\n /// @dev Emitted when a (fake) retryable ticket is created\n event FakeTxToL2(\n address from,\n uint256 value,\n uint256 maxGas,\n uint256 gasPriceBid,\n uint256 maxSubmissionCost,\n bytes outboundCalldata\n );\n\n /// @dev Emitted when an outbound transfer is initiated, i.e. tokens are deposited from L1 to L2\n event DepositInitiated(\n address l1Token,\n address indexed from,\n address indexed to,\n uint256 indexed sequenceNumber,\n uint256 amount\n );\n\n /**\n * @notice L1 Token Gateway Contract Constructor.\n */\n constructor() {}\n\n /**\n * @notice Creates and sends a fake retryable ticket to transfer GRT to L2.\n * This mock will actually just emit an event with parameters equivalent to what the real L1GraphTokenGateway\n * would send to L2.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _to Recipient address on L2\n * @param _amount Amount of tokens to tranfer\n * @param _maxGas Gas limit for L2 execution of the ticket\n * @param _gasPriceBid Price per gas on L2\n * @param _data Encoded maxSubmissionCost and sender address along with additional calldata\n * @return Sequence number of the retryable ticket created by Inbox (always )\n */\n function outboundTransfer(\n address _l1Token,\n address _to,\n uint256 _amount,\n uint256 _maxGas,\n uint256 _gasPriceBid,\n bytes calldata _data\n ) external payable returns (bytes memory) {\n require(_amount > 0, \"INVALID_ZERO_AMOUNT\");\n require(_to != address(0), \"INVALID_DESTINATION\");\n\n // nested scopes to avoid stack too deep errors\n address from;\n uint256 seqNum = nextSeqNum;\n nextSeqNum += 1;\n {\n uint256 maxSubmissionCost;\n bytes memory outboundCalldata;\n {\n bytes memory extraData;\n (from, maxSubmissionCost, extraData) = _parseOutboundData(_data);\n require(maxSubmissionCost > 0, \"NO_SUBMISSION_COST\");\n\n {\n // makes sure only sufficient ETH is supplied as required for successful redemption on L2\n // if a user does not desire immediate redemption they should provide\n // a msg.value of AT LEAST maxSubmissionCost\n uint256 expectedEth = maxSubmissionCost.add(_maxGas.mul(_gasPriceBid));\n require(msg.value >= expectedEth, \"WRONG_ETH_VALUE\");\n }\n outboundCalldata = getOutboundCalldata(_l1Token, from, _to, _amount, extraData);\n }\n {\n // transfer tokens to escrow\n IERC20(_l1Token).transferFrom(from, address(this), _amount);\n\n emit FakeTxToL2(from, msg.value, _maxGas, _gasPriceBid, maxSubmissionCost, outboundCalldata);\n }\n }\n emit DepositInitiated(_l1Token, from, _to, seqNum, _amount);\n\n return abi.encode(seqNum);\n }\n\n /**\n * @notice (Mock) Receives withdrawn tokens from L2\n * Actually does nothing, just keeping it here as its useful to define the expected\n * calldata for the outgoing transfer in tests.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _from Address of the sender\n * @param _to Recepient address on L1\n * @param _amount Amount of tokens transferred\n * @param _data Additional calldata\n */\n function finalizeInboundTransfer(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external payable {}\n\n /**\n * @notice Creates calldata required to create a retryable ticket\n * @dev encodes the target function with its params which\n * will be called on L2 when the retryable ticket is redeemed\n * @param _l1Token Address of the Graph token contract on L1\n * @param _from Address on L1 from which we're transferring tokens\n * @param _to Address on L2 to which we're transferring tokens\n * @param _amount Amount of GRT to transfer\n * @param _data Additional call data for the L2 transaction, which must be empty unless the caller is whitelisted\n * @return Encoded calldata (including function selector) for the L2 transaction\n */\n function getOutboundCalldata(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes memory _data\n ) public pure returns (bytes memory) {\n bytes memory emptyBytes;\n\n return\n abi.encodeWithSelector(\n ITokenGateway.finalizeInboundTransfer.selector,\n _l1Token,\n _from,\n _to,\n _amount,\n abi.encode(emptyBytes, _data)\n );\n }\n\n /**\n * @notice Decodes calldata required for transfer of tokens to L2\n * @dev Data must include maxSubmissionCost, extraData can be left empty. When the router\n * sends an outbound message, data also contains the from address, but this mock\n * doesn't consider this case\n * @param _data Encoded callhook data containing maxSubmissionCost and extraData\n * @return Sender of the tx\n * @return Max ether value used to submit the retryable ticket\n * @return Additional data sent to L2\n */\n function _parseOutboundData(bytes memory _data) private view returns (address, uint256, bytes memory) {\n address from;\n uint256 maxSubmissionCost;\n bytes memory extraData;\n from = msg.sender;\n // User-encoded data contains the max retryable ticket submission cost\n // and additional L2 calldata\n (maxSubmissionCost, extraData) = abi.decode(_data, (uint256, bytes));\n return (from, maxSubmissionCost, extraData);\n }\n}\n" + }, + "contracts/tests/L2TokenGatewayMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { ITokenGateway } from \"../arbitrum//ITokenGateway.sol\";\nimport { GraphTokenMock } from \"./GraphTokenMock.sol\";\nimport { ICallhookReceiver } from \"../ICallhookReceiver.sol\";\n\n/**\n * @title L2 Token Gateway mock contract\n * @dev Used for testing purposes, DO NOT USE IN PRODUCTION\n */\ncontract L2TokenGatewayMock is Ownable {\n /// Address of the L1 GRT contract\n address public immutable l1Token;\n /// Address of the L2 GRT contract\n address public immutable l2Token;\n /// Next ID to return when sending an outboundTransfer\n uint256 public nextId;\n\n /// @dev Emitted when a (fake) transaction to L1 is created\n event FakeTxToL1(address from, bytes outboundCalldata);\n /// @dev Emitted when a (fake) retryable ticket is received from L1\n event DepositFinalized(address token, address indexed from, address indexed to, uint256 amount);\n\n /// @dev Emitted when an outbound transfer is initiated, i.e. tokens are withdrawn to L1 from L2\n event WithdrawalInitiated(\n address l1Token,\n address indexed from,\n address indexed to,\n uint256 indexed sequenceNumber,\n uint256 amount\n );\n\n /**\n * @notice L2 Token Gateway Contract Constructor.\n * @param _l1Token Address of the L1 GRT contract\n * @param _l2Token Address of the L2 GRT contract\n */\n constructor(address _l1Token, address _l2Token) {\n l1Token = _l1Token;\n l2Token = _l2Token;\n }\n\n /**\n * @notice Creates and sends a (fake) transfer of GRT to L1.\n * This mock will actually just emit an event with parameters equivalent to what the real L2GraphTokenGateway\n * would send to L1.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _to Recipient address on L2\n * @param _amount Amount of tokens to tranfer\n * @param _data Encoded maxSubmissionCost and sender address along with additional calldata\n * @return ID of the L2-L1 message (incrementing on every call)\n */\n function outboundTransfer(\n address _l1Token,\n address _to,\n uint256 _amount,\n uint256,\n uint256,\n bytes calldata _data\n ) external payable returns (bytes memory) {\n require(_l1Token == l1Token, \"INVALID_L1_TOKEN\");\n require(_amount > 0, \"INVALID_ZERO_AMOUNT\");\n require(_to != address(0), \"INVALID_DESTINATION\");\n\n // nested scopes to avoid stack too deep errors\n address from;\n uint256 id = nextId;\n nextId += 1;\n {\n bytes memory outboundCalldata;\n {\n bytes memory extraData;\n (from, extraData) = _parseOutboundData(_data);\n\n require(msg.value == 0, \"!value\");\n require(extraData.length == 0, \"!extraData\");\n outboundCalldata = getOutboundCalldata(_l1Token, from, _to, _amount, extraData);\n }\n {\n // burn tokens from the sender, they will be released from escrow in L1\n GraphTokenMock(l2Token).bridgeBurn(from, _amount);\n\n emit FakeTxToL1(from, outboundCalldata);\n }\n }\n emit WithdrawalInitiated(_l1Token, from, _to, id, _amount);\n\n return abi.encode(id);\n }\n\n /**\n * @notice (Mock) Receives withdrawn tokens from L1\n * Implements calling callhooks if data is non-empty.\n * @param _l1Token L1 Address of the GRT contract (needed for compatibility with Arbitrum Gateway Router)\n * @param _from Address of the sender\n * @param _to Recipient address on L1\n * @param _amount Amount of tokens transferred\n * @param _data Additional calldata, will trigger an onTokenTransfer call if non-empty\n */\n function finalizeInboundTransfer(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes calldata _data\n ) external payable {\n require(_l1Token == l1Token, \"TOKEN_NOT_GRT\");\n require(msg.value == 0, \"INVALID_NONZERO_VALUE\");\n\n GraphTokenMock(l2Token).bridgeMint(_to, _amount);\n\n if (_data.length > 0) {\n ICallhookReceiver(_to).onTokenTransfer(_from, _amount, _data);\n }\n\n emit DepositFinalized(_l1Token, _from, _to, _amount);\n }\n\n /**\n * @notice Calculate the L2 address of a bridged token\n * @dev In our case, this would only work for GRT.\n * @param l1ERC20 address of L1 GRT contract\n * @return L2 address of the bridged GRT token\n */\n function calculateL2TokenAddress(address l1ERC20) public view returns (address) {\n if (l1ERC20 != l1Token) {\n return address(0);\n }\n return l2Token;\n }\n\n /**\n * @notice Creates calldata required to create a tx to L1\n * @param _l1Token Address of the Graph token contract on L1\n * @param _from Address on L2 from which we're transferring tokens\n * @param _to Address on L1 to which we're transferring tokens\n * @param _amount Amount of GRT to transfer\n * @param _data Additional call data for the L1 transaction, which must be empty\n * @return Encoded calldata (including function selector) for the L1 transaction\n */\n function getOutboundCalldata(\n address _l1Token,\n address _from,\n address _to,\n uint256 _amount,\n bytes memory _data\n ) public pure returns (bytes memory) {\n return\n abi.encodeWithSelector(\n ITokenGateway.finalizeInboundTransfer.selector,\n _l1Token,\n _from,\n _to,\n _amount,\n abi.encode(0, _data)\n );\n }\n\n /**\n * @dev Decodes calldata required for transfer of tokens to L1.\n * extraData can be left empty\n * @param _data Encoded callhook data\n * @return Sender of the tx\n * @return Any other data sent to L1\n */\n function _parseOutboundData(bytes calldata _data) private view returns (address, bytes memory) {\n address from;\n bytes memory extraData;\n // The mock doesn't take messages from the Router\n from = msg.sender;\n extraData = _data;\n return (from, extraData);\n }\n}\n" + }, + "contracts/tests/Stakes.sol": { + "content": "// SPDX-License-Identifier: GPL-2.0-or-later\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\n\n/**\n * @title A collection of data structures and functions to manage the Indexer Stake state.\n * Used for low-level state changes, require() conditions should be evaluated\n * at the caller function scope.\n */\nlibrary Stakes {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n struct Indexer {\n uint256 tokensStaked; // Tokens on the indexer stake (staked by the indexer)\n uint256 tokensAllocated; // Tokens used in allocations\n uint256 tokensLocked; // Tokens locked for withdrawal subject to thawing period\n uint256 tokensLockedUntil; // Block when locked tokens can be withdrawn\n }\n\n /**\n * @dev Deposit tokens to the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to deposit\n */\n function deposit(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.add(_tokens);\n }\n\n /**\n * @dev Release tokens from the indexer stake.\n * @param stake Stake data\n * @param _tokens Amount of tokens to release\n */\n function release(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensStaked = stake.tokensStaked.sub(_tokens);\n }\n\n /**\n * @dev Allocate tokens from the main stack to a SubgraphDeployment.\n * @param stake Stake data\n * @param _tokens Amount of tokens to allocate\n */\n function allocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.add(_tokens);\n }\n\n /**\n * @dev Unallocate tokens from a SubgraphDeployment back to the main stack.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unallocate\n */\n function unallocate(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensAllocated = stake.tokensAllocated.sub(_tokens);\n }\n\n /**\n * @dev Lock tokens until a thawing period pass.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _period Period in blocks that need to pass before withdrawal\n */\n function lockTokens(Stakes.Indexer storage stake, uint256 _tokens, uint256 _period) internal {\n // Take into account period averaging for multiple unstake requests\n uint256 lockingPeriod = _period;\n if (stake.tokensLocked > 0) {\n lockingPeriod = stake.getLockingPeriod(_tokens, _period);\n }\n\n // Update balances\n stake.tokensLocked = stake.tokensLocked.add(_tokens);\n stake.tokensLockedUntil = block.number.add(lockingPeriod);\n }\n\n /**\n * @dev Unlock tokens.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unkock\n */\n function unlockTokens(Stakes.Indexer storage stake, uint256 _tokens) internal {\n stake.tokensLocked = stake.tokensLocked.sub(_tokens);\n if (stake.tokensLocked == 0) {\n stake.tokensLockedUntil = 0;\n }\n }\n\n /**\n * @dev Take all tokens out from the locked stake for withdrawal.\n * @param stake Stake data\n * @return Amount of tokens being withdrawn\n */\n function withdrawTokens(Stakes.Indexer storage stake) internal returns (uint256) {\n // Calculate tokens that can be released\n uint256 tokensToWithdraw = stake.tokensWithdrawable();\n\n if (tokensToWithdraw > 0) {\n // Reset locked tokens\n stake.unlockTokens(tokensToWithdraw);\n\n // Decrease indexer stake\n stake.release(tokensToWithdraw);\n }\n\n return tokensToWithdraw;\n }\n\n /**\n * @dev Get the locking period of the tokens to unstake.\n * If already unstaked before calculate the weighted average.\n * @param stake Stake data\n * @param _tokens Amount of tokens to unstake\n * @param _thawingPeriod Period in blocks that need to pass before withdrawal\n * @return True if staked\n */\n function getLockingPeriod(\n Stakes.Indexer memory stake,\n uint256 _tokens,\n uint256 _thawingPeriod\n ) internal view returns (uint256) {\n uint256 blockNum = block.number;\n uint256 periodA = (stake.tokensLockedUntil > blockNum) ? stake.tokensLockedUntil.sub(blockNum) : 0;\n uint256 periodB = _thawingPeriod;\n uint256 stakeA = stake.tokensLocked;\n uint256 stakeB = _tokens;\n return periodA.mul(stakeA).add(periodB.mul(stakeB)).div(stakeA.add(stakeB));\n }\n\n /**\n * @dev Return true if there are tokens staked by the Indexer.\n * @param stake Stake data\n * @return True if staked\n */\n function hasTokens(Stakes.Indexer memory stake) internal pure returns (bool) {\n return stake.tokensStaked > 0;\n }\n\n /**\n * @dev Return the amount of tokens used in allocations and locked for withdrawal.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensUsed(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAllocated.add(stake.tokensLocked);\n }\n\n /**\n * @dev Return the amount of tokens staked not considering the ones that are already going\n * through the thawing period or are ready for withdrawal. We call it secure stake because\n * it is not subject to change by a withdraw call from the indexer.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensSecureStake(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensStaked.sub(stake.tokensLocked);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for any purpose.\n * Any token that is allocated cannot be used as well as tokens that are going through the\n * thawing period or are withdrawable\n * Calc: tokensStaked - tokensAllocated - tokensLocked\n * @param stake Stake data\n * @return Token amount\n */\n function tokensAvailable(Stakes.Indexer memory stake) internal pure returns (uint256) {\n return stake.tokensAvailableWithDelegation(0);\n }\n\n /**\n * @dev Tokens free balance on the indexer stake that can be used for allocations.\n * This function accepts a parameter for extra delegated capacity that takes into\n * account delegated tokens\n * @param stake Stake data\n * @param _delegatedCapacity Amount of tokens used from delegators to calculate availability\n * @return Token amount\n */\n function tokensAvailableWithDelegation(\n Stakes.Indexer memory stake,\n uint256 _delegatedCapacity\n ) internal pure returns (uint256) {\n uint256 tokensCapacity = stake.tokensStaked.add(_delegatedCapacity);\n uint256 _tokensUsed = stake.tokensUsed();\n // If more tokens are used than the current capacity, the indexer is overallocated.\n // This means the indexer doesn't have available capacity to create new allocations.\n // We can reach this state when the indexer has funds allocated and then any\n // of these conditions happen:\n // - The delegationCapacity ratio is reduced.\n // - The indexer stake is slashed.\n // - A delegator removes enough stake.\n if (_tokensUsed > tokensCapacity) {\n // Indexer stake is over allocated: return 0 to avoid stake to be used until\n // the overallocation is restored by staking more tokens, unallocating tokens\n // or using more delegated funds\n return 0;\n }\n return tokensCapacity.sub(_tokensUsed);\n }\n\n /**\n * @dev Tokens available for withdrawal after thawing period.\n * @param stake Stake data\n * @return Token amount\n */\n function tokensWithdrawable(Stakes.Indexer memory stake) internal view returns (uint256) {\n // No tokens to withdraw before locking period\n if (stake.tokensLockedUntil == 0 || block.number < stake.tokensLockedUntil) {\n return 0;\n }\n return stake.tokensLocked;\n }\n}\n" + }, + "contracts/tests/StakingMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"./Stakes.sol\";\n\ncontract StakingMock {\n using SafeMath for uint256;\n using Stakes for Stakes.Indexer;\n\n // -- State --\n\n uint256 public minimumIndexerStake = 100e18;\n uint256 public thawingPeriod = 10; // 10 blocks\n IERC20 public token;\n\n // Indexer stakes : indexer => Stake\n mapping(address => Stakes.Indexer) public stakes;\n\n /**\n * @dev Emitted when `indexer` stake `tokens` amount.\n */\n event StakeDeposited(address indexed indexer, uint256 tokens);\n\n /**\n * @dev Emitted when `indexer` unstaked and locked `tokens` amount `until` block.\n */\n event StakeLocked(address indexed indexer, uint256 tokens, uint256 until);\n\n /**\n * @dev Emitted when `indexer` withdrew `tokens` staked.\n */\n event StakeWithdrawn(address indexed indexer, uint256 tokens);\n\n // Contract constructor.\n constructor(IERC20 _token) {\n require(address(_token) != address(0), \"!token\");\n token = _token;\n }\n\n receive() external payable {}\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _tokens Amount of tokens to stake\n */\n function stake(uint256 _tokens) external {\n stakeTo(msg.sender, _tokens);\n }\n\n /**\n * @dev Deposit tokens on the indexer stake.\n * @param _indexer Address of the indexer\n * @param _tokens Amount of tokens to stake\n */\n function stakeTo(address _indexer, uint256 _tokens) public {\n require(_tokens > 0, \"!tokens\");\n\n // Ensure minimum stake\n require(stakes[_indexer].tokensSecureStake().add(_tokens) >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Transfer tokens to stake from caller to this contract\n require(token.transferFrom(msg.sender, address(this), _tokens), \"!transfer\");\n\n // Stake the transferred tokens\n _stake(_indexer, _tokens);\n }\n\n /**\n * @dev Unstake tokens from the indexer stake, lock them until thawing period expires.\n * @param _tokens Amount of tokens to unstake\n */\n function unstake(uint256 _tokens) external {\n address indexer = msg.sender;\n Stakes.Indexer storage indexerStake = stakes[indexer];\n\n require(_tokens > 0, \"!tokens\");\n require(indexerStake.hasTokens(), \"!stake\");\n require(indexerStake.tokensAvailable() >= _tokens, \"!stake-avail\");\n\n // Ensure minimum stake\n uint256 newStake = indexerStake.tokensSecureStake().sub(_tokens);\n require(newStake == 0 || newStake >= minimumIndexerStake, \"!minimumIndexerStake\");\n\n // Before locking more tokens, withdraw any unlocked ones\n uint256 tokensToWithdraw = indexerStake.tokensWithdrawable();\n if (tokensToWithdraw > 0) {\n _withdraw(indexer);\n }\n\n indexerStake.lockTokens(_tokens, thawingPeriod);\n\n emit StakeLocked(indexer, indexerStake.tokensLocked, indexerStake.tokensLockedUntil);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n */\n function withdraw() external {\n _withdraw(msg.sender);\n }\n\n function _stake(address _indexer, uint256 _tokens) internal {\n // Deposit tokens into the indexer stake\n Stakes.Indexer storage indexerStake = stakes[_indexer];\n indexerStake.deposit(_tokens);\n\n emit StakeDeposited(_indexer, _tokens);\n }\n\n /**\n * @dev Withdraw indexer tokens once the thawing period has passed.\n * @param _indexer Address of indexer to withdraw funds from\n */\n function _withdraw(address _indexer) private {\n // Get tokens available for withdraw and update balance\n uint256 tokensToWithdraw = stakes[_indexer].withdrawTokens();\n require(tokensToWithdraw > 0, \"!tokens\");\n\n // Return tokens to the indexer\n require(token.transfer(_indexer, tokensToWithdraw), \"!transfer\");\n\n emit StakeWithdrawn(_indexer, tokensToWithdraw);\n }\n}\n" + }, + "contracts/tests/WalletMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.7.3;\npragma experimental ABIEncoderV2;\n\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\n\n/**\n * @title WalletMock: a mock wallet contract for testing purposes\n * @dev For testing only, DO NOT USE IN PRODUCTION.\n * This is used to test L1-L2 transfer tools and to create scenarios\n * where an invalid wallet calls the transfer tool, e.g. a wallet that has an invalid\n * manager, or a wallet that has not been initialized.\n */\ncontract WalletMock {\n /// Target contract for the fallback function (usually a transfer tool contract)\n address public immutable target;\n /// Address of the GRT (mock) token\n address public immutable token;\n /// Address of the wallet's manager\n address public immutable manager;\n /// Whether the wallet has been initialized\n bool public immutable isInitialized;\n /// Whether the beneficiary has accepted the lock\n bool public immutable isAccepted;\n\n /**\n * @notice WalletMock constructor\n * @dev This constructor sets all the state variables so that\n * specific test scenarios can be created just by deploying this contract.\n * @param _target Target contract for the fallback function\n * @param _token Address of the GRT (mock) token\n * @param _manager Address of the wallet's manager\n * @param _isInitialized Whether the wallet has been initialized\n * @param _isAccepted Whether the beneficiary has accepted the lock\n */\n constructor(address _target, address _token, address _manager, bool _isInitialized, bool _isAccepted) {\n target = _target;\n token = _token;\n manager = _manager;\n isInitialized = _isInitialized;\n isAccepted = _isAccepted;\n }\n\n /**\n * @notice Fallback function\n * @dev This function calls the target contract with the data sent to this contract.\n * This is used to test the L1-L2 transfer tool.\n */\n fallback() external payable {\n // Call function with data\n Address.functionCall(target, msg.data);\n }\n\n /**\n * @notice Receive function\n * @dev This function is added to avoid compiler warnings, but just reverts.\n */\n receive() external payable {\n revert(\"Invalid call\");\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": false, + "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/deployments/goerli/L1GraphTokenLockTransferTool.json b/deployments/goerli/L1GraphTokenLockTransferTool.json new file mode 100644 index 0000000..b65b71f --- /dev/null +++ b/deployments/goerli/L1GraphTokenLockTransferTool.json @@ -0,0 +1,593 @@ +{ + "address": "0x739a6BC599347adA0Cec67520559F46eA8B9155E", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_graphToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_l2Implementation", + "type": "address" + }, + { + "internalType": "contract ITokenGateway", + "name": "_l1Gateway", + "type": "address" + }, + { + "internalType": "address payable", + "name": "_staking", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "tokenLock", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ETHDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "tokenLock", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ETHPulled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "tokenLock", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ETHWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1LockManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2LockManager", + "type": "address" + } + ], + "name": "L2LockManagerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Wallet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Wallet", + "type": "address" + } + ], + "name": "L2WalletAddressSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1WalletOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2WalletOwner", + "type": "address" + } + ], + "name": "L2WalletOwnerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Wallet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Wallet", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l1LockManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "l2LockManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "LockedFundsSentToL2", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenLock", + "type": "address" + } + ], + "name": "depositETH", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_l2Beneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_maxGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_gasPriceBid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maxSubmissionCost", + "type": "uint256" + } + ], + "name": "depositToL2Locked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_salt", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "address", + "name": "_deployer", + "type": "address" + } + ], + "name": "getDeploymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "graphToken", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "l1Gateway", + "outputs": [ + { + "internalType": "contract ITokenGateway", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2Beneficiary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2Implementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2LockManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2WalletAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2WalletAddressSetManually", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "l2WalletOwner", + "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": "address", + "name": "_tokenLock", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "pullETH", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l1LockManager", + "type": "address" + }, + { + "internalType": "address", + "name": "_l2LockManager", + "type": "address" + } + ], + "name": "setL2LockManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l2Wallet", + "type": "address" + } + ], + "name": "setL2WalletAddressManually", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l1WalletOwner", + "type": "address" + }, + { + "internalType": "address", + "name": "_l2WalletOwner", + "type": "address" + } + ], + "name": "setL2WalletOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "staking", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "tokenLockETHBalances", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_destination", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawETH", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xb5573f00c85aa1e6030e886539169f1ac1efd2685cb6176d5a33ae92a4e6be34" +} \ No newline at end of file From a5f60aca7861271ff04e8398bfcce235b1c4fe21 Mon Sep 17 00:00:00 2001 From: Pablo Carranza Velez Date: Mon, 10 Jul 2023 20:53:44 -0300 Subject: [PATCH 5/5] chore: upgrade graphprotocol contracts to 5.0.0 --- package.json | 2 +- yarn.lock | 25 +++++++++++++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 62e7111..2493e52 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "devDependencies": { "@ethersproject/experimental": "^5.0.7", "@graphprotocol/client-cli": "^2.0.2", - "@graphprotocol/contracts": "^1.1.0", + "@graphprotocol/contracts": "^5.0.0", "@nomiclabs/hardhat-ethers": "^2.0.0", "@nomiclabs/hardhat-etherscan": "^3.1.7", "@nomiclabs/hardhat-waffle": "^2.0.0", diff --git a/yarn.lock b/yarn.lock index 1892afd..a08fe3b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1103,12 +1103,13 @@ "@repeaterjs/repeater" "^3.0.4" tslib "^2.4.0" -"@graphprotocol/contracts@^1.1.0": - version "1.17.0" - resolved "https://registry.yarnpkg.com/@graphprotocol/contracts/-/contracts-1.17.0.tgz#3bbcbaa855bfbdaf834b2cd4ec24cd8eed9ac4c5" - integrity sha512-wA2HfMfn9OieHkXdh5I1NnXJ/Sp5y7EVCA0reab+Vp5mJ8RFtMgObMr45iQqH4i1Ur8BUK/AdWhXUHqKh4YYpw== +"@graphprotocol/contracts@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@graphprotocol/contracts/-/contracts-5.0.0.tgz#b4602c2a4590c40a04238c9645b12e5816d7ef30" + integrity sha512-AxTJUz3atFyQSCoCY+YT1NLnrCJjTXsZSXO2lNnZwfTrs/W7Tkw/RJ9f4TWGjvtJ8aIJHS3suWjIWWqBWDR5aQ== dependencies: - ethers "^5.4.4" + console-table-printer "^2.11.1" + ethers "^5.6.0" "@graphql-codegen/core@3.1.0": version "3.1.0" @@ -4672,6 +4673,13 @@ consola@^2.15.0: resolved "https://registry.yarnpkg.com/consola/-/consola-2.15.3.tgz#2e11f98d6a4be71ff72e0bdf07bd23e12cb61550" integrity sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw== +console-table-printer@^2.11.1: + version "2.11.1" + resolved "https://registry.yarnpkg.com/console-table-printer/-/console-table-printer-2.11.1.tgz#c2dfe56e6343ea5bcfa3701a4be29fe912dbd9c7" + integrity sha512-8LfFpbF/BczoxPwo2oltto5bph8bJkGOATXsg3E9ddMJOGnWJciKHldx2zDj5XIBflaKzPfVCjOTl6tMh7lErg== + dependencies: + simple-wcswidth "^1.0.1" + constant-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/constant-case/-/constant-case-3.0.4.tgz#3b84a9aeaf4cf31ec45e6bf5de91bdfb0589faf1" @@ -6039,7 +6047,7 @@ ethers@^4.0.40: uuid "2.0.1" xmlhttprequest "1.8.0" -ethers@^5.0.1, ethers@^5.0.18, ethers@^5.0.2, ethers@^5.4.4, ethers@^5.5.2, ethers@^5.7.0, ethers@^5.7.1: +ethers@^5.0.1, ethers@^5.0.18, ethers@^5.0.2, ethers@^5.5.2, ethers@^5.6.0, ethers@^5.7.0, ethers@^5.7.1: version "5.7.2" resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== @@ -10599,6 +10607,11 @@ simple-get@^2.7.0: once "^1.3.1" simple-concat "^1.0.0" +simple-wcswidth@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/simple-wcswidth/-/simple-wcswidth-1.0.1.tgz#8ab18ac0ae342f9d9b629604e54d2aa1ecb018b2" + integrity sha512-xMO/8eNREtaROt7tJvWJqHBDTMFN4eiQ5I4JRMuilwfnFcV5W9u7RUkueNkdw0jPqGMX36iCywelS5yilTuOxg== + slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55"