kleros-interaction-2
Version:
Smart contracts interacting with Kleros.
928 lines (927 loc) • 393 kB
JSON
{
"contractName": "MultiPartyAgreements",
"abi": [
{
"constant": true,
"inputs": [],
"name": "arbitratorExtraData",
"outputs": [
{
"name": "",
"type": "bytes"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "arbitrator",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "bytes32"
}
],
"name": "agreements",
"outputs": [
{
"name": "creator",
"type": "address"
},
{
"name": "numberOfChoices",
"type": "uint256"
},
{
"name": "extraData",
"type": "bytes"
},
{
"name": "arbitrationFeesWaitingTime",
"type": "uint256"
},
{
"name": "arbitrator",
"type": "address"
},
{
"name": "disputeID",
"type": "uint256"
},
{
"name": "disputed",
"type": "bool"
},
{
"name": "appealed",
"type": "bool"
},
{
"name": "ruling",
"type": "uint256"
},
{
"name": "executed",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
},
{
"name": "",
"type": "uint256"
}
],
"name": "arbitratorAndDisputeIDToAgreementID",
"outputs": [
{
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_arbitrator",
"type": "address"
},
{
"name": "_arbitratorExtraData",
"type": "bytes"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_metaEvidenceID",
"type": "uint256"
},
{
"indexed": false,
"name": "_evidence",
"type": "string"
}
],
"name": "MetaEvidence",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_arbitrator",
"type": "address"
},
{
"indexed": true,
"name": "_disputeID",
"type": "uint256"
},
{
"indexed": false,
"name": "_metaEvidenceID",
"type": "uint256"
}
],
"name": "Dispute",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_arbitrator",
"type": "address"
},
{
"indexed": true,
"name": "_disputeID",
"type": "uint256"
},
{
"indexed": true,
"name": "_party",
"type": "address"
},
{
"indexed": false,
"name": "_evidence",
"type": "string"
}
],
"name": "Evidence",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_arbitrator",
"type": "address"
},
{
"indexed": true,
"name": "_disputeID",
"type": "uint256"
},
{
"indexed": false,
"name": "_ruling",
"type": "uint256"
}
],
"name": "Ruling",
"type": "event"
},
{
"constant": false,
"inputs": [
{
"name": "_disputeID",
"type": "uint256"
},
{
"name": "_ruling",
"type": "uint256"
}
],
"name": "rule",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_agreementID",
"type": "bytes32"
}
],
"name": "getAgreementInfo",
"outputs": [
{
"name": "creator",
"type": "address"
},
{
"name": "parties",
"type": "address[]"
},
{
"name": "numberOfChoices",
"type": "uint256"
},
{
"name": "extraData",
"type": "bytes"
},
{
"name": "arbitrationFeesWaitingTime",
"type": "uint256"
},
{
"name": "arbitrator",
"type": "address"
},
{
"name": "disputeID",
"type": "uint256"
},
{
"name": "disputed",
"type": "bool"
},
{
"name": "appealed",
"type": "bool"
},
{
"name": "ruling",
"type": "uint256"
},
{
"name": "executed",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
],
"bytecode": "0x608060405234801561001057600080fd5b50604051610bac380380610bac83398101604052805160208083015160008054600160a060020a031916600160a060020a03851617905590920180519192909183918391610064916001919084019061006e565b5050505050610109565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100af57805160ff19168380011785556100dc565b828001600101855582156100dc579182015b828111156100dc5782518255916020019190600101906100c1565b506100e89291506100ec565b5090565b61010691905b808211156100e857600081556001016100f2565b90565b610a94806101186000396000f3006080604052600436106100775763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630c7ac7b6811461007c578063311a6c56146101065780636cc6cde1146101235780639e1f68c714610154578063d7baa83d1461023e578063edde5ff414610274575b600080fd5b34801561008857600080fd5b506100916103a1565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100cb5781810151838201526020016100b3565b50505050905090810190601f1680156100f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561011257600080fd5b5061012160043560243561042e565b005b34801561012f57600080fd5b50610138610536565b60408051600160a060020a039092168252519081900360200190f35b34801561016057600080fd5b5061016c600435610545565b60408051600160a060020a03808d16825260208083018d9052606083018b9052908916608083015260a0820188905286151560c083015285151560e083015261010082018590528315156101208301526101409282018381528b51938301939093528a519192916101608401918c019080838360005b838110156101fa5781810151838201526020016101e2565b50505050905090810190601f1680156102275780820380516001836020036101000a031916815260200191505b509b50505050505050505050505060405180910390f35b34801561024a57600080fd5b50610262600160a060020a0360043516602435610636565b60408051918252519081900360200190f35b34801561028057600080fd5b5061028c600435610653565b60408051600160a060020a03808e1682529181018b90526080810189905290871660a082015260c0810186905284151560e0820152831515610100820152610120810183905281151561014082015261016060208083018281528d51928401929092528c5160608401916101808501918f8201910280838360005b8381101561031f578181015183820152602001610307565b5050505090500183810382528b818151815260200191508051906020019080838360005b8381101561035b578181015183820152602001610343565b50505050905090810190601f1680156103885780820380516001836020036101000a031916815260200191505b509d505050505050505050505050505060405180910390f35b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104265780601f106103fb57610100808354040283529160200191610426565b820191906000526020600020905b81548152906001019060200180831161040957829003601f168201915b505050505081565b33600081815260036020908152604080832086845282528083205483526002909152902060050154600160a060020a0316146104f157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4120646973707574652063616e206f6e6c792062652072756c6564206f6e206260448201527f79206974732061726269747261746f722e000000000000000000000000000000606482015290519081900360840190fd5b604080518281529051839133917f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769181900360200190a361053282826108e9565b5050565b600054600160a060020a031681565b60026020818152600092835260409283902080548184015460038301805487516101006001831615026000190190911696909604601f8101869004860287018601909752868652600160a060020a0390921695909492938301828280156105ed5780601f106105c2576101008083540402835291602001916105ed565b820191906000526020600020905b8154815290600101906020018083116105d057829003601f168201915b5050506004840154600585015460068601546007870154600888015460099098015496979396600160a060020a03909316955090935060ff80821693610100909204811692168a565b600360209081526000928352604080842090915290825290205481565b6000818152600260209081526040808320805460019091018054835181860281018601909452808452600160a060020a039092169460609490938593859384938493849384938493849392908301828280156106d857602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116106ba575b50505050509950600260008d60001916600019168152602001908152602001600020600201549850600260008d600019166000191681526020019081526020016000206003018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107b25780601f10610787576101008083540402835291602001916107b2565b820191906000526020600020905b81548152906001019060200180831161079557829003601f168201915b50505050509750600260008d60001916600019168152602001908152602001600020600401549650600260008d6000191660001916815260200190815260200160002060050160009054906101000a9004600160a060020a03169550600260008d60001916600019168152602001908152602001600020600601549450600260008d6000191660001916815260200190815260200160002060070160009054906101000a900460ff169350600260008d6000191660001916815260200190815260200160002060070160019054906101000a900460ff169250600260008d60001916600019168152602001908152602001600020600801549150600260008d6000191660001916815260200190815260200160002060090160009054906101000a900460ff16905091939597999b90929496989a50565b336000908152600360209081526040808320858452909152902054610532908260008281526002602052604090208054600160a060020a031615156109b557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f546865207370656369666965642061677265656d656e7420646f6573206e6f7460448201527f2065786973742e00000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600981015460ff1615610a4f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f546865207370656369666965642061677265656d656e742068617320616c726560448201527f616479206265656e2065786563757465642e0000000000000000000000000000606482015290519081900360840190fd5b6008810191909155600901805460ff19166001179055505600a165627a7a723058207cb4c3cb4f9d314caf4f2970f80d2e4f4675b446aac92dd1855914a0bb3adb4f0029",
"deployedBytecode": "0x6080604052600436106100775763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630c7ac7b6811461007c578063311a6c56146101065780636cc6cde1146101235780639e1f68c714610154578063d7baa83d1461023e578063edde5ff414610274575b600080fd5b34801561008857600080fd5b506100916103a1565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100cb5781810151838201526020016100b3565b50505050905090810190601f1680156100f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561011257600080fd5b5061012160043560243561042e565b005b34801561012f57600080fd5b50610138610536565b60408051600160a060020a039092168252519081900360200190f35b34801561016057600080fd5b5061016c600435610545565b60408051600160a060020a03808d16825260208083018d9052606083018b9052908916608083015260a0820188905286151560c083015285151560e083015261010082018590528315156101208301526101409282018381528b51938301939093528a519192916101608401918c019080838360005b838110156101fa5781810151838201526020016101e2565b50505050905090810190601f1680156102275780820380516001836020036101000a031916815260200191505b509b50505050505050505050505060405180910390f35b34801561024a57600080fd5b50610262600160a060020a0360043516602435610636565b60408051918252519081900360200190f35b34801561028057600080fd5b5061028c600435610653565b60408051600160a060020a03808e1682529181018b90526080810189905290871660a082015260c0810186905284151560e0820152831515610100820152610120810183905281151561014082015261016060208083018281528d51928401929092528c5160608401916101808501918f8201910280838360005b8381101561031f578181015183820152602001610307565b5050505090500183810382528b818151815260200191508051906020019080838360005b8381101561035b578181015183820152602001610343565b50505050905090810190601f1680156103885780820380516001836020036101000a031916815260200191505b509d505050505050505050505050505060405180910390f35b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104265780601f106103fb57610100808354040283529160200191610426565b820191906000526020600020905b81548152906001019060200180831161040957829003601f168201915b505050505081565b33600081815260036020908152604080832086845282528083205483526002909152902060050154600160a060020a0316146104f157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4120646973707574652063616e206f6e6c792062652072756c6564206f6e206260448201527f79206974732061726269747261746f722e000000000000000000000000000000606482015290519081900360840190fd5b604080518281529051839133917f394027a5fa6e098a1191094d1719d6929b9abc535fcc0c8f448d6a4e756222769181900360200190a361053282826108e9565b5050565b600054600160a060020a031681565b60026020818152600092835260409283902080548184015460038301805487516101006001831615026000190190911696909604601f8101869004860287018601909752868652600160a060020a0390921695909492938301828280156105ed5780601f106105c2576101008083540402835291602001916105ed565b820191906000526020600020905b8154815290600101906020018083116105d057829003601f168201915b5050506004840154600585015460068601546007870154600888015460099098015496979396600160a060020a03909316955090935060ff80821693610100909204811692168a565b600360209081526000928352604080842090915290825290205481565b6000818152600260209081526040808320805460019091018054835181860281018601909452808452600160a060020a039092169460609490938593859384938493849384938493849392908301828280156106d857602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116106ba575b50505050509950600260008d60001916600019168152602001908152602001600020600201549850600260008d600019166000191681526020019081526020016000206003018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107b25780601f10610787576101008083540402835291602001916107b2565b820191906000526020600020905b81548152906001019060200180831161079557829003601f168201915b50505050509750600260008d60001916600019168152602001908152602001600020600401549650600260008d6000191660001916815260200190815260200160002060050160009054906101000a9004600160a060020a03169550600260008d60001916600019168152602001908152602001600020600601549450600260008d6000191660001916815260200190815260200160002060070160009054906101000a900460ff169350600260008d6000191660001916815260200190815260200160002060070160019054906101000a900460ff169250600260008d60001916600019168152602001908152602001600020600801549150600260008d6000191660001916815260200190815260200160002060090160009054906101000a900460ff16905091939597999b90929496989a50565b336000908152600360209081526040808320858452909152902054610532908260008281526002602052604090208054600160a060020a031615156109b557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f546865207370656369666965642061677265656d656e7420646f6573206e6f7460448201527f2065786973742e00000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600981015460ff1615610a4f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f546865207370656369666965642061677265656d656e742068617320616c726560448201527f616479206265656e2065786563757465642e0000000000000000000000000000606482015290519081900360840190fd5b6008810191909155600901805460ff19166001179055505600a165627a7a723058207cb4c3cb4f9d314caf4f2970f80d2e4f4675b446aac92dd1855914a0bb3adb4f0029",
"sourceMap": "265:5620:34:-;;;1582:119;8:9:-1;5:2;;;30:1;27;20:12;5:2;1582:119:34;;;;;;;;;;;;;;;;;;;;;2848:10:2;:24;;-1:-1:-1;;;;;;2848:24:2;-1:-1:-1;;;;;2848:24:2;;;;;1582:119:34;;;2882:42:2;;1582:119:34;;;;;;;;2882:42:2;;-1:-1:-1;;2882:42:2;;;;;:::i;:::-;;2767:164;;1582:119:34;;265:5620;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;265:5620:34;;;-1:-1:-1;265:5620:34;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;",
"deployedSourceMap": "265:5620:34:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;691:32:2;;8:9:-1;5:2;;;30:1;27;20:12;5:2;691:32:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;691:32:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1876:383:34;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1876:383:34;;;;;;;;;657:28:2;;8:9:-1;5:2;;;30:1;27;20:12;5:2;657:28:2;;;;;;;;-1:-1:-1;;;;;657:28:2;;;;;;;;;;;;;;1217:47:34;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1217:47:34;;;;;;;;;-1:-1:-1;;;;;1217:47:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;1217:47:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1270:87;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1270:87:34;-1:-1:-1;;;;;1270:87:34;;;;;;;;;;;;;;;;;;;;;;;4863:1020;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4863:1020:34;;;;;;;;;-1:-1:-1;;;;;4863:1020:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;4863:1020:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;4863:1020:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;691:32:2;;;;;;;;;;;;;;;-1:-1:-1;;691:32:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1876:383:34:-;2056:10;1959:71;1970:47;;;:35;:47;;;;;;;;:59;;;;;;;;;1959:71;;:10;:71;;;;;:82;;;-1:-1:-1;;;;;1959:82:34;:108;1938:204;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2157:51;;;;;;;;2188:10;;2175;;2157:51;;;;;;;;;2218:34;2232:10;2244:7;2218:13;:34::i;:::-;1876:383;;:::o;657:28:2:-;;;-1:-1:-1;;;;;657:28:2;;:::o;1217:47:34:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1217:47:34;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1217:47:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;1217:47:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1217:47:34;;;;-1:-1:-1;1217:47:34;;-1:-1:-1;1217:47:34;;;;;;;;;;;;;;:::o;1270:87::-;;;;;;;;;;;;;;;;;;;;;;;;:::o;4863:1020::-;4942:15;5252:24;;;:10;:24;;;;;;;;:32;;;5304;;;5294:42;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;5252:32:34;;;;4967:17;;4942:15;;4967:17;;4942:15;;;;;;;;;;;;;;5294:42;;;;5304:32;5294:42;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;5294:42:34;;;;;;;;;;;;;;;;;;;;;;;5364:10;:24;5375:12;5364:24;;;;;;;;;;;;;;;;;:40;;;5346:58;;5426:10;:24;5437:12;5426:24;;;;;;;;;;;;;;;;;:34;;5414:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5499:10;:24;5510:12;5499:24;;;;;;;;;;;;;;;;;:51;;;5470:80;;5573:10;:24;5584:12;5573:24;;;;;;;;;;;;;;;;;:35;;;;;;;;;;-1:-1:-1;;;;;5573:35:34;5560:48;;5630:10;:24;5641:12;5630:24;;;;;;;;;;;;;;;;;:34;;;5618:46;;5685:10;:24;5696:12;5685:24;;;;;;;;;;;;;;;;;:33;;;;;;;;;;;;5674:44;;5739:10;:24;5750:12;5739:24;;;;;;;;;;;;;;;;;:33;;;;;;;;;;;;5728:44;;5791:10;:24;5802:12;5791:24;;;;;;;;;;;;;;;;;:31;;;5782:40;;5843:10;:24;5854:12;5843:24;;;;;;;;;;;;;;;;;:33;;;;;;;;;;;;5832:44;;4863:1020;;;;;;;;;;;;;:::o;4517:172::-;4649:10;4613:47;;;;:35;:47;;;;;;;;:59;;;;;;;;;4590:92;;4674:7;4043:27;4073:24;;;:10;:24;;;;;4115:17;;-1:-1:-1;;;;;4115:17:34;:31;;4107:83;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4209:18;;;;;;4208:19;4200:82;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4292:16;;;:26;;;;4328:18;;:25;;-1:-1:-1;;4328:25:34;4349:4;4328:25;;;-1:-1:-1;3956:404:34:o",
"source": "pragma solidity ^0.4.24;\n\nimport \"../../Arbitrable.sol\";\n\n/**\n * @title MultiPartyAgreements\n * @author Enrique Piqueras - <epiquerass@gmail.com>\n * @dev Agreement part of a composed arbitrable contract. Handles multi-party, multi-choice dispute agreements.\n */\ncontract MultiPartyAgreements is Arbitrable {\n /* Structs */\n\n struct Agreement {\n address creator; // The agreement's creator.\n address[] parties; // The involved parties.\n uint numberOfChoices; // The number of choices in a dispute arising from the agreement.\n bytes extraData; // The extra data in a dispute arising from the agreement.\n uint arbitrationFeesWaitingTime; // The maximum time to wait for arbitration fees.\n Arbitrator arbitrator; // The arbitrator to use in a dispute arising from the agreement.\n uint disputeID; // The agreement's dispute ID, if disputed.\n bool disputed; // Wether the agreement is disputed or not.\n bool appealed; // Wether the agreement's dispute has been appealed or not.\n uint ruling; // The final ruling for the agreement's dispute.\n bool executed; // Wether the agreement has been executed or not.\n }\n\n /* Storage */\n\n mapping(bytes32 => Agreement) public agreements;\n mapping(address => mapping(uint => bytes32)) public arbitratorAndDisputeIDToAgreementID;\n\n /* Constructor */\n\n /** @dev Constructs the `MultiPartyAgreements` contract.\n * @param _arbitrator The arbitrator of the contract.\n * @param _arbitratorExtraData Extra data for the arbitrator.\n */\n constructor(Arbitrator _arbitrator, bytes _arbitratorExtraData) public Arbitrable(_arbitrator, _arbitratorExtraData) {}\n\n /* Public */\n\n /** @dev Executes the ruling on the specified dispute.\n * @param _disputeID The ID of the dispute.\n * @param _ruling The ruling.\n */\n function rule(uint _disputeID, uint _ruling) public {\n require(\n agreements[arbitratorAndDisputeIDToAgreementID[msg.sender][_disputeID]].arbitrator == Arbitrator(msg.sender),\n \"A dispute can only be ruled on by its arbitrator.\"\n );\n emit Ruling(Arbitrator(msg.sender), _disputeID, _ruling);\n executeRuling(_disputeID, _ruling);\n }\n\n /* Internal */\n\n /** @dev Creates an agreement.\n * @param _agreementID The ID of the agreement.\n * @param _metaEvidence The meta evidence of the agreement.\n * @param _parties The `parties` value of the agreement.\n * @param _numberOfChoices The `numberOfChoices` value of the agreement.\n * @param _extraData The `extraData` value of the agreement.\n * @param _arbitrationFeesWaitingTime The `arbitrationFeesWaitingTime` value of the agreement.\n * @param _arbitrator The `arbitrator` value of the agreement.\n */\n function _createAgreement(\n bytes32 _agreementID,\n string _metaEvidence,\n address[] _parties,\n uint _numberOfChoices,\n bytes _extraData,\n uint _arbitrationFeesWaitingTime,\n Arbitrator _arbitrator\n ) internal {\n require(agreements[_agreementID].creator == address(0), \"The supplied agreement ID is already being used.\");\n require(_parties.length <= 10, \"There cannot be more than 10 parties.\");\n agreements[_agreementID] = Agreement({\n creator: msg.sender,\n parties: _parties,\n numberOfChoices: _numberOfChoices,\n extraData: _extraData,\n arbitrationFeesWaitingTime: _arbitrationFeesWaitingTime,\n arbitrator: _arbitrator,\n disputeID: 0,\n disputed: false,\n appealed: false,\n ruling: 0,\n executed: false\n });\n emit MetaEvidence(uint(_agreementID), _metaEvidence);\n }\n\n /** @dev Executes the ruling on the specified agreement.\n * @param _agreementID The ID of the agreement.\n * @param _ruling The ruling.\n */\n function executeAgreementRuling(bytes32 _agreementID, uint _ruling) internal {\n Agreement storage agreement = agreements[_agreementID];\n require(agreement.creator != address(0), \"The specified agreement does not exist.\");\n require(!agreement.executed, \"The specified agreement has already been executed.\");\n agreement.ruling = _ruling;\n agreement.executed = true;\n }\n\n /** @dev Executes the ruling on the specified dispute.\n * @param _disputeID The ID of the dispute.\n * @param _ruling The ruling.\n */\n function executeRuling(uint _disputeID, uint _ruling) internal {\n executeAgreementRuling(arbitratorAndDisputeIDToAgreementID[msg.sender][_disputeID], _ruling);\n }\n\n /* External Views */\n\n /** @dev Gets the info on the specified agreement.\n * @param _agreementID The ID of the agreement.\n * @return The info.\n */\n function getAgreementInfo(bytes32 _agreementID) external view returns(\n address creator,\n address[] parties,\n uint numberOfChoices,\n bytes extraData,\n uint arbitrationFeesWaitingTime,\n Arbitrator arbitrator,\n uint disputeID,\n bool disputed,\n bool appealed,\n uint ruling,\n bool executed\n ) {\n creator = agreements[_agreementID].creator;\n parties = agreements[_agreementID].parties;\n numberOfChoices = agreements[_agreementID].numberOfChoices;\n extraData = agreements[_agreementID].extraData;\n arbitrationFeesWaitingTime = agreements[_agreementID].arbitrationFeesWaitingTime;\n arbitrator = agreements[_agreementID].arbitrator;\n disputeID = agreements[_agreementID].disputeID;\n disputed = agreements[_agreementID].disputed;\n appealed = agreements[_agreementID].appealed;\n ruling = agreements[_agreementID].ruling;\n executed = agreements[_agreementID].executed;\n }\n}\n",
"sourcePath": "/private/tmp/kleros-interaction/contracts/standard/arbitration/composed-arbitrable/agreement/MultiPartyAgreements.sol",
"ast": {
"absolutePath": "/private/tmp/kleros-interaction/contracts/standard/arbitration/composed-arbitrable/agreement/MultiPartyAgreements.sol",
"exportedSymbols": {
"MultiPartyAgreements": [
11022
]
},
"id": 11023,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 10700,
"literals": [
"solidity",
"^",
"0.4",
".24"
],
"nodeType": "PragmaDirective",
"src": "0:24:34"
},
{
"absolutePath": "/private/tmp/kleros-interaction/contracts/standard/arbitration/Arbitrable.sol",
"file": "../../Arbitrable.sol",
"id": 10701,
"nodeType": "ImportDirective",
"scope": 11023,
"sourceUnit": 596,
"src": "26:30:34",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 10702,
"name": "Arbitrable",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 595,
"src": "298:10:34",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Arbitrable_$595",
"typeString": "contract Arbitrable"
}
},
"id": 10703,
"nodeType": "InheritanceSpecifier",
"src": "298:10:34"
}
],
"contractDependencies": [
595
],
"contractKind": "contract",
"documentation": " @title MultiPartyAgreements\n @author Enrique Piqueras - <epiquerass@gmail.com>\n @dev Agreement part of a composed arbitrable contract. Handles multi-party, multi-choice dispute agreements.",
"fullyImplemented": true,
"id": 11022,
"linearizedBaseContracts": [
11022,
595
],
"name": "MultiPartyAgreements",
"nodeType": "ContractDefinition",
"nodes": [
{
"canonicalName": "MultiPartyAgreements.Agreement",
"id": 10727,
"members": [
{
"constant": false,
"id": 10705,
"name": "creator",
"nodeType": "VariableDeclaration",
"scope": 10727,
"src": "361:15:34",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 10704,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "361:7:34",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 10708,
"name": "parties",
"nodeType": "VariableDeclaration",
"scope": 10727,
"src": "414:17:34",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 10706,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "414:7:34",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 10707,
"length": null,
"nodeType": "ArrayTypeName",
"src": "414:9:34",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 10710,
"name": "numberOfChoices",
"nodeType": "VariableDeclaration",
"scope": 10727,
"src": "466:20:34",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 10709,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "466:4:34",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 10712,
"name": "extraData",
"nodeType": "VariableDeclaration",
"scope": 10727,
"src": "562:15:34",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 10711,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "562:5:34",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 10714,
"name": "arbitrationFeesWaitingTime",
"nodeType": "VariableDeclaration",
"scope": 10727,
"src": "646:31:34",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 10713,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "646:4:34",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 10716,
"name": "arbitrator",
"nodeType": "VariableDeclaration",
"scope": 10727,
"src": "737:21:34",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Arbitrator_$4021",
"typeString": "contract Arbitrator"
},
"typeName": {
"contractScope": null,
"id": 10715,
"name": "Arbitrator",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 4021,
"src": "737:10:34",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Arbitrator_$4021",
"typeString": "contract Arbitrator"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 10718,
"name": "disputeID",
"nodeType": "VariableDeclaration",
"scope": 10727,
"src": "834:14:34",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 10717,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "834:4:34",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 10720,
"name": "disputed",
"nodeType": "VariableDeclaration",
"scope": 10727,
"src": "902:13:34",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 10719,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "902:4:34",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 10722,
"name": "appealed",
"nodeType": "VariableDeclaration",
"scope": 10727,
"src": "969:13:34",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 10721,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "969:4:34",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 10724,
"name": "ruling",
"nodeType": "VariableDeclaration",
"scope": 10727,
"src": "1052:11:34",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 10723,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1052:4:34",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 10726,
"name": "executed",
"nodeType": "VariableDeclaration",
"scope": 10727,
"src": "1122:13:34",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 10725,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1122:4:34",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "Agreement",
"nodeType": "StructDefinition",
"scope": 11022,
"src": "334:858:34",
"visibility": "public"
},
{
"constant": false,
"id": 10731,
"name": "agreements",
"nodeType": "VariableDeclaration",
"scope": 11022,
"src": "1217:47:34",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Agreement_$10727_storage_$",
"typeString": "mapping(bytes32 => struct MultiPartyAgreements.Agreement)"
},
"typeName": {
"id": 10730,
"keyType": {
"id": 10728,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1225:7:34",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "Mapping",
"src": "1217:29:34",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Agreement_$10727_storage_$",
"typeString": "mapping(bytes32 => struct MultiPartyAgreements.Agreement)"
},
"valueType": {
"contractScope": null,
"id": 10729,
"name": "Agreement",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 10727,
"src": "1236:9:34",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Agreement_$10727_storage_ptr",
"typeString": "struct MultiPartyAgreements.Agreement"
}
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 10737,
"name": "arbitratorAndDisputeIDToAgreementID",
"nodeType": "VariableDeclaration",
"scope": 11022,
"src": "1270:87:34",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint256_$_t_bytes32_$_$",
"typeString": "mapping(address => mapping(uint256 => bytes32))"
},
"typeName": {
"id": 10736,
"keyType": {
"id": 10732,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1278:7:34",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "1270:44:34",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint256_$_t_bytes32_$_$",
"typeString": "mapping(address => mapping(uint256 => bytes32))"
},
"valueType": {
"id": 10735,
"keyType": {
"id": 10733,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1297:4:34",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Mapping",
"src": "1289:24:34",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_uint256_$_t_bytes32_$",
"typeString": "mapping(uint256 => bytes32)"
},
"valueType": {
"id": 10734,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1305:7:34",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 10748,
"nodeType": "Block",
"src": "1699:2:34",
"statements": []
},
"documentation": "@dev Constructs the `MultiPartyAgreements` contract.\n @param _arbitrator The arbitrator of the contract.\n @param _arbitratorExtraData Extra data for the arbitrator.",
"id": 10749,
"implemented": true,
"isConstructor": true,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 10744,
"name": "_arbitrator",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10739,
"src": "1664:11:34",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Arbitrator_$4021",
"typeString": "contract Arbitrator"
}
},
{
"argumentTypes": null,
"id": 10745,
"name": "_arbitratorExtraData",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10741,
"src": "1677:20:34",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"id": 10746,
"modifierName": {
"argumentTypes": null,
"id": 10743,
"name": "Arbitrable",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 595,
"src": "1653:10:34",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_Arbitrable_$595_$",
"typeString": "type(contract Arbitrable)"
}
},
"nodeType": "ModifierInvocation",
"src": "1653:45:34"
}
],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 10742,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 10739,
"name": "_arbitrator",
"nodeType": "VariableDeclaration",
"scope": 10749,
"src": "1594:22:34",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Arbitrator_$4021",
"typeString": "contract Arbitrator"
},
"typeName": {
"contractScope": null,
"id": 10738,
"name": "Arbitrator",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 4021,
"src": "1594:10:34",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Arbitrator_$4021",
"typeString": "contract Arbitrator"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 10741,
"name": "_arbitratorExtraData",
"nodeType": "VariableDeclaration",
"scope": 10749,
"src": "1618:26:34",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 10740,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "1618:5:34",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1593:52:34"
},
"payable": false,
"returnParameters": {
"id": 10747,
"nodeType": "ParameterList",
"parameters": [],
"src": "1699:0:34"
},
"scope": 11022,
"src": "1582:119:34",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 10788,
"nodeType": "Block",
"src": "1928:331:34",
"statements": [
{
"expression": {