From f9dc18577a147e45b45be48a497c63030a745354 Mon Sep 17 00:00:00 2001 From: Sam Kozin Date: Thu, 23 Nov 2017 03:04:35 +0300 Subject: [PATCH] Fix errors & missing pre-conditions in contract code Related to #1 --- build/contracts/Migrations.json | 6 +- build/contracts/Project.json | 3477 ++++++++++++++++++++----------- contracts/Project.sol | 29 +- 3 files changed, 2333 insertions(+), 1179 deletions(-) diff --git a/build/contracts/Migrations.json b/build/contracts/Migrations.json index 12bb1f0..9ee333b 100644 --- a/build/contracts/Migrations.json +++ b/build/contracts/Migrations.json @@ -220,7 +220,7 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 492, + "referencedDeclaration": 571, "type": "msg", "value": "msg" }, @@ -357,7 +357,7 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 492, + "referencedDeclaration": 571, "type": "msg", "value": "msg" }, @@ -817,5 +817,5 @@ }, "networks": {}, "schemaVersion": "1.0.1", - "updatedAt": "2017-11-12T16:36:28.810Z" + "updatedAt": "2017-11-23T00:02:14.944Z" } \ No newline at end of file diff --git a/build/contracts/Project.json b/build/contracts/Project.json index 20323f0..d4501b0 100644 --- a/build/contracts/Project.json +++ b/build/contracts/Project.json @@ -339,18 +339,18 @@ "type": "constructor" } ], - "bytecode": "0x60606040524260065560006009556000600a55341561001d57600080fd5b604051611124380380611124833981016040528080518201919060200180519060200190919080519060200190919080519060200190919080519060200190919050506103e88163ffffffff161115151561007757600080fd5b846001908051906020019061008d929190610163565b5083600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260058190555081600360186101000a81548163ffffffff021916908363ffffffff16021790555080600360146101000a81548163ffffffff021916908363ffffffff16021790555033600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050505050610208565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106101a457805160ff19168380011785556101d2565b828001600101855582156101d2579182015b828111156101d15782518255916020019190600101906101b6565b5b5090506101df91906101e3565b5090565b61020591905b808211156102015760008160009055506001016101e9565b5090565b90565b610f0d806102176000396000f300606060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101385780630e40de31146101c657806312424e3f146102035780632c2ab5ea146102185780633ccfd60b1461026d5780634c7afe60146102825780634d947d59146102ab57806354fd4d50146102d457806359a7b3fe14610305578063844b33201461032e57806391294e5414610363578063a761d1b61461038c578063adb41fec146103b5578063bb168ab6146103de578063be9a655514610413578063c19d93fb1461041d578063c24a0f8b14610454578063c8802e151461047d578063cae3e7021461050b578063d900f2d614610540578063ea8a1af014610579578063f21376af1461058e578063fde08174146105e3575b600080fd5b341561014357600080fd5b61014b61061a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018b578082015181840152602081019050610170565b50505050905090810190601f1680156101b85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101d157600080fd5b610201600480803563ffffffff1690602001909190803590602001908201803590602001919091929050506106b8565b005b341561020e57600080fd5b610216610788565b005b341561022357600080fd5b61022b6107fb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561027857600080fd5b610280610821565b005b341561028d57600080fd5b6102956108b3565b6040518082815260200191505060405180910390f35b34156102b657600080fd5b6102be6108e3565b6040518082815260200191505060405180910390f35b34156102df57600080fd5b6102e7610a01565b604051808261ffff1661ffff16815260200191505060405180910390f35b341561031057600080fd5b610318610a06565b6040518082815260200191505060405180910390f35b341561033957600080fd5b610341610a0c565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b341561036e57600080fd5b610376610a22565b6040518082815260200191505060405180910390f35b341561039757600080fd5b61039f610a28565b6040518082815260200191505060405180910390f35b34156103c057600080fd5b6103c8610a2e565b6040518082815260200191505060405180910390f35b34156103e957600080fd5b6103f1610a69565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b61041b610a7f565b005b341561042857600080fd5b610430610b51565b6040518082600381111561044057fe5b60ff16815260200191505060405180910390f35b341561045f57600080fd5b610467610b63565b6040518082815260200191505060405180910390f35b341561048857600080fd5b610490610b69565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104d05780820151818401526020810190506104b5565b50505050905090810190601f1680156104fd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561051657600080fd5b61051e610c07565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b341561054b57600080fd5b610577600480803515159060200190919080359060200190820180359060200191909192905050610c1d565b005b341561058457600080fd5b61058c610c8a565b005b341561059957600080fd5b6105a1610d4e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105ee57600080fd5b6105f6610d74565b6040518082600281111561060657fe5b60ff16815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106b05780601f10610685576101008083540402835291602001916106b0565b820191906000526020600020905b81548152906001019060200180831161069357829003601f168201915b505050505081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561071457600080fd5b600180600381111561072257fe5b6000809054906101000a900460ff16600381111561073c57fe5b14151561074857600080fd5b836003601c6101000a81548163ffffffff021916908363ffffffff16021790555082826004919061077a929190610e3c565b504260068190555050505050565b600060026000806101000a81548160ff021916908360038111156107a857fe5b02179055504260088190555042600681905550603c6003601c9054906101000a900463ffffffff1663ffffffff16600554028115156107e357fe5b0490506009548111156107f857806009819055505b50565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000426006819055506108326108e3565b905060008111156108b0576001600281111561084a57fe5b610852610d74565b600281111561085d57fe5b141561086f5780600a5401600a819055505b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015156108af57600080fd5b5b50565b6000603c600360189054906101000a900463ffffffff1663ffffffff16600554028115156108dd57fe5b04905090565b60008060008060038111156108f457fe5b6000809054906101000a900460ff16600381111561090e57fe5b141561091d57600092506109fc565b610925610d74565b91506000600281111561093457fe5b82600281111561094057fe5b141561094f57600092506109fc565b600a546009541015151561095f57fe5b600a546009540390506001600281111561097557fe5b82600281111561098157fe5b141561098f578092506109fc565b60028081111561099b57fe5b8260028111156109a757fe5b14156109f157803073ffffffffffffffffffffffffffffffffffffffff1631101515156109d057fe5b803073ffffffffffffffffffffffffffffffffffffffff16310392506109fc565b600015156109fb57fe5b5b505090565b600181565b60055481565b6003601c9054906101000a900463ffffffff1681565b60065481565b60075481565b600080610a396108b3565b90506103e8600360149054906101000a900463ffffffff1663ffffffff168202811515610a6257fe5b0491505090565b600360149054906101000a900463ffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610adb57600080fd5b6000806003811115610ae957fe5b6000809054906101000a900460ff166003811115610b0357fe5b141515610b0f57600080fd5b60016000806101000a81548160ff02191690836003811115610b2d57fe5b0217905550610b3a610a2e565b600981905550426007819055504260068190555050565b6000809054906101000a900460ff1681565b60085481565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bff5780601f10610bd457610100808354040283529160200191610bff565b820191906000526020600020905b815481529060010190602001808311610be257829003601f168201915b505050505081565b600360189054906101000a900463ffffffff1681565b60026003811115610c2a57fe5b6000809054906101000a900460ff166003811115610c4457fe5b1480610c735750600380811115610c5757fe5b6000809054906101000a900460ff166003811115610c7157fe5b145b1515610c7e57600080fd5b42600681905550505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ce657600080fd5b6001806003811115610cf457fe5b6000809054906101000a900460ff166003811115610d0e57fe5b141515610d1a57600080fd5b60036000806101000a81548160ff02191690836003811115610d3857fe5b0217905550426008819055504260068190555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610dd55760029050610e39565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610e345760019050610e39565b600090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610e7d57803560ff1916838001178555610eab565b82800160010185558215610eab579182015b82811115610eaa578235825591602001919060010190610e8f565b5b509050610eb89190610ebc565b5090565b610ede91905b80821115610eda576000816000905550600101610ec2565b5090565b905600a165627a7a72305820f80ddcdc187b839b249a085276ee8103b737ae681b54edf804a2f53e63e5de010029", - "deployedBytecode": "0x606060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101385780630e40de31146101c657806312424e3f146102035780632c2ab5ea146102185780633ccfd60b1461026d5780634c7afe60146102825780634d947d59146102ab57806354fd4d50146102d457806359a7b3fe14610305578063844b33201461032e57806391294e5414610363578063a761d1b61461038c578063adb41fec146103b5578063bb168ab6146103de578063be9a655514610413578063c19d93fb1461041d578063c24a0f8b14610454578063c8802e151461047d578063cae3e7021461050b578063d900f2d614610540578063ea8a1af014610579578063f21376af1461058e578063fde08174146105e3575b600080fd5b341561014357600080fd5b61014b61061a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018b578082015181840152602081019050610170565b50505050905090810190601f1680156101b85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101d157600080fd5b610201600480803563ffffffff1690602001909190803590602001908201803590602001919091929050506106b8565b005b341561020e57600080fd5b610216610788565b005b341561022357600080fd5b61022b6107fb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561027857600080fd5b610280610821565b005b341561028d57600080fd5b6102956108b3565b6040518082815260200191505060405180910390f35b34156102b657600080fd5b6102be6108e3565b6040518082815260200191505060405180910390f35b34156102df57600080fd5b6102e7610a01565b604051808261ffff1661ffff16815260200191505060405180910390f35b341561031057600080fd5b610318610a06565b6040518082815260200191505060405180910390f35b341561033957600080fd5b610341610a0c565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b341561036e57600080fd5b610376610a22565b6040518082815260200191505060405180910390f35b341561039757600080fd5b61039f610a28565b6040518082815260200191505060405180910390f35b34156103c057600080fd5b6103c8610a2e565b6040518082815260200191505060405180910390f35b34156103e957600080fd5b6103f1610a69565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b61041b610a7f565b005b341561042857600080fd5b610430610b51565b6040518082600381111561044057fe5b60ff16815260200191505060405180910390f35b341561045f57600080fd5b610467610b63565b6040518082815260200191505060405180910390f35b341561048857600080fd5b610490610b69565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104d05780820151818401526020810190506104b5565b50505050905090810190601f1680156104fd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561051657600080fd5b61051e610c07565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b341561054b57600080fd5b610577600480803515159060200190919080359060200190820180359060200191909192905050610c1d565b005b341561058457600080fd5b61058c610c8a565b005b341561059957600080fd5b6105a1610d4e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105ee57600080fd5b6105f6610d74565b6040518082600281111561060657fe5b60ff16815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106b05780601f10610685576101008083540402835291602001916106b0565b820191906000526020600020905b81548152906001019060200180831161069357829003601f168201915b505050505081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561071457600080fd5b600180600381111561072257fe5b6000809054906101000a900460ff16600381111561073c57fe5b14151561074857600080fd5b836003601c6101000a81548163ffffffff021916908363ffffffff16021790555082826004919061077a929190610e3c565b504260068190555050505050565b600060026000806101000a81548160ff021916908360038111156107a857fe5b02179055504260088190555042600681905550603c6003601c9054906101000a900463ffffffff1663ffffffff16600554028115156107e357fe5b0490506009548111156107f857806009819055505b50565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000426006819055506108326108e3565b905060008111156108b0576001600281111561084a57fe5b610852610d74565b600281111561085d57fe5b141561086f5780600a5401600a819055505b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015156108af57600080fd5b5b50565b6000603c600360189054906101000a900463ffffffff1663ffffffff16600554028115156108dd57fe5b04905090565b60008060008060038111156108f457fe5b6000809054906101000a900460ff16600381111561090e57fe5b141561091d57600092506109fc565b610925610d74565b91506000600281111561093457fe5b82600281111561094057fe5b141561094f57600092506109fc565b600a546009541015151561095f57fe5b600a546009540390506001600281111561097557fe5b82600281111561098157fe5b141561098f578092506109fc565b60028081111561099b57fe5b8260028111156109a757fe5b14156109f157803073ffffffffffffffffffffffffffffffffffffffff1631101515156109d057fe5b803073ffffffffffffffffffffffffffffffffffffffff16310392506109fc565b600015156109fb57fe5b5b505090565b600181565b60055481565b6003601c9054906101000a900463ffffffff1681565b60065481565b60075481565b600080610a396108b3565b90506103e8600360149054906101000a900463ffffffff1663ffffffff168202811515610a6257fe5b0491505090565b600360149054906101000a900463ffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610adb57600080fd5b6000806003811115610ae957fe5b6000809054906101000a900460ff166003811115610b0357fe5b141515610b0f57600080fd5b60016000806101000a81548160ff02191690836003811115610b2d57fe5b0217905550610b3a610a2e565b600981905550426007819055504260068190555050565b6000809054906101000a900460ff1681565b60085481565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bff5780601f10610bd457610100808354040283529160200191610bff565b820191906000526020600020905b815481529060010190602001808311610be257829003601f168201915b505050505081565b600360189054906101000a900463ffffffff1681565b60026003811115610c2a57fe5b6000809054906101000a900460ff166003811115610c4457fe5b1480610c735750600380811115610c5757fe5b6000809054906101000a900460ff166003811115610c7157fe5b145b1515610c7e57600080fd5b42600681905550505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ce657600080fd5b6001806003811115610cf457fe5b6000809054906101000a900460ff166003811115610d0e57fe5b141515610d1a57600080fd5b60036000806101000a81548160ff02191690836003811115610d3857fe5b0217905550426008819055504260068190555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610dd55760029050610e39565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610e345760019050610e39565b600090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610e7d57803560ff1916838001178555610eab565b82800160010185558215610eab579182015b82811115610eaa578235825591602001919060010190610e8f565b5b509050610eb89190610ebc565b5090565b610ede91905b80821115610eda576000816000905550600101610ec2565b5090565b905600a165627a7a72305820f80ddcdc187b839b249a085276ee8103b737ae681b54edf804a2f53e63e5de010029", - "sourceMap": "26:3854:1:-;;;626:3;592:37;;727:1;692:36;;766:1;732:35;;772:429;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;977:4;949:24;:32;;;;941:41;;;;;;;;995:5;988:4;:12;;;;;;;;;;;;:::i;:::-;;1022:14;1006:13;;:30;;;;;;;;;;;;;;;;;;1055:11;1042:10;:24;;;;1089:15;1072:14;;:32;;;;;;;;;;;;;;;;;;1136:24;1110:23;;:50;;;;;;;;;;;;;;;;;;1186:10;1166:17;;:30;;;;;;;;;;;;;;;;;;772:429;;;;;26:3854;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;", - "deployedSourceMap": "26:3854:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;242:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2782:218:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3004:264;;;;;;;;;;;;;;265:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3421:278;;;;;;;;;;;;;;2103:105;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2212:566;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;181:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;562:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;408:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;592:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;633:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1949:150;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;334:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1454:260;;;;;;220:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;665:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;526:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;375:28:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3703:174;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3272:145;;;;;;;;;;;;;;297:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1718:227;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;242:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;2782:218::-;1259:17;;;;;;;;;;;1245:31;;:10;:31;;;1237:40;;;;;;;;2874:12;1431:6;1422:15;;;;;;;;:5;;;;;;;;;;;:15;;;;;;;;;1414:24;;;;;;;;2923:11;2905:15;;:29;;;;;;;;;;;;;;;;;;2960:7;;2940:17;:27;;;;;;;:::i;:::-;;2992:3;2973:16;:22;;;;1283:1;2782:218;;;:::o;3004:264::-;3114:21;3046:14;3038:5;;:22;;;;;;;;;;;;;;;;;;;;;;;;3076:3;3066:7;:13;;;;3104:3;3085:16;:22;;;;3171:2;3152:15;;;;;;;;;;;3139:28;;:10;;:28;3138:35;;;;;;;;3114:59;;3199:16;;3183:13;:32;3179:85;;;3244:13;3225:16;:32;;;;3179:85;3004:264;:::o;265:28::-;;;;;;;;;;;;;:::o;3421:278::-;3482:16;3473:3;3454:16;:22;;;;3501;:20;:22::i;:::-;3482:41;;3544:1;3533:8;:12;3529:166;;;3572:15;3559:28;;;;;;;;:9;:7;:9::i;:::-;:28;;;;;;;;;3555:97;;;3635:8;3617:15;;:26;3599:15;:44;;;;3555:97;3659:10;:19;;:29;3679:8;3659:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3529:166;3421:278;:::o;2103:105::-;2147:7;2201:2;2183:14;;;;;;;;;;;2170:27;;:10;;:27;2169:34;;;;;;;;2162:41;;2103:105;:::o;2212:566::-;2265:4;2334:9;2467:29;2290:13;2281:22;;;;;;;;:5;;;;;;;;;;;:22;;;;;;;;;2277:51;;;2320:1;2313:8;;;;2277:51;2346:9;:7;:9::i;:::-;2334:21;;2374:13;2366:21;;;;;;;;:4;:21;;;;;;;;;2362:50;;;2404:1;2397:8;;;;2362:50;2445:15;;2425:16;;:35;;2418:43;;;;;;2518:15;;2499:16;;:34;2467:66;;2552:15;2544:23;;;;;;;;:4;:23;;;;;;;;;2540:72;;;2584:21;2577:28;;;;2540:72;2630:11;2622:19;;;;;;;;:4;:19;;;;;;;;;2618:136;;;2674:21;2658:4;:12;;;:37;;2651:45;;;;;;2726:21;2711:4;:12;;;:36;2704:43;;;;2618:136;2767:5;2760:13;;;;;;2212:566;;;;:::o;181:34::-;214:1;181:34;:::o;562:25::-;;;;:::o;408:29::-;;;;;;;;;;;;;:::o;592:37::-;;;;:::o;633:28::-;;;;:::o;1949:150::-;1991:7;2006:16;2025:13;:11;:13::i;:::-;2006:32;;2090:4;2063:23;;;;;;;;;;;2052:34;;:8;:34;2051:43;;;;;;;;2044:50;;1949:150;;:::o;334:37::-;;;;;;;;;;;;;:::o;1454:260::-;1343:13;;;;;;;;;;;1329:27;;:10;:27;;;1321:36;;;;;;;;1511:13;1431:6;1422:15;;;;;;;;:5;;;;;;;;;;;:15;;;;;;;;;1414:24;;;;;;;;1608:12;1600:5;;:20;;;;;;;;;;;;;;;;;;;;;;;;1645:11;:9;:11::i;:::-;1626:16;:30;;;;1678:3;1662:13;:19;;;;1706:3;1687:16;:22;;;;1363:1;1454:260::o;220:18::-;;;;;;;;;;;;;:::o;665:22::-;;;;:::o;526:31::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;375:28::-;;;;;;;;;;;;;:::o;3703:174::-;3789:14;3780:23;;;;;;;;:5;;;;;;;;;;;:23;;;;;;;;;:51;;;;3816:15;3807:24;;;;;;;;:5;;;;;;;;;;;:24;;;;;;;;;3780:51;3772:60;;;;;;;;3869:3;3850:16;:22;;;;3703:174;;;:::o;3272:145::-;1343:13;;;;;;;;;;;1329:27;;:10;:27;;;1321:36;;;;;;;;3313:12;1431:6;1422:15;;;;;;;;:5;;;;;;;;;;;:15;;;;;;;;;1414:24;;;;;;;;3350:15;3342:5;;:23;;;;;;;;;;;;;;;;;;;;;;;;3381:3;3371:7;:13;;;;3409:3;3390:16;:22;;;;1363:1;3272:145::o;297:32::-;;;;;;;;;;;;;:::o;1718:227::-;1758:4;1788:13;;;;;;;;;;;1774:27;;:10;:27;;;1770:66;;;1818:11;1811:18;;;;1770:66;1859:17;;;;;;;;;;;1845:31;;:10;:31;;;1841:74;;;1893:15;1886:22;;;;1841:74;1927:13;1920:20;;1718:227;;:::o;26:3854::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o", - "source": "pragma solidity ^0.4.18;\n\ncontract Project {\n\n enum State {\n Created,\n Active,\n Approved,\n Cancelled\n }\n\n enum Role {\n Stranger,\n Contractor,\n Client\n }\n\n uint16 public constant version = 1;\n\n State public state;\n string public name;\n\n address public clientAddress;\n address public contractorAddress;\n\n uint32 public prepayFractionThousands;\n uint32 public timeCapMinutes;\n\n uint32 public minutesReported;\n\n // making this public breaks Solidity compiler so it starts to output invalid ABI\n string public contractorComment;\n\n uint256 public hourlyRate;\n\n uint256 public lastActivityDate = now;\n uint256 public executionDate;\n uint256 public endDate;\n\n uint256 private contractorCredit = 0;\n uint256 private contractorDebit = 0;\n\n function Project(\n string _name,\n address _clientAddress,\n uint256 _hourlyRate,\n uint32 _timeCapMinutes,\n uint32 _prepayFractionThousands)\n public {\n require(_prepayFractionThousands <= 1000);\n name = _name;\n clientAddress = _clientAddress;\n hourlyRate = _hourlyRate;\n timeCapMinutes = _timeCapMinutes;\n prepayFractionThousands = _prepayFractionThousands;\n contractorAddress = msg.sender;\n }\n\n modifier onlyContractor() {\n require(msg.sender == contractorAddress);\n _;\n }\n\n modifier onlyClient() {\n require(msg.sender == clientAddress);\n _;\n }\n\n modifier onlyAtState(State _state) {\n require(state == _state);\n _;\n }\n\n function start() external payable onlyClient onlyAtState(State.Created) {\n // require(this.balance >= (hourlyRate * timeCapMinutes) / 60);\n state = State.Active;\n contractorCredit = getPrepay();\n executionDate = now;\n lastActivityDate = now;\n }\n\n function getRole() public view returns (Role) {\n if (msg.sender == clientAddress) {\n return Role.Client;\n }\n if (msg.sender == contractorAddress) {\n return Role.Contractor;\n }\n return Role.Stranger;\n }\n\n function getPrepay() public view returns (uint256) {\n uint256 priceCap = getPriceCap();\n return (priceCap * prepayFractionThousands) / 1000;\n }\n\n function getPriceCap() public view returns (uint256) {\n return (hourlyRate * timeCapMinutes) / 60;\n }\n\n function availableForWithdraw() public view returns (uint) {\n if (state == State.Created) {\n return 0;\n }\n\n Role role = getRole();\n\n if (role == Role.Stranger) {\n return 0;\n }\n\n assert(contractorCredit >= contractorDebit);\n uint256 availableToContractor = contractorCredit - contractorDebit;\n\n if (role == Role.Contractor) {\n return availableToContractor;\n }\n\n if (role == Role.Client) {\n assert(this.balance >= availableToContractor);\n return this.balance - availableToContractor;\n }\n\n assert(false);\n }\n\n function setBillableTime(uint32 timeMinutes, string comment)\n onlyContractor onlyAtState(State.Active)\n external {\n minutesReported = timeMinutes;\n contractorComment = comment;\n lastActivityDate = now;\n }\n\n function approve() external {\n state = State.Approved;\n endDate = now;\n lastActivityDate = now;\n\n uint256 approvedPrice = (hourlyRate * minutesReported) / 60;\n if (approvedPrice > contractorCredit) {\n contractorCredit = approvedPrice;\n }\n }\n\n function cancel() onlyClient onlyAtState(State.Active) external {\n state = State.Cancelled;\n endDate = now;\n lastActivityDate = now;\n }\n\n function withdraw() public {\n lastActivityDate = now;\n uint256 toBeSent = availableForWithdraw();\n if (toBeSent > 0) {\n if (getRole() == Role.Contractor) {\n contractorDebit = contractorDebit + toBeSent;\n }\n msg.sender.transfer(toBeSent);\n }\n }\n\n function leaveFeedback(bool positive, string comment) external {\n require(state == State.Approved || state == State.Cancelled);\n // TODO\n lastActivityDate = now;\n }\n\n}\n", + "bytecode": "0x606060405260008060006101000a81548160ff021916908360038111156200002357fe5b02179055504260065560006009556000600a5534156200004257600080fd5b6040516200148d3803806200148d833981016040528080518201919060200180519060200190919080519060200190919080519060200190919080519060200190919050506103e88163ffffffff16111515156200009f57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515620000db57600080fd5b8460019080519060200190620000f3929190620001ca565b5083600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555033600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260058190555081600360186101000a81548163ffffffff021916908363ffffffff16021790555080600360146101000a81548163ffffffff021916908363ffffffff160217905550505050505062000279565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200020d57805160ff19168380011785556200023e565b828001600101855582156200023e579182015b828111156200023d57825182559160200191906001019062000220565b5b5090506200024d919062000251565b5090565b6200027691905b808211156200027257600081600090555060010162000258565b5090565b90565b61120480620002896000396000f300606060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101385780630e40de31146101c657806312424e3f146102035780632c2ab5ea146102185780633ccfd60b1461026d5780634c7afe60146102825780634d947d59146102ab57806354fd4d50146102d457806359a7b3fe14610305578063844b33201461032e57806391294e5414610363578063a761d1b61461038c578063adb41fec146103b5578063bb168ab6146103de578063be9a655514610413578063c19d93fb1461041d578063c24a0f8b14610454578063c8802e151461047d578063cae3e7021461050b578063d900f2d614610540578063ea8a1af014610579578063f21376af1461058e578063fde08174146105e3575b600080fd5b341561014357600080fd5b61014b61061a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018b578082015181840152602081019050610170565b50505050905090810190601f1680156101b85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101d157600080fd5b610201600480803563ffffffff1690602001909190803590602001908201803590602001919091929050506106b8565b005b341561020e57600080fd5b6102166107d1565b005b341561022357600080fd5b61022b6108d5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561027857600080fd5b6102806108fb565b005b341561028d57600080fd5b610295610a41565b6040518082815260200191505060405180910390f35b34156102b657600080fd5b6102be610a71565b6040518082815260200191505060405180910390f35b34156102df57600080fd5b6102e7610bf6565b604051808261ffff1661ffff16815260200191505060405180910390f35b341561031057600080fd5b610318610bfb565b6040518082815260200191505060405180910390f35b341561033957600080fd5b610341610c01565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b341561036e57600080fd5b610376610c17565b6040518082815260200191505060405180910390f35b341561039757600080fd5b61039f610c1d565b6040518082815260200191505060405180910390f35b34156103c057600080fd5b6103c8610c23565b6040518082815260200191505060405180910390f35b34156103e957600080fd5b6103f1610c5e565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b61041b610c74565b005b341561042857600080fd5b610430610d94565b6040518082600381111561044057fe5b60ff16815260200191505060405180910390f35b341561045f57600080fd5b610467610da6565b6040518082815260200191505060405180910390f35b341561048857600080fd5b610490610dac565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104d05780820151818401526020810190506104b5565b50505050905090810190601f1680156104fd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561051657600080fd5b61051e610e4a565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b341561054b57600080fd5b610577600480803515159060200190919080359060200190820180359060200191909192905050610e60565b005b341561058457600080fd5b61058c610f81565b005b341561059957600080fd5b6105a1611045565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105ee57600080fd5b6105f661106b565b6040518082600281111561060657fe5b60ff16815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106b05780601f10610685576101008083540402835291602001916106b0565b820191906000526020600020905b81548152906001019060200180831161069357829003601f168201915b505050505081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561071457600080fd5b600180600381111561072257fe5b6000809054906101000a900460ff16600381111561073c57fe5b14151561074857600080fd5b600360189054906101000a900463ffffffff1663ffffffff168463ffffffff161115151561077557600080fd5b6007544203603c850263ffffffff161115151561079157600080fd5b836003601c6101000a81548163ffffffff021916908363ffffffff1602179055508282600491906107c3929190611133565b504260068190555050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561082f57600080fd5b600180600381111561083d57fe5b6000809054906101000a900460ff16600381111561085757fe5b14151561086357600080fd5b60026000806101000a81548160ff0219169083600381111561088157fe5b02179055504260088190555042600681905550603c6003601c9054906101000a900463ffffffff1663ffffffff16600554028115156108bc57fe5b0491506009548211156108d157816009819055505b5050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806109a65750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156109b157600080fd5b426006819055506109c0610a71565b90506000811115610a3e57600160028111156109d857fe5b6109e061106b565b60028111156109eb57fe5b14156109fd5780600a5401600a819055505b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610a3d57600080fd5b5b50565b6000603c600360189054906101000a900463ffffffff1663ffffffff1660055402811515610a6b57fe5b04905090565b6000806000806003811115610a8257fe5b6000809054906101000a900460ff166003811115610a9c57fe5b1415610aab5760009250610bf1565b610ab361106b565b915060006002811115610ac257fe5b826002811115610ace57fe5b1415610add5760009250610bf1565b600a5460095410151515610aed57fe5b600a5460095403905060016002811115610b0357fe5b826002811115610b0f57fe5b1415610b1d57809250610bf1565b600280811115610b2957fe5b826002811115610b3557fe5b1415610be65760026003811115610b4857fe5b6000809054906101000a900460ff166003811115610b6257fe5b14158015610b945750600380811115610b7757fe5b6000809054906101000a900460ff166003811115610b9157fe5b14155b15610ba25760009250610bf1565b803073ffffffffffffffffffffffffffffffffffffffff163110151515610bc557fe5b803073ffffffffffffffffffffffffffffffffffffffff1631039250610bf1565b60001515610bf057fe5b5b505090565b600181565b60055481565b6003601c9054906101000a900463ffffffff1681565b60065481565b60075481565b600080610c2e610a41565b90506103e8600360149054906101000a900463ffffffff1663ffffffff168202811515610c5757fe5b0491505090565b600360149054906101000a900463ffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cd057600080fd5b6000806003811115610cde57fe5b6000809054906101000a900460ff166003811115610cf857fe5b141515610d0457600080fd5b603c600360189054906101000a900463ffffffff1663ffffffff1660055402811515610d2c57fe5b043073ffffffffffffffffffffffffffffffffffffffff163110151515610d5257600080fd5b60016000806101000a81548160ff02191690836003811115610d7057fe5b0217905550610d7d610c23565b600981905550426007819055504260068190555050565b6000809054906101000a900460ff1681565b60085481565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e425780601f10610e1757610100808354040283529160200191610e42565b820191906000526020600020905b815481529060010190602001808311610e2557829003601f168201915b505050505081565b600360189054906101000a900463ffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610f095750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610f1457600080fd5b60026003811115610f2157fe5b6000809054906101000a900460ff166003811115610f3b57fe5b1480610f6a5750600380811115610f4e57fe5b6000809054906101000a900460ff166003811115610f6857fe5b145b1515610f7557600080fd5b42600681905550505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fdd57600080fd5b6001806003811115610feb57fe5b6000809054906101000a900460ff16600381111561100557fe5b14151561101157600080fd5b60036000806101000a81548160ff0219169083600381111561102f57fe5b0217905550426008819055504260068190555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156110cc5760029050611130565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561112b5760019050611130565b600090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061117457803560ff19168380011785556111a2565b828001600101855582156111a2579182015b828111156111a1578235825591602001919060010190611186565b5b5090506111af91906111b3565b5090565b6111d591905b808211156111d15760008160009055506001016111b9565b5090565b905600a165627a7a7230582047884932d24cb307e5c226092c7410116103b2f7bdec110db9304f8e9a46b67b0029", + "deployedBytecode": "0x606060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101385780630e40de31146101c657806312424e3f146102035780632c2ab5ea146102185780633ccfd60b1461026d5780634c7afe60146102825780634d947d59146102ab57806354fd4d50146102d457806359a7b3fe14610305578063844b33201461032e57806391294e5414610363578063a761d1b61461038c578063adb41fec146103b5578063bb168ab6146103de578063be9a655514610413578063c19d93fb1461041d578063c24a0f8b14610454578063c8802e151461047d578063cae3e7021461050b578063d900f2d614610540578063ea8a1af014610579578063f21376af1461058e578063fde08174146105e3575b600080fd5b341561014357600080fd5b61014b61061a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018b578082015181840152602081019050610170565b50505050905090810190601f1680156101b85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101d157600080fd5b610201600480803563ffffffff1690602001909190803590602001908201803590602001919091929050506106b8565b005b341561020e57600080fd5b6102166107d1565b005b341561022357600080fd5b61022b6108d5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561027857600080fd5b6102806108fb565b005b341561028d57600080fd5b610295610a41565b6040518082815260200191505060405180910390f35b34156102b657600080fd5b6102be610a71565b6040518082815260200191505060405180910390f35b34156102df57600080fd5b6102e7610bf6565b604051808261ffff1661ffff16815260200191505060405180910390f35b341561031057600080fd5b610318610bfb565b6040518082815260200191505060405180910390f35b341561033957600080fd5b610341610c01565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b341561036e57600080fd5b610376610c17565b6040518082815260200191505060405180910390f35b341561039757600080fd5b61039f610c1d565b6040518082815260200191505060405180910390f35b34156103c057600080fd5b6103c8610c23565b6040518082815260200191505060405180910390f35b34156103e957600080fd5b6103f1610c5e565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b61041b610c74565b005b341561042857600080fd5b610430610d94565b6040518082600381111561044057fe5b60ff16815260200191505060405180910390f35b341561045f57600080fd5b610467610da6565b6040518082815260200191505060405180910390f35b341561048857600080fd5b610490610dac565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104d05780820151818401526020810190506104b5565b50505050905090810190601f1680156104fd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561051657600080fd5b61051e610e4a565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b341561054b57600080fd5b610577600480803515159060200190919080359060200190820180359060200191909192905050610e60565b005b341561058457600080fd5b61058c610f81565b005b341561059957600080fd5b6105a1611045565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105ee57600080fd5b6105f661106b565b6040518082600281111561060657fe5b60ff16815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106b05780601f10610685576101008083540402835291602001916106b0565b820191906000526020600020905b81548152906001019060200180831161069357829003601f168201915b505050505081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561071457600080fd5b600180600381111561072257fe5b6000809054906101000a900460ff16600381111561073c57fe5b14151561074857600080fd5b600360189054906101000a900463ffffffff1663ffffffff168463ffffffff161115151561077557600080fd5b6007544203603c850263ffffffff161115151561079157600080fd5b836003601c6101000a81548163ffffffff021916908363ffffffff1602179055508282600491906107c3929190611133565b504260068190555050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561082f57600080fd5b600180600381111561083d57fe5b6000809054906101000a900460ff16600381111561085757fe5b14151561086357600080fd5b60026000806101000a81548160ff0219169083600381111561088157fe5b02179055504260088190555042600681905550603c6003601c9054906101000a900463ffffffff1663ffffffff16600554028115156108bc57fe5b0491506009548211156108d157816009819055505b5050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806109a65750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156109b157600080fd5b426006819055506109c0610a71565b90506000811115610a3e57600160028111156109d857fe5b6109e061106b565b60028111156109eb57fe5b14156109fd5780600a5401600a819055505b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610a3d57600080fd5b5b50565b6000603c600360189054906101000a900463ffffffff1663ffffffff1660055402811515610a6b57fe5b04905090565b6000806000806003811115610a8257fe5b6000809054906101000a900460ff166003811115610a9c57fe5b1415610aab5760009250610bf1565b610ab361106b565b915060006002811115610ac257fe5b826002811115610ace57fe5b1415610add5760009250610bf1565b600a5460095410151515610aed57fe5b600a5460095403905060016002811115610b0357fe5b826002811115610b0f57fe5b1415610b1d57809250610bf1565b600280811115610b2957fe5b826002811115610b3557fe5b1415610be65760026003811115610b4857fe5b6000809054906101000a900460ff166003811115610b6257fe5b14158015610b945750600380811115610b7757fe5b6000809054906101000a900460ff166003811115610b9157fe5b14155b15610ba25760009250610bf1565b803073ffffffffffffffffffffffffffffffffffffffff163110151515610bc557fe5b803073ffffffffffffffffffffffffffffffffffffffff1631039250610bf1565b60001515610bf057fe5b5b505090565b600181565b60055481565b6003601c9054906101000a900463ffffffff1681565b60065481565b60075481565b600080610c2e610a41565b90506103e8600360149054906101000a900463ffffffff1663ffffffff168202811515610c5757fe5b0491505090565b600360149054906101000a900463ffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cd057600080fd5b6000806003811115610cde57fe5b6000809054906101000a900460ff166003811115610cf857fe5b141515610d0457600080fd5b603c600360189054906101000a900463ffffffff1663ffffffff1660055402811515610d2c57fe5b043073ffffffffffffffffffffffffffffffffffffffff163110151515610d5257600080fd5b60016000806101000a81548160ff02191690836003811115610d7057fe5b0217905550610d7d610c23565b600981905550426007819055504260068190555050565b6000809054906101000a900460ff1681565b60085481565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e425780601f10610e1757610100808354040283529160200191610e42565b820191906000526020600020905b815481529060010190602001808311610e2557829003601f168201915b505050505081565b600360189054906101000a900463ffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610f095750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610f1457600080fd5b60026003811115610f2157fe5b6000809054906101000a900460ff166003811115610f3b57fe5b1480610f6a5750600380811115610f4e57fe5b6000809054906101000a900460ff166003811115610f6857fe5b145b1515610f7557600080fd5b42600681905550505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fdd57600080fd5b6001806003811115610feb57fe5b6000809054906101000a900460ff16600381111561100557fe5b14151561101157600080fd5b60036000806101000a81548160ff0219169083600381111561102f57fe5b0217905550426008819055504260068190555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156110cc5760029050611130565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561112b5760019050611130565b600090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061117457803560ff19168380011785556111a2565b828001600101855582156111a2579182015b828111156111a1578235825591602001919060010190611186565b5b5090506111af91906111b3565b5090565b6111d591905b808211156111d15760008160009055506001016111b9565b5090565b905600a165627a7a7230582047884932d24cb307e5c226092c7410116103b2f7bdec110db9304f8e9a46b67b0029", + "sourceMap": "26:4288:1:-;;;241:13;220:34;;;;;;;;;;;;;;;;;;;;;;;;;;642:3;608:37;;743:1;708:36;;782:1;748:35;;788:472;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;993:4;965:24;:32;;;;957:41;;;;;;;;1030:10;1012:28;;:14;:28;;;;1004:37;;;;;;;;1054:5;1047:4;:12;;;;;;;;;;;;:::i;:::-;;1081:14;1065:13;;:30;;;;;;;;;;;;;;;;;;1121:10;1101:17;;:30;;;;;;;;;;;;;;;;;;1150:11;1137:10;:24;;;;1184:15;1167:14;;:32;;;;;;;;;;;;;;;;;;1231:24;1205:23;;:50;;;;;;;;;;;;;;;;;;788:472;;;;;26:4288;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;", + "deployedSourceMap": "26:4288:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;258:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3047:318:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3369:303;;;;;;;;;;;;;;281:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3827:292;;;;;;;;;;;;;;2277:105;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2386:657;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;181:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;578:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;424:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;608:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;649:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2123:150;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;350:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1629:259;;;;;;220:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;681:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;542:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;391:28:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4123:188;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3676:147;;;;;;;;;;;;;;313:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1892:227;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;258:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;3047:318::-;1318:17;;;;;;;;;;;1304:31;;:10;:31;;;1296:40;;;;;;;;3141:12;1606:6;1597:15;;;;;;;;:5;;;;;;;;;;;:15;;;;;;;;;1589:24;;;;;;;;3195:14;;;;;;;;;;;3180:29;;:11;:29;;;;3172:38;;;;;;;;3250:13;;3244:3;:19;3238:2;3224:11;:16;:39;;;;3216:48;;;;;;;;3288:11;3270:15;;:29;;;;;;;;;;;;;;;;;;3325:7;;3305:17;:27;;;;;;;:::i;:::-;;3357:3;3338:16;:22;;;;1342:1;3047:318;;;:::o;3369:303::-;3518:21;1402:13;;;;;;;;;;;1388:27;;:10;:27;;;1380:36;;;;;;;;3413:12;1606:6;1597:15;;;;;;;;:5;;;;;;;;;;;:15;;;;;;;;;1589:24;;;;;;;;3450:14;3442:5;;:22;;;;;;;;;;;;;;;;;;;;;;;;3480:3;3470:7;:13;;;;3508:3;3489:16;:22;;;;3575:2;3556:15;;;;;;;;;;;3543:28;;:10;;:28;3542:35;;;;;;;;3518:59;;3603:16;;3587:13;:32;3583:85;;;3648:13;3629:16;:32;;;;3583:85;1422:1;3369:303;:::o;281:28::-;;;;;;;;;;;;;:::o;3827:292::-;3902:16;1483:17;;;;;;;;;;;1469:31;;:10;:31;;;:62;;;;1518:13;;;;;;;;;;;1504:27;;:10;:27;;;1469:62;1461:71;;;;;;;;3893:3;3874:16;:22;;;;3921;:20;:22::i;:::-;3902:41;;3964:1;3953:8;:12;3949:166;;;3992:15;3979:28;;;;;;;;:9;:7;:9::i;:::-;:28;;;;;;;;;3975:97;;;4055:8;4037:15;;:26;4019:15;:44;;;;3975:97;4079:10;:19;;:29;4099:8;4079:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3949:166;3827:292;:::o;2277:105::-;2321:7;2375:2;2357:14;;;;;;;;;;;2344:27;;:10;;:27;2343:34;;;;;;;;2336:41;;2277:105;:::o;2386:657::-;2439:4;2508:9;2641:29;2464:13;2455:22;;;;;;;;:5;;;;;;;;;;;:22;;;;;;;;;2451:51;;;2494:1;2487:8;;;;2451:51;2520:9;:7;:9::i;:::-;2508:21;;2548:13;2540:21;;;;;;;;:4;:21;;;;;;;;;2536:50;;;2578:1;2571:8;;;;2536:50;2619:15;;2599:16;;:35;;2592:43;;;;;;2692:15;;2673:16;;:34;2641:66;;2726:15;2718:23;;;;;;;;:4;:23;;;;;;;;;2714:72;;;2758:21;2751:28;;;;2714:72;2804:11;2796:19;;;;;;;;:4;:19;;;;;;;;;2792:227;;;2838:14;2829:23;;;;;;;;:5;;;;;;;;;;;:23;;;;;;;;;;:51;;;;;2865:15;2856:24;;;;;;;;:5;;;;;;;;;;;:24;;;;;;;;;;2829:51;2825:84;;;2899:1;2892:8;;;;2825:84;2939:21;2923:4;:12;;;:37;;2916:45;;;;;;2991:21;2976:4;:12;;;:36;2969:43;;;;2792:227;3032:5;3025:13;;;;;;2386:657;;;;:::o;181:34::-;214:1;181:34;:::o;578:25::-;;;;:::o;424:29::-;;;;;;;;;;;;;:::o;608:37::-;;;;:::o;649:28::-;;;;:::o;2123:150::-;2165:7;2180:16;2199:13;:11;:13::i;:::-;2180:32;;2264:4;2237:23;;;;;;;;;;;2226:34;;:8;:34;2225:43;;;;;;;;2218:50;;2123:150;;:::o;350:37::-;;;;;;;;;;;;;:::o;1629:259::-;1402:13;;;;;;;;;;;1388:27;;:10;:27;;;1380:36;;;;;;;;1671:13;1606:6;1597:15;;;;;;;;:5;;;;;;;;;;;:15;;;;;;;;;1589:24;;;;;;;;1765:2;1747:14;;;;;;;;;;;1734:27;;:10;;:27;1733:34;;;;;;;;1717:4;:12;;;:50;;1709:59;;;;;;;;1782:12;1774:5;;:20;;;;;;;;;;;;;;;;;;;;;;;;1819:11;:9;:11::i;:::-;1800:16;:30;;;;1852:3;1836:13;:19;;;;1880:3;1861:16;:22;;;;1422:1;1629:259::o;220:34::-;;;;;;;;;;;;;:::o;681:22::-;;;;:::o;542:31::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;391:28::-;;;;;;;;;;;;;:::o;4123:188::-;1483:17;;;;;;;;;;;1469:31;;:10;:31;;;:62;;;;1518:13;;;;;;;;;;;1504:27;;:10;:27;;;1469:62;1461:71;;;;;;;;4223:14;4214:23;;;;;;;;:5;;;;;;;;;;;:23;;;;;;;;;:51;;;;4250:15;4241:24;;;;;;;;:5;;;;;;;;;;;:24;;;;;;;;;4214:51;4206:60;;;;;;;;4303:3;4284:16;:22;;;;4123:188;;;:::o;3676:147::-;1402:13;;;;;;;;;;;1388:27;;:10;:27;;;1380:36;;;;;;;;3719:12;1606:6;1597:15;;;;;;;;:5;;;;;;;;;;;:15;;;;;;;;;1589:24;;;;;;;;3756:15;3748:5;;:23;;;;;;;;;;;;;;;;;;;;;;;;3787:3;3777:7;:13;;;;3815:3;3796:16;:22;;;;1422:1;3676:147::o;313:32::-;;;;;;;;;;;;;:::o;1892:227::-;1932:4;1962:13;;;;;;;;;;;1948:27;;:10;:27;;;1944:66;;;1992:11;1985:18;;;;1944:66;2033:17;;;;;;;;;;;2019:31;;:10;:31;;;2015:74;;;2067:15;2060:22;;;;2015:74;2101:13;2094:20;;1892:227;;:::o;26:4288::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o", + "source": "pragma solidity ^0.4.18;\n\ncontract Project {\n\n enum State {\n Created,\n Active,\n Approved,\n Cancelled\n }\n\n enum Role {\n Stranger,\n Contractor,\n Client\n }\n\n uint16 public constant version = 1;\n\n State public state = State.Created;\n string public name;\n\n address public clientAddress;\n address public contractorAddress;\n\n uint32 public prepayFractionThousands;\n uint32 public timeCapMinutes;\n\n uint32 public minutesReported;\n\n // making this public breaks Solidity compiler so it starts to output invalid ABI\n string public contractorComment;\n\n uint256 public hourlyRate;\n\n uint256 public lastActivityDate = now;\n uint256 public executionDate;\n uint256 public endDate;\n\n uint256 private contractorCredit = 0;\n uint256 private contractorDebit = 0;\n\n function Project(\n string _name,\n address _clientAddress,\n uint256 _hourlyRate,\n uint32 _timeCapMinutes,\n uint32 _prepayFractionThousands)\n public {\n require(_prepayFractionThousands <= 1000);\n require(_clientAddress != msg.sender);\n name = _name;\n clientAddress = _clientAddress;\n contractorAddress = msg.sender;\n hourlyRate = _hourlyRate;\n timeCapMinutes = _timeCapMinutes;\n prepayFractionThousands = _prepayFractionThousands;\n }\n\n modifier onlyContractor() {\n require(msg.sender == contractorAddress);\n _;\n }\n\n modifier onlyClient() {\n require(msg.sender == clientAddress);\n _;\n }\n\n modifier onlyParties() {\n require(msg.sender == contractorAddress || msg.sender == clientAddress);\n _;\n }\n\n modifier onlyAtState(State _state) {\n require(state == _state);\n _;\n }\n\n function start() onlyClient() onlyAtState(State.Created) external payable {\n require(this.balance >= (hourlyRate * timeCapMinutes) / 60);\n state = State.Active;\n contractorCredit = getPrepay();\n executionDate = now;\n lastActivityDate = now;\n }\n\n function getRole() public view returns (Role) {\n if (msg.sender == clientAddress) {\n return Role.Client;\n }\n if (msg.sender == contractorAddress) {\n return Role.Contractor;\n }\n return Role.Stranger;\n }\n\n function getPrepay() public view returns (uint256) {\n uint256 priceCap = getPriceCap();\n return (priceCap * prepayFractionThousands) / 1000;\n }\n\n function getPriceCap() public view returns (uint256) {\n return (hourlyRate * timeCapMinutes) / 60;\n }\n\n function availableForWithdraw() public view returns (uint) {\n if (state == State.Created) {\n return 0;\n }\n\n Role role = getRole();\n\n if (role == Role.Stranger) {\n return 0;\n }\n\n assert(contractorCredit >= contractorDebit);\n uint256 availableToContractor = contractorCredit - contractorDebit;\n\n if (role == Role.Contractor) {\n return availableToContractor;\n }\n\n if (role == Role.Client) {\n if (state != State.Approved && state != State.Cancelled) {\n return 0;\n }\n assert(this.balance >= availableToContractor);\n return this.balance - availableToContractor;\n }\n\n assert(false);\n }\n\n function setBillableTime(uint32 timeMinutes, string comment)\n onlyContractor() onlyAtState(State.Active)\n external {\n require(timeMinutes <= timeCapMinutes);\n require(timeMinutes * 60 <= now - executionDate);\n minutesReported = timeMinutes;\n contractorComment = comment;\n lastActivityDate = now;\n }\n\n function approve() onlyClient() onlyAtState(State.Active) external {\n state = State.Approved;\n endDate = now;\n lastActivityDate = now;\n\n uint256 approvedPrice = (hourlyRate * minutesReported) / 60;\n if (approvedPrice > contractorCredit) {\n contractorCredit = approvedPrice;\n }\n }\n\n function cancel() onlyClient() onlyAtState(State.Active) external {\n state = State.Cancelled;\n endDate = now;\n lastActivityDate = now;\n }\n\n function withdraw() onlyParties() public {\n lastActivityDate = now;\n uint256 toBeSent = availableForWithdraw();\n if (toBeSent > 0) {\n if (getRole() == Role.Contractor) {\n contractorDebit = contractorDebit + toBeSent;\n }\n msg.sender.transfer(toBeSent);\n }\n }\n\n function leaveFeedback(bool positive, string comment) onlyParties() external {\n require(state == State.Approved || state == State.Cancelled);\n // TODO\n lastActivityDate = now;\n }\n\n}\n", "sourcePath": "/Users/sam/dev/projects/append-only-log/hackathon/contracts/Project.sol", "ast": { "attributes": { "absolutePath": "/Users/sam/dev/projects/append-only-log/hackathon/contracts/Project.sol", "exportedSymbols": { "Project": [ - 483 + 559 ] } }, @@ -380,10 +380,10 @@ "documentation": null, "fullyImplemented": true, "linearizedBaseContracts": [ - 483 + 559 ], "name": "Project", - "scope": 484 + "scope": 560 }, "children": [ { @@ -468,7 +468,7 @@ "attributes": { "constant": true, "name": "version", - "scope": 483, + "scope": 559, "stateVariable": true, "storageLocation": "default", "type": "uint16", @@ -510,11 +510,10 @@ "attributes": { "constant": false, "name": "state", - "scope": 483, + "scope": 559, "stateVariable": true, "storageLocation": "default", "type": "enum Project.State", - "value": null, "visibility": "public" }, "children": [ @@ -528,17 +527,48 @@ "id": 71, "name": "UserDefinedTypeName", "src": "220:5:1" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "member_name": "Created", + "referencedDeclaration": null, + "type": "enum Project.State" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 63, + "type": "type(enum Project.State)", + "value": "State" + }, + "id": 72, + "name": "Identifier", + "src": "241:5:1" + } + ], + "id": 73, + "name": "MemberAccess", + "src": "241:13:1" } ], - "id": 72, + "id": 74, "name": "VariableDeclaration", - "src": "220:18:1" + "src": "220:34:1" }, { "attributes": { "constant": false, "name": "name", - "scope": 483, + "scope": 559, "stateVariable": true, "storageLocation": "default", "type": "string storage ref", @@ -551,20 +581,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 73, + "id": 75, "name": "ElementaryTypeName", - "src": "242:6:1" + "src": "258:6:1" } ], - "id": 74, + "id": 76, "name": "VariableDeclaration", - "src": "242:18:1" + "src": "258:18:1" }, { "attributes": { "constant": false, "name": "clientAddress", - "scope": 483, + "scope": 559, "stateVariable": true, "storageLocation": "default", "type": "address", @@ -577,20 +607,20 @@ "name": "address", "type": "address" }, - "id": 75, + "id": 77, "name": "ElementaryTypeName", - "src": "265:7:1" + "src": "281:7:1" } ], - "id": 76, + "id": 78, "name": "VariableDeclaration", - "src": "265:28:1" + "src": "281:28:1" }, { "attributes": { "constant": false, "name": "contractorAddress", - "scope": 483, + "scope": 559, "stateVariable": true, "storageLocation": "default", "type": "address", @@ -603,20 +633,20 @@ "name": "address", "type": "address" }, - "id": 77, + "id": 79, "name": "ElementaryTypeName", - "src": "297:7:1" + "src": "313:7:1" } ], - "id": 78, + "id": 80, "name": "VariableDeclaration", - "src": "297:32:1" + "src": "313:32:1" }, { "attributes": { "constant": false, "name": "prepayFractionThousands", - "scope": 483, + "scope": 559, "stateVariable": true, "storageLocation": "default", "type": "uint32", @@ -629,20 +659,20 @@ "name": "uint32", "type": "uint32" }, - "id": 79, + "id": 81, "name": "ElementaryTypeName", - "src": "334:6:1" + "src": "350:6:1" } ], - "id": 80, + "id": 82, "name": "VariableDeclaration", - "src": "334:37:1" + "src": "350:37:1" }, { "attributes": { "constant": false, "name": "timeCapMinutes", - "scope": 483, + "scope": 559, "stateVariable": true, "storageLocation": "default", "type": "uint32", @@ -655,20 +685,20 @@ "name": "uint32", "type": "uint32" }, - "id": 81, + "id": 83, "name": "ElementaryTypeName", - "src": "375:6:1" + "src": "391:6:1" } ], - "id": 82, + "id": 84, "name": "VariableDeclaration", - "src": "375:28:1" + "src": "391:28:1" }, { "attributes": { "constant": false, "name": "minutesReported", - "scope": 483, + "scope": 559, "stateVariable": true, "storageLocation": "default", "type": "uint32", @@ -681,20 +711,20 @@ "name": "uint32", "type": "uint32" }, - "id": 83, + "id": 85, "name": "ElementaryTypeName", - "src": "408:6:1" + "src": "424:6:1" } ], - "id": 84, + "id": 86, "name": "VariableDeclaration", - "src": "408:29:1" + "src": "424:29:1" }, { "attributes": { "constant": false, "name": "contractorComment", - "scope": 483, + "scope": 559, "stateVariable": true, "storageLocation": "default", "type": "string storage ref", @@ -707,20 +737,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 85, + "id": 87, "name": "ElementaryTypeName", - "src": "526:6:1" + "src": "542:6:1" } ], - "id": 86, + "id": 88, "name": "VariableDeclaration", - "src": "526:31:1" + "src": "542:31:1" }, { "attributes": { "constant": false, "name": "hourlyRate", - "scope": 483, + "scope": 559, "stateVariable": true, "storageLocation": "default", "type": "uint256", @@ -733,20 +763,20 @@ "name": "uint256", "type": "uint256" }, - "id": 87, + "id": 89, "name": "ElementaryTypeName", - "src": "562:7:1" + "src": "578:7:1" } ], - "id": 88, + "id": 90, "name": "VariableDeclaration", - "src": "562:25:1" + "src": "578:25:1" }, { "attributes": { "constant": false, "name": "lastActivityDate", - "scope": 483, + "scope": 559, "stateVariable": true, "storageLocation": "default", "type": "uint256", @@ -758,9 +788,9 @@ "name": "uint256", "type": "uint256" }, - "id": 89, + "id": 91, "name": "ElementaryTypeName", - "src": "592:7:1" + "src": "608:7:1" }, { "attributes": { @@ -768,24 +798,24 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 497, + "referencedDeclaration": 573, "type": "uint256", "value": "now" }, - "id": 90, + "id": 92, "name": "Identifier", - "src": "626:3:1" + "src": "642:3:1" } ], - "id": 91, + "id": 93, "name": "VariableDeclaration", - "src": "592:37:1" + "src": "608:37:1" }, { "attributes": { "constant": false, "name": "executionDate", - "scope": 483, + "scope": 559, "stateVariable": true, "storageLocation": "default", "type": "uint256", @@ -798,20 +828,20 @@ "name": "uint256", "type": "uint256" }, - "id": 92, + "id": 94, "name": "ElementaryTypeName", - "src": "633:7:1" + "src": "649:7:1" } ], - "id": 93, + "id": 95, "name": "VariableDeclaration", - "src": "633:28:1" + "src": "649:28:1" }, { "attributes": { "constant": false, "name": "endDate", - "scope": 483, + "scope": 559, "stateVariable": true, "storageLocation": "default", "type": "uint256", @@ -824,20 +854,20 @@ "name": "uint256", "type": "uint256" }, - "id": 94, + "id": 96, "name": "ElementaryTypeName", - "src": "665:7:1" + "src": "681:7:1" } ], - "id": 95, + "id": 97, "name": "VariableDeclaration", - "src": "665:22:1" + "src": "681:22:1" }, { "attributes": { "constant": false, "name": "contractorCredit", - "scope": 483, + "scope": 559, "stateVariable": true, "storageLocation": "default", "type": "uint256", @@ -849,9 +879,9 @@ "name": "uint256", "type": "uint256" }, - "id": 96, + "id": 98, "name": "ElementaryTypeName", - "src": "692:7:1" + "src": "708:7:1" }, { "attributes": { @@ -866,20 +896,20 @@ "type": "int_const 0", "value": "0" }, - "id": 97, + "id": 99, "name": "Literal", - "src": "727:1:1" + "src": "743:1:1" } ], - "id": 98, + "id": 100, "name": "VariableDeclaration", - "src": "692:36:1" + "src": "708:36:1" }, { "attributes": { "constant": false, "name": "contractorDebit", - "scope": 483, + "scope": 559, "stateVariable": true, "storageLocation": "default", "type": "uint256", @@ -891,9 +921,9 @@ "name": "uint256", "type": "uint256" }, - "id": 99, + "id": 101, "name": "ElementaryTypeName", - "src": "732:7:1" + "src": "748:7:1" }, { "attributes": { @@ -908,14 +938,14 @@ "type": "int_const 0", "value": "0" }, - "id": 100, + "id": 102, "name": "Literal", - "src": "766:1:1" + "src": "782:1:1" } ], - "id": 101, + "id": 103, "name": "VariableDeclaration", - "src": "732:35:1" + "src": "748:35:1" }, { "attributes": { @@ -927,7 +957,7 @@ ], "name": "Project", "payable": false, - "scope": 483, + "scope": 559, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -939,7 +969,7 @@ "attributes": { "constant": false, "name": "_name", - "scope": 146, + "scope": 155, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -952,20 +982,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 102, + "id": 104, "name": "ElementaryTypeName", - "src": "794:6:1" + "src": "810:6:1" } ], - "id": 103, + "id": 105, "name": "VariableDeclaration", - "src": "794:12:1" + "src": "810:12:1" }, { "attributes": { "constant": false, "name": "_clientAddress", - "scope": 146, + "scope": 155, "stateVariable": false, "storageLocation": "default", "type": "address", @@ -978,20 +1008,20 @@ "name": "address", "type": "address" }, - "id": 104, + "id": 106, "name": "ElementaryTypeName", - "src": "812:7:1" + "src": "828:7:1" } ], - "id": 105, + "id": 107, "name": "VariableDeclaration", - "src": "812:22:1" + "src": "828:22:1" }, { "attributes": { "constant": false, "name": "_hourlyRate", - "scope": 146, + "scope": 155, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -1004,20 +1034,20 @@ "name": "uint256", "type": "uint256" }, - "id": 106, + "id": 108, "name": "ElementaryTypeName", - "src": "840:7:1" + "src": "856:7:1" } ], - "id": 107, + "id": 109, "name": "VariableDeclaration", - "src": "840:19:1" + "src": "856:19:1" }, { "attributes": { "constant": false, "name": "_timeCapMinutes", - "scope": 146, + "scope": 155, "stateVariable": false, "storageLocation": "default", "type": "uint32", @@ -1030,20 +1060,20 @@ "name": "uint32", "type": "uint32" }, - "id": 108, + "id": 110, "name": "ElementaryTypeName", - "src": "865:6:1" + "src": "881:6:1" } ], - "id": 109, + "id": 111, "name": "VariableDeclaration", - "src": "865:22:1" + "src": "881:22:1" }, { "attributes": { "constant": false, "name": "_prepayFractionThousands", - "scope": 146, + "scope": 155, "stateVariable": false, "storageLocation": "default", "type": "uint32", @@ -1056,19 +1086,19 @@ "name": "uint32", "type": "uint32" }, - "id": 110, + "id": 112, "name": "ElementaryTypeName", - "src": "893:6:1" + "src": "909:6:1" } ], - "id": 111, + "id": 113, "name": "VariableDeclaration", - "src": "893:31:1" + "src": "909:31:1" } ], - "id": 112, + "id": 114, "name": "ParameterList", - "src": "788:137:1" + "src": "804:137:1" }, { "attributes": { @@ -1077,9 +1107,9 @@ ] }, "children": [], - "id": 113, + "id": 115, "name": "ParameterList", - "src": "935:0:1" + "src": "951:0:1" }, { "children": [ @@ -1111,13 +1141,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 498, + "referencedDeclaration": 574, "type": "function (bool) pure", "value": "require" }, - "id": 114, + "id": 116, "name": "Identifier", - "src": "941:7:1" + "src": "957:7:1" }, { "attributes": { @@ -1140,13 +1170,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 111, + "referencedDeclaration": 113, "type": "uint32", "value": "_prepayFractionThousands" }, - "id": 115, + "id": 117, "name": "Identifier", - "src": "949:24:1" + "src": "965:24:1" }, { "attributes": { @@ -1161,24 +1191,135 @@ "type": "int_const 1000", "value": "1000" }, - "id": 116, + "id": 118, "name": "Literal", - "src": "977:4:1" + "src": "993:4:1" + } + ], + "id": 119, + "name": "BinaryOperation", + "src": "965:32:1" + } + ], + "id": 120, + "name": "FunctionCall", + "src": "957:41:1" + } + ], + "id": 121, + "name": "ExpressionStatement", + "src": "957:41:1" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "tuple()", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 574, + "type": "function (bool) pure", + "value": "require" + }, + "id": 122, + "name": "Identifier", + "src": "1004:7:1" + }, + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "!=", + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 107, + "type": "address", + "value": "_clientAddress" + }, + "id": 123, + "name": "Identifier", + "src": "1012:14:1" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "sender", + "referencedDeclaration": null, + "type": "address" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 571, + "type": "msg", + "value": "msg" + }, + "id": 124, + "name": "Identifier", + "src": "1030:3:1" + } + ], + "id": 125, + "name": "MemberAccess", + "src": "1030:10:1" } ], - "id": 117, + "id": 126, "name": "BinaryOperation", - "src": "949:32:1" + "src": "1012:28:1" } ], - "id": 118, + "id": 127, "name": "FunctionCall", - "src": "941:41:1" + "src": "1004:37:1" } ], - "id": 119, + "id": 128, "name": "ExpressionStatement", - "src": "941:41:1" + "src": "1004:37:1" }, { "children": [ @@ -1199,13 +1340,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 74, + "referencedDeclaration": 76, "type": "string storage ref", "value": "name" }, - "id": 120, + "id": 129, "name": "Identifier", - "src": "988:4:1" + "src": "1047:4:1" }, { "attributes": { @@ -1213,23 +1354,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 103, + "referencedDeclaration": 105, "type": "string memory", "value": "_name" }, - "id": 121, + "id": 130, "name": "Identifier", - "src": "995:5:1" + "src": "1054:5:1" } ], - "id": 122, + "id": 131, "name": "Assignment", - "src": "988:12:1" + "src": "1047:12:1" } ], - "id": 123, + "id": 132, "name": "ExpressionStatement", - "src": "988:12:1" + "src": "1047:12:1" }, { "children": [ @@ -1250,13 +1391,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 76, + "referencedDeclaration": 78, "type": "address", "value": "clientAddress" }, - "id": 124, + "id": 133, "name": "Identifier", - "src": "1006:13:1" + "src": "1065:13:1" }, { "attributes": { @@ -1264,23 +1405,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 105, + "referencedDeclaration": 107, "type": "address", "value": "_clientAddress" }, - "id": 125, + "id": 134, "name": "Identifier", - "src": "1022:14:1" + "src": "1081:14:1" } ], - "id": 126, + "id": 135, "name": "Assignment", - "src": "1006:30:1" + "src": "1065:30:1" } ], - "id": 127, + "id": 136, "name": "ExpressionStatement", - "src": "1006:30:1" + "src": "1065:30:1" }, { "children": [ @@ -1292,7 +1433,7 @@ "isPure": false, "lValueRequested": false, "operator": "=", - "type": "uint256" + "type": "address" }, "children": [ { @@ -1301,37 +1442,54 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 88, - "type": "uint256", - "value": "hourlyRate" + "referencedDeclaration": 80, + "type": "address", + "value": "contractorAddress" }, - "id": 128, + "id": 137, "name": "Identifier", - "src": "1042:10:1" + "src": "1101:17:1" }, { "attributes": { "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 107, - "type": "uint256", - "value": "_hourlyRate" + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "sender", + "referencedDeclaration": null, + "type": "address" }, - "id": 129, - "name": "Identifier", - "src": "1055:11:1" + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 571, + "type": "msg", + "value": "msg" + }, + "id": 138, + "name": "Identifier", + "src": "1121:3:1" + } + ], + "id": 139, + "name": "MemberAccess", + "src": "1121:10:1" } ], - "id": 130, + "id": 140, "name": "Assignment", - "src": "1042:24:1" + "src": "1101:30:1" } ], - "id": 131, + "id": 141, "name": "ExpressionStatement", - "src": "1042:24:1" + "src": "1101:30:1" }, { "children": [ @@ -1343,7 +1501,7 @@ "isPure": false, "lValueRequested": false, "operator": "=", - "type": "uint32" + "type": "uint256" }, "children": [ { @@ -1352,13 +1510,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 82, - "type": "uint32", - "value": "timeCapMinutes" + "referencedDeclaration": 90, + "type": "uint256", + "value": "hourlyRate" }, - "id": 132, + "id": 142, "name": "Identifier", - "src": "1072:14:1" + "src": "1137:10:1" }, { "attributes": { @@ -1367,22 +1525,22 @@ null ], "referencedDeclaration": 109, - "type": "uint32", - "value": "_timeCapMinutes" + "type": "uint256", + "value": "_hourlyRate" }, - "id": 133, + "id": 143, "name": "Identifier", - "src": "1089:15:1" + "src": "1150:11:1" } ], - "id": 134, + "id": 144, "name": "Assignment", - "src": "1072:32:1" + "src": "1137:24:1" } ], - "id": 135, + "id": 145, "name": "ExpressionStatement", - "src": "1072:32:1" + "src": "1137:24:1" }, { "children": [ @@ -1403,13 +1561,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 80, + "referencedDeclaration": 84, "type": "uint32", - "value": "prepayFractionThousands" + "value": "timeCapMinutes" }, - "id": 136, + "id": 146, "name": "Identifier", - "src": "1110:23:1" + "src": "1167:14:1" }, { "attributes": { @@ -1419,21 +1577,21 @@ ], "referencedDeclaration": 111, "type": "uint32", - "value": "_prepayFractionThousands" + "value": "_timeCapMinutes" }, - "id": 137, + "id": 147, "name": "Identifier", - "src": "1136:24:1" + "src": "1184:15:1" } ], - "id": 138, + "id": 148, "name": "Assignment", - "src": "1110:50:1" + "src": "1167:32:1" } ], - "id": 139, + "id": 149, "name": "ExpressionStatement", - "src": "1110:50:1" + "src": "1167:32:1" }, { "children": [ @@ -1445,7 +1603,7 @@ "isPure": false, "lValueRequested": false, "operator": "=", - "type": "address" + "type": "uint32" }, "children": [ { @@ -1454,64 +1612,47 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 78, - "type": "address", - "value": "contractorAddress" + "referencedDeclaration": 82, + "type": "uint32", + "value": "prepayFractionThousands" }, - "id": 140, + "id": 150, "name": "Identifier", - "src": "1166:17:1" + "src": "1205:23:1" }, { "attributes": { "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "sender", - "referencedDeclaration": null, - "type": "address" + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 113, + "type": "uint32", + "value": "_prepayFractionThousands" }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 495, - "type": "msg", - "value": "msg" - }, - "id": 141, - "name": "Identifier", - "src": "1186:3:1" - } - ], - "id": 142, - "name": "MemberAccess", - "src": "1186:10:1" + "id": 151, + "name": "Identifier", + "src": "1231:24:1" } ], - "id": 143, + "id": 152, "name": "Assignment", - "src": "1166:30:1" + "src": "1205:50:1" } ], - "id": 144, + "id": 153, "name": "ExpressionStatement", - "src": "1166:30:1" + "src": "1205:50:1" } ], - "id": 145, + "id": 154, "name": "Block", - "src": "935:266:1" + "src": "951:309:1" } ], - "id": 146, + "id": 155, "name": "FunctionDefinition", - "src": "772:429:1" + "src": "788:472:1" }, { "attributes": { @@ -1526,9 +1667,9 @@ ] }, "children": [], - "id": 147, + "id": 156, "name": "ParameterList", - "src": "1228:2:1" + "src": "1287:2:1" }, { "children": [ @@ -1560,13 +1701,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 498, + "referencedDeclaration": 574, "type": "function (bool) pure", "value": "require" }, - "id": 148, + "id": 157, "name": "Identifier", - "src": "1237:7:1" + "src": "1296:7:1" }, { "attributes": { @@ -1601,18 +1742,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 495, + "referencedDeclaration": 571, "type": "msg", "value": "msg" }, - "id": 149, + "id": 158, "name": "Identifier", - "src": "1245:3:1" + "src": "1304:3:1" } ], - "id": 150, + "id": 159, "name": "MemberAccess", - "src": "1245:10:1" + "src": "1304:10:1" }, { "attributes": { @@ -1620,43 +1761,43 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 78, + "referencedDeclaration": 80, "type": "address", "value": "contractorAddress" }, - "id": 151, + "id": 160, "name": "Identifier", - "src": "1259:17:1" + "src": "1318:17:1" } ], - "id": 152, + "id": 161, "name": "BinaryOperation", - "src": "1245:31:1" + "src": "1304:31:1" } ], - "id": 153, + "id": 162, "name": "FunctionCall", - "src": "1237:40:1" + "src": "1296:40:1" } ], - "id": 154, + "id": 163, "name": "ExpressionStatement", - "src": "1237:40:1" + "src": "1296:40:1" }, { - "id": 155, + "id": 164, "name": "PlaceholderStatement", - "src": "1283:1:1" + "src": "1342:1:1" } ], - "id": 156, + "id": 165, "name": "Block", - "src": "1231:58:1" + "src": "1290:58:1" } ], - "id": 157, + "id": 166, "name": "ModifierDefinition", - "src": "1205:84:1" + "src": "1264:84:1" }, { "attributes": { @@ -1671,9 +1812,9 @@ ] }, "children": [], - "id": 158, + "id": 167, "name": "ParameterList", - "src": "1312:2:1" + "src": "1371:2:1" }, { "children": [ @@ -1705,13 +1846,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 498, + "referencedDeclaration": 574, "type": "function (bool) pure", "value": "require" }, - "id": 159, + "id": 168, "name": "Identifier", - "src": "1321:7:1" + "src": "1380:7:1" }, { "attributes": { @@ -1746,18 +1887,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 495, + "referencedDeclaration": 571, "type": "msg", "value": "msg" }, - "id": 160, + "id": 169, "name": "Identifier", - "src": "1329:3:1" + "src": "1388:3:1" } ], - "id": 161, + "id": 170, "name": "MemberAccess", - "src": "1329:10:1" + "src": "1388:10:1" }, { "attributes": { @@ -1765,43 +1906,273 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 76, + "referencedDeclaration": 78, "type": "address", "value": "clientAddress" }, - "id": 162, + "id": 171, "name": "Identifier", - "src": "1343:13:1" + "src": "1402:13:1" } ], - "id": 163, + "id": 172, "name": "BinaryOperation", - "src": "1329:27:1" + "src": "1388:27:1" } ], - "id": 164, + "id": 173, "name": "FunctionCall", - "src": "1321:36:1" + "src": "1380:36:1" } ], - "id": 165, + "id": 174, "name": "ExpressionStatement", - "src": "1321:36:1" + "src": "1380:36:1" }, { - "id": 166, + "id": 175, "name": "PlaceholderStatement", - "src": "1363:1:1" + "src": "1422:1:1" } ], - "id": 167, + "id": 176, + "name": "Block", + "src": "1374:54:1" + } + ], + "id": 177, + "name": "ModifierDefinition", + "src": "1352:76:1" + }, + { + "attributes": { + "name": "onlyParties", + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "parameters": [ + null + ] + }, + "children": [], + "id": 178, + "name": "ParameterList", + "src": "1452:2:1" + }, + { + "children": [ + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "tuple()", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 574, + "type": "function (bool) pure", + "value": "require" + }, + "id": 179, + "name": "Identifier", + "src": "1461:7:1" + }, + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "||", + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "==", + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "sender", + "referencedDeclaration": null, + "type": "address" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 571, + "type": "msg", + "value": "msg" + }, + "id": 180, + "name": "Identifier", + "src": "1469:3:1" + } + ], + "id": 181, + "name": "MemberAccess", + "src": "1469:10:1" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 80, + "type": "address", + "value": "contractorAddress" + }, + "id": 182, + "name": "Identifier", + "src": "1483:17:1" + } + ], + "id": 183, + "name": "BinaryOperation", + "src": "1469:31:1" + }, + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "==", + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "sender", + "referencedDeclaration": null, + "type": "address" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 571, + "type": "msg", + "value": "msg" + }, + "id": 184, + "name": "Identifier", + "src": "1504:3:1" + } + ], + "id": 185, + "name": "MemberAccess", + "src": "1504:10:1" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 78, + "type": "address", + "value": "clientAddress" + }, + "id": 186, + "name": "Identifier", + "src": "1518:13:1" + } + ], + "id": 187, + "name": "BinaryOperation", + "src": "1504:27:1" + } + ], + "id": 188, + "name": "BinaryOperation", + "src": "1469:62:1" + } + ], + "id": 189, + "name": "FunctionCall", + "src": "1461:71:1" + } + ], + "id": 190, + "name": "ExpressionStatement", + "src": "1461:71:1" + }, + { + "id": 191, + "name": "PlaceholderStatement", + "src": "1538:1:1" + } + ], + "id": 192, "name": "Block", - "src": "1315:54:1" + "src": "1455:89:1" } ], - "id": 168, + "id": 193, "name": "ModifierDefinition", - "src": "1293:76:1" + "src": "1432:112:1" }, { "attributes": { @@ -1815,7 +2186,7 @@ "attributes": { "constant": false, "name": "_state", - "scope": 180, + "scope": 205, "stateVariable": false, "storageLocation": "default", "type": "enum Project.State", @@ -1830,19 +2201,19 @@ "referencedDeclaration": 63, "type": "enum Project.State" }, - "id": 169, + "id": 194, "name": "UserDefinedTypeName", - "src": "1394:5:1" + "src": "1569:5:1" } ], - "id": 170, + "id": 195, "name": "VariableDeclaration", - "src": "1394:12:1" + "src": "1569:12:1" } ], - "id": 171, + "id": 196, "name": "ParameterList", - "src": "1393:14:1" + "src": "1568:14:1" }, { "children": [ @@ -1874,13 +2245,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 498, + "referencedDeclaration": 574, "type": "function (bool) pure", "value": "require" }, - "id": 172, + "id": 197, "name": "Identifier", - "src": "1414:7:1" + "src": "1589:7:1" }, { "attributes": { @@ -1903,13 +2274,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 72, + "referencedDeclaration": 74, "type": "enum Project.State", "value": "state" }, - "id": 173, + "id": 198, "name": "Identifier", - "src": "1422:5:1" + "src": "1597:5:1" }, { "attributes": { @@ -1917,43 +2288,43 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 170, + "referencedDeclaration": 195, "type": "enum Project.State", "value": "_state" }, - "id": 174, + "id": 199, "name": "Identifier", - "src": "1431:6:1" + "src": "1606:6:1" } ], - "id": 175, + "id": 200, "name": "BinaryOperation", - "src": "1422:15:1" + "src": "1597:15:1" } ], - "id": 176, + "id": 201, "name": "FunctionCall", - "src": "1414:24:1" + "src": "1589:24:1" } ], - "id": 177, + "id": 202, "name": "ExpressionStatement", - "src": "1414:24:1" + "src": "1589:24:1" }, { - "id": 178, + "id": 203, "name": "PlaceholderStatement", - "src": "1444:1:1" + "src": "1619:1:1" } ], - "id": 179, + "id": 204, "name": "Block", - "src": "1408:42:1" + "src": "1583:42:1" } ], - "id": 180, + "id": 205, "name": "ModifierDefinition", - "src": "1373:77:1" + "src": "1548:77:1" }, { "attributes": { @@ -1962,7 +2333,7 @@ "isConstructor": false, "name": "start", "payable": true, - "scope": 483, + "scope": 559, "stateMutability": "payable", "superFunction": null, "visibility": "external" @@ -1975,9 +2346,9 @@ ] }, "children": [], - "id": 181, + "id": 206, "name": "ParameterList", - "src": "1468:2:1" + "src": "1643:2:1" }, { "attributes": { @@ -1986,9 +2357,9 @@ ] }, "children": [], - "id": 188, + "id": 213, "name": "ParameterList", - "src": "1526:0:1" + "src": "1703:0:1" }, { "attributes": { @@ -2003,18 +2374,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 168, + "referencedDeclaration": 177, "type": "modifier ()", "value": "onlyClient" }, - "id": 182, + "id": 207, "name": "Identifier", - "src": "1488:10:1" + "src": "1646:10:1" } ], - "id": 183, + "id": 208, "name": "ModifierInvocation", - "src": "1488:10:1" + "src": "1646:12:1" }, { "children": [ @@ -2024,13 +2395,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 180, + "referencedDeclaration": 205, "type": "modifier (enum Project.State)", "value": "onlyAtState" }, - "id": 184, + "id": 209, "name": "Identifier", - "src": "1499:11:1" + "src": "1659:11:1" }, { "attributes": { @@ -2054,19 +2425,19 @@ "type": "type(enum Project.State)", "value": "State" }, - "id": 185, + "id": 210, "name": "Identifier", - "src": "1511:5:1" + "src": "1671:5:1" } ], - "id": 186, + "id": 211, "name": "MemberAccess", - "src": "1511:13:1" + "src": "1671:13:1" } ], - "id": 187, + "id": 212, "name": "ModifierInvocation", - "src": "1499:26:1" + "src": "1659:26:1" }, { "children": [ @@ -2078,65 +2449,263 @@ "isConstant": false, "isLValue": false, "isPure": false, + "isStructConstructorCall": false, "lValueRequested": false, - "operator": "=", - "type": "enum Project.State" + "names": [ + null + ], + "type": "tuple()", + "type_conversion": false }, "children": [ { "attributes": { - "argumentTypes": null, + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], "overloadedDeclarations": [ null ], - "referencedDeclaration": 72, - "type": "enum Project.State", - "value": "state" + "referencedDeclaration": 574, + "type": "function (bool) pure", + "value": "require" }, - "id": 189, + "id": 214, "name": "Identifier", - "src": "1600:5:1" + "src": "1709:7:1" }, { "attributes": { "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, "isConstant": false, "isLValue": false, - "isPure": true, + "isPure": false, "lValueRequested": false, - "member_name": "Active", - "referencedDeclaration": null, - "type": "enum Project.State" + "operator": ">=", + "type": "bool" }, "children": [ { "attributes": { "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 63, - "type": "type(enum Project.State)", - "value": "State" - }, - "id": 190, - "name": "Identifier", - "src": "1608:5:1" - } - ], - "id": 191, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "balance", + "referencedDeclaration": null, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 584, + "type": "contract Project", + "value": "this" + }, + "id": 215, + "name": "Identifier", + "src": "1717:4:1" + } + ], + "id": 216, + "name": "MemberAccess", + "src": "1717:12:1" + }, + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "/", + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "*", + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 90, + "type": "uint256", + "value": "hourlyRate" + }, + "id": 217, + "name": "Identifier", + "src": "1734:10:1" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 84, + "type": "uint32", + "value": "timeCapMinutes" + }, + "id": 218, + "name": "Identifier", + "src": "1747:14:1" + } + ], + "id": 219, + "name": "BinaryOperation", + "src": "1734:27:1" + } + ], + "id": 220, + "name": "TupleExpression", + "src": "1733:29:1" + }, + { + "attributes": { + "argumentTypes": null, + "hexvalue": "3630", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "number", + "type": "int_const 60", + "value": "60" + }, + "id": 221, + "name": "Literal", + "src": "1765:2:1" + } + ], + "id": 222, + "name": "BinaryOperation", + "src": "1733:34:1" + } + ], + "id": 223, + "name": "BinaryOperation", + "src": "1717:50:1" + } + ], + "id": 224, + "name": "FunctionCall", + "src": "1709:59:1" + } + ], + "id": 225, + "name": "ExpressionStatement", + "src": "1709:59:1" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "=", + "type": "enum Project.State" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 74, + "type": "enum Project.State", + "value": "state" + }, + "id": 226, + "name": "Identifier", + "src": "1774:5:1" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "member_name": "Active", + "referencedDeclaration": null, + "type": "enum Project.State" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 63, + "type": "type(enum Project.State)", + "value": "State" + }, + "id": 227, + "name": "Identifier", + "src": "1782:5:1" + } + ], + "id": 228, "name": "MemberAccess", - "src": "1608:12:1" + "src": "1782:12:1" } ], - "id": 192, + "id": 229, "name": "Assignment", - "src": "1600:20:1" + "src": "1774:20:1" } ], - "id": 193, + "id": 230, "name": "ExpressionStatement", - "src": "1600:20:1" + "src": "1774:20:1" }, { "children": [ @@ -2157,13 +2726,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 98, + "referencedDeclaration": 100, "type": "uint256", "value": "contractorCredit" }, - "id": 194, + "id": 231, "name": "Identifier", - "src": "1626:16:1" + "src": "1800:16:1" }, { "attributes": { @@ -2191,28 +2760,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 253, + "referencedDeclaration": 290, "type": "function () view returns (uint256)", "value": "getPrepay" }, - "id": 195, + "id": 232, "name": "Identifier", - "src": "1645:9:1" + "src": "1819:9:1" } ], - "id": 196, + "id": 233, "name": "FunctionCall", - "src": "1645:11:1" + "src": "1819:11:1" } ], - "id": 197, + "id": 234, "name": "Assignment", - "src": "1626:30:1" + "src": "1800:30:1" } ], - "id": 198, + "id": 235, "name": "ExpressionStatement", - "src": "1626:30:1" + "src": "1800:30:1" }, { "children": [ @@ -2233,13 +2802,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 93, + "referencedDeclaration": 95, "type": "uint256", "value": "executionDate" }, - "id": 199, + "id": 236, "name": "Identifier", - "src": "1662:13:1" + "src": "1836:13:1" }, { "attributes": { @@ -2247,23 +2816,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 497, + "referencedDeclaration": 573, "type": "uint256", "value": "now" }, - "id": 200, + "id": 237, "name": "Identifier", - "src": "1678:3:1" + "src": "1852:3:1" } ], - "id": 201, + "id": 238, "name": "Assignment", - "src": "1662:19:1" + "src": "1836:19:1" } ], - "id": 202, + "id": 239, "name": "ExpressionStatement", - "src": "1662:19:1" + "src": "1836:19:1" }, { "children": [ @@ -2284,13 +2853,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 91, + "referencedDeclaration": 93, "type": "uint256", "value": "lastActivityDate" }, - "id": 203, + "id": 240, "name": "Identifier", - "src": "1687:16:1" + "src": "1861:16:1" }, { "attributes": { @@ -2298,33 +2867,33 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 497, + "referencedDeclaration": 573, "type": "uint256", "value": "now" }, - "id": 204, + "id": 241, "name": "Identifier", - "src": "1706:3:1" + "src": "1880:3:1" } ], - "id": 205, + "id": 242, "name": "Assignment", - "src": "1687:22:1" + "src": "1861:22:1" } ], - "id": 206, + "id": 243, "name": "ExpressionStatement", - "src": "1687:22:1" + "src": "1861:22:1" } ], - "id": 207, + "id": 244, "name": "Block", - "src": "1526:188:1" + "src": "1703:185:1" } ], - "id": 208, + "id": 245, "name": "FunctionDefinition", - "src": "1454:260:1" + "src": "1629:259:1" }, { "attributes": { @@ -2336,7 +2905,7 @@ ], "name": "getRole", "payable": false, - "scope": 483, + "scope": 559, "stateMutability": "view", "superFunction": null, "visibility": "public" @@ -2349,9 +2918,9 @@ ] }, "children": [], - "id": 209, + "id": 246, "name": "ParameterList", - "src": "1734:2:1" + "src": "1908:2:1" }, { "children": [ @@ -2359,7 +2928,7 @@ "attributes": { "constant": false, "name": "", - "scope": 235, + "scope": 272, "stateVariable": false, "storageLocation": "default", "type": "enum Project.Role", @@ -2374,19 +2943,19 @@ "referencedDeclaration": 67, "type": "enum Project.Role" }, - "id": 210, + "id": 247, "name": "UserDefinedTypeName", - "src": "1758:4:1" + "src": "1932:4:1" } ], - "id": 211, + "id": 248, "name": "VariableDeclaration", - "src": "1758:4:1" + "src": "1932:4:1" } ], - "id": 212, + "id": 249, "name": "ParameterList", - "src": "1757:6:1" + "src": "1931:6:1" }, { "children": [ @@ -2428,18 +2997,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 495, + "referencedDeclaration": 571, "type": "msg", "value": "msg" }, - "id": 213, + "id": 250, "name": "Identifier", - "src": "1774:3:1" + "src": "1948:3:1" } ], - "id": 214, + "id": 251, "name": "MemberAccess", - "src": "1774:10:1" + "src": "1948:10:1" }, { "attributes": { @@ -2447,24 +3016,24 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 76, + "referencedDeclaration": 78, "type": "address", "value": "clientAddress" }, - "id": 215, + "id": 252, "name": "Identifier", - "src": "1788:13:1" + "src": "1962:13:1" } ], - "id": 216, + "id": 253, "name": "BinaryOperation", - "src": "1774:27:1" + "src": "1948:27:1" }, { "children": [ { "attributes": { - "functionReturnParameters": 212 + "functionReturnParameters": 249 }, "children": [ { @@ -2489,29 +3058,29 @@ "type": "type(enum Project.Role)", "value": "Role" }, - "id": 217, + "id": 254, "name": "Identifier", - "src": "1818:4:1" + "src": "1992:4:1" } ], - "id": 218, + "id": 255, "name": "MemberAccess", - "src": "1818:11:1" + "src": "1992:11:1" } ], - "id": 219, + "id": 256, "name": "Return", - "src": "1811:18:1" + "src": "1985:18:1" } ], - "id": 220, + "id": 257, "name": "Block", - "src": "1803:33:1" + "src": "1977:33:1" } ], - "id": 221, + "id": 258, "name": "IfStatement", - "src": "1770:66:1" + "src": "1944:66:1" }, { "attributes": { @@ -2551,18 +3120,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 495, + "referencedDeclaration": 571, "type": "msg", "value": "msg" }, - "id": 222, + "id": 259, "name": "Identifier", - "src": "1845:3:1" + "src": "2019:3:1" } ], - "id": 223, + "id": 260, "name": "MemberAccess", - "src": "1845:10:1" + "src": "2019:10:1" }, { "attributes": { @@ -2570,24 +3139,24 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 78, + "referencedDeclaration": 80, "type": "address", "value": "contractorAddress" }, - "id": 224, + "id": 261, "name": "Identifier", - "src": "1859:17:1" + "src": "2033:17:1" } ], - "id": 225, + "id": 262, "name": "BinaryOperation", - "src": "1845:31:1" + "src": "2019:31:1" }, { "children": [ { "attributes": { - "functionReturnParameters": 212 + "functionReturnParameters": 249 }, "children": [ { @@ -2612,33 +3181,33 @@ "type": "type(enum Project.Role)", "value": "Role" }, - "id": 226, + "id": 263, "name": "Identifier", - "src": "1893:4:1" + "src": "2067:4:1" } ], - "id": 227, + "id": 264, "name": "MemberAccess", - "src": "1893:15:1" + "src": "2067:15:1" } ], - "id": 228, + "id": 265, "name": "Return", - "src": "1886:22:1" + "src": "2060:22:1" } ], - "id": 229, + "id": 266, "name": "Block", - "src": "1878:37:1" + "src": "2052:37:1" } ], - "id": 230, + "id": 267, "name": "IfStatement", - "src": "1841:74:1" + "src": "2015:74:1" }, { "attributes": { - "functionReturnParameters": 212 + "functionReturnParameters": 249 }, "children": [ { @@ -2663,29 +3232,29 @@ "type": "type(enum Project.Role)", "value": "Role" }, - "id": 231, + "id": 268, "name": "Identifier", - "src": "1927:4:1" + "src": "2101:4:1" } ], - "id": 232, + "id": 269, "name": "MemberAccess", - "src": "1927:13:1" + "src": "2101:13:1" } ], - "id": 233, + "id": 270, "name": "Return", - "src": "1920:20:1" + "src": "2094:20:1" } ], - "id": 234, + "id": 271, "name": "Block", - "src": "1764:181:1" + "src": "1938:181:1" } ], - "id": 235, + "id": 272, "name": "FunctionDefinition", - "src": "1718:227:1" + "src": "1892:227:1" }, { "attributes": { @@ -2697,7 +3266,7 @@ ], "name": "getPrepay", "payable": false, - "scope": 483, + "scope": 559, "stateMutability": "view", "superFunction": null, "visibility": "public" @@ -2710,9 +3279,9 @@ ] }, "children": [], - "id": 236, + "id": 273, "name": "ParameterList", - "src": "1967:2:1" + "src": "2141:2:1" }, { "children": [ @@ -2720,7 +3289,7 @@ "attributes": { "constant": false, "name": "", - "scope": 253, + "scope": 290, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -2733,26 +3302,26 @@ "name": "uint256", "type": "uint256" }, - "id": 237, + "id": 274, "name": "ElementaryTypeName", - "src": "1991:7:1" + "src": "2165:7:1" } ], - "id": 238, + "id": 275, "name": "VariableDeclaration", - "src": "1991:7:1" + "src": "2165:7:1" } ], - "id": 239, + "id": 276, "name": "ParameterList", - "src": "1990:9:1" + "src": "2164:9:1" }, { "children": [ { "attributes": { "assignments": [ - 241 + 278 ] }, "children": [ @@ -2760,7 +3329,7 @@ "attributes": { "constant": false, "name": "priceCap", - "scope": 253, + "scope": 290, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -2773,14 +3342,14 @@ "name": "uint256", "type": "uint256" }, - "id": 240, + "id": 277, "name": "ElementaryTypeName", - "src": "2006:7:1" + "src": "2180:7:1" } ], - "id": 241, + "id": 278, "name": "VariableDeclaration", - "src": "2006:16:1" + "src": "2180:16:1" }, { "attributes": { @@ -2808,27 +3377,27 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 266, + "referencedDeclaration": 303, "type": "function () view returns (uint256)", "value": "getPriceCap" }, - "id": 242, + "id": 279, "name": "Identifier", - "src": "2025:11:1" + "src": "2199:11:1" } ], - "id": 243, + "id": 280, "name": "FunctionCall", - "src": "2025:13:1" + "src": "2199:13:1" } ], - "id": 244, + "id": 281, "name": "VariableDeclarationStatement", - "src": "2006:32:1" + "src": "2180:32:1" }, { "attributes": { - "functionReturnParameters": 239 + "functionReturnParameters": 276 }, "children": [ { @@ -2878,13 +3447,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 241, + "referencedDeclaration": 278, "type": "uint256", "value": "priceCap" }, - "id": 245, + "id": 282, "name": "Identifier", - "src": "2052:8:1" + "src": "2226:8:1" }, { "attributes": { @@ -2892,23 +3461,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 80, + "referencedDeclaration": 82, "type": "uint32", "value": "prepayFractionThousands" }, - "id": 246, + "id": 283, "name": "Identifier", - "src": "2063:23:1" + "src": "2237:23:1" } ], - "id": 247, + "id": 284, "name": "BinaryOperation", - "src": "2052:34:1" + "src": "2226:34:1" } ], - "id": 248, + "id": 285, "name": "TupleExpression", - "src": "2051:36:1" + "src": "2225:36:1" }, { "attributes": { @@ -2923,29 +3492,29 @@ "type": "int_const 1000", "value": "1000" }, - "id": 249, + "id": 286, "name": "Literal", - "src": "2090:4:1" + "src": "2264:4:1" } ], - "id": 250, + "id": 287, "name": "BinaryOperation", - "src": "2051:43:1" + "src": "2225:43:1" } ], - "id": 251, + "id": 288, "name": "Return", - "src": "2044:50:1" + "src": "2218:50:1" } ], - "id": 252, + "id": 289, "name": "Block", - "src": "2000:99:1" + "src": "2174:99:1" } ], - "id": 253, + "id": 290, "name": "FunctionDefinition", - "src": "1949:150:1" + "src": "2123:150:1" }, { "attributes": { @@ -2957,7 +3526,7 @@ ], "name": "getPriceCap", "payable": false, - "scope": 483, + "scope": 559, "stateMutability": "view", "superFunction": null, "visibility": "public" @@ -2970,9 +3539,9 @@ ] }, "children": [], - "id": 254, + "id": 291, "name": "ParameterList", - "src": "2123:2:1" + "src": "2297:2:1" }, { "children": [ @@ -2980,7 +3549,7 @@ "attributes": { "constant": false, "name": "", - "scope": 266, + "scope": 303, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -2993,25 +3562,25 @@ "name": "uint256", "type": "uint256" }, - "id": 255, + "id": 292, "name": "ElementaryTypeName", - "src": "2147:7:1" + "src": "2321:7:1" } ], - "id": 256, + "id": 293, "name": "VariableDeclaration", - "src": "2147:7:1" + "src": "2321:7:1" } ], - "id": 257, + "id": 294, "name": "ParameterList", - "src": "2146:9:1" + "src": "2320:9:1" }, { "children": [ { "attributes": { - "functionReturnParameters": 257 + "functionReturnParameters": 294 }, "children": [ { @@ -3061,13 +3630,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 88, + "referencedDeclaration": 90, "type": "uint256", "value": "hourlyRate" }, - "id": 258, + "id": 295, "name": "Identifier", - "src": "2170:10:1" + "src": "2344:10:1" }, { "attributes": { @@ -3075,23 +3644,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 82, + "referencedDeclaration": 84, "type": "uint32", "value": "timeCapMinutes" }, - "id": 259, + "id": 296, "name": "Identifier", - "src": "2183:14:1" + "src": "2357:14:1" } ], - "id": 260, + "id": 297, "name": "BinaryOperation", - "src": "2170:27:1" + "src": "2344:27:1" } ], - "id": 261, + "id": 298, "name": "TupleExpression", - "src": "2169:29:1" + "src": "2343:29:1" }, { "attributes": { @@ -3106,29 +3675,29 @@ "type": "int_const 60", "value": "60" }, - "id": 262, + "id": 299, "name": "Literal", - "src": "2201:2:1" + "src": "2375:2:1" } ], - "id": 263, + "id": 300, "name": "BinaryOperation", - "src": "2169:34:1" + "src": "2343:34:1" } ], - "id": 264, + "id": 301, "name": "Return", - "src": "2162:41:1" + "src": "2336:41:1" } ], - "id": 265, + "id": 302, "name": "Block", - "src": "2156:52:1" + "src": "2330:52:1" } ], - "id": 266, + "id": 303, "name": "FunctionDefinition", - "src": "2103:105:1" + "src": "2277:105:1" }, { "attributes": { @@ -3140,7 +3709,7 @@ ], "name": "availableForWithdraw", "payable": false, - "scope": 483, + "scope": 559, "stateMutability": "view", "superFunction": null, "visibility": "public" @@ -3153,9 +3722,9 @@ ] }, "children": [], - "id": 267, + "id": 304, "name": "ParameterList", - "src": "2241:2:1" + "src": "2415:2:1" }, { "children": [ @@ -3163,7 +3732,7 @@ "attributes": { "constant": false, "name": "", - "scope": 335, + "scope": 385, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -3176,19 +3745,19 @@ "name": "uint", "type": "uint256" }, - "id": 268, + "id": 305, "name": "ElementaryTypeName", - "src": "2265:4:1" + "src": "2439:4:1" } ], - "id": 269, + "id": 306, "name": "VariableDeclaration", - "src": "2265:4:1" + "src": "2439:4:1" } ], - "id": 270, + "id": 307, "name": "ParameterList", - "src": "2264:6:1" + "src": "2438:6:1" }, { "children": [ @@ -3218,13 +3787,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 72, + "referencedDeclaration": 74, "type": "enum Project.State", "value": "state" }, - "id": 271, + "id": 308, "name": "Identifier", - "src": "2281:5:1" + "src": "2455:5:1" }, { "attributes": { @@ -3248,25 +3817,25 @@ "type": "type(enum Project.State)", "value": "State" }, - "id": 272, + "id": 309, "name": "Identifier", - "src": "2290:5:1" + "src": "2464:5:1" } ], - "id": 273, + "id": 310, "name": "MemberAccess", - "src": "2290:13:1" + "src": "2464:13:1" } ], - "id": 274, + "id": 311, "name": "BinaryOperation", - "src": "2281:22:1" + "src": "2455:22:1" }, { "children": [ { "attributes": { - "functionReturnParameters": 270 + "functionReturnParameters": 307 }, "children": [ { @@ -3282,29 +3851,29 @@ "type": "int_const 0", "value": "0" }, - "id": 275, + "id": 312, "name": "Literal", - "src": "2320:1:1" + "src": "2494:1:1" } ], - "id": 276, + "id": 313, "name": "Return", - "src": "2313:8:1" + "src": "2487:8:1" } ], - "id": 277, + "id": 314, "name": "Block", - "src": "2305:23:1" + "src": "2479:23:1" } ], - "id": 278, + "id": 315, "name": "IfStatement", - "src": "2277:51:1" + "src": "2451:51:1" }, { "attributes": { "assignments": [ - 280 + 317 ] }, "children": [ @@ -3312,7 +3881,7 @@ "attributes": { "constant": false, "name": "role", - "scope": 335, + "scope": 385, "stateVariable": false, "storageLocation": "default", "type": "enum Project.Role", @@ -3327,14 +3896,14 @@ "referencedDeclaration": 67, "type": "enum Project.Role" }, - "id": 279, + "id": 316, "name": "UserDefinedTypeName", - "src": "2334:4:1" + "src": "2508:4:1" } ], - "id": 280, + "id": 317, "name": "VariableDeclaration", - "src": "2334:9:1" + "src": "2508:9:1" }, { "attributes": { @@ -3362,23 +3931,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 235, + "referencedDeclaration": 272, "type": "function () view returns (enum Project.Role)", "value": "getRole" }, - "id": 281, + "id": 318, "name": "Identifier", - "src": "2346:7:1" + "src": "2520:7:1" } ], - "id": 282, + "id": 319, "name": "FunctionCall", - "src": "2346:9:1" + "src": "2520:9:1" } ], - "id": 283, + "id": 320, "name": "VariableDeclarationStatement", - "src": "2334:21:1" + "src": "2508:21:1" }, { "attributes": { @@ -3406,13 +3975,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 280, + "referencedDeclaration": 317, "type": "enum Project.Role", "value": "role" }, - "id": 284, + "id": 321, "name": "Identifier", - "src": "2366:4:1" + "src": "2540:4:1" }, { "attributes": { @@ -3436,25 +4005,25 @@ "type": "type(enum Project.Role)", "value": "Role" }, - "id": 285, + "id": 322, "name": "Identifier", - "src": "2374:4:1" + "src": "2548:4:1" } ], - "id": 286, + "id": 323, "name": "MemberAccess", - "src": "2374:13:1" + "src": "2548:13:1" } ], - "id": 287, + "id": 324, "name": "BinaryOperation", - "src": "2366:21:1" + "src": "2540:21:1" }, { "children": [ { "attributes": { - "functionReturnParameters": 270 + "functionReturnParameters": 307 }, "children": [ { @@ -3470,24 +4039,24 @@ "type": "int_const 0", "value": "0" }, - "id": 288, + "id": 325, "name": "Literal", - "src": "2404:1:1" + "src": "2578:1:1" } ], - "id": 289, + "id": 326, "name": "Return", - "src": "2397:8:1" + "src": "2571:8:1" } ], - "id": 290, + "id": 327, "name": "Block", - "src": "2389:23:1" + "src": "2563:23:1" } ], - "id": 291, + "id": 328, "name": "IfStatement", - "src": "2362:50:1" + "src": "2536:50:1" }, { "children": [ @@ -3517,13 +4086,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 486, + "referencedDeclaration": 562, "type": "function (bool) pure", "value": "assert" }, - "id": 292, + "id": 329, "name": "Identifier", - "src": "2418:6:1" + "src": "2592:6:1" }, { "attributes": { @@ -3546,13 +4115,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 98, + "referencedDeclaration": 100, "type": "uint256", "value": "contractorCredit" }, - "id": 293, + "id": 330, "name": "Identifier", - "src": "2425:16:1" + "src": "2599:16:1" }, { "attributes": { @@ -3560,33 +4129,33 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 101, + "referencedDeclaration": 103, "type": "uint256", "value": "contractorDebit" }, - "id": 294, + "id": 331, "name": "Identifier", - "src": "2445:15:1" + "src": "2619:15:1" } ], - "id": 295, + "id": 332, "name": "BinaryOperation", - "src": "2425:35:1" + "src": "2599:35:1" } ], - "id": 296, + "id": 333, "name": "FunctionCall", - "src": "2418:43:1" + "src": "2592:43:1" } ], - "id": 297, + "id": 334, "name": "ExpressionStatement", - "src": "2418:43:1" + "src": "2592:43:1" }, { "attributes": { "assignments": [ - 299 + 336 ] }, "children": [ @@ -3594,7 +4163,7 @@ "attributes": { "constant": false, "name": "availableToContractor", - "scope": 335, + "scope": 385, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -3607,14 +4176,14 @@ "name": "uint256", "type": "uint256" }, - "id": 298, + "id": 335, "name": "ElementaryTypeName", - "src": "2467:7:1" + "src": "2641:7:1" } ], - "id": 299, + "id": 336, "name": "VariableDeclaration", - "src": "2467:29:1" + "src": "2641:29:1" }, { "attributes": { @@ -3637,13 +4206,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 98, + "referencedDeclaration": 100, "type": "uint256", "value": "contractorCredit" }, - "id": 300, + "id": 337, "name": "Identifier", - "src": "2499:16:1" + "src": "2673:16:1" }, { "attributes": { @@ -3651,23 +4220,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 101, + "referencedDeclaration": 103, "type": "uint256", "value": "contractorDebit" }, - "id": 301, + "id": 338, "name": "Identifier", - "src": "2518:15:1" + "src": "2692:15:1" } ], - "id": 302, + "id": 339, "name": "BinaryOperation", - "src": "2499:34:1" + "src": "2673:34:1" } ], - "id": 303, + "id": 340, "name": "VariableDeclarationStatement", - "src": "2467:66:1" + "src": "2641:66:1" }, { "attributes": { @@ -3695,13 +4264,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 280, + "referencedDeclaration": 317, "type": "enum Project.Role", "value": "role" }, - "id": 304, + "id": 341, "name": "Identifier", - "src": "2544:4:1" + "src": "2718:4:1" }, { "attributes": { @@ -3725,25 +4294,25 @@ "type": "type(enum Project.Role)", "value": "Role" }, - "id": 305, + "id": 342, "name": "Identifier", - "src": "2552:4:1" + "src": "2726:4:1" } ], - "id": 306, + "id": 343, "name": "MemberAccess", - "src": "2552:15:1" + "src": "2726:15:1" } ], - "id": 307, + "id": 344, "name": "BinaryOperation", - "src": "2544:23:1" + "src": "2718:23:1" }, { "children": [ { "attributes": { - "functionReturnParameters": 270 + "functionReturnParameters": 307 }, "children": [ { @@ -3752,28 +4321,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 299, + "referencedDeclaration": 336, "type": "uint256", "value": "availableToContractor" }, - "id": 308, + "id": 345, "name": "Identifier", - "src": "2584:21:1" + "src": "2758:21:1" } ], - "id": 309, + "id": 346, "name": "Return", - "src": "2577:28:1" + "src": "2751:28:1" } ], - "id": 310, + "id": 347, "name": "Block", - "src": "2569:43:1" + "src": "2743:43:1" } ], - "id": 311, + "id": 348, "name": "IfStatement", - "src": "2540:72:1" + "src": "2714:72:1" }, { "attributes": { @@ -3801,13 +4370,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 280, + "referencedDeclaration": 317, "type": "enum Project.Role", "value": "role" }, - "id": 312, + "id": 349, "name": "Identifier", - "src": "2622:4:1" + "src": "2796:4:1" }, { "attributes": { @@ -3831,83 +4400,81 @@ "type": "type(enum Project.Role)", "value": "Role" }, - "id": 313, + "id": 350, "name": "Identifier", - "src": "2630:4:1" + "src": "2804:4:1" } ], - "id": 314, + "id": 351, "name": "MemberAccess", - "src": "2630:11:1" + "src": "2804:11:1" } ], - "id": 315, + "id": 352, "name": "BinaryOperation", - "src": "2622:19:1" + "src": "2796:19:1" }, { "children": [ { + "attributes": { + "falseBody": null + }, "children": [ { "attributes": { "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, "isConstant": false, "isLValue": false, "isPure": false, - "isStructConstructorCall": false, "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false + "operator": "&&", + "type": "bool" }, "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 486, - "type": "function (bool) pure", - "value": "assert" - }, - "id": 316, - "name": "Identifier", - "src": "2651:6:1" - }, { "attributes": { "argumentTypes": null, "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_enum$_State_$63", + "typeString": "enum Project.State" }, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, - "operator": ">=", + "operator": "!=", "type": "bool" }, "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 74, + "type": "enum Project.State", + "value": "state" + }, + "id": 353, + "name": "Identifier", + "src": "2829:5:1" + }, { "attributes": { "argumentTypes": null, "isConstant": false, "isLValue": false, - "isPure": false, + "isPure": true, "lValueRequested": false, - "member_name": "balance", + "member_name": "Approved", "referencedDeclaration": null, - "type": "uint256" + "type": "enum Project.State" }, "children": [ { @@ -3916,51 +4483,247 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 508, - "type": "contract Project", - "value": "this" + "referencedDeclaration": 63, + "type": "type(enum Project.State)", + "value": "State" }, - "id": 317, + "id": 354, "name": "Identifier", - "src": "2658:4:1" + "src": "2838:5:1" } ], - "id": 318, + "id": 355, "name": "MemberAccess", - "src": "2658:12:1" + "src": "2838:14:1" + } + ], + "id": 356, + "name": "BinaryOperation", + "src": "2829:23:1" + }, + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_enum$_State_$63", + "typeString": "enum Project.State" }, - { + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "!=", + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 74, + "type": "enum Project.State", + "value": "state" + }, + "id": 357, + "name": "Identifier", + "src": "2856:5:1" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "member_name": "Cancelled", + "referencedDeclaration": null, + "type": "enum Project.State" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 63, + "type": "type(enum Project.State)", + "value": "State" + }, + "id": 358, + "name": "Identifier", + "src": "2865:5:1" + } + ], + "id": 359, + "name": "MemberAccess", + "src": "2865:15:1" + } + ], + "id": 360, + "name": "BinaryOperation", + "src": "2856:24:1" + } + ], + "id": 361, + "name": "BinaryOperation", + "src": "2829:51:1" + }, + { + "children": [ + { + "attributes": { + "functionReturnParameters": 307 + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "hexvalue": "30", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "number", + "type": "int_const 0", + "value": "0" + }, + "id": 362, + "name": "Literal", + "src": "2899:1:1" + } + ], + "id": 363, + "name": "Return", + "src": "2892:8:1" + } + ], + "id": 364, + "name": "Block", + "src": "2882:27:1" + } + ], + "id": 365, + "name": "IfStatement", + "src": "2825:84:1" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "tuple()", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 562, + "type": "function (bool) pure", + "value": "assert" + }, + "id": 366, + "name": "Identifier", + "src": "2916:6:1" + }, + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": ">=", + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "balance", + "referencedDeclaration": null, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 584, + "type": "contract Project", + "value": "this" + }, + "id": 367, + "name": "Identifier", + "src": "2923:4:1" + } + ], + "id": 368, + "name": "MemberAccess", + "src": "2923:12:1" + }, + { "attributes": { "argumentTypes": null, "overloadedDeclarations": [ null ], - "referencedDeclaration": 299, + "referencedDeclaration": 336, "type": "uint256", "value": "availableToContractor" }, - "id": 319, + "id": 369, "name": "Identifier", - "src": "2674:21:1" + "src": "2939:21:1" } ], - "id": 320, + "id": 370, "name": "BinaryOperation", - "src": "2658:37:1" + "src": "2923:37:1" } ], - "id": 321, + "id": 371, "name": "FunctionCall", - "src": "2651:45:1" + "src": "2916:45:1" } ], - "id": 322, + "id": 372, "name": "ExpressionStatement", - "src": "2651:45:1" + "src": "2916:45:1" }, { "attributes": { - "functionReturnParameters": 270 + "functionReturnParameters": 307 }, "children": [ { @@ -3996,18 +4759,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 508, + "referencedDeclaration": 584, "type": "contract Project", "value": "this" }, - "id": 323, + "id": 373, "name": "Identifier", - "src": "2711:4:1" + "src": "2976:4:1" } ], - "id": 324, + "id": 374, "name": "MemberAccess", - "src": "2711:12:1" + "src": "2976:12:1" }, { "attributes": { @@ -4015,33 +4778,33 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 299, + "referencedDeclaration": 336, "type": "uint256", "value": "availableToContractor" }, - "id": 325, + "id": 375, "name": "Identifier", - "src": "2726:21:1" + "src": "2991:21:1" } ], - "id": 326, + "id": 376, "name": "BinaryOperation", - "src": "2711:36:1" + "src": "2976:36:1" } ], - "id": 327, + "id": 377, "name": "Return", - "src": "2704:43:1" + "src": "2969:43:1" } ], - "id": 328, + "id": 378, "name": "Block", - "src": "2643:111:1" + "src": "2817:202:1" } ], - "id": 329, + "id": 379, "name": "IfStatement", - "src": "2618:136:1" + "src": "2792:227:1" }, { "children": [ @@ -4071,13 +4834,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 486, + "referencedDeclaration": 562, "type": "function (bool) pure", "value": "assert" }, - "id": 330, + "id": 380, "name": "Identifier", - "src": "2760:6:1" + "src": "3025:6:1" }, { "attributes": { @@ -4092,29 +4855,29 @@ "type": "bool", "value": "false" }, - "id": 331, + "id": 381, "name": "Literal", - "src": "2767:5:1" + "src": "3032:5:1" } ], - "id": 332, + "id": 382, "name": "FunctionCall", - "src": "2760:13:1" + "src": "3025:13:1" } ], - "id": 333, + "id": 383, "name": "ExpressionStatement", - "src": "2760:13:1" + "src": "3025:13:1" } ], - "id": 334, + "id": 384, "name": "Block", - "src": "2271:507:1" + "src": "2445:598:1" } ], - "id": 335, + "id": 385, "name": "FunctionDefinition", - "src": "2212:566:1" + "src": "2386:657:1" }, { "attributes": { @@ -4123,7 +4886,7 @@ "isConstructor": false, "name": "setBillableTime", "payable": false, - "scope": 483, + "scope": 559, "stateMutability": "nonpayable", "superFunction": null, "visibility": "external" @@ -4135,7 +4898,7 @@ "attributes": { "constant": false, "name": "timeMinutes", - "scope": 361, + "scope": 427, "stateVariable": false, "storageLocation": "default", "type": "uint32", @@ -4148,20 +4911,20 @@ "name": "uint32", "type": "uint32" }, - "id": 336, + "id": 386, "name": "ElementaryTypeName", - "src": "2807:6:1" + "src": "3072:6:1" } ], - "id": 337, + "id": 387, "name": "VariableDeclaration", - "src": "2807:18:1" + "src": "3072:18:1" }, { "attributes": { "constant": false, "name": "comment", - "scope": 361, + "scope": 427, "stateVariable": false, "storageLocation": "default", "type": "string calldata", @@ -4174,111 +4937,370 @@ "name": "string", "type": "string storage pointer" }, - "id": 338, + "id": 388, "name": "ElementaryTypeName", - "src": "2827:6:1" + "src": "3092:6:1" + } + ], + "id": 389, + "name": "VariableDeclaration", + "src": "3092:14:1" + } + ], + "id": 390, + "name": "ParameterList", + "src": "3071:36:1" + }, + { + "attributes": { + "parameters": [ + null + ] + }, + "children": [], + "id": 397, + "name": "ParameterList", + "src": "3166:0:1" + }, + { + "attributes": { + "arguments": [ + null + ] + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 166, + "type": "modifier ()", + "value": "onlyContractor" + }, + "id": 391, + "name": "Identifier", + "src": "3112:14:1" + } + ], + "id": 392, + "name": "ModifierInvocation", + "src": "3112:16:1" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 205, + "type": "modifier (enum Project.State)", + "value": "onlyAtState" + }, + "id": 393, + "name": "Identifier", + "src": "3129:11:1" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "member_name": "Active", + "referencedDeclaration": null, + "type": "enum Project.State" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 63, + "type": "type(enum Project.State)", + "value": "State" + }, + "id": 394, + "name": "Identifier", + "src": "3141:5:1" + } + ], + "id": 395, + "name": "MemberAccess", + "src": "3141:12:1" + } + ], + "id": 396, + "name": "ModifierInvocation", + "src": "3129:25:1" + }, + { + "children": [ + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "tuple()", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 574, + "type": "function (bool) pure", + "value": "require" + }, + "id": 398, + "name": "Identifier", + "src": "3172:7:1" + }, + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "<=", + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 387, + "type": "uint32", + "value": "timeMinutes" + }, + "id": 399, + "name": "Identifier", + "src": "3180:11:1" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 84, + "type": "uint32", + "value": "timeCapMinutes" + }, + "id": 400, + "name": "Identifier", + "src": "3195:14:1" + } + ], + "id": 401, + "name": "BinaryOperation", + "src": "3180:29:1" + } + ], + "id": 402, + "name": "FunctionCall", + "src": "3172:38:1" + } + ], + "id": 403, + "name": "ExpressionStatement", + "src": "3172:38:1" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "tuple()", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 574, + "type": "function (bool) pure", + "value": "require" + }, + "id": 404, + "name": "Identifier", + "src": "3216:7:1" + }, + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "<=", + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "*", + "type": "uint32" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 387, + "type": "uint32", + "value": "timeMinutes" + }, + "id": 405, + "name": "Identifier", + "src": "3224:11:1" + }, + { + "attributes": { + "argumentTypes": null, + "hexvalue": "3630", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "number", + "type": "int_const 60", + "value": "60" + }, + "id": 406, + "name": "Literal", + "src": "3238:2:1" + } + ], + "id": 407, + "name": "BinaryOperation", + "src": "3224:16:1" + }, + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "-", + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 573, + "type": "uint256", + "value": "now" + }, + "id": 408, + "name": "Identifier", + "src": "3244:3:1" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 95, + "type": "uint256", + "value": "executionDate" + }, + "id": 409, + "name": "Identifier", + "src": "3250:13:1" + } + ], + "id": 410, + "name": "BinaryOperation", + "src": "3244:19:1" + } + ], + "id": 411, + "name": "BinaryOperation", + "src": "3224:39:1" + } + ], + "id": 412, + "name": "FunctionCall", + "src": "3216:48:1" } ], - "id": 339, - "name": "VariableDeclaration", - "src": "2827:14:1" - } - ], - "id": 340, - "name": "ParameterList", - "src": "2806:36:1" - }, - { - "attributes": { - "parameters": [ - null - ] - }, - "children": [], - "id": 347, - "name": "ParameterList", - "src": "2899:0:1" - }, - { - "attributes": { - "arguments": [ - null - ] - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 157, - "type": "modifier ()", - "value": "onlyContractor" - }, - "id": 341, - "name": "Identifier", - "src": "2847:14:1" - } - ], - "id": 342, - "name": "ModifierInvocation", - "src": "2847:14:1" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 180, - "type": "modifier (enum Project.State)", - "value": "onlyAtState" - }, - "id": 343, - "name": "Identifier", - "src": "2862:11:1" + "id": 413, + "name": "ExpressionStatement", + "src": "3216:48:1" }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "member_name": "Active", - "referencedDeclaration": null, - "type": "enum Project.State" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 63, - "type": "type(enum Project.State)", - "value": "State" - }, - "id": 344, - "name": "Identifier", - "src": "2874:5:1" - } - ], - "id": 345, - "name": "MemberAccess", - "src": "2874:12:1" - } - ], - "id": 346, - "name": "ModifierInvocation", - "src": "2862:25:1" - }, - { - "children": [ { "children": [ { @@ -4298,13 +5320,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 84, + "referencedDeclaration": 86, "type": "uint32", "value": "minutesReported" }, - "id": 348, + "id": 414, "name": "Identifier", - "src": "2905:15:1" + "src": "3270:15:1" }, { "attributes": { @@ -4312,23 +5334,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 337, + "referencedDeclaration": 387, "type": "uint32", "value": "timeMinutes" }, - "id": 349, + "id": 415, "name": "Identifier", - "src": "2923:11:1" + "src": "3288:11:1" } ], - "id": 350, + "id": 416, "name": "Assignment", - "src": "2905:29:1" + "src": "3270:29:1" } ], - "id": 351, + "id": 417, "name": "ExpressionStatement", - "src": "2905:29:1" + "src": "3270:29:1" }, { "children": [ @@ -4349,13 +5371,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 86, + "referencedDeclaration": 88, "type": "string storage ref", "value": "contractorComment" }, - "id": 352, + "id": 418, "name": "Identifier", - "src": "2940:17:1" + "src": "3305:17:1" }, { "attributes": { @@ -4363,23 +5385,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 339, + "referencedDeclaration": 389, "type": "string calldata", "value": "comment" }, - "id": 353, + "id": 419, "name": "Identifier", - "src": "2960:7:1" + "src": "3325:7:1" } ], - "id": 354, + "id": 420, "name": "Assignment", - "src": "2940:27:1" + "src": "3305:27:1" } ], - "id": 355, + "id": 421, "name": "ExpressionStatement", - "src": "2940:27:1" + "src": "3305:27:1" }, { "children": [ @@ -4400,13 +5422,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 91, + "referencedDeclaration": 93, "type": "uint256", "value": "lastActivityDate" }, - "id": 356, + "id": 422, "name": "Identifier", - "src": "2973:16:1" + "src": "3338:16:1" }, { "attributes": { @@ -4414,45 +5436,42 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 497, + "referencedDeclaration": 573, "type": "uint256", "value": "now" }, - "id": 357, + "id": 423, "name": "Identifier", - "src": "2992:3:1" + "src": "3357:3:1" } ], - "id": 358, + "id": 424, "name": "Assignment", - "src": "2973:22:1" + "src": "3338:22:1" } ], - "id": 359, + "id": 425, "name": "ExpressionStatement", - "src": "2973:22:1" + "src": "3338:22:1" } ], - "id": 360, + "id": 426, "name": "Block", - "src": "2899:101:1" + "src": "3166:199:1" } ], - "id": 361, + "id": 427, "name": "FunctionDefinition", - "src": "2782:218:1" + "src": "3047:318:1" }, { "attributes": { "constant": false, "implemented": true, "isConstructor": false, - "modifiers": [ - null - ], "name": "approve", "payable": false, - "scope": 483, + "scope": 559, "stateMutability": "nonpayable", "superFunction": null, "visibility": "external" @@ -4465,9 +5484,9 @@ ] }, "children": [], - "id": 362, + "id": 428, "name": "ParameterList", - "src": "3020:2:1" + "src": "3385:2:1" }, { "attributes": { @@ -4476,9 +5495,87 @@ ] }, "children": [], - "id": 363, + "id": 435, "name": "ParameterList", - "src": "3032:0:1" + "src": "3436:0:1" + }, + { + "attributes": { + "arguments": [ + null + ] + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 177, + "type": "modifier ()", + "value": "onlyClient" + }, + "id": 429, + "name": "Identifier", + "src": "3388:10:1" + } + ], + "id": 430, + "name": "ModifierInvocation", + "src": "3388:12:1" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 205, + "type": "modifier (enum Project.State)", + "value": "onlyAtState" + }, + "id": 431, + "name": "Identifier", + "src": "3401:11:1" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "member_name": "Active", + "referencedDeclaration": null, + "type": "enum Project.State" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 63, + "type": "type(enum Project.State)", + "value": "State" + }, + "id": 432, + "name": "Identifier", + "src": "3413:5:1" + } + ], + "id": 433, + "name": "MemberAccess", + "src": "3413:12:1" + } + ], + "id": 434, + "name": "ModifierInvocation", + "src": "3401:25:1" }, { "children": [ @@ -4501,13 +5598,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 72, + "referencedDeclaration": 74, "type": "enum Project.State", "value": "state" }, - "id": 364, + "id": 436, "name": "Identifier", - "src": "3038:5:1" + "src": "3442:5:1" }, { "attributes": { @@ -4531,24 +5628,24 @@ "type": "type(enum Project.State)", "value": "State" }, - "id": 365, + "id": 437, "name": "Identifier", - "src": "3046:5:1" + "src": "3450:5:1" } ], - "id": 366, + "id": 438, "name": "MemberAccess", - "src": "3046:14:1" + "src": "3450:14:1" } ], - "id": 367, + "id": 439, "name": "Assignment", - "src": "3038:22:1" + "src": "3442:22:1" } ], - "id": 368, + "id": 440, "name": "ExpressionStatement", - "src": "3038:22:1" + "src": "3442:22:1" }, { "children": [ @@ -4569,13 +5666,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 95, + "referencedDeclaration": 97, "type": "uint256", "value": "endDate" }, - "id": 369, + "id": 441, "name": "Identifier", - "src": "3066:7:1" + "src": "3470:7:1" }, { "attributes": { @@ -4583,23 +5680,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 497, + "referencedDeclaration": 573, "type": "uint256", "value": "now" }, - "id": 370, + "id": 442, "name": "Identifier", - "src": "3076:3:1" + "src": "3480:3:1" } ], - "id": 371, + "id": 443, "name": "Assignment", - "src": "3066:13:1" + "src": "3470:13:1" } ], - "id": 372, + "id": 444, "name": "ExpressionStatement", - "src": "3066:13:1" + "src": "3470:13:1" }, { "children": [ @@ -4620,13 +5717,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 91, + "referencedDeclaration": 93, "type": "uint256", "value": "lastActivityDate" }, - "id": 373, + "id": 445, "name": "Identifier", - "src": "3085:16:1" + "src": "3489:16:1" }, { "attributes": { @@ -4634,28 +5731,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 497, + "referencedDeclaration": 573, "type": "uint256", "value": "now" }, - "id": 374, + "id": 446, "name": "Identifier", - "src": "3104:3:1" + "src": "3508:3:1" } ], - "id": 375, + "id": 447, "name": "Assignment", - "src": "3085:22:1" + "src": "3489:22:1" } ], - "id": 376, + "id": 448, "name": "ExpressionStatement", - "src": "3085:22:1" + "src": "3489:22:1" }, { "attributes": { "assignments": [ - 378 + 450 ] }, "children": [ @@ -4663,7 +5760,7 @@ "attributes": { "constant": false, "name": "approvedPrice", - "scope": 396, + "scope": 468, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -4676,14 +5773,14 @@ "name": "uint256", "type": "uint256" }, - "id": 377, + "id": 449, "name": "ElementaryTypeName", - "src": "3114:7:1" + "src": "3518:7:1" } ], - "id": 378, + "id": 450, "name": "VariableDeclaration", - "src": "3114:21:1" + "src": "3518:21:1" }, { "attributes": { @@ -4732,13 +5829,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 88, + "referencedDeclaration": 90, "type": "uint256", "value": "hourlyRate" }, - "id": 379, + "id": 451, "name": "Identifier", - "src": "3139:10:1" + "src": "3543:10:1" }, { "attributes": { @@ -4746,23 +5843,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 84, + "referencedDeclaration": 86, "type": "uint32", "value": "minutesReported" }, - "id": 380, + "id": 452, "name": "Identifier", - "src": "3152:15:1" + "src": "3556:15:1" } ], - "id": 381, + "id": 453, "name": "BinaryOperation", - "src": "3139:28:1" + "src": "3543:28:1" } ], - "id": 382, + "id": 454, "name": "TupleExpression", - "src": "3138:30:1" + "src": "3542:30:1" }, { "attributes": { @@ -4777,19 +5874,19 @@ "type": "int_const 60", "value": "60" }, - "id": 383, + "id": 455, "name": "Literal", - "src": "3171:2:1" + "src": "3575:2:1" } ], - "id": 384, + "id": 456, "name": "BinaryOperation", - "src": "3138:35:1" + "src": "3542:35:1" } ], - "id": 385, + "id": 457, "name": "VariableDeclarationStatement", - "src": "3114:59:1" + "src": "3518:59:1" }, { "attributes": { @@ -4817,13 +5914,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 378, + "referencedDeclaration": 450, "type": "uint256", "value": "approvedPrice" }, - "id": 386, + "id": 458, "name": "Identifier", - "src": "3183:13:1" + "src": "3587:13:1" }, { "attributes": { @@ -4831,18 +5928,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 98, + "referencedDeclaration": 100, "type": "uint256", "value": "contractorCredit" }, - "id": 387, + "id": 459, "name": "Identifier", - "src": "3199:16:1" + "src": "3603:16:1" } ], - "id": 388, + "id": 460, "name": "BinaryOperation", - "src": "3183:32:1" + "src": "3587:32:1" }, { "children": [ @@ -4865,13 +5962,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 98, + "referencedDeclaration": 100, "type": "uint256", "value": "contractorCredit" }, - "id": 389, + "id": 461, "name": "Identifier", - "src": "3225:16:1" + "src": "3629:16:1" }, { "attributes": { @@ -4879,43 +5976,43 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 378, + "referencedDeclaration": 450, "type": "uint256", "value": "approvedPrice" }, - "id": 390, + "id": 462, "name": "Identifier", - "src": "3244:13:1" + "src": "3648:13:1" } ], - "id": 391, + "id": 463, "name": "Assignment", - "src": "3225:32:1" + "src": "3629:32:1" } ], - "id": 392, + "id": 464, "name": "ExpressionStatement", - "src": "3225:32:1" + "src": "3629:32:1" } ], - "id": 393, + "id": 465, "name": "Block", - "src": "3217:47:1" + "src": "3621:47:1" } ], - "id": 394, + "id": 466, "name": "IfStatement", - "src": "3179:85:1" + "src": "3583:85:1" } ], - "id": 395, + "id": 467, "name": "Block", - "src": "3032:236:1" + "src": "3436:236:1" } ], - "id": 396, + "id": 468, "name": "FunctionDefinition", - "src": "3004:264:1" + "src": "3369:303:1" }, { "attributes": { @@ -4924,7 +6021,7 @@ "isConstructor": false, "name": "cancel", "payable": false, - "scope": 483, + "scope": 559, "stateMutability": "nonpayable", "superFunction": null, "visibility": "external" @@ -4937,9 +6034,9 @@ ] }, "children": [], - "id": 397, + "id": 469, "name": "ParameterList", - "src": "3287:2:1" + "src": "3691:2:1" }, { "attributes": { @@ -4948,9 +6045,9 @@ ] }, "children": [], - "id": 404, + "id": 476, "name": "ParameterList", - "src": "3336:0:1" + "src": "3742:0:1" }, { "attributes": { @@ -4965,18 +6062,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 168, + "referencedDeclaration": 177, "type": "modifier ()", "value": "onlyClient" }, - "id": 398, + "id": 470, "name": "Identifier", - "src": "3290:10:1" + "src": "3694:10:1" } ], - "id": 399, + "id": 471, "name": "ModifierInvocation", - "src": "3290:10:1" + "src": "3694:12:1" }, { "children": [ @@ -4986,13 +6083,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 180, + "referencedDeclaration": 205, "type": "modifier (enum Project.State)", "value": "onlyAtState" }, - "id": 400, + "id": 472, "name": "Identifier", - "src": "3301:11:1" + "src": "3707:11:1" }, { "attributes": { @@ -5016,19 +6113,19 @@ "type": "type(enum Project.State)", "value": "State" }, - "id": 401, + "id": 473, "name": "Identifier", - "src": "3313:5:1" + "src": "3719:5:1" } ], - "id": 402, + "id": 474, "name": "MemberAccess", - "src": "3313:12:1" + "src": "3719:12:1" } ], - "id": 403, + "id": 475, "name": "ModifierInvocation", - "src": "3301:25:1" + "src": "3707:25:1" }, { "children": [ @@ -5051,13 +6148,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 72, + "referencedDeclaration": 74, "type": "enum Project.State", "value": "state" }, - "id": 405, + "id": 477, "name": "Identifier", - "src": "3342:5:1" + "src": "3748:5:1" }, { "attributes": { @@ -5081,24 +6178,24 @@ "type": "type(enum Project.State)", "value": "State" }, - "id": 406, + "id": 478, "name": "Identifier", - "src": "3350:5:1" + "src": "3756:5:1" } ], - "id": 407, + "id": 479, "name": "MemberAccess", - "src": "3350:15:1" + "src": "3756:15:1" } ], - "id": 408, + "id": 480, "name": "Assignment", - "src": "3342:23:1" + "src": "3748:23:1" } ], - "id": 409, + "id": 481, "name": "ExpressionStatement", - "src": "3342:23:1" + "src": "3748:23:1" }, { "children": [ @@ -5119,13 +6216,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 95, + "referencedDeclaration": 97, "type": "uint256", "value": "endDate" }, - "id": 410, + "id": 482, "name": "Identifier", - "src": "3371:7:1" + "src": "3777:7:1" }, { "attributes": { @@ -5133,23 +6230,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 497, + "referencedDeclaration": 573, "type": "uint256", "value": "now" }, - "id": 411, + "id": 483, "name": "Identifier", - "src": "3381:3:1" + "src": "3787:3:1" } ], - "id": 412, + "id": 484, "name": "Assignment", - "src": "3371:13:1" + "src": "3777:13:1" } ], - "id": 413, + "id": 485, "name": "ExpressionStatement", - "src": "3371:13:1" + "src": "3777:13:1" }, { "children": [ @@ -5170,13 +6267,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 91, + "referencedDeclaration": 93, "type": "uint256", "value": "lastActivityDate" }, - "id": 414, + "id": 486, "name": "Identifier", - "src": "3390:16:1" + "src": "3796:16:1" }, { "attributes": { @@ -5184,45 +6281,42 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 497, + "referencedDeclaration": 573, "type": "uint256", "value": "now" }, - "id": 415, + "id": 487, "name": "Identifier", - "src": "3409:3:1" + "src": "3815:3:1" } ], - "id": 416, + "id": 488, "name": "Assignment", - "src": "3390:22:1" + "src": "3796:22:1" } ], - "id": 417, + "id": 489, "name": "ExpressionStatement", - "src": "3390:22:1" + "src": "3796:22:1" } ], - "id": 418, + "id": 490, "name": "Block", - "src": "3336:81:1" + "src": "3742:81:1" } ], - "id": 419, + "id": 491, "name": "FunctionDefinition", - "src": "3272:145:1" + "src": "3676:147:1" }, { "attributes": { "constant": false, "implemented": true, "isConstructor": false, - "modifiers": [ - null - ], "name": "withdraw", "payable": false, - "scope": 483, + "scope": 559, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -5235,9 +6329,9 @@ ] }, "children": [], - "id": 420, + "id": 492, "name": "ParameterList", - "src": "3438:2:1" + "src": "3844:2:1" }, { "attributes": { @@ -5246,9 +6340,35 @@ ] }, "children": [], - "id": 421, + "id": 495, "name": "ParameterList", - "src": "3448:0:1" + "src": "3868:0:1" + }, + { + "attributes": { + "arguments": [ + null + ] + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 193, + "type": "modifier ()", + "value": "onlyParties" + }, + "id": 493, + "name": "Identifier", + "src": "3847:11:1" + } + ], + "id": 494, + "name": "ModifierInvocation", + "src": "3847:13:1" }, { "children": [ @@ -5271,13 +6391,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 91, + "referencedDeclaration": 93, "type": "uint256", "value": "lastActivityDate" }, - "id": 422, + "id": 496, "name": "Identifier", - "src": "3454:16:1" + "src": "3874:16:1" }, { "attributes": { @@ -5285,28 +6405,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 497, + "referencedDeclaration": 573, "type": "uint256", "value": "now" }, - "id": 423, + "id": 497, "name": "Identifier", - "src": "3473:3:1" + "src": "3893:3:1" } ], - "id": 424, + "id": 498, "name": "Assignment", - "src": "3454:22:1" + "src": "3874:22:1" } ], - "id": 425, + "id": 499, "name": "ExpressionStatement", - "src": "3454:22:1" + "src": "3874:22:1" }, { "attributes": { "assignments": [ - 427 + 501 ] }, "children": [ @@ -5314,7 +6434,7 @@ "attributes": { "constant": false, "name": "toBeSent", - "scope": 458, + "scope": 532, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -5327,14 +6447,14 @@ "name": "uint256", "type": "uint256" }, - "id": 426, + "id": 500, "name": "ElementaryTypeName", - "src": "3482:7:1" + "src": "3902:7:1" } ], - "id": 427, + "id": 501, "name": "VariableDeclaration", - "src": "3482:16:1" + "src": "3902:16:1" }, { "attributes": { @@ -5362,23 +6482,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 335, + "referencedDeclaration": 385, "type": "function () view returns (uint256)", "value": "availableForWithdraw" }, - "id": 428, + "id": 502, "name": "Identifier", - "src": "3501:20:1" + "src": "3921:20:1" } ], - "id": 429, + "id": 503, "name": "FunctionCall", - "src": "3501:22:1" + "src": "3921:22:1" } ], - "id": 430, + "id": 504, "name": "VariableDeclarationStatement", - "src": "3482:41:1" + "src": "3902:41:1" }, { "attributes": { @@ -5406,13 +6526,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 427, + "referencedDeclaration": 501, "type": "uint256", "value": "toBeSent" }, - "id": 431, + "id": 505, "name": "Identifier", - "src": "3533:8:1" + "src": "3953:8:1" }, { "attributes": { @@ -5427,14 +6547,14 @@ "type": "int_const 0", "value": "0" }, - "id": 432, + "id": 506, "name": "Literal", - "src": "3544:1:1" + "src": "3964:1:1" } ], - "id": 433, + "id": 507, "name": "BinaryOperation", - "src": "3533:12:1" + "src": "3953:12:1" }, { "children": [ @@ -5484,18 +6604,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 235, + "referencedDeclaration": 272, "type": "function () view returns (enum Project.Role)", "value": "getRole" }, - "id": 434, + "id": 508, "name": "Identifier", - "src": "3559:7:1" + "src": "3979:7:1" } ], - "id": 435, + "id": 509, "name": "FunctionCall", - "src": "3559:9:1" + "src": "3979:9:1" }, { "attributes": { @@ -5519,19 +6639,19 @@ "type": "type(enum Project.Role)", "value": "Role" }, - "id": 436, + "id": 510, "name": "Identifier", - "src": "3572:4:1" + "src": "3992:4:1" } ], - "id": 437, + "id": 511, "name": "MemberAccess", - "src": "3572:15:1" + "src": "3992:15:1" } ], - "id": 438, + "id": 512, "name": "BinaryOperation", - "src": "3559:28:1" + "src": "3979:28:1" }, { "children": [ @@ -5554,13 +6674,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 101, + "referencedDeclaration": 103, "type": "uint256", "value": "contractorDebit" }, - "id": 439, + "id": 513, "name": "Identifier", - "src": "3599:15:1" + "src": "4019:15:1" }, { "attributes": { @@ -5583,13 +6703,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 101, + "referencedDeclaration": 103, "type": "uint256", "value": "contractorDebit" }, - "id": 440, + "id": 514, "name": "Identifier", - "src": "3617:15:1" + "src": "4037:15:1" }, { "attributes": { @@ -5597,38 +6717,38 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 427, + "referencedDeclaration": 501, "type": "uint256", "value": "toBeSent" }, - "id": 441, + "id": 515, "name": "Identifier", - "src": "3635:8:1" + "src": "4055:8:1" } ], - "id": 442, + "id": 516, "name": "BinaryOperation", - "src": "3617:26:1" + "src": "4037:26:1" } ], - "id": 443, + "id": 517, "name": "Assignment", - "src": "3599:44:1" + "src": "4019:44:1" } ], - "id": 444, + "id": 518, "name": "ExpressionStatement", - "src": "3599:44:1" + "src": "4019:44:1" } ], - "id": 445, + "id": 519, "name": "Block", - "src": "3589:63:1" + "src": "4009:63:1" } ], - "id": 446, + "id": 520, "name": "IfStatement", - "src": "3555:97:1" + "src": "3975:97:1" }, { "children": [ @@ -5682,23 +6802,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 495, + "referencedDeclaration": 571, "type": "msg", "value": "msg" }, - "id": 447, + "id": 521, "name": "Identifier", - "src": "3659:3:1" + "src": "4079:3:1" } ], - "id": 450, + "id": 524, "name": "MemberAccess", - "src": "3659:10:1" + "src": "4079:10:1" } ], - "id": 451, + "id": 525, "name": "MemberAccess", - "src": "3659:19:1" + "src": "4079:19:1" }, { "attributes": { @@ -5706,55 +6826,52 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 427, + "referencedDeclaration": 501, "type": "uint256", "value": "toBeSent" }, - "id": 452, + "id": 526, "name": "Identifier", - "src": "3679:8:1" + "src": "4099:8:1" } ], - "id": 453, + "id": 527, "name": "FunctionCall", - "src": "3659:29:1" + "src": "4079:29:1" } ], - "id": 454, + "id": 528, "name": "ExpressionStatement", - "src": "3659:29:1" + "src": "4079:29:1" } ], - "id": 455, + "id": 529, "name": "Block", - "src": "3547:148:1" + "src": "3967:148:1" } ], - "id": 456, + "id": 530, "name": "IfStatement", - "src": "3529:166:1" + "src": "3949:166:1" } ], - "id": 457, + "id": 531, "name": "Block", - "src": "3448:251:1" + "src": "3868:251:1" } ], - "id": 458, + "id": 532, "name": "FunctionDefinition", - "src": "3421:278:1" + "src": "3827:292:1" }, { "attributes": { "constant": false, "implemented": true, "isConstructor": false, - "modifiers": [ - null - ], "name": "leaveFeedback", "payable": false, - "scope": 483, + "scope": 559, "stateMutability": "nonpayable", "superFunction": null, "visibility": "external" @@ -5766,7 +6883,7 @@ "attributes": { "constant": false, "name": "positive", - "scope": 482, + "scope": 558, "stateVariable": false, "storageLocation": "default", "type": "bool", @@ -5779,20 +6896,20 @@ "name": "bool", "type": "bool" }, - "id": 459, + "id": 533, "name": "ElementaryTypeName", - "src": "3726:4:1" + "src": "4146:4:1" } ], - "id": 460, + "id": 534, "name": "VariableDeclaration", - "src": "3726:13:1" + "src": "4146:13:1" }, { "attributes": { "constant": false, "name": "comment", - "scope": 482, + "scope": 558, "stateVariable": false, "storageLocation": "default", "type": "string calldata", @@ -5805,19 +6922,19 @@ "name": "string", "type": "string storage pointer" }, - "id": 461, + "id": 535, "name": "ElementaryTypeName", - "src": "3741:6:1" + "src": "4161:6:1" } ], - "id": 462, + "id": 536, "name": "VariableDeclaration", - "src": "3741:14:1" + "src": "4161:14:1" } ], - "id": 463, + "id": 537, "name": "ParameterList", - "src": "3725:31:1" + "src": "4145:31:1" }, { "attributes": { @@ -5826,9 +6943,35 @@ ] }, "children": [], - "id": 464, + "id": 540, "name": "ParameterList", - "src": "3766:0:1" + "src": "4200:0:1" + }, + { + "attributes": { + "arguments": [ + null + ] + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 193, + "type": "modifier ()", + "value": "onlyParties" + }, + "id": 538, + "name": "Identifier", + "src": "4177:11:1" + } + ], + "id": 539, + "name": "ModifierInvocation", + "src": "4177:13:1" }, { "children": [ @@ -5860,13 +7003,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 498, + "referencedDeclaration": 574, "type": "function (bool) pure", "value": "require" }, - "id": 465, + "id": 541, "name": "Identifier", - "src": "3772:7:1" + "src": "4206:7:1" }, { "attributes": { @@ -5904,13 +7047,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 72, + "referencedDeclaration": 74, "type": "enum Project.State", "value": "state" }, - "id": 466, + "id": 542, "name": "Identifier", - "src": "3780:5:1" + "src": "4214:5:1" }, { "attributes": { @@ -5934,19 +7077,19 @@ "type": "type(enum Project.State)", "value": "State" }, - "id": 467, + "id": 543, "name": "Identifier", - "src": "3789:5:1" + "src": "4223:5:1" } ], - "id": 468, + "id": 544, "name": "MemberAccess", - "src": "3789:14:1" + "src": "4223:14:1" } ], - "id": 469, + "id": 545, "name": "BinaryOperation", - "src": "3780:23:1" + "src": "4214:23:1" }, { "attributes": { @@ -5969,13 +7112,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 72, + "referencedDeclaration": 74, "type": "enum Project.State", "value": "state" }, - "id": 470, + "id": 546, "name": "Identifier", - "src": "3807:5:1" + "src": "4241:5:1" }, { "attributes": { @@ -5999,34 +7142,34 @@ "type": "type(enum Project.State)", "value": "State" }, - "id": 471, + "id": 547, "name": "Identifier", - "src": "3816:5:1" + "src": "4250:5:1" } ], - "id": 472, + "id": 548, "name": "MemberAccess", - "src": "3816:15:1" + "src": "4250:15:1" } ], - "id": 473, + "id": 549, "name": "BinaryOperation", - "src": "3807:24:1" + "src": "4241:24:1" } ], - "id": 474, + "id": 550, "name": "BinaryOperation", - "src": "3780:51:1" + "src": "4214:51:1" } ], - "id": 475, + "id": 551, "name": "FunctionCall", - "src": "3772:60:1" + "src": "4206:60:1" } ], - "id": 476, + "id": 552, "name": "ExpressionStatement", - "src": "3772:60:1" + "src": "4206:60:1" }, { "children": [ @@ -6047,13 +7190,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 91, + "referencedDeclaration": 93, "type": "uint256", "value": "lastActivityDate" }, - "id": 477, + "id": 553, "name": "Identifier", - "src": "3850:16:1" + "src": "4284:16:1" }, { "attributes": { @@ -6061,43 +7204,43 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 497, + "referencedDeclaration": 573, "type": "uint256", "value": "now" }, - "id": 478, + "id": 554, "name": "Identifier", - "src": "3869:3:1" + "src": "4303:3:1" } ], - "id": 479, + "id": 555, "name": "Assignment", - "src": "3850:22:1" + "src": "4284:22:1" } ], - "id": 480, + "id": 556, "name": "ExpressionStatement", - "src": "3850:22:1" + "src": "4284:22:1" } ], - "id": 481, + "id": 557, "name": "Block", - "src": "3766:111:1" + "src": "4200:111:1" } ], - "id": 482, + "id": 558, "name": "FunctionDefinition", - "src": "3703:174:1" + "src": "4123:188:1" } ], - "id": 483, + "id": 559, "name": "ContractDefinition", - "src": "26:3854:1" + "src": "26:4288:1" } ], - "id": 484, + "id": 560, "name": "SourceUnit", - "src": "0:3881:1" + "src": "0:4315:1" }, "compiler": { "name": "solc", @@ -6105,5 +7248,5 @@ }, "networks": {}, "schemaVersion": "1.0.1", - "updatedAt": "2017-11-22T17:16:55.393Z" + "updatedAt": "2017-11-23T00:02:14.944Z" } \ No newline at end of file diff --git a/contracts/Project.sol b/contracts/Project.sol index 624fd32..8f6771d 100644 --- a/contracts/Project.sol +++ b/contracts/Project.sol @@ -17,7 +17,7 @@ contract Project { uint16 public constant version = 1; - State public state; + State public state = State.Created; string public name; address public clientAddress; @@ -48,12 +48,13 @@ contract Project { uint32 _prepayFractionThousands) public { require(_prepayFractionThousands <= 1000); + require(_clientAddress != msg.sender); name = _name; clientAddress = _clientAddress; + contractorAddress = msg.sender; hourlyRate = _hourlyRate; timeCapMinutes = _timeCapMinutes; prepayFractionThousands = _prepayFractionThousands; - contractorAddress = msg.sender; } modifier onlyContractor() { @@ -66,13 +67,18 @@ contract Project { _; } + modifier onlyParties() { + require(msg.sender == contractorAddress || msg.sender == clientAddress); + _; + } + modifier onlyAtState(State _state) { require(state == _state); _; } - function start() external payable onlyClient onlyAtState(State.Created) { - // require(this.balance >= (hourlyRate * timeCapMinutes) / 60); + function start() onlyClient() onlyAtState(State.Created) external payable { + require(this.balance >= (hourlyRate * timeCapMinutes) / 60); state = State.Active; contractorCredit = getPrepay(); executionDate = now; @@ -117,6 +123,9 @@ contract Project { } if (role == Role.Client) { + if (state != State.Approved && state != State.Cancelled) { + return 0; + } assert(this.balance >= availableToContractor); return this.balance - availableToContractor; } @@ -125,14 +134,16 @@ contract Project { } function setBillableTime(uint32 timeMinutes, string comment) - onlyContractor onlyAtState(State.Active) + onlyContractor() onlyAtState(State.Active) external { + require(timeMinutes <= timeCapMinutes); + require(timeMinutes * 60 <= now - executionDate); minutesReported = timeMinutes; contractorComment = comment; lastActivityDate = now; } - function approve() external { + function approve() onlyClient() onlyAtState(State.Active) external { state = State.Approved; endDate = now; lastActivityDate = now; @@ -143,13 +154,13 @@ contract Project { } } - function cancel() onlyClient onlyAtState(State.Active) external { + function cancel() onlyClient() onlyAtState(State.Active) external { state = State.Cancelled; endDate = now; lastActivityDate = now; } - function withdraw() public { + function withdraw() onlyParties() public { lastActivityDate = now; uint256 toBeSent = availableForWithdraw(); if (toBeSent > 0) { @@ -160,7 +171,7 @@ contract Project { } } - function leaveFeedback(bool positive, string comment) external { + function leaveFeedback(bool positive, string comment) onlyParties() external { require(state == State.Approved || state == State.Cancelled); // TODO lastActivityDate = now;