{"file_path":"contracts/SimpleSwapFactory.sol","creation_status":"success","source_code":"// SPDX-License-Identifier: BSD-3-Clause\npragma solidity =0.7.6;\npragma abicoder v2;\nimport \"./ERC20SimpleSwap.sol\";\nimport \"@openzeppelin/contracts/proxy/Clones.sol\";\n\n/**\n@title Factory contract for SimpleSwap\n@author The Swarm Authors\n@notice This contract deploys SimpleSwap contracts\n*/\ncontract SimpleSwapFactory {\n\n  /* event fired on every new SimpleSwap deployment */\n  event SimpleSwapDeployed(address contractAddress);\n\n  /* mapping to keep track of which contracts were deployed by this factory */\n  mapping (address => bool) public deployedContracts;\n\n  /* address of the ERC20-token, to be used by the to-be-deployed chequebooks */\n  address public ERC20Address;\n  /* address of the code contract from which all chequebooks are cloned */\n  address public master;\n\n  constructor(address _ERC20Address) {\n    ERC20Address = _ERC20Address;\n    ERC20SimpleSwap _master = new ERC20SimpleSwap();\n    // set the issuer of the master contract to prevent misuse\n    _master.init(address(1), address(0), 0);\n    master = address(_master);\n  }\n  /**\n  @notice creates a clone of the master SimpleSwap contract\n  @param issuer the issuer of cheques for the new chequebook\n  @param defaultHardDepositTimeoutDuration duration in seconds which by default will be used to reduce hardDeposit allocations\n  @param salt salt to include in create2 to enable the same address to deploy multiple chequebooks\n  */\n  function deploySimpleSwap(address issuer, uint defaultHardDepositTimeoutDuration, bytes32 salt)\n  public returns (address) {    \n    address contractAddress = Clones.cloneDeterministic(master, keccak256(abi.encode(msg.sender, salt)));\n    ERC20SimpleSwap(contractAddress).init(issuer, ERC20Address, defaultHardDepositTimeoutDuration);\n    deployedContracts[contractAddress] = true;\n    emit SimpleSwapDeployed(contractAddress);\n    return contractAddress;\n  }\n}","deployed_bytecode":"0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806315efd8a714610051578063a6021ace1461007a578063c70242ad14610082578063ee97f7f3146100a2575b600080fd5b61006461005f3660046102d6565b6100aa565b6040516100719190610308565b60405180910390f35b6100646101bb565b6100956100903660046102b5565b6101ca565b6040516100719190610359565b6100646101df565b60025460405160009182916100ee916001600160a01b0316906100d3903390879060200161031c565b604051602081830303815290604052805190602001206101ee565b6001546040516343431f6360e11b81529192506001600160a01b03808416926386863ec692610126928a929116908990600401610335565b600060405180830381600087803b15801561014057600080fd5b505af1158015610154573d6000803e3d6000fd5b5050506001600160a01b03821660009081526020819052604090819020805460ff19166001179055517fc0ffc525a1c7689549d7f79b49eca900e61ac49b43d977f680bcc3b36224c00491506101ab908390610308565b60405180910390a1949350505050565b6001546001600160a01b031681565b60006020819052908152604090205460ff1681565b6002546001600160a01b031681565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528360601b60148201526e5af43d82803e903d91602b57fd5bf360881b6028820152826037826000f59150506001600160a01b038116610293576040805162461bcd60e51b815260206004820152601760248201527f455243313136373a2063726561746532206661696c6564000000000000000000604482015290519081900360640190fd5b92915050565b80356001600160a01b03811681146102b057600080fd5b919050565b6000602082840312156102c6578081fd5b6102cf82610299565b9392505050565b6000806000606084860312156102ea578182fd5b6102f384610299565b95602085013595506040909401359392505050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b90151581526020019056fea2646970667358221220879500e712d6cdee6e7b2cc582fef56f09aa010787a01406fe50796b05d33cba64736f6c63430007060033","optimization_enabled":true,"verified_twin_address_hash":null,"is_verified":true,"compiler_settings":{"evmVersion":"istanbul","libraries":{},"metadata":{"bytecodeHash":"ipfs","useLiteralContent":false},"optimizer":{"enabled":true,"runs":200},"outputSelection":{"*":{"":["*"],"*":["*"]}},"remappings":["@ensdomains/=node_modules/@ensdomains/","@ethereum-waffle/=node_modules/@ethereum-waffle/","@openzeppelin/=node_modules/@openzeppelin/","eth-gas-reporter/=node_modules/eth-gas-reporter/","hardhat-deploy/=node_modules/hardhat-deploy/","hardhat/=node_modules/hardhat/"],"viaIR":false},"optimization_runs":200,"sourcify_repo_url":null,"decoded_constructor_args":[["0x239Db952bde69A15962436C6CD86FDd3b45342e4",{"internalType":"address","name":"_ERC20Address","type":"address"}]],"compiler_version":"v0.7.6+commit.7338295f","is_verified_via_verifier_alliance":false,"verified_at":"2025-11-25T16:52:03.413611Z","implementations":[],"proxy_type":null,"external_libraries":[],"creation_bytecode":"0x608060405234801561001057600080fd5b50604051611df2380380611df283398101604081905261002f91610112565b600180546001600160a01b0319166001600160a01b03831617905560405160009061005990610105565b604051809103906000f080158015610075573d6000803e3d6000fd5b506040516343431f6360e11b81529091506001600160a01b038216906386863ec6906100ab906001906000908190600401610140565b600060405180830381600087803b1580156100c557600080fd5b505af11580156100d9573d6000803e3d6000fd5b5050600280546001600160a01b0319166001600160a01b03949094169390931790925550610164915050565b6118e58061050d83390190565b600060208284031215610123578081fd5b81516001600160a01b0381168114610139578182fd5b9392505050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b61039a806101736000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806315efd8a714610051578063a6021ace1461007a578063c70242ad14610082578063ee97f7f3146100a2575b600080fd5b61006461005f3660046102d6565b6100aa565b6040516100719190610308565b60405180910390f35b6100646101bb565b6100956100903660046102b5565b6101ca565b6040516100719190610359565b6100646101df565b60025460405160009182916100ee916001600160a01b0316906100d3903390879060200161031c565b604051602081830303815290604052805190602001206101ee565b6001546040516343431f6360e11b81529192506001600160a01b03808416926386863ec692610126928a929116908990600401610335565b600060405180830381600087803b15801561014057600080fd5b505af1158015610154573d6000803e3d6000fd5b5050506001600160a01b03821660009081526020819052604090819020805460ff19166001179055517fc0ffc525a1c7689549d7f79b49eca900e61ac49b43d977f680bcc3b36224c00491506101ab908390610308565b60405180910390a1949350505050565b6001546001600160a01b031681565b60006020819052908152604090205460ff1681565b6002546001600160a01b031681565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528360601b60148201526e5af43d82803e903d91602b57fd5bf360881b6028820152826037826000f59150506001600160a01b038116610293576040805162461bcd60e51b815260206004820152601760248201527f455243313136373a2063726561746532206661696c6564000000000000000000604482015290519081900360640190fd5b92915050565b80356001600160a01b03811681146102b057600080fd5b919050565b6000602082840312156102c6578081fd5b6102cf82610299565b9392505050565b6000806000606084860312156102ea578182fd5b6102f384610299565b95602085013595506040909401359392505050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b90151581526020019056fea2646970667358221220879500e712d6cdee6e7b2cc582fef56f09aa010787a01406fe50796b05d33cba64736f6c63430007060033608060405234801561001057600080fd5b506118c5806100206000396000f3fe608060405234801561001057600080fd5b506004361061014d5760003560e01c8063946f46a2116100c3578063b7ec1a331161007c578063b7ec1a331461027f578063c49f91d314610287578063c76a4d311461028f578063d4c9a8e8146102a2578063e0bcf13a146102b5578063fc0c546a146102bd5761014d565b8063946f46a214610211578063b6343b0d14610224578063b648b41714610247578063b69ef8a81461025c578063b777035014610264578063b7998907146102775761014d565b80631d143848116101155780631d143848146101a85780632e1a7d4d146101bd578063338f3fed146101d0578063488b017c146101e357806381f03fcb146101eb57806386863ec6146101fe5761014d565b80630d5f26591461015257806312101021146101675780631357e1dc1461018557806315c3343f1461018d5780631633fb1d14610195575b600080fd5b61016561016036600461146b565b6102c5565b005b61016f6102d8565b60405161017c9190611563565b60405180910390f35b61016f6102de565b61016f6102e4565b6101656101a33660046113ae565b610308565b6101b061036c565b60405161017c919061152b565b6101656101cb3660046114e0565b61037b565b6101656101de366004611442565b610473565b61016f610556565b61016f6101f9366004611359565b61057a565b61016561020c366004611373565b61058c565b61016561021f366004611359565b610610565b610237610232366004611359565b6106d0565b60405161017c94939291906115c7565b61024f6106f7565b60405161017c9190611558565b61016f610707565b610165610272366004611442565b61078d565b61016f610867565b61016f61088b565b61016f6108a1565b61016f61029d366004611359565b6108c5565b6101656102b036600461146b565b6108f8565b61016f6109b4565b6101b06109ba565b6102d33384846000856109c9565b505050565b60005481565b60035481565b7f48ebe6deff4a5ee645c01506a026031e2a945d6f41f1f4e5098ad65347492c1281565b61031e6103183033878987610dd2565b84610e30565b6001600160a01b0316866001600160a01b0316146103575760405162461bcd60e51b815260040161034e906117d5565b60405180910390fd5b61036486868685856109c9565b505050505050565b6006546001600160a01b031681565b6006546001600160a01b031633146103a55760405162461bcd60e51b815260040161034e906115e2565b6103ad61088b565b8111156103cc5760405162461bcd60e51b815260040161034e90611695565b60015460065460405163a9059cbb60e01b81526001600160a01b039283169263a9059cbb9261040292911690859060040161153f565b602060405180830381600087803b15801561041c57600080fd5b505af1158015610430573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045491906114c0565b6104705760405162461bcd60e51b815260040161034e9061180c565b50565b6006546001600160a01b0316331461049d5760405162461bcd60e51b815260040161034e90611665565b6104a5610707565b6005546104b29083610e7f565b11156104d05760405162461bcd60e51b815260040161034e90611730565b6001600160a01b038216600090815260046020526040902080546104f49083610e7f565b81556005546105039083610e7f565b6005556000600382015580546040516001600160a01b038516917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad916105499190611563565b60405180910390a2505050565b7f7d824962dd0f01520922ea1766c987b1db570cd5db90bdba5ccf5e320607950281565b60026020526000908152604090205481565b6001600160a01b0383166105b25760405162461bcd60e51b815260040161034e9061163d565b6006546001600160a01b0316156105db5760405162461bcd60e51b815260040161034e906116cc565b600680546001600160a01b039485166001600160a01b0319918216179091556001805493909416921691909117909155600055565b6001600160a01b03811660009081526004602052604090206003810154421080159061063f5750600381015415155b61065b5760405162461bcd60e51b815260040161034e90611606565b6001810154815461066b91610ee0565b815560006003820155600181015460055461068591610ee0565b60055580546040516001600160a01b038416917f2506c43272ded05d095b91dbba876e66e46888157d3e078db5691496e96c5fad916106c49190611563565b60405180910390a25050565b60046020526000908152604090208054600182015460028301546003909301549192909184565b600654600160a01b900460ff1681565b6001546040516370a0823160e01b81526000916001600160a01b0316906370a082319061073890309060040161152b565b60206040518083038186803b15801561075057600080fd5b505afa158015610764573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078891906114f8565b905090565b6006546001600160a01b031633146107b75760405162461bcd60e51b815260040161034e90611665565b6001600160a01b038216600090815260046020526040902080548211156107f05760405162461bcd60e51b815260040161034e906116f9565b6000816002015460001461080857816002015461080c565b6000545b4281016003840155600183018490556040519091506001600160a01b038516907fc8305077b495025ec4c1d977b176a762c350bb18cad4666ce1ee85c32b78698a90610859908690611563565b60405180910390a250505050565b7fe95f353750f192082df064ca5142d3a2d6f0bef0f3ffad66d80d8af86b7a749a81565b600061078860055461089b610707565b90610ee0565b7fc2f8787176b8ac6bf7215b4adcc1e069bf4ab82d9ab1df05a57a91d425935b6e81565b6001600160a01b0381166000908152600460205260408120546108f0906108ea61088b565b90610e7f565b90505b919050565b6006546001600160a01b031633146109225760405162461bcd60e51b815260040161034e906115e2565b610936610930308585610f3d565b82610e30565b6001600160a01b0316836001600160a01b0316146109665760405162461bcd60e51b815260040161034e906117d5565b6001600160a01b03831660008181526004602052604090819020600201849055517f7b816003a769eb718bd9c66bdbd2dd5827da3f92bc6645276876bd7957b08cf090610549908590611563565b60055481565b6001546001600160a01b031681565b6006546001600160a01b03163314610a16576109e9610930308786610f95565b6006546001600160a01b03908116911614610a165760405162461bcd60e51b815260040161034e9061179e565b6001600160a01b038516600090815260026020526040812054610a3a908590610ee0565b90506000610a5082610a4b896108c5565b610fce565b6001600160a01b03881660009081526004602052604081205491925090610a78908390610fce565b905084821015610a9a5760405162461bcd60e51b815260040161034e90611767565b8015610aed576001600160a01b038816600090815260046020526040902054610ac39082610ee0565b6001600160a01b038916600090815260046020526040902055600554610ae99082610ee0565b6005555b6001600160a01b038816600090815260026020526040902054610b109083610e7f565b6001600160a01b038916600090815260026020526040902055600354610b369083610e7f565b600355828214610b7d576006805460ff60a01b1916600160a01b1790556040517f3f4449c047e11092ec54dc0751b6b4817a9162745de856c893a26e611d18ffc490600090a15b8415610ccf5760015460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb90610bb5903390899060040161153f565b602060405180830381600087803b158015610bcf57600080fd5b505af1158015610be3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0791906114c0565b610c235760405162461bcd60e51b815260040161034e9061180c565b6001546001600160a01b031663a9059cbb88610c3f8589610ee0565b6040518363ffffffff1660e01b8152600401610c5c92919061153f565b602060405180830381600087803b158015610c7657600080fd5b505af1158015610c8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cae91906114c0565b610cca5760405162461bcd60e51b815260040161034e9061180c565b610d6f565b60015460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb90610d01908a90869060040161153f565b602060405180830381600087803b158015610d1b57600080fd5b505af1158015610d2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5391906114c0565b610d6f5760405162461bcd60e51b815260040161034e9061180c565b336001600160a01b0316876001600160a01b0316896001600160a01b03167f950494fc3642fae5221b6c32e0e45765c95ebb382a04a71b160db0843e74c99f858a8a604051610dc093929190611835565b60405180910390a45050505050505050565b60007f7d824962dd0f01520922ea1766c987b1db570cd5db90bdba5ccf5e32060795028686868686604051602001610e0f96959493929190611591565b60405160208183030381529060405280519060200120905095945050505050565b600080610e43610e3e610fe4565b61103e565b84604051602001610e55929190611510565b604051602081830303815290604052805190602001209050610e7781846110ae565b949350505050565b600082820183811015610ed9576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600082821115610f37576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60007fe95f353750f192082df064ca5142d3a2d6f0bef0f3ffad66d80d8af86b7a749a848484604051602001610f76949392919061156c565b6040516020818303038152906040528051906020012090509392505050565b60007f48ebe6deff4a5ee645c01506a026031e2a945d6f41f1f4e5098ad65347492c12848484604051602001610f76949392919061156c565b6000818310610fdd5781610ed9565b5090919050565b610fec6112ac565b506040805160a081018252600a6060820190815269436865717565626f6f6b60b01b608083015281528151808301835260038152620312e360ec1b602082810191909152820152469181019190915290565b60007fc2f8787176b8ac6bf7215b4adcc1e069bf4ab82d9ab1df05a57a91d425935b6e826000015180519060200120836020015180519060200120846040015160405160200161109194939291906115c7565b604051602081830303815290604052805190602001209050919050565b60008151604114611106576040805162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015290519081900360640190fd5b60208201516040830151606084015160001a6111248682858561112e565b9695505050505050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a082111561118f5760405162461bcd60e51b815260040180806020018281038252602281526020018061184c6022913960400191505060405180910390fd5b8360ff16601b14806111a457508360ff16601c145b6111df5760405162461bcd60e51b815260040180806020018281038252602281526020018061186e6022913960400191505060405180910390fd5b600060018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa15801561123b573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166112a3576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b95945050505050565b60405180606001604052806060815260200160608152602001600081525090565b80356001600160a01b03811681146108f357600080fd5b600082601f8301126112f4578081fd5b813567ffffffffffffffff8082111561130957fe5b604051601f8301601f19168101602001828111828210171561132757fe5b60405282815284830160200186101561133e578384fd5b82602086016020830137918201602001929092529392505050565b60006020828403121561136a578081fd5b610ed9826112cd565b600080600060608486031215611387578182fd5b611390846112cd565b925061139e602085016112cd565b9150604084013590509250925092565b60008060008060008060c087890312156113c6578182fd5b6113cf876112cd565b95506113dd602088016112cd565b945060408701359350606087013567ffffffffffffffff80821115611400578384fd5b61140c8a838b016112e4565b94506080890135935060a0890135915080821115611428578283fd5b5061143589828a016112e4565b9150509295509295509295565b60008060408385031215611454578182fd5b61145d836112cd565b946020939093013593505050565b60008060006060848603121561147f578283fd5b611488846112cd565b925060208401359150604084013567ffffffffffffffff8111156114aa578182fd5b6114b6868287016112e4565b9150509250925092565b6000602082840312156114d1578081fd5b81518015158114610ed9578182fd5b6000602082840312156114f1578081fd5b5035919050565b600060208284031215611509578081fd5b5051919050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b9384526001600160a01b03928316602085015291166040830152606082015260800190565b9586526001600160a01b03948516602087015292841660408601526060850191909152909116608083015260a082015260c00190565b93845260208401929092526040830152606082015260800190565b6020808252600a90820152693737ba1034b9b9bab2b960b11b604082015260600190565b60208082526019908201527f6465706f736974206e6f74207965742074696d6564206f757400000000000000604082015260600190565b6020808252600e908201526d34b73b30b634b21034b9b9bab2b960911b604082015260600190565b60208082526016908201527529b4b6b83632a9bbb0b81d103737ba1034b9b9bab2b960511b604082015260600190565b6020808252601c908201527f6c697175696442616c616e6365206e6f742073756666696369656e7400000000604082015260600190565b602080825260139082015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604082015260600190565b6020808252601b908201527f68617264206465706f736974206e6f742073756666696369656e740000000000604082015260600190565b6020808252601c908201527f68617264206465706f73697420657863656564732062616c616e636500000000604082015260600190565b6020808252601d908201527f53696d706c65537761703a2063616e6e6f74207061792063616c6c6572000000604082015260600190565b60208082526018908201527f696e76616c696420697373756572207369676e61747572650000000000000000604082015260600190565b6020808252601d908201527f696e76616c69642062656e6566696369617279207369676e6174757265000000604082015260600190565b6020808252600f908201526e1d1c985b9cd9995c8819985a5b1959608a1b604082015260600190565b928352602083019190915260408201526060019056fe45434453413a20696e76616c6964207369676e6174757265202773272076616c756545434453413a20696e76616c6964207369676e6174757265202776272076616c7565a264697066735822122003b4d7b34ba9618525aadaaa284c74578496e5bae3a8f0b479d84dd43e25d1f864736f6c63430007060033000000000000000000000000239db952bde69a15962436c6cd86fdd3b45342e4","name":"SimpleSwapFactory","is_blueprint":false,"license_type":"none","is_fully_verified":false,"is_verified_via_eth_bytecode_db":true,"language":"solidity","evm_version":"istanbul","can_be_visualized_via_sol2uml":true,"is_verified_via_sourcify":false,"additional_sources":[{"file_path":"node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol","source_code":"// 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"},{"file_path":"contracts/ERC20SimpleSwap.sol","source_code":"// SPDX-License-Identifier: BSD-3-Clause\npragma solidity =0.7.6;\npragma abicoder v2;\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\nimport \"@openzeppelin/contracts/math/Math.sol\";\nimport \"@openzeppelin/contracts/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/presets/ERC20PresetMinterPauser.sol\";\n\n/**\n@title Chequebook contract without waivers\n@author The Swarm Authors\n@notice The chequebook contract allows the issuer of the chequebook to send cheques to an unlimited amount of counterparties.\nFurthermore, solvency can be guaranteed via hardDeposits\n@dev as an issuer, no cheques should be send if the cumulative worth of a cheques send is above the cumulative worth of all deposits\nas a beneficiary, we should always take into account the possibility that a cheque bounces (when no hardDeposits are assigned)\n*/\ncontract ERC20SimpleSwap {\n    using SafeMath for uint;\n\n    event ChequeCashed(\n        address indexed beneficiary,\n        address indexed recipient,\n        address indexed caller,\n        uint totalPayout,\n        uint cumulativePayout,\n        uint callerPayout\n    );\n    event ChequeBounced();\n    event HardDepositAmountChanged(address indexed beneficiary, uint amount);\n    event HardDepositDecreasePrepared(\n        address indexed beneficiary,\n        uint decreaseAmount\n    );\n    event HardDepositTimeoutChanged(address indexed beneficiary, uint timeout);\n    event Withdraw(uint amount);\n\n    uint public defaultHardDepositTimeout;\n    /* structure to keep track of the hard deposits (on-chain guarantee of solvency) per beneficiary*/\n    struct HardDeposit {\n        uint amount /* hard deposit amount allocated */;\n        uint decreaseAmount /* decreaseAmount substranced from amount when decrease is requested */;\n        uint timeout /* issuer has to wait timeout seconds to decrease hardDeposit, 0 implies applying defaultHardDepositTimeout */;\n        uint canBeDecreasedAt /* point in time after which harddeposit can be decreased*/;\n    }\n\n    struct EIP712Domain {\n        string name;\n        string version;\n        uint256 chainId;\n    }\n\n    bytes32 public constant EIP712DOMAIN_TYPEHASH =\n        keccak256(\"EIP712Domain(string name,string version,uint256 chainId)\");\n    bytes32 public constant CHEQUE_TYPEHASH =\n        keccak256(\n            \"Cheque(address chequebook,address beneficiary,uint256 cumulativePayout)\"\n        );\n    bytes32 public constant CASHOUT_TYPEHASH =\n        keccak256(\n            \"Cashout(address chequebook,address sender,uint256 requestPayout,address recipient,uint256 callerPayout)\"\n        );\n    bytes32 public constant CUSTOMDECREASETIMEOUT_TYPEHASH =\n        keccak256(\n            \"CustomDecreaseTimeout(address chequebook,address beneficiary,uint256 decreaseTimeout)\"\n        );\n\n    // the EIP712 domain this contract uses\n    function domain() internal pure returns (EIP712Domain memory) {\n        uint256 chainId;\n        assembly {\n            chainId := chainid()\n        }\n        return\n            EIP712Domain({\n                name: \"Chequebook\",\n                version: \"1.0\",\n                chainId: chainId\n            });\n    }\n\n    // compute the EIP712 domain separator. this cannot be constant because it depends on chainId\n    function domainSeparator(\n        EIP712Domain memory eip712Domain\n    ) internal pure returns (bytes32) {\n        return\n            keccak256(\n                abi.encode(\n                    EIP712DOMAIN_TYPEHASH,\n                    keccak256(bytes(eip712Domain.name)),\n                    keccak256(bytes(eip712Domain.version)),\n                    eip712Domain.chainId\n                )\n            );\n    }\n\n    // recover a signature with the EIP712 signing scheme\n    function recoverEIP712(\n        bytes32 hash,\n        bytes memory sig\n    ) internal pure returns (address) {\n        bytes32 digest = keccak256(\n            abi.encodePacked(\"\\x19\\x01\", domainSeparator(domain()), hash)\n        );\n        return ECDSA.recover(digest, sig);\n    }\n\n    /* The token against which this chequebook writes cheques */\n    ERC20 public token;\n    /* associates every beneficiary with how much has been paid out to them */\n    mapping(address => uint) public paidOut;\n    /* total amount paid out */\n    uint public totalPaidOut;\n    /* associates every beneficiary with their HardDeposit */\n    mapping(address => HardDeposit) public hardDeposits;\n    /* sum of all hard deposits */\n    uint public totalHardDeposit;\n    /* issuer of the contract, set at construction */\n    address public issuer;\n    /* indicates wether a cheque bounced in the past */\n    bool public bounced;\n\n    /**\n  @notice sets the issuer, token and the defaultHardDepositTimeout. can only be called once.\n  @param _issuer the issuer of cheques from this chequebook (needed as an argument for \"Setting up a chequebook as a payment\").\n  _issuer must be an Externally Owned Account, or it must support calling the function cashCheque\n  @param _token the token this chequebook uses\n  @param _defaultHardDepositTimeout duration in seconds which by default will be used to reduce hardDeposit allocations\n  */\n    function init(\n        address _issuer,\n        address _token,\n        uint _defaultHardDepositTimeout\n    ) public {\n        require(_issuer != address(0), \"invalid issuer\");\n        require(issuer == address(0), \"already initialized\");\n        issuer = _issuer;\n        token = ERC20(_token);\n        defaultHardDepositTimeout = _defaultHardDepositTimeout;\n    }\n\n    /// @return the balance of the chequebook\n    function balance() public view returns (uint) {\n        return token.balanceOf(address(this));\n    }\n\n    /// @return the part of the balance that is not covered by hard deposits\n    function liquidBalance() public view returns (uint) {\n        return balance().sub(totalHardDeposit);\n    }\n\n    /// @return the part of the balance available for a specific beneficiary\n    function liquidBalanceFor(address beneficiary) public view returns (uint) {\n        return liquidBalance().add(hardDeposits[beneficiary].amount);\n    }\n\n    /**\n  @dev internal function responsible for checking the issuerSignature, updating hardDeposit balances and doing transfers.\n  Called by cashCheque and cashChequeBeneficary\n  @param beneficiary the beneficiary to which cheques were assigned. Beneficiary must be an Externally Owned Account\n  @param recipient receives the differences between cumulativePayment and what was already paid-out to the beneficiary minus callerPayout\n  @param cumulativePayout cumulative amount of cheques assigned to beneficiary\n  @param issuerSig if issuer is not the sender, issuer must have given explicit approval on the cumulativePayout to the beneficiary\n  */\n    function _cashChequeInternal(\n        address beneficiary,\n        address recipient,\n        uint cumulativePayout,\n        uint callerPayout,\n        bytes memory issuerSig\n    ) internal {\n        /* The issuer must have given explicit approval to the cumulativePayout, either by being the caller or by signature*/\n        if (msg.sender != issuer) {\n            require(\n                issuer ==\n                    recoverEIP712(\n                        chequeHash(\n                            address(this),\n                            beneficiary,\n                            cumulativePayout\n                        ),\n                        issuerSig\n                    ),\n                \"invalid issuer signature\"\n            );\n        }\n        /* the requestPayout is the amount requested for payment processing */\n        uint requestPayout = cumulativePayout.sub(paidOut[beneficiary]);\n        /* calculates acutal payout */\n        uint totalPayout = Math.min(\n            requestPayout,\n            liquidBalanceFor(beneficiary)\n        );\n        /* calculates hard-deposit usage */\n        uint hardDepositUsage = Math.min(\n            totalPayout,\n            hardDeposits[beneficiary].amount\n        );\n        require(totalPayout >= callerPayout, \"SimpleSwap: cannot pay caller\");\n        /* if there are some of the hard deposit used, update hardDeposits*/\n        if (hardDepositUsage != 0) {\n            hardDeposits[beneficiary].amount = hardDeposits[beneficiary]\n                .amount\n                .sub(hardDepositUsage);\n\n            totalHardDeposit = totalHardDeposit.sub(hardDepositUsage);\n        }\n        /* increase the stored paidOut amount to avoid double payout */\n        paidOut[beneficiary] = paidOut[beneficiary].add(totalPayout);\n        totalPaidOut = totalPaidOut.add(totalPayout);\n\n        /* let the world know that the issuer has over-promised on outstanding cheques */\n        if (requestPayout != totalPayout) {\n            bounced = true;\n            emit ChequeBounced();\n        }\n\n        if (callerPayout != 0) {\n            /* do a transfer to the caller if specified*/\n            require(\n                token.transfer(msg.sender, callerPayout),\n                \"transfer failed\"\n            );\n            /* do the actual payment */\n            require(\n                token.transfer(recipient, totalPayout.sub(callerPayout)),\n                \"transfer failed\"\n            );\n        } else {\n            /* do the actual payment */\n            require(token.transfer(recipient, totalPayout), \"transfer failed\");\n        }\n\n        emit ChequeCashed(\n            beneficiary,\n            recipient,\n            msg.sender,\n            totalPayout,\n            cumulativePayout,\n            callerPayout\n        );\n    }\n\n    /**\n  @notice cash a cheque of the beneficiary by a non-beneficiary and reward the sender for doing so with callerPayout\n  @dev a beneficiary must be able to generate signatures (be an Externally Owned Account) to make use of this feature\n  @param beneficiary the beneficiary to which cheques were assigned. Beneficiary must be an Externally Owned Account\n  @param recipient receives the differences between cumulativePayment and what was already paid-out to the beneficiary minus callerPayout\n  @param cumulativePayout cumulative amount of cheques assigned to beneficiary\n  @param beneficiarySig beneficiary must have given explicit approval for cashing out the cumulativePayout by the sender and sending the callerPayout\n  @param issuerSig if issuer is not the sender, issuer must have given explicit approval on the cumulativePayout to the beneficiary\n  @param callerPayout when beneficiary does not have ether yet, he can incentivize other people to cash cheques with help of callerPayout\n  @param issuerSig if issuer is not the sender, issuer must have given explicit approval on the cumulativePayout to the beneficiary\n  */\n    function cashCheque(\n        address beneficiary,\n        address recipient,\n        uint cumulativePayout,\n        bytes memory beneficiarySig,\n        uint256 callerPayout,\n        bytes memory issuerSig\n    ) public {\n        require(\n            beneficiary ==\n                recoverEIP712(\n                    cashOutHash(\n                        address(this),\n                        msg.sender,\n                        cumulativePayout,\n                        recipient,\n                        callerPayout\n                    ),\n                    beneficiarySig\n                ),\n            \"invalid beneficiary signature\"\n        );\n        _cashChequeInternal(\n            beneficiary,\n            recipient,\n            cumulativePayout,\n            callerPayout,\n            issuerSig\n        );\n    }\n\n    /**\n  @notice cash a cheque as beneficiary\n  @param recipient receives the differences between cumulativePayment and what was already paid-out to the beneficiary minus callerPayout\n  @param cumulativePayout amount requested to pay out\n  @param issuerSig issuer must have given explicit approval on the cumulativePayout to the beneficiary\n  */\n    function cashChequeBeneficiary(\n        address recipient,\n        uint cumulativePayout,\n        bytes memory issuerSig\n    ) public {\n        _cashChequeInternal(\n            msg.sender,\n            recipient,\n            cumulativePayout,\n            0,\n            issuerSig\n        );\n    }\n\n    /**\n  @notice prepare to decrease the hard deposit\n  @dev decreasing hardDeposits must be done in two steps to allow beneficiaries to cash any uncashed cheques (and make use of the assgined hard-deposits)\n  @param beneficiary beneficiary whose hard deposit should be decreased\n  @param decreaseAmount amount that the deposit is supposed to be decreased by\n  */\n    function prepareDecreaseHardDeposit(\n        address beneficiary,\n        uint decreaseAmount\n    ) public {\n        require(msg.sender == issuer, \"SimpleSwap: not issuer\");\n        HardDeposit storage hardDeposit = hardDeposits[beneficiary];\n        /* cannot decrease it by more than the deposit */\n        require(\n            decreaseAmount <= hardDeposit.amount,\n            \"hard deposit not sufficient\"\n        );\n        // if hardDeposit.timeout was never set, apply defaultHardDepositTimeout\n        uint timeout = hardDeposit.timeout == 0\n            ? defaultHardDepositTimeout\n            : hardDeposit.timeout;\n        hardDeposit.canBeDecreasedAt = block.timestamp + timeout;\n        hardDeposit.decreaseAmount = decreaseAmount;\n        emit HardDepositDecreasePrepared(beneficiary, decreaseAmount);\n    }\n\n    /**\n  @notice decrease the hard deposit after waiting the necesary amount of time since prepareDecreaseHardDeposit was called\n  @param beneficiary beneficiary whose hard deposit should be decreased\n  */\n    function decreaseHardDeposit(address beneficiary) public {\n        HardDeposit storage hardDeposit = hardDeposits[beneficiary];\n        require(\n            block.timestamp >= hardDeposit.canBeDecreasedAt &&\n                hardDeposit.canBeDecreasedAt != 0,\n            \"deposit not yet timed out\"\n        );\n        /* this throws if decreaseAmount > amount */\n        //TODO: if there is a cash-out in between prepareDecreaseHardDeposit and decreaseHardDeposit, decreaseHardDeposit will throw and reducing hard-deposits is impossible.\n        hardDeposit.amount = hardDeposit.amount.sub(hardDeposit.decreaseAmount);\n        /* reset the canBeDecreasedAt to avoid a double decrease */\n        hardDeposit.canBeDecreasedAt = 0;\n        /* keep totalDeposit in sync */\n        totalHardDeposit = totalHardDeposit.sub(hardDeposit.decreaseAmount);\n        emit HardDepositAmountChanged(beneficiary, hardDeposit.amount);\n    }\n\n    /**\n  @notice increase the hard deposit\n  @param beneficiary beneficiary whose hard deposit should be decreased\n  @param amount the new hard deposit\n  */\n    function increaseHardDeposit(address beneficiary, uint amount) public {\n        require(msg.sender == issuer, \"SimpleSwap: not issuer\");\n        /* ensure hard deposits don't exceed the global balance */\n        require(\n            totalHardDeposit.add(amount) <= balance(),\n            \"hard deposit exceeds balance\"\n        );\n\n        HardDeposit storage hardDeposit = hardDeposits[beneficiary];\n        hardDeposit.amount = hardDeposit.amount.add(amount);\n        // we don't explicitely set hardDepositTimout, as zero means using defaultHardDepositTimeout\n        totalHardDeposit = totalHardDeposit.add(amount);\n        /* disable any pending decrease */\n        hardDeposit.canBeDecreasedAt = 0;\n        emit HardDepositAmountChanged(beneficiary, hardDeposit.amount);\n    }\n\n    /**\n  @notice allows for setting a custom hardDepositDecreaseTimeout per beneficiary\n  @dev this is required when solvency must be guaranteed for a period longer than the defaultHardDepositDecreaseTimeout\n  @param beneficiary beneficiary whose hard deposit decreaseTimeout must be changed\n  @param hardDepositTimeout new hardDeposit.timeout for beneficiary\n  @param beneficiarySig beneficiary must give explicit approval by giving his signature on the new decreaseTimeout\n  */\n    function setCustomHardDepositTimeout(\n        address beneficiary,\n        uint hardDepositTimeout,\n        bytes memory beneficiarySig\n    ) public {\n        require(msg.sender == issuer, \"not issuer\");\n        require(\n            beneficiary ==\n                recoverEIP712(\n                    customDecreaseTimeoutHash(\n                        address(this),\n                        beneficiary,\n                        hardDepositTimeout\n                    ),\n                    beneficiarySig\n                ),\n            \"invalid beneficiary signature\"\n        );\n        hardDeposits[beneficiary].timeout = hardDepositTimeout;\n        emit HardDepositTimeoutChanged(beneficiary, hardDepositTimeout);\n    }\n\n    /// @notice withdraw ether\n    /// @param amount amount to withdraw\n    // solhint-disable-next-line no-simple-event-func-name\n    function withdraw(uint amount) public {\n        /* only issuer can do this */\n        require(msg.sender == issuer, \"not issuer\");\n        /* ensure we don't take anything from the hard deposit */\n        require(amount <= liquidBalance(), \"liquidBalance not sufficient\");\n        require(token.transfer(issuer, amount), \"transfer failed\");\n    }\n\n    function chequeHash(\n        address chequebook,\n        address beneficiary,\n        uint cumulativePayout\n    ) internal pure returns (bytes32) {\n        return\n            keccak256(\n                abi.encode(\n                    CHEQUE_TYPEHASH,\n                    chequebook,\n                    beneficiary,\n                    cumulativePayout\n                )\n            );\n    }\n\n    function cashOutHash(\n        address chequebook,\n        address sender,\n        uint requestPayout,\n        address recipient,\n        uint callerPayout\n    ) internal pure returns (bytes32) {\n        return\n            keccak256(\n                abi.encode(\n                    CASHOUT_TYPEHASH,\n                    chequebook,\n                    sender,\n                    requestPayout,\n                    recipient,\n                    callerPayout\n                )\n            );\n    }\n\n    function customDecreaseTimeoutHash(\n        address chequebook,\n        address beneficiary,\n        uint decreaseTimeout\n    ) internal pure returns (bytes32) {\n        return\n            keccak256(\n                abi.encode(\n                    CUSTOMDECREASETIMEOUT_TYPEHASH,\n                    chequebook,\n                    beneficiary,\n                    decreaseTimeout\n                )\n            );\n    }\n}\n"},{"file_path":"node_modules/@openzeppelin/contracts/access/AccessControl.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../utils/EnumerableSet.sol\";\nimport \"../utils/Address.sol\";\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```\n * function foo() public {\n *     require(hasRole(MY_ROLE, msg.sender));\n *     ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\nabstract contract AccessControl is Context {\n    using EnumerableSet for EnumerableSet.AddressSet;\n    using Address for address;\n\n    struct RoleData {\n        EnumerableSet.AddressSet members;\n        bytes32 adminRole;\n    }\n\n    mapping (bytes32 => RoleData) private _roles;\n\n    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n    /**\n     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n     *\n     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n     * {RoleAdminChanged} not being emitted signaling this.\n     *\n     * _Available since v3.1._\n     */\n    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n    /**\n     * @dev Emitted when `account` is granted `role`.\n     *\n     * `sender` is the account that originated the contract call, an admin role\n     * bearer except when using {_setupRole}.\n     */\n    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Emitted when `account` is revoked `role`.\n     *\n     * `sender` is the account that originated the contract call:\n     *   - if using `revokeRole`, it is the admin role bearer\n     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)\n     */\n    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Returns `true` if `account` has been granted `role`.\n     */\n    function hasRole(bytes32 role, address account) public view returns (bool) {\n        return _roles[role].members.contains(account);\n    }\n\n    /**\n     * @dev Returns the number of accounts that have `role`. Can be used\n     * together with {getRoleMember} to enumerate all bearers of a role.\n     */\n    function getRoleMemberCount(bytes32 role) public view returns (uint256) {\n        return _roles[role].members.length();\n    }\n\n    /**\n     * @dev Returns one of the accounts that have `role`. `index` must be a\n     * value between 0 and {getRoleMemberCount}, non-inclusive.\n     *\n     * Role bearers are not sorted in any particular way, and their ordering may\n     * change at any point.\n     *\n     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n     * you perform all queries on the same block. See the following\n     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n     * for more information.\n     */\n    function getRoleMember(bytes32 role, uint256 index) public view returns (address) {\n        return _roles[role].members.at(index);\n    }\n\n    /**\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\n     * {revokeRole}.\n     *\n     * To change a role's admin, use {_setRoleAdmin}.\n     */\n    function getRoleAdmin(bytes32 role) public view returns (bytes32) {\n        return _roles[role].adminRole;\n    }\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function grantRole(bytes32 role, address account) public virtual {\n        require(hasRole(_roles[role].adminRole, _msgSender()), \"AccessControl: sender must be an admin to grant\");\n\n        _grantRole(role, account);\n    }\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function revokeRole(bytes32 role, address account) public virtual {\n        require(hasRole(_roles[role].adminRole, _msgSender()), \"AccessControl: sender must be an admin to revoke\");\n\n        _revokeRole(role, account);\n    }\n\n    /**\n     * @dev Revokes `role` from the calling account.\n     *\n     * Roles are often managed via {grantRole} and {revokeRole}: this function's\n     * purpose is to provide a mechanism for accounts to lose their privileges\n     * if they are compromised (such as when a trusted device is misplaced).\n     *\n     * If the calling account had been granted `role`, emits a {RoleRevoked}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must be `account`.\n     */\n    function renounceRole(bytes32 role, address account) public virtual {\n        require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n        _revokeRole(role, account);\n    }\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event. Note that unlike {grantRole}, this function doesn't perform any\n     * checks on the calling account.\n     *\n     * [WARNING]\n     * ====\n     * This function should only be called from the constructor when setting\n     * up the initial roles for the system.\n     *\n     * Using this function in any other way is effectively circumventing the admin\n     * system imposed by {AccessControl}.\n     * ====\n     */\n    function _setupRole(bytes32 role, address account) internal virtual {\n        _grantRole(role, account);\n    }\n\n    /**\n     * @dev Sets `adminRole` as ``role``'s admin role.\n     *\n     * Emits a {RoleAdminChanged} event.\n     */\n    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n        emit RoleAdminChanged(role, _roles[role].adminRole, adminRole);\n        _roles[role].adminRole = adminRole;\n    }\n\n    function _grantRole(bytes32 role, address account) private {\n        if (_roles[role].members.add(account)) {\n            emit RoleGranted(role, account, _msgSender());\n        }\n    }\n\n    function _revokeRole(bytes32 role, address account) private {\n        if (_roles[role].members.remove(account)) {\n            emit RoleRevoked(role, account, _msgSender());\n        }\n    }\n}\n"},{"file_path":"node_modules/@openzeppelin/contracts/cryptography/ECDSA.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSA {\n    /**\n     * @dev Returns the address that signed a hashed message (`hash`) with\n     * `signature`. This address can then be used for verification purposes.\n     *\n     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n     * this function rejects them by requiring the `s` value to be in the lower\n     * half order, and the `v` value to be either 27 or 28.\n     *\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n     * verification to be secure: it is possible to craft signatures that\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n     * this is by receiving a hash of the original message (which may otherwise\n     * be too long), and then calling {toEthSignedMessageHash} on it.\n     */\n    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n        // Check the signature length\n        if (signature.length != 65) {\n            revert(\"ECDSA: invalid signature length\");\n        }\n\n        // Divide the signature in r, s and v variables\n        bytes32 r;\n        bytes32 s;\n        uint8 v;\n\n        // ecrecover takes the signature parameters, and the only way to get them\n        // currently is to use assembly.\n        // solhint-disable-next-line no-inline-assembly\n        assembly {\n            r := mload(add(signature, 0x20))\n            s := mload(add(signature, 0x40))\n            v := byte(0, mload(add(signature, 0x60)))\n        }\n\n        return recover(hash, v, r, s);\n    }\n\n    /**\n     * @dev Overload of {ECDSA-recover-bytes32-bytes-} that receives the `v`,\n     * `r` and `s` signature fields separately.\n     */\n    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {\n        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n        // the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most\n        // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n        //\n        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n        // these malleable signatures as well.\n        require(uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, \"ECDSA: invalid signature 's' value\");\n        require(v == 27 || v == 28, \"ECDSA: invalid signature 'v' value\");\n\n        // If the signature is valid (and not malleable), return the signer address\n        address signer = ecrecover(hash, v, r, s);\n        require(signer != address(0), \"ECDSA: invalid signature\");\n\n        return signer;\n    }\n\n    /**\n     * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n     * replicates the behavior of the\n     * https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign[`eth_sign`]\n     * JSON-RPC method.\n     *\n     * See {recover}.\n     */\n    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\n        // 32 is the length in bytes of hash,\n        // enforced by the type signature above\n        return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", hash));\n    }\n}\n"},{"file_path":"node_modules/@openzeppelin/contracts/math/Math.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n    /**\n     * @dev Returns the largest of two numbers.\n     */\n    function max(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a >= b ? a : b;\n    }\n\n    /**\n     * @dev Returns the smallest of two numbers.\n     */\n    function min(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a < b ? a : b;\n    }\n\n    /**\n     * @dev Returns the average of two numbers. The result is rounded towards\n     * zero.\n     */\n    function average(uint256 a, uint256 b) internal pure returns (uint256) {\n        // (a + b) / 2 can overflow, so we distribute\n        return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);\n    }\n}\n"},{"file_path":"node_modules/@openzeppelin/contracts/math/SafeMath.sol","source_code":"// 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"},{"file_path":"node_modules/@openzeppelin/contracts/presets/ERC20PresetMinterPauser.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../access/AccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../token/ERC20/ERC20.sol\";\nimport \"../token/ERC20/ERC20Burnable.sol\";\nimport \"../token/ERC20/ERC20Pausable.sol\";\n\n/**\n * @dev {ERC20} token, including:\n *\n *  - ability for holders to burn (destroy) their tokens\n *  - a minter role that allows for token minting (creation)\n *  - a pauser role that allows to stop all token transfers\n *\n * This contract uses {AccessControl} to lock permissioned functions using the\n * different roles - head to its documentation for details.\n *\n * The account that deploys the contract will be granted the minter and pauser\n * roles, as well as the default admin role, which will let it grant both minter\n * and pauser roles to other accounts.\n */\ncontract ERC20PresetMinterPauser is Context, AccessControl, ERC20Burnable, ERC20Pausable {\n    bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n    bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n\n    /**\n     * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE` and `PAUSER_ROLE` to the\n     * account that deploys the contract.\n     *\n     * See {ERC20-constructor}.\n     */\n    constructor(string memory name, string memory symbol) public ERC20(name, symbol) {\n        _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());\n\n        _setupRole(MINTER_ROLE, _msgSender());\n        _setupRole(PAUSER_ROLE, _msgSender());\n    }\n\n    /**\n     * @dev Creates `amount` new tokens for `to`.\n     *\n     * See {ERC20-_mint}.\n     *\n     * Requirements:\n     *\n     * - the caller must have the `MINTER_ROLE`.\n     */\n    function mint(address to, uint256 amount) public virtual {\n        require(hasRole(MINTER_ROLE, _msgSender()), \"ERC20PresetMinterPauser: must have minter role to mint\");\n        _mint(to, amount);\n    }\n\n    /**\n     * @dev Pauses all token transfers.\n     *\n     * See {ERC20Pausable} and {Pausable-_pause}.\n     *\n     * Requirements:\n     *\n     * - the caller must have the `PAUSER_ROLE`.\n     */\n    function pause() public virtual {\n        require(hasRole(PAUSER_ROLE, _msgSender()), \"ERC20PresetMinterPauser: must have pauser role to pause\");\n        _pause();\n    }\n\n    /**\n     * @dev Unpauses all token transfers.\n     *\n     * See {ERC20Pausable} and {Pausable-_unpause}.\n     *\n     * Requirements:\n     *\n     * - the caller must have the `PAUSER_ROLE`.\n     */\n    function unpause() public virtual {\n        require(hasRole(PAUSER_ROLE, _msgSender()), \"ERC20PresetMinterPauser: must have pauser role to unpause\");\n        _unpause();\n    }\n\n    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override(ERC20, ERC20Pausable) {\n        super._beforeTokenTransfer(from, to, amount);\n    }\n}\n"},{"file_path":"node_modules/@openzeppelin/contracts/proxy/Clones.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for\n * deploying minimal proxy contracts, also known as \"clones\".\n *\n * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies\n * > a minimal bytecode implementation that delegates all calls to a known, fixed address.\n *\n * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`\n * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the\n * deterministic method.\n *\n * _Available since v3.4._\n */\nlibrary Clones {\n    /**\n     * @dev Deploys and returns the address of a clone that mimics the behaviour of `master`.\n     *\n     * This function uses the create opcode, which should never revert.\n     */\n    function clone(address master) internal returns (address instance) {\n        // solhint-disable-next-line no-inline-assembly\n        assembly {\n            let ptr := mload(0x40)\n            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)\n            mstore(add(ptr, 0x14), shl(0x60, master))\n            mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)\n            instance := create(0, ptr, 0x37)\n        }\n        require(instance != address(0), \"ERC1167: create failed\");\n    }\n\n    /**\n     * @dev Deploys and returns the address of a clone that mimics the behaviour of `master`.\n     *\n     * This function uses the create2 opcode and a `salt` to deterministically deploy\n     * the clone. Using the same `master` and `salt` multiple time will revert, since\n     * the clones cannot be deployed twice at the same address.\n     */\n    function cloneDeterministic(address master, bytes32 salt) internal returns (address instance) {\n        // solhint-disable-next-line no-inline-assembly\n        assembly {\n            let ptr := mload(0x40)\n            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)\n            mstore(add(ptr, 0x14), shl(0x60, master))\n            mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)\n            instance := create2(0, ptr, 0x37, salt)\n        }\n        require(instance != address(0), \"ERC1167: create2 failed\");\n    }\n\n    /**\n     * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.\n     */\n    function predictDeterministicAddress(address master, bytes32 salt, address deployer) internal pure returns (address predicted) {\n        // solhint-disable-next-line no-inline-assembly\n        assembly {\n            let ptr := mload(0x40)\n            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)\n            mstore(add(ptr, 0x14), shl(0x60, master))\n            mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf3ff00000000000000000000000000000000)\n            mstore(add(ptr, 0x38), shl(0x60, deployer))\n            mstore(add(ptr, 0x4c), salt)\n            mstore(add(ptr, 0x6c), keccak256(ptr, 0x37))\n            predicted := keccak256(add(ptr, 0x37), 0x55)\n        }\n    }\n\n    /**\n     * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.\n     */\n    function predictDeterministicAddress(address master, bytes32 salt) internal view returns (address predicted) {\n        return predictDeterministicAddress(master, salt, address(this));\n    }\n}\n"},{"file_path":"node_modules/@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"../../utils/Context.sol\";\nimport \"./ERC20.sol\";\n\n/**\n * @dev Extension of {ERC20} that allows token holders to destroy both their own\n * tokens and those that they have an allowance for, in a way that can be\n * recognized off-chain (via event analysis).\n */\nabstract contract ERC20Burnable is Context, ERC20 {\n    using SafeMath for uint256;\n\n    /**\n     * @dev Destroys `amount` tokens from the caller.\n     *\n     * See {ERC20-_burn}.\n     */\n    function burn(uint256 amount) public virtual {\n        _burn(_msgSender(), amount);\n    }\n\n    /**\n     * @dev Destroys `amount` tokens from `account`, deducting from the caller's\n     * allowance.\n     *\n     * See {ERC20-_burn} and {ERC20-allowance}.\n     *\n     * Requirements:\n     *\n     * - the caller must have allowance for ``accounts``'s tokens of at least\n     * `amount`.\n     */\n    function burnFrom(address account, uint256 amount) public virtual {\n        uint256 decreasedAllowance = allowance(account, _msgSender()).sub(amount, \"ERC20: burn amount exceeds allowance\");\n\n        _approve(account, _msgSender(), decreasedAllowance);\n        _burn(account, amount);\n    }\n}\n"},{"file_path":"node_modules/@openzeppelin/contracts/token/ERC20/ERC20Pausable.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"./ERC20.sol\";\nimport \"../../utils/Pausable.sol\";\n\n/**\n * @dev ERC20 token with pausable token transfers, minting and burning.\n *\n * Useful for scenarios such as preventing trades until the end of an evaluation\n * period, or having an emergency switch for freezing all token transfers in the\n * event of a large bug.\n */\nabstract contract ERC20Pausable is ERC20, Pausable {\n    /**\n     * @dev See {ERC20-_beforeTokenTransfer}.\n     *\n     * Requirements:\n     *\n     * - the contract must not be paused.\n     */\n    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override {\n        super._beforeTokenTransfer(from, to, amount);\n\n        require(!paused(), \"ERC20Pausable: token transfer while paused\");\n    }\n}\n"},{"file_path":"node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol","source_code":"// 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"},{"file_path":"node_modules/@openzeppelin/contracts/utils/Address.sol","source_code":"// 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"},{"file_path":"node_modules/@openzeppelin/contracts/utils/Context.sol","source_code":"// 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"},{"file_path":"node_modules/@openzeppelin/contracts/utils/EnumerableSet.sol","source_code":"// 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"},{"file_path":"node_modules/@openzeppelin/contracts/utils/Pausable.sol","source_code":"// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"./Context.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract Pausable is Context {\n    /**\n     * @dev Emitted when the pause is triggered by `account`.\n     */\n    event Paused(address account);\n\n    /**\n     * @dev Emitted when the pause is lifted by `account`.\n     */\n    event Unpaused(address account);\n\n    bool private _paused;\n\n    /**\n     * @dev Initializes the contract in unpaused state.\n     */\n    constructor () internal {\n        _paused = false;\n    }\n\n    /**\n     * @dev Returns true if the contract is paused, and false otherwise.\n     */\n    function paused() public view virtual returns (bool) {\n        return _paused;\n    }\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is not paused.\n     *\n     * Requirements:\n     *\n     * - The contract must not be paused.\n     */\n    modifier whenNotPaused() {\n        require(!paused(), \"Pausable: paused\");\n        _;\n    }\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is paused.\n     *\n     * Requirements:\n     *\n     * - The contract must be paused.\n     */\n    modifier whenPaused() {\n        require(paused(), \"Pausable: not paused\");\n        _;\n    }\n\n    /**\n     * @dev Triggers stopped state.\n     *\n     * Requirements:\n     *\n     * - The contract must not be paused.\n     */\n    function _pause() internal virtual whenNotPaused {\n        _paused = true;\n        emit Paused(_msgSender());\n    }\n\n    /**\n     * @dev Returns to normal state.\n     *\n     * Requirements:\n     *\n     * - The contract must be paused.\n     */\n    function _unpause() internal virtual whenPaused {\n        _paused = false;\n        emit Unpaused(_msgSender());\n    }\n}\n"}],"certified":false,"conflicting_implementations":null,"abi":[{"inputs":[{"internalType":"address","name":"_ERC20Address","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"contractAddress","type":"address"}],"name":"SimpleSwapDeployed","type":"event"},{"inputs":[],"name":"ERC20Address","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"issuer","type":"address"},{"internalType":"uint256","name":"defaultHardDepositTimeoutDuration","type":"uint256"},{"internalType":"bytes32","name":"salt","type":"bytes32"}],"name":"deploySimpleSwap","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"deployedContracts","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"master","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"is_changed_bytecode":false,"is_partially_verified":true,"constructor_args":"000000000000000000000000239db952bde69a15962436c6cd86fdd3b45342e4"}