diff --git "a/09-\347\224\260\345\220\233-\347\254\2544\346\254\241\344\275\234\344\270\232" "b/09-\347\224\260\345\220\233-\347\254\2544\346\254\241\344\275\234\344\270\232" new file mode 100644 index 00000000..4809c039 --- /dev/null +++ "b/09-\347\224\260\345\220\233-\347\254\2544\346\254\241\344\275\234\344\270\232" @@ -0,0 +1,9540 @@ +{ + "contractName": "Payroll", + "abi": [ + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "address" + } + ], + "name": "employees", + "outputs": [ + { + "name": "id", + "type": "address" + }, + { + "name": "salary", + "type": "uint256" + }, + { + "name": "lastPayday", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "constant": false, + "inputs": [], + "name": "getOwner", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "employeeId", + "type": "address" + }, + { + "name": "salary", + "type": "uint256" + } + ], + "name": "addEmployee", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "employeeId", + "type": "address" + } + ], + "name": "removeEmployee", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "employeeId", + "type": "address" + }, + { + "name": "salary", + "type": "uint256" + } + ], + "name": "updateEmployee", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "addFund", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "calculateRunway", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "hasEnoughFund", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "getPaid", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "newAddress", + "type": "address" + } + ], + "name": "changePaymentAddress", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6060604052341561000f57600080fd5b33600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061110b8061005f6000396000f3006060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806323fed09e146100a95780634ec19512146100d65780635e91d8ec146100ff5780637124d61314610141578063893d20e81461017a578063a2f09dfa146101cf578063cf41d6f8146101ed578063d067894714610202578063d108177a14610289578063e7fd9a13146102c2575b600080fd5b34156100b457600080fd5b6100bc610304565b604051808215151515815260200191505060405180910390f35b34156100e157600080fd5b6100e9610315565b6040518082815260200191505060405180910390f35b341561010a57600080fd5b61013f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610356565b005b341561014c57600080fd5b610178600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506105ec565b005b341561018557600080fd5b61018d610931565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101d761095b565b6040518082815260200191505060405180910390f35b34156101f857600080fd5b61020061097a565b005b341561020d57600080fd5b610239600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b13565b604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390f35b341561029457600080fd5b6102c0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b5d565b005b34156102cd57600080fd5b610302600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610da4565b005b60008061030f610315565b11905090565b6000806000541415151561032557fe5b6103516000543073ffffffffffffffffffffffffffffffffffffffff1631610fbc90919063ffffffff16565b905090565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156103b457600080fd5b826000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561043f57fe5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002092506104ff83606060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160018201548152602001600282015481525050610fd7565b610518836001015460005461106d90919063ffffffff16565b600081905550610539670de0b6b3a76400008561108690919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018190555061059883600101546000546110c190919063ffffffff16565b60008190555042600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055505050505050565b6000336000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561067957fe5b836000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561070357fe5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002094506107c385606060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160018201548152602001600282015481525050610fd7565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001820160009055600282016000905550506060604051908101604052808773ffffffffffffffffffffffffffffffffffffffff168152602001610883670de0b6b3a7640000886001015461108690919063ffffffff16565b815260200142815250600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020155905050505050505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b600080336000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515610a0857fe5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209350600a84600201540192504283101515610a5e57fe5b82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055508360000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc85600101549081150290604051600060405180830381858888f193505050501515610b0d57600080fd5b50505050565b60026020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154905083565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bbb57600080fd5b816000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515610c4657fe5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209250610d0683606060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160018201548152602001600282015481525050610fd7565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600182016000905560028201600090555050610d98836001015460005461106d90919063ffffffff16565b60008190555050505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e0257600080fd5b826000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610e8c57fe5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002092506060604051908101604052808673ffffffffffffffffffffffffffffffffffffffff16815260200185815260200142815250600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020155905050670de0b6b3a7640000840260008082825401925050819055505050505050565b6000808284811515610fca57fe5b0490508091505092915050565b6000611019600a61100b610ff885604001514261106d90919063ffffffff16565b856020015161108690919063ffffffff16565b610fbc90919063ffffffff16565b905042826040018181525050816000015173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561106957600080fd5b5050565b600082821115151561107b57fe5b818303905092915050565b600080600084141561109b57600091506110ba565b82840290508284828115156110ac57fe5b041415156110b657fe5b8091505b5092915050565b60008082840190508381101515156110d557fe5b80915050929150505600a165627a7a723058202128a91db629a37f14e65f080beb9811aec3b716937bd6acfa87ec46a7de9aef0029", + "deployedBytecode": "0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806323fed09e146100a95780634ec19512146100d65780635e91d8ec146100ff5780637124d61314610141578063893d20e81461017a578063a2f09dfa146101cf578063cf41d6f8146101ed578063d067894714610202578063d108177a14610289578063e7fd9a13146102c2575b600080fd5b34156100b457600080fd5b6100bc610304565b604051808215151515815260200191505060405180910390f35b34156100e157600080fd5b6100e9610315565b6040518082815260200191505060405180910390f35b341561010a57600080fd5b61013f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610356565b005b341561014c57600080fd5b610178600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506105ec565b005b341561018557600080fd5b61018d610931565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101d761095b565b6040518082815260200191505060405180910390f35b34156101f857600080fd5b61020061097a565b005b341561020d57600080fd5b610239600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b13565b604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390f35b341561029457600080fd5b6102c0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b5d565b005b34156102cd57600080fd5b610302600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610da4565b005b60008061030f610315565b11905090565b6000806000541415151561032557fe5b6103516000543073ffffffffffffffffffffffffffffffffffffffff1631610fbc90919063ffffffff16565b905090565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156103b457600080fd5b826000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561043f57fe5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002092506104ff83606060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160018201548152602001600282015481525050610fd7565b610518836001015460005461106d90919063ffffffff16565b600081905550610539670de0b6b3a76400008561108690919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018190555061059883600101546000546110c190919063ffffffff16565b60008190555042600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055505050505050565b6000336000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561067957fe5b836000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561070357fe5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002094506107c385606060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160018201548152602001600282015481525050610fd7565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001820160009055600282016000905550506060604051908101604052808773ffffffffffffffffffffffffffffffffffffffff168152602001610883670de0b6b3a7640000886001015461108690919063ffffffff16565b815260200142815250600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020155905050505050505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b600080336000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515610a0857fe5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209350600a84600201540192504283101515610a5e57fe5b82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055508360000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc85600101549081150290604051600060405180830381858888f193505050501515610b0d57600080fd5b50505050565b60026020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154905083565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bbb57600080fd5b816000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515610c4657fe5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209250610d0683606060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160018201548152602001600282015481525050610fd7565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600182016000905560028201600090555050610d98836001015460005461106d90919063ffffffff16565b60008190555050505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e0257600080fd5b826000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610e8c57fe5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002092506060604051908101604052808673ffffffffffffffffffffffffffffffffffffffff16815260200185815260200142815250600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020155905050670de0b6b3a7640000840260008082825401925050819055505050505050565b6000808284811515610fca57fe5b0490508091505092915050565b6000611019600a61100b610ff885604001514261106d90919063ffffffff16565b856020015161108690919063ffffffff16565b610fbc90919063ffffffff16565b905042826040018181525050816000015173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561106957600080fd5b5050565b600082821115151561107b57fe5b818303905092915050565b600080600084141561109b57600091506110ba565b82840290508284828115156110ac57fe5b041415156110b657fe5b8091505b5092915050565b60008082840190508381101515156110d557fe5b80915050929150505600a165627a7a723058202128a91db629a37f14e65f080beb9811aec3b716937bd6acfa87ec46a7de9aef0029", + "sourceMap": "53:2754:0:-;;;351:50;;;;;;;;385:10;377:5;;:18;;;;;;;;;;;;;;;;;;53:2754;;;;;;", + "deployedSourceMap": "53:2754:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2131:81;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2003:123;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1539:380;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2503:301;;;;;;;;;;;;;;;;;;;;;;;;;;;;757:63;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1924:74;;;;;;;;;;;;;;;;;;;;;;;2217:281;;;;;;;;;;;;;;300:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1288:246;;;;;;;;;;;;;;;;;;;;;;;;;;;;1040:243;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2131:81;2165:4;2205:1;2185:17;:15;:17::i;:::-;:21;2178:28;;2131:81;:::o;2003:123::-;2039:4;2075:1;2060:11;;:16;;2052:25;;;;;;2091:29;2108:11;;2091:4;:12;;;:16;;:29;;;;:::i;:::-;2084:36;;2003:123;:::o;1539:380::-;1640:12;454:5;;;;;;;;;;;440:19;;:10;:19;;;432:28;;;;;;;;1620:10;529:12;544:9;:21;554:10;544:21;;;;;;;;;;;;;;;529:36;;594:3;579:8;:11;;;;;;;;;;;;:18;;;;572:26;;;;;;1655:9;:21;1665:10;1655:21;;;;;;;;;;;;;;;1640:36;;1683:22;1696:8;1683:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:12;:22::i;:::-;1726:32;1742:8;:15;;;1726:11;;:15;;:32;;;;:::i;:::-;1712:11;:46;;;;1796:19;1807:7;1796:6;:10;;:19;;;;:::i;:::-;1765:9;:21;1775:10;1765:21;;;;;;;;;;;;;;;:28;;:50;;;;1836:32;1852:8;:15;;;1836:11;;:15;;:32;;;;:::i;:::-;1822:11;:46;;;;1910:3;1875:9;:21;1885:10;1875:21;;;;;;;;;;;;;;;:32;;:38;;;;467:1;;1539:380;;;:::o;2503:301::-;2614:12;2567:10;529:12;544:9;:21;554:10;544:21;;;;;;;;;;;;;;;529:36;;594:3;579:8;:11;;;;;;;;;;;;:18;;;;572:26;;;;;;2595:10;669:12;684:9;:21;694:10;684:21;;;;;;;;;;;;;;;669:36;;735:3;720:8;:11;;;;;;;;;;;;:18;;;712:27;;;;;;2629:9;:21;2639:10;2629:21;;;;;;;;;;;;;;;2614:36;;2656:23;2670:8;2656:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:12;:23::i;:::-;2692:9;:21;2702:10;2692:21;;;;;;;;;;;;;;;;2685:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2743:55;;;;;;;;;2752:10;2743:55;;;;;;2764:28;2784:7;2764:8;:15;;;:19;;:28;;;;:::i;:::-;2743:55;;;;2794:3;2743:55;;;2719:9;:21;2729:10;2719:21;;;;;;;;;;;;;;;:79;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;605:1;;2503:301;;;;:::o;757:63::-;786:7;809:5;;;;;;;;;;;802:12;;757:63;:::o;1924:74::-;1960:4;1980;:12;;;1973:19;;1924:74;:::o;2217:281::-;2269:12;2313:15;2250:10;529:12;544:9;:21;554:10;544:21;;;;;;;;;;;;;;;529:36;;594:3;579:8;:11;;;;;;;;;;;;:18;;;;572:26;;;;;;2284:9;:21;2294:10;2284:21;;;;;;;;;;;;;;;2269:36;;187:10;2331:8;:19;;;:33;2313:51;;2391:3;2378:10;:16;2371:24;;;;;;2438:10;2403:9;:21;2413:10;2403:21;;;;;;;;;;;;;;;:32;;:45;;;;2455:8;:11;;;;;;;;;;;;:20;;:37;2476:8;:15;;;2455:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2217:281;;;;:::o;300:45::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1288:246::-;1375:12;454:5;;;;;;;;;;;440:19;;:10;:19;;;432:28;;;;;;;;1356:10;529:12;544:9;:21;554:10;544:21;;;;;;;;;;;;;;;529:36;;594:3;579:8;:11;;;;;;;;;;;;:18;;;;572:26;;;;;;1390:9;:21;1400:10;1390:21;;;;;;;;;;;;;;;1375:36;;1418:22;1431:8;1418:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:12;:22::i;:::-;1454:9;:21;1464:10;1454:21;;;;;;;;;;;;;;;;1447:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1496:32;1512:8;:15;;;1496:11;;:15;;:32;;;;:::i;:::-;1482:11;:46;;;;467:1;;1288:246;;:::o;1040:243::-;1139:12;454:5;;;;;;;;;;;440:19;;:10;:19;;;432:28;;;;;;;;1120:10;669:12;684:9;:21;694:10;684:21;;;;;;;;;;;;;;;669:36;;735:3;720:8;:11;;;;;;;;;;;;:18;;;712:27;;;;;;1154:9;:21;1164:10;1154:21;;;;;;;;;;;;;;;1139:36;;1206:33;;;;;;;;;1215:10;1206:33;;;;;;1227:6;1206:33;;;;1235:3;1206:33;;;1182:9;:21;1192:10;1182:21;;;;;;;;;;;;;;;:57;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1270:7;1261:6;:16;1246:11;;:31;;;;;;;;;;;467:1;;1040:243;;;:::o;458:265:1:-;516:7;605:9;621:1;617;:5;;;;;;;;605:17;;717:1;710:8;;458:265;;;;;:::o;824:211:0:-;880:12;895:66;187:10;895:49;915:28;923:8;:19;;;915:3;:7;;:28;;;;:::i;:::-;895:8;:15;;;:19;;:49;;;;:::i;:::-;:53;;:66;;;;:::i;:::-;880:81;;990:3;968:8;:19;;:25;;;;;1000:8;:11;;;:20;;:29;1021:7;1000:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;824:211;;:::o;835:110:1:-;893:7;920:1;915;:6;;908:14;;;;;;939:1;935;:5;928:12;;835:110;;;;:::o;203:173::-;261:7;316:9;285:1;280;:6;276:35;;;303:1;296:8;;;;276:35;332:1;328;:5;316:17;;355:1;350;346;:5;;;;;;;;:10;339:18;;;;;;370:1;363:8;;203:173;;;;;;:::o;1007:129::-;1065:7;1080:9;1096:1;1092;:5;1080:17;;1115:1;1110;:6;;1103:14;;;;;;1130:1;1123:8;;1007:129;;;;;:::o", + "source": "pragma solidity ^0.4.14;\n\nimport './SafeMath.sol';\n\n contract Payroll {\n struct Employee {\n address id;\n uint salary;\n uint lastPayday;\n }\n\n uint constant payDuration = 10 seconds;\n uint totalSalary;\n using SafeMath for uint;\n address owner;\n /* Employee[] employees; */\n mapping(address => Employee) public employees;\n\n function Payroll() {\n owner = msg.sender;\n }\n\n modifier onlyOwner {\n require(msg.sender == owner);\n _;\n }\n\n modifier employeeExist(address employeeId) {\n var employee = employees[employeeId];\n assert(employee.id != 0x0);\n _;\n }\n\n modifier addressNotExist(address employeeId) {\n var employee = employees[employeeId];\n assert (employee.id == 0x0);\n _;\n }\n function getOwner() returns (address) {\n return owner;\n }\n function _partialPaid(Employee employee) private {\n uint payment = employee.salary.mul(now.sub(employee.lastPayday)).div(payDuration);\n employee.lastPayday = now;\n employee.id.transfer(payment);\n }\n\n function addEmployee(address employeeId, uint salary) onlyOwner addressNotExist(employeeId) {\n var employee = employees[employeeId];\n employees[employeeId] = Employee(employeeId, salary, now);\n totalSalary += salary * 1 ether;\n }\n\n function removeEmployee(address employeeId) onlyOwner employeeExist(employeeId) {\n var employee = employees[employeeId];\n _partialPaid(employee);\n delete employees[employeeId];\n totalSalary = totalSalary.sub(employee.salary);\n }\n\n function updateEmployee(address employeeId, uint salary) onlyOwner employeeExist(employeeId) {\n var employee = employees[employeeId];\n _partialPaid(employee);\n totalSalary = totalSalary.sub(employee.salary);\n employees[employeeId].salary = salary.mul(1 ether);\n totalSalary = totalSalary.add(employee.salary);\n employees[employeeId].lastPayday = now;\n }\n\n function addFund() payable returns (uint) {\n return this.balance;\n }\n\n function calculateRunway() returns (uint) {\n assert (totalSalary != 0);\n return this.balance.div(totalSalary);\n }\n\n function hasEnoughFund() returns (bool) {\n return calculateRunway() > 0;\n }\n\n function getPaid() employeeExist(msg.sender) {\n var employee = employees[msg.sender];\n\n uint nextPayday = employee.lastPayday + payDuration;\n assert(nextPayday < now);\n\n employees[msg.sender].lastPayday = nextPayday;\n employee.id.transfer(employee.salary);\n }\n\n function changePaymentAddress(address newAddress) employeeExist(msg.sender) addressNotExist(newAddress) {\n var employee = employees[msg.sender];\n _partialPaid (employee);\n delete employees[msg.sender];\n employees[newAddress] = Employee(newAddress, employee.salary.mul(1 ether), now);\n }\n }\n", + "sourcePath": "/home/test/smb/lesson/lesson4/contracts/Payroll.sol", + "ast": { + "absolutePath": "/home/test/smb/lesson/lesson4/contracts/Payroll.sol", + "exportedSymbols": { + "Payroll": [ + 370 + ] + }, + "id": 371, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1, + "literals": [ + "solidity", + "^", + "0.4", + ".14" + ], + "nodeType": "PragmaDirective", + "src": "0:24:0" + }, + { + "absolutePath": "/home/test/smb/lesson/lesson4/contracts/SafeMath.sol", + "file": "./SafeMath.sol", + "id": 2, + "nodeType": "ImportDirective", + "scope": 371, + "sourceUnit": 469, + "src": "26:24:0", + "symbolAliases": [], + "unitAlias": "" + }, + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 370, + "linearizedBaseContracts": [ + 370 + ], + "name": "Payroll", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "Payroll.Employee", + "id": 9, + "members": [ + { + "constant": false, + "id": 4, + "name": "id", + "nodeType": "VariableDeclaration", + "scope": 9, + "src": "98:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "98:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 6, + "name": "salary", + "nodeType": "VariableDeclaration", + "scope": 9, + "src": "115:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 5, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "115:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 8, + "name": "lastPayday", + "nodeType": "VariableDeclaration", + "scope": 9, + "src": "133:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "133:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "name": "Employee", + "nodeType": "StructDefinition", + "scope": 370, + "src": "75:79:0", + "visibility": "public" + }, + { + "constant": true, + "id": 12, + "name": "payDuration", + "nodeType": "VariableDeclaration", + "scope": 370, + "src": "159:38:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "159:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "argumentTypes": null, + "hexValue": "3130", + "id": 11, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "187:10:0", + "subdenomination": "seconds", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14, + "name": "totalSalary", + "nodeType": "VariableDeclaration", + "scope": 370, + "src": "202:16:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 13, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "202:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "id": 17, + "libraryName": { + "contractScope": null, + "id": 15, + "name": "SafeMath", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 468, + "src": "229:8:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SafeMath_$468", + "typeString": "library SafeMath" + } + }, + "nodeType": "UsingForDirective", + "src": "223:24:0", + "typeName": { + "id": 16, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "242:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + { + "constant": false, + "id": 19, + "name": "owner", + "nodeType": "VariableDeclaration", + "scope": 370, + "src": "251:13:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 18, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "251:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 23, + "name": "employees", + "nodeType": "VariableDeclaration", + "scope": 370, + "src": "300:45:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + }, + "typeName": { + "id": 22, + "keyType": { + "id": 20, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "308:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "300:28:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + }, + "valueType": { + "contractScope": null, + "id": 21, + "name": "Employee", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 9, + "src": "319:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "body": { + "id": 31, + "nodeType": "Block", + "src": "370:31:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 29, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 26, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 19, + "src": "377:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 27, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 480, + "src": "385:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 28, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "385:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "377:18:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 30, + "nodeType": "ExpressionStatement", + "src": "377:18:0" + } + ] + }, + "id": 32, + "implemented": true, + "isConstructor": true, + "isDeclaredConst": false, + "modifiers": [], + "name": "Payroll", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 24, + "nodeType": "ParameterList", + "parameters": [], + "src": "367:2:0" + }, + "payable": false, + "returnParameters": { + "id": 25, + "nodeType": "ParameterList", + "parameters": [], + "src": "370:0:0" + }, + "scope": 370, + "src": "351:50:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 42, + "nodeType": "Block", + "src": "425:49:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 38, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 35, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 480, + "src": "440:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 36, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "440:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 37, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 19, + "src": "454:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "440:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 34, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 483, + "src": "432:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 39, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "432:28:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 40, + "nodeType": "ExpressionStatement", + "src": "432:28:0" + }, + { + "id": 41, + "nodeType": "PlaceholderStatement", + "src": "467:1:0" + } + ] + }, + "id": 43, + "name": "onlyOwner", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 33, + "nodeType": "ParameterList", + "parameters": [], + "src": "425:0:0" + }, + "src": "406:68:0", + "visibility": "internal" + }, + { + "body": { + "id": 60, + "nodeType": "Block", + "src": "522:90:0", + "statements": [ + { + "assignments": [ + 47 + ], + "declarations": [ + { + "constant": false, + "id": 47, + "name": "employee", + "nodeType": "VariableDeclaration", + "scope": 61, + "src": "529:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + }, + "typeName": null, + "value": null, + "visibility": "internal" + } + ], + "id": 51, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 48, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "544:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 50, + "indexExpression": { + "argumentTypes": null, + "id": 49, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 45, + "src": "554:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "544:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "529:36:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 56, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 53, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 47, + "src": "579:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + }, + "id": 54, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "id", + "nodeType": "MemberAccess", + "referencedDeclaration": 4, + "src": "579:11:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "307830", + "id": 55, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "594:3:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0x0" + }, + "src": "579:18:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 52, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 471, + "src": "572:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 57, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "572:26:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 58, + "nodeType": "ExpressionStatement", + "src": "572:26:0" + }, + { + "id": 59, + "nodeType": "PlaceholderStatement", + "src": "605:1:0" + } + ] + }, + "id": 61, + "name": "employeeExist", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 46, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 45, + "name": "employeeId", + "nodeType": "VariableDeclaration", + "scope": 61, + "src": "502:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 44, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "502:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "501:20:0" + }, + "src": "479:133:0", + "visibility": "internal" + }, + { + "body": { + "id": 78, + "nodeType": "Block", + "src": "662:91:0", + "statements": [ + { + "assignments": [ + 65 + ], + "declarations": [ + { + "constant": false, + "id": 65, + "name": "employee", + "nodeType": "VariableDeclaration", + "scope": 79, + "src": "669:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + }, + "typeName": null, + "value": null, + "visibility": "internal" + } + ], + "id": 69, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 66, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "684:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 68, + "indexExpression": { + "argumentTypes": null, + "id": 67, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 63, + "src": "694:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "684:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "669:36:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 74, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 71, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 65, + "src": "720:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + }, + "id": 72, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "id", + "nodeType": "MemberAccess", + "referencedDeclaration": 4, + "src": "720:11:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "307830", + "id": 73, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "735:3:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0x0" + }, + "src": "720:18:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 70, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 471, + "src": "712:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 75, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "712:27:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 76, + "nodeType": "ExpressionStatement", + "src": "712:27:0" + }, + { + "id": 77, + "nodeType": "PlaceholderStatement", + "src": "746:1:0" + } + ] + }, + "id": 79, + "name": "addressNotExist", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 64, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 63, + "name": "employeeId", + "nodeType": "VariableDeclaration", + "scope": 79, + "src": "642:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 62, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "642:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "641:20:0" + }, + "src": "617:136:0", + "visibility": "internal" + }, + { + "body": { + "id": 86, + "nodeType": "Block", + "src": "795:25:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 84, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 19, + "src": "809:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 83, + "id": 85, + "nodeType": "Return", + "src": "802:12:0" + } + ] + }, + "id": 87, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [], + "name": "getOwner", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 80, + "nodeType": "ParameterList", + "parameters": [], + "src": "774:2:0" + }, + "payable": false, + "returnParameters": { + "id": 83, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 82, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 87, + "src": "786:7:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 81, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "786:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "785:9:0" + }, + "scope": 370, + "src": "757:63:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 121, + "nodeType": "Block", + "src": "873:162:0", + "statements": [ + { + "assignments": [ + 93 + ], + "declarations": [ + { + "constant": false, + "id": 93, + "name": "payment", + "nodeType": "VariableDeclaration", + "scope": 122, + "src": "880:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 92, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "880:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 106, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 104, + "name": "payDuration", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12, + "src": "949:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 99, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 89, + "src": "923:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_memory_ptr", + "typeString": "struct Payroll.Employee memory" + } + }, + "id": 100, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "lastPayday", + "nodeType": "MemberAccess", + "referencedDeclaration": 8, + "src": "923:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 97, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 482, + "src": "915:3:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 98, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sub", + "nodeType": "MemberAccess", + "referencedDeclaration": 443, + "src": "915:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 101, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "915:28:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 94, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 89, + "src": "895:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_memory_ptr", + "typeString": "struct Payroll.Employee memory" + } + }, + "id": 95, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "salary", + "nodeType": "MemberAccess", + "referencedDeclaration": 6, + "src": "895:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 96, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "mul", + "nodeType": "MemberAccess", + "referencedDeclaration": 405, + "src": "895:19:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 102, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "895:49:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 103, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "div", + "nodeType": "MemberAccess", + "referencedDeclaration": 423, + "src": "895:53:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 105, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "895:66:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "880:81:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 111, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 107, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 89, + "src": "968:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_memory_ptr", + "typeString": "struct Payroll.Employee memory" + } + }, + "id": 109, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "lastPayday", + "nodeType": "MemberAccess", + "referencedDeclaration": 8, + "src": "968:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 110, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 482, + "src": "990:3:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "968:25:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 112, + "nodeType": "ExpressionStatement", + "src": "968:25:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 118, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 93, + "src": "1021:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 113, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 89, + "src": "1000:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_memory_ptr", + "typeString": "struct Payroll.Employee memory" + } + }, + "id": 116, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "id", + "nodeType": "MemberAccess", + "referencedDeclaration": 4, + "src": "1000:11:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 117, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1000:20:0", + "typeDescriptions": { + "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 119, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1000:29:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 120, + "nodeType": "ExpressionStatement", + "src": "1000:29:0" + } + ] + }, + "id": 122, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [], + "name": "_partialPaid", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 90, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 89, + "name": "employee", + "nodeType": "VariableDeclaration", + "scope": 122, + "src": "846:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_memory_ptr", + "typeString": "struct Payroll.Employee memory" + }, + "typeName": { + "contractScope": null, + "id": 88, + "name": "Employee", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 9, + "src": "846:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "845:19:0" + }, + "payable": false, + "returnParameters": { + "id": 91, + "nodeType": "ParameterList", + "parameters": [], + "src": "873:0:0" + }, + "scope": 370, + "src": "824:211:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 155, + "nodeType": "Block", + "src": "1132:151:0", + "statements": [ + { + "assignments": [ + 134 + ], + "declarations": [ + { + "constant": false, + "id": 134, + "name": "employee", + "nodeType": "VariableDeclaration", + "scope": 156, + "src": "1139:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + }, + "typeName": null, + "value": null, + "visibility": "internal" + } + ], + "id": 138, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 135, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "1154:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 137, + "indexExpression": { + "argumentTypes": null, + "id": 136, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 124, + "src": "1164:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1154:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1139:36:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 147, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 139, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "1182:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 141, + "indexExpression": { + "argumentTypes": null, + "id": 140, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 124, + "src": "1192:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "1182:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 143, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 124, + "src": "1215:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 144, + "name": "salary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 126, + "src": "1227:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 145, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 482, + "src": "1235:3:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 142, + "name": "Employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9, + "src": "1206:8:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_Employee_$9_storage_ptr_$", + "typeString": "type(struct Payroll.Employee storage pointer)" + } + }, + "id": 146, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1206:33:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_memory", + "typeString": "struct Payroll.Employee memory" + } + }, + "src": "1182:57:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "id": 148, + "nodeType": "ExpressionStatement", + "src": "1182:57:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 153, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 149, + "name": "totalSalary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "1246:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "+=", + "rightHandSide": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 152, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 150, + "name": "salary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 126, + "src": "1261:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 151, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1270:7:0", + "subdenomination": "ether", + "typeDescriptions": { + "typeIdentifier": "t_rational_1000000000000000000_by_1", + "typeString": "int_const 1000000000000000000" + }, + "value": "1" + }, + "src": "1261:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1246:31:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 154, + "nodeType": "ExpressionStatement", + "src": "1246:31:0" + } + ] + }, + "id": 156, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": [], + "id": 129, + "modifierName": { + "argumentTypes": null, + "id": 128, + "name": "onlyOwner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 43, + "src": "1094:9:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "1094:9:0" + }, + { + "arguments": [ + { + "argumentTypes": null, + "id": 131, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 124, + "src": "1120:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 132, + "modifierName": { + "argumentTypes": null, + "id": 130, + "name": "addressNotExist", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 79, + "src": "1104:15:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_address_$", + "typeString": "modifier (address)" + } + }, + "nodeType": "ModifierInvocation", + "src": "1104:27:0" + } + ], + "name": "addEmployee", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 127, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 124, + "name": "employeeId", + "nodeType": "VariableDeclaration", + "scope": 156, + "src": "1061:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 123, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1061:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 126, + "name": "salary", + "nodeType": "VariableDeclaration", + "scope": 156, + "src": "1081:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 125, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1081:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1060:33:0" + }, + "payable": false, + "returnParameters": { + "id": 133, + "nodeType": "ParameterList", + "parameters": [], + "src": "1132:0:0" + }, + "scope": 370, + "src": "1040:243:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 188, + "nodeType": "Block", + "src": "1368:166:0", + "statements": [ + { + "assignments": [ + 166 + ], + "declarations": [ + { + "constant": false, + "id": 166, + "name": "employee", + "nodeType": "VariableDeclaration", + "scope": 189, + "src": "1375:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + }, + "typeName": null, + "value": null, + "visibility": "internal" + } + ], + "id": 170, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 167, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "1390:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 169, + "indexExpression": { + "argumentTypes": null, + "id": 168, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 158, + "src": "1400:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1390:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1375:36:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 172, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 166, + "src": "1431:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + ], + "id": 171, + "name": "_partialPaid", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 122, + "src": "1418:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_struct$_Employee_$9_memory_ptr_$returns$__$", + "typeString": "function (struct Payroll.Employee memory)" + } + }, + "id": 173, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1418:22:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 174, + "nodeType": "ExpressionStatement", + "src": "1418:22:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 178, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "delete", + "prefix": true, + "src": "1447:28:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 175, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "1454:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 177, + "indexExpression": { + "argumentTypes": null, + "id": 176, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 158, + "src": "1464:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "1454:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 179, + "nodeType": "ExpressionStatement", + "src": "1447:28:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 186, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 180, + "name": "totalSalary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "1482:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 183, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 166, + "src": "1512:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + }, + "id": 184, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "salary", + "nodeType": "MemberAccess", + "referencedDeclaration": 6, + "src": "1512:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 181, + "name": "totalSalary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "1496:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 182, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sub", + "nodeType": "MemberAccess", + "referencedDeclaration": 443, + "src": "1496:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 185, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1496:32:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1482:46:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 187, + "nodeType": "ExpressionStatement", + "src": "1482:46:0" + } + ] + }, + "id": 189, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": [], + "id": 161, + "modifierName": { + "argumentTypes": null, + "id": 160, + "name": "onlyOwner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 43, + "src": "1332:9:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "1332:9:0" + }, + { + "arguments": [ + { + "argumentTypes": null, + "id": 163, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 158, + "src": "1356:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 164, + "modifierName": { + "argumentTypes": null, + "id": 162, + "name": "employeeExist", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 61, + "src": "1342:13:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_address_$", + "typeString": "modifier (address)" + } + }, + "nodeType": "ModifierInvocation", + "src": "1342:25:0" + } + ], + "name": "removeEmployee", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 159, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 158, + "name": "employeeId", + "nodeType": "VariableDeclaration", + "scope": 189, + "src": "1312:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 157, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1312:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1311:20:0" + }, + "payable": false, + "returnParameters": { + "id": 165, + "nodeType": "ParameterList", + "parameters": [], + "src": "1368:0:0" + }, + "scope": 370, + "src": "1288:246:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 243, + "nodeType": "Block", + "src": "1633:286:0", + "statements": [ + { + "assignments": [ + 201 + ], + "declarations": [ + { + "constant": false, + "id": 201, + "name": "employee", + "nodeType": "VariableDeclaration", + "scope": 244, + "src": "1640:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + }, + "typeName": null, + "value": null, + "visibility": "internal" + } + ], + "id": 205, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 202, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "1655:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 204, + "indexExpression": { + "argumentTypes": null, + "id": 203, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 191, + "src": "1665:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1655:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1640:36:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 207, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 201, + "src": "1696:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + ], + "id": 206, + "name": "_partialPaid", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 122, + "src": "1683:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_struct$_Employee_$9_memory_ptr_$returns$__$", + "typeString": "function (struct Payroll.Employee memory)" + } + }, + "id": 208, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1683:22:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 209, + "nodeType": "ExpressionStatement", + "src": "1683:22:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 216, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 210, + "name": "totalSalary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "1712:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 213, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 201, + "src": "1742:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + }, + "id": 214, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "salary", + "nodeType": "MemberAccess", + "referencedDeclaration": 6, + "src": "1742:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 211, + "name": "totalSalary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "1726:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 212, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sub", + "nodeType": "MemberAccess", + "referencedDeclaration": 443, + "src": "1726:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 215, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1726:32:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1712:46:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 217, + "nodeType": "ExpressionStatement", + "src": "1712:46:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 226, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 218, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "1765:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 220, + "indexExpression": { + "argumentTypes": null, + "id": 219, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 191, + "src": "1775:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1765:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "id": 221, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "salary", + "nodeType": "MemberAccess", + "referencedDeclaration": 6, + "src": "1765:28:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "31", + "id": 224, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1807:7:0", + "subdenomination": "ether", + "typeDescriptions": { + "typeIdentifier": "t_rational_1000000000000000000_by_1", + "typeString": "int_const 1000000000000000000" + }, + "value": "1" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_1000000000000000000_by_1", + "typeString": "int_const 1000000000000000000" + } + ], + "expression": { + "argumentTypes": null, + "id": 222, + "name": "salary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 193, + "src": "1796:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 223, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "mul", + "nodeType": "MemberAccess", + "referencedDeclaration": 405, + "src": "1796:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 225, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1796:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1765:50:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 227, + "nodeType": "ExpressionStatement", + "src": "1765:50:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 234, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 228, + "name": "totalSalary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "1822:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 231, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 201, + "src": "1852:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + }, + "id": 232, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "salary", + "nodeType": "MemberAccess", + "referencedDeclaration": 6, + "src": "1852:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 229, + "name": "totalSalary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "1836:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 230, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "add", + "nodeType": "MemberAccess", + "referencedDeclaration": 467, + "src": "1836:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 233, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1836:32:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1822:46:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 235, + "nodeType": "ExpressionStatement", + "src": "1822:46:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 241, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 236, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "1875:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 238, + "indexExpression": { + "argumentTypes": null, + "id": 237, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 191, + "src": "1885:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1875:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "id": 239, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "lastPayday", + "nodeType": "MemberAccess", + "referencedDeclaration": 8, + "src": "1875:32:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 240, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 482, + "src": "1910:3:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1875:38:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 242, + "nodeType": "ExpressionStatement", + "src": "1875:38:0" + } + ] + }, + "id": 244, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": [], + "id": 196, + "modifierName": { + "argumentTypes": null, + "id": 195, + "name": "onlyOwner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 43, + "src": "1596:9:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "1596:9:0" + }, + { + "arguments": [ + { + "argumentTypes": null, + "id": 198, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 191, + "src": "1620:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 199, + "modifierName": { + "argumentTypes": null, + "id": 197, + "name": "employeeExist", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 61, + "src": "1606:13:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_address_$", + "typeString": "modifier (address)" + } + }, + "nodeType": "ModifierInvocation", + "src": "1606:25:0" + } + ], + "name": "updateEmployee", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 194, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 191, + "name": "employeeId", + "nodeType": "VariableDeclaration", + "scope": 244, + "src": "1563:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 190, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1563:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 193, + "name": "salary", + "nodeType": "VariableDeclaration", + "scope": 244, + "src": "1583:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 192, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1583:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1562:33:0" + }, + "payable": false, + "returnParameters": { + "id": 200, + "nodeType": "ParameterList", + "parameters": [], + "src": "1633:0:0" + }, + "scope": 370, + "src": "1539:380:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 252, + "nodeType": "Block", + "src": "1966:32:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 249, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 493, + "src": "1980:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Payroll_$370", + "typeString": "contract Payroll" + } + }, + "id": 250, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1980:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 248, + "id": 251, + "nodeType": "Return", + "src": "1973:19:0" + } + ] + }, + "id": 253, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [], + "name": "addFund", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 245, + "nodeType": "ParameterList", + "parameters": [], + "src": "1940:2:0" + }, + "payable": true, + "returnParameters": { + "id": 248, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 247, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 253, + "src": "1960:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 246, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1960:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1959:6:0" + }, + "scope": 370, + "src": "1924:74:0", + "stateMutability": "payable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 270, + "nodeType": "Block", + "src": "2045:81:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 261, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 259, + "name": "totalSalary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "2060:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 260, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2075:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "2060:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 258, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 471, + "src": "2052:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 262, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2052:25:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 263, + "nodeType": "ExpressionStatement", + "src": "2052:25:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 267, + "name": "totalSalary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "2108:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 264, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 493, + "src": "2091:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Payroll_$370", + "typeString": "contract Payroll" + } + }, + "id": 265, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2091:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 266, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "div", + "nodeType": "MemberAccess", + "referencedDeclaration": 423, + "src": "2091:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 268, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2091:29:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 257, + "id": 269, + "nodeType": "Return", + "src": "2084:36:0" + } + ] + }, + "id": 271, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [], + "name": "calculateRunway", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 254, + "nodeType": "ParameterList", + "parameters": [], + "src": "2027:2:0" + }, + "payable": false, + "returnParameters": { + "id": 257, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 256, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 271, + "src": "2039:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 255, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2039:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2038:6:0" + }, + "scope": 370, + "src": "2003:123:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 281, + "nodeType": "Block", + "src": "2171:41:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 279, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 276, + "name": "calculateRunway", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 271, + "src": "2185:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$_t_uint256_$", + "typeString": "function () returns (uint256)" + } + }, + "id": 277, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2185:17:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 278, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2205:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "2185:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 275, + "id": 280, + "nodeType": "Return", + "src": "2178:28:0" + } + ] + }, + "id": 282, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [], + "name": "hasEnoughFund", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 272, + "nodeType": "ParameterList", + "parameters": [], + "src": "2153:2:0" + }, + "payable": false, + "returnParameters": { + "id": 275, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 274, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 282, + "src": "2165:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 273, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2165:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2164:6:0" + }, + "scope": 370, + "src": "2131:81:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 325, + "nodeType": "Block", + "src": "2262:236:0", + "statements": [ + { + "assignments": [ + 289 + ], + "declarations": [ + { + "constant": false, + "id": 289, + "name": "employee", + "nodeType": "VariableDeclaration", + "scope": 326, + "src": "2269:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + }, + "typeName": null, + "value": null, + "visibility": "internal" + } + ], + "id": 294, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 290, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "2284:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 293, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 291, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 480, + "src": "2294:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 292, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2294:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2284:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2269:36:0" + }, + { + "assignments": [ + 296 + ], + "declarations": [ + { + "constant": false, + "id": 296, + "name": "nextPayday", + "nodeType": "VariableDeclaration", + "scope": 326, + "src": "2313:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 295, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2313:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 301, + "initialValue": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 300, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 297, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 289, + "src": "2331:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + }, + "id": 298, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "lastPayday", + "nodeType": "MemberAccess", + "referencedDeclaration": 8, + "src": "2331:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "argumentTypes": null, + "id": 299, + "name": "payDuration", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12, + "src": "2353:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2331:33:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2313:51:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 305, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 303, + "name": "nextPayday", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 296, + "src": "2378:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "id": 304, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 482, + "src": "2391:3:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2378:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 302, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 471, + "src": "2371:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 306, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2371:24:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 307, + "nodeType": "ExpressionStatement", + "src": "2371:24:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 314, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 308, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "2403:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 311, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 309, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 480, + "src": "2413:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 310, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2413:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2403:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "id": 312, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "lastPayday", + "nodeType": "MemberAccess", + "referencedDeclaration": 8, + "src": "2403:32:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 313, + "name": "nextPayday", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 296, + "src": "2438:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2403:45:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 315, + "nodeType": "ExpressionStatement", + "src": "2403:45:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 321, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 289, + "src": "2476:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + }, + "id": 322, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "salary", + "nodeType": "MemberAccess", + "referencedDeclaration": 6, + "src": "2476:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 316, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 289, + "src": "2455:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + }, + "id": 319, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "id", + "nodeType": "MemberAccess", + "referencedDeclaration": 4, + "src": "2455:11:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 320, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2455:20:0", + "typeDescriptions": { + "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 323, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2455:37:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 324, + "nodeType": "ExpressionStatement", + "src": "2455:37:0" + } + ] + }, + "id": 326, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 285, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 480, + "src": "2250:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 286, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2250:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 287, + "modifierName": { + "argumentTypes": null, + "id": 284, + "name": "employeeExist", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 61, + "src": "2236:13:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_address_$", + "typeString": "modifier (address)" + } + }, + "nodeType": "ModifierInvocation", + "src": "2236:25:0" + } + ], + "name": "getPaid", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 283, + "nodeType": "ParameterList", + "parameters": [], + "src": "2233:2:0" + }, + "payable": false, + "returnParameters": { + "id": 288, + "nodeType": "ParameterList", + "parameters": [], + "src": "2262:0:0" + }, + "scope": 370, + "src": "2217:281:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 368, + "nodeType": "Block", + "src": "2607:197:0", + "statements": [ + { + "assignments": [ + 338 + ], + "declarations": [ + { + "constant": false, + "id": 338, + "name": "employee", + "nodeType": "VariableDeclaration", + "scope": 369, + "src": "2614:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + }, + "typeName": null, + "value": null, + "visibility": "internal" + } + ], + "id": 343, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 339, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "2629:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 342, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 340, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 480, + "src": "2639:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 341, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2639:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2629:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2614:36:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 345, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 338, + "src": "2670:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + ], + "id": 344, + "name": "_partialPaid", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 122, + "src": "2656:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_struct$_Employee_$9_memory_ptr_$returns$__$", + "typeString": "function (struct Payroll.Employee memory)" + } + }, + "id": 346, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2656:23:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 347, + "nodeType": "ExpressionStatement", + "src": "2656:23:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 352, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "delete", + "prefix": true, + "src": "2685:28:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 348, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "2692:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 351, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 349, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 480, + "src": "2702:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 350, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2702:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "2692:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 353, + "nodeType": "ExpressionStatement", + "src": "2685:28:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 366, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 354, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "2719:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 356, + "indexExpression": { + "argumentTypes": null, + "id": 355, + "name": "newAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "2729:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "2719:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 358, + "name": "newAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "2752:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "31", + "id": 362, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2784:7:0", + "subdenomination": "ether", + "typeDescriptions": { + "typeIdentifier": "t_rational_1000000000000000000_by_1", + "typeString": "int_const 1000000000000000000" + }, + "value": "1" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_1000000000000000000_by_1", + "typeString": "int_const 1000000000000000000" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 359, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 338, + "src": "2764:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + }, + "id": 360, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "salary", + "nodeType": "MemberAccess", + "referencedDeclaration": 6, + "src": "2764:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 361, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "mul", + "nodeType": "MemberAccess", + "referencedDeclaration": 405, + "src": "2764:19:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 363, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2764:28:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 364, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 482, + "src": "2794:3:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 357, + "name": "Employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9, + "src": "2743:8:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_Employee_$9_storage_ptr_$", + "typeString": "type(struct Payroll.Employee storage pointer)" + } + }, + "id": 365, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2743:55:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_memory", + "typeString": "struct Payroll.Employee memory" + } + }, + "src": "2719:79:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "id": 367, + "nodeType": "ExpressionStatement", + "src": "2719:79:0" + } + ] + }, + "id": 369, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 331, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 480, + "src": "2567:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 332, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2567:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 333, + "modifierName": { + "argumentTypes": null, + "id": 330, + "name": "employeeExist", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 61, + "src": "2553:13:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_address_$", + "typeString": "modifier (address)" + } + }, + "nodeType": "ModifierInvocation", + "src": "2553:25:0" + }, + { + "arguments": [ + { + "argumentTypes": null, + "id": 335, + "name": "newAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "2595:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 336, + "modifierName": { + "argumentTypes": null, + "id": 334, + "name": "addressNotExist", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 79, + "src": "2579:15:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_address_$", + "typeString": "modifier (address)" + } + }, + "nodeType": "ModifierInvocation", + "src": "2579:27:0" + } + ], + "name": "changePaymentAddress", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 329, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 328, + "name": "newAddress", + "nodeType": "VariableDeclaration", + "scope": 369, + "src": "2533:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 327, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2533:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2532:20:0" + }, + "payable": false, + "returnParameters": { + "id": 337, + "nodeType": "ParameterList", + "parameters": [], + "src": "2607:0:0" + }, + "scope": 370, + "src": "2503:301:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 371, + "src": "53:2754:0" + } + ], + "src": "0:2808:0" + }, + "legacyAST": { + "absolutePath": "/home/test/smb/lesson/lesson4/contracts/Payroll.sol", + "exportedSymbols": { + "Payroll": [ + 370 + ] + }, + "id": 371, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1, + "literals": [ + "solidity", + "^", + "0.4", + ".14" + ], + "nodeType": "PragmaDirective", + "src": "0:24:0" + }, + { + "absolutePath": "/home/test/smb/lesson/lesson4/contracts/SafeMath.sol", + "file": "./SafeMath.sol", + "id": 2, + "nodeType": "ImportDirective", + "scope": 371, + "sourceUnit": 469, + "src": "26:24:0", + "symbolAliases": [], + "unitAlias": "" + }, + { + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "documentation": null, + "fullyImplemented": true, + "id": 370, + "linearizedBaseContracts": [ + 370 + ], + "name": "Payroll", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "Payroll.Employee", + "id": 9, + "members": [ + { + "constant": false, + "id": 4, + "name": "id", + "nodeType": "VariableDeclaration", + "scope": 9, + "src": "98:10:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 3, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "98:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 6, + "name": "salary", + "nodeType": "VariableDeclaration", + "scope": 9, + "src": "115:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 5, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "115:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 8, + "name": "lastPayday", + "nodeType": "VariableDeclaration", + "scope": 9, + "src": "133:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 7, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "133:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "name": "Employee", + "nodeType": "StructDefinition", + "scope": 370, + "src": "75:79:0", + "visibility": "public" + }, + { + "constant": true, + "id": 12, + "name": "payDuration", + "nodeType": "VariableDeclaration", + "scope": 370, + "src": "159:38:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 10, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "159:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "argumentTypes": null, + "hexValue": "3130", + "id": 11, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "187:10:0", + "subdenomination": "seconds", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 14, + "name": "totalSalary", + "nodeType": "VariableDeclaration", + "scope": 370, + "src": "202:16:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 13, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "202:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "id": 17, + "libraryName": { + "contractScope": null, + "id": 15, + "name": "SafeMath", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 468, + "src": "229:8:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_SafeMath_$468", + "typeString": "library SafeMath" + } + }, + "nodeType": "UsingForDirective", + "src": "223:24:0", + "typeName": { + "id": 16, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "242:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + }, + { + "constant": false, + "id": 19, + "name": "owner", + "nodeType": "VariableDeclaration", + "scope": 370, + "src": "251:13:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 18, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "251:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 23, + "name": "employees", + "nodeType": "VariableDeclaration", + "scope": 370, + "src": "300:45:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + }, + "typeName": { + "id": 22, + "keyType": { + "id": 20, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "308:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "300:28:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + }, + "valueType": { + "contractScope": null, + "id": 21, + "name": "Employee", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 9, + "src": "319:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + } + }, + "value": null, + "visibility": "public" + }, + { + "body": { + "id": 31, + "nodeType": "Block", + "src": "370:31:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 29, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 26, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 19, + "src": "377:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 27, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 480, + "src": "385:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 28, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "385:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "377:18:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 30, + "nodeType": "ExpressionStatement", + "src": "377:18:0" + } + ] + }, + "id": 32, + "implemented": true, + "isConstructor": true, + "isDeclaredConst": false, + "modifiers": [], + "name": "Payroll", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 24, + "nodeType": "ParameterList", + "parameters": [], + "src": "367:2:0" + }, + "payable": false, + "returnParameters": { + "id": 25, + "nodeType": "ParameterList", + "parameters": [], + "src": "370:0:0" + }, + "scope": 370, + "src": "351:50:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 42, + "nodeType": "Block", + "src": "425:49:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 38, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 35, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 480, + "src": "440:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 36, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "440:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "id": 37, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 19, + "src": "454:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "440:19:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 34, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 483, + "src": "432:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 39, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "432:28:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 40, + "nodeType": "ExpressionStatement", + "src": "432:28:0" + }, + { + "id": 41, + "nodeType": "PlaceholderStatement", + "src": "467:1:0" + } + ] + }, + "id": 43, + "name": "onlyOwner", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 33, + "nodeType": "ParameterList", + "parameters": [], + "src": "425:0:0" + }, + "src": "406:68:0", + "visibility": "internal" + }, + { + "body": { + "id": 60, + "nodeType": "Block", + "src": "522:90:0", + "statements": [ + { + "assignments": [ + 47 + ], + "declarations": [ + { + "constant": false, + "id": 47, + "name": "employee", + "nodeType": "VariableDeclaration", + "scope": 61, + "src": "529:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + }, + "typeName": null, + "value": null, + "visibility": "internal" + } + ], + "id": 51, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 48, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "544:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 50, + "indexExpression": { + "argumentTypes": null, + "id": 49, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 45, + "src": "554:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "544:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "529:36:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 56, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 53, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 47, + "src": "579:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + }, + "id": 54, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "id", + "nodeType": "MemberAccess", + "referencedDeclaration": 4, + "src": "579:11:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "307830", + "id": 55, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "594:3:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0x0" + }, + "src": "579:18:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 52, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 471, + "src": "572:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 57, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "572:26:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 58, + "nodeType": "ExpressionStatement", + "src": "572:26:0" + }, + { + "id": 59, + "nodeType": "PlaceholderStatement", + "src": "605:1:0" + } + ] + }, + "id": 61, + "name": "employeeExist", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 46, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 45, + "name": "employeeId", + "nodeType": "VariableDeclaration", + "scope": 61, + "src": "502:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 44, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "502:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "501:20:0" + }, + "src": "479:133:0", + "visibility": "internal" + }, + { + "body": { + "id": 78, + "nodeType": "Block", + "src": "662:91:0", + "statements": [ + { + "assignments": [ + 65 + ], + "declarations": [ + { + "constant": false, + "id": 65, + "name": "employee", + "nodeType": "VariableDeclaration", + "scope": 79, + "src": "669:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + }, + "typeName": null, + "value": null, + "visibility": "internal" + } + ], + "id": 69, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 66, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "684:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 68, + "indexExpression": { + "argumentTypes": null, + "id": 67, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 63, + "src": "694:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "684:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "669:36:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 74, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 71, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 65, + "src": "720:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + }, + "id": 72, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "id", + "nodeType": "MemberAccess", + "referencedDeclaration": 4, + "src": "720:11:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "307830", + "id": 73, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "735:3:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0x0" + }, + "src": "720:18:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 70, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 471, + "src": "712:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 75, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "712:27:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 76, + "nodeType": "ExpressionStatement", + "src": "712:27:0" + }, + { + "id": 77, + "nodeType": "PlaceholderStatement", + "src": "746:1:0" + } + ] + }, + "id": 79, + "name": "addressNotExist", + "nodeType": "ModifierDefinition", + "parameters": { + "id": 64, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 63, + "name": "employeeId", + "nodeType": "VariableDeclaration", + "scope": 79, + "src": "642:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 62, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "642:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "641:20:0" + }, + "src": "617:136:0", + "visibility": "internal" + }, + { + "body": { + "id": 86, + "nodeType": "Block", + "src": "795:25:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 84, + "name": "owner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 19, + "src": "809:5:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "functionReturnParameters": 83, + "id": 85, + "nodeType": "Return", + "src": "802:12:0" + } + ] + }, + "id": 87, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [], + "name": "getOwner", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 80, + "nodeType": "ParameterList", + "parameters": [], + "src": "774:2:0" + }, + "payable": false, + "returnParameters": { + "id": 83, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 82, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 87, + "src": "786:7:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 81, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "786:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "785:9:0" + }, + "scope": 370, + "src": "757:63:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 121, + "nodeType": "Block", + "src": "873:162:0", + "statements": [ + { + "assignments": [ + 93 + ], + "declarations": [ + { + "constant": false, + "id": 93, + "name": "payment", + "nodeType": "VariableDeclaration", + "scope": 122, + "src": "880:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 92, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "880:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 106, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 104, + "name": "payDuration", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12, + "src": "949:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 99, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 89, + "src": "923:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_memory_ptr", + "typeString": "struct Payroll.Employee memory" + } + }, + "id": 100, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "lastPayday", + "nodeType": "MemberAccess", + "referencedDeclaration": 8, + "src": "923:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 97, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 482, + "src": "915:3:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 98, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sub", + "nodeType": "MemberAccess", + "referencedDeclaration": 443, + "src": "915:7:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 101, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "915:28:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 94, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 89, + "src": "895:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_memory_ptr", + "typeString": "struct Payroll.Employee memory" + } + }, + "id": 95, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "salary", + "nodeType": "MemberAccess", + "referencedDeclaration": 6, + "src": "895:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 96, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "mul", + "nodeType": "MemberAccess", + "referencedDeclaration": 405, + "src": "895:19:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 102, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "895:49:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 103, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "div", + "nodeType": "MemberAccess", + "referencedDeclaration": 423, + "src": "895:53:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 105, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "895:66:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "880:81:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 111, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 107, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 89, + "src": "968:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_memory_ptr", + "typeString": "struct Payroll.Employee memory" + } + }, + "id": 109, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "lastPayday", + "nodeType": "MemberAccess", + "referencedDeclaration": 8, + "src": "968:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 110, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 482, + "src": "990:3:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "968:25:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 112, + "nodeType": "ExpressionStatement", + "src": "968:25:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 118, + "name": "payment", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 93, + "src": "1021:7:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 113, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 89, + "src": "1000:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_memory_ptr", + "typeString": "struct Payroll.Employee memory" + } + }, + "id": 116, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "id", + "nodeType": "MemberAccess", + "referencedDeclaration": 4, + "src": "1000:11:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 117, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1000:20:0", + "typeDescriptions": { + "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 119, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1000:29:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 120, + "nodeType": "ExpressionStatement", + "src": "1000:29:0" + } + ] + }, + "id": 122, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [], + "name": "_partialPaid", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 90, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 89, + "name": "employee", + "nodeType": "VariableDeclaration", + "scope": 122, + "src": "846:17:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_memory_ptr", + "typeString": "struct Payroll.Employee memory" + }, + "typeName": { + "contractScope": null, + "id": 88, + "name": "Employee", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 9, + "src": "846:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "845:19:0" + }, + "payable": false, + "returnParameters": { + "id": 91, + "nodeType": "ParameterList", + "parameters": [], + "src": "873:0:0" + }, + "scope": 370, + "src": "824:211:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "private" + }, + { + "body": { + "id": 155, + "nodeType": "Block", + "src": "1132:151:0", + "statements": [ + { + "assignments": [ + 134 + ], + "declarations": [ + { + "constant": false, + "id": 134, + "name": "employee", + "nodeType": "VariableDeclaration", + "scope": 156, + "src": "1139:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + }, + "typeName": null, + "value": null, + "visibility": "internal" + } + ], + "id": 138, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 135, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "1154:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 137, + "indexExpression": { + "argumentTypes": null, + "id": 136, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 124, + "src": "1164:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1154:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1139:36:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 147, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 139, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "1182:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 141, + "indexExpression": { + "argumentTypes": null, + "id": 140, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 124, + "src": "1192:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "1182:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 143, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 124, + "src": "1215:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 144, + "name": "salary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 126, + "src": "1227:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 145, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 482, + "src": "1235:3:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 142, + "name": "Employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9, + "src": "1206:8:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_Employee_$9_storage_ptr_$", + "typeString": "type(struct Payroll.Employee storage pointer)" + } + }, + "id": 146, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1206:33:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_memory", + "typeString": "struct Payroll.Employee memory" + } + }, + "src": "1182:57:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "id": 148, + "nodeType": "ExpressionStatement", + "src": "1182:57:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 153, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 149, + "name": "totalSalary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "1246:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "+=", + "rightHandSide": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 152, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 150, + "name": "salary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 126, + "src": "1261:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 151, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1270:7:0", + "subdenomination": "ether", + "typeDescriptions": { + "typeIdentifier": "t_rational_1000000000000000000_by_1", + "typeString": "int_const 1000000000000000000" + }, + "value": "1" + }, + "src": "1261:16:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1246:31:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 154, + "nodeType": "ExpressionStatement", + "src": "1246:31:0" + } + ] + }, + "id": 156, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": [], + "id": 129, + "modifierName": { + "argumentTypes": null, + "id": 128, + "name": "onlyOwner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 43, + "src": "1094:9:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "1094:9:0" + }, + { + "arguments": [ + { + "argumentTypes": null, + "id": 131, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 124, + "src": "1120:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 132, + "modifierName": { + "argumentTypes": null, + "id": 130, + "name": "addressNotExist", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 79, + "src": "1104:15:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_address_$", + "typeString": "modifier (address)" + } + }, + "nodeType": "ModifierInvocation", + "src": "1104:27:0" + } + ], + "name": "addEmployee", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 127, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 124, + "name": "employeeId", + "nodeType": "VariableDeclaration", + "scope": 156, + "src": "1061:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 123, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1061:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 126, + "name": "salary", + "nodeType": "VariableDeclaration", + "scope": 156, + "src": "1081:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 125, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1081:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1060:33:0" + }, + "payable": false, + "returnParameters": { + "id": 133, + "nodeType": "ParameterList", + "parameters": [], + "src": "1132:0:0" + }, + "scope": 370, + "src": "1040:243:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 188, + "nodeType": "Block", + "src": "1368:166:0", + "statements": [ + { + "assignments": [ + 166 + ], + "declarations": [ + { + "constant": false, + "id": 166, + "name": "employee", + "nodeType": "VariableDeclaration", + "scope": 189, + "src": "1375:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + }, + "typeName": null, + "value": null, + "visibility": "internal" + } + ], + "id": 170, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 167, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "1390:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 169, + "indexExpression": { + "argumentTypes": null, + "id": 168, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 158, + "src": "1400:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1390:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1375:36:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 172, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 166, + "src": "1431:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + ], + "id": 171, + "name": "_partialPaid", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 122, + "src": "1418:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_struct$_Employee_$9_memory_ptr_$returns$__$", + "typeString": "function (struct Payroll.Employee memory)" + } + }, + "id": 173, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1418:22:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 174, + "nodeType": "ExpressionStatement", + "src": "1418:22:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 178, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "delete", + "prefix": true, + "src": "1447:28:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 175, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "1454:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 177, + "indexExpression": { + "argumentTypes": null, + "id": 176, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 158, + "src": "1464:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "1454:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 179, + "nodeType": "ExpressionStatement", + "src": "1447:28:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 186, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 180, + "name": "totalSalary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "1482:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 183, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 166, + "src": "1512:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + }, + "id": 184, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "salary", + "nodeType": "MemberAccess", + "referencedDeclaration": 6, + "src": "1512:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 181, + "name": "totalSalary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "1496:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 182, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sub", + "nodeType": "MemberAccess", + "referencedDeclaration": 443, + "src": "1496:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 185, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1496:32:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1482:46:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 187, + "nodeType": "ExpressionStatement", + "src": "1482:46:0" + } + ] + }, + "id": 189, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": [], + "id": 161, + "modifierName": { + "argumentTypes": null, + "id": 160, + "name": "onlyOwner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 43, + "src": "1332:9:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "1332:9:0" + }, + { + "arguments": [ + { + "argumentTypes": null, + "id": 163, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 158, + "src": "1356:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 164, + "modifierName": { + "argumentTypes": null, + "id": 162, + "name": "employeeExist", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 61, + "src": "1342:13:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_address_$", + "typeString": "modifier (address)" + } + }, + "nodeType": "ModifierInvocation", + "src": "1342:25:0" + } + ], + "name": "removeEmployee", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 159, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 158, + "name": "employeeId", + "nodeType": "VariableDeclaration", + "scope": 189, + "src": "1312:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 157, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1312:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1311:20:0" + }, + "payable": false, + "returnParameters": { + "id": 165, + "nodeType": "ParameterList", + "parameters": [], + "src": "1368:0:0" + }, + "scope": 370, + "src": "1288:246:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 243, + "nodeType": "Block", + "src": "1633:286:0", + "statements": [ + { + "assignments": [ + 201 + ], + "declarations": [ + { + "constant": false, + "id": 201, + "name": "employee", + "nodeType": "VariableDeclaration", + "scope": 244, + "src": "1640:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + }, + "typeName": null, + "value": null, + "visibility": "internal" + } + ], + "id": 205, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 202, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "1655:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 204, + "indexExpression": { + "argumentTypes": null, + "id": 203, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 191, + "src": "1665:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1655:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "1640:36:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 207, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 201, + "src": "1696:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + ], + "id": 206, + "name": "_partialPaid", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 122, + "src": "1683:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_struct$_Employee_$9_memory_ptr_$returns$__$", + "typeString": "function (struct Payroll.Employee memory)" + } + }, + "id": 208, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1683:22:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 209, + "nodeType": "ExpressionStatement", + "src": "1683:22:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 216, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 210, + "name": "totalSalary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "1712:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 213, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 201, + "src": "1742:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + }, + "id": 214, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "salary", + "nodeType": "MemberAccess", + "referencedDeclaration": 6, + "src": "1742:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 211, + "name": "totalSalary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "1726:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 212, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sub", + "nodeType": "MemberAccess", + "referencedDeclaration": 443, + "src": "1726:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 215, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1726:32:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1712:46:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 217, + "nodeType": "ExpressionStatement", + "src": "1712:46:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 226, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 218, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "1765:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 220, + "indexExpression": { + "argumentTypes": null, + "id": 219, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 191, + "src": "1775:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1765:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "id": 221, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "salary", + "nodeType": "MemberAccess", + "referencedDeclaration": 6, + "src": "1765:28:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "31", + "id": 224, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1807:7:0", + "subdenomination": "ether", + "typeDescriptions": { + "typeIdentifier": "t_rational_1000000000000000000_by_1", + "typeString": "int_const 1000000000000000000" + }, + "value": "1" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_1000000000000000000_by_1", + "typeString": "int_const 1000000000000000000" + } + ], + "expression": { + "argumentTypes": null, + "id": 222, + "name": "salary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 193, + "src": "1796:6:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 223, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "mul", + "nodeType": "MemberAccess", + "referencedDeclaration": 405, + "src": "1796:10:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 225, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1796:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1765:50:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 227, + "nodeType": "ExpressionStatement", + "src": "1765:50:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 234, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 228, + "name": "totalSalary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "1822:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 231, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 201, + "src": "1852:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + }, + "id": 232, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "salary", + "nodeType": "MemberAccess", + "referencedDeclaration": 6, + "src": "1852:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 229, + "name": "totalSalary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "1836:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 230, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "add", + "nodeType": "MemberAccess", + "referencedDeclaration": 467, + "src": "1836:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 233, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1836:32:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1822:46:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 235, + "nodeType": "ExpressionStatement", + "src": "1822:46:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 241, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 236, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "1875:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 238, + "indexExpression": { + "argumentTypes": null, + "id": 237, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 191, + "src": "1885:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1875:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "id": 239, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "lastPayday", + "nodeType": "MemberAccess", + "referencedDeclaration": 8, + "src": "1875:32:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 240, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 482, + "src": "1910:3:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1875:38:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 242, + "nodeType": "ExpressionStatement", + "src": "1875:38:0" + } + ] + }, + "id": 244, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": [], + "id": 196, + "modifierName": { + "argumentTypes": null, + "id": 195, + "name": "onlyOwner", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 43, + "src": "1596:9:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$__$", + "typeString": "modifier ()" + } + }, + "nodeType": "ModifierInvocation", + "src": "1596:9:0" + }, + { + "arguments": [ + { + "argumentTypes": null, + "id": 198, + "name": "employeeId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 191, + "src": "1620:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 199, + "modifierName": { + "argumentTypes": null, + "id": 197, + "name": "employeeExist", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 61, + "src": "1606:13:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_address_$", + "typeString": "modifier (address)" + } + }, + "nodeType": "ModifierInvocation", + "src": "1606:25:0" + } + ], + "name": "updateEmployee", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 194, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 191, + "name": "employeeId", + "nodeType": "VariableDeclaration", + "scope": 244, + "src": "1563:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 190, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1563:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 193, + "name": "salary", + "nodeType": "VariableDeclaration", + "scope": 244, + "src": "1583:11:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 192, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1583:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1562:33:0" + }, + "payable": false, + "returnParameters": { + "id": 200, + "nodeType": "ParameterList", + "parameters": [], + "src": "1633:0:0" + }, + "scope": 370, + "src": "1539:380:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 252, + "nodeType": "Block", + "src": "1966:32:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 249, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 493, + "src": "1980:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Payroll_$370", + "typeString": "contract Payroll" + } + }, + "id": 250, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "1980:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 248, + "id": 251, + "nodeType": "Return", + "src": "1973:19:0" + } + ] + }, + "id": 253, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [], + "name": "addFund", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 245, + "nodeType": "ParameterList", + "parameters": [], + "src": "1940:2:0" + }, + "payable": true, + "returnParameters": { + "id": 248, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 247, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 253, + "src": "1960:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 246, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1960:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1959:6:0" + }, + "scope": 370, + "src": "1924:74:0", + "stateMutability": "payable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 270, + "nodeType": "Block", + "src": "2045:81:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 261, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 259, + "name": "totalSalary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "2060:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 260, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2075:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "2060:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 258, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 471, + "src": "2052:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 262, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2052:25:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 263, + "nodeType": "ExpressionStatement", + "src": "2052:25:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 267, + "name": "totalSalary", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 14, + "src": "2108:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 264, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 493, + "src": "2091:4:0", + "typeDescriptions": { + "typeIdentifier": "t_contract$_Payroll_$370", + "typeString": "contract Payroll" + } + }, + "id": 265, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "balance", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2091:12:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 266, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "div", + "nodeType": "MemberAccess", + "referencedDeclaration": 423, + "src": "2091:16:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 268, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2091:29:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 257, + "id": 269, + "nodeType": "Return", + "src": "2084:36:0" + } + ] + }, + "id": 271, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [], + "name": "calculateRunway", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 254, + "nodeType": "ParameterList", + "parameters": [], + "src": "2027:2:0" + }, + "payable": false, + "returnParameters": { + "id": 257, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 256, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 271, + "src": "2039:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 255, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2039:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2038:6:0" + }, + "scope": 370, + "src": "2003:123:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 281, + "nodeType": "Block", + "src": "2171:41:0", + "statements": [ + { + "expression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 279, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [], + "expression": { + "argumentTypes": [], + "id": 276, + "name": "calculateRunway", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 271, + "src": "2185:15:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$__$returns$_t_uint256_$", + "typeString": "function () returns (uint256)" + } + }, + "id": 277, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2185:17:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 278, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2205:1:0", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "2185:21:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "functionReturnParameters": 275, + "id": 280, + "nodeType": "Return", + "src": "2178:28:0" + } + ] + }, + "id": 282, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [], + "name": "hasEnoughFund", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 272, + "nodeType": "ParameterList", + "parameters": [], + "src": "2153:2:0" + }, + "payable": false, + "returnParameters": { + "id": 275, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 274, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 282, + "src": "2165:4:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 273, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2165:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2164:6:0" + }, + "scope": 370, + "src": "2131:81:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 325, + "nodeType": "Block", + "src": "2262:236:0", + "statements": [ + { + "assignments": [ + 289 + ], + "declarations": [ + { + "constant": false, + "id": 289, + "name": "employee", + "nodeType": "VariableDeclaration", + "scope": 326, + "src": "2269:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + }, + "typeName": null, + "value": null, + "visibility": "internal" + } + ], + "id": 294, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 290, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "2284:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 293, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 291, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 480, + "src": "2294:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 292, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2294:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2284:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2269:36:0" + }, + { + "assignments": [ + 296 + ], + "declarations": [ + { + "constant": false, + "id": 296, + "name": "nextPayday", + "nodeType": "VariableDeclaration", + "scope": 326, + "src": "2313:15:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 295, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2313:4:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 301, + "initialValue": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 300, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 297, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 289, + "src": "2331:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + }, + "id": 298, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "lastPayday", + "nodeType": "MemberAccess", + "referencedDeclaration": 8, + "src": "2331:19:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "argumentTypes": null, + "id": 299, + "name": "payDuration", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 12, + "src": "2353:11:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2331:33:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2313:51:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 305, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 303, + "name": "nextPayday", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 296, + "src": "2378:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "id": 304, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 482, + "src": "2391:3:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2378:16:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 302, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 471, + "src": "2371:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 306, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2371:24:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 307, + "nodeType": "ExpressionStatement", + "src": "2371:24:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 314, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 308, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "2403:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 311, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 309, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 480, + "src": "2413:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 310, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2413:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2403:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "id": 312, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "lastPayday", + "nodeType": "MemberAccess", + "referencedDeclaration": 8, + "src": "2403:32:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 313, + "name": "nextPayday", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 296, + "src": "2438:10:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2403:45:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 315, + "nodeType": "ExpressionStatement", + "src": "2403:45:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 321, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 289, + "src": "2476:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + }, + "id": 322, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "salary", + "nodeType": "MemberAccess", + "referencedDeclaration": 6, + "src": "2476:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 316, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 289, + "src": "2455:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + }, + "id": 319, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "id", + "nodeType": "MemberAccess", + "referencedDeclaration": 4, + "src": "2455:11:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 320, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2455:20:0", + "typeDescriptions": { + "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 323, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2455:37:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 324, + "nodeType": "ExpressionStatement", + "src": "2455:37:0" + } + ] + }, + "id": 326, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 285, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 480, + "src": "2250:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 286, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2250:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 287, + "modifierName": { + "argumentTypes": null, + "id": 284, + "name": "employeeExist", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 61, + "src": "2236:13:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_address_$", + "typeString": "modifier (address)" + } + }, + "nodeType": "ModifierInvocation", + "src": "2236:25:0" + } + ], + "name": "getPaid", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 283, + "nodeType": "ParameterList", + "parameters": [], + "src": "2233:2:0" + }, + "payable": false, + "returnParameters": { + "id": 288, + "nodeType": "ParameterList", + "parameters": [], + "src": "2262:0:0" + }, + "scope": 370, + "src": "2217:281:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 368, + "nodeType": "Block", + "src": "2607:197:0", + "statements": [ + { + "assignments": [ + 338 + ], + "declarations": [ + { + "constant": false, + "id": 338, + "name": "employee", + "nodeType": "VariableDeclaration", + "scope": 369, + "src": "2614:12:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + }, + "typeName": null, + "value": null, + "visibility": "internal" + } + ], + "id": 343, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 339, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "2629:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 342, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 340, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 480, + "src": "2639:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 341, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2639:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "2629:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "2614:36:0" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 345, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 338, + "src": "2670:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + ], + "id": 344, + "name": "_partialPaid", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 122, + "src": "2656:12:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_struct$_Employee_$9_memory_ptr_$returns$__$", + "typeString": "function (struct Payroll.Employee memory)" + } + }, + "id": 346, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2656:23:0", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 347, + "nodeType": "ExpressionStatement", + "src": "2656:23:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 352, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "delete", + "prefix": true, + "src": "2685:28:0", + "subExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 348, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "2692:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 351, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 349, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 480, + "src": "2702:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 350, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2702:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "2692:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 353, + "nodeType": "ExpressionStatement", + "src": "2685:28:0" + }, + { + "expression": { + "argumentTypes": null, + "id": 366, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 354, + "name": "employees", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23, + "src": "2719:9:0", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Employee_$9_storage_$", + "typeString": "mapping(address => struct Payroll.Employee storage ref)" + } + }, + "id": 356, + "indexExpression": { + "argumentTypes": null, + "id": 355, + "name": "newAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "2729:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "2719:21:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 358, + "name": "newAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "2752:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "31", + "id": 362, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2784:7:0", + "subdenomination": "ether", + "typeDescriptions": { + "typeIdentifier": "t_rational_1000000000000000000_by_1", + "typeString": "int_const 1000000000000000000" + }, + "value": "1" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_1000000000000000000_by_1", + "typeString": "int_const 1000000000000000000" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 359, + "name": "employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 338, + "src": "2764:8:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage_ptr", + "typeString": "struct Payroll.Employee storage pointer" + } + }, + "id": 360, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "salary", + "nodeType": "MemberAccess", + "referencedDeclaration": 6, + "src": "2764:15:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 361, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "mul", + "nodeType": "MemberAccess", + "referencedDeclaration": 405, + "src": "2764:19:0", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 363, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2764:28:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 364, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 482, + "src": "2794:3:0", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 357, + "name": "Employee", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 9, + "src": "2743:8:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_Employee_$9_storage_ptr_$", + "typeString": "type(struct Payroll.Employee storage pointer)" + } + }, + "id": 365, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2743:55:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_memory", + "typeString": "struct Payroll.Employee memory" + } + }, + "src": "2719:79:0", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Employee_$9_storage", + "typeString": "struct Payroll.Employee storage ref" + } + }, + "id": 367, + "nodeType": "ExpressionStatement", + "src": "2719:79:0" + } + ] + }, + "id": 369, + "implemented": true, + "isConstructor": false, + "isDeclaredConst": false, + "modifiers": [ + { + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 331, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 480, + "src": "2567:3:0", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 332, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2567:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 333, + "modifierName": { + "argumentTypes": null, + "id": 330, + "name": "employeeExist", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 61, + "src": "2553:13:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_address_$", + "typeString": "modifier (address)" + } + }, + "nodeType": "ModifierInvocation", + "src": "2553:25:0" + }, + { + "arguments": [ + { + "argumentTypes": null, + "id": 335, + "name": "newAddress", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "2595:10:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "id": 336, + "modifierName": { + "argumentTypes": null, + "id": 334, + "name": "addressNotExist", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 79, + "src": "2579:15:0", + "typeDescriptions": { + "typeIdentifier": "t_modifier$_t_address_$", + "typeString": "modifier (address)" + } + }, + "nodeType": "ModifierInvocation", + "src": "2579:27:0" + } + ], + "name": "changePaymentAddress", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 329, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 328, + "name": "newAddress", + "nodeType": "VariableDeclaration", + "scope": 369, + "src": "2533:18:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 327, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2533:7:0", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2532:20:0" + }, + "payable": false, + "returnParameters": { + "id": 337, + "nodeType": "ParameterList", + "parameters": [], + "src": "2607:0:0" + }, + "scope": 370, + "src": "2503:301:0", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + } + ], + "scope": 371, + "src": "53:2754:0" + } + ], + "src": "0:2808:0" + }, + "compiler": { + "name": "solc", + "version": "0.4.19+commit.c4cbbb05.Emscripten.clang" + }, + "networks": {}, + "schemaVersion": "2.0.0", + "updatedAt": "2018-03-25T05:48:04.356Z" +}