From 0b03dc213580ee4ce40b07ce6cd0918947b07470 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Tue, 11 Jun 2024 14:32:46 +0100 Subject: [PATCH 1/2] feat: absolute tx deadline --- contracts/README.md | 2 +- .../EscrowUniversal.json | 120 +++++++++--------- contracts/src/Escrow.sol | 4 +- contracts/src/EscrowToken.sol | 4 +- contracts/src/EscrowUniversal.sol | 8 +- contracts/src/interfaces/IEscrow.sol | 8 +- subgraph/package.json | 2 +- subgraph/subgraph.yaml | 4 +- 8 files changed, 76 insertions(+), 76 deletions(-) diff --git a/contracts/README.md b/contracts/README.md index 3f22499..181bbb1 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -18,7 +18,7 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments - [Escrow](https://sepolia.arbiscan.io/address/0x250AB0477346aDFC010585b58FbF61cff1d8f3ea) - [EscrowToken](https://sepolia.arbiscan.io/address/0xe7B52a7Bc50cb4Ff13d057629082844780b6E28D) -- [EscrowUniversal](https://sepolia.arbiscan.io/address/0x5c4B2Cff2998529f9d405A9b6EbB44BC537c8D7F) +- [EscrowUniversal](https://sepolia.arbiscan.io/address/0xBa2cC03e2e34C5DEDaEbC481b2531e06946353De) #### Sepolia diff --git a/contracts/deployments/arbitrumSepoliaDevnet/EscrowUniversal.json b/contracts/deployments/arbitrumSepoliaDevnet/EscrowUniversal.json index a63c4c8..e44c0f9 100644 --- a/contracts/deployments/arbitrumSepoliaDevnet/EscrowUniversal.json +++ b/contracts/deployments/arbitrumSepoliaDevnet/EscrowUniversal.json @@ -1,5 +1,5 @@ { - "address": "0x5c4B2Cff2998529f9d405A9b6EbB44BC537c8D7F", + "address": "0xBa2cC03e2e34C5DEDaEbC481b2531e06946353De", "abi": [ { "inputs": [ @@ -586,7 +586,7 @@ }, { "internalType": "uint256", - "name": "_timeoutPayment", + "name": "_deadline", "type": "uint256" }, { @@ -625,7 +625,7 @@ "inputs": [ { "internalType": "uint256", - "name": "_timeoutPayment", + "name": "_deadline", "type": "uint256" }, { @@ -979,46 +979,46 @@ "type": "function" } ], - "transactionHash": "0xaa0df3879c06a99e0d37bea40efbe8347ee98ca5c0d13a418520751fff8b1475", + "transactionHash": "0x9cd400a3fee047ab0c4d16ab01e51f6b446a3c298fb5e5c327a9a3b18a8a3983", "receipt": { "to": null, "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", - "contractAddress": "0x5c4B2Cff2998529f9d405A9b6EbB44BC537c8D7F", - "transactionIndex": 6, - "gasUsed": "2941556", - "logsBloom": "0x00000000000000000000000000000002000000000000000000040000000000008000080040000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000080000000000000000000080000000000000080000000000002000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000400000000000000000000040000000000000000000000000000000000000000000100000002000000400000000000100000000000000000000000000000000000000", - "blockHash": "0x7f36c7f4d5adf123f474d3c23ae2a416adb80c400884f4948c759e0d1f34807f", - "transactionHash": "0xaa0df3879c06a99e0d37bea40efbe8347ee98ca5c0d13a418520751fff8b1475", + "contractAddress": "0xBa2cC03e2e34C5DEDaEbC481b2531e06946353De", + "transactionIndex": 3, + "gasUsed": "3474086", + "logsBloom": "0x00000000000000000000000000000000000000000000000000040000000000008000080000002000004000000000000000000000000000000000000000000000000000000000040000000000000000040000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000080000000000002000000000000000010000100000000000000000000000000000000000040000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000002000000400000000000100000000000000000000000080000000000000", + "blockHash": "0xb92c80dc2e61002c1f3fef738de7031a49511d32c256ebd895f8a084f830dfcd", + "transactionHash": "0x9cd400a3fee047ab0c4d16ab01e51f6b446a3c298fb5e5c327a9a3b18a8a3983", "logs": [ { - "transactionIndex": 6, - "blockNumber": 42653663, - "transactionHash": "0xaa0df3879c06a99e0d37bea40efbe8347ee98ca5c0d13a418520751fff8b1475", + "transactionIndex": 3, + "blockNumber": 53588833, + "transactionHash": "0x9cd400a3fee047ab0c4d16ab01e51f6b446a3c298fb5e5c327a9a3b18a8a3983", "address": "0x596D3B09E684D62217682216e9b7a0De75933391", "topics": [ "0x00f7cd7255d1073b4e136dd477c38ea0020c051ab17110cc5bfab0c840ff9924", - "0x0000000000000000000000000000000000000000000000000000000000000144", + "0x0000000000000000000000000000000000000000000000000000000000000177", "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000004e47b0a2020227469746c65223a20227b7b657363726f775469746c657d7d222c0a2020226465736372697074696f6e223a20227b7b64656c6976657261626c65546578747d7d222c0a2020227175657374696f6e223a202257686963682070617274792061626964656420627920746865207465726d73206f662074686520636f6e74726163743f222c0a202022616e7377657273223a205b0a2020202020207b0a20202020202020202020227469746c65223a2022526566756e6420746865204275796572222c0a20202020202020202020226465736372697074696f6e223a202253656c656374207468697320746f2072657475726e207468652066756e647320746f207468652042757965722e220a2020202020207d2c0a2020202020207b0a20202020202020202020227469746c65223a2022506179207468652053656c6c6572222c0a20202020202020202020226465736372697074696f6e223a202253656c656374207468697320746f2072656c65617365207468652066756e647320746f207468652053656c6c65722e220a2020202020207d0a20205d2c0a202022706f6c696379555249223a2022697066733a2f2f544f444f222c0a2020226174746163686d656e74223a207b0a202020202020226c6162656c223a20225472616e73616374696f6e205465726d73222c0a20202020202022757269223a20227b7b65787472614465736372697074696f6e5572697d7d220a20207d2c0a20202266726f6e74656e6455726c223a202268747470733a2f2f657363726f772d76322e6b6c65726f732e6275696c646572732f232f6d795472616e73616374696f6e732f2573222c0a20202261726269747261626c65436861696e4944223a2022343231363134222c0a20202261726269747261626c6541646472657373223a2022307832353041423034373733343661444643303130353835623538466246363163666631643866336561222c0a20202261726269747261746f72436861696e4944223a2022343231363134222c0a20202261726269747261746f7241646472657373223a2022307841353465374131366437343630653338613846333234654634363738324642353230643538434538222c0a2020226d65746164617461223a207b0a202020202020226275796572223a20227b7b616464726573737d7d222c0a2020202020202273656c6c6572223a20227b7b73656e64696e67526563697069656e74416464726573737d7d222c0a20202020202022616d6f756e74223a20227b7b73656e64696e675175616e746974797d7d222c0a202020202020226173736574223a20227b7b657363726f77547970657d7d222c0a2020202020202274696d656f75745061796d656e74223a20227b7b74696d656f75745061796d656e747d7d222c0a202020202020227472616e73616374696f6e557269223a20227b7b7472616e73616374696f6e5572697d7d220a20207d2c0a20202263617465676f7279223a2022457363726f77222c0a20202273706563696669636174696f6e223a20224b4950585858222c0a202022616c6961736573223a207b0a202020202020224275796572223a20227b7b616464726573737d7d222c0a2020202020202253656c6c6572223a20227b7b73656e64696e67526563697069656e74416464726573737d7d220a20207d2c0a20202276657273696f6e223a2022312e30220a7d0a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000027b7d000000000000000000000000000000000000000000000000000000000000", - "logIndex": 15, - "blockHash": "0x7f36c7f4d5adf123f474d3c23ae2a416adb80c400884f4948c759e0d1f34807f" + "logIndex": 7, + "blockHash": "0xb92c80dc2e61002c1f3fef738de7031a49511d32c256ebd895f8a084f830dfcd" }, { - "transactionIndex": 6, - "blockNumber": 42653663, - "transactionHash": "0xaa0df3879c06a99e0d37bea40efbe8347ee98ca5c0d13a418520751fff8b1475", - "address": "0x5c4B2Cff2998529f9d405A9b6EbB44BC537c8D7F", + "transactionIndex": 3, + "blockNumber": 53588833, + "transactionHash": "0x9cd400a3fee047ab0c4d16ab01e51f6b446a3c298fb5e5c327a9a3b18a8a3983", + "address": "0xBa2cC03e2e34C5DEDaEbC481b2531e06946353De", "topics": [ "0xf0d0a0b363c32316c3e6e7e797bbc126af09c634db439ed65a3f96afe7ae2367" ], "data": "0x000000000000000000000000000000000000000000000000000000000000025800000000000000000000000000000000000000000000000000000000000002580000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003", - "logIndex": 16, - "blockHash": "0x7f36c7f4d5adf123f474d3c23ae2a416adb80c400884f4948c759e0d1f34807f" + "logIndex": 8, + "blockHash": "0xb92c80dc2e61002c1f3fef738de7031a49511d32c256ebd895f8a084f830dfcd" } ], - "blockNumber": 42653663, - "cumulativeGasUsed": "4991765", + "blockNumber": 53588833, + "cumulativeGasUsed": "5274512", "status": 1, "byzantium": true }, @@ -1031,11 +1031,11 @@ 600, 600 ], - "numDeployments": 1, - "solcInputHash": "f0eda2c61264c8e82d0740ef130a1b29", - "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_templateDataMappings\",\"type\":\"string\"},{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"_templateRegistry\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_feeTimeout\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_settlementTimeout\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ArbitratorOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BuyerFeeNotCoverArbitrationCosts\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BuyerOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BuyerOrSellerOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DeadlineNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeAlreadyResolved\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRuling\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MaximumPaymentAmountExceeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoSettlementProposedOrTransactionMovedOnAcceptSettlement\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoSettlementProposedOrTransactionMovedOnPayFeeBuyer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoSettlementProposedOrTransactionMovedOnPayFeeSeller\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotSupported\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotWaitingForBuyerFees\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotWaitingForSellerFees\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SellerFeeNotCoverArbitrationCosts\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SellerOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SettlementPeriodNotOver\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TimeoutNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TokenTransferFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransactionDisputed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransactionEscalatedForArbitration\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransactionExpired\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_arbitrableDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateUri\",\"type\":\"string\"}],\"name\":\"DisputeRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_transactionUri\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_buyer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_seller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_deadline\",\"type\":\"uint256\"}],\"name\":\"ERC20TransactionCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum Party\",\"name\":\"_party\",\"type\":\"uint8\"}],\"name\":\"HasToPayFee\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_transactionUri\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_buyer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_seller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_deadline\",\"type\":\"uint256\"}],\"name\":\"NativeTransactionCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_feeTimeout\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_settlementTimeout\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"}],\"name\":\"ParameterUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_party\",\"type\":\"address\"}],\"name\":\"Payment\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum Party\",\"name\":\"_party\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"SettlementProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"enum Resolution\",\"name\":\"_resolution\",\"type\":\"uint8\"}],\"name\":\"TransactionResolved\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AMOUNT_OF_CHOICES\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"}],\"name\":\"acceptSettlement\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"arbitratorExtraData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"}],\"name\":\"changeArbitrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"}],\"name\":\"changeArbitratorExtraData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_templateDataMappings\",\"type\":\"string\"}],\"name\":\"changeDisputeTemplate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_feeTimeout\",\"type\":\"uint256\"}],\"name\":\"changeFeeTimeout\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_settlementTimeout\",\"type\":\"uint256\"}],\"name\":\"changeSettlementTimeout\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"_templateRegistry\",\"type\":\"address\"}],\"name\":\"changeTemplateRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_timeoutPayment\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_transactionUri\",\"type\":\"string\"},{\"internalType\":\"address payable\",\"name\":\"_seller\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_templateDataMappings\",\"type\":\"string\"}],\"name\":\"createERC20Transaction\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"transactionID\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_timeoutPayment\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_transactionUri\",\"type\":\"string\"},{\"internalType\":\"address payable\",\"name\":\"_seller\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_templateDataMappings\",\"type\":\"string\"}],\"name\":\"createNativeTransaction\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"transactionID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputeIDtoTransactionID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"}],\"name\":\"executeTransaction\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeTimeout\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTransactionCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"pay\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"}],\"name\":\"payArbitrationFeeByBuyer\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"}],\"name\":\"payArbitrationFeeBySeller\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"proposeSettlement\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_amountReimbursed\",\"type\":\"uint256\"}],\"name\":\"reimburse\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"settlementTimeout\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"templateId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"templateRegistry\",\"outputs\":[{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"}],\"name\":\"timeOutByBuyer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"}],\"name\":\"timeOutBySeller\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"transactions\",\"outputs\":[{\"internalType\":\"address payable\",\"name\":\"buyer\",\"type\":\"address\"},{\"internalType\":\"address payable\",\"name\":\"seller\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"settlementBuyer\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"settlementSeller\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"buyerFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"sellerFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastFeePaymentTime\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"templateDataMappings\",\"type\":\"string\"},{\"internalType\":\"enum Status\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"contract IERC20\",\"name\":\"token\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Adapted from MultipleArbitrableTokenTransaction contract: https://github.com/kleros/kleros-interaction/blob/master/contracts/standard/arbitration/MultipleArbitrableTokenTransaction.sol and from MultipleArbitrableTransaction contract: https://github.com/kleros/kleros-interaction/blob/master/contracts/standard/arbitration/MultipleArbitrableTransaction.sol Note that the contract expects the tokens to have standard ERC20 behaviour. The tokens that don't conform to this type of behaviour should be filtered by the UI. Tokens should not reenter or allow recipients to refuse the transfer. Also note that arbitration fees are still paid in ETH.\",\"events\":{\"DisputeRequest(address,uint256,uint256,uint256,string)\":{\"details\":\"To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\",\"params\":{\"_arbitrableDisputeID\":\"The identifier of the dispute in the Arbitrable contract.\",\"_arbitrator\":\"The arbitrator of the contract.\",\"_externalDisputeID\":\"An identifier created outside Kleros by the protocol requesting arbitration.\",\"_templateId\":\"The identifier of the dispute template. Should not be used with _templateUri.\",\"_templateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\"}},\"ERC20TransactionCreated(uint256,string,address,address,address,uint256,uint256)\":{\"details\":\"Emitted when a transaction paid in ERC20 token is created.\",\"params\":{\"_amount\":\"The initial amount in the transaction.\",\"_buyer\":\"The address of the buyer.\",\"_deadline\":\"The deadline of the transaction.\",\"_seller\":\"The address of the seller.\",\"_token\":\"The token address.\",\"_transactionID\":\"The index of the transaction.\",\"_transactionUri\":\"The IPFS Uri Hash of the transaction.\"}},\"HasToPayFee(uint256,uint8)\":{\"details\":\"Indicate that a party has to pay a fee or would otherwise be considered as losing.\",\"params\":{\"_party\":\"The party who has to pay.\",\"_transactionID\":\"The index of the transaction.\"}},\"NativeTransactionCreated(uint256,string,address,address,uint256,uint256)\":{\"details\":\"Emitted when a transaction paid in native currency is created.\",\"params\":{\"_amount\":\"The initial amount in the transaction.\",\"_buyer\":\"The address of the buyer.\",\"_deadline\":\"The deadline of the transaction.\",\"_seller\":\"The address of the seller.\",\"_transactionID\":\"The index of the transaction.\",\"_transactionUri\":\"The IPFS Uri Hash of the transaction.\"}},\"ParameterUpdated(uint256,uint256,bytes)\":{\"details\":\"To be emitted when Escrow parameters are updated.\"},\"Payment(uint256,uint256,address)\":{\"details\":\"To be emitted when a party pays or reimburses the other.\",\"params\":{\"_amount\":\"The amount paid.\",\"_party\":\"The party that paid.\",\"_transactionID\":\"The index of the transaction.\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrator\":\"The arbitrator giving the ruling.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}},\"SettlementProposed(uint256,uint8,uint256)\":{\"details\":\"Emitted when a party proposes a settlement.\",\"params\":{\"_amount\":\"The amount proposed.\",\"_party\":\"The party that proposed a settlement.\",\"_transactionID\":\"The index of the transaction.\"}},\"TransactionResolved(uint256,uint8)\":{\"details\":\"To be emitted when a transaction is resolved, either by its execution, a timeout or because a ruling was enforced.\",\"params\":{\"_resolution\":\"Short description of what caused the transaction to be solved.\",\"_transactionID\":\"The ID of the respective transaction.\"}}},\"kind\":\"dev\",\"methods\":{\"acceptSettlement(uint256)\":{\"details\":\"Accept a settlement proposed by the other party.\",\"params\":{\"_transactionID\":\"The index of the transaction.\"}},\"constructor\":{\"details\":\"Constructor.\",\"params\":{\"_arbitrator\":\"The arbitrator of the contract.\",\"_arbitratorExtraData\":\"Extra data for the arbitrator.\",\"_feeTimeout\":\"Arbitration fee timeout for the parties.\",\"_settlementTimeout\":\"Settlement timeout for the parties.\",\"_templateData\":\"The dispute template data.\",\"_templateDataMappings\":\"The dispute template data mappings.\",\"_templateRegistry\":\"The dispute template registry.\"}},\"createERC20Transaction(uint256,address,uint256,string,address,string,string)\":{\"details\":\"Create a transaction.\",\"params\":{\"_amount\":\"The amount of tokens in this transaction.\",\"_seller\":\"The recipient of the transaction.\",\"_templateData\":\"The dispute template data.\",\"_templateDataMappings\":\"The dispute template data mappings.\",\"_timeoutPayment\":\"Time after which a party can automatically execute the arbitrable transaction.\",\"_token\":\"The ERC20 token contract.\",\"_transactionUri\":\"The IPFS Uri Hash of the transaction.\"},\"returns\":{\"transactionID\":\"The index of the transaction.\"}},\"createNativeTransaction(uint256,string,address,string,string)\":{\"details\":\"Create a transaction.\",\"params\":{\"_seller\":\"The recipient of the transaction.\",\"_templateData\":\"The dispute template data.\",\"_templateDataMappings\":\"The dispute template data mappings.\",\"_timeoutPayment\":\"Time after which a party can automatically execute the arbitrable transaction.\",\"_transactionUri\":\"The IPFS Uri Hash of the transaction.\"},\"returns\":{\"transactionID\":\"The index of the transaction.\"}},\"executeTransaction(uint256)\":{\"details\":\"Transfer the transaction's amount to the seller if the timeout has passed.\",\"params\":{\"_transactionID\":\"The index of the transaction.\"}},\"getTransactionCount()\":{\"details\":\"Getter to know the count of transactions.\",\"returns\":{\"_0\":\"The count of transactions.\"}},\"pay(uint256,uint256)\":{\"details\":\"Pay seller. To be called if the good or service is provided.\",\"params\":{\"_amount\":\"Amount to pay in wei.\",\"_transactionID\":\"The index of the transaction.\"}},\"payArbitrationFeeByBuyer(uint256)\":{\"details\":\"Pay the arbitration fee to raise a dispute. To be called by the buyer. Note that it can only be called after settlement proposition. Also note that the arbitrator can have createDispute throw, which will make this function throw and therefore lead to a party being timed-out. This is not a vulnerability as the arbitrator can rule in favor of one party anyway.\",\"params\":{\"_transactionID\":\"The index of the transaction.\"}},\"payArbitrationFeeBySeller(uint256)\":{\"details\":\"Pay the arbitration fee to raise a dispute. To be called by the seller. Note that this function mirrors payArbitrationFeeByBuyer.\",\"params\":{\"_transactionID\":\"The index of the transaction.\"}},\"proposeSettlement(uint256,uint256)\":{\"details\":\"Propose a settlement as a compromise from the initial terms to the other party. Note that a party can only propose a settlement again after the other party has done so as well to prevent front running/griefing issues.\",\"params\":{\"_amount\":\"The settlement amount.\",\"_transactionID\":\"The index of the transaction.\"}},\"reimburse(uint256,uint256)\":{\"details\":\"Reimburse buyer. To be called if the good or service can't be fully provided.\",\"params\":{\"_amountReimbursed\":\"Amount to reimburse in wei.\",\"_transactionID\":\"The index of the transaction.\"}},\"rule(uint256,uint256)\":{\"details\":\"Give a ruling for a dispute. Must be called by the arbitrator. The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\",\"params\":{\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_ruling\":\"Ruling given by the arbitrator. Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\"}},\"timeOutByBuyer(uint256)\":{\"details\":\"Reimburse buyer if seller fails to pay the fee.\",\"params\":{\"_transactionID\":\"The index of the transaction.\"}},\"timeOutBySeller(uint256)\":{\"details\":\"Pay seller if buyer fails to pay the fee.\",\"params\":{\"_transactionID\":\"The index of the transaction.\"}}},\"title\":\"EscrowUniversal for a sale paid in native currency or ERC20 tokens without platform fees.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/EscrowUniversal.sol\":\"EscrowUniversal\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@kleros/kleros-v2-contracts/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x389326b1f749454ed179bdac2f9d6ce24a1ef944bbce976ca78b93f4e173354a\",\"license\":\"MIT\"},\"@kleros/kleros-v2-contracts/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"@kleros/kleros-v2-contracts/arbitration/interfaces/IDisputeTemplateRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\n/// @title IDisputeTemplate\\n/// @notice Dispute Template interface.\\ninterface IDisputeTemplateRegistry {\\n /// @dev To be emitted when a new dispute template is created.\\n /// @param _templateId The identifier of the dispute template.\\n /// @param _templateTag An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\\n /// @param _templateData The template data.\\n /// @param _templateDataMappings The data mappings.\\n event DisputeTemplate(\\n uint256 indexed _templateId,\\n string indexed _templateTag,\\n string _templateData,\\n string _templateDataMappings\\n );\\n\\n function setDisputeTemplate(\\n string memory _templateTag,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external returns (uint256 templateId);\\n}\\n\",\"keccak256\":\"0x88b0038d226532e6cf862a485d162f7bca61ac3d361d6801146b55a240f091ac\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\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 /**\\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 `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/EscrowUniversal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @authors: [@unknownunknown1, @jaybuidl]\\n/// @reviewers: []\\n/// @auditors: []\\n/// @bounties: []\\n\\npragma solidity 0.8.18;\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"@kleros/kleros-v2-contracts/arbitration/interfaces/IArbitrableV2.sol\\\";\\nimport \\\"@kleros/kleros-v2-contracts/arbitration/interfaces/IDisputeTemplateRegistry.sol\\\";\\nimport {SafeERC20, IERC20} from \\\"./libraries/SafeERC20.sol\\\";\\nimport \\\"./interfaces/IEscrow.sol\\\";\\n\\n/// @title EscrowUniversal for a sale paid in native currency or ERC20 tokens without platform fees.\\n/// @dev Adapted from MultipleArbitrableTokenTransaction contract: https://github.com/kleros/kleros-interaction/blob/master/contracts/standard/arbitration/MultipleArbitrableTokenTransaction.sol\\n/// and from MultipleArbitrableTransaction contract: https://github.com/kleros/kleros-interaction/blob/master/contracts/standard/arbitration/MultipleArbitrableTransaction.sol\\n/// Note that the contract expects the tokens to have standard ERC20 behaviour.\\n/// The tokens that don't conform to this type of behaviour should be filtered by the UI.\\n/// Tokens should not reenter or allow recipients to refuse the transfer.\\n/// Also note that arbitration fees are still paid in ETH.\\ncontract EscrowUniversal is IEscrow, IArbitrableV2 {\\n // Use safe transfers when both parties are paid simultaneously (save for acceptSettlement) to prevent griefing.\\n using SafeERC20 for IERC20;\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 public constant AMOUNT_OF_CHOICES = 2;\\n address public governor;\\n IArbitratorV2 public arbitrator; // Address of the arbitrator contract.\\n bytes public arbitratorExtraData; // Extra data to set up the arbitration.\\n IDisputeTemplateRegistry public templateRegistry; // The dispute template registry.\\n uint256 public templateId; // The current dispute template identifier.\\n uint256 public feeTimeout; // Time in seconds a party can take to pay arbitration fees before being considered unresponsive and lose the dispute.\\n uint256 public settlementTimeout; // Time in seconds a party can take to accept or propose a settlement before being considered unresponsive.\\n Transaction[] public transactions; // List of all created transactions.\\n mapping(uint256 => uint256) public disputeIDtoTransactionID; // Naps dispute ID to tx ID.\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n if (governor != msg.sender) revert GovernorOnly();\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitratorExtraData Extra data for the arbitrator.\\n /// @param _templateData The dispute template data.\\n /// @param _templateDataMappings The dispute template data mappings.\\n /// @param _templateRegistry The dispute template registry.\\n /// @param _feeTimeout Arbitration fee timeout for the parties.\\n /// @param _settlementTimeout Settlement timeout for the parties.\\n constructor(\\n IArbitratorV2 _arbitrator,\\n bytes memory _arbitratorExtraData,\\n string memory _templateData,\\n string memory _templateDataMappings,\\n IDisputeTemplateRegistry _templateRegistry,\\n uint256 _feeTimeout,\\n uint256 _settlementTimeout\\n ) {\\n governor = msg.sender;\\n arbitrator = _arbitrator;\\n arbitratorExtraData = _arbitratorExtraData;\\n templateRegistry = _templateRegistry;\\n feeTimeout = _feeTimeout;\\n settlementTimeout = _settlementTimeout;\\n templateId = templateRegistry.setDisputeTemplate(\\\"\\\", _templateData, _templateDataMappings);\\n\\n emit ParameterUpdated(_feeTimeout, _settlementTimeout, _arbitratorExtraData);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n function changeGovernor(address _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n function changeArbitrator(IArbitratorV2 _arbitrator) external onlyByGovernor {\\n arbitrator = _arbitrator;\\n }\\n\\n function changeArbitratorExtraData(bytes calldata _arbitratorExtraData) external onlyByGovernor {\\n arbitratorExtraData = _arbitratorExtraData;\\n emit ParameterUpdated(feeTimeout, settlementTimeout, _arbitratorExtraData);\\n }\\n\\n function changeTemplateRegistry(IDisputeTemplateRegistry _templateRegistry) external onlyByGovernor {\\n templateRegistry = _templateRegistry;\\n }\\n\\n function changeDisputeTemplate(\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external onlyByGovernor {\\n templateId = templateRegistry.setDisputeTemplate(\\\"\\\", _templateData, _templateDataMappings);\\n }\\n\\n function changeFeeTimeout(uint256 _feeTimeout) external onlyByGovernor {\\n feeTimeout = _feeTimeout;\\n emit ParameterUpdated(_feeTimeout, settlementTimeout, arbitratorExtraData);\\n }\\n\\n function changeSettlementTimeout(uint256 _settlementTimeout) external onlyByGovernor {\\n settlementTimeout = _settlementTimeout;\\n emit ParameterUpdated(feeTimeout, _settlementTimeout, arbitratorExtraData);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @inheritdoc IEscrow\\n function createNativeTransaction(\\n uint256 _timeoutPayment,\\n string memory _transactionUri,\\n address payable _seller,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external payable override returns (uint256 transactionID) {\\n Transaction storage transaction = transactions.push();\\n transaction.buyer = payable(msg.sender);\\n transaction.seller = _seller;\\n transaction.amount = msg.value;\\n transaction.token = NATIVE;\\n transaction.deadline = block.timestamp + _timeoutPayment;\\n transaction.templateData = _templateData;\\n transaction.templateDataMappings = _templateDataMappings;\\n\\n transactionID = transactions.length - 1;\\n\\n emit NativeTransactionCreated(\\n transactionID,\\n _transactionUri,\\n msg.sender,\\n _seller,\\n msg.value,\\n transaction.deadline\\n );\\n }\\n\\n /// @inheritdoc IEscrow\\n function createERC20Transaction(\\n uint256 _amount,\\n IERC20 _token,\\n uint256 _timeoutPayment,\\n string memory _transactionUri,\\n address payable _seller,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external override returns (uint256 transactionID) {\\n // Transfers token from sender wallet to contract.\\n if (!_token.safeTransferFrom(msg.sender, address(this), _amount)) revert TokenTransferFailed();\\n Transaction storage transaction = transactions.push();\\n transaction.buyer = payable(msg.sender);\\n transaction.seller = _seller;\\n transaction.amount = _amount;\\n transaction.token = _token;\\n transaction.deadline = block.timestamp + _timeoutPayment;\\n transaction.templateData = _templateData;\\n transaction.templateDataMappings = _templateDataMappings;\\n\\n transactionID = transactions.length - 1;\\n\\n emit ERC20TransactionCreated(\\n transactionID,\\n _transactionUri,\\n msg.sender,\\n _seller,\\n _token,\\n _amount,\\n transaction.deadline\\n );\\n }\\n\\n /// @inheritdoc IEscrow\\n function pay(uint256 _transactionID, uint256 _amount) external override {\\n Transaction storage transaction = transactions[_transactionID];\\n if (transaction.buyer != msg.sender) revert BuyerOnly();\\n if (transaction.status != Status.NoDispute) revert TransactionDisputed();\\n if (_amount > transaction.amount) revert MaximumPaymentAmountExceeded();\\n\\n transaction.amount -= _amount;\\n\\n if (transaction.token == NATIVE) {\\n transaction.seller.send(_amount); // It is the user responsibility to accept ETH.\\n } else {\\n if (!transaction.token.safeTransfer(transaction.seller, _amount)) revert TokenTransferFailed();\\n }\\n\\n emit Payment(_transactionID, _amount, msg.sender);\\n }\\n\\n /// @inheritdoc IEscrow\\n function reimburse(uint256 _transactionID, uint256 _amountReimbursed) external override {\\n Transaction storage transaction = transactions[_transactionID];\\n if (transaction.seller != msg.sender) revert SellerOnly();\\n if (transaction.status != Status.NoDispute) revert TransactionDisputed();\\n if (_amountReimbursed > transaction.amount) revert MaximumPaymentAmountExceeded();\\n\\n transaction.amount -= _amountReimbursed;\\n\\n if (transaction.token == NATIVE) {\\n transaction.buyer.send(_amountReimbursed); // It is the user responsibility to accept ETH.\\n } else {\\n if (!transaction.token.safeTransfer(transaction.buyer, _amountReimbursed)) revert TokenTransferFailed();\\n }\\n\\n emit Payment(_transactionID, _amountReimbursed, msg.sender);\\n }\\n\\n /// @inheritdoc IEscrow\\n function executeTransaction(uint256 _transactionID) external override {\\n Transaction storage transaction = transactions[_transactionID];\\n if (block.timestamp < transaction.deadline) revert DeadlineNotPassed();\\n if (transaction.status != Status.NoDispute) revert TransactionDisputed();\\n\\n uint256 amount = transaction.amount;\\n transaction.amount = 0;\\n\\n if (transaction.token == NATIVE) {\\n transaction.seller.send(amount); // It is the user responsibility to accept ETH.\\n } else {\\n if (!transaction.token.safeTransfer(transaction.seller, amount)) revert TokenTransferFailed();\\n }\\n\\n transaction.status = Status.TransactionResolved;\\n\\n emit TransactionResolved(_transactionID, Resolution.TransactionExecuted);\\n }\\n\\n /// @inheritdoc IEscrow\\n function proposeSettlement(uint256 _transactionID, uint256 _amount) external override {\\n Transaction storage transaction = transactions[_transactionID];\\n if (transaction.status == Status.NoDispute && block.timestamp >= transaction.deadline)\\n revert TransactionExpired();\\n if (transaction.status >= Status.WaitingBuyer) revert TransactionEscalatedForArbitration();\\n if (_amount > transaction.amount) revert MaximumPaymentAmountExceeded();\\n\\n Party party;\\n transaction.lastFeePaymentTime = block.timestamp;\\n if (transaction.status == Status.WaitingSettlementBuyer) {\\n if (msg.sender != transaction.buyer) revert BuyerOnly();\\n transaction.settlementBuyer = _amount;\\n transaction.status = Status.WaitingSettlementSeller;\\n party = Party.Buyer;\\n } else if (transaction.status == Status.WaitingSettlementSeller) {\\n if (msg.sender != transaction.seller) revert SellerOnly();\\n transaction.settlementSeller = _amount;\\n transaction.status = Status.WaitingSettlementBuyer;\\n party = Party.Seller;\\n } else {\\n if (msg.sender == transaction.buyer) {\\n transaction.settlementBuyer = _amount;\\n transaction.status = Status.WaitingSettlementSeller;\\n party = Party.Buyer;\\n } else if (msg.sender == transaction.seller) {\\n transaction.settlementSeller = _amount;\\n transaction.status = Status.WaitingSettlementBuyer;\\n party = Party.Seller;\\n } else revert BuyerOrSellerOnly();\\n }\\n emit SettlementProposed(_transactionID, party, _amount);\\n }\\n\\n /// @inheritdoc IEscrow\\n function acceptSettlement(uint256 _transactionID) external override {\\n Transaction storage transaction = transactions[_transactionID];\\n uint256 settlementAmount;\\n if (transaction.status == Status.WaitingSettlementBuyer) {\\n if (msg.sender != transaction.buyer) revert BuyerOnly();\\n settlementAmount = transaction.settlementSeller;\\n } else if (transaction.status == Status.WaitingSettlementSeller) {\\n if (msg.sender != transaction.seller) revert SellerOnly();\\n settlementAmount = transaction.settlementBuyer;\\n } else revert NoSettlementProposedOrTransactionMovedOnAcceptSettlement();\\n\\n uint256 remainingAmount = transaction.amount - settlementAmount;\\n\\n transaction.amount = 0;\\n transaction.settlementBuyer = 0;\\n transaction.settlementSeller = 0;\\n transaction.status = Status.TransactionResolved;\\n\\n if (transaction.token == NATIVE) {\\n // It is the users' responsibility to accept ETH.\\n transaction.buyer.send(remainingAmount);\\n transaction.seller.send(settlementAmount);\\n } else {\\n if (!transaction.token.safeTransfer(transaction.buyer, remainingAmount)) revert TokenTransferFailed();\\n if (!transaction.token.safeTransfer(transaction.seller, settlementAmount)) revert TokenTransferFailed();\\n }\\n\\n emit TransactionResolved(_transactionID, Resolution.SettlementReached);\\n }\\n\\n /// @inheritdoc IEscrow\\n function payArbitrationFeeByBuyer(uint256 _transactionID) external payable override {\\n Transaction storage transaction = transactions[_transactionID];\\n if (\\n transaction.status != Status.WaitingSettlementBuyer &&\\n transaction.status != Status.WaitingSettlementSeller &&\\n transaction.status != Status.WaitingBuyer\\n ) revert NoSettlementProposedOrTransactionMovedOnPayFeeBuyer();\\n\\n // Allow the other party enough time to respond to a settlement before allowing the proposer to raise a dispute.\\n if (\\n transaction.status == Status.WaitingSettlementSeller &&\\n block.timestamp - transaction.lastFeePaymentTime < settlementTimeout\\n ) revert SettlementPeriodNotOver();\\n\\n if (msg.sender != transaction.buyer) revert BuyerOnly();\\n\\n transaction.buyerFee += msg.value;\\n uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);\\n if (transaction.buyerFee < arbitrationCost) revert BuyerFeeNotCoverArbitrationCosts();\\n\\n transaction.lastFeePaymentTime = block.timestamp;\\n\\n if (transaction.sellerFee < arbitrationCost) {\\n // The seller still has to pay. This can also happen if he has paid, but arbitrationCost has increased.\\n transaction.status = Status.WaitingSeller;\\n emit HasToPayFee(_transactionID, Party.Seller);\\n } else {\\n // The seller has also paid the fee. We create the dispute.\\n raiseDispute(_transactionID, arbitrationCost);\\n }\\n }\\n\\n /// @inheritdoc IEscrow\\n function payArbitrationFeeBySeller(uint256 _transactionID) external payable override {\\n Transaction storage transaction = transactions[_transactionID];\\n if (\\n transaction.status != Status.WaitingSettlementBuyer &&\\n transaction.status != Status.WaitingSettlementSeller &&\\n transaction.status != Status.WaitingSeller\\n ) revert NoSettlementProposedOrTransactionMovedOnPayFeeSeller();\\n\\n // Allow the other party enough time to respond to a settlement before allowing the proposer to raise a dispute.\\n if (\\n transaction.status == Status.WaitingSettlementBuyer &&\\n block.timestamp - transaction.lastFeePaymentTime < settlementTimeout\\n ) revert SettlementPeriodNotOver();\\n\\n if (msg.sender != transaction.seller) revert SellerOnly();\\n\\n transaction.sellerFee += msg.value;\\n uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);\\n if (transaction.sellerFee < arbitrationCost) revert SellerFeeNotCoverArbitrationCosts();\\n\\n transaction.lastFeePaymentTime = block.timestamp;\\n\\n if (transaction.buyerFee < arbitrationCost) {\\n // The buyer still has to pay. This can also happen if he has paid, but arbitrationCost has increased.\\n transaction.status = Status.WaitingBuyer;\\n emit HasToPayFee(_transactionID, Party.Buyer);\\n } else {\\n // The buyer has also paid the fee. We create the dispute.\\n raiseDispute(_transactionID, arbitrationCost);\\n }\\n }\\n\\n /// @inheritdoc IEscrow\\n function timeOutByBuyer(uint256 _transactionID) external override {\\n Transaction storage transaction = transactions[_transactionID];\\n if (transaction.status != Status.WaitingSeller) revert NotWaitingForSellerFees();\\n if (block.timestamp - transaction.lastFeePaymentTime < feeTimeout) revert TimeoutNotPassed();\\n\\n uint256 amount = transaction.sellerFee;\\n transaction.sellerFee = 0;\\n\\n executeRuling(_transactionID, uint256(Party.Buyer));\\n\\n if (amount != 0) {\\n transaction.seller.send(amount); // It is the user responsibility to accept ETH.\\n }\\n\\n emit TransactionResolved(_transactionID, Resolution.TimeoutByBuyer);\\n }\\n\\n /// @inheritdoc IEscrow\\n function timeOutBySeller(uint256 _transactionID) external override {\\n Transaction storage transaction = transactions[_transactionID];\\n if (transaction.status != Status.WaitingBuyer) revert NotWaitingForBuyerFees();\\n if (block.timestamp - transaction.lastFeePaymentTime < feeTimeout) revert TimeoutNotPassed();\\n\\n uint256 amount = transaction.buyerFee;\\n transaction.buyerFee = 0;\\n\\n executeRuling(_transactionID, uint256(Party.Seller));\\n\\n if (amount != 0) {\\n transaction.buyer.send(amount); // It is the user responsibility to accept ETH.\\n }\\n\\n emit TransactionResolved(_transactionID, Resolution.TimeoutBySeller);\\n }\\n\\n /// @inheritdoc IArbitrableV2\\n function rule(uint256 _disputeID, uint256 _ruling) external override {\\n if (msg.sender != address(arbitrator)) revert ArbitratorOnly();\\n if (_ruling > AMOUNT_OF_CHOICES) revert InvalidRuling();\\n\\n uint256 transactionID = disputeIDtoTransactionID[_disputeID];\\n Transaction storage transaction = transactions[transactionID];\\n if (transaction.status != Status.DisputeCreated) revert DisputeAlreadyResolved();\\n\\n emit Ruling(arbitrator, _disputeID, _ruling);\\n executeRuling(transactionID, _ruling);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Create a dispute.\\n /// @param _transactionID The index of the transaction.\\n /// @param _arbitrationCost Amount to pay the arbitrator.\\n function raiseDispute(uint256 _transactionID, uint256 _arbitrationCost) internal {\\n Transaction storage transaction = transactions[_transactionID];\\n transaction.status = Status.DisputeCreated;\\n transaction.disputeID = arbitrator.createDispute{value: _arbitrationCost}(\\n AMOUNT_OF_CHOICES,\\n arbitratorExtraData\\n );\\n disputeIDtoTransactionID[transaction.disputeID] = _transactionID;\\n emit DisputeRequest(arbitrator, transaction.disputeID, _transactionID, templateId, \\\"\\\");\\n\\n // Refund buyer if he overpaid.\\n if (transaction.buyerFee > _arbitrationCost) {\\n uint256 extraFeeBuyer = transaction.buyerFee - _arbitrationCost;\\n transaction.buyerFee = _arbitrationCost;\\n transaction.buyer.send(extraFeeBuyer); // It is the user responsibility to accept ETH.\\n }\\n\\n // Refund seller if he overpaid.\\n if (transaction.sellerFee > _arbitrationCost) {\\n uint256 extraFeeSeller = transaction.sellerFee - _arbitrationCost;\\n transaction.sellerFee = _arbitrationCost;\\n transaction.seller.send(extraFeeSeller); // It is the user responsibility to accept ETH.\\n }\\n }\\n\\n /// @dev Execute a ruling of a dispute. It reimburses the fee to the winning party.\\n /// @param _transactionID The index of the transaction.\\n /// @param _ruling Ruling given by the arbitrator. 1 : Reimburse the seller. 2 : Pay the buyer.\\n function executeRuling(uint256 _transactionID, uint256 _ruling) internal {\\n Transaction storage transaction = transactions[_transactionID];\\n uint256 amount = transaction.amount;\\n uint256 settlementBuyer = transaction.settlementBuyer;\\n uint256 settlementSeller = transaction.settlementSeller;\\n uint256 buyerFee = transaction.buyerFee;\\n uint256 sellerFee = transaction.sellerFee;\\n bool nativePayment = transaction.token == NATIVE;\\n\\n transaction.amount = 0;\\n transaction.settlementBuyer = 0;\\n transaction.settlementSeller = 0;\\n transaction.buyerFee = 0;\\n transaction.sellerFee = 0;\\n transaction.status = Status.TransactionResolved;\\n\\n // Give the arbitration fee back.\\n if (_ruling == uint256(Party.Buyer)) {\\n transaction.buyer.send(buyerFee);\\n // If there was a settlement amount proposed, we use that to make the partial payment and refund the rest.\\n if (settlementBuyer != 0) {\\n if (nativePayment) {\\n transaction.buyer.send(amount - settlementBuyer); // It is the user responsibility to accept ETH.\\n transaction.seller.send(settlementBuyer);\\n } else {\\n transaction.token.safeTransfer(transaction.buyer, amount - settlementBuyer);\\n transaction.token.safeTransfer(transaction.seller, settlementBuyer);\\n }\\n } else {\\n if (nativePayment) {\\n transaction.buyer.send(amount); // It is the user responsibility to accept ETH.\\n } else {\\n if (!transaction.token.safeTransfer(transaction.buyer, amount)) revert TokenTransferFailed();\\n }\\n }\\n } else if (_ruling == uint256(Party.Seller)) {\\n transaction.seller.send(sellerFee);\\n // If there was a settlement amount proposed, we use that to make the partial payment and refund the rest to buyer.\\n if (settlementSeller != 0) {\\n if (nativePayment) {\\n transaction.buyer.send(amount - settlementSeller); // It is the user responsibility to accept ETH.\\n transaction.seller.send(settlementSeller);\\n } else {\\n transaction.token.safeTransfer(transaction.buyer, amount - settlementSeller);\\n transaction.token.safeTransfer(transaction.seller, settlementSeller);\\n }\\n } else {\\n if (nativePayment) {\\n transaction.seller.send(amount); // It is the user responsibility to accept ETH.\\n } else {\\n if (!transaction.token.safeTransfer(transaction.seller, amount)) revert TokenTransferFailed();\\n }\\n }\\n } else {\\n uint256 splitArbitrationFee = buyerFee / 2;\\n transaction.buyer.send(splitArbitrationFee);\\n transaction.seller.send(splitArbitrationFee);\\n\\n // Tokens should not reenter or allow recipients to refuse the transfer.\\n // In case of an uneven token amount, one basic token unit can be burnt.\\n uint256 splitAmount = amount / 2;\\n if (nativePayment) {\\n transaction.buyer.send(splitAmount); // It is the user responsibility to accept ETH.\\n transaction.seller.send(splitAmount);\\n } else {\\n transaction.token.safeTransfer(transaction.buyer, splitAmount);\\n transaction.token.safeTransfer(transaction.seller, splitAmount);\\n }\\n }\\n\\n emit TransactionResolved(_transactionID, Resolution.RulingEnforced);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @inheritdoc IEscrow\\n function getTransactionCount() external view override returns (uint256) {\\n return transactions.length;\\n }\\n}\\n\",\"keccak256\":\"0x4db6060877c5deb583c114a9cac0f7d4e725e45626677021ee1be3d8714d5e7d\",\"license\":\"MIT\"},\"src/interfaces/IEscrow.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./Types.sol\\\";\\n\\ninterface IEscrow {\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n /// @dev To be emitted when Escrow parameters are updated.\\n event ParameterUpdated(uint256 _feeTimeout, uint256 _settlementTimeout, bytes _arbitratorExtraData);\\n\\n /// @dev To be emitted when a party pays or reimburses the other.\\n /// @param _transactionID The index of the transaction.\\n /// @param _amount The amount paid.\\n /// @param _party The party that paid.\\n event Payment(uint256 indexed _transactionID, uint256 _amount, address _party);\\n\\n /// @dev Indicate that a party has to pay a fee or would otherwise be considered as losing.\\n /// @param _transactionID The index of the transaction.\\n /// @param _party The party who has to pay.\\n event HasToPayFee(uint256 indexed _transactionID, Party _party);\\n\\n /// @dev Emitted when a party proposes a settlement.\\n /// @param _transactionID The index of the transaction.\\n /// @param _party The party that proposed a settlement.\\n /// @param _amount The amount proposed.\\n event SettlementProposed(uint256 indexed _transactionID, Party _party, uint256 _amount);\\n\\n /// @dev Emitted when a transaction paid in native currency is created.\\n /// @param _transactionID The index of the transaction.\\n /// @param _transactionUri The IPFS Uri Hash of the transaction.\\n /// @param _buyer The address of the buyer.\\n /// @param _seller The address of the seller.\\n /// @param _amount The initial amount in the transaction.\\n /// @param _deadline The deadline of the transaction.\\n event NativeTransactionCreated(\\n uint256 indexed _transactionID,\\n string _transactionUri,\\n address indexed _buyer,\\n address indexed _seller,\\n uint256 _amount,\\n uint256 _deadline\\n );\\n\\n /// @dev Emitted when a transaction paid in ERC20 token is created.\\n /// @param _transactionID The index of the transaction.\\n /// @param _transactionUri The IPFS Uri Hash of the transaction.\\n /// @param _buyer The address of the buyer.\\n /// @param _seller The address of the seller.\\n /// @param _token The token address.\\n /// @param _amount The initial amount in the transaction.\\n /// @param _deadline The deadline of the transaction.\\n event ERC20TransactionCreated(\\n uint256 indexed _transactionID,\\n string _transactionUri,\\n address indexed _buyer,\\n address indexed _seller,\\n IERC20 _token,\\n uint256 _amount,\\n uint256 _deadline\\n );\\n\\n /// @dev To be emitted when a transaction is resolved, either by its\\n /// execution, a timeout or because a ruling was enforced.\\n /// @param _transactionID The ID of the respective transaction.\\n /// @param _resolution Short description of what caused the transaction to be solved.\\n event TransactionResolved(uint256 indexed _transactionID, Resolution indexed _resolution);\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Create a transaction.\\n /// @param _timeoutPayment Time after which a party can automatically execute the arbitrable transaction.\\n /// @param _transactionUri The IPFS Uri Hash of the transaction.\\n /// @param _seller The recipient of the transaction.\\n /// @param _templateData The dispute template data.\\n /// @param _templateDataMappings The dispute template data mappings.\\n /// @return transactionID The index of the transaction.\\n function createNativeTransaction(\\n uint256 _timeoutPayment,\\n string memory _transactionUri,\\n address payable _seller,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external payable returns (uint256 transactionID);\\n\\n /// @dev Create a transaction.\\n /// @param _amount The amount of tokens in this transaction.\\n /// @param _token The ERC20 token contract.\\n /// @param _timeoutPayment Time after which a party can automatically execute the arbitrable transaction.\\n /// @param _transactionUri The IPFS Uri Hash of the transaction.\\n /// @param _seller The recipient of the transaction.\\n /// @param _templateData The dispute template data.\\n /// @param _templateDataMappings The dispute template data mappings.\\n /// @return transactionID The index of the transaction.\\n function createERC20Transaction(\\n uint256 _amount,\\n IERC20 _token,\\n uint256 _timeoutPayment,\\n string memory _transactionUri,\\n address payable _seller,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external returns (uint256 transactionID);\\n\\n /// @dev Pay seller. To be called if the good or service is provided.\\n /// @param _transactionID The index of the transaction.\\n /// @param _amount Amount to pay in wei.\\n function pay(uint256 _transactionID, uint256 _amount) external;\\n\\n /// @dev Reimburse buyer. To be called if the good or service can't be fully provided.\\n /// @param _transactionID The index of the transaction.\\n /// @param _amountReimbursed Amount to reimburse in wei.\\n function reimburse(uint256 _transactionID, uint256 _amountReimbursed) external;\\n\\n /// @dev Transfer the transaction's amount to the seller if the timeout has passed.\\n /// @param _transactionID The index of the transaction.\\n function executeTransaction(uint256 _transactionID) external;\\n\\n /// @dev Propose a settlement as a compromise from the initial terms to the other party.\\n /// Note that a party can only propose a settlement again after the other party has\\n /// done so as well to prevent front running/griefing issues.\\n /// @param _transactionID The index of the transaction.\\n /// @param _amount The settlement amount.\\n function proposeSettlement(uint256 _transactionID, uint256 _amount) external;\\n\\n /// @dev Accept a settlement proposed by the other party.\\n /// @param _transactionID The index of the transaction.\\n function acceptSettlement(uint256 _transactionID) external;\\n\\n /// @dev Pay the arbitration fee to raise a dispute. To be called by the buyer.\\n /// Note that it can only be called after settlement proposition.\\n /// Also note that the arbitrator can have createDispute throw, which will make\\n /// this function throw and therefore lead to a party being timed-out.\\n /// This is not a vulnerability as the arbitrator can rule in favor of one party anyway.\\n /// @param _transactionID The index of the transaction.\\n function payArbitrationFeeByBuyer(uint256 _transactionID) external payable;\\n\\n /// @dev Pay the arbitration fee to raise a dispute. To be called by the seller.\\n /// Note that this function mirrors payArbitrationFeeByBuyer.\\n /// @param _transactionID The index of the transaction.\\n function payArbitrationFeeBySeller(uint256 _transactionID) external payable;\\n\\n /// @dev Reimburse buyer if seller fails to pay the fee.\\n /// @param _transactionID The index of the transaction.\\n function timeOutByBuyer(uint256 _transactionID) external;\\n\\n /// @dev Pay seller if buyer fails to pay the fee.\\n /// @param _transactionID The index of the transaction.\\n function timeOutBySeller(uint256 _transactionID) external;\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Getter to know the count of transactions.\\n /// @return The count of transactions.\\n function getTransactionCount() external view returns (uint256);\\n\\n // ************************************* //\\n // * Errors * //\\n // ************************************* //\\n\\n error GovernorOnly();\\n error BuyerOnly();\\n error SellerOnly();\\n error BuyerOrSellerOnly();\\n error ArbitratorOnly();\\n error TransactionDisputed();\\n error MaximumPaymentAmountExceeded();\\n error DeadlineNotPassed();\\n error BuyerFeeNotCoverArbitrationCosts();\\n error SellerFeeNotCoverArbitrationCosts();\\n error NotWaitingForSellerFees();\\n error NotWaitingForBuyerFees();\\n error TimeoutNotPassed();\\n error InvalidRuling();\\n error DisputeAlreadyResolved();\\n error TransactionExpired();\\n error TransactionEscalatedForArbitration();\\n error NoSettlementProposedOrTransactionMovedOnAcceptSettlement();\\n error NoSettlementProposedOrTransactionMovedOnPayFeeBuyer();\\n error NoSettlementProposedOrTransactionMovedOnPayFeeSeller();\\n error SettlementPeriodNotOver();\\n error NotSupported();\\n error TokenTransferFailed();\\n}\\n\",\"keccak256\":\"0x477c994bb157eac7f5f74b5d11bdf2b9237a3c2eff3aa0f7b466cae41ca49798\",\"license\":\"MIT\"},\"src/interfaces/Types.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\nimport {IERC20} from \\\"../libraries/SafeERC20.sol\\\";\\n\\nIERC20 constant NATIVE = IERC20(address(0));\\n\\nenum Party {\\n None,\\n Buyer, // Makes a purchase in native currency or ERC20 token.\\n Seller // Provides a good or service in exchange for native currency or ERC20 token.\\n}\\n\\nenum Status {\\n NoDispute,\\n WaitingSettlementBuyer,\\n WaitingSettlementSeller,\\n WaitingBuyer,\\n WaitingSeller,\\n DisputeCreated,\\n TransactionResolved\\n}\\n\\nenum Resolution {\\n TransactionExecuted,\\n TimeoutByBuyer,\\n TimeoutBySeller,\\n RulingEnforced,\\n SettlementReached\\n}\\n\\nstruct Transaction {\\n address payable buyer;\\n address payable seller;\\n uint256 amount;\\n uint256 settlementBuyer; // Settlement amount proposed by the buyer.\\n uint256 settlementSeller; // Settlement amount proposed by the seller.\\n uint256 deadline; // Timestamp at which the transaction can be automatically executed if not disputed.\\n uint256 disputeID; // If dispute exists, the ID of the dispute.\\n uint256 buyerFee; // Total fees paid by the buyer.\\n uint256 sellerFee; // Total fees paid by the seller.\\n uint256 lastFeePaymentTime; // Last time the dispute fees were paid by either party or settlement proposed.\\n string templateData;\\n string templateDataMappings;\\n Status status;\\n IERC20 token; // Token to pay the seller with.\\n}\\n\",\"keccak256\":\"0x4a83bce5c6fa857c81832eaebe4a8c7d045e16f4a3d29a1141769149f03e3a75\",\"license\":\"MIT\"},\"src/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a7a94c77463acea95d979aae1580fb0ddc3b6a1e/contracts/token/ERC20/utils/SafeERC20.sol\\n\\npragma solidity ^0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title SafeERC20\\n/// @dev Wrappers around ERC20 operations that throw on failure (when the token\\n/// contract returns false). Tokens that return no value (and instead revert or\\n/// throw on failure) are also supported, non-reverting calls are assumed to be\\n/// successful.\\n/// To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n/// which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\nlibrary SafeERC20 {\\n /// @dev Calls transfer() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransfer(IERC20 _token, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\",\"keccak256\":\"0x60df38c872cae58f18d4b706251445e13542a5d9d94b9db71de02bfcaf7575ee\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60806040523480156200001157600080fd5b506040516200343238038062003432833981016040819052620000349162000233565b60008054336001600160a01b031991821617909155600180549091166001600160a01b03891617905560026200006b878262000393565b50600380546001600160a01b0319166001600160a01b038516908117909155600583905560068290556040516312a6505d60e21b8152634a99417490620000b990889088906004016200048d565b6020604051808303816000875af1158015620000d9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000ff9190620004cd565b6004556040517ff0d0a0b363c32316c3e6e7e797bbc126af09c634db439ed65a3f96afe7ae2367906200013890849084908a90620004e7565b60405180910390a15050505050505062000508565b6001600160a01b03811681146200016357600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620001995781810151838201526020016200017f565b50506000910152565b600082601f830112620001b457600080fd5b81516001600160401b0380821115620001d157620001d162000166565b604051601f8301601f19908116603f01168101908282118183101715620001fc57620001fc62000166565b816040528381528660208588010111156200021657600080fd5b620002298460208301602089016200017c565b9695505050505050565b600080600080600080600060e0888a0312156200024f57600080fd5b87516200025c816200014d565b60208901519097506001600160401b03808211156200027a57600080fd5b620002888b838c01620001a2565b975060408a01519150808211156200029f57600080fd5b620002ad8b838c01620001a2565b965060608a0151915080821115620002c457600080fd5b50620002d38a828b01620001a2565b9450506080880151620002e6816200014d565b8093505060a0880151915060c0880151905092959891949750929550565b600181811c908216806200031957607f821691505b6020821081036200033a57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200038e57600081815260208120601f850160051c81016020861015620003695750805b601f850160051c820191505b818110156200038a5782815560010162000375565b5050505b505050565b81516001600160401b03811115620003af57620003af62000166565b620003c781620003c0845462000304565b8462000340565b602080601f831160018114620003ff5760008415620003e65750858301515b600019600386901b1c1916600185901b1785556200038a565b600085815260208120601f198616915b8281101562000430578886015182559484019460019091019084016200040f565b50858210156200044f5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008151808452620004798160208601602086016200017c565b601f01601f19169290920160200192915050565b6060815260006060820152608060208201526000620004b060808301856200045f565b8281036040840152620004c481856200045f565b95945050505050565b600060208284031215620004e057600080fd5b5051919050565b838152826020820152606060408201526000620004c460608301846200045f565b612f1a80620005186000396000f3fe60806040526004361061018d5760003560e01c806393ee2678116100d7578063cb44c3fa11610085578063cb44c3fa1461044d578063e4c0aaf41461046d578063e77d0bd31461048d578063e98c579b146104ad578063ee22610b146104cd578063ef48eee6146104ed578063fc548f081461050d578063fe43a9921461052d57600080fd5b806393ee26781461035d5780639ace38c21461037d578063a0af81f0146103b7578063aba36169146103d7578063b2b96792146103f7578063b329036b14610417578063c5d552881461042d57600080fd5b80632fbe3b031161013f5780632fbe3b0314610271578063311a6c561461029e57806334e2672d146102be5780633bf54724146102de578063441080fe146102f15780634660ebbe146103075780636cc6cde1146103275780637aa77f291461034757600080fd5b80630c340a24146101925780630c7ac7b6146101cf5780631bd1823a146101f15780632ae0085e146102135780632be6d005146102345780632e0b6422146102475780632e7700f01461025c575b600080fd5b34801561019e57600080fd5b506000546101b2906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101db57600080fd5b506101e461054d565b6040516101c691906125ac565b3480156101fd57600080fd5b5061021161020c3660046125c6565b6105db565b005b610226610221366004612699565b6106d2565b6040519081526020016101c6565b6102116102423660046125c6565b610844565b34801561025357600080fd5b50610226600281565b34801561026857600080fd5b50600754610226565b34801561027d57600080fd5b5061022661028c3660046125c6565b60086020526000908152604090205481565b3480156102aa57600080fd5b506102116102b936600461273f565b610a92565b3480156102ca57600080fd5b506102116102d9366004612761565b610ba2565b6102116102ec3660046125c6565b610c0e565b3480156102fd57600080fd5b5061022660065481565b34801561031357600080fd5b506102116103223660046127d2565b610e43565b34801561033357600080fd5b506001546101b2906001600160a01b031681565b34801561035357600080fd5b5061022660045481565b34801561036957600080fd5b506102116103783660046125c6565b610e90565b34801561038957600080fd5b5061039d6103983660046125c6565b6110c7565b6040516101c69e9d9c9b9a99989796959493929190612819565b3480156103c357600080fd5b506003546101b2906001600160a01b031681565b3480156103e357600080fd5b506102266103f23660046128bf565b611272565b34801561040357600080fd5b5061021161041236600461273f565b61142c565b34801561042357600080fd5b5061022660055481565b34801561043957600080fd5b50610211610448366004612981565b61169b565b34801561045957600080fd5b506102116104683660046125c6565b611742565b34801561047957600080fd5b506102116104883660046127d2565b6117a2565b34801561049957600080fd5b506102116104a83660046125c6565b6117ef565b3480156104b957600080fd5b506102116104c83660046125c6565b6118cf565b3480156104d957600080fd5b506102116104e83660046125c6565b611923565b3480156104f957600080fd5b5061021161050836600461273f565b611a52565b34801561051957600080fd5b506102116105283660046127d2565b611be5565b34801561053957600080fd5b5061021161054836600461273f565b611c32565b6002805461055a906129e4565b80601f0160208091040260200160405190810160405280929190818152602001828054610586906129e4565b80156105d35780601f106105a8576101008083540402835291602001916105d3565b820191906000526020600020905b8154815290600101906020018083116105b657829003601f168201915b505050505081565b6000600782815481106105f0576105f0612a1e565b60009182526020909120600d9091020190506003600c82015460ff16600681111561061d5761061d6127ef565b1461063b57604051635ed7670b60e11b815260040160405180910390fd5b600554600982015461064d9042612a4a565b101561066c57604051634799187b60e01b815260040160405180910390fd5b6007810180546000909155610682836002611d67565b80156106b15781546040516001600160a01b039091169082156108fc029083906000818181858888f150505050505b60025b6040518490600080516020612ea583398151915290600090a3505050565b600780546001810182556000918252600d027fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688810180546001600160a01b0319908116331782557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c689830180546001600160a01b0389169216919091179055347fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a8301557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6949091018054610100600160a81b03191690556107b28742612a63565b6005820155600a81016107c58582612ad9565b50600b81016107d48482612ad9565b506007546107e490600190612a4a565b9150846001600160a01b0316336001600160a01b0316837f0a7ca50c43ec865fdc8519822762f88432e18409024b9c036d6507b9c8f79d808934866005015460405161083293929190612b92565b60405180910390a45095945050505050565b60006007828154811061085957610859612a1e565b60009182526020909120600d9091020190506001600c82015460ff166006811115610886576108866127ef565b141580156108ad57506002600c82015460ff1660068111156108aa576108aa6127ef565b14155b80156108d257506003600c82015460ff1660068111156108cf576108cf6127ef565b14155b156108f05760405163376af24960e21b815260040160405180910390fd5b6002600c82015460ff16600681111561090b5761090b6127ef565b148015610927575060065460098201546109259042612a4a565b105b1561094557604051630627cd6b60e01b815260040160405180910390fd5b80546001600160a01b0316331461096f5760405163e2bc376b60e01b815260040160405180910390fd5b348160070160008282546109839190612a63565b909155505060015460405163f7434ea960e01b81526000916001600160a01b03169063f7434ea9906109ba90600290600401612c34565b602060405180830381865afa1580156109d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109fb9190612c47565b90508082600701541015610a2257604051631a48f3db60e11b815260040160405180910390fd5b4260098301556008820154811115610a8357600c8201805460ff1916600417905560405183907fc74b9f7dedf2887cd3c113b6d8da9cea19e55c1116e25f1f0e1b72d7543179b590610a7690600290612c70565b60405180910390a2505050565b610a8d83826121e6565b505050565b6001546001600160a01b03163314610abd57604051630955f84760e31b815260040160405180910390fd5b6002811115610adf576040516309efd47960e41b815260040160405180910390fd5b6000828152600860205260408120546007805491929183908110610b0557610b05612a1e565b60009182526020909120600d9091020190506005600c82015460ff166006811115610b3257610b326127ef565b14610b505760405163f10068b560e01b815260040160405180910390fd5b60015460405184815285916001600160a01b0316907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a3610b9c8284611d67565b50505050565b6000546001600160a01b03163314610bcd5760405163c383977560e01b815260040160405180910390fd5b6002610bda828483612c7e565b50600080516020612ec58339815191526005546006548484604051610c029493929190612d38565b60405180910390a15050565b600060078281548110610c2357610c23612a1e565b60009182526020909120600d9091020190506001600c82015460ff166006811115610c5057610c506127ef565b14158015610c7757506002600c82015460ff166006811115610c7457610c746127ef565b14155b8015610c9c57506004600c82015460ff166006811115610c9957610c996127ef565b14155b15610cba5760405163365105ef60e11b815260040160405180910390fd5b6001600c82015460ff166006811115610cd557610cd56127ef565b148015610cf157506006546009820154610cef9042612a4a565b105b15610d0f57604051630627cd6b60e01b815260040160405180910390fd5b60018101546001600160a01b03163314610d3c57604051635800797f60e11b815260040160405180910390fd5b34816008016000828254610d509190612a63565b909155505060015460405163f7434ea960e01b81526000916001600160a01b03169063f7434ea990610d8790600290600401612c34565b602060405180830381865afa158015610da4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc89190612c47565b90508082600801541015610def5760405163818d938f60e01b815260040160405180910390fd5b4260098301556007820154811115610a8357600c8201805460ff1916600317905560405183907fc74b9f7dedf2887cd3c113b6d8da9cea19e55c1116e25f1f0e1b72d7543179b590610a7690600190612c70565b6000546001600160a01b03163314610e6e5760405163c383977560e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600060078281548110610ea557610ea5612a1e565b600091825260208220600d9091020191506001600c83015460ff166006811115610ed157610ed16127ef565b03610f0b5781546001600160a01b03163314610f005760405163e2bc376b60e01b815260040160405180910390fd5b506004810154610f7c565b6002600c83015460ff166006811115610f2657610f266127ef565b03610f635760018201546001600160a01b03163314610f5857604051635800797f60e11b815260040160405180910390fd5b506003810154610f7c565b604051630a7b6ec160e01b815260040160405180910390fd5b6000818360020154610f8e9190612a4a565b600060028501819055600385018190556004850155600c8401805460ff1916600617908190559091506001600160a01b03610100909104166110235782546040516001600160a01b039091169082156108fc029083906000818181858888f150505060018501546040516001600160a01b03909116925084156108fc02915084906000818181858888f19350505050506110a6565b8254600c840154611046916001600160a01b0361010090920482169116836123ad565b6110635760405163022e258160e11b815260040160405180910390fd5b6001830154600c840154611089916001600160a01b0361010090920482169116846123ad565b6110a65760405163022e258160e11b815260040160405180910390fd5b60046040518590600080516020612ea583398151915290600090a350505050565b600781815481106110d757600080fd5b60009182526020909120600d9091020180546001820154600283015460038401546004850154600586015460068701546007880154600889015460098a0154600a8b0180546001600160a01b039b8c169d5099909a169a97999698959794969395929491939092611147906129e4565b80601f0160208091040260200160405190810160405280929190818152602001828054611173906129e4565b80156111c05780601f10611195576101008083540402835291602001916111c0565b820191906000526020600020905b8154815290600101906020018083116111a357829003601f168201915b50505050509080600b0180546111d5906129e4565b80601f0160208091040260200160405190810160405280929190818152602001828054611201906129e4565b801561124e5780601f106112235761010080835404028352916020019161124e565b820191906000526020600020905b81548152906001019060200180831161123157829003601f168201915b505050600c909301549192505060ff8116906001600160a01b03610100909104168e565b60006112896001600160a01b03881633308b612480565b6112a65760405163022e258160e11b815260040160405180910390fd5b60078054600181018255600091909152600d027fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688810180546001600160a01b0319908116331782557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c689830180546001600160a01b03898116919093161790557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a83018b90557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6949092018054928a1661010002610100600160a81b0319909316929092179091556113968742612a63565b6005820155600a81016113a98582612ad9565b50600b81016113b88482612ad9565b506007546113c890600190612a4a565b9150846001600160a01b0316336001600160a01b0316837fb96ca2c0c34e2ad6384277748b8101f4bddc3cbeaad7086e59cd315bd19aa8c5898c8e87600501546040516114189493929190612d75565b60405180910390a450979650505050505050565b60006007838154811061144157611441612a1e565b600091825260208220600d909102019150600c82015460ff16600681111561146b5761146b6127ef565b14801561147c575080600501544210155b1561149a576040516338e5e54b60e21b815260040160405180910390fd5b6003600c82015460ff1660068111156114b5576114b56127ef565b106114d357604051630d71592960e31b815260040160405180910390fd5b80600201548211156114f8576040516305aafecf60e01b815260040160405180910390fd5b42600982015560006001600c83015460ff16600681111561151b5761151b6127ef565b036115715781546001600160a01b0316331461154a5760405163e2bc376b60e01b815260040160405180910390fd5b60038201839055600c820180546002919060ff19166001835b02179055506001905061165b565b6002600c83015460ff16600681111561158c5761158c6127ef565b036115e45760018201546001600160a01b031633146115be57604051635800797f60e11b815260040160405180910390fd5b60048201839055600c820180546001919060ff191682805b02179055506002905061165b565b81546001600160a01b031633036116125760038201839055600c820180546002919060ff1916600183611563565b60018201546001600160a01b031633036116425760048201839055600c820180546001919060ff191682806115d6565b60405163351c18ff60e21b815260040160405180910390fd5b837f10c8b22b69e324b0227c6adfa65183c771304c11385423e93ce99779a7483dbf828560405161168d929190612dad565b60405180910390a250505050565b6000546001600160a01b031633146116c65760405163c383977560e01b815260040160405180910390fd5b6003546040516312a6505d60e21b81526001600160a01b0390911690634a994174906116f89085908590600401612dc8565b6020604051808303816000875af1158015611717573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173b9190612c47565b6004555050565b6000546001600160a01b0316331461176d5760405163c383977560e01b815260040160405180910390fd5b6005819055600654604051600080516020612ec58339815191529161179791849190600290612e04565b60405180910390a150565b6000546001600160a01b031633146117cd5760405163c383977560e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60006007828154811061180457611804612a1e565b60009182526020909120600d9091020190506004600c82015460ff166006811115611831576118316127ef565b1461184f57604051638225aba560e01b815260040160405180910390fd5b60055460098201546118619042612a4a565b101561188057604051634799187b60e01b815260040160405180910390fd5b6008810180546000909155611896836001611d67565b80156118c85760018201546040516001600160a01b039091169082156108fc029083906000818181858888f150505050505b60016106b4565b6000546001600160a01b031633146118fa5760405163c383977560e01b815260040160405180910390fd5b6006819055600554604051600080516020612ec583398151915291611797918490600290612e04565b60006007828154811061193857611938612a1e565b90600052602060002090600d02019050806005015442101561196d576040516302eb354360e41b815260040160405180910390fd5b6000600c82015460ff166006811115611988576119886127ef565b146119a657604051634e22597f60e11b815260040160405180910390fd5b6002810180546000909155600c82015461010090046001600160a01b03166119f95760018201546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505050611a3c565b6001820154600c830154611a1f916001600160a01b0361010090920482169116836123ad565b611a3c5760405163022e258160e11b815260040160405180910390fd5b600c8201805460ff1916600617905560006106b4565b600060078381548110611a6757611a67612a1e565b60009182526020909120600d9091020180549091506001600160a01b03163314611aa45760405163e2bc376b60e01b815260040160405180910390fd5b6000600c82015460ff166006811115611abf57611abf6127ef565b14611add57604051634e22597f60e11b815260040160405180910390fd5b8060020154821115611b02576040516305aafecf60e01b815260040160405180910390fd5b81816002016000828254611b169190612a4a565b9091555050600c81015461010090046001600160a01b0316611b635760018101546040516001600160a01b039091169083156108fc029084906000818181858888f1935050505050611ba6565b6001810154600c820154611b89916001600160a01b0361010090920482169116846123ad565b611ba65760405163022e258160e11b815260040160405180910390fd5b6040805183815233602082015284917fd1432ca9a38d944f01b256a411861b109bc4bfe200c40d7144e919a16b86a8a8910160405180910390a2505050565b6000546001600160a01b03163314611c105760405163c383977560e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600060078381548110611c4757611c47612a1e565b600091825260209091206001600d90920201908101549091506001600160a01b03163314611c8857604051635800797f60e11b815260040160405180910390fd5b6000600c82015460ff166006811115611ca357611ca36127ef565b14611cc157604051634e22597f60e11b815260040160405180910390fd5b8060020154821115611ce6576040516305aafecf60e01b815260040160405180910390fd5b81816002016000828254611cfa9190612a4a565b9091555050600c81015461010090046001600160a01b0316611d445780546040516001600160a01b039091169083156108fc029084906000818181858888f1935050505050611ba6565b8054600c820154611b89916001600160a01b0361010090920482169116846123ad565b600060078381548110611d7c57611d7c612a1e565b600091825260208220600d9190910201600281018054600383018054600485018054600787018054600889018054600c8b0180549a8d9055978c9055948b9055918a905598905560ff1986166006179093559496509194919390926001600160a01b0361010090910416156000198801611f605786546040516001600160a01b039091169084156108fc029085906000818181858888f193505050505084600014611ee7578015611e875786546001600160a01b03166108fc611e3f8789612a4a565b6040518115909202916000818181858888f150505060018901546040516001600160a01b03909116925087156108fc02915087906000818181858888f19350505050506121c0565b8654611eba906001600160a01b0316611ea08789612a4a565b600c8a015461010090046001600160a01b031691906123ad565b506001870154600c880154611ee1916001600160a01b0361010090920482169116876123ad565b506121c0565b8015611f1b5786546040516001600160a01b039091169087156108fc029088906000818181858888f19350505050506121c0565b8654600c880154611f3e916001600160a01b0361010090920482169116886123ad565b611f5b5760405163022e258160e11b815260040160405180910390fd5b6121c0565b6002880361209f5760018701546040516001600160a01b039091169083156108fc029084906000818181858888f1935050505050836000146120425780156120025786546001600160a01b03166108fc611fba8689612a4a565b6040518115909202916000818181858888f150505060018901546040516001600160a01b03909116925086156108fc02915086906000818181858888f19350505050506121c0565b865461201b906001600160a01b0316611ea08689612a4a565b506001870154600c880154611ee1916001600160a01b0361010090920482169116866123ad565b80156120795760018701546040516001600160a01b039091169087156108fc029088906000818181858888f19350505050506121c0565b6001870154600c880154611f3e916001600160a01b0361010090920482169116886123ad565b60006120ac600285612e23565b88546040519192506001600160a01b03169082156108fc029083906000818181858888f150505060018a01546040516001600160a01b03909116925083156108fc02915083906000818181858888f193505050505060006002886121109190612e23565b905082156121715788546040516001600160a01b039091169082156108fc029083906000818181858888f150505060018b01546040516001600160a01b03909116925083156108fc02915083906000818181858888f19350505050506121bd565b8854600c8a0154612194916001600160a01b0361010090920482169116836123ad565b506001890154600c8a01546121bb916001600160a01b0361010090920482169116836123ad565b505b50505b60036040518a90600080516020612ea583398151915290600090a3505050505050505050565b6000600783815481106121fb576121fb612a1e565b60009182526020909120600c600d90920201908101805460ff1916600517905560015460405163c13517e160e01b81529192506001600160a01b03169063c13517e1908490612251906002908190600401612e45565b60206040518083038185885af115801561226f573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906122949190612c47565b60068201818155600091825260086020908152604080842087905591546001546004548451898152938401526060838501819052830194909452915191926001600160a01b0316917f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e271869181900360800190a381816007015411156123565760008282600701546123249190612a4a565b6007830184905582546040519192506001600160a01b03169082156108fc029083906000818181858888f15050505050505b8181600801541115610a8d5760008282600801546123749190612a4a565b6008830184905560018301546040519192506001600160a01b03169082156108fc029083906000818181858888f1505050505050505050565b6040516001600160a01b03838116602483015260448201839052600091829182919087169060640160408051601f198184030181529181526020820180516001600160e01b031663a9059cbb60e01b1790525161240a9190612e66565b6000604051808303816000865af19150503d8060008114612447576040519150601f19603f3d011682016040523d82523d6000602084013e61244c565b606091505b50915091508180156124765750805115806124765750808060200190518101906124769190612e82565b9695505050505050565b6040516001600160a01b038481166024830152838116604483015260648201839052600091829182919088169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b179052516124e59190612e66565b6000604051808303816000865af19150503d8060008114612522576040519150601f19603f3d011682016040523d82523d6000602084013e612527565b606091505b50915091508180156125515750805115806125515750808060200190518101906125519190612e82565b979650505050505050565b60005b8381101561257757818101518382015260200161255f565b50506000910152565b6000815180845261259881602086016020860161255c565b601f01601f19169290920160200192915050565b6020815260006125bf6020830184612580565b9392505050565b6000602082840312156125d857600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261260657600080fd5b81356001600160401b0380821115612620576126206125df565b604051601f8301601f19908116603f01168101908282118183101715612648576126486125df565b8160405283815286602085880101111561266157600080fd5b836020870160208301376000602085830101528094505050505092915050565b6001600160a01b038116811461269657600080fd5b50565b600080600080600060a086880312156126b157600080fd5b8535945060208601356001600160401b03808211156126cf57600080fd5b6126db89838a016125f5565b9550604088013591506126ed82612681565b9093506060870135908082111561270357600080fd5b61270f89838a016125f5565b9350608088013591508082111561272557600080fd5b50612732888289016125f5565b9150509295509295909350565b6000806040838503121561275257600080fd5b50508035926020909101359150565b6000806020838503121561277457600080fd5b82356001600160401b038082111561278b57600080fd5b818501915085601f83011261279f57600080fd5b8135818111156127ae57600080fd5b8660208285010111156127c057600080fd5b60209290920196919550909350505050565b6000602082840312156127e457600080fd5b81356125bf81612681565b634e487b7160e01b600052602160045260246000fd5b60078110612815576128156127ef565b9052565b6001600160a01b038f811682528e1660208201528c60408201528b60608201528a60808201528960a08201528860c08201528760e082015286610100820152856101208201526101c061014082015260006128786101c0830187612580565b82810361016084015261288b8187612580565b91505061289c610180830185612805565b6001600160a01b0383166101a08301529f9e505050505050505050505050505050565b600080600080600080600060e0888a0312156128da57600080fd5b8735965060208801356128ec81612681565b95506040880135945060608801356001600160401b038082111561290f57600080fd5b61291b8b838c016125f5565b955060808a0135915061292d82612681565b90935060a0890135908082111561294357600080fd5b61294f8b838c016125f5565b935060c08a013591508082111561296557600080fd5b506129728a828b016125f5565b91505092959891949750929550565b6000806040838503121561299457600080fd5b82356001600160401b03808211156129ab57600080fd5b6129b7868387016125f5565b935060208501359150808211156129cd57600080fd5b506129da858286016125f5565b9150509250929050565b600181811c908216806129f857607f821691505b602082108103612a1857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115612a5d57612a5d612a34565b92915050565b80820180821115612a5d57612a5d612a34565b601f821115610a8d57600081815260208120601f850160051c81016020861015612a9d5750805b601f850160051c820191505b81811015612abc57828155600101612aa9565b505050505050565b600019600383901b1c191660019190911b1790565b81516001600160401b03811115612af257612af26125df565b612b0681612b0084546129e4565b84612a76565b602080601f831160018114612b355760008415612b235750858301515b612b2d8582612ac4565b865550612abc565b600085815260208120601f198616915b82811015612b6457888601518255948401946001909101908401612b45565b5085821015612b825787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b606081526000612ba56060830186612580565b60208301949094525060400152919050565b60008154612bc4816129e4565b808552602060018381168015612be15760018114612bfb57612c29565b60ff1985168884015283151560051b880183019550612c29565b866000528260002060005b85811015612c215781548a8201860152908301908401612c06565b890184019650505b505050505092915050565b6020815260006125bf6020830184612bb7565b600060208284031215612c5957600080fd5b5051919050565b60038110612815576128156127ef565b60208101612a5d8284612c60565b6001600160401b03831115612c9557612c956125df565b612ca983612ca383546129e4565b83612a76565b6000601f841160018114612cd75760008515612cc55750838201355b612ccf8682612ac4565b845550612d31565b600083815260209020601f19861690835b82811015612d085786850135825560209485019460019092019101612ce8565b5086821015612d255760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b84815283602082015260606040820152816060820152818360808301376000818301608090810191909152601f909201601f191601019392505050565b608081526000612d886080830187612580565b6001600160a01b03959095166020830152506040810192909252606090910152919050565b60408101612dbb8285612c60565b8260208301529392505050565b6060815260006060820152608060208201526000612de96080830185612580565b8281036040840152612dfb8185612580565b95945050505050565b838152826020820152606060408201526000612dfb6060830184612bb7565b600082612e4057634e487b7160e01b600052601260045260246000fd5b500490565b828152604060208201526000612e5e6040830184612bb7565b949350505050565b60008251612e7881846020870161255c565b9190910192915050565b600060208284031215612e9457600080fd5b815180151581146125bf57600080fdfe89e6168584e1de3ec704ff46376271b5481b0d9b2b0ef0ae102f0d001093e000f0d0a0b363c32316c3e6e7e797bbc126af09c634db439ed65a3f96afe7ae2367a26469706673582212205affbe448218da096a7fe86de28ea7e13965bd324154b7a0fe455083b8e8c93764736f6c63430008120033", - "deployedBytecode": "0x60806040526004361061018d5760003560e01c806393ee2678116100d7578063cb44c3fa11610085578063cb44c3fa1461044d578063e4c0aaf41461046d578063e77d0bd31461048d578063e98c579b146104ad578063ee22610b146104cd578063ef48eee6146104ed578063fc548f081461050d578063fe43a9921461052d57600080fd5b806393ee26781461035d5780639ace38c21461037d578063a0af81f0146103b7578063aba36169146103d7578063b2b96792146103f7578063b329036b14610417578063c5d552881461042d57600080fd5b80632fbe3b031161013f5780632fbe3b0314610271578063311a6c561461029e57806334e2672d146102be5780633bf54724146102de578063441080fe146102f15780634660ebbe146103075780636cc6cde1146103275780637aa77f291461034757600080fd5b80630c340a24146101925780630c7ac7b6146101cf5780631bd1823a146101f15780632ae0085e146102135780632be6d005146102345780632e0b6422146102475780632e7700f01461025c575b600080fd5b34801561019e57600080fd5b506000546101b2906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101db57600080fd5b506101e461054d565b6040516101c691906125ac565b3480156101fd57600080fd5b5061021161020c3660046125c6565b6105db565b005b610226610221366004612699565b6106d2565b6040519081526020016101c6565b6102116102423660046125c6565b610844565b34801561025357600080fd5b50610226600281565b34801561026857600080fd5b50600754610226565b34801561027d57600080fd5b5061022661028c3660046125c6565b60086020526000908152604090205481565b3480156102aa57600080fd5b506102116102b936600461273f565b610a92565b3480156102ca57600080fd5b506102116102d9366004612761565b610ba2565b6102116102ec3660046125c6565b610c0e565b3480156102fd57600080fd5b5061022660065481565b34801561031357600080fd5b506102116103223660046127d2565b610e43565b34801561033357600080fd5b506001546101b2906001600160a01b031681565b34801561035357600080fd5b5061022660045481565b34801561036957600080fd5b506102116103783660046125c6565b610e90565b34801561038957600080fd5b5061039d6103983660046125c6565b6110c7565b6040516101c69e9d9c9b9a99989796959493929190612819565b3480156103c357600080fd5b506003546101b2906001600160a01b031681565b3480156103e357600080fd5b506102266103f23660046128bf565b611272565b34801561040357600080fd5b5061021161041236600461273f565b61142c565b34801561042357600080fd5b5061022660055481565b34801561043957600080fd5b50610211610448366004612981565b61169b565b34801561045957600080fd5b506102116104683660046125c6565b611742565b34801561047957600080fd5b506102116104883660046127d2565b6117a2565b34801561049957600080fd5b506102116104a83660046125c6565b6117ef565b3480156104b957600080fd5b506102116104c83660046125c6565b6118cf565b3480156104d957600080fd5b506102116104e83660046125c6565b611923565b3480156104f957600080fd5b5061021161050836600461273f565b611a52565b34801561051957600080fd5b506102116105283660046127d2565b611be5565b34801561053957600080fd5b5061021161054836600461273f565b611c32565b6002805461055a906129e4565b80601f0160208091040260200160405190810160405280929190818152602001828054610586906129e4565b80156105d35780601f106105a8576101008083540402835291602001916105d3565b820191906000526020600020905b8154815290600101906020018083116105b657829003601f168201915b505050505081565b6000600782815481106105f0576105f0612a1e565b60009182526020909120600d9091020190506003600c82015460ff16600681111561061d5761061d6127ef565b1461063b57604051635ed7670b60e11b815260040160405180910390fd5b600554600982015461064d9042612a4a565b101561066c57604051634799187b60e01b815260040160405180910390fd5b6007810180546000909155610682836002611d67565b80156106b15781546040516001600160a01b039091169082156108fc029083906000818181858888f150505050505b60025b6040518490600080516020612ea583398151915290600090a3505050565b600780546001810182556000918252600d027fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688810180546001600160a01b0319908116331782557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c689830180546001600160a01b0389169216919091179055347fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a8301557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6949091018054610100600160a81b03191690556107b28742612a63565b6005820155600a81016107c58582612ad9565b50600b81016107d48482612ad9565b506007546107e490600190612a4a565b9150846001600160a01b0316336001600160a01b0316837f0a7ca50c43ec865fdc8519822762f88432e18409024b9c036d6507b9c8f79d808934866005015460405161083293929190612b92565b60405180910390a45095945050505050565b60006007828154811061085957610859612a1e565b60009182526020909120600d9091020190506001600c82015460ff166006811115610886576108866127ef565b141580156108ad57506002600c82015460ff1660068111156108aa576108aa6127ef565b14155b80156108d257506003600c82015460ff1660068111156108cf576108cf6127ef565b14155b156108f05760405163376af24960e21b815260040160405180910390fd5b6002600c82015460ff16600681111561090b5761090b6127ef565b148015610927575060065460098201546109259042612a4a565b105b1561094557604051630627cd6b60e01b815260040160405180910390fd5b80546001600160a01b0316331461096f5760405163e2bc376b60e01b815260040160405180910390fd5b348160070160008282546109839190612a63565b909155505060015460405163f7434ea960e01b81526000916001600160a01b03169063f7434ea9906109ba90600290600401612c34565b602060405180830381865afa1580156109d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109fb9190612c47565b90508082600701541015610a2257604051631a48f3db60e11b815260040160405180910390fd5b4260098301556008820154811115610a8357600c8201805460ff1916600417905560405183907fc74b9f7dedf2887cd3c113b6d8da9cea19e55c1116e25f1f0e1b72d7543179b590610a7690600290612c70565b60405180910390a2505050565b610a8d83826121e6565b505050565b6001546001600160a01b03163314610abd57604051630955f84760e31b815260040160405180910390fd5b6002811115610adf576040516309efd47960e41b815260040160405180910390fd5b6000828152600860205260408120546007805491929183908110610b0557610b05612a1e565b60009182526020909120600d9091020190506005600c82015460ff166006811115610b3257610b326127ef565b14610b505760405163f10068b560e01b815260040160405180910390fd5b60015460405184815285916001600160a01b0316907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a3610b9c8284611d67565b50505050565b6000546001600160a01b03163314610bcd5760405163c383977560e01b815260040160405180910390fd5b6002610bda828483612c7e565b50600080516020612ec58339815191526005546006548484604051610c029493929190612d38565b60405180910390a15050565b600060078281548110610c2357610c23612a1e565b60009182526020909120600d9091020190506001600c82015460ff166006811115610c5057610c506127ef565b14158015610c7757506002600c82015460ff166006811115610c7457610c746127ef565b14155b8015610c9c57506004600c82015460ff166006811115610c9957610c996127ef565b14155b15610cba5760405163365105ef60e11b815260040160405180910390fd5b6001600c82015460ff166006811115610cd557610cd56127ef565b148015610cf157506006546009820154610cef9042612a4a565b105b15610d0f57604051630627cd6b60e01b815260040160405180910390fd5b60018101546001600160a01b03163314610d3c57604051635800797f60e11b815260040160405180910390fd5b34816008016000828254610d509190612a63565b909155505060015460405163f7434ea960e01b81526000916001600160a01b03169063f7434ea990610d8790600290600401612c34565b602060405180830381865afa158015610da4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc89190612c47565b90508082600801541015610def5760405163818d938f60e01b815260040160405180910390fd5b4260098301556007820154811115610a8357600c8201805460ff1916600317905560405183907fc74b9f7dedf2887cd3c113b6d8da9cea19e55c1116e25f1f0e1b72d7543179b590610a7690600190612c70565b6000546001600160a01b03163314610e6e5760405163c383977560e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600060078281548110610ea557610ea5612a1e565b600091825260208220600d9091020191506001600c83015460ff166006811115610ed157610ed16127ef565b03610f0b5781546001600160a01b03163314610f005760405163e2bc376b60e01b815260040160405180910390fd5b506004810154610f7c565b6002600c83015460ff166006811115610f2657610f266127ef565b03610f635760018201546001600160a01b03163314610f5857604051635800797f60e11b815260040160405180910390fd5b506003810154610f7c565b604051630a7b6ec160e01b815260040160405180910390fd5b6000818360020154610f8e9190612a4a565b600060028501819055600385018190556004850155600c8401805460ff1916600617908190559091506001600160a01b03610100909104166110235782546040516001600160a01b039091169082156108fc029083906000818181858888f150505060018501546040516001600160a01b03909116925084156108fc02915084906000818181858888f19350505050506110a6565b8254600c840154611046916001600160a01b0361010090920482169116836123ad565b6110635760405163022e258160e11b815260040160405180910390fd5b6001830154600c840154611089916001600160a01b0361010090920482169116846123ad565b6110a65760405163022e258160e11b815260040160405180910390fd5b60046040518590600080516020612ea583398151915290600090a350505050565b600781815481106110d757600080fd5b60009182526020909120600d9091020180546001820154600283015460038401546004850154600586015460068701546007880154600889015460098a0154600a8b0180546001600160a01b039b8c169d5099909a169a97999698959794969395929491939092611147906129e4565b80601f0160208091040260200160405190810160405280929190818152602001828054611173906129e4565b80156111c05780601f10611195576101008083540402835291602001916111c0565b820191906000526020600020905b8154815290600101906020018083116111a357829003601f168201915b50505050509080600b0180546111d5906129e4565b80601f0160208091040260200160405190810160405280929190818152602001828054611201906129e4565b801561124e5780601f106112235761010080835404028352916020019161124e565b820191906000526020600020905b81548152906001019060200180831161123157829003601f168201915b505050600c909301549192505060ff8116906001600160a01b03610100909104168e565b60006112896001600160a01b03881633308b612480565b6112a65760405163022e258160e11b815260040160405180910390fd5b60078054600181018255600091909152600d027fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688810180546001600160a01b0319908116331782557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c689830180546001600160a01b03898116919093161790557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a83018b90557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6949092018054928a1661010002610100600160a81b0319909316929092179091556113968742612a63565b6005820155600a81016113a98582612ad9565b50600b81016113b88482612ad9565b506007546113c890600190612a4a565b9150846001600160a01b0316336001600160a01b0316837fb96ca2c0c34e2ad6384277748b8101f4bddc3cbeaad7086e59cd315bd19aa8c5898c8e87600501546040516114189493929190612d75565b60405180910390a450979650505050505050565b60006007838154811061144157611441612a1e565b600091825260208220600d909102019150600c82015460ff16600681111561146b5761146b6127ef565b14801561147c575080600501544210155b1561149a576040516338e5e54b60e21b815260040160405180910390fd5b6003600c82015460ff1660068111156114b5576114b56127ef565b106114d357604051630d71592960e31b815260040160405180910390fd5b80600201548211156114f8576040516305aafecf60e01b815260040160405180910390fd5b42600982015560006001600c83015460ff16600681111561151b5761151b6127ef565b036115715781546001600160a01b0316331461154a5760405163e2bc376b60e01b815260040160405180910390fd5b60038201839055600c820180546002919060ff19166001835b02179055506001905061165b565b6002600c83015460ff16600681111561158c5761158c6127ef565b036115e45760018201546001600160a01b031633146115be57604051635800797f60e11b815260040160405180910390fd5b60048201839055600c820180546001919060ff191682805b02179055506002905061165b565b81546001600160a01b031633036116125760038201839055600c820180546002919060ff1916600183611563565b60018201546001600160a01b031633036116425760048201839055600c820180546001919060ff191682806115d6565b60405163351c18ff60e21b815260040160405180910390fd5b837f10c8b22b69e324b0227c6adfa65183c771304c11385423e93ce99779a7483dbf828560405161168d929190612dad565b60405180910390a250505050565b6000546001600160a01b031633146116c65760405163c383977560e01b815260040160405180910390fd5b6003546040516312a6505d60e21b81526001600160a01b0390911690634a994174906116f89085908590600401612dc8565b6020604051808303816000875af1158015611717573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173b9190612c47565b6004555050565b6000546001600160a01b0316331461176d5760405163c383977560e01b815260040160405180910390fd5b6005819055600654604051600080516020612ec58339815191529161179791849190600290612e04565b60405180910390a150565b6000546001600160a01b031633146117cd5760405163c383977560e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60006007828154811061180457611804612a1e565b60009182526020909120600d9091020190506004600c82015460ff166006811115611831576118316127ef565b1461184f57604051638225aba560e01b815260040160405180910390fd5b60055460098201546118619042612a4a565b101561188057604051634799187b60e01b815260040160405180910390fd5b6008810180546000909155611896836001611d67565b80156118c85760018201546040516001600160a01b039091169082156108fc029083906000818181858888f150505050505b60016106b4565b6000546001600160a01b031633146118fa5760405163c383977560e01b815260040160405180910390fd5b6006819055600554604051600080516020612ec583398151915291611797918490600290612e04565b60006007828154811061193857611938612a1e565b90600052602060002090600d02019050806005015442101561196d576040516302eb354360e41b815260040160405180910390fd5b6000600c82015460ff166006811115611988576119886127ef565b146119a657604051634e22597f60e11b815260040160405180910390fd5b6002810180546000909155600c82015461010090046001600160a01b03166119f95760018201546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505050611a3c565b6001820154600c830154611a1f916001600160a01b0361010090920482169116836123ad565b611a3c5760405163022e258160e11b815260040160405180910390fd5b600c8201805460ff1916600617905560006106b4565b600060078381548110611a6757611a67612a1e565b60009182526020909120600d9091020180549091506001600160a01b03163314611aa45760405163e2bc376b60e01b815260040160405180910390fd5b6000600c82015460ff166006811115611abf57611abf6127ef565b14611add57604051634e22597f60e11b815260040160405180910390fd5b8060020154821115611b02576040516305aafecf60e01b815260040160405180910390fd5b81816002016000828254611b169190612a4a565b9091555050600c81015461010090046001600160a01b0316611b635760018101546040516001600160a01b039091169083156108fc029084906000818181858888f1935050505050611ba6565b6001810154600c820154611b89916001600160a01b0361010090920482169116846123ad565b611ba65760405163022e258160e11b815260040160405180910390fd5b6040805183815233602082015284917fd1432ca9a38d944f01b256a411861b109bc4bfe200c40d7144e919a16b86a8a8910160405180910390a2505050565b6000546001600160a01b03163314611c105760405163c383977560e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600060078381548110611c4757611c47612a1e565b600091825260209091206001600d90920201908101549091506001600160a01b03163314611c8857604051635800797f60e11b815260040160405180910390fd5b6000600c82015460ff166006811115611ca357611ca36127ef565b14611cc157604051634e22597f60e11b815260040160405180910390fd5b8060020154821115611ce6576040516305aafecf60e01b815260040160405180910390fd5b81816002016000828254611cfa9190612a4a565b9091555050600c81015461010090046001600160a01b0316611d445780546040516001600160a01b039091169083156108fc029084906000818181858888f1935050505050611ba6565b8054600c820154611b89916001600160a01b0361010090920482169116846123ad565b600060078381548110611d7c57611d7c612a1e565b600091825260208220600d9190910201600281018054600383018054600485018054600787018054600889018054600c8b0180549a8d9055978c9055948b9055918a905598905560ff1986166006179093559496509194919390926001600160a01b0361010090910416156000198801611f605786546040516001600160a01b039091169084156108fc029085906000818181858888f193505050505084600014611ee7578015611e875786546001600160a01b03166108fc611e3f8789612a4a565b6040518115909202916000818181858888f150505060018901546040516001600160a01b03909116925087156108fc02915087906000818181858888f19350505050506121c0565b8654611eba906001600160a01b0316611ea08789612a4a565b600c8a015461010090046001600160a01b031691906123ad565b506001870154600c880154611ee1916001600160a01b0361010090920482169116876123ad565b506121c0565b8015611f1b5786546040516001600160a01b039091169087156108fc029088906000818181858888f19350505050506121c0565b8654600c880154611f3e916001600160a01b0361010090920482169116886123ad565b611f5b5760405163022e258160e11b815260040160405180910390fd5b6121c0565b6002880361209f5760018701546040516001600160a01b039091169083156108fc029084906000818181858888f1935050505050836000146120425780156120025786546001600160a01b03166108fc611fba8689612a4a565b6040518115909202916000818181858888f150505060018901546040516001600160a01b03909116925086156108fc02915086906000818181858888f19350505050506121c0565b865461201b906001600160a01b0316611ea08689612a4a565b506001870154600c880154611ee1916001600160a01b0361010090920482169116866123ad565b80156120795760018701546040516001600160a01b039091169087156108fc029088906000818181858888f19350505050506121c0565b6001870154600c880154611f3e916001600160a01b0361010090920482169116886123ad565b60006120ac600285612e23565b88546040519192506001600160a01b03169082156108fc029083906000818181858888f150505060018a01546040516001600160a01b03909116925083156108fc02915083906000818181858888f193505050505060006002886121109190612e23565b905082156121715788546040516001600160a01b039091169082156108fc029083906000818181858888f150505060018b01546040516001600160a01b03909116925083156108fc02915083906000818181858888f19350505050506121bd565b8854600c8a0154612194916001600160a01b0361010090920482169116836123ad565b506001890154600c8a01546121bb916001600160a01b0361010090920482169116836123ad565b505b50505b60036040518a90600080516020612ea583398151915290600090a3505050505050505050565b6000600783815481106121fb576121fb612a1e565b60009182526020909120600c600d90920201908101805460ff1916600517905560015460405163c13517e160e01b81529192506001600160a01b03169063c13517e1908490612251906002908190600401612e45565b60206040518083038185885af115801561226f573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906122949190612c47565b60068201818155600091825260086020908152604080842087905591546001546004548451898152938401526060838501819052830194909452915191926001600160a01b0316917f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e271869181900360800190a381816007015411156123565760008282600701546123249190612a4a565b6007830184905582546040519192506001600160a01b03169082156108fc029083906000818181858888f15050505050505b8181600801541115610a8d5760008282600801546123749190612a4a565b6008830184905560018301546040519192506001600160a01b03169082156108fc029083906000818181858888f1505050505050505050565b6040516001600160a01b03838116602483015260448201839052600091829182919087169060640160408051601f198184030181529181526020820180516001600160e01b031663a9059cbb60e01b1790525161240a9190612e66565b6000604051808303816000865af19150503d8060008114612447576040519150601f19603f3d011682016040523d82523d6000602084013e61244c565b606091505b50915091508180156124765750805115806124765750808060200190518101906124769190612e82565b9695505050505050565b6040516001600160a01b038481166024830152838116604483015260648201839052600091829182919088169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b179052516124e59190612e66565b6000604051808303816000865af19150503d8060008114612522576040519150601f19603f3d011682016040523d82523d6000602084013e612527565b606091505b50915091508180156125515750805115806125515750808060200190518101906125519190612e82565b979650505050505050565b60005b8381101561257757818101518382015260200161255f565b50506000910152565b6000815180845261259881602086016020860161255c565b601f01601f19169290920160200192915050565b6020815260006125bf6020830184612580565b9392505050565b6000602082840312156125d857600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261260657600080fd5b81356001600160401b0380821115612620576126206125df565b604051601f8301601f19908116603f01168101908282118183101715612648576126486125df565b8160405283815286602085880101111561266157600080fd5b836020870160208301376000602085830101528094505050505092915050565b6001600160a01b038116811461269657600080fd5b50565b600080600080600060a086880312156126b157600080fd5b8535945060208601356001600160401b03808211156126cf57600080fd5b6126db89838a016125f5565b9550604088013591506126ed82612681565b9093506060870135908082111561270357600080fd5b61270f89838a016125f5565b9350608088013591508082111561272557600080fd5b50612732888289016125f5565b9150509295509295909350565b6000806040838503121561275257600080fd5b50508035926020909101359150565b6000806020838503121561277457600080fd5b82356001600160401b038082111561278b57600080fd5b818501915085601f83011261279f57600080fd5b8135818111156127ae57600080fd5b8660208285010111156127c057600080fd5b60209290920196919550909350505050565b6000602082840312156127e457600080fd5b81356125bf81612681565b634e487b7160e01b600052602160045260246000fd5b60078110612815576128156127ef565b9052565b6001600160a01b038f811682528e1660208201528c60408201528b60608201528a60808201528960a08201528860c08201528760e082015286610100820152856101208201526101c061014082015260006128786101c0830187612580565b82810361016084015261288b8187612580565b91505061289c610180830185612805565b6001600160a01b0383166101a08301529f9e505050505050505050505050505050565b600080600080600080600060e0888a0312156128da57600080fd5b8735965060208801356128ec81612681565b95506040880135945060608801356001600160401b038082111561290f57600080fd5b61291b8b838c016125f5565b955060808a0135915061292d82612681565b90935060a0890135908082111561294357600080fd5b61294f8b838c016125f5565b935060c08a013591508082111561296557600080fd5b506129728a828b016125f5565b91505092959891949750929550565b6000806040838503121561299457600080fd5b82356001600160401b03808211156129ab57600080fd5b6129b7868387016125f5565b935060208501359150808211156129cd57600080fd5b506129da858286016125f5565b9150509250929050565b600181811c908216806129f857607f821691505b602082108103612a1857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115612a5d57612a5d612a34565b92915050565b80820180821115612a5d57612a5d612a34565b601f821115610a8d57600081815260208120601f850160051c81016020861015612a9d5750805b601f850160051c820191505b81811015612abc57828155600101612aa9565b505050505050565b600019600383901b1c191660019190911b1790565b81516001600160401b03811115612af257612af26125df565b612b0681612b0084546129e4565b84612a76565b602080601f831160018114612b355760008415612b235750858301515b612b2d8582612ac4565b865550612abc565b600085815260208120601f198616915b82811015612b6457888601518255948401946001909101908401612b45565b5085821015612b825787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b606081526000612ba56060830186612580565b60208301949094525060400152919050565b60008154612bc4816129e4565b808552602060018381168015612be15760018114612bfb57612c29565b60ff1985168884015283151560051b880183019550612c29565b866000528260002060005b85811015612c215781548a8201860152908301908401612c06565b890184019650505b505050505092915050565b6020815260006125bf6020830184612bb7565b600060208284031215612c5957600080fd5b5051919050565b60038110612815576128156127ef565b60208101612a5d8284612c60565b6001600160401b03831115612c9557612c956125df565b612ca983612ca383546129e4565b83612a76565b6000601f841160018114612cd75760008515612cc55750838201355b612ccf8682612ac4565b845550612d31565b600083815260209020601f19861690835b82811015612d085786850135825560209485019460019092019101612ce8565b5086821015612d255760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b84815283602082015260606040820152816060820152818360808301376000818301608090810191909152601f909201601f191601019392505050565b608081526000612d886080830187612580565b6001600160a01b03959095166020830152506040810192909252606090910152919050565b60408101612dbb8285612c60565b8260208301529392505050565b6060815260006060820152608060208201526000612de96080830185612580565b8281036040840152612dfb8185612580565b95945050505050565b838152826020820152606060408201526000612dfb6060830184612bb7565b600082612e4057634e487b7160e01b600052601260045260246000fd5b500490565b828152604060208201526000612e5e6040830184612bb7565b949350505050565b60008251612e7881846020870161255c565b9190910192915050565b600060208284031215612e9457600080fd5b815180151581146125bf57600080fdfe89e6168584e1de3ec704ff46376271b5481b0d9b2b0ef0ae102f0d001093e000f0d0a0b363c32316c3e6e7e797bbc126af09c634db439ed65a3f96afe7ae2367a26469706673582212205affbe448218da096a7fe86de28ea7e13965bd324154b7a0fe455083b8e8c93764736f6c63430008120033", + "numDeployments": 2, + "solcInputHash": "747147ea99c822791b6b4a2e2e68b668", + "metadata": "{\"compiler\":{\"version\":\"0.8.18+commit.87f61d96\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_templateDataMappings\",\"type\":\"string\"},{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"_templateRegistry\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_feeTimeout\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_settlementTimeout\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ArbitratorOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BuyerFeeNotCoverArbitrationCosts\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BuyerOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BuyerOrSellerOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DeadlineNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputeAlreadyResolved\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRuling\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MaximumPaymentAmountExceeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoSettlementProposedOrTransactionMovedOnAcceptSettlement\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoSettlementProposedOrTransactionMovedOnPayFeeBuyer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoSettlementProposedOrTransactionMovedOnPayFeeSeller\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotSupported\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotWaitingForBuyerFees\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotWaitingForSellerFees\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SellerFeeNotCoverArbitrationCosts\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SellerOnly\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SettlementPeriodNotOver\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TimeoutNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TokenTransferFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransactionDisputed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransactionEscalatedForArbitration\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransactionExpired\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_arbitrableDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_externalDisputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_templateId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_templateUri\",\"type\":\"string\"}],\"name\":\"DisputeRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_transactionUri\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_buyer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_seller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_deadline\",\"type\":\"uint256\"}],\"name\":\"ERC20TransactionCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum Party\",\"name\":\"_party\",\"type\":\"uint8\"}],\"name\":\"HasToPayFee\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_transactionUri\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_buyer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_seller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_deadline\",\"type\":\"uint256\"}],\"name\":\"NativeTransactionCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_feeTimeout\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_settlementTimeout\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"}],\"name\":\"ParameterUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_party\",\"type\":\"address\"}],\"name\":\"Payment\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"Ruling\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum Party\",\"name\":\"_party\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"SettlementProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"enum Resolution\",\"name\":\"_resolution\",\"type\":\"uint8\"}],\"name\":\"TransactionResolved\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AMOUNT_OF_CHOICES\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"}],\"name\":\"acceptSettlement\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"arbitrator\",\"outputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"arbitratorExtraData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IArbitratorV2\",\"name\":\"_arbitrator\",\"type\":\"address\"}],\"name\":\"changeArbitrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_arbitratorExtraData\",\"type\":\"bytes\"}],\"name\":\"changeArbitratorExtraData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_templateDataMappings\",\"type\":\"string\"}],\"name\":\"changeDisputeTemplate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_feeTimeout\",\"type\":\"uint256\"}],\"name\":\"changeFeeTimeout\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_settlementTimeout\",\"type\":\"uint256\"}],\"name\":\"changeSettlementTimeout\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"_templateRegistry\",\"type\":\"address\"}],\"name\":\"changeTemplateRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"contract IERC20\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_deadline\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_transactionUri\",\"type\":\"string\"},{\"internalType\":\"address payable\",\"name\":\"_seller\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_templateDataMappings\",\"type\":\"string\"}],\"name\":\"createERC20Transaction\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"transactionID\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_deadline\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_transactionUri\",\"type\":\"string\"},{\"internalType\":\"address payable\",\"name\":\"_seller\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_templateDataMappings\",\"type\":\"string\"}],\"name\":\"createNativeTransaction\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"transactionID\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"disputeIDtoTransactionID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"}],\"name\":\"executeTransaction\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeTimeout\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTransactionCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"pay\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"}],\"name\":\"payArbitrationFeeByBuyer\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"}],\"name\":\"payArbitrationFeeBySeller\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"proposeSettlement\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_amountReimbursed\",\"type\":\"uint256\"}],\"name\":\"reimburse\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ruling\",\"type\":\"uint256\"}],\"name\":\"rule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"settlementTimeout\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"templateId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"templateRegistry\",\"outputs\":[{\"internalType\":\"contract IDisputeTemplateRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"}],\"name\":\"timeOutByBuyer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_transactionID\",\"type\":\"uint256\"}],\"name\":\"timeOutBySeller\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"transactions\",\"outputs\":[{\"internalType\":\"address payable\",\"name\":\"buyer\",\"type\":\"address\"},{\"internalType\":\"address payable\",\"name\":\"seller\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"settlementBuyer\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"settlementSeller\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"disputeID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"buyerFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"sellerFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastFeePaymentTime\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"templateData\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"templateDataMappings\",\"type\":\"string\"},{\"internalType\":\"enum Status\",\"name\":\"status\",\"type\":\"uint8\"},{\"internalType\":\"contract IERC20\",\"name\":\"token\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Adapted from MultipleArbitrableTokenTransaction contract: https://github.com/kleros/kleros-interaction/blob/master/contracts/standard/arbitration/MultipleArbitrableTokenTransaction.sol and from MultipleArbitrableTransaction contract: https://github.com/kleros/kleros-interaction/blob/master/contracts/standard/arbitration/MultipleArbitrableTransaction.sol Note that the contract expects the tokens to have standard ERC20 behaviour. The tokens that don't conform to this type of behaviour should be filtered by the UI. Tokens should not reenter or allow recipients to refuse the transfer. Also note that arbitration fees are still paid in ETH.\",\"events\":{\"DisputeRequest(address,uint256,uint256,uint256,string)\":{\"details\":\"To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\",\"params\":{\"_arbitrableDisputeID\":\"The identifier of the dispute in the Arbitrable contract.\",\"_arbitrator\":\"The arbitrator of the contract.\",\"_externalDisputeID\":\"An identifier created outside Kleros by the protocol requesting arbitration.\",\"_templateId\":\"The identifier of the dispute template. Should not be used with _templateUri.\",\"_templateUri\":\"The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\"}},\"ERC20TransactionCreated(uint256,string,address,address,address,uint256,uint256)\":{\"details\":\"Emitted when a transaction paid in ERC20 token is created.\",\"params\":{\"_amount\":\"The initial amount in the transaction.\",\"_buyer\":\"The address of the buyer.\",\"_deadline\":\"The deadline of the transaction.\",\"_seller\":\"The address of the seller.\",\"_token\":\"The token address.\",\"_transactionID\":\"The index of the transaction.\",\"_transactionUri\":\"The IPFS Uri Hash of the transaction.\"}},\"HasToPayFee(uint256,uint8)\":{\"details\":\"Indicate that a party has to pay a fee or would otherwise be considered as losing.\",\"params\":{\"_party\":\"The party who has to pay.\",\"_transactionID\":\"The index of the transaction.\"}},\"NativeTransactionCreated(uint256,string,address,address,uint256,uint256)\":{\"details\":\"Emitted when a transaction paid in native currency is created.\",\"params\":{\"_amount\":\"The initial amount in the transaction.\",\"_buyer\":\"The address of the buyer.\",\"_deadline\":\"The deadline of the transaction.\",\"_seller\":\"The address of the seller.\",\"_transactionID\":\"The index of the transaction.\",\"_transactionUri\":\"The IPFS Uri Hash of the transaction.\"}},\"ParameterUpdated(uint256,uint256,bytes)\":{\"details\":\"To be emitted when Escrow parameters are updated.\"},\"Payment(uint256,uint256,address)\":{\"details\":\"To be emitted when a party pays or reimburses the other.\",\"params\":{\"_amount\":\"The amount paid.\",\"_party\":\"The party that paid.\",\"_transactionID\":\"The index of the transaction.\"}},\"Ruling(address,uint256,uint256)\":{\"details\":\"To be raised when a ruling is given.\",\"params\":{\"_arbitrator\":\"The arbitrator giving the ruling.\",\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_ruling\":\"The ruling which was given.\"}},\"SettlementProposed(uint256,uint8,uint256)\":{\"details\":\"Emitted when a party proposes a settlement.\",\"params\":{\"_amount\":\"The amount proposed.\",\"_party\":\"The party that proposed a settlement.\",\"_transactionID\":\"The index of the transaction.\"}},\"TransactionResolved(uint256,uint8)\":{\"details\":\"To be emitted when a transaction is resolved, either by its execution, a timeout or because a ruling was enforced.\",\"params\":{\"_resolution\":\"Short description of what caused the transaction to be solved.\",\"_transactionID\":\"The ID of the respective transaction.\"}}},\"kind\":\"dev\",\"methods\":{\"acceptSettlement(uint256)\":{\"details\":\"Accept a settlement proposed by the other party.\",\"params\":{\"_transactionID\":\"The index of the transaction.\"}},\"constructor\":{\"details\":\"Constructor.\",\"params\":{\"_arbitrator\":\"The arbitrator of the contract.\",\"_arbitratorExtraData\":\"Extra data for the arbitrator.\",\"_feeTimeout\":\"Arbitration fee timeout for the parties.\",\"_settlementTimeout\":\"Settlement timeout for the parties.\",\"_templateData\":\"The dispute template data.\",\"_templateDataMappings\":\"The dispute template data mappings.\",\"_templateRegistry\":\"The dispute template registry.\"}},\"createERC20Transaction(uint256,address,uint256,string,address,string,string)\":{\"details\":\"Create a transaction.\",\"params\":{\"_amount\":\"The amount of tokens in this transaction.\",\"_deadline\":\"Time after which a party can automatically execute the arbitrable transaction.\",\"_seller\":\"The recipient of the transaction.\",\"_templateData\":\"The dispute template data.\",\"_templateDataMappings\":\"The dispute template data mappings.\",\"_token\":\"The ERC20 token contract.\",\"_transactionUri\":\"The IPFS Uri Hash of the transaction.\"},\"returns\":{\"transactionID\":\"The index of the transaction.\"}},\"createNativeTransaction(uint256,string,address,string,string)\":{\"details\":\"Create a transaction.\",\"params\":{\"_deadline\":\"Time after which a party can automatically execute the arbitrable transaction.\",\"_seller\":\"The recipient of the transaction.\",\"_templateData\":\"The dispute template data.\",\"_templateDataMappings\":\"The dispute template data mappings.\",\"_transactionUri\":\"The IPFS Uri Hash of the transaction.\"},\"returns\":{\"transactionID\":\"The index of the transaction.\"}},\"executeTransaction(uint256)\":{\"details\":\"Transfer the transaction's amount to the seller if the timeout has passed.\",\"params\":{\"_transactionID\":\"The index of the transaction.\"}},\"getTransactionCount()\":{\"details\":\"Getter to know the count of transactions.\",\"returns\":{\"_0\":\"The count of transactions.\"}},\"pay(uint256,uint256)\":{\"details\":\"Pay seller. To be called if the good or service is provided.\",\"params\":{\"_amount\":\"Amount to pay in wei.\",\"_transactionID\":\"The index of the transaction.\"}},\"payArbitrationFeeByBuyer(uint256)\":{\"details\":\"Pay the arbitration fee to raise a dispute. To be called by the buyer. Note that it can only be called after settlement proposition. Also note that the arbitrator can have createDispute throw, which will make this function throw and therefore lead to a party being timed-out. This is not a vulnerability as the arbitrator can rule in favor of one party anyway.\",\"params\":{\"_transactionID\":\"The index of the transaction.\"}},\"payArbitrationFeeBySeller(uint256)\":{\"details\":\"Pay the arbitration fee to raise a dispute. To be called by the seller. Note that this function mirrors payArbitrationFeeByBuyer.\",\"params\":{\"_transactionID\":\"The index of the transaction.\"}},\"proposeSettlement(uint256,uint256)\":{\"details\":\"Propose a settlement as a compromise from the initial terms to the other party. Note that a party can only propose a settlement again after the other party has done so as well to prevent front running/griefing issues.\",\"params\":{\"_amount\":\"The settlement amount.\",\"_transactionID\":\"The index of the transaction.\"}},\"reimburse(uint256,uint256)\":{\"details\":\"Reimburse buyer. To be called if the good or service can't be fully provided.\",\"params\":{\"_amountReimbursed\":\"Amount to reimburse in wei.\",\"_transactionID\":\"The index of the transaction.\"}},\"rule(uint256,uint256)\":{\"details\":\"Give a ruling for a dispute. Must be called by the arbitrator. The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\",\"params\":{\"_disputeID\":\"The identifier of the dispute in the Arbitrator contract.\",\"_ruling\":\"Ruling given by the arbitrator. Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\"}},\"timeOutByBuyer(uint256)\":{\"details\":\"Reimburse buyer if seller fails to pay the fee.\",\"params\":{\"_transactionID\":\"The index of the transaction.\"}},\"timeOutBySeller(uint256)\":{\"details\":\"Pay seller if buyer fails to pay the fee.\",\"params\":{\"_transactionID\":\"The index of the transaction.\"}}},\"title\":\"EscrowUniversal for a sale paid in native currency or ERC20 tokens without platform fees.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/EscrowUniversal.sol\":\"EscrowUniversal\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@kleros/kleros-v2-contracts/arbitration/interfaces/IArbitrableV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./IArbitratorV2.sol\\\";\\n\\n/// @title IArbitrableV2\\n/// @notice Arbitrable interface.\\n/// When developing arbitrable contracts, we need to:\\n/// - Define the action taken when a ruling is received by the contract.\\n/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);\\ninterface IArbitrableV2 {\\n /// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.\\n /// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.\\n /// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.\\n /// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.\\n event DisputeRequest(\\n IArbitratorV2 indexed _arbitrator,\\n uint256 indexed _arbitrableDisputeID,\\n uint256 _externalDisputeID,\\n uint256 _templateId,\\n string _templateUri\\n );\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrator The arbitrator giving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitratorV2 indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev Give a ruling for a dispute.\\n /// Must be called by the arbitrator.\\n /// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling Ruling given by the arbitrator.\\n /// Note that 0 is reserved for \\\"Not able/wanting to make a decision\\\".\\n function rule(uint256 _disputeID, uint256 _ruling) external;\\n}\\n\",\"keccak256\":\"0x389326b1f749454ed179bdac2f9d6ce24a1ef944bbce976ca78b93f4e173354a\",\"license\":\"MIT\"},\"@kleros/kleros-v2-contracts/arbitration/interfaces/IArbitratorV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"./IArbitrableV2.sol\\\";\\n\\n/// @title Arbitrator\\n/// Arbitrator interface that implements the new arbitration standard.\\n/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.\\n/// When developing arbitrator contracts we need to:\\n/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).\\n/// - Define the functions for cost display (arbitrationCost).\\n/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).\\ninterface IArbitratorV2 {\\n /// @dev To be emitted when a dispute is created.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _arbitrable The contract which created the dispute.\\n event DisputeCreation(uint256 indexed _disputeID, IArbitrableV2 indexed _arbitrable);\\n\\n /// @dev To be raised when a ruling is given.\\n /// @param _arbitrable The arbitrable receiving the ruling.\\n /// @param _disputeID The identifier of the dispute in the Arbitrator contract.\\n /// @param _ruling The ruling which was given.\\n event Ruling(IArbitrableV2 indexed _arbitrable, uint256 indexed _disputeID, uint256 _ruling);\\n\\n /// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.\\n /// @param _token The ERC20 token.\\n /// @param _accepted Whether the token is accepted or not.\\n event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);\\n\\n /// @dev To be emitted when the fee for a particular ERC20 token is updated.\\n /// @param _feeToken The ERC20 token.\\n /// @param _rateInEth The new rate of the fee token in ETH.\\n /// @param _rateDecimals The new decimals of the fee token rate.\\n event NewCurrencyRate(IERC20 indexed _feeToken, uint64 _rateInEth, uint8 _rateDecimals);\\n\\n /// @dev Create a dispute and pay for the fees in the native currency, typically ETH.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData\\n ) external payable returns (uint256 disputeID);\\n\\n /// @dev Create a dispute and pay for the fees in a supported ERC20 token.\\n /// Must be called by the arbitrable contract.\\n /// Must pay at least arbitrationCost(_extraData).\\n /// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @param _feeAmount Amount of the ERC20 token used to pay fees.\\n /// @return disputeID The identifier of the dispute created.\\n function createDispute(\\n uint256 _numberOfChoices,\\n bytes calldata _extraData,\\n IERC20 _feeToken,\\n uint256 _feeAmount\\n ) external returns (uint256 disputeID);\\n\\n /// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @return cost The arbitration cost in ETH.\\n function arbitrationCost(bytes calldata _extraData) external view returns (uint256 cost);\\n\\n /// @dev Compute the cost of arbitration denominated in `_feeToken`.\\n /// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.\\n /// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).\\n /// @param _feeToken The ERC20 token used to pay fees.\\n /// @return cost The arbitration cost in `_feeToken`.\\n function arbitrationCost(bytes calldata _extraData, IERC20 _feeToken) external view returns (uint256 cost);\\n\\n /// @dev Gets the current ruling of a specified dispute.\\n /// @param _disputeID The ID of the dispute.\\n /// @return ruling The current ruling.\\n /// @return tied Whether it's a tie or not.\\n /// @return overridden Whether the ruling was overridden by appeal funding or not.\\n function currentRuling(uint256 _disputeID) external view returns (uint256 ruling, bool tied, bool overridden);\\n}\\n\",\"keccak256\":\"0x453943ba5ccc94b9b9cdfd4afd3678682d62d8b90fe16b43e90215387d2f6a51\",\"license\":\"MIT\"},\"@kleros/kleros-v2-contracts/arbitration/interfaces/IDisputeTemplateRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\n/// @title IDisputeTemplate\\n/// @notice Dispute Template interface.\\ninterface IDisputeTemplateRegistry {\\n /// @dev To be emitted when a new dispute template is created.\\n /// @param _templateId The identifier of the dispute template.\\n /// @param _templateTag An optional tag for the dispute template, such as \\\"registration\\\" or \\\"removal\\\".\\n /// @param _templateData The template data.\\n /// @param _templateDataMappings The data mappings.\\n event DisputeTemplate(\\n uint256 indexed _templateId,\\n string indexed _templateTag,\\n string _templateData,\\n string _templateDataMappings\\n );\\n\\n function setDisputeTemplate(\\n string memory _templateTag,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external returns (uint256 templateId);\\n}\\n\",\"keccak256\":\"0x88b0038d226532e6cf862a485d162f7bca61ac3d361d6801146b55a240f091ac\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\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 /**\\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 `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/EscrowUniversal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n/// @authors: [@unknownunknown1, @jaybuidl]\\n/// @reviewers: []\\n/// @auditors: []\\n/// @bounties: []\\n\\npragma solidity 0.8.18;\\n\\nimport {IArbitrableV2, IArbitratorV2} from \\\"@kleros/kleros-v2-contracts/arbitration/interfaces/IArbitrableV2.sol\\\";\\nimport \\\"@kleros/kleros-v2-contracts/arbitration/interfaces/IDisputeTemplateRegistry.sol\\\";\\nimport {SafeERC20, IERC20} from \\\"./libraries/SafeERC20.sol\\\";\\nimport \\\"./interfaces/IEscrow.sol\\\";\\n\\n/// @title EscrowUniversal for a sale paid in native currency or ERC20 tokens without platform fees.\\n/// @dev Adapted from MultipleArbitrableTokenTransaction contract: https://github.com/kleros/kleros-interaction/blob/master/contracts/standard/arbitration/MultipleArbitrableTokenTransaction.sol\\n/// and from MultipleArbitrableTransaction contract: https://github.com/kleros/kleros-interaction/blob/master/contracts/standard/arbitration/MultipleArbitrableTransaction.sol\\n/// Note that the contract expects the tokens to have standard ERC20 behaviour.\\n/// The tokens that don't conform to this type of behaviour should be filtered by the UI.\\n/// Tokens should not reenter or allow recipients to refuse the transfer.\\n/// Also note that arbitration fees are still paid in ETH.\\ncontract EscrowUniversal is IEscrow, IArbitrableV2 {\\n // Use safe transfers when both parties are paid simultaneously (save for acceptSettlement) to prevent griefing.\\n using SafeERC20 for IERC20;\\n\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n uint256 public constant AMOUNT_OF_CHOICES = 2;\\n address public governor;\\n IArbitratorV2 public arbitrator; // Address of the arbitrator contract.\\n bytes public arbitratorExtraData; // Extra data to set up the arbitration.\\n IDisputeTemplateRegistry public templateRegistry; // The dispute template registry.\\n uint256 public templateId; // The current dispute template identifier.\\n uint256 public feeTimeout; // Time in seconds a party can take to pay arbitration fees before being considered unresponsive and lose the dispute.\\n uint256 public settlementTimeout; // Time in seconds a party can take to accept or propose a settlement before being considered unresponsive.\\n Transaction[] public transactions; // List of all created transactions.\\n mapping(uint256 => uint256) public disputeIDtoTransactionID; // Naps dispute ID to tx ID.\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n if (governor != msg.sender) revert GovernorOnly();\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor.\\n /// @param _arbitrator The arbitrator of the contract.\\n /// @param _arbitratorExtraData Extra data for the arbitrator.\\n /// @param _templateData The dispute template data.\\n /// @param _templateDataMappings The dispute template data mappings.\\n /// @param _templateRegistry The dispute template registry.\\n /// @param _feeTimeout Arbitration fee timeout for the parties.\\n /// @param _settlementTimeout Settlement timeout for the parties.\\n constructor(\\n IArbitratorV2 _arbitrator,\\n bytes memory _arbitratorExtraData,\\n string memory _templateData,\\n string memory _templateDataMappings,\\n IDisputeTemplateRegistry _templateRegistry,\\n uint256 _feeTimeout,\\n uint256 _settlementTimeout\\n ) {\\n governor = msg.sender;\\n arbitrator = _arbitrator;\\n arbitratorExtraData = _arbitratorExtraData;\\n templateRegistry = _templateRegistry;\\n feeTimeout = _feeTimeout;\\n settlementTimeout = _settlementTimeout;\\n templateId = templateRegistry.setDisputeTemplate(\\\"\\\", _templateData, _templateDataMappings);\\n\\n emit ParameterUpdated(_feeTimeout, _settlementTimeout, _arbitratorExtraData);\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n function changeGovernor(address _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n function changeArbitrator(IArbitratorV2 _arbitrator) external onlyByGovernor {\\n arbitrator = _arbitrator;\\n }\\n\\n function changeArbitratorExtraData(bytes calldata _arbitratorExtraData) external onlyByGovernor {\\n arbitratorExtraData = _arbitratorExtraData;\\n emit ParameterUpdated(feeTimeout, settlementTimeout, _arbitratorExtraData);\\n }\\n\\n function changeTemplateRegistry(IDisputeTemplateRegistry _templateRegistry) external onlyByGovernor {\\n templateRegistry = _templateRegistry;\\n }\\n\\n function changeDisputeTemplate(\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external onlyByGovernor {\\n templateId = templateRegistry.setDisputeTemplate(\\\"\\\", _templateData, _templateDataMappings);\\n }\\n\\n function changeFeeTimeout(uint256 _feeTimeout) external onlyByGovernor {\\n feeTimeout = _feeTimeout;\\n emit ParameterUpdated(_feeTimeout, settlementTimeout, arbitratorExtraData);\\n }\\n\\n function changeSettlementTimeout(uint256 _settlementTimeout) external onlyByGovernor {\\n settlementTimeout = _settlementTimeout;\\n emit ParameterUpdated(feeTimeout, _settlementTimeout, arbitratorExtraData);\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @inheritdoc IEscrow\\n function createNativeTransaction(\\n uint256 _deadline,\\n string memory _transactionUri,\\n address payable _seller,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external payable override returns (uint256 transactionID) {\\n Transaction storage transaction = transactions.push();\\n transaction.buyer = payable(msg.sender);\\n transaction.seller = _seller;\\n transaction.amount = msg.value;\\n transaction.token = NATIVE;\\n transaction.deadline = _deadline;\\n transaction.templateData = _templateData;\\n transaction.templateDataMappings = _templateDataMappings;\\n\\n transactionID = transactions.length - 1;\\n\\n emit NativeTransactionCreated(\\n transactionID,\\n _transactionUri,\\n msg.sender,\\n _seller,\\n msg.value,\\n transaction.deadline\\n );\\n }\\n\\n /// @inheritdoc IEscrow\\n function createERC20Transaction(\\n uint256 _amount,\\n IERC20 _token,\\n uint256 _deadline,\\n string memory _transactionUri,\\n address payable _seller,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external override returns (uint256 transactionID) {\\n // Transfers token from sender wallet to contract.\\n if (!_token.safeTransferFrom(msg.sender, address(this), _amount)) revert TokenTransferFailed();\\n Transaction storage transaction = transactions.push();\\n transaction.buyer = payable(msg.sender);\\n transaction.seller = _seller;\\n transaction.amount = _amount;\\n transaction.token = _token;\\n transaction.deadline = _deadline;\\n transaction.templateData = _templateData;\\n transaction.templateDataMappings = _templateDataMappings;\\n\\n transactionID = transactions.length - 1;\\n\\n emit ERC20TransactionCreated(\\n transactionID,\\n _transactionUri,\\n msg.sender,\\n _seller,\\n _token,\\n _amount,\\n transaction.deadline\\n );\\n }\\n\\n /// @inheritdoc IEscrow\\n function pay(uint256 _transactionID, uint256 _amount) external override {\\n Transaction storage transaction = transactions[_transactionID];\\n if (transaction.buyer != msg.sender) revert BuyerOnly();\\n if (transaction.status != Status.NoDispute) revert TransactionDisputed();\\n if (_amount > transaction.amount) revert MaximumPaymentAmountExceeded();\\n\\n transaction.amount -= _amount;\\n\\n if (transaction.token == NATIVE) {\\n transaction.seller.send(_amount); // It is the user responsibility to accept ETH.\\n } else {\\n if (!transaction.token.safeTransfer(transaction.seller, _amount)) revert TokenTransferFailed();\\n }\\n\\n emit Payment(_transactionID, _amount, msg.sender);\\n }\\n\\n /// @inheritdoc IEscrow\\n function reimburse(uint256 _transactionID, uint256 _amountReimbursed) external override {\\n Transaction storage transaction = transactions[_transactionID];\\n if (transaction.seller != msg.sender) revert SellerOnly();\\n if (transaction.status != Status.NoDispute) revert TransactionDisputed();\\n if (_amountReimbursed > transaction.amount) revert MaximumPaymentAmountExceeded();\\n\\n transaction.amount -= _amountReimbursed;\\n\\n if (transaction.token == NATIVE) {\\n transaction.buyer.send(_amountReimbursed); // It is the user responsibility to accept ETH.\\n } else {\\n if (!transaction.token.safeTransfer(transaction.buyer, _amountReimbursed)) revert TokenTransferFailed();\\n }\\n\\n emit Payment(_transactionID, _amountReimbursed, msg.sender);\\n }\\n\\n /// @inheritdoc IEscrow\\n function executeTransaction(uint256 _transactionID) external override {\\n Transaction storage transaction = transactions[_transactionID];\\n if (block.timestamp < transaction.deadline) revert DeadlineNotPassed();\\n if (transaction.status != Status.NoDispute) revert TransactionDisputed();\\n\\n uint256 amount = transaction.amount;\\n transaction.amount = 0;\\n\\n if (transaction.token == NATIVE) {\\n transaction.seller.send(amount); // It is the user responsibility to accept ETH.\\n } else {\\n if (!transaction.token.safeTransfer(transaction.seller, amount)) revert TokenTransferFailed();\\n }\\n\\n transaction.status = Status.TransactionResolved;\\n\\n emit TransactionResolved(_transactionID, Resolution.TransactionExecuted);\\n }\\n\\n /// @inheritdoc IEscrow\\n function proposeSettlement(uint256 _transactionID, uint256 _amount) external override {\\n Transaction storage transaction = transactions[_transactionID];\\n if (transaction.status == Status.NoDispute && block.timestamp >= transaction.deadline)\\n revert TransactionExpired();\\n if (transaction.status >= Status.WaitingBuyer) revert TransactionEscalatedForArbitration();\\n if (_amount > transaction.amount) revert MaximumPaymentAmountExceeded();\\n\\n Party party;\\n transaction.lastFeePaymentTime = block.timestamp;\\n if (transaction.status == Status.WaitingSettlementBuyer) {\\n if (msg.sender != transaction.buyer) revert BuyerOnly();\\n transaction.settlementBuyer = _amount;\\n transaction.status = Status.WaitingSettlementSeller;\\n party = Party.Buyer;\\n } else if (transaction.status == Status.WaitingSettlementSeller) {\\n if (msg.sender != transaction.seller) revert SellerOnly();\\n transaction.settlementSeller = _amount;\\n transaction.status = Status.WaitingSettlementBuyer;\\n party = Party.Seller;\\n } else {\\n if (msg.sender == transaction.buyer) {\\n transaction.settlementBuyer = _amount;\\n transaction.status = Status.WaitingSettlementSeller;\\n party = Party.Buyer;\\n } else if (msg.sender == transaction.seller) {\\n transaction.settlementSeller = _amount;\\n transaction.status = Status.WaitingSettlementBuyer;\\n party = Party.Seller;\\n } else revert BuyerOrSellerOnly();\\n }\\n emit SettlementProposed(_transactionID, party, _amount);\\n }\\n\\n /// @inheritdoc IEscrow\\n function acceptSettlement(uint256 _transactionID) external override {\\n Transaction storage transaction = transactions[_transactionID];\\n uint256 settlementAmount;\\n if (transaction.status == Status.WaitingSettlementBuyer) {\\n if (msg.sender != transaction.buyer) revert BuyerOnly();\\n settlementAmount = transaction.settlementSeller;\\n } else if (transaction.status == Status.WaitingSettlementSeller) {\\n if (msg.sender != transaction.seller) revert SellerOnly();\\n settlementAmount = transaction.settlementBuyer;\\n } else revert NoSettlementProposedOrTransactionMovedOnAcceptSettlement();\\n\\n uint256 remainingAmount = transaction.amount - settlementAmount;\\n\\n transaction.amount = 0;\\n transaction.settlementBuyer = 0;\\n transaction.settlementSeller = 0;\\n transaction.status = Status.TransactionResolved;\\n\\n if (transaction.token == NATIVE) {\\n // It is the users' responsibility to accept ETH.\\n transaction.buyer.send(remainingAmount);\\n transaction.seller.send(settlementAmount);\\n } else {\\n if (!transaction.token.safeTransfer(transaction.buyer, remainingAmount)) revert TokenTransferFailed();\\n if (!transaction.token.safeTransfer(transaction.seller, settlementAmount)) revert TokenTransferFailed();\\n }\\n\\n emit TransactionResolved(_transactionID, Resolution.SettlementReached);\\n }\\n\\n /// @inheritdoc IEscrow\\n function payArbitrationFeeByBuyer(uint256 _transactionID) external payable override {\\n Transaction storage transaction = transactions[_transactionID];\\n if (\\n transaction.status != Status.WaitingSettlementBuyer &&\\n transaction.status != Status.WaitingSettlementSeller &&\\n transaction.status != Status.WaitingBuyer\\n ) revert NoSettlementProposedOrTransactionMovedOnPayFeeBuyer();\\n\\n // Allow the other party enough time to respond to a settlement before allowing the proposer to raise a dispute.\\n if (\\n transaction.status == Status.WaitingSettlementSeller &&\\n block.timestamp - transaction.lastFeePaymentTime < settlementTimeout\\n ) revert SettlementPeriodNotOver();\\n\\n if (msg.sender != transaction.buyer) revert BuyerOnly();\\n\\n transaction.buyerFee += msg.value;\\n uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);\\n if (transaction.buyerFee < arbitrationCost) revert BuyerFeeNotCoverArbitrationCosts();\\n\\n transaction.lastFeePaymentTime = block.timestamp;\\n\\n if (transaction.sellerFee < arbitrationCost) {\\n // The seller still has to pay. This can also happen if he has paid, but arbitrationCost has increased.\\n transaction.status = Status.WaitingSeller;\\n emit HasToPayFee(_transactionID, Party.Seller);\\n } else {\\n // The seller has also paid the fee. We create the dispute.\\n raiseDispute(_transactionID, arbitrationCost);\\n }\\n }\\n\\n /// @inheritdoc IEscrow\\n function payArbitrationFeeBySeller(uint256 _transactionID) external payable override {\\n Transaction storage transaction = transactions[_transactionID];\\n if (\\n transaction.status != Status.WaitingSettlementBuyer &&\\n transaction.status != Status.WaitingSettlementSeller &&\\n transaction.status != Status.WaitingSeller\\n ) revert NoSettlementProposedOrTransactionMovedOnPayFeeSeller();\\n\\n // Allow the other party enough time to respond to a settlement before allowing the proposer to raise a dispute.\\n if (\\n transaction.status == Status.WaitingSettlementBuyer &&\\n block.timestamp - transaction.lastFeePaymentTime < settlementTimeout\\n ) revert SettlementPeriodNotOver();\\n\\n if (msg.sender != transaction.seller) revert SellerOnly();\\n\\n transaction.sellerFee += msg.value;\\n uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);\\n if (transaction.sellerFee < arbitrationCost) revert SellerFeeNotCoverArbitrationCosts();\\n\\n transaction.lastFeePaymentTime = block.timestamp;\\n\\n if (transaction.buyerFee < arbitrationCost) {\\n // The buyer still has to pay. This can also happen if he has paid, but arbitrationCost has increased.\\n transaction.status = Status.WaitingBuyer;\\n emit HasToPayFee(_transactionID, Party.Buyer);\\n } else {\\n // The buyer has also paid the fee. We create the dispute.\\n raiseDispute(_transactionID, arbitrationCost);\\n }\\n }\\n\\n /// @inheritdoc IEscrow\\n function timeOutByBuyer(uint256 _transactionID) external override {\\n Transaction storage transaction = transactions[_transactionID];\\n if (transaction.status != Status.WaitingSeller) revert NotWaitingForSellerFees();\\n if (block.timestamp - transaction.lastFeePaymentTime < feeTimeout) revert TimeoutNotPassed();\\n\\n uint256 amount = transaction.sellerFee;\\n transaction.sellerFee = 0;\\n\\n executeRuling(_transactionID, uint256(Party.Buyer));\\n\\n if (amount != 0) {\\n transaction.seller.send(amount); // It is the user responsibility to accept ETH.\\n }\\n\\n emit TransactionResolved(_transactionID, Resolution.TimeoutByBuyer);\\n }\\n\\n /// @inheritdoc IEscrow\\n function timeOutBySeller(uint256 _transactionID) external override {\\n Transaction storage transaction = transactions[_transactionID];\\n if (transaction.status != Status.WaitingBuyer) revert NotWaitingForBuyerFees();\\n if (block.timestamp - transaction.lastFeePaymentTime < feeTimeout) revert TimeoutNotPassed();\\n\\n uint256 amount = transaction.buyerFee;\\n transaction.buyerFee = 0;\\n\\n executeRuling(_transactionID, uint256(Party.Seller));\\n\\n if (amount != 0) {\\n transaction.buyer.send(amount); // It is the user responsibility to accept ETH.\\n }\\n\\n emit TransactionResolved(_transactionID, Resolution.TimeoutBySeller);\\n }\\n\\n /// @inheritdoc IArbitrableV2\\n function rule(uint256 _disputeID, uint256 _ruling) external override {\\n if (msg.sender != address(arbitrator)) revert ArbitratorOnly();\\n if (_ruling > AMOUNT_OF_CHOICES) revert InvalidRuling();\\n\\n uint256 transactionID = disputeIDtoTransactionID[_disputeID];\\n Transaction storage transaction = transactions[transactionID];\\n if (transaction.status != Status.DisputeCreated) revert DisputeAlreadyResolved();\\n\\n emit Ruling(arbitrator, _disputeID, _ruling);\\n executeRuling(transactionID, _ruling);\\n }\\n\\n // ************************************* //\\n // * Internal * //\\n // ************************************* //\\n\\n /// @dev Create a dispute.\\n /// @param _transactionID The index of the transaction.\\n /// @param _arbitrationCost Amount to pay the arbitrator.\\n function raiseDispute(uint256 _transactionID, uint256 _arbitrationCost) internal {\\n Transaction storage transaction = transactions[_transactionID];\\n transaction.status = Status.DisputeCreated;\\n transaction.disputeID = arbitrator.createDispute{value: _arbitrationCost}(\\n AMOUNT_OF_CHOICES,\\n arbitratorExtraData\\n );\\n disputeIDtoTransactionID[transaction.disputeID] = _transactionID;\\n emit DisputeRequest(arbitrator, transaction.disputeID, _transactionID, templateId, \\\"\\\");\\n\\n // Refund buyer if he overpaid.\\n if (transaction.buyerFee > _arbitrationCost) {\\n uint256 extraFeeBuyer = transaction.buyerFee - _arbitrationCost;\\n transaction.buyerFee = _arbitrationCost;\\n transaction.buyer.send(extraFeeBuyer); // It is the user responsibility to accept ETH.\\n }\\n\\n // Refund seller if he overpaid.\\n if (transaction.sellerFee > _arbitrationCost) {\\n uint256 extraFeeSeller = transaction.sellerFee - _arbitrationCost;\\n transaction.sellerFee = _arbitrationCost;\\n transaction.seller.send(extraFeeSeller); // It is the user responsibility to accept ETH.\\n }\\n }\\n\\n /// @dev Execute a ruling of a dispute. It reimburses the fee to the winning party.\\n /// @param _transactionID The index of the transaction.\\n /// @param _ruling Ruling given by the arbitrator. 1 : Reimburse the seller. 2 : Pay the buyer.\\n function executeRuling(uint256 _transactionID, uint256 _ruling) internal {\\n Transaction storage transaction = transactions[_transactionID];\\n uint256 amount = transaction.amount;\\n uint256 settlementBuyer = transaction.settlementBuyer;\\n uint256 settlementSeller = transaction.settlementSeller;\\n uint256 buyerFee = transaction.buyerFee;\\n uint256 sellerFee = transaction.sellerFee;\\n bool nativePayment = transaction.token == NATIVE;\\n\\n transaction.amount = 0;\\n transaction.settlementBuyer = 0;\\n transaction.settlementSeller = 0;\\n transaction.buyerFee = 0;\\n transaction.sellerFee = 0;\\n transaction.status = Status.TransactionResolved;\\n\\n // Give the arbitration fee back.\\n if (_ruling == uint256(Party.Buyer)) {\\n transaction.buyer.send(buyerFee);\\n // If there was a settlement amount proposed, we use that to make the partial payment and refund the rest.\\n if (settlementBuyer != 0) {\\n if (nativePayment) {\\n transaction.buyer.send(amount - settlementBuyer); // It is the user responsibility to accept ETH.\\n transaction.seller.send(settlementBuyer);\\n } else {\\n transaction.token.safeTransfer(transaction.buyer, amount - settlementBuyer);\\n transaction.token.safeTransfer(transaction.seller, settlementBuyer);\\n }\\n } else {\\n if (nativePayment) {\\n transaction.buyer.send(amount); // It is the user responsibility to accept ETH.\\n } else {\\n if (!transaction.token.safeTransfer(transaction.buyer, amount)) revert TokenTransferFailed();\\n }\\n }\\n } else if (_ruling == uint256(Party.Seller)) {\\n transaction.seller.send(sellerFee);\\n // If there was a settlement amount proposed, we use that to make the partial payment and refund the rest to buyer.\\n if (settlementSeller != 0) {\\n if (nativePayment) {\\n transaction.buyer.send(amount - settlementSeller); // It is the user responsibility to accept ETH.\\n transaction.seller.send(settlementSeller);\\n } else {\\n transaction.token.safeTransfer(transaction.buyer, amount - settlementSeller);\\n transaction.token.safeTransfer(transaction.seller, settlementSeller);\\n }\\n } else {\\n if (nativePayment) {\\n transaction.seller.send(amount); // It is the user responsibility to accept ETH.\\n } else {\\n if (!transaction.token.safeTransfer(transaction.seller, amount)) revert TokenTransferFailed();\\n }\\n }\\n } else {\\n uint256 splitArbitrationFee = buyerFee / 2;\\n transaction.buyer.send(splitArbitrationFee);\\n transaction.seller.send(splitArbitrationFee);\\n\\n // Tokens should not reenter or allow recipients to refuse the transfer.\\n // In case of an uneven token amount, one basic token unit can be burnt.\\n uint256 splitAmount = amount / 2;\\n if (nativePayment) {\\n transaction.buyer.send(splitAmount); // It is the user responsibility to accept ETH.\\n transaction.seller.send(splitAmount);\\n } else {\\n transaction.token.safeTransfer(transaction.buyer, splitAmount);\\n transaction.token.safeTransfer(transaction.seller, splitAmount);\\n }\\n }\\n\\n emit TransactionResolved(_transactionID, Resolution.RulingEnforced);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @inheritdoc IEscrow\\n function getTransactionCount() external view override returns (uint256) {\\n return transactions.length;\\n }\\n}\\n\",\"keccak256\":\"0xe2d79bf18672545e35470b7bc47ba77b1247ca57d4f28adb20f44d16a16df305\",\"license\":\"MIT\"},\"src/interfaces/IEscrow.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.18;\\n\\nimport \\\"./Types.sol\\\";\\n\\ninterface IEscrow {\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n /// @dev To be emitted when Escrow parameters are updated.\\n event ParameterUpdated(uint256 _feeTimeout, uint256 _settlementTimeout, bytes _arbitratorExtraData);\\n\\n /// @dev To be emitted when a party pays or reimburses the other.\\n /// @param _transactionID The index of the transaction.\\n /// @param _amount The amount paid.\\n /// @param _party The party that paid.\\n event Payment(uint256 indexed _transactionID, uint256 _amount, address _party);\\n\\n /// @dev Indicate that a party has to pay a fee or would otherwise be considered as losing.\\n /// @param _transactionID The index of the transaction.\\n /// @param _party The party who has to pay.\\n event HasToPayFee(uint256 indexed _transactionID, Party _party);\\n\\n /// @dev Emitted when a party proposes a settlement.\\n /// @param _transactionID The index of the transaction.\\n /// @param _party The party that proposed a settlement.\\n /// @param _amount The amount proposed.\\n event SettlementProposed(uint256 indexed _transactionID, Party _party, uint256 _amount);\\n\\n /// @dev Emitted when a transaction paid in native currency is created.\\n /// @param _transactionID The index of the transaction.\\n /// @param _transactionUri The IPFS Uri Hash of the transaction.\\n /// @param _buyer The address of the buyer.\\n /// @param _seller The address of the seller.\\n /// @param _amount The initial amount in the transaction.\\n /// @param _deadline The deadline of the transaction.\\n event NativeTransactionCreated(\\n uint256 indexed _transactionID,\\n string _transactionUri,\\n address indexed _buyer,\\n address indexed _seller,\\n uint256 _amount,\\n uint256 _deadline\\n );\\n\\n /// @dev Emitted when a transaction paid in ERC20 token is created.\\n /// @param _transactionID The index of the transaction.\\n /// @param _transactionUri The IPFS Uri Hash of the transaction.\\n /// @param _buyer The address of the buyer.\\n /// @param _seller The address of the seller.\\n /// @param _token The token address.\\n /// @param _amount The initial amount in the transaction.\\n /// @param _deadline The deadline of the transaction.\\n event ERC20TransactionCreated(\\n uint256 indexed _transactionID,\\n string _transactionUri,\\n address indexed _buyer,\\n address indexed _seller,\\n IERC20 _token,\\n uint256 _amount,\\n uint256 _deadline\\n );\\n\\n /// @dev To be emitted when a transaction is resolved, either by its\\n /// execution, a timeout or because a ruling was enforced.\\n /// @param _transactionID The ID of the respective transaction.\\n /// @param _resolution Short description of what caused the transaction to be solved.\\n event TransactionResolved(uint256 indexed _transactionID, Resolution indexed _resolution);\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Create a transaction.\\n /// @param _deadline Time after which a party can automatically execute the arbitrable transaction.\\n /// @param _transactionUri The IPFS Uri Hash of the transaction.\\n /// @param _seller The recipient of the transaction.\\n /// @param _templateData The dispute template data.\\n /// @param _templateDataMappings The dispute template data mappings.\\n /// @return transactionID The index of the transaction.\\n function createNativeTransaction(\\n uint256 _deadline,\\n string memory _transactionUri,\\n address payable _seller,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external payable returns (uint256 transactionID);\\n\\n /// @dev Create a transaction.\\n /// @param _amount The amount of tokens in this transaction.\\n /// @param _token The ERC20 token contract.\\n /// @param _deadline Time after which a party can automatically execute the arbitrable transaction.\\n /// @param _transactionUri The IPFS Uri Hash of the transaction.\\n /// @param _seller The recipient of the transaction.\\n /// @param _templateData The dispute template data.\\n /// @param _templateDataMappings The dispute template data mappings.\\n /// @return transactionID The index of the transaction.\\n function createERC20Transaction(\\n uint256 _amount,\\n IERC20 _token,\\n uint256 _deadline,\\n string memory _transactionUri,\\n address payable _seller,\\n string memory _templateData,\\n string memory _templateDataMappings\\n ) external returns (uint256 transactionID);\\n\\n /// @dev Pay seller. To be called if the good or service is provided.\\n /// @param _transactionID The index of the transaction.\\n /// @param _amount Amount to pay in wei.\\n function pay(uint256 _transactionID, uint256 _amount) external;\\n\\n /// @dev Reimburse buyer. To be called if the good or service can't be fully provided.\\n /// @param _transactionID The index of the transaction.\\n /// @param _amountReimbursed Amount to reimburse in wei.\\n function reimburse(uint256 _transactionID, uint256 _amountReimbursed) external;\\n\\n /// @dev Transfer the transaction's amount to the seller if the timeout has passed.\\n /// @param _transactionID The index of the transaction.\\n function executeTransaction(uint256 _transactionID) external;\\n\\n /// @dev Propose a settlement as a compromise from the initial terms to the other party.\\n /// Note that a party can only propose a settlement again after the other party has\\n /// done so as well to prevent front running/griefing issues.\\n /// @param _transactionID The index of the transaction.\\n /// @param _amount The settlement amount.\\n function proposeSettlement(uint256 _transactionID, uint256 _amount) external;\\n\\n /// @dev Accept a settlement proposed by the other party.\\n /// @param _transactionID The index of the transaction.\\n function acceptSettlement(uint256 _transactionID) external;\\n\\n /// @dev Pay the arbitration fee to raise a dispute. To be called by the buyer.\\n /// Note that it can only be called after settlement proposition.\\n /// Also note that the arbitrator can have createDispute throw, which will make\\n /// this function throw and therefore lead to a party being timed-out.\\n /// This is not a vulnerability as the arbitrator can rule in favor of one party anyway.\\n /// @param _transactionID The index of the transaction.\\n function payArbitrationFeeByBuyer(uint256 _transactionID) external payable;\\n\\n /// @dev Pay the arbitration fee to raise a dispute. To be called by the seller.\\n /// Note that this function mirrors payArbitrationFeeByBuyer.\\n /// @param _transactionID The index of the transaction.\\n function payArbitrationFeeBySeller(uint256 _transactionID) external payable;\\n\\n /// @dev Reimburse buyer if seller fails to pay the fee.\\n /// @param _transactionID The index of the transaction.\\n function timeOutByBuyer(uint256 _transactionID) external;\\n\\n /// @dev Pay seller if buyer fails to pay the fee.\\n /// @param _transactionID The index of the transaction.\\n function timeOutBySeller(uint256 _transactionID) external;\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Getter to know the count of transactions.\\n /// @return The count of transactions.\\n function getTransactionCount() external view returns (uint256);\\n\\n // ************************************* //\\n // * Errors * //\\n // ************************************* //\\n\\n error GovernorOnly();\\n error BuyerOnly();\\n error SellerOnly();\\n error BuyerOrSellerOnly();\\n error ArbitratorOnly();\\n error TransactionDisputed();\\n error MaximumPaymentAmountExceeded();\\n error DeadlineNotPassed();\\n error BuyerFeeNotCoverArbitrationCosts();\\n error SellerFeeNotCoverArbitrationCosts();\\n error NotWaitingForSellerFees();\\n error NotWaitingForBuyerFees();\\n error TimeoutNotPassed();\\n error InvalidRuling();\\n error DisputeAlreadyResolved();\\n error TransactionExpired();\\n error TransactionEscalatedForArbitration();\\n error NoSettlementProposedOrTransactionMovedOnAcceptSettlement();\\n error NoSettlementProposedOrTransactionMovedOnPayFeeBuyer();\\n error NoSettlementProposedOrTransactionMovedOnPayFeeSeller();\\n error SettlementPeriodNotOver();\\n error NotSupported();\\n error TokenTransferFailed();\\n}\\n\",\"keccak256\":\"0xc824722c455af26717dac976b86a67f9f6106a684c04b8118bd317fa443f67a9\",\"license\":\"MIT\"},\"src/interfaces/Types.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.18;\\n\\nimport {IERC20} from \\\"../libraries/SafeERC20.sol\\\";\\n\\nIERC20 constant NATIVE = IERC20(address(0));\\n\\nenum Party {\\n None,\\n Buyer, // Makes a purchase in native currency or ERC20 token.\\n Seller // Provides a good or service in exchange for native currency or ERC20 token.\\n}\\n\\nenum Status {\\n NoDispute,\\n WaitingSettlementBuyer,\\n WaitingSettlementSeller,\\n WaitingBuyer,\\n WaitingSeller,\\n DisputeCreated,\\n TransactionResolved\\n}\\n\\nenum Resolution {\\n TransactionExecuted,\\n TimeoutByBuyer,\\n TimeoutBySeller,\\n RulingEnforced,\\n SettlementReached\\n}\\n\\nstruct Transaction {\\n address payable buyer;\\n address payable seller;\\n uint256 amount;\\n uint256 settlementBuyer; // Settlement amount proposed by the buyer.\\n uint256 settlementSeller; // Settlement amount proposed by the seller.\\n uint256 deadline; // Timestamp at which the transaction can be automatically executed if not disputed.\\n uint256 disputeID; // If dispute exists, the ID of the dispute.\\n uint256 buyerFee; // Total fees paid by the buyer.\\n uint256 sellerFee; // Total fees paid by the seller.\\n uint256 lastFeePaymentTime; // Last time the dispute fees were paid by either party or settlement proposed.\\n string templateData;\\n string templateDataMappings;\\n Status status;\\n IERC20 token; // Token to pay the seller with.\\n}\\n\",\"keccak256\":\"0x4a83bce5c6fa857c81832eaebe4a8c7d045e16f4a3d29a1141769149f03e3a75\",\"license\":\"MIT\"},\"src/libraries/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a7a94c77463acea95d979aae1580fb0ddc3b6a1e/contracts/token/ERC20/utils/SafeERC20.sol\\n\\npragma solidity ^0.8.18;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/// @title SafeERC20\\n/// @dev Wrappers around ERC20 operations that throw on failure (when the token\\n/// contract returns false). Tokens that return no value (and instead revert or\\n/// throw on failure) are also supported, non-reverting calls are assumed to be\\n/// successful.\\n/// To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n/// which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\nlibrary SafeERC20 {\\n /// @dev Calls transfer() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransfer(IERC20 _token, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(abi.encodeCall(IERC20.transfer, (_to, _value)));\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n\\n /// @dev Calls transferFrom() without reverting.\\n /// @param _token Token to transfer.\\n /// @param _from Sender address.\\n /// @param _to Recepient address.\\n /// @param _value Amount transferred.\\n /// @return Whether transfer succeeded or not.\\n function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _value) internal returns (bool) {\\n (bool success, bytes memory data) = address(_token).call(\\n abi.encodeCall(IERC20.transferFrom, (_from, _to, _value))\\n );\\n return (success && (data.length == 0 || abi.decode(data, (bool))));\\n }\\n}\",\"keccak256\":\"0x60df38c872cae58f18d4b706251445e13542a5d9d94b9db71de02bfcaf7575ee\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b506040516200349b3803806200349b833981016040819052620000349162000233565b60008054336001600160a01b031991821617909155600180549091166001600160a01b03891617905560026200006b878262000393565b50600380546001600160a01b0319166001600160a01b038516908117909155600583905560068290556040516312a6505d60e21b8152634a99417490620000b990889088906004016200048d565b6020604051808303816000875af1158015620000d9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000ff9190620004cd565b6004556040517ff0d0a0b363c32316c3e6e7e797bbc126af09c634db439ed65a3f96afe7ae2367906200013890849084908a90620004e7565b60405180910390a15050505050505062000508565b6001600160a01b03811681146200016357600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620001995781810151838201526020016200017f565b50506000910152565b600082601f830112620001b457600080fd5b81516001600160401b0380821115620001d157620001d162000166565b604051601f8301601f19908116603f01168101908282118183101715620001fc57620001fc62000166565b816040528381528660208588010111156200021657600080fd5b620002298460208301602089016200017c565b9695505050505050565b600080600080600080600060e0888a0312156200024f57600080fd5b87516200025c816200014d565b60208901519097506001600160401b03808211156200027a57600080fd5b620002888b838c01620001a2565b975060408a01519150808211156200029f57600080fd5b620002ad8b838c01620001a2565b965060608a0151915080821115620002c457600080fd5b50620002d38a828b01620001a2565b9450506080880151620002e6816200014d565b8093505060a0880151915060c0880151905092959891949750929550565b600181811c908216806200031957607f821691505b6020821081036200033a57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200038e57600081815260208120601f850160051c81016020861015620003695750805b601f850160051c820191505b818110156200038a5782815560010162000375565b5050505b505050565b81516001600160401b03811115620003af57620003af62000166565b620003c781620003c0845462000304565b8462000340565b602080601f831160018114620003ff5760008415620003e65750858301515b600019600386901b1c1916600185901b1785556200038a565b600085815260208120601f198616915b8281101562000430578886015182559484019460019091019084016200040f565b50858210156200044f5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008151808452620004798160208601602086016200017c565b601f01601f19169290920160200192915050565b6060815260006060820152608060208201526000620004b060808301856200045f565b8281036040840152620004c481856200045f565b95945050505050565b600060208284031215620004e057600080fd5b5051919050565b838152826020820152606060408201526000620004c460608301846200045f565b612f8380620005186000396000f3fe60806040526004361061018d5760003560e01c806393ee2678116100d7578063cb44c3fa11610085578063cb44c3fa1461044d578063e4c0aaf41461046d578063e77d0bd31461048d578063e98c579b146104ad578063ee22610b146104cd578063ef48eee6146104ed578063fc548f081461050d578063fe43a9921461052d57600080fd5b806393ee26781461035d5780639ace38c21461037d578063a0af81f0146103b7578063aba36169146103d7578063b2b96792146103f7578063b329036b14610417578063c5d552881461042d57600080fd5b80632fbe3b031161013f5780632fbe3b0314610271578063311a6c561461029e57806334e2672d146102be5780633bf54724146102de578063441080fe146102f15780634660ebbe146103075780636cc6cde1146103275780637aa77f291461034757600080fd5b80630c340a24146101925780630c7ac7b6146101cf5780631bd1823a146101f15780632ae0085e146102135780632be6d005146102345780632e0b6422146102475780632e7700f01461025c575b600080fd5b34801561019e57600080fd5b506000546101b2906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101db57600080fd5b506101e461054d565b6040516101c69190612615565b3480156101fd57600080fd5b5061021161020c36600461262f565b6105db565b005b610226610221366004612702565b6106d2565b6040519081526020016101c6565b61021161024236600461262f565b610879565b34801561025357600080fd5b50610226600281565b34801561026857600080fd5b50600754610226565b34801561027d57600080fd5b5061022661028c36600461262f565b60086020526000908152604090205481565b3480156102aa57600080fd5b506102116102b93660046127a8565b610ac7565b3480156102ca57600080fd5b506102116102d93660046127ca565b610bd7565b6102116102ec36600461262f565b610c43565b3480156102fd57600080fd5b5061022660065481565b34801561031357600080fd5b5061021161032236600461283b565b610e78565b34801561033357600080fd5b506001546101b2906001600160a01b031681565b34801561035357600080fd5b5061022660045481565b34801561036957600080fd5b5061021161037836600461262f565b610ec5565b34801561038957600080fd5b5061039d61039836600461262f565b6110fc565b6040516101c69e9d9c9b9a99989796959493929190612882565b3480156103c357600080fd5b506003546101b2906001600160a01b031681565b3480156103e357600080fd5b506102266103f2366004612928565b6112a7565b34801561040357600080fd5b506102116104123660046127a8565b611495565b34801561042357600080fd5b5061022660055481565b34801561043957600080fd5b506102116104483660046129ea565b611704565b34801561045957600080fd5b5061021161046836600461262f565b6117ab565b34801561047957600080fd5b5061021161048836600461283b565b61180b565b34801561049957600080fd5b506102116104a836600461262f565b611858565b3480156104b957600080fd5b506102116104c836600461262f565b611938565b3480156104d957600080fd5b506102116104e836600461262f565b61198c565b3480156104f957600080fd5b506102116105083660046127a8565b611abb565b34801561051957600080fd5b5061021161052836600461283b565b611c4e565b34801561053957600080fd5b506102116105483660046127a8565b611c9b565b6002805461055a90612a4d565b80601f016020809104026020016040519081016040528092919081815260200182805461058690612a4d565b80156105d35780601f106105a8576101008083540402835291602001916105d3565b820191906000526020600020905b8154815290600101906020018083116105b657829003601f168201915b505050505081565b6000600782815481106105f0576105f0612a87565b60009182526020909120600d9091020190506003600c82015460ff16600681111561061d5761061d612858565b1461063b57604051635ed7670b60e11b815260040160405180910390fd5b600554600982015461064d9042612ab3565b101561066c57604051634799187b60e01b815260040160405180910390fd5b6007810180546000909155610682836002611dd0565b80156106b15781546040516001600160a01b039091169082156108fc029083906000818181858888f150505050505b60025b6040518490600080516020612f0e83398151915290600090a3505050565b600780546001810182556000918252600d027fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688810180546001600160a01b0319908116331782557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c689830180546001600160a01b0389169216919091179055347fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a8301557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c69482018054610100600160a81b03191690557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68d8201889055907fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c692016107fa8582612b2f565b50600b81016108098482612b2f565b5060075461081990600190612ab3565b9150846001600160a01b0316336001600160a01b0316837f0a7ca50c43ec865fdc8519822762f88432e18409024b9c036d6507b9c8f79d808934866005015460405161086793929190612be8565b60405180910390a45095945050505050565b60006007828154811061088e5761088e612a87565b60009182526020909120600d9091020190506001600c82015460ff1660068111156108bb576108bb612858565b141580156108e257506002600c82015460ff1660068111156108df576108df612858565b14155b801561090757506003600c82015460ff16600681111561090457610904612858565b14155b156109255760405163376af24960e21b815260040160405180910390fd5b6002600c82015460ff16600681111561094057610940612858565b14801561095c5750600654600982015461095a9042612ab3565b105b1561097a57604051630627cd6b60e01b815260040160405180910390fd5b80546001600160a01b031633146109a45760405163e2bc376b60e01b815260040160405180910390fd5b348160070160008282546109b89190612c0d565b909155505060015460405163f7434ea960e01b81526000916001600160a01b03169063f7434ea9906109ef90600290600401612c9d565b602060405180830381865afa158015610a0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a309190612cb0565b90508082600701541015610a5757604051631a48f3db60e11b815260040160405180910390fd5b4260098301556008820154811115610ab857600c8201805460ff1916600417905560405183907fc74b9f7dedf2887cd3c113b6d8da9cea19e55c1116e25f1f0e1b72d7543179b590610aab90600290612cd9565b60405180910390a2505050565b610ac2838261224f565b505050565b6001546001600160a01b03163314610af257604051630955f84760e31b815260040160405180910390fd5b6002811115610b14576040516309efd47960e41b815260040160405180910390fd5b6000828152600860205260408120546007805491929183908110610b3a57610b3a612a87565b60009182526020909120600d9091020190506005600c82015460ff166006811115610b6757610b67612858565b14610b855760405163f10068b560e01b815260040160405180910390fd5b60015460405184815285916001600160a01b0316907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a3610bd18284611dd0565b50505050565b6000546001600160a01b03163314610c025760405163c383977560e01b815260040160405180910390fd5b6002610c0f828483612ce7565b50600080516020612f2e8339815191526005546006548484604051610c379493929190612da1565b60405180910390a15050565b600060078281548110610c5857610c58612a87565b60009182526020909120600d9091020190506001600c82015460ff166006811115610c8557610c85612858565b14158015610cac57506002600c82015460ff166006811115610ca957610ca9612858565b14155b8015610cd157506004600c82015460ff166006811115610cce57610cce612858565b14155b15610cef5760405163365105ef60e11b815260040160405180910390fd5b6001600c82015460ff166006811115610d0a57610d0a612858565b148015610d2657506006546009820154610d249042612ab3565b105b15610d4457604051630627cd6b60e01b815260040160405180910390fd5b60018101546001600160a01b03163314610d7157604051635800797f60e11b815260040160405180910390fd5b34816008016000828254610d859190612c0d565b909155505060015460405163f7434ea960e01b81526000916001600160a01b03169063f7434ea990610dbc90600290600401612c9d565b602060405180830381865afa158015610dd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfd9190612cb0565b90508082600801541015610e245760405163818d938f60e01b815260040160405180910390fd5b4260098301556007820154811115610ab857600c8201805460ff1916600317905560405183907fc74b9f7dedf2887cd3c113b6d8da9cea19e55c1116e25f1f0e1b72d7543179b590610aab90600190612cd9565b6000546001600160a01b03163314610ea35760405163c383977560e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600060078281548110610eda57610eda612a87565b600091825260208220600d9091020191506001600c83015460ff166006811115610f0657610f06612858565b03610f405781546001600160a01b03163314610f355760405163e2bc376b60e01b815260040160405180910390fd5b506004810154610fb1565b6002600c83015460ff166006811115610f5b57610f5b612858565b03610f985760018201546001600160a01b03163314610f8d57604051635800797f60e11b815260040160405180910390fd5b506003810154610fb1565b604051630a7b6ec160e01b815260040160405180910390fd5b6000818360020154610fc39190612ab3565b600060028501819055600385018190556004850155600c8401805460ff1916600617908190559091506001600160a01b03610100909104166110585782546040516001600160a01b039091169082156108fc029083906000818181858888f150505060018501546040516001600160a01b03909116925084156108fc02915084906000818181858888f19350505050506110db565b8254600c84015461107b916001600160a01b036101009092048216911683612416565b6110985760405163022e258160e11b815260040160405180910390fd5b6001830154600c8401546110be916001600160a01b036101009092048216911684612416565b6110db5760405163022e258160e11b815260040160405180910390fd5b60046040518590600080516020612f0e83398151915290600090a350505050565b6007818154811061110c57600080fd5b60009182526020909120600d9091020180546001820154600283015460038401546004850154600586015460068701546007880154600889015460098a0154600a8b0180546001600160a01b039b8c169d5099909a169a9799969895979496939592949193909261117c90612a4d565b80601f01602080910402602001604051908101604052809291908181526020018280546111a890612a4d565b80156111f55780601f106111ca576101008083540402835291602001916111f5565b820191906000526020600020905b8154815290600101906020018083116111d857829003601f168201915b50505050509080600b01805461120a90612a4d565b80601f016020809104026020016040519081016040528092919081815260200182805461123690612a4d565b80156112835780601f1061125857610100808354040283529160200191611283565b820191906000526020600020905b81548152906001019060200180831161126657829003601f168201915b505050600c909301549192505060ff8116906001600160a01b03610100909104168e565b60006112be6001600160a01b03881633308b6124e9565b6112db5760405163022e258160e11b815260040160405180910390fd5b60078054600181018255600091909152600d027fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688810180546001600160a01b0319908116331782557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c689830180546001600160a01b03898116919093161790557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a83018b90557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c69483018054918b1661010002610100600160a81b03199092169190911790557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68d8201889055907fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c692016114128582612b2f565b50600b81016114218482612b2f565b5060075461143190600190612ab3565b9150846001600160a01b0316336001600160a01b0316837fb96ca2c0c34e2ad6384277748b8101f4bddc3cbeaad7086e59cd315bd19aa8c5898c8e87600501546040516114819493929190612dde565b60405180910390a450979650505050505050565b6000600783815481106114aa576114aa612a87565b600091825260208220600d909102019150600c82015460ff1660068111156114d4576114d4612858565b1480156114e5575080600501544210155b15611503576040516338e5e54b60e21b815260040160405180910390fd5b6003600c82015460ff16600681111561151e5761151e612858565b1061153c57604051630d71592960e31b815260040160405180910390fd5b8060020154821115611561576040516305aafecf60e01b815260040160405180910390fd5b42600982015560006001600c83015460ff16600681111561158457611584612858565b036115da5781546001600160a01b031633146115b35760405163e2bc376b60e01b815260040160405180910390fd5b60038201839055600c820180546002919060ff19166001835b0217905550600190506116c4565b6002600c83015460ff1660068111156115f5576115f5612858565b0361164d5760018201546001600160a01b0316331461162757604051635800797f60e11b815260040160405180910390fd5b60048201839055600c820180546001919060ff191682805b0217905550600290506116c4565b81546001600160a01b0316330361167b5760038201839055600c820180546002919060ff19166001836115cc565b60018201546001600160a01b031633036116ab5760048201839055600c820180546001919060ff1916828061163f565b60405163351c18ff60e21b815260040160405180910390fd5b837f10c8b22b69e324b0227c6adfa65183c771304c11385423e93ce99779a7483dbf82856040516116f6929190612e16565b60405180910390a250505050565b6000546001600160a01b0316331461172f5760405163c383977560e01b815260040160405180910390fd5b6003546040516312a6505d60e21b81526001600160a01b0390911690634a994174906117619085908590600401612e31565b6020604051808303816000875af1158015611780573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a49190612cb0565b6004555050565b6000546001600160a01b031633146117d65760405163c383977560e01b815260040160405180910390fd5b6005819055600654604051600080516020612f2e8339815191529161180091849190600290612e6d565b60405180910390a150565b6000546001600160a01b031633146118365760405163c383977560e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60006007828154811061186d5761186d612a87565b60009182526020909120600d9091020190506004600c82015460ff16600681111561189a5761189a612858565b146118b857604051638225aba560e01b815260040160405180910390fd5b60055460098201546118ca9042612ab3565b10156118e957604051634799187b60e01b815260040160405180910390fd5b60088101805460009091556118ff836001611dd0565b80156119315760018201546040516001600160a01b039091169082156108fc029083906000818181858888f150505050505b60016106b4565b6000546001600160a01b031633146119635760405163c383977560e01b815260040160405180910390fd5b6006819055600554604051600080516020612f2e83398151915291611800918490600290612e6d565b6000600782815481106119a1576119a1612a87565b90600052602060002090600d0201905080600501544210156119d6576040516302eb354360e41b815260040160405180910390fd5b6000600c82015460ff1660068111156119f1576119f1612858565b14611a0f57604051634e22597f60e11b815260040160405180910390fd5b6002810180546000909155600c82015461010090046001600160a01b0316611a625760018201546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505050611aa5565b6001820154600c830154611a88916001600160a01b036101009092048216911683612416565b611aa55760405163022e258160e11b815260040160405180910390fd5b600c8201805460ff1916600617905560006106b4565b600060078381548110611ad057611ad0612a87565b60009182526020909120600d9091020180549091506001600160a01b03163314611b0d5760405163e2bc376b60e01b815260040160405180910390fd5b6000600c82015460ff166006811115611b2857611b28612858565b14611b4657604051634e22597f60e11b815260040160405180910390fd5b8060020154821115611b6b576040516305aafecf60e01b815260040160405180910390fd5b81816002016000828254611b7f9190612ab3565b9091555050600c81015461010090046001600160a01b0316611bcc5760018101546040516001600160a01b039091169083156108fc029084906000818181858888f1935050505050611c0f565b6001810154600c820154611bf2916001600160a01b036101009092048216911684612416565b611c0f5760405163022e258160e11b815260040160405180910390fd5b6040805183815233602082015284917fd1432ca9a38d944f01b256a411861b109bc4bfe200c40d7144e919a16b86a8a8910160405180910390a2505050565b6000546001600160a01b03163314611c795760405163c383977560e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600060078381548110611cb057611cb0612a87565b600091825260209091206001600d90920201908101549091506001600160a01b03163314611cf157604051635800797f60e11b815260040160405180910390fd5b6000600c82015460ff166006811115611d0c57611d0c612858565b14611d2a57604051634e22597f60e11b815260040160405180910390fd5b8060020154821115611d4f576040516305aafecf60e01b815260040160405180910390fd5b81816002016000828254611d639190612ab3565b9091555050600c81015461010090046001600160a01b0316611dad5780546040516001600160a01b039091169083156108fc029084906000818181858888f1935050505050611c0f565b8054600c820154611bf2916001600160a01b036101009092048216911684612416565b600060078381548110611de557611de5612a87565b600091825260208220600d9190910201600281018054600383018054600485018054600787018054600889018054600c8b0180549a8d9055978c9055948b9055918a905598905560ff1986166006179093559496509194919390926001600160a01b0361010090910416156000198801611fc95786546040516001600160a01b039091169084156108fc029085906000818181858888f193505050505084600014611f50578015611ef05786546001600160a01b03166108fc611ea88789612ab3565b6040518115909202916000818181858888f150505060018901546040516001600160a01b03909116925087156108fc02915087906000818181858888f1935050505050612229565b8654611f23906001600160a01b0316611f098789612ab3565b600c8a015461010090046001600160a01b03169190612416565b506001870154600c880154611f4a916001600160a01b036101009092048216911687612416565b50612229565b8015611f845786546040516001600160a01b039091169087156108fc029088906000818181858888f1935050505050612229565b8654600c880154611fa7916001600160a01b036101009092048216911688612416565b611fc45760405163022e258160e11b815260040160405180910390fd5b612229565b600288036121085760018701546040516001600160a01b039091169083156108fc029084906000818181858888f1935050505050836000146120ab57801561206b5786546001600160a01b03166108fc6120238689612ab3565b6040518115909202916000818181858888f150505060018901546040516001600160a01b03909116925086156108fc02915086906000818181858888f1935050505050612229565b8654612084906001600160a01b0316611f098689612ab3565b506001870154600c880154611f4a916001600160a01b036101009092048216911686612416565b80156120e25760018701546040516001600160a01b039091169087156108fc029088906000818181858888f1935050505050612229565b6001870154600c880154611fa7916001600160a01b036101009092048216911688612416565b6000612115600285612e8c565b88546040519192506001600160a01b03169082156108fc029083906000818181858888f150505060018a01546040516001600160a01b03909116925083156108fc02915083906000818181858888f193505050505060006002886121799190612e8c565b905082156121da5788546040516001600160a01b039091169082156108fc029083906000818181858888f150505060018b01546040516001600160a01b03909116925083156108fc02915083906000818181858888f1935050505050612226565b8854600c8a01546121fd916001600160a01b036101009092048216911683612416565b506001890154600c8a0154612224916001600160a01b036101009092048216911683612416565b505b50505b60036040518a90600080516020612f0e83398151915290600090a3505050505050505050565b60006007838154811061226457612264612a87565b60009182526020909120600c600d90920201908101805460ff1916600517905560015460405163c13517e160e01b81529192506001600160a01b03169063c13517e19084906122ba906002908190600401612eae565b60206040518083038185885af11580156122d8573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906122fd9190612cb0565b60068201818155600091825260086020908152604080842087905591546001546004548451898152938401526060838501819052830194909452915191926001600160a01b0316917f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e271869181900360800190a381816007015411156123bf57600082826007015461238d9190612ab3565b6007830184905582546040519192506001600160a01b03169082156108fc029083906000818181858888f15050505050505b8181600801541115610ac25760008282600801546123dd9190612ab3565b6008830184905560018301546040519192506001600160a01b03169082156108fc029083906000818181858888f1505050505050505050565b6040516001600160a01b03838116602483015260448201839052600091829182919087169060640160408051601f198184030181529181526020820180516001600160e01b031663a9059cbb60e01b179052516124739190612ecf565b6000604051808303816000865af19150503d80600081146124b0576040519150601f19603f3d011682016040523d82523d6000602084013e6124b5565b606091505b50915091508180156124df5750805115806124df5750808060200190518101906124df9190612eeb565b9695505050505050565b6040516001600160a01b038481166024830152838116604483015260648201839052600091829182919088169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b1790525161254e9190612ecf565b6000604051808303816000865af19150503d806000811461258b576040519150601f19603f3d011682016040523d82523d6000602084013e612590565b606091505b50915091508180156125ba5750805115806125ba5750808060200190518101906125ba9190612eeb565b979650505050505050565b60005b838110156125e05781810151838201526020016125c8565b50506000910152565b600081518084526126018160208601602086016125c5565b601f01601f19169290920160200192915050565b60208152600061262860208301846125e9565b9392505050565b60006020828403121561264157600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261266f57600080fd5b81356001600160401b038082111561268957612689612648565b604051601f8301601f19908116603f011681019082821181831017156126b1576126b1612648565b816040528381528660208588010111156126ca57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6001600160a01b03811681146126ff57600080fd5b50565b600080600080600060a0868803121561271a57600080fd5b8535945060208601356001600160401b038082111561273857600080fd5b61274489838a0161265e565b955060408801359150612756826126ea565b9093506060870135908082111561276c57600080fd5b61277889838a0161265e565b9350608088013591508082111561278e57600080fd5b5061279b8882890161265e565b9150509295509295909350565b600080604083850312156127bb57600080fd5b50508035926020909101359150565b600080602083850312156127dd57600080fd5b82356001600160401b03808211156127f457600080fd5b818501915085601f83011261280857600080fd5b81358181111561281757600080fd5b86602082850101111561282957600080fd5b60209290920196919550909350505050565b60006020828403121561284d57600080fd5b8135612628816126ea565b634e487b7160e01b600052602160045260246000fd5b6007811061287e5761287e612858565b9052565b6001600160a01b038f811682528e1660208201528c60408201528b60608201528a60808201528960a08201528860c08201528760e082015286610100820152856101208201526101c061014082015260006128e16101c08301876125e9565b8281036101608401526128f481876125e9565b91505061290561018083018561286e565b6001600160a01b0383166101a08301529f9e505050505050505050505050505050565b600080600080600080600060e0888a03121561294357600080fd5b873596506020880135612955816126ea565b95506040880135945060608801356001600160401b038082111561297857600080fd5b6129848b838c0161265e565b955060808a01359150612996826126ea565b90935060a089013590808211156129ac57600080fd5b6129b88b838c0161265e565b935060c08a01359150808211156129ce57600080fd5b506129db8a828b0161265e565b91505092959891949750929550565b600080604083850312156129fd57600080fd5b82356001600160401b0380821115612a1457600080fd5b612a208683870161265e565b93506020850135915080821115612a3657600080fd5b50612a438582860161265e565b9150509250929050565b600181811c90821680612a6157607f821691505b602082108103612a8157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115612ac657612ac6612a9d565b92915050565b601f821115610ac257600081815260208120601f850160051c81016020861015612af35750805b601f850160051c820191505b81811015612b1257828155600101612aff565b505050505050565b600019600383901b1c191660019190911b1790565b81516001600160401b03811115612b4857612b48612648565b612b5c81612b568454612a4d565b84612acc565b602080601f831160018114612b8b5760008415612b795750858301515b612b838582612b1a565b865550612b12565b600085815260208120601f198616915b82811015612bba57888601518255948401946001909101908401612b9b565b5085821015612bd85787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b606081526000612bfb60608301866125e9565b60208301949094525060400152919050565b80820180821115612ac657612ac6612a9d565b60008154612c2d81612a4d565b808552602060018381168015612c4a5760018114612c6457612c92565b60ff1985168884015283151560051b880183019550612c92565b866000528260002060005b85811015612c8a5781548a8201860152908301908401612c6f565b890184019650505b505050505092915050565b6020815260006126286020830184612c20565b600060208284031215612cc257600080fd5b5051919050565b6003811061287e5761287e612858565b60208101612ac68284612cc9565b6001600160401b03831115612cfe57612cfe612648565b612d1283612d0c8354612a4d565b83612acc565b6000601f841160018114612d405760008515612d2e5750838201355b612d388682612b1a565b845550612d9a565b600083815260209020601f19861690835b82811015612d715786850135825560209485019460019092019101612d51565b5086821015612d8e5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b84815283602082015260606040820152816060820152818360808301376000818301608090810191909152601f909201601f191601019392505050565b608081526000612df160808301876125e9565b6001600160a01b03959095166020830152506040810192909252606090910152919050565b60408101612e248285612cc9565b8260208301529392505050565b6060815260006060820152608060208201526000612e5260808301856125e9565b8281036040840152612e6481856125e9565b95945050505050565b838152826020820152606060408201526000612e646060830184612c20565b600082612ea957634e487b7160e01b600052601260045260246000fd5b500490565b828152604060208201526000612ec76040830184612c20565b949350505050565b60008251612ee18184602087016125c5565b9190910192915050565b600060208284031215612efd57600080fd5b8151801515811461262857600080fdfe89e6168584e1de3ec704ff46376271b5481b0d9b2b0ef0ae102f0d001093e000f0d0a0b363c32316c3e6e7e797bbc126af09c634db439ed65a3f96afe7ae2367a264697066735822122013e12ca3460b4f50b0fd1ad4da49e37a137cf9b48564f2d712e241bf1b1ffca464736f6c63430008120033", + "deployedBytecode": "0x60806040526004361061018d5760003560e01c806393ee2678116100d7578063cb44c3fa11610085578063cb44c3fa1461044d578063e4c0aaf41461046d578063e77d0bd31461048d578063e98c579b146104ad578063ee22610b146104cd578063ef48eee6146104ed578063fc548f081461050d578063fe43a9921461052d57600080fd5b806393ee26781461035d5780639ace38c21461037d578063a0af81f0146103b7578063aba36169146103d7578063b2b96792146103f7578063b329036b14610417578063c5d552881461042d57600080fd5b80632fbe3b031161013f5780632fbe3b0314610271578063311a6c561461029e57806334e2672d146102be5780633bf54724146102de578063441080fe146102f15780634660ebbe146103075780636cc6cde1146103275780637aa77f291461034757600080fd5b80630c340a24146101925780630c7ac7b6146101cf5780631bd1823a146101f15780632ae0085e146102135780632be6d005146102345780632e0b6422146102475780632e7700f01461025c575b600080fd5b34801561019e57600080fd5b506000546101b2906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101db57600080fd5b506101e461054d565b6040516101c69190612615565b3480156101fd57600080fd5b5061021161020c36600461262f565b6105db565b005b610226610221366004612702565b6106d2565b6040519081526020016101c6565b61021161024236600461262f565b610879565b34801561025357600080fd5b50610226600281565b34801561026857600080fd5b50600754610226565b34801561027d57600080fd5b5061022661028c36600461262f565b60086020526000908152604090205481565b3480156102aa57600080fd5b506102116102b93660046127a8565b610ac7565b3480156102ca57600080fd5b506102116102d93660046127ca565b610bd7565b6102116102ec36600461262f565b610c43565b3480156102fd57600080fd5b5061022660065481565b34801561031357600080fd5b5061021161032236600461283b565b610e78565b34801561033357600080fd5b506001546101b2906001600160a01b031681565b34801561035357600080fd5b5061022660045481565b34801561036957600080fd5b5061021161037836600461262f565b610ec5565b34801561038957600080fd5b5061039d61039836600461262f565b6110fc565b6040516101c69e9d9c9b9a99989796959493929190612882565b3480156103c357600080fd5b506003546101b2906001600160a01b031681565b3480156103e357600080fd5b506102266103f2366004612928565b6112a7565b34801561040357600080fd5b506102116104123660046127a8565b611495565b34801561042357600080fd5b5061022660055481565b34801561043957600080fd5b506102116104483660046129ea565b611704565b34801561045957600080fd5b5061021161046836600461262f565b6117ab565b34801561047957600080fd5b5061021161048836600461283b565b61180b565b34801561049957600080fd5b506102116104a836600461262f565b611858565b3480156104b957600080fd5b506102116104c836600461262f565b611938565b3480156104d957600080fd5b506102116104e836600461262f565b61198c565b3480156104f957600080fd5b506102116105083660046127a8565b611abb565b34801561051957600080fd5b5061021161052836600461283b565b611c4e565b34801561053957600080fd5b506102116105483660046127a8565b611c9b565b6002805461055a90612a4d565b80601f016020809104026020016040519081016040528092919081815260200182805461058690612a4d565b80156105d35780601f106105a8576101008083540402835291602001916105d3565b820191906000526020600020905b8154815290600101906020018083116105b657829003601f168201915b505050505081565b6000600782815481106105f0576105f0612a87565b60009182526020909120600d9091020190506003600c82015460ff16600681111561061d5761061d612858565b1461063b57604051635ed7670b60e11b815260040160405180910390fd5b600554600982015461064d9042612ab3565b101561066c57604051634799187b60e01b815260040160405180910390fd5b6007810180546000909155610682836002611dd0565b80156106b15781546040516001600160a01b039091169082156108fc029083906000818181858888f150505050505b60025b6040518490600080516020612f0e83398151915290600090a3505050565b600780546001810182556000918252600d027fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688810180546001600160a01b0319908116331782557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c689830180546001600160a01b0389169216919091179055347fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a8301557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c69482018054610100600160a81b03191690557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68d8201889055907fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c692016107fa8582612b2f565b50600b81016108098482612b2f565b5060075461081990600190612ab3565b9150846001600160a01b0316336001600160a01b0316837f0a7ca50c43ec865fdc8519822762f88432e18409024b9c036d6507b9c8f79d808934866005015460405161086793929190612be8565b60405180910390a45095945050505050565b60006007828154811061088e5761088e612a87565b60009182526020909120600d9091020190506001600c82015460ff1660068111156108bb576108bb612858565b141580156108e257506002600c82015460ff1660068111156108df576108df612858565b14155b801561090757506003600c82015460ff16600681111561090457610904612858565b14155b156109255760405163376af24960e21b815260040160405180910390fd5b6002600c82015460ff16600681111561094057610940612858565b14801561095c5750600654600982015461095a9042612ab3565b105b1561097a57604051630627cd6b60e01b815260040160405180910390fd5b80546001600160a01b031633146109a45760405163e2bc376b60e01b815260040160405180910390fd5b348160070160008282546109b89190612c0d565b909155505060015460405163f7434ea960e01b81526000916001600160a01b03169063f7434ea9906109ef90600290600401612c9d565b602060405180830381865afa158015610a0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a309190612cb0565b90508082600701541015610a5757604051631a48f3db60e11b815260040160405180910390fd5b4260098301556008820154811115610ab857600c8201805460ff1916600417905560405183907fc74b9f7dedf2887cd3c113b6d8da9cea19e55c1116e25f1f0e1b72d7543179b590610aab90600290612cd9565b60405180910390a2505050565b610ac2838261224f565b505050565b6001546001600160a01b03163314610af257604051630955f84760e31b815260040160405180910390fd5b6002811115610b14576040516309efd47960e41b815260040160405180910390fd5b6000828152600860205260408120546007805491929183908110610b3a57610b3a612a87565b60009182526020909120600d9091020190506005600c82015460ff166006811115610b6757610b67612858565b14610b855760405163f10068b560e01b815260040160405180910390fd5b60015460405184815285916001600160a01b0316907f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769060200160405180910390a3610bd18284611dd0565b50505050565b6000546001600160a01b03163314610c025760405163c383977560e01b815260040160405180910390fd5b6002610c0f828483612ce7565b50600080516020612f2e8339815191526005546006548484604051610c379493929190612da1565b60405180910390a15050565b600060078281548110610c5857610c58612a87565b60009182526020909120600d9091020190506001600c82015460ff166006811115610c8557610c85612858565b14158015610cac57506002600c82015460ff166006811115610ca957610ca9612858565b14155b8015610cd157506004600c82015460ff166006811115610cce57610cce612858565b14155b15610cef5760405163365105ef60e11b815260040160405180910390fd5b6001600c82015460ff166006811115610d0a57610d0a612858565b148015610d2657506006546009820154610d249042612ab3565b105b15610d4457604051630627cd6b60e01b815260040160405180910390fd5b60018101546001600160a01b03163314610d7157604051635800797f60e11b815260040160405180910390fd5b34816008016000828254610d859190612c0d565b909155505060015460405163f7434ea960e01b81526000916001600160a01b03169063f7434ea990610dbc90600290600401612c9d565b602060405180830381865afa158015610dd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfd9190612cb0565b90508082600801541015610e245760405163818d938f60e01b815260040160405180910390fd5b4260098301556007820154811115610ab857600c8201805460ff1916600317905560405183907fc74b9f7dedf2887cd3c113b6d8da9cea19e55c1116e25f1f0e1b72d7543179b590610aab90600190612cd9565b6000546001600160a01b03163314610ea35760405163c383977560e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600060078281548110610eda57610eda612a87565b600091825260208220600d9091020191506001600c83015460ff166006811115610f0657610f06612858565b03610f405781546001600160a01b03163314610f355760405163e2bc376b60e01b815260040160405180910390fd5b506004810154610fb1565b6002600c83015460ff166006811115610f5b57610f5b612858565b03610f985760018201546001600160a01b03163314610f8d57604051635800797f60e11b815260040160405180910390fd5b506003810154610fb1565b604051630a7b6ec160e01b815260040160405180910390fd5b6000818360020154610fc39190612ab3565b600060028501819055600385018190556004850155600c8401805460ff1916600617908190559091506001600160a01b03610100909104166110585782546040516001600160a01b039091169082156108fc029083906000818181858888f150505060018501546040516001600160a01b03909116925084156108fc02915084906000818181858888f19350505050506110db565b8254600c84015461107b916001600160a01b036101009092048216911683612416565b6110985760405163022e258160e11b815260040160405180910390fd5b6001830154600c8401546110be916001600160a01b036101009092048216911684612416565b6110db5760405163022e258160e11b815260040160405180910390fd5b60046040518590600080516020612f0e83398151915290600090a350505050565b6007818154811061110c57600080fd5b60009182526020909120600d9091020180546001820154600283015460038401546004850154600586015460068701546007880154600889015460098a0154600a8b0180546001600160a01b039b8c169d5099909a169a9799969895979496939592949193909261117c90612a4d565b80601f01602080910402602001604051908101604052809291908181526020018280546111a890612a4d565b80156111f55780601f106111ca576101008083540402835291602001916111f5565b820191906000526020600020905b8154815290600101906020018083116111d857829003601f168201915b50505050509080600b01805461120a90612a4d565b80601f016020809104026020016040519081016040528092919081815260200182805461123690612a4d565b80156112835780601f1061125857610100808354040283529160200191611283565b820191906000526020600020905b81548152906001019060200180831161126657829003601f168201915b505050600c909301549192505060ff8116906001600160a01b03610100909104168e565b60006112be6001600160a01b03881633308b6124e9565b6112db5760405163022e258160e11b815260040160405180910390fd5b60078054600181018255600091909152600d027fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688810180546001600160a01b0319908116331782557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c689830180546001600160a01b03898116919093161790557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a83018b90557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c69483018054918b1661010002610100600160a81b03199092169190911790557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68d8201889055907fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c692016114128582612b2f565b50600b81016114218482612b2f565b5060075461143190600190612ab3565b9150846001600160a01b0316336001600160a01b0316837fb96ca2c0c34e2ad6384277748b8101f4bddc3cbeaad7086e59cd315bd19aa8c5898c8e87600501546040516114819493929190612dde565b60405180910390a450979650505050505050565b6000600783815481106114aa576114aa612a87565b600091825260208220600d909102019150600c82015460ff1660068111156114d4576114d4612858565b1480156114e5575080600501544210155b15611503576040516338e5e54b60e21b815260040160405180910390fd5b6003600c82015460ff16600681111561151e5761151e612858565b1061153c57604051630d71592960e31b815260040160405180910390fd5b8060020154821115611561576040516305aafecf60e01b815260040160405180910390fd5b42600982015560006001600c83015460ff16600681111561158457611584612858565b036115da5781546001600160a01b031633146115b35760405163e2bc376b60e01b815260040160405180910390fd5b60038201839055600c820180546002919060ff19166001835b0217905550600190506116c4565b6002600c83015460ff1660068111156115f5576115f5612858565b0361164d5760018201546001600160a01b0316331461162757604051635800797f60e11b815260040160405180910390fd5b60048201839055600c820180546001919060ff191682805b0217905550600290506116c4565b81546001600160a01b0316330361167b5760038201839055600c820180546002919060ff19166001836115cc565b60018201546001600160a01b031633036116ab5760048201839055600c820180546001919060ff1916828061163f565b60405163351c18ff60e21b815260040160405180910390fd5b837f10c8b22b69e324b0227c6adfa65183c771304c11385423e93ce99779a7483dbf82856040516116f6929190612e16565b60405180910390a250505050565b6000546001600160a01b0316331461172f5760405163c383977560e01b815260040160405180910390fd5b6003546040516312a6505d60e21b81526001600160a01b0390911690634a994174906117619085908590600401612e31565b6020604051808303816000875af1158015611780573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a49190612cb0565b6004555050565b6000546001600160a01b031633146117d65760405163c383977560e01b815260040160405180910390fd5b6005819055600654604051600080516020612f2e8339815191529161180091849190600290612e6d565b60405180910390a150565b6000546001600160a01b031633146118365760405163c383977560e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60006007828154811061186d5761186d612a87565b60009182526020909120600d9091020190506004600c82015460ff16600681111561189a5761189a612858565b146118b857604051638225aba560e01b815260040160405180910390fd5b60055460098201546118ca9042612ab3565b10156118e957604051634799187b60e01b815260040160405180910390fd5b60088101805460009091556118ff836001611dd0565b80156119315760018201546040516001600160a01b039091169082156108fc029083906000818181858888f150505050505b60016106b4565b6000546001600160a01b031633146119635760405163c383977560e01b815260040160405180910390fd5b6006819055600554604051600080516020612f2e83398151915291611800918490600290612e6d565b6000600782815481106119a1576119a1612a87565b90600052602060002090600d0201905080600501544210156119d6576040516302eb354360e41b815260040160405180910390fd5b6000600c82015460ff1660068111156119f1576119f1612858565b14611a0f57604051634e22597f60e11b815260040160405180910390fd5b6002810180546000909155600c82015461010090046001600160a01b0316611a625760018201546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505050611aa5565b6001820154600c830154611a88916001600160a01b036101009092048216911683612416565b611aa55760405163022e258160e11b815260040160405180910390fd5b600c8201805460ff1916600617905560006106b4565b600060078381548110611ad057611ad0612a87565b60009182526020909120600d9091020180549091506001600160a01b03163314611b0d5760405163e2bc376b60e01b815260040160405180910390fd5b6000600c82015460ff166006811115611b2857611b28612858565b14611b4657604051634e22597f60e11b815260040160405180910390fd5b8060020154821115611b6b576040516305aafecf60e01b815260040160405180910390fd5b81816002016000828254611b7f9190612ab3565b9091555050600c81015461010090046001600160a01b0316611bcc5760018101546040516001600160a01b039091169083156108fc029084906000818181858888f1935050505050611c0f565b6001810154600c820154611bf2916001600160a01b036101009092048216911684612416565b611c0f5760405163022e258160e11b815260040160405180910390fd5b6040805183815233602082015284917fd1432ca9a38d944f01b256a411861b109bc4bfe200c40d7144e919a16b86a8a8910160405180910390a2505050565b6000546001600160a01b03163314611c795760405163c383977560e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600060078381548110611cb057611cb0612a87565b600091825260209091206001600d90920201908101549091506001600160a01b03163314611cf157604051635800797f60e11b815260040160405180910390fd5b6000600c82015460ff166006811115611d0c57611d0c612858565b14611d2a57604051634e22597f60e11b815260040160405180910390fd5b8060020154821115611d4f576040516305aafecf60e01b815260040160405180910390fd5b81816002016000828254611d639190612ab3565b9091555050600c81015461010090046001600160a01b0316611dad5780546040516001600160a01b039091169083156108fc029084906000818181858888f1935050505050611c0f565b8054600c820154611bf2916001600160a01b036101009092048216911684612416565b600060078381548110611de557611de5612a87565b600091825260208220600d9190910201600281018054600383018054600485018054600787018054600889018054600c8b0180549a8d9055978c9055948b9055918a905598905560ff1986166006179093559496509194919390926001600160a01b0361010090910416156000198801611fc95786546040516001600160a01b039091169084156108fc029085906000818181858888f193505050505084600014611f50578015611ef05786546001600160a01b03166108fc611ea88789612ab3565b6040518115909202916000818181858888f150505060018901546040516001600160a01b03909116925087156108fc02915087906000818181858888f1935050505050612229565b8654611f23906001600160a01b0316611f098789612ab3565b600c8a015461010090046001600160a01b03169190612416565b506001870154600c880154611f4a916001600160a01b036101009092048216911687612416565b50612229565b8015611f845786546040516001600160a01b039091169087156108fc029088906000818181858888f1935050505050612229565b8654600c880154611fa7916001600160a01b036101009092048216911688612416565b611fc45760405163022e258160e11b815260040160405180910390fd5b612229565b600288036121085760018701546040516001600160a01b039091169083156108fc029084906000818181858888f1935050505050836000146120ab57801561206b5786546001600160a01b03166108fc6120238689612ab3565b6040518115909202916000818181858888f150505060018901546040516001600160a01b03909116925086156108fc02915086906000818181858888f1935050505050612229565b8654612084906001600160a01b0316611f098689612ab3565b506001870154600c880154611f4a916001600160a01b036101009092048216911686612416565b80156120e25760018701546040516001600160a01b039091169087156108fc029088906000818181858888f1935050505050612229565b6001870154600c880154611fa7916001600160a01b036101009092048216911688612416565b6000612115600285612e8c565b88546040519192506001600160a01b03169082156108fc029083906000818181858888f150505060018a01546040516001600160a01b03909116925083156108fc02915083906000818181858888f193505050505060006002886121799190612e8c565b905082156121da5788546040516001600160a01b039091169082156108fc029083906000818181858888f150505060018b01546040516001600160a01b03909116925083156108fc02915083906000818181858888f1935050505050612226565b8854600c8a01546121fd916001600160a01b036101009092048216911683612416565b506001890154600c8a0154612224916001600160a01b036101009092048216911683612416565b505b50505b60036040518a90600080516020612f0e83398151915290600090a3505050505050505050565b60006007838154811061226457612264612a87565b60009182526020909120600c600d90920201908101805460ff1916600517905560015460405163c13517e160e01b81529192506001600160a01b03169063c13517e19084906122ba906002908190600401612eae565b60206040518083038185885af11580156122d8573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906122fd9190612cb0565b60068201818155600091825260086020908152604080842087905591546001546004548451898152938401526060838501819052830194909452915191926001600160a01b0316917f8bd32f430ff060e6bd204709b3790c9807987263d3230c580dc80b5f89e271869181900360800190a381816007015411156123bf57600082826007015461238d9190612ab3565b6007830184905582546040519192506001600160a01b03169082156108fc029083906000818181858888f15050505050505b8181600801541115610ac25760008282600801546123dd9190612ab3565b6008830184905560018301546040519192506001600160a01b03169082156108fc029083906000818181858888f1505050505050505050565b6040516001600160a01b03838116602483015260448201839052600091829182919087169060640160408051601f198184030181529181526020820180516001600160e01b031663a9059cbb60e01b179052516124739190612ecf565b6000604051808303816000865af19150503d80600081146124b0576040519150601f19603f3d011682016040523d82523d6000602084013e6124b5565b606091505b50915091508180156124df5750805115806124df5750808060200190518101906124df9190612eeb565b9695505050505050565b6040516001600160a01b038481166024830152838116604483015260648201839052600091829182919088169060840160408051601f198184030181529181526020820180516001600160e01b03166323b872dd60e01b1790525161254e9190612ecf565b6000604051808303816000865af19150503d806000811461258b576040519150601f19603f3d011682016040523d82523d6000602084013e612590565b606091505b50915091508180156125ba5750805115806125ba5750808060200190518101906125ba9190612eeb565b979650505050505050565b60005b838110156125e05781810151838201526020016125c8565b50506000910152565b600081518084526126018160208601602086016125c5565b601f01601f19169290920160200192915050565b60208152600061262860208301846125e9565b9392505050565b60006020828403121561264157600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261266f57600080fd5b81356001600160401b038082111561268957612689612648565b604051601f8301601f19908116603f011681019082821181831017156126b1576126b1612648565b816040528381528660208588010111156126ca57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6001600160a01b03811681146126ff57600080fd5b50565b600080600080600060a0868803121561271a57600080fd5b8535945060208601356001600160401b038082111561273857600080fd5b61274489838a0161265e565b955060408801359150612756826126ea565b9093506060870135908082111561276c57600080fd5b61277889838a0161265e565b9350608088013591508082111561278e57600080fd5b5061279b8882890161265e565b9150509295509295909350565b600080604083850312156127bb57600080fd5b50508035926020909101359150565b600080602083850312156127dd57600080fd5b82356001600160401b03808211156127f457600080fd5b818501915085601f83011261280857600080fd5b81358181111561281757600080fd5b86602082850101111561282957600080fd5b60209290920196919550909350505050565b60006020828403121561284d57600080fd5b8135612628816126ea565b634e487b7160e01b600052602160045260246000fd5b6007811061287e5761287e612858565b9052565b6001600160a01b038f811682528e1660208201528c60408201528b60608201528a60808201528960a08201528860c08201528760e082015286610100820152856101208201526101c061014082015260006128e16101c08301876125e9565b8281036101608401526128f481876125e9565b91505061290561018083018561286e565b6001600160a01b0383166101a08301529f9e505050505050505050505050505050565b600080600080600080600060e0888a03121561294357600080fd5b873596506020880135612955816126ea565b95506040880135945060608801356001600160401b038082111561297857600080fd5b6129848b838c0161265e565b955060808a01359150612996826126ea565b90935060a089013590808211156129ac57600080fd5b6129b88b838c0161265e565b935060c08a01359150808211156129ce57600080fd5b506129db8a828b0161265e565b91505092959891949750929550565b600080604083850312156129fd57600080fd5b82356001600160401b0380821115612a1457600080fd5b612a208683870161265e565b93506020850135915080821115612a3657600080fd5b50612a438582860161265e565b9150509250929050565b600181811c90821680612a6157607f821691505b602082108103612a8157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115612ac657612ac6612a9d565b92915050565b601f821115610ac257600081815260208120601f850160051c81016020861015612af35750805b601f850160051c820191505b81811015612b1257828155600101612aff565b505050505050565b600019600383901b1c191660019190911b1790565b81516001600160401b03811115612b4857612b48612648565b612b5c81612b568454612a4d565b84612acc565b602080601f831160018114612b8b5760008415612b795750858301515b612b838582612b1a565b865550612b12565b600085815260208120601f198616915b82811015612bba57888601518255948401946001909101908401612b9b565b5085821015612bd85787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b606081526000612bfb60608301866125e9565b60208301949094525060400152919050565b80820180821115612ac657612ac6612a9d565b60008154612c2d81612a4d565b808552602060018381168015612c4a5760018114612c6457612c92565b60ff1985168884015283151560051b880183019550612c92565b866000528260002060005b85811015612c8a5781548a8201860152908301908401612c6f565b890184019650505b505050505092915050565b6020815260006126286020830184612c20565b600060208284031215612cc257600080fd5b5051919050565b6003811061287e5761287e612858565b60208101612ac68284612cc9565b6001600160401b03831115612cfe57612cfe612648565b612d1283612d0c8354612a4d565b83612acc565b6000601f841160018114612d405760008515612d2e5750838201355b612d388682612b1a565b845550612d9a565b600083815260209020601f19861690835b82811015612d715786850135825560209485019460019092019101612d51565b5086821015612d8e5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b84815283602082015260606040820152816060820152818360808301376000818301608090810191909152601f909201601f191601019392505050565b608081526000612df160808301876125e9565b6001600160a01b03959095166020830152506040810192909252606090910152919050565b60408101612e248285612cc9565b8260208301529392505050565b6060815260006060820152608060208201526000612e5260808301856125e9565b8281036040840152612e6481856125e9565b95945050505050565b838152826020820152606060408201526000612e646060830184612c20565b600082612ea957634e487b7160e01b600052601260045260246000fd5b500490565b828152604060208201526000612ec76040830184612c20565b949350505050565b60008251612ee18184602087016125c5565b9190910192915050565b600060208284031215612efd57600080fd5b8151801515811461262857600080fdfe89e6168584e1de3ec704ff46376271b5481b0d9b2b0ef0ae102f0d001093e000f0d0a0b363c32316c3e6e7e797bbc126af09c634db439ed65a3f96afe7ae2367a264697066735822122013e12ca3460b4f50b0fd1ad4da49e37a137cf9b48564f2d712e241bf1b1ffca464736f6c63430008120033", "devdoc": { "details": "Adapted from MultipleArbitrableTokenTransaction contract: https://github.com/kleros/kleros-interaction/blob/master/contracts/standard/arbitration/MultipleArbitrableTokenTransaction.sol and from MultipleArbitrableTransaction contract: https://github.com/kleros/kleros-interaction/blob/master/contracts/standard/arbitration/MultipleArbitrableTransaction.sol Note that the contract expects the tokens to have standard ERC20 behaviour. The tokens that don't conform to this type of behaviour should be filtered by the UI. Tokens should not reenter or allow recipients to refuse the transfer. Also note that arbitration fees are still paid in ETH.", "events": { @@ -1138,10 +1138,10 @@ "details": "Create a transaction.", "params": { "_amount": "The amount of tokens in this transaction.", + "_deadline": "Time after which a party can automatically execute the arbitrable transaction.", "_seller": "The recipient of the transaction.", "_templateData": "The dispute template data.", "_templateDataMappings": "The dispute template data mappings.", - "_timeoutPayment": "Time after which a party can automatically execute the arbitrable transaction.", "_token": "The ERC20 token contract.", "_transactionUri": "The IPFS Uri Hash of the transaction." }, @@ -1152,10 +1152,10 @@ "createNativeTransaction(uint256,string,address,string,string)": { "details": "Create a transaction.", "params": { + "_deadline": "Time after which a party can automatically execute the arbitrable transaction.", "_seller": "The recipient of the transaction.", "_templateData": "The dispute template data.", "_templateDataMappings": "The dispute template data mappings.", - "_timeoutPayment": "Time after which a party can automatically execute the arbitrable transaction.", "_transactionUri": "The IPFS Uri Hash of the transaction." }, "returns": { @@ -1238,7 +1238,7 @@ "storageLayout": { "storage": [ { - "astId": 262, + "astId": 3532, "contract": "src/EscrowUniversal.sol:EscrowUniversal", "label": "governor", "offset": 0, @@ -1246,7 +1246,7 @@ "type": "t_address" }, { - "astId": 265, + "astId": 3535, "contract": "src/EscrowUniversal.sol:EscrowUniversal", "label": "arbitrator", "offset": 0, @@ -1254,7 +1254,7 @@ "type": "t_contract(IArbitratorV2)134" }, { - "astId": 267, + "astId": 3537, "contract": "src/EscrowUniversal.sol:EscrowUniversal", "label": "arbitratorExtraData", "offset": 0, @@ -1262,7 +1262,7 @@ "type": "t_bytes_storage" }, { - "astId": 270, + "astId": 3540, "contract": "src/EscrowUniversal.sol:EscrowUniversal", "label": "templateRegistry", "offset": 0, @@ -1270,7 +1270,7 @@ "type": "t_contract(IDisputeTemplateRegistry)160" }, { - "astId": 272, + "astId": 3542, "contract": "src/EscrowUniversal.sol:EscrowUniversal", "label": "templateId", "offset": 0, @@ -1278,7 +1278,7 @@ "type": "t_uint256" }, { - "astId": 274, + "astId": 3544, "contract": "src/EscrowUniversal.sol:EscrowUniversal", "label": "feeTimeout", "offset": 0, @@ -1286,7 +1286,7 @@ "type": "t_uint256" }, { - "astId": 276, + "astId": 3546, "contract": "src/EscrowUniversal.sol:EscrowUniversal", "label": "settlementTimeout", "offset": 0, @@ -1294,15 +1294,15 @@ "type": "t_uint256" }, { - "astId": 280, + "astId": 3550, "contract": "src/EscrowUniversal.sol:EscrowUniversal", "label": "transactions", "offset": 0, "slot": "7", - "type": "t_array(t_struct(Transaction)2453_storage)dyn_storage" + "type": "t_array(t_struct(Transaction)5717_storage)dyn_storage" }, { - "astId": 284, + "astId": 3554, "contract": "src/EscrowUniversal.sol:EscrowUniversal", "label": "disputeIDtoTransactionID", "offset": 0, @@ -1321,8 +1321,8 @@ "label": "address payable", "numberOfBytes": "20" }, - "t_array(t_struct(Transaction)2453_storage)dyn_storage": { - "base": "t_struct(Transaction)2453_storage", + "t_array(t_struct(Transaction)5717_storage)dyn_storage": { + "base": "t_struct(Transaction)5717_storage", "encoding": "dynamic_array", "label": "struct Transaction[]", "numberOfBytes": "32" @@ -1347,7 +1347,7 @@ "label": "contract IERC20", "numberOfBytes": "20" }, - "t_enum(Status)2416": { + "t_enum(Status)5680": { "encoding": "inplace", "label": "enum Status", "numberOfBytes": "1" @@ -1364,12 +1364,12 @@ "label": "string", "numberOfBytes": "32" }, - "t_struct(Transaction)2453_storage": { + "t_struct(Transaction)5717_storage": { "encoding": "inplace", "label": "struct Transaction", "members": [ { - "astId": 2424, + "astId": 5688, "contract": "src/EscrowUniversal.sol:EscrowUniversal", "label": "buyer", "offset": 0, @@ -1377,7 +1377,7 @@ "type": "t_address_payable" }, { - "astId": 2426, + "astId": 5690, "contract": "src/EscrowUniversal.sol:EscrowUniversal", "label": "seller", "offset": 0, @@ -1385,7 +1385,7 @@ "type": "t_address_payable" }, { - "astId": 2428, + "astId": 5692, "contract": "src/EscrowUniversal.sol:EscrowUniversal", "label": "amount", "offset": 0, @@ -1393,7 +1393,7 @@ "type": "t_uint256" }, { - "astId": 2430, + "astId": 5694, "contract": "src/EscrowUniversal.sol:EscrowUniversal", "label": "settlementBuyer", "offset": 0, @@ -1401,7 +1401,7 @@ "type": "t_uint256" }, { - "astId": 2432, + "astId": 5696, "contract": "src/EscrowUniversal.sol:EscrowUniversal", "label": "settlementSeller", "offset": 0, @@ -1409,7 +1409,7 @@ "type": "t_uint256" }, { - "astId": 2434, + "astId": 5698, "contract": "src/EscrowUniversal.sol:EscrowUniversal", "label": "deadline", "offset": 0, @@ -1417,7 +1417,7 @@ "type": "t_uint256" }, { - "astId": 2436, + "astId": 5700, "contract": "src/EscrowUniversal.sol:EscrowUniversal", "label": "disputeID", "offset": 0, @@ -1425,7 +1425,7 @@ "type": "t_uint256" }, { - "astId": 2438, + "astId": 5702, "contract": "src/EscrowUniversal.sol:EscrowUniversal", "label": "buyerFee", "offset": 0, @@ -1433,7 +1433,7 @@ "type": "t_uint256" }, { - "astId": 2440, + "astId": 5704, "contract": "src/EscrowUniversal.sol:EscrowUniversal", "label": "sellerFee", "offset": 0, @@ -1441,7 +1441,7 @@ "type": "t_uint256" }, { - "astId": 2442, + "astId": 5706, "contract": "src/EscrowUniversal.sol:EscrowUniversal", "label": "lastFeePaymentTime", "offset": 0, @@ -1449,7 +1449,7 @@ "type": "t_uint256" }, { - "astId": 2444, + "astId": 5708, "contract": "src/EscrowUniversal.sol:EscrowUniversal", "label": "templateData", "offset": 0, @@ -1457,7 +1457,7 @@ "type": "t_string_storage" }, { - "astId": 2446, + "astId": 5710, "contract": "src/EscrowUniversal.sol:EscrowUniversal", "label": "templateDataMappings", "offset": 0, @@ -1465,15 +1465,15 @@ "type": "t_string_storage" }, { - "astId": 2449, + "astId": 5713, "contract": "src/EscrowUniversal.sol:EscrowUniversal", "label": "status", "offset": 0, "slot": "12", - "type": "t_enum(Status)2416" + "type": "t_enum(Status)5680" }, { - "astId": 2452, + "astId": 5716, "contract": "src/EscrowUniversal.sol:EscrowUniversal", "label": "token", "offset": 1, diff --git a/contracts/src/Escrow.sol b/contracts/src/Escrow.sol index 000bf03..5068c23 100644 --- a/contracts/src/Escrow.sol +++ b/contracts/src/Escrow.sol @@ -114,7 +114,7 @@ contract Escrow is IEscrow, IArbitrableV2 { /// @inheritdoc IEscrow function createNativeTransaction( - uint256 _timeoutPayment, + uint256 _deadline, string memory _transactionUri, address payable _seller, string memory _templateData, @@ -124,7 +124,7 @@ contract Escrow is IEscrow, IArbitrableV2 { transaction.buyer = payable(msg.sender); transaction.seller = _seller; transaction.amount = msg.value; - transaction.deadline = block.timestamp + _timeoutPayment; + transaction.deadline = _deadline; transaction.templateData = _templateData; transaction.templateDataMappings = _templateDataMappings; diff --git a/contracts/src/EscrowToken.sol b/contracts/src/EscrowToken.sol index a62705f..f113046 100644 --- a/contracts/src/EscrowToken.sol +++ b/contracts/src/EscrowToken.sol @@ -135,7 +135,7 @@ contract EscrowToken is IEscrow, IArbitrableV2 { function createERC20Transaction( uint256 _amount, IERC20 _token, - uint256 _timeoutPayment, + uint256 _deadline, string memory _transactionUri, address payable _seller, string memory _templateData, @@ -149,7 +149,7 @@ contract EscrowToken is IEscrow, IArbitrableV2 { transaction.amount = _amount; transaction.token = _token; // transaction.paymentType = PaymentType.ERC20; - transaction.deadline = block.timestamp + _timeoutPayment; + transaction.deadline = _deadline; transaction.templateData = _templateData; transaction.templateDataMappings = _templateDataMappings; diff --git a/contracts/src/EscrowUniversal.sol b/contracts/src/EscrowUniversal.sol index 1ef1ee4..af110a7 100644 --- a/contracts/src/EscrowUniversal.sol +++ b/contracts/src/EscrowUniversal.sol @@ -123,7 +123,7 @@ contract EscrowUniversal is IEscrow, IArbitrableV2 { /// @inheritdoc IEscrow function createNativeTransaction( - uint256 _timeoutPayment, + uint256 _deadline, string memory _transactionUri, address payable _seller, string memory _templateData, @@ -134,7 +134,7 @@ contract EscrowUniversal is IEscrow, IArbitrableV2 { transaction.seller = _seller; transaction.amount = msg.value; transaction.token = NATIVE; - transaction.deadline = block.timestamp + _timeoutPayment; + transaction.deadline = _deadline; transaction.templateData = _templateData; transaction.templateDataMappings = _templateDataMappings; @@ -154,7 +154,7 @@ contract EscrowUniversal is IEscrow, IArbitrableV2 { function createERC20Transaction( uint256 _amount, IERC20 _token, - uint256 _timeoutPayment, + uint256 _deadline, string memory _transactionUri, address payable _seller, string memory _templateData, @@ -167,7 +167,7 @@ contract EscrowUniversal is IEscrow, IArbitrableV2 { transaction.seller = _seller; transaction.amount = _amount; transaction.token = _token; - transaction.deadline = block.timestamp + _timeoutPayment; + transaction.deadline = _deadline; transaction.templateData = _templateData; transaction.templateDataMappings = _templateDataMappings; diff --git a/contracts/src/interfaces/IEscrow.sol b/contracts/src/interfaces/IEscrow.sol index 10ca30c..0684d52 100644 --- a/contracts/src/interfaces/IEscrow.sol +++ b/contracts/src/interfaces/IEscrow.sol @@ -74,14 +74,14 @@ interface IEscrow { // ************************************* // /// @dev Create a transaction. - /// @param _timeoutPayment Time after which a party can automatically execute the arbitrable transaction. + /// @param _deadline Time after which a party can automatically execute the arbitrable transaction. /// @param _transactionUri The IPFS Uri Hash of the transaction. /// @param _seller The recipient of the transaction. /// @param _templateData The dispute template data. /// @param _templateDataMappings The dispute template data mappings. /// @return transactionID The index of the transaction. function createNativeTransaction( - uint256 _timeoutPayment, + uint256 _deadline, string memory _transactionUri, address payable _seller, string memory _templateData, @@ -91,7 +91,7 @@ interface IEscrow { /// @dev Create a transaction. /// @param _amount The amount of tokens in this transaction. /// @param _token The ERC20 token contract. - /// @param _timeoutPayment Time after which a party can automatically execute the arbitrable transaction. + /// @param _deadline Time after which a party can automatically execute the arbitrable transaction. /// @param _transactionUri The IPFS Uri Hash of the transaction. /// @param _seller The recipient of the transaction. /// @param _templateData The dispute template data. @@ -100,7 +100,7 @@ interface IEscrow { function createERC20Transaction( uint256 _amount, IERC20 _token, - uint256 _timeoutPayment, + uint256 _deadline, string memory _transactionUri, address payable _seller, string memory _templateData, diff --git a/subgraph/package.json b/subgraph/package.json index f438c02..45f2b4b 100644 --- a/subgraph/package.json +++ b/subgraph/package.json @@ -1,6 +1,6 @@ { "name": "@kleros/escrow-v2-subgraph", - "version": "2.0.0", + "version": "2.0.1", "license": "MIT", "scripts": { "update:arbitrum-sepolia-devnet": "./scripts/update.sh arbitrumSepoliaDevnet arbitrum-sepolia", diff --git a/subgraph/subgraph.yaml b/subgraph/subgraph.yaml index 290035c..6bd5232 100644 --- a/subgraph/subgraph.yaml +++ b/subgraph/subgraph.yaml @@ -6,9 +6,9 @@ dataSources: name: EscrowUniversal network: arbitrum-sepolia source: - address: '0x5c4B2Cff2998529f9d405A9b6EbB44BC537c8D7F' + address: '0xBa2cC03e2e34C5DEDaEbC481b2531e06946353De' abi: EscrowUniversal - startBlock: 42653663 + startBlock: 53588833 mapping: kind: ethereum/events apiVersion: 0.0.6 From 472d36af35ea757673b487e6414150adb40608f0 Mon Sep 17 00:00:00 2001 From: kemuru <102478601+kemuru@users.noreply.github.com> Date: Tue, 11 Jun 2024 18:54:54 +0200 Subject: [PATCH 2/2] feat: update frontend to handle deadline absolutely and stop rerenders --- .../DepositPaymentButton.tsx | 38 ++++++------------- 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/web/src/pages/NewTransaction/NavigationButtons/DepositPaymentButton.tsx b/web/src/pages/NewTransaction/NavigationButtons/DepositPaymentButton.tsx index c03133b..1f25df6 100644 --- a/web/src/pages/NewTransaction/NavigationButtons/DepositPaymentButton.tsx +++ b/web/src/pages/NewTransaction/NavigationButtons/DepositPaymentButton.tsx @@ -40,7 +40,6 @@ const DepositPaymentButton: React.FC = () => { resetContext, } = useNewTransactionContext(); - const [currentTime, setCurrentTime] = useState(Date.now()); const [finalRecipientAddress, setFinalRecipientAddress] = useState(sellerAddress); const publicClient = usePublicClient(); const navigateAndScrollTop = useNavigateAndScrollTop(); @@ -50,32 +49,19 @@ const DepositPaymentButton: React.FC = () => { const { address } = useAccount(); const { chain } = useNetwork(); const ensResult = useEnsAddress({ name: sellerAddress, chainId: 1 }); - const deadlineTimestamp = useMemo(() => new Date(deadline).getTime(), [deadline]); - const timeoutPayment = useMemo(() => (deadlineTimestamp - currentTime) / 1000, [deadlineTimestamp, currentTime]); + const deadlineTimestamp = useMemo(() => BigInt(Math.floor(new Date(deadline).getTime() / 1000)), [deadline]); const isNativeTransaction = sendingToken?.address === "native"; const transactionValue = useMemo( () => (isNativeTransaction ? parseEther(sendingQuantity) : parseUnits(sendingQuantity, 18)), [isNativeTransaction, sendingQuantity] ); - const isDeadlinePassed = currentTime >= deadlineTimestamp; - - useEffect(() => { - if (isDeadlinePassed) { - navigateAndScrollTop("/new-transaction/deadline"); - } - }, [isDeadlinePassed, navigateAndScrollTop]); - - useEffect(() => { - const intervalId = setInterval(() => setCurrentTime(Date.now()), 1000); - return () => clearInterval(intervalId); - }, []); useEffect(() => { setFinalRecipientAddress(ensResult.data || sellerAddress); }, [sellerAddress, ensResult.data]); - const { data: allowance } = useContractRead({ - enabled: !isNativeTransaction && !isDeadlinePassed, + const { data: allowance, refetch: refetchAllowance } = useContractRead({ + enabled: !isNativeTransaction, address: sendingToken?.address, abi: erc20ABI, functionName: "allowance", @@ -120,7 +106,7 @@ const DepositPaymentButton: React.FC = () => { seller: sellerAddress, amount: sendingQuantity, token: isNativeTransaction ? "native" : sendingToken?.address, - timeoutPayment: timeoutPayment, + deadline: deadlineTimestamp.toString(), transactionUri: transactionUri, }, category: "Escrow", @@ -140,14 +126,14 @@ const DepositPaymentButton: React.FC = () => { address, isNativeTransaction, sendingToken?.address, - timeoutPayment, + deadlineTimestamp, transactionUri, ] ); const { config: createNativeTransactionConfig } = usePrepareEscrowUniversalCreateNativeTransaction({ - enabled: isNativeTransaction && ethAddressPattern.test(finalRecipientAddress) && !isDeadlinePassed, - args: [BigInt(Math.floor(timeoutPayment)), transactionUri, finalRecipientAddress, templateData, ""], + enabled: isNativeTransaction && ethAddressPattern.test(finalRecipientAddress), + args: [deadlineTimestamp, transactionUri, finalRecipientAddress, templateData, ""], value: transactionValue, }); @@ -156,12 +142,11 @@ const DepositPaymentButton: React.FC = () => { !isNativeTransaction && !isUndefined(allowance) && allowance >= transactionValue && - ethAddressPattern.test(finalRecipientAddress) && - !isDeadlinePassed, + ethAddressPattern.test(finalRecipientAddress), args: [ transactionValue, sendingToken?.address, - BigInt(Math.floor(timeoutPayment)), + deadlineTimestamp, transactionUri, finalRecipientAddress, templateData, @@ -174,7 +159,7 @@ const DepositPaymentButton: React.FC = () => { const { writeAsync: createERC20Transaction } = useEscrowUniversalCreateErc20Transaction(createERC20TransactionConfig); const { config: approveConfig } = usePrepareContractWrite({ - enabled: !isNativeTransaction && !isDeadlinePassed, + enabled: !isNativeTransaction, address: sendingToken?.address, abi: erc20ABI, functionName: "approve", @@ -192,6 +177,7 @@ const DepositPaymentButton: React.FC = () => { publicClient ); setIsApproved(wrapResult.status); + await refetchAllowance(); } catch (error) { console.error("Approval failed:", error); setIsApproved(false); @@ -226,7 +212,7 @@ const DepositPaymentButton: React.FC = () => { return (