diff --git a/client/src/contracts/Election.json b/client/src/contracts/Election.json new file mode 100644 index 0000000..c5029e0 --- /dev/null +++ b/client/src/contracts/Election.json @@ -0,0 +1,5204 @@ +{ + "contractName": "Election", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_candidateId", + "type": "uint256" + } + ], + "name": "Voted", + "type": "event" + }, + { + "inputs": [], + "name": "candidatesCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_candidateId", + "type": "uint256" + } + ], + "name": "vote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_candidateId", + "type": "uint256" + } + ], + "name": "getCandidateDetails", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_candidateId\",\"type\":\"uint256\"}],\"name\":\"Voted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"candidatesCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_candidateId\",\"type\":\"uint256\"}],\"name\":\"getCandidateDetails\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_candidateId\",\"type\":\"uint256\"}],\"name\":\"vote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/Voting.sol\":\"Election\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"project:/contracts/Voting.sol\":{\"keccak256\":\"0x2767125c2fa3c13d195aa87be0cb0c3ab3566b7291b050558db7ba5a4f834d7f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bd5b60c2fe76e04e7783b2441fe5d95be5e12820d592f3b41b32d7c940f3f21a\",\"dweb:/ipfs/QmR2SedErX6k7WNNyH9tNDzmzHMVoevAo5YVqArEP8tTD9\"]}},\"version\":1}", + "bytecode": "0x6080604052600060025534801561001557600080fd5b5061005a6040518060400160405280600b81526020017f43616e64696461746520310000000000000000000000000000000000000000008152506100a360201b60201c565b61009e6040518060400160405280600b81526020017f43616e64696461746520320000000000000000000000000000000000000000008152506100a360201b60201c565b6102a8565b60405180606001604052806002548152602001828152602001600081525060008060025481526020019081526020016000206000820151816000015560208201518160010190805190602001906100fb929190610124565b50604082015181600201559050506002600081548092919061011c90610200565b919050555050565b82805461013090610277565b90600052602060002090601f0160209004810192826101525760008555610199565b82601f1061016b57805160ff1916838001178555610199565b82800160010185558215610199579182015b8281111561019857825182559160200191906001019061017d565b5b5090506101a691906101aa565b5090565b5b808211156101c35760008160009055506001016101ab565b5090565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000819050919050565b600061020b826101f6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361023d5761023c6101c7565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061028f57607f821691505b6020821081036102a2576102a1610248565b5b50919050565b61069b806102b76000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80630121b93f1461004657806327f9fd50146100625780632d35a8a214610093575b600080fd5b610060600480360381019061005b9190610396565b6100b1565b005b61007c60048036038101906100779190610396565b610241565b60405161008a92919061046b565b60405180910390f35b61009b610355565b6040516100a8919061049b565b60405180910390f35b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561013e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013590610502565b60405180910390fd5b60008110158015610150575060025481105b61018f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101869061056e565b60405180910390fd5b60008082815260200190815260200160002060020160008154809291906101b5906105bd565b919050555060018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550807f7f511e347bf51eed3be100b3194247d5207f05f3b33de7d31e3e8ee73199a04960405160405180910390a250565b60606000808310158015610256575060025483105b610295576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161028c9061056e565b60405180910390fd5b600080848152602001908152602001600020600101600080858152602001908152602001600020600201548180546102cc90610634565b80601f01602080910402602001604051908101604052809291908181526020018280546102f890610634565b80156103455780601f1061031a57610100808354040283529160200191610345565b820191906000526020600020905b81548152906001019060200180831161032857829003601f168201915b5050505050915091509150915091565b60025481565b600080fd5b6000819050919050565b61037381610360565b811461037e57600080fd5b50565b6000813590506103908161036a565b92915050565b6000602082840312156103ac576103ab61035b565b5b60006103ba84828501610381565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156103fd5780820151818401526020810190506103e2565b8381111561040c576000848401525b50505050565b6000601f19601f8301169050919050565b600061042e826103c3565b61043881856103ce565b93506104488185602086016103df565b61045181610412565b840191505092915050565b61046581610360565b82525050565b600060408201905081810360008301526104858185610423565b9050610494602083018461045c565b9392505050565b60006020820190506104b0600083018461045c565b92915050565b7f596f75206861766520616c726561647920766f74656400000000000000000000600082015250565b60006104ec6016836103ce565b91506104f7826104b6565b602082019050919050565b6000602082019050818103600083015261051b816104df565b9050919050565b7f496e76616c69642063616e646964617465204944000000000000000000000000600082015250565b60006105586014836103ce565b915061056382610522565b602082019050919050565b600060208201905081810360008301526105878161054b565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006105c882610360565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036105fa576105f961058e565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061064c57607f821691505b60208210810361065f5761065e610605565b5b5091905056fea2646970667358221220f0e2b2eb6f7301395edc8fa05541e42a2b16d7448995178b8bc1f0da7c52db1c64736f6c634300080e0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c80630121b93f1461004657806327f9fd50146100625780632d35a8a214610093575b600080fd5b610060600480360381019061005b9190610396565b6100b1565b005b61007c60048036038101906100779190610396565b610241565b60405161008a92919061046b565b60405180910390f35b61009b610355565b6040516100a8919061049b565b60405180910390f35b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561013e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013590610502565b60405180910390fd5b60008110158015610150575060025481105b61018f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101869061056e565b60405180910390fd5b60008082815260200190815260200160002060020160008154809291906101b5906105bd565b919050555060018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550807f7f511e347bf51eed3be100b3194247d5207f05f3b33de7d31e3e8ee73199a04960405160405180910390a250565b60606000808310158015610256575060025483105b610295576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161028c9061056e565b60405180910390fd5b600080848152602001908152602001600020600101600080858152602001908152602001600020600201548180546102cc90610634565b80601f01602080910402602001604051908101604052809291908181526020018280546102f890610634565b80156103455780601f1061031a57610100808354040283529160200191610345565b820191906000526020600020905b81548152906001019060200180831161032857829003601f168201915b5050505050915091509150915091565b60025481565b600080fd5b6000819050919050565b61037381610360565b811461037e57600080fd5b50565b6000813590506103908161036a565b92915050565b6000602082840312156103ac576103ab61035b565b5b60006103ba84828501610381565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156103fd5780820151818401526020810190506103e2565b8381111561040c576000848401525b50505050565b6000601f19601f8301169050919050565b600061042e826103c3565b61043881856103ce565b93506104488185602086016103df565b61045181610412565b840191505092915050565b61046581610360565b82525050565b600060408201905081810360008301526104858185610423565b9050610494602083018461045c565b9392505050565b60006020820190506104b0600083018461045c565b92915050565b7f596f75206861766520616c726561647920766f74656400000000000000000000600082015250565b60006104ec6016836103ce565b91506104f7826104b6565b602082019050919050565b6000602082019050818103600083015261051b816104df565b9050919050565b7f496e76616c69642063616e646964617465204944000000000000000000000000600082015250565b60006105586014836103ce565b915061056382610522565b602082019050919050565b600060208201905081810360008301526105878161054b565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006105c882610360565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036105fa576105f961058e565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061064c57607f821691505b60208210810361065f5761065e610605565b5b5091905056fea2646970667358221220f0e2b2eb6f7301395edc8fa05541e42a2b16d7448995178b8bc1f0da7c52db1c64736f6c634300080e0033", + "immutableReferences": {}, + "generatedSources": [ + { + "ast": { + "nodeType": "YulBlock", + "src": "0:1024:2", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "35:152:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "52:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "55:77:2", + "type": "", + "value": "35408467139433450592217433187231851964531694900788300625387963629091585785856" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "45:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "45:88:2" + }, + "nodeType": "YulExpressionStatement", + "src": "45:88:2" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "149:1:2", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "152:4:2", + "type": "", + "value": "0x11" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "142:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "142:15:2" + }, + "nodeType": "YulExpressionStatement", + "src": "142:15:2" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "173:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "176:4:2", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "166:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "166:15:2" + }, + "nodeType": "YulExpressionStatement", + "src": "166:15:2" + } + ] + }, + "name": "panic_error_0x11", + "nodeType": "YulFunctionDefinition", + "src": "7:180:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "238:32:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "248:16:2", + "value": { + "name": "value", + "nodeType": "YulIdentifier", + "src": "259:5:2" + }, + "variableNames": [ + { + "name": "cleaned", + "nodeType": "YulIdentifier", + "src": "248:7:2" + } + ] + } + ] + }, + "name": "cleanup_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "220:5:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "cleaned", + "nodeType": "YulTypedName", + "src": "230:7:2", + "type": "" + } + ], + "src": "193:77:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "319:190:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "329:33:2", + "value": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "356:5:2" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "338:17:2" + }, + "nodeType": "YulFunctionCall", + "src": "338:24:2" + }, + "variableNames": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "329:5:2" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "452:22:2", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nodeType": "YulIdentifier", + "src": "454:16:2" + }, + "nodeType": "YulFunctionCall", + "src": "454:18:2" + }, + "nodeType": "YulExpressionStatement", + "src": "454:18:2" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "377:5:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "384:66:2", + "type": "", + "value": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + } + ], + "functionName": { + "name": "eq", + "nodeType": "YulIdentifier", + "src": "374:2:2" + }, + "nodeType": "YulFunctionCall", + "src": "374:77:2" + }, + "nodeType": "YulIf", + "src": "371:103:2" + }, + { + "nodeType": "YulAssignment", + "src": "483:20:2", + "value": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "494:5:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "501:1:2", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "490:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "490:13:2" + }, + "variableNames": [ + { + "name": "ret", + "nodeType": "YulIdentifier", + "src": "483:3:2" + } + ] + } + ] + }, + "name": "increment_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "305:5:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "ret", + "nodeType": "YulTypedName", + "src": "315:3:2", + "type": "" + } + ], + "src": "276:233:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "543:152:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "560:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "563:77:2", + "type": "", + "value": "35408467139433450592217433187231851964531694900788300625387963629091585785856" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "553:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "553:88:2" + }, + "nodeType": "YulExpressionStatement", + "src": "553:88:2" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "657:1:2", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "660:4:2", + "type": "", + "value": "0x22" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "650:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "650:15:2" + }, + "nodeType": "YulExpressionStatement", + "src": "650:15:2" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "681:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "684:4:2", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "674:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "674:15:2" + }, + "nodeType": "YulExpressionStatement", + "src": "674:15:2" + } + ] + }, + "name": "panic_error_0x22", + "nodeType": "YulFunctionDefinition", + "src": "515:180:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "752:269:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "762:22:2", + "value": { + "arguments": [ + { + "name": "data", + "nodeType": "YulIdentifier", + "src": "776:4:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "782:1:2", + "type": "", + "value": "2" + } + ], + "functionName": { + "name": "div", + "nodeType": "YulIdentifier", + "src": "772:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "772:12:2" + }, + "variableNames": [ + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "762:6:2" + } + ] + }, + { + "nodeType": "YulVariableDeclaration", + "src": "793:38:2", + "value": { + "arguments": [ + { + "name": "data", + "nodeType": "YulIdentifier", + "src": "823:4:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "829:1:2", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "819:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "819:12:2" + }, + "variables": [ + { + "name": "outOfPlaceEncoding", + "nodeType": "YulTypedName", + "src": "797:18:2", + "type": "" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "870:51:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "884:27:2", + "value": { + "arguments": [ + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "898:6:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "906:4:2", + "type": "", + "value": "0x7f" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "894:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "894:17:2" + }, + "variableNames": [ + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "884:6:2" + } + ] + } + ] + }, + "condition": { + "arguments": [ + { + "name": "outOfPlaceEncoding", + "nodeType": "YulIdentifier", + "src": "850:18:2" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "843:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "843:26:2" + }, + "nodeType": "YulIf", + "src": "840:81:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "973:42:2", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x22", + "nodeType": "YulIdentifier", + "src": "987:16:2" + }, + "nodeType": "YulFunctionCall", + "src": "987:18:2" + }, + "nodeType": "YulExpressionStatement", + "src": "987:18:2" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "outOfPlaceEncoding", + "nodeType": "YulIdentifier", + "src": "937:18:2" + }, + { + "arguments": [ + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "960:6:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "968:2:2", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "lt", + "nodeType": "YulIdentifier", + "src": "957:2:2" + }, + "nodeType": "YulFunctionCall", + "src": "957:14:2" + } + ], + "functionName": { + "name": "eq", + "nodeType": "YulIdentifier", + "src": "934:2:2" + }, + "nodeType": "YulFunctionCall", + "src": "934:38:2" + }, + "nodeType": "YulIf", + "src": "931:84:2" + } + ] + }, + "name": "extract_byte_array_length", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "data", + "nodeType": "YulTypedName", + "src": "736:4:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "length", + "nodeType": "YulTypedName", + "src": "745:6:2", + "type": "" + } + ], + "src": "701:320:2" + } + ] + }, + "contents": "{\n\n function panic_error_0x11() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x11)\n revert(0, 0x24)\n }\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n function increment_t_uint256(value) -> ret {\n value := cleanup_t_uint256(value)\n if eq(value, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) { panic_error_0x11() }\n ret := add(value, 1)\n }\n\n function panic_error_0x22() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x22)\n revert(0, 0x24)\n }\n\n function extract_byte_array_length(data) -> length {\n length := div(data, 2)\n let outOfPlaceEncoding := and(data, 1)\n if iszero(outOfPlaceEncoding) {\n length := and(length, 0x7f)\n }\n\n if eq(outOfPlaceEncoding, lt(length, 32)) {\n panic_error_0x22()\n }\n }\n\n}\n", + "id": 2, + "language": "Yul", + "name": "#utility.yul" + } + ], + "deployedGeneratedSources": [ + { + "ast": { + "nodeType": "YulBlock", + "src": "0:5759:2", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "47:35:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "57:19:2", + "value": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "73:2:2", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "mload", + "nodeType": "YulIdentifier", + "src": "67:5:2" + }, + "nodeType": "YulFunctionCall", + "src": "67:9:2" + }, + "variableNames": [ + { + "name": "memPtr", + "nodeType": "YulIdentifier", + "src": "57:6:2" + } + ] + } + ] + }, + "name": "allocate_unbounded", + "nodeType": "YulFunctionDefinition", + "returnVariables": [ + { + "name": "memPtr", + "nodeType": "YulTypedName", + "src": "40:6:2", + "type": "" + } + ], + "src": "7:75:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "177:28:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "194:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "197:1:2", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "187:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "187:12:2" + }, + "nodeType": "YulExpressionStatement", + "src": "187:12:2" + } + ] + }, + "name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", + "nodeType": "YulFunctionDefinition", + "src": "88:117:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "300:28:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "317:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "320:1:2", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "310:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "310:12:2" + }, + "nodeType": "YulExpressionStatement", + "src": "310:12:2" + } + ] + }, + "name": "revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db", + "nodeType": "YulFunctionDefinition", + "src": "211:117:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "379:32:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "389:16:2", + "value": { + "name": "value", + "nodeType": "YulIdentifier", + "src": "400:5:2" + }, + "variableNames": [ + { + "name": "cleaned", + "nodeType": "YulIdentifier", + "src": "389:7:2" + } + ] + } + ] + }, + "name": "cleanup_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "361:5:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "cleaned", + "nodeType": "YulTypedName", + "src": "371:7:2", + "type": "" + } + ], + "src": "334:77:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "460:79:2", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "517:16:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "526:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "529:1:2", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "519:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "519:12:2" + }, + "nodeType": "YulExpressionStatement", + "src": "519:12:2" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "483:5:2" + }, + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "508:5:2" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "490:17:2" + }, + "nodeType": "YulFunctionCall", + "src": "490:24:2" + } + ], + "functionName": { + "name": "eq", + "nodeType": "YulIdentifier", + "src": "480:2:2" + }, + "nodeType": "YulFunctionCall", + "src": "480:35:2" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "473:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "473:43:2" + }, + "nodeType": "YulIf", + "src": "470:63:2" + } + ] + }, + "name": "validator_revert_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "453:5:2", + "type": "" + } + ], + "src": "417:122:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "597:87:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "607:29:2", + "value": { + "arguments": [ + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "629:6:2" + } + ], + "functionName": { + "name": "calldataload", + "nodeType": "YulIdentifier", + "src": "616:12:2" + }, + "nodeType": "YulFunctionCall", + "src": "616:20:2" + }, + "variableNames": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "607:5:2" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "672:5:2" + } + ], + "functionName": { + "name": "validator_revert_t_uint256", + "nodeType": "YulIdentifier", + "src": "645:26:2" + }, + "nodeType": "YulFunctionCall", + "src": "645:33:2" + }, + "nodeType": "YulExpressionStatement", + "src": "645:33:2" + } + ] + }, + "name": "abi_decode_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "575:6:2", + "type": "" + }, + { + "name": "end", + "nodeType": "YulTypedName", + "src": "583:3:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "591:5:2", + "type": "" + } + ], + "src": "545:139:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "756:263:2", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "802:83:2", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", + "nodeType": "YulIdentifier", + "src": "804:77:2" + }, + "nodeType": "YulFunctionCall", + "src": "804:79:2" + }, + "nodeType": "YulExpressionStatement", + "src": "804:79:2" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "777:7:2" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "786:9:2" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "773:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "773:23:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "798:2:2", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "769:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "769:32:2" + }, + "nodeType": "YulIf", + "src": "766:119:2" + }, + { + "nodeType": "YulBlock", + "src": "895:117:2", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "910:15:2", + "value": { + "kind": "number", + "nodeType": "YulLiteral", + "src": "924:1:2", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "offset", + "nodeType": "YulTypedName", + "src": "914:6:2", + "type": "" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "939:63:2", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "974:9:2" + }, + { + "name": "offset", + "nodeType": "YulIdentifier", + "src": "985:6:2" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "970:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "970:22:2" + }, + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "994:7:2" + } + ], + "functionName": { + "name": "abi_decode_t_uint256", + "nodeType": "YulIdentifier", + "src": "949:20:2" + }, + "nodeType": "YulFunctionCall", + "src": "949:53:2" + }, + "variableNames": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "939:6:2" + } + ] + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "726:9:2", + "type": "" + }, + { + "name": "dataEnd", + "nodeType": "YulTypedName", + "src": "737:7:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "749:6:2", + "type": "" + } + ], + "src": "690:329:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1084:40:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "1095:22:2", + "value": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1111:5:2" + } + ], + "functionName": { + "name": "mload", + "nodeType": "YulIdentifier", + "src": "1105:5:2" + }, + "nodeType": "YulFunctionCall", + "src": "1105:12:2" + }, + "variableNames": [ + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "1095:6:2" + } + ] + } + ] + }, + "name": "array_length_t_string_memory_ptr", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "1067:5:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "length", + "nodeType": "YulTypedName", + "src": "1077:6:2", + "type": "" + } + ], + "src": "1025:99:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1226:73:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "1243:3:2" + }, + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "1248:6:2" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "1236:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "1236:19:2" + }, + "nodeType": "YulExpressionStatement", + "src": "1236:19:2" + }, + { + "nodeType": "YulAssignment", + "src": "1264:29:2", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "1283:3:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1288:4:2", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1279:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "1279:14:2" + }, + "variableNames": [ + { + "name": "updated_pos", + "nodeType": "YulIdentifier", + "src": "1264:11:2" + } + ] + } + ] + }, + "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "1198:3:2", + "type": "" + }, + { + "name": "length", + "nodeType": "YulTypedName", + "src": "1203:6:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "updated_pos", + "nodeType": "YulTypedName", + "src": "1214:11:2", + "type": "" + } + ], + "src": "1130:169:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1354:258:2", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "1364:10:2", + "value": { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1373:1:2", + "type": "", + "value": "0" + }, + "variables": [ + { + "name": "i", + "nodeType": "YulTypedName", + "src": "1368:1:2", + "type": "" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1433:63:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "dst", + "nodeType": "YulIdentifier", + "src": "1458:3:2" + }, + { + "name": "i", + "nodeType": "YulIdentifier", + "src": "1463:1:2" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1454:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "1454:11:2" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "src", + "nodeType": "YulIdentifier", + "src": "1477:3:2" + }, + { + "name": "i", + "nodeType": "YulIdentifier", + "src": "1482:1:2" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1473:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "1473:11:2" + } + ], + "functionName": { + "name": "mload", + "nodeType": "YulIdentifier", + "src": "1467:5:2" + }, + "nodeType": "YulFunctionCall", + "src": "1467:18:2" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "1447:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "1447:39:2" + }, + "nodeType": "YulExpressionStatement", + "src": "1447:39:2" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "i", + "nodeType": "YulIdentifier", + "src": "1394:1:2" + }, + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "1397:6:2" + } + ], + "functionName": { + "name": "lt", + "nodeType": "YulIdentifier", + "src": "1391:2:2" + }, + "nodeType": "YulFunctionCall", + "src": "1391:13:2" + }, + "nodeType": "YulForLoop", + "post": { + "nodeType": "YulBlock", + "src": "1405:19:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "1407:15:2", + "value": { + "arguments": [ + { + "name": "i", + "nodeType": "YulIdentifier", + "src": "1416:1:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1419:2:2", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1412:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "1412:10:2" + }, + "variableNames": [ + { + "name": "i", + "nodeType": "YulIdentifier", + "src": "1407:1:2" + } + ] + } + ] + }, + "pre": { + "nodeType": "YulBlock", + "src": "1387:3:2", + "statements": [] + }, + "src": "1383:113:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1530:76:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "dst", + "nodeType": "YulIdentifier", + "src": "1580:3:2" + }, + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "1585:6:2" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1576:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "1576:16:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1594:1:2", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "1569:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "1569:27:2" + }, + "nodeType": "YulExpressionStatement", + "src": "1569:27:2" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "i", + "nodeType": "YulIdentifier", + "src": "1511:1:2" + }, + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "1514:6:2" + } + ], + "functionName": { + "name": "gt", + "nodeType": "YulIdentifier", + "src": "1508:2:2" + }, + "nodeType": "YulFunctionCall", + "src": "1508:13:2" + }, + "nodeType": "YulIf", + "src": "1505:101:2" + } + ] + }, + "name": "copy_memory_to_memory", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "src", + "nodeType": "YulTypedName", + "src": "1336:3:2", + "type": "" + }, + { + "name": "dst", + "nodeType": "YulTypedName", + "src": "1341:3:2", + "type": "" + }, + { + "name": "length", + "nodeType": "YulTypedName", + "src": "1346:6:2", + "type": "" + } + ], + "src": "1305:307:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1666:54:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "1676:38:2", + "value": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1694:5:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1701:2:2", + "type": "", + "value": "31" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1690:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "1690:14:2" + }, + { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1710:2:2", + "type": "", + "value": "31" + } + ], + "functionName": { + "name": "not", + "nodeType": "YulIdentifier", + "src": "1706:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "1706:7:2" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "1686:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "1686:28:2" + }, + "variableNames": [ + { + "name": "result", + "nodeType": "YulIdentifier", + "src": "1676:6:2" + } + ] + } + ] + }, + "name": "round_up_to_mul_of_32", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "1649:5:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "result", + "nodeType": "YulTypedName", + "src": "1659:6:2", + "type": "" + } + ], + "src": "1618:102:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1818:272:2", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "1828:53:2", + "value": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "1875:5:2" + } + ], + "functionName": { + "name": "array_length_t_string_memory_ptr", + "nodeType": "YulIdentifier", + "src": "1842:32:2" + }, + "nodeType": "YulFunctionCall", + "src": "1842:39:2" + }, + "variables": [ + { + "name": "length", + "nodeType": "YulTypedName", + "src": "1832:6:2", + "type": "" + } + ] + }, + { + "nodeType": "YulAssignment", + "src": "1890:78:2", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "1956:3:2" + }, + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "1961:6:2" + } + ], + "functionName": { + "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", + "nodeType": "YulIdentifier", + "src": "1897:58:2" + }, + "nodeType": "YulFunctionCall", + "src": "1897:71:2" + }, + "variableNames": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "1890:3:2" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "2003:5:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "2010:4:2", + "type": "", + "value": "0x20" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1999:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "1999:16:2" + }, + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "2017:3:2" + }, + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "2022:6:2" + } + ], + "functionName": { + "name": "copy_memory_to_memory", + "nodeType": "YulIdentifier", + "src": "1977:21:2" + }, + "nodeType": "YulFunctionCall", + "src": "1977:52:2" + }, + "nodeType": "YulExpressionStatement", + "src": "1977:52:2" + }, + { + "nodeType": "YulAssignment", + "src": "2038:46:2", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "2049:3:2" + }, + { + "arguments": [ + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "2076:6:2" + } + ], + "functionName": { + "name": "round_up_to_mul_of_32", + "nodeType": "YulIdentifier", + "src": "2054:21:2" + }, + "nodeType": "YulFunctionCall", + "src": "2054:29:2" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "2045:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "2045:39:2" + }, + "variableNames": [ + { + "name": "end", + "nodeType": "YulIdentifier", + "src": "2038:3:2" + } + ] + } + ] + }, + "name": "abi_encode_t_string_memory_ptr_to_t_string_memory_ptr_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "1799:5:2", + "type": "" + }, + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "1806:3:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "end", + "nodeType": "YulTypedName", + "src": "1814:3:2", + "type": "" + } + ], + "src": "1726:364:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "2161:53:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "2178:3:2" + }, + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "2201:5:2" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "2183:17:2" + }, + "nodeType": "YulFunctionCall", + "src": "2183:24:2" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "2171:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "2171:37:2" + }, + "nodeType": "YulExpressionStatement", + "src": "2171:37:2" + } + ] + }, + "name": "abi_encode_t_uint256_to_t_uint256_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "2149:5:2", + "type": "" + }, + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "2156:3:2", + "type": "" + } + ], + "src": "2096:118:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "2366:277:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "2376:26:2", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "2388:9:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "2399:2:2", + "type": "", + "value": "64" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "2384:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "2384:18:2" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "2376:4:2" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "2423:9:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "2434:1:2", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "2419:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "2419:17:2" + }, + { + "arguments": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "2442:4:2" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "2448:9:2" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "2438:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "2438:20:2" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "2412:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "2412:47:2" + }, + "nodeType": "YulExpressionStatement", + "src": "2412:47:2" + }, + { + "nodeType": "YulAssignment", + "src": "2468:86:2", + "value": { + "arguments": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "2540:6:2" + }, + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "2549:4:2" + } + ], + "functionName": { + "name": "abi_encode_t_string_memory_ptr_to_t_string_memory_ptr_fromStack", + "nodeType": "YulIdentifier", + "src": "2476:63:2" + }, + "nodeType": "YulFunctionCall", + "src": "2476:78:2" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "2468:4:2" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value1", + "nodeType": "YulIdentifier", + "src": "2608:6:2" + }, + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "2621:9:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "2632:2:2", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "2617:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "2617:18:2" + } + ], + "functionName": { + "name": "abi_encode_t_uint256_to_t_uint256_fromStack", + "nodeType": "YulIdentifier", + "src": "2564:43:2" + }, + "nodeType": "YulFunctionCall", + "src": "2564:72:2" + }, + "nodeType": "YulExpressionStatement", + "src": "2564:72:2" + } + ] + }, + "name": "abi_encode_tuple_t_string_memory_ptr_t_uint256__to_t_string_memory_ptr_t_uint256__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "2330:9:2", + "type": "" + }, + { + "name": "value1", + "nodeType": "YulTypedName", + "src": "2342:6:2", + "type": "" + }, + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "2350:6:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "2361:4:2", + "type": "" + } + ], + "src": "2220:423:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "2747:124:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "2757:26:2", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "2769:9:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "2780:2:2", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "2765:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "2765:18:2" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "2757:4:2" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "2837:6:2" + }, + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "2850:9:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "2861:1:2", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "2846:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "2846:17:2" + } + ], + "functionName": { + "name": "abi_encode_t_uint256_to_t_uint256_fromStack", + "nodeType": "YulIdentifier", + "src": "2793:43:2" + }, + "nodeType": "YulFunctionCall", + "src": "2793:71:2" + }, + "nodeType": "YulExpressionStatement", + "src": "2793:71:2" + } + ] + }, + "name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "2719:9:2", + "type": "" + }, + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "2731:6:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "2742:4:2", + "type": "" + } + ], + "src": "2649:222:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "2983:66:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "memPtr", + "nodeType": "YulIdentifier", + "src": "3005:6:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "3013:1:2", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "3001:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "3001:14:2" + }, + { + "hexValue": "596f75206861766520616c726561647920766f746564", + "kind": "string", + "nodeType": "YulLiteral", + "src": "3017:24:2", + "type": "", + "value": "You have already voted" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "2994:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "2994:48:2" + }, + "nodeType": "YulExpressionStatement", + "src": "2994:48:2" + } + ] + }, + "name": "store_literal_in_memory_f717c48f565c1f6c8c7139cf54f577e481ac65760eb92c077a08597c622f2a8a", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "memPtr", + "nodeType": "YulTypedName", + "src": "2975:6:2", + "type": "" + } + ], + "src": "2877:172:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "3201:220:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "3211:74:2", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "3277:3:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "3282:2:2", + "type": "", + "value": "22" + } + ], + "functionName": { + "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", + "nodeType": "YulIdentifier", + "src": "3218:58:2" + }, + "nodeType": "YulFunctionCall", + "src": "3218:67:2" + }, + "variableNames": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "3211:3:2" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "3383:3:2" + } + ], + "functionName": { + "name": "store_literal_in_memory_f717c48f565c1f6c8c7139cf54f577e481ac65760eb92c077a08597c622f2a8a", + "nodeType": "YulIdentifier", + "src": "3294:88:2" + }, + "nodeType": "YulFunctionCall", + "src": "3294:93:2" + }, + "nodeType": "YulExpressionStatement", + "src": "3294:93:2" + }, + { + "nodeType": "YulAssignment", + "src": "3396:19:2", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "3407:3:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "3412:2:2", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "3403:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "3403:12:2" + }, + "variableNames": [ + { + "name": "end", + "nodeType": "YulIdentifier", + "src": "3396:3:2" + } + ] + } + ] + }, + "name": "abi_encode_t_stringliteral_f717c48f565c1f6c8c7139cf54f577e481ac65760eb92c077a08597c622f2a8a_to_t_string_memory_ptr_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "3189:3:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "end", + "nodeType": "YulTypedName", + "src": "3197:3:2", + "type": "" + } + ], + "src": "3055:366:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "3598:248:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "3608:26:2", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "3620:9:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "3631:2:2", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "3616:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "3616:18:2" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "3608:4:2" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "3655:9:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "3666:1:2", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "3651:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "3651:17:2" + }, + { + "arguments": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "3674:4:2" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "3680:9:2" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "3670:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "3670:20:2" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "3644:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "3644:47:2" + }, + "nodeType": "YulExpressionStatement", + "src": "3644:47:2" + }, + { + "nodeType": "YulAssignment", + "src": "3700:139:2", + "value": { + "arguments": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "3834:4:2" + } + ], + "functionName": { + "name": "abi_encode_t_stringliteral_f717c48f565c1f6c8c7139cf54f577e481ac65760eb92c077a08597c622f2a8a_to_t_string_memory_ptr_fromStack", + "nodeType": "YulIdentifier", + "src": "3708:124:2" + }, + "nodeType": "YulFunctionCall", + "src": "3708:131:2" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "3700:4:2" + } + ] + } + ] + }, + "name": "abi_encode_tuple_t_stringliteral_f717c48f565c1f6c8c7139cf54f577e481ac65760eb92c077a08597c622f2a8a__to_t_string_memory_ptr__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "3578:9:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "3593:4:2", + "type": "" + } + ], + "src": "3427:419:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "3958:64:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "memPtr", + "nodeType": "YulIdentifier", + "src": "3980:6:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "3988:1:2", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "3976:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "3976:14:2" + }, + { + "hexValue": "496e76616c69642063616e646964617465204944", + "kind": "string", + "nodeType": "YulLiteral", + "src": "3992:22:2", + "type": "", + "value": "Invalid candidate ID" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "3969:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "3969:46:2" + }, + "nodeType": "YulExpressionStatement", + "src": "3969:46:2" + } + ] + }, + "name": "store_literal_in_memory_db400dcff1cead9247f3093acd4e7012ef92b819e40575ded7d3413831e5cfc0", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "memPtr", + "nodeType": "YulTypedName", + "src": "3950:6:2", + "type": "" + } + ], + "src": "3852:170:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "4174:220:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "4184:74:2", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "4250:3:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "4255:2:2", + "type": "", + "value": "20" + } + ], + "functionName": { + "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", + "nodeType": "YulIdentifier", + "src": "4191:58:2" + }, + "nodeType": "YulFunctionCall", + "src": "4191:67:2" + }, + "variableNames": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "4184:3:2" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "4356:3:2" + } + ], + "functionName": { + "name": "store_literal_in_memory_db400dcff1cead9247f3093acd4e7012ef92b819e40575ded7d3413831e5cfc0", + "nodeType": "YulIdentifier", + "src": "4267:88:2" + }, + "nodeType": "YulFunctionCall", + "src": "4267:93:2" + }, + "nodeType": "YulExpressionStatement", + "src": "4267:93:2" + }, + { + "nodeType": "YulAssignment", + "src": "4369:19:2", + "value": { + "arguments": [ + { + "name": "pos", + "nodeType": "YulIdentifier", + "src": "4380:3:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "4385:2:2", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "4376:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "4376:12:2" + }, + "variableNames": [ + { + "name": "end", + "nodeType": "YulIdentifier", + "src": "4369:3:2" + } + ] + } + ] + }, + "name": "abi_encode_t_stringliteral_db400dcff1cead9247f3093acd4e7012ef92b819e40575ded7d3413831e5cfc0_to_t_string_memory_ptr_fromStack", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "pos", + "nodeType": "YulTypedName", + "src": "4162:3:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "end", + "nodeType": "YulTypedName", + "src": "4170:3:2", + "type": "" + } + ], + "src": "4028:366:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "4571:248:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "4581:26:2", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "4593:9:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "4604:2:2", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "4589:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "4589:18:2" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "4581:4:2" + } + ] + }, + { + "expression": { + "arguments": [ + { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "4628:9:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "4639:1:2", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "4624:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "4624:17:2" + }, + { + "arguments": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "4647:4:2" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "4653:9:2" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "4643:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "4643:20:2" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "4617:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "4617:47:2" + }, + "nodeType": "YulExpressionStatement", + "src": "4617:47:2" + }, + { + "nodeType": "YulAssignment", + "src": "4673:139:2", + "value": { + "arguments": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "4807:4:2" + } + ], + "functionName": { + "name": "abi_encode_t_stringliteral_db400dcff1cead9247f3093acd4e7012ef92b819e40575ded7d3413831e5cfc0_to_t_string_memory_ptr_fromStack", + "nodeType": "YulIdentifier", + "src": "4681:124:2" + }, + "nodeType": "YulFunctionCall", + "src": "4681:131:2" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "4673:4:2" + } + ] + } + ] + }, + "name": "abi_encode_tuple_t_stringliteral_db400dcff1cead9247f3093acd4e7012ef92b819e40575ded7d3413831e5cfc0__to_t_string_memory_ptr__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "4551:9:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "4566:4:2", + "type": "" + } + ], + "src": "4400:419:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "4853:152:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "4870:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "4873:77:2", + "type": "", + "value": "35408467139433450592217433187231851964531694900788300625387963629091585785856" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "4863:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "4863:88:2" + }, + "nodeType": "YulExpressionStatement", + "src": "4863:88:2" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "4967:1:2", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "4970:4:2", + "type": "", + "value": "0x11" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "4960:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "4960:15:2" + }, + "nodeType": "YulExpressionStatement", + "src": "4960:15:2" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "4991:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "4994:4:2", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "4984:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "4984:15:2" + }, + "nodeType": "YulExpressionStatement", + "src": "4984:15:2" + } + ] + }, + "name": "panic_error_0x11", + "nodeType": "YulFunctionDefinition", + "src": "4825:180:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "5054:190:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "5064:33:2", + "value": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "5091:5:2" + } + ], + "functionName": { + "name": "cleanup_t_uint256", + "nodeType": "YulIdentifier", + "src": "5073:17:2" + }, + "nodeType": "YulFunctionCall", + "src": "5073:24:2" + }, + "variableNames": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "5064:5:2" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "5187:22:2", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nodeType": "YulIdentifier", + "src": "5189:16:2" + }, + "nodeType": "YulFunctionCall", + "src": "5189:18:2" + }, + "nodeType": "YulExpressionStatement", + "src": "5189:18:2" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "5112:5:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5119:66:2", + "type": "", + "value": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + } + ], + "functionName": { + "name": "eq", + "nodeType": "YulIdentifier", + "src": "5109:2:2" + }, + "nodeType": "YulFunctionCall", + "src": "5109:77:2" + }, + "nodeType": "YulIf", + "src": "5106:103:2" + }, + { + "nodeType": "YulAssignment", + "src": "5218:20:2", + "value": { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "5229:5:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5236:1:2", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "5225:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "5225:13:2" + }, + "variableNames": [ + { + "name": "ret", + "nodeType": "YulIdentifier", + "src": "5218:3:2" + } + ] + } + ] + }, + "name": "increment_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "5040:5:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "ret", + "nodeType": "YulTypedName", + "src": "5050:3:2", + "type": "" + } + ], + "src": "5011:233:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "5278:152:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5295:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5298:77:2", + "type": "", + "value": "35408467139433450592217433187231851964531694900788300625387963629091585785856" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "5288:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "5288:88:2" + }, + "nodeType": "YulExpressionStatement", + "src": "5288:88:2" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5392:1:2", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5395:4:2", + "type": "", + "value": "0x22" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "5385:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "5385:15:2" + }, + "nodeType": "YulExpressionStatement", + "src": "5385:15:2" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5416:1:2", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5419:4:2", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "5409:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "5409:15:2" + }, + "nodeType": "YulExpressionStatement", + "src": "5409:15:2" + } + ] + }, + "name": "panic_error_0x22", + "nodeType": "YulFunctionDefinition", + "src": "5250:180:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "5487:269:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "5497:22:2", + "value": { + "arguments": [ + { + "name": "data", + "nodeType": "YulIdentifier", + "src": "5511:4:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5517:1:2", + "type": "", + "value": "2" + } + ], + "functionName": { + "name": "div", + "nodeType": "YulIdentifier", + "src": "5507:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "5507:12:2" + }, + "variableNames": [ + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "5497:6:2" + } + ] + }, + { + "nodeType": "YulVariableDeclaration", + "src": "5528:38:2", + "value": { + "arguments": [ + { + "name": "data", + "nodeType": "YulIdentifier", + "src": "5558:4:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5564:1:2", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "5554:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "5554:12:2" + }, + "variables": [ + { + "name": "outOfPlaceEncoding", + "nodeType": "YulTypedName", + "src": "5532:18:2", + "type": "" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "5605:51:2", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "5619:27:2", + "value": { + "arguments": [ + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "5633:6:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5641:4:2", + "type": "", + "value": "0x7f" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "5629:3:2" + }, + "nodeType": "YulFunctionCall", + "src": "5629:17:2" + }, + "variableNames": [ + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "5619:6:2" + } + ] + } + ] + }, + "condition": { + "arguments": [ + { + "name": "outOfPlaceEncoding", + "nodeType": "YulIdentifier", + "src": "5585:18:2" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "5578:6:2" + }, + "nodeType": "YulFunctionCall", + "src": "5578:26:2" + }, + "nodeType": "YulIf", + "src": "5575:81:2" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "5708:42:2", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x22", + "nodeType": "YulIdentifier", + "src": "5722:16:2" + }, + "nodeType": "YulFunctionCall", + "src": "5722:18:2" + }, + "nodeType": "YulExpressionStatement", + "src": "5722:18:2" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "outOfPlaceEncoding", + "nodeType": "YulIdentifier", + "src": "5672:18:2" + }, + { + "arguments": [ + { + "name": "length", + "nodeType": "YulIdentifier", + "src": "5695:6:2" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "5703:2:2", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "lt", + "nodeType": "YulIdentifier", + "src": "5692:2:2" + }, + "nodeType": "YulFunctionCall", + "src": "5692:14:2" + } + ], + "functionName": { + "name": "eq", + "nodeType": "YulIdentifier", + "src": "5669:2:2" + }, + "nodeType": "YulFunctionCall", + "src": "5669:38:2" + }, + "nodeType": "YulIf", + "src": "5666:84:2" + } + ] + }, + "name": "extract_byte_array_length", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "data", + "nodeType": "YulTypedName", + "src": "5471:4:2", + "type": "" + } + ], + "returnVariables": [ + { + "name": "length", + "nodeType": "YulTypedName", + "src": "5480:6:2", + "type": "" + } + ], + "src": "5436:320:2" + } + ] + }, + "contents": "{\n\n function allocate_unbounded() -> memPtr {\n memPtr := mload(64)\n }\n\n function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {\n revert(0, 0)\n }\n\n function revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() {\n revert(0, 0)\n }\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n function validator_revert_t_uint256(value) {\n if iszero(eq(value, cleanup_t_uint256(value))) { revert(0, 0) }\n }\n\n function abi_decode_t_uint256(offset, end) -> value {\n value := calldataload(offset)\n validator_revert_t_uint256(value)\n }\n\n function abi_decode_tuple_t_uint256(headStart, dataEnd) -> value0 {\n if slt(sub(dataEnd, headStart), 32) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_uint256(add(headStart, offset), dataEnd)\n }\n\n }\n\n function array_length_t_string_memory_ptr(value) -> length {\n\n length := mload(value)\n\n }\n\n function array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, length) -> updated_pos {\n mstore(pos, length)\n updated_pos := add(pos, 0x20)\n }\n\n function copy_memory_to_memory(src, dst, length) {\n let i := 0\n for { } lt(i, length) { i := add(i, 32) }\n {\n mstore(add(dst, i), mload(add(src, i)))\n }\n if gt(i, length)\n {\n // clear end\n mstore(add(dst, length), 0)\n }\n }\n\n function round_up_to_mul_of_32(value) -> result {\n result := and(add(value, 31), not(31))\n }\n\n function abi_encode_t_string_memory_ptr_to_t_string_memory_ptr_fromStack(value, pos) -> end {\n let length := array_length_t_string_memory_ptr(value)\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, length)\n copy_memory_to_memory(add(value, 0x20), pos, length)\n end := add(pos, round_up_to_mul_of_32(length))\n }\n\n function abi_encode_t_uint256_to_t_uint256_fromStack(value, pos) {\n mstore(pos, cleanup_t_uint256(value))\n }\n\n function abi_encode_tuple_t_string_memory_ptr_t_uint256__to_t_string_memory_ptr_t_uint256__fromStack_reversed(headStart , value1, value0) -> tail {\n tail := add(headStart, 64)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_string_memory_ptr_to_t_string_memory_ptr_fromStack(value0, tail)\n\n abi_encode_t_uint256_to_t_uint256_fromStack(value1, add(headStart, 32))\n\n }\n\n function abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed(headStart , value0) -> tail {\n tail := add(headStart, 32)\n\n abi_encode_t_uint256_to_t_uint256_fromStack(value0, add(headStart, 0))\n\n }\n\n function store_literal_in_memory_f717c48f565c1f6c8c7139cf54f577e481ac65760eb92c077a08597c622f2a8a(memPtr) {\n\n mstore(add(memPtr, 0), \"You have already voted\")\n\n }\n\n function abi_encode_t_stringliteral_f717c48f565c1f6c8c7139cf54f577e481ac65760eb92c077a08597c622f2a8a_to_t_string_memory_ptr_fromStack(pos) -> end {\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, 22)\n store_literal_in_memory_f717c48f565c1f6c8c7139cf54f577e481ac65760eb92c077a08597c622f2a8a(pos)\n end := add(pos, 32)\n }\n\n function abi_encode_tuple_t_stringliteral_f717c48f565c1f6c8c7139cf54f577e481ac65760eb92c077a08597c622f2a8a__to_t_string_memory_ptr__fromStack_reversed(headStart ) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_stringliteral_f717c48f565c1f6c8c7139cf54f577e481ac65760eb92c077a08597c622f2a8a_to_t_string_memory_ptr_fromStack( tail)\n\n }\n\n function store_literal_in_memory_db400dcff1cead9247f3093acd4e7012ef92b819e40575ded7d3413831e5cfc0(memPtr) {\n\n mstore(add(memPtr, 0), \"Invalid candidate ID\")\n\n }\n\n function abi_encode_t_stringliteral_db400dcff1cead9247f3093acd4e7012ef92b819e40575ded7d3413831e5cfc0_to_t_string_memory_ptr_fromStack(pos) -> end {\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, 20)\n store_literal_in_memory_db400dcff1cead9247f3093acd4e7012ef92b819e40575ded7d3413831e5cfc0(pos)\n end := add(pos, 32)\n }\n\n function abi_encode_tuple_t_stringliteral_db400dcff1cead9247f3093acd4e7012ef92b819e40575ded7d3413831e5cfc0__to_t_string_memory_ptr__fromStack_reversed(headStart ) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_stringliteral_db400dcff1cead9247f3093acd4e7012ef92b819e40575ded7d3413831e5cfc0_to_t_string_memory_ptr_fromStack( tail)\n\n }\n\n function panic_error_0x11() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x11)\n revert(0, 0x24)\n }\n\n function increment_t_uint256(value) -> ret {\n value := cleanup_t_uint256(value)\n if eq(value, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) { panic_error_0x11() }\n ret := add(value, 1)\n }\n\n function panic_error_0x22() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x22)\n revert(0, 0x24)\n }\n\n function extract_byte_array_length(data) -> length {\n length := div(data, 2)\n let outOfPlaceEncoding := and(data, 1)\n if iszero(outOfPlaceEncoding) {\n length := and(length, 0x7f)\n }\n\n if eq(outOfPlaceEncoding, lt(length, 32)) {\n panic_error_0x22()\n }\n }\n\n}\n", + "id": 2, + "language": "Yul", + "name": "#utility.yul" + } + ], + "sourceMap": "68:1355:1:-:0;;;316:1;283:34;;326:98;;;;;;;;;;351:27;;;;;;;;;;;;;;;;;;:12;;;:27;;:::i;:::-;389;;;;;;;;;;;;;;;;;;:12;;;:27;;:::i;:::-;68:1355;;482:164;574:36;;;;;;;;584:15;;574:36;;;;601:5;574:36;;;;608:1;574:36;;;544:10;:27;555:15;;544:27;;;;;;;;;;;:66;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;621:15;;:17;;;;;;;;;:::i;:::-;;;;;;482:164;:::o;68:1355::-;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;:::o;7:180:2:-;55:77;52:1;45:88;152:4;149:1;142:15;176:4;173:1;166:15;193:77;230:7;259:5;248:16;;193:77;;;:::o;276:233::-;315:3;338:24;356:5;338:24;:::i;:::-;329:33;;384:66;377:5;374:77;371:103;;454:18;;:::i;:::-;371:103;501:1;494:5;490:13;483:20;;276:233;;;:::o;515:180::-;563:77;560:1;553:88;660:4;657:1;650:15;684:4;681:1;674:15;701:320;745:6;782:1;776:4;772:12;762:22;;829:1;823:4;819:12;850:18;840:81;;906:4;898:6;894:17;884:27;;840:81;968:2;960:6;957:14;937:18;934:38;931:84;;987:18;;:::i;:::-;931:84;752:269;701:320;;;:::o;68:1355:1:-;;;;;;;", + "deployedSourceMap": "68:1355:1:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;654:368;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;1030:390;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;;;283:34;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;654:368;717:5;:17;723:10;717:17;;;;;;;;;;;;;;;;;;;;;;;;;716:18;708:53;;;;;;;;;;;;:::i;:::-;;;;;;;;;810:1;794:12;:17;;:51;;;;;830:15;;815:12;:30;794:51;772:121;;;;;;;;;;;;:::i;:::-;;;;;;;;;906:10;:24;917:12;906:24;;;;;;;;;;;:34;;;:36;;;;;;;;;:::i;:::-;;;;;;973:4;953:5;:17;959:10;953:17;;;;;;;;;;;;;;;;:24;;;;;;;;;;;;;;;;;;1001:12;995:19;;;;;;;;;;654:368;:::o;1030:390::-;1129:13;1144:7;1207:1;1191:12;:17;;:51;;;;;1227:15;;1212:12;:30;1191:51;1169:121;;;;;;;;;;;;:::i;:::-;;;;;;;;;1323:10;:24;1334:12;1323:24;;;;;;;;;;;:29;;1367:10;:24;1378:12;1367:24;;;;;;;;;;;:34;;;1301:111;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1030:390;;;:::o;283:34::-;;;;:::o;88:117:2:-;197:1;194;187:12;334:77;371:7;400:5;389:16;;334:77;;;:::o;417:122::-;490:24;508:5;490:24;:::i;:::-;483:5;480:35;470:63;;529:1;526;519:12;470:63;417:122;:::o;545:139::-;591:5;629:6;616:20;607:29;;645:33;672:5;645:33;:::i;:::-;545:139;;;;:::o;690:329::-;749:6;798:2;786:9;777:7;773:23;769:32;766:119;;;804:79;;:::i;:::-;766:119;924:1;949:53;994:7;985:6;974:9;970:22;949:53;:::i;:::-;939:63;;895:117;690:329;;;;:::o;1025:99::-;1077:6;1111:5;1105:12;1095:22;;1025:99;;;:::o;1130:169::-;1214:11;1248:6;1243:3;1236:19;1288:4;1283:3;1279:14;1264:29;;1130:169;;;;:::o;1305:307::-;1373:1;1383:113;1397:6;1394:1;1391:13;1383:113;;;1482:1;1477:3;1473:11;1467:18;1463:1;1458:3;1454:11;1447:39;1419:2;1416:1;1412:10;1407:15;;1383:113;;;1514:6;1511:1;1508:13;1505:101;;;1594:1;1585:6;1580:3;1576:16;1569:27;1505:101;1354:258;1305:307;;;:::o;1618:102::-;1659:6;1710:2;1706:7;1701:2;1694:5;1690:14;1686:28;1676:38;;1618:102;;;:::o;1726:364::-;1814:3;1842:39;1875:5;1842:39;:::i;:::-;1897:71;1961:6;1956:3;1897:71;:::i;:::-;1890:78;;1977:52;2022:6;2017:3;2010:4;2003:5;1999:16;1977:52;:::i;:::-;2054:29;2076:6;2054:29;:::i;:::-;2049:3;2045:39;2038:46;;1818:272;1726:364;;;;:::o;2096:118::-;2183:24;2201:5;2183:24;:::i;:::-;2178:3;2171:37;2096:118;;:::o;2220:423::-;2361:4;2399:2;2388:9;2384:18;2376:26;;2448:9;2442:4;2438:20;2434:1;2423:9;2419:17;2412:47;2476:78;2549:4;2540:6;2476:78;:::i;:::-;2468:86;;2564:72;2632:2;2621:9;2617:18;2608:6;2564:72;:::i;:::-;2220:423;;;;;:::o;2649:222::-;2742:4;2780:2;2769:9;2765:18;2757:26;;2793:71;2861:1;2850:9;2846:17;2837:6;2793:71;:::i;:::-;2649:222;;;;:::o;2877:172::-;3017:24;3013:1;3005:6;3001:14;2994:48;2877:172;:::o;3055:366::-;3197:3;3218:67;3282:2;3277:3;3218:67;:::i;:::-;3211:74;;3294:93;3383:3;3294:93;:::i;:::-;3412:2;3407:3;3403:12;3396:19;;3055:366;;;:::o;3427:419::-;3593:4;3631:2;3620:9;3616:18;3608:26;;3680:9;3674:4;3670:20;3666:1;3655:9;3651:17;3644:47;3708:131;3834:4;3708:131;:::i;:::-;3700:139;;3427:419;;;:::o;3852:170::-;3992:22;3988:1;3980:6;3976:14;3969:46;3852:170;:::o;4028:366::-;4170:3;4191:67;4255:2;4250:3;4191:67;:::i;:::-;4184:74;;4267:93;4356:3;4267:93;:::i;:::-;4385:2;4380:3;4376:12;4369:19;;4028:366;;;:::o;4400:419::-;4566:4;4604:2;4593:9;4589:18;4581:26;;4653:9;4647:4;4643:20;4639:1;4628:9;4624:17;4617:47;4681:131;4807:4;4681:131;:::i;:::-;4673:139;;4400:419;;;:::o;4825:180::-;4873:77;4870:1;4863:88;4970:4;4967:1;4960:15;4994:4;4991:1;4984:15;5011:233;5050:3;5073:24;5091:5;5073:24;:::i;:::-;5064:33;;5119:66;5112:5;5109:77;5106:103;;5189:18;;:::i;:::-;5106:103;5236:1;5229:5;5225:13;5218:20;;5011:233;;;:::o;5250:180::-;5298:77;5295:1;5288:88;5395:4;5392:1;5385:15;5419:4;5416:1;5409:15;5436:320;5480:6;5517:1;5511:4;5507:12;5497:22;;5564:1;5558:4;5554:12;5585:18;5575:81;;5641:4;5633:6;5629:17;5619:27;;5575:81;5703:2;5695:6;5692:14;5672:18;5669:38;5666:84;;5722:18;;:::i;:::-;5666:84;5487:269;5436:320;;;:::o", + "source": "// SPDX-License-Identifier: MIT\r\npragma solidity >=0.4.0 <0.9.0;\r\n\r\ncontract Election {\r\n struct Candidate {\r\n uint256 id;\r\n string name;\r\n uint256 voteCount;\r\n }\r\n\r\n mapping(uint256 => Candidate) candidates;\r\n mapping(address => bool) voted;\r\n\r\n uint256 public candidatesCount = 0;\r\n\r\n constructor() {\r\n addCandidate(\"Candidate 1\");\r\n addCandidate(\"Candidate 2\");\r\n }\r\n\r\n event Voted(uint256 indexed _candidateId);\r\n\r\n function addCandidate(string memory _name) private {\r\n candidates[candidatesCount] = Candidate(candidatesCount, _name, 0);\r\n candidatesCount++;\r\n }\r\n\r\n function vote(uint256 _candidateId) public {\r\n require(!voted[msg.sender], \"You have already voted\");\r\n require(\r\n _candidateId >= 0 && _candidateId < candidatesCount,\r\n \"Invalid candidate ID\"\r\n );\r\n\r\n candidates[_candidateId].voteCount++;\r\n voted[msg.sender] = true;\r\n\r\n emit Voted(_candidateId);\r\n }\r\n\r\n function getCandidateDetails(uint256 _candidateId)\r\n public\r\n view\r\n returns (string memory, uint256)\r\n {\r\n require(\r\n _candidateId >= 0 && _candidateId < candidatesCount,\r\n \"Invalid candidate ID\"\r\n );\r\n return (\r\n candidates[_candidateId].name,\r\n candidates[_candidateId].voteCount\r\n );\r\n }\r\n}\r\n", + "sourcePath": "C:\\dev\\voting-dapp\\contracts\\Voting.sol", + "ast": { + "absolutePath": "project:/contracts/Voting.sol", + "exportedSymbols": { + "Election": [ + 163 + ] + }, + "id": 164, + "license": "MIT", + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 34, + "literals": [ + "solidity", + ">=", + "0.4", + ".0", + "<", + "0.9", + ".0" + ], + "nodeType": "PragmaDirective", + "src": "33:31:1" + }, + { + "abstract": false, + "baseContracts": [], + "canonicalName": "Election", + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "id": 163, + "linearizedBaseContracts": [ + 163 + ], + "name": "Election", + "nameLocation": "77:8:1", + "nodeType": "ContractDefinition", + "nodes": [ + { + "canonicalName": "Election.Candidate", + "id": 41, + "members": [ + { + "constant": false, + "id": 36, + "mutability": "mutable", + "name": "id", + "nameLocation": "129:2:1", + "nodeType": "VariableDeclaration", + "scope": 41, + "src": "121:10:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 35, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "121:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 38, + "mutability": "mutable", + "name": "name", + "nameLocation": "149:4:1", + "nodeType": "VariableDeclaration", + "scope": 41, + "src": "142:11:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + }, + "typeName": { + "id": 37, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "142:6:1", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 40, + "mutability": "mutable", + "name": "voteCount", + "nameLocation": "172:9:1", + "nodeType": "VariableDeclaration", + "scope": 41, + "src": "164:17:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 39, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "164:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "name": "Candidate", + "nameLocation": "100:9:1", + "nodeType": "StructDefinition", + "scope": 163, + "src": "93:96:1", + "visibility": "public" + }, + { + "constant": false, + "id": 46, + "mutability": "mutable", + "name": "candidates", + "nameLocation": "227:10:1", + "nodeType": "VariableDeclaration", + "scope": 163, + "src": "197:40:1", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_Candidate_$41_storage_$", + "typeString": "mapping(uint256 => struct Election.Candidate)" + }, + "typeName": { + "id": 45, + "keyType": { + "id": 42, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "205:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Mapping", + "src": "197:29:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_Candidate_$41_storage_$", + "typeString": "mapping(uint256 => struct Election.Candidate)" + }, + "valueType": { + "id": 44, + "nodeType": "UserDefinedTypeName", + "pathNode": { + "id": 43, + "name": "Candidate", + "nodeType": "IdentifierPath", + "referencedDeclaration": 41, + "src": "216:9:1" + }, + "referencedDeclaration": 41, + "src": "216:9:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Candidate_$41_storage_ptr", + "typeString": "struct Election.Candidate" + } + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 50, + "mutability": "mutable", + "name": "voted", + "nameLocation": "269:5:1", + "nodeType": "VariableDeclaration", + "scope": 163, + "src": "244:30:1", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" + }, + "typeName": { + "id": 49, + "keyType": { + "id": 47, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "252:7:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "Mapping", + "src": "244:24:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" + }, + "valueType": { + "id": 48, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "263:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + } + }, + "visibility": "internal" + }, + { + "constant": false, + "functionSelector": "2d35a8a2", + "id": 53, + "mutability": "mutable", + "name": "candidatesCount", + "nameLocation": "298:15:1", + "nodeType": "VariableDeclaration", + "scope": 163, + "src": "283:34:1", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 51, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "283:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "hexValue": "30", + "id": 52, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "316:1:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "visibility": "public" + }, + { + "body": { + "id": 64, + "nodeType": "Block", + "src": "340:84:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "43616e6469646174652031", + "id": 57, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "364:13:1", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_41f9dcbd43e9b33194759b5a51b1df9864cdc2b2138ff106f03091eb79861f0c", + "typeString": "literal_string \"Candidate 1\"" + }, + "value": "Candidate 1" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_41f9dcbd43e9b33194759b5a51b1df9864cdc2b2138ff106f03091eb79861f0c", + "typeString": "literal_string \"Candidate 1\"" + } + ], + "id": 56, + "name": "addCandidate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 88, + "src": "351:12:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_string_memory_ptr_$returns$__$", + "typeString": "function (string memory)" + } + }, + "id": 58, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "351:27:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 59, + "nodeType": "ExpressionStatement", + "src": "351:27:1" + }, + { + "expression": { + "arguments": [ + { + "hexValue": "43616e6469646174652032", + "id": 61, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "402:13:1", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_f1f17440f69835dafba5c9fd0e4caa6c780807a80f8d1745ec7af1408d6cca4a", + "typeString": "literal_string \"Candidate 2\"" + }, + "value": "Candidate 2" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_stringliteral_f1f17440f69835dafba5c9fd0e4caa6c780807a80f8d1745ec7af1408d6cca4a", + "typeString": "literal_string \"Candidate 2\"" + } + ], + "id": 60, + "name": "addCandidate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 88, + "src": "389:12:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_string_memory_ptr_$returns$__$", + "typeString": "function (string memory)" + } + }, + "id": 62, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "389:27:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 63, + "nodeType": "ExpressionStatement", + "src": "389:27:1" + } + ] + }, + "id": 65, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 54, + "nodeType": "ParameterList", + "parameters": [], + "src": "337:2:1" + }, + "returnParameters": { + "id": 55, + "nodeType": "ParameterList", + "parameters": [], + "src": "340:0:1" + }, + "scope": 163, + "src": "326:98:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "anonymous": false, + "eventSelector": "7f511e347bf51eed3be100b3194247d5207f05f3b33de7d31e3e8ee73199a049", + "id": 69, + "name": "Voted", + "nameLocation": "438:5:1", + "nodeType": "EventDefinition", + "parameters": { + "id": 68, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 67, + "indexed": true, + "mutability": "mutable", + "name": "_candidateId", + "nameLocation": "460:12:1", + "nodeType": "VariableDeclaration", + "scope": 69, + "src": "444:28:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 66, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "444:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "443:30:1" + }, + "src": "432:42:1" + }, + { + "body": { + "id": 87, + "nodeType": "Block", + "src": "533:113:1", + "statements": [ + { + "expression": { + "id": 82, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 74, + "name": "candidates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 46, + "src": "544:10:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_Candidate_$41_storage_$", + "typeString": "mapping(uint256 => struct Election.Candidate storage ref)" + } + }, + "id": 76, + "indexExpression": { + "id": 75, + "name": "candidatesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "555:15:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "544:27:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Candidate_$41_storage", + "typeString": "struct Election.Candidate storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 78, + "name": "candidatesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "584:15:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "id": 79, + "name": "_name", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 71, + "src": "601:5:1", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "hexValue": "30", + "id": 80, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "608:1:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 77, + "name": "Candidate", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 41, + "src": "574:9:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_struct$_Candidate_$41_storage_ptr_$", + "typeString": "type(struct Election.Candidate storage pointer)" + } + }, + "id": 81, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "structConstructorCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "574:36:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_struct$_Candidate_$41_memory_ptr", + "typeString": "struct Election.Candidate memory" + } + }, + "src": "544:66:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Candidate_$41_storage", + "typeString": "struct Election.Candidate storage ref" + } + }, + "id": 83, + "nodeType": "ExpressionStatement", + "src": "544:66:1" + }, + { + "expression": { + "id": 85, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "621:17:1", + "subExpression": { + "id": 84, + "name": "candidatesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "621:15:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 86, + "nodeType": "ExpressionStatement", + "src": "621:17:1" + } + ] + }, + "id": 88, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "addCandidate", + "nameLocation": "491:12:1", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 72, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 71, + "mutability": "mutable", + "name": "_name", + "nameLocation": "518:5:1", + "nodeType": "VariableDeclaration", + "scope": 88, + "src": "504:19:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 70, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "504:6:1", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "503:21:1" + }, + "returnParameters": { + "id": 73, + "nodeType": "ParameterList", + "parameters": [], + "src": "533:0:1" + }, + "scope": 163, + "src": "482:164:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "private" + }, + { + "body": { + "id": 130, + "nodeType": "Block", + "src": "697:325:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "id": 98, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "!", + "prefix": true, + "src": "716:18:1", + "subExpression": { + "baseExpression": { + "id": 94, + "name": "voted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 50, + "src": "717:5:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" + } + }, + "id": 97, + "indexExpression": { + "expression": { + "id": 95, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4294967281, + "src": "723:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 96, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "723:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "717:17:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "596f75206861766520616c726561647920766f746564", + "id": 99, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "736:24:1", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_f717c48f565c1f6c8c7139cf54f577e481ac65760eb92c077a08597c622f2a8a", + "typeString": "literal_string \"You have already voted\"" + }, + "value": "You have already voted" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_f717c48f565c1f6c8c7139cf54f577e481ac65760eb92c077a08597c622f2a8a", + "typeString": "literal_string \"You have already voted\"" + } + ], + "id": 93, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4294967278, + 4294967278 + ], + "referencedDeclaration": 4294967278, + "src": "708:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 100, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "708:53:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 101, + "nodeType": "ExpressionStatement", + "src": "708:53:1" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 109, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 105, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 103, + "name": "_candidateId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "794:12:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "hexValue": "30", + "id": 104, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "810:1:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "794:17:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 108, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 106, + "name": "_candidateId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "815:12:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "id": 107, + "name": "candidatesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "830:15:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "815:30:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "794:51:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "496e76616c69642063616e646964617465204944", + "id": 110, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "860:22:1", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_db400dcff1cead9247f3093acd4e7012ef92b819e40575ded7d3413831e5cfc0", + "typeString": "literal_string \"Invalid candidate ID\"" + }, + "value": "Invalid candidate ID" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_db400dcff1cead9247f3093acd4e7012ef92b819e40575ded7d3413831e5cfc0", + "typeString": "literal_string \"Invalid candidate ID\"" + } + ], + "id": 102, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4294967278, + 4294967278 + ], + "referencedDeclaration": 4294967278, + "src": "772:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 111, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "772:121:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 112, + "nodeType": "ExpressionStatement", + "src": "772:121:1" + }, + { + "expression": { + "id": 117, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "906:36:1", + "subExpression": { + "expression": { + "baseExpression": { + "id": 113, + "name": "candidates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 46, + "src": "906:10:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_Candidate_$41_storage_$", + "typeString": "mapping(uint256 => struct Election.Candidate storage ref)" + } + }, + "id": 115, + "indexExpression": { + "id": 114, + "name": "_candidateId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "917:12:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "906:24:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Candidate_$41_storage", + "typeString": "struct Election.Candidate storage ref" + } + }, + "id": 116, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "voteCount", + "nodeType": "MemberAccess", + "referencedDeclaration": 40, + "src": "906:34:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 118, + "nodeType": "ExpressionStatement", + "src": "906:36:1" + }, + { + "expression": { + "id": 124, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "baseExpression": { + "id": 119, + "name": "voted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 50, + "src": "953:5:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" + } + }, + "id": 122, + "indexExpression": { + "expression": { + "id": 120, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4294967281, + "src": "959:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 121, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "src": "959:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "953:17:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "hexValue": "74727565", + "id": 123, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "973:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "953:24:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 125, + "nodeType": "ExpressionStatement", + "src": "953:24:1" + }, + { + "eventCall": { + "arguments": [ + { + "id": 127, + "name": "_candidateId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 90, + "src": "1001:12:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 126, + "name": "Voted", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 69, + "src": "995:5:1", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 128, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "995:19:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 129, + "nodeType": "EmitStatement", + "src": "990:24:1" + } + ] + }, + "functionSelector": "0121b93f", + "id": 131, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "vote", + "nameLocation": "663:4:1", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 91, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 90, + "mutability": "mutable", + "name": "_candidateId", + "nameLocation": "676:12:1", + "nodeType": "VariableDeclaration", + "scope": 131, + "src": "668:20:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 89, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "668:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "667:22:1" + }, + "returnParameters": { + "id": 92, + "nodeType": "ParameterList", + "parameters": [], + "src": "697:0:1" + }, + "scope": 163, + "src": "654:368:1", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 161, + "nodeType": "Block", + "src": "1158:262:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 147, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 143, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 141, + "name": "_candidateId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 133, + "src": "1191:12:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "hexValue": "30", + "id": 142, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1207:1:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "1191:17:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "&&", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 146, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 144, + "name": "_candidateId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 133, + "src": "1212:12:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "id": 145, + "name": "candidatesCount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 53, + "src": "1227:15:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1212:30:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "src": "1191:51:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "496e76616c69642063616e646964617465204944", + "id": 148, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1257:22:1", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_db400dcff1cead9247f3093acd4e7012ef92b819e40575ded7d3413831e5cfc0", + "typeString": "literal_string \"Invalid candidate ID\"" + }, + "value": "Invalid candidate ID" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_db400dcff1cead9247f3093acd4e7012ef92b819e40575ded7d3413831e5cfc0", + "typeString": "literal_string \"Invalid candidate ID\"" + } + ], + "id": 140, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 4294967278, + 4294967278 + ], + "referencedDeclaration": 4294967278, + "src": "1169:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 149, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1169:121:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 150, + "nodeType": "ExpressionStatement", + "src": "1169:121:1" + }, + { + "expression": { + "components": [ + { + "expression": { + "baseExpression": { + "id": 151, + "name": "candidates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 46, + "src": "1323:10:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_Candidate_$41_storage_$", + "typeString": "mapping(uint256 => struct Election.Candidate storage ref)" + } + }, + "id": 153, + "indexExpression": { + "id": 152, + "name": "_candidateId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 133, + "src": "1334:12:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1323:24:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Candidate_$41_storage", + "typeString": "struct Election.Candidate storage ref" + } + }, + "id": 154, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "name", + "nodeType": "MemberAccess", + "referencedDeclaration": 38, + "src": "1323:29:1", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + { + "expression": { + "baseExpression": { + "id": 155, + "name": "candidates", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 46, + "src": "1367:10:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_Candidate_$41_storage_$", + "typeString": "mapping(uint256 => struct Election.Candidate storage ref)" + } + }, + "id": 157, + "indexExpression": { + "id": 156, + "name": "_candidateId", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 133, + "src": "1378:12:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "1367:24:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Candidate_$41_storage", + "typeString": "struct Election.Candidate storage ref" + } + }, + "id": 158, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "voteCount", + "nodeType": "MemberAccess", + "referencedDeclaration": 40, + "src": "1367:34:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 159, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "1308:104:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$_t_string_storage_$_t_uint256_$", + "typeString": "tuple(string storage ref,uint256)" + } + }, + "functionReturnParameters": 139, + "id": 160, + "nodeType": "Return", + "src": "1301:111:1" + } + ] + }, + "functionSelector": "27f9fd50", + "id": 162, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getCandidateDetails", + "nameLocation": "1039:19:1", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 134, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 133, + "mutability": "mutable", + "name": "_candidateId", + "nameLocation": "1067:12:1", + "nodeType": "VariableDeclaration", + "scope": 162, + "src": "1059:20:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 132, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1059:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1058:22:1" + }, + "returnParameters": { + "id": 139, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 136, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 162, + "src": "1129:13:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 135, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "1129:6:1", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 138, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 162, + "src": "1144:7:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 137, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1144:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "1128:24:1" + }, + "scope": 163, + "src": "1030:390:1", + "stateMutability": "view", + "virtual": false, + "visibility": "public" + } + ], + "scope": 164, + "src": "68:1355:1", + "usedErrors": [] + } + ], + "src": "33:1392:1" + }, + "compiler": { + "name": "solc", + "version": "0.8.14+commit.80d49f37.Emscripten.clang" + }, + "networks": {}, + "schemaVersion": "3.4.7", + "updatedAt": "2022-06-27T15:59:23.528Z", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + } +} \ No newline at end of file diff --git a/client/src/contracts/Migrations.json b/client/src/contracts/Migrations.json index e38da8e..295546d 100644 --- a/client/src/contracts/Migrations.json +++ b/client/src/contracts/Migrations.json @@ -52,26 +52,26 @@ { "ast": { "nodeType": "YulBlock", - "src": "0:3176:1", + "src": "0:3176:2", "statements": [ { "body": { "nodeType": "YulBlock", - "src": "52:32:1", + "src": "52:32:2", "statements": [ { "nodeType": "YulAssignment", - "src": "62:16:1", + "src": "62:16:2", "value": { "name": "value", "nodeType": "YulIdentifier", - "src": "73:5:1" + "src": "73:5:2" }, "variableNames": [ { "name": "cleaned", "nodeType": "YulIdentifier", - "src": "62:7:1" + "src": "62:7:2" } ] } @@ -83,7 +83,7 @@ { "name": "value", "nodeType": "YulTypedName", - "src": "34:5:1", + "src": "34:5:2", "type": "" } ], @@ -91,16 +91,16 @@ { "name": "cleaned", "nodeType": "YulTypedName", - "src": "44:7:1", + "src": "44:7:2", "type": "" } ], - "src": "7:77:1" + "src": "7:77:2" }, { "body": { "nodeType": "YulBlock", - "src": "155:53:1", + "src": "155:53:2", "statements": [ { "expression": { @@ -108,35 +108,35 @@ { "name": "pos", "nodeType": "YulIdentifier", - "src": "172:3:1" + "src": "172:3:2" }, { "arguments": [ { "name": "value", "nodeType": "YulIdentifier", - "src": "195:5:1" + "src": "195:5:2" } ], "functionName": { "name": "cleanup_t_uint256", "nodeType": "YulIdentifier", - "src": "177:17:1" + "src": "177:17:2" }, "nodeType": "YulFunctionCall", - "src": "177:24:1" + "src": "177:24:2" } ], "functionName": { "name": "mstore", "nodeType": "YulIdentifier", - "src": "165:6:1" + "src": "165:6:2" }, "nodeType": "YulFunctionCall", - "src": "165:37:1" + "src": "165:37:2" }, "nodeType": "YulExpressionStatement", - "src": "165:37:1" + "src": "165:37:2" } ] }, @@ -146,37 +146,37 @@ { "name": "value", "nodeType": "YulTypedName", - "src": "143:5:1", + "src": "143:5:2", "type": "" }, { "name": "pos", "nodeType": "YulTypedName", - "src": "150:3:1", + "src": "150:3:2", "type": "" } ], - "src": "90:118:1" + "src": "90:118:2" }, { "body": { "nodeType": "YulBlock", - "src": "312:124:1", + "src": "312:124:2", "statements": [ { "nodeType": "YulAssignment", - "src": "322:26:1", + "src": "322:26:2", "value": { "arguments": [ { "name": "headStart", "nodeType": "YulIdentifier", - "src": "334:9:1" + "src": "334:9:2" }, { "kind": "number", "nodeType": "YulLiteral", - "src": "345:2:1", + "src": "345:2:2", "type": "", "value": "32" } @@ -184,16 +184,16 @@ "functionName": { "name": "add", "nodeType": "YulIdentifier", - "src": "330:3:1" + "src": "330:3:2" }, "nodeType": "YulFunctionCall", - "src": "330:18:1" + "src": "330:18:2" }, "variableNames": [ { "name": "tail", "nodeType": "YulIdentifier", - "src": "322:4:1" + "src": "322:4:2" } ] }, @@ -203,19 +203,19 @@ { "name": "value0", "nodeType": "YulIdentifier", - "src": "402:6:1" + "src": "402:6:2" }, { "arguments": [ { "name": "headStart", "nodeType": "YulIdentifier", - "src": "415:9:1" + "src": "415:9:2" }, { "kind": "number", "nodeType": "YulLiteral", - "src": "426:1:1", + "src": "426:1:2", "type": "", "value": "0" } @@ -223,22 +223,22 @@ "functionName": { "name": "add", "nodeType": "YulIdentifier", - "src": "411:3:1" + "src": "411:3:2" }, "nodeType": "YulFunctionCall", - "src": "411:17:1" + "src": "411:17:2" } ], "functionName": { "name": "abi_encode_t_uint256_to_t_uint256_fromStack", "nodeType": "YulIdentifier", - "src": "358:43:1" + "src": "358:43:2" }, "nodeType": "YulFunctionCall", - "src": "358:71:1" + "src": "358:71:2" }, "nodeType": "YulExpressionStatement", - "src": "358:71:1" + "src": "358:71:2" } ] }, @@ -248,13 +248,13 @@ { "name": "headStart", "nodeType": "YulTypedName", - "src": "284:9:1", + "src": "284:9:2", "type": "" }, { "name": "value0", "nodeType": "YulTypedName", - "src": "296:6:1", + "src": "296:6:2", "type": "" } ], @@ -262,31 +262,31 @@ { "name": "tail", "nodeType": "YulTypedName", - "src": "307:4:1", + "src": "307:4:2", "type": "" } ], - "src": "214:222:1" + "src": "214:222:2" }, { "body": { "nodeType": "YulBlock", - "src": "487:81:1", + "src": "487:81:2", "statements": [ { "nodeType": "YulAssignment", - "src": "497:65:1", + "src": "497:65:2", "value": { "arguments": [ { "name": "value", "nodeType": "YulIdentifier", - "src": "512:5:1" + "src": "512:5:2" }, { "kind": "number", "nodeType": "YulLiteral", - "src": "519:42:1", + "src": "519:42:2", "type": "", "value": "0xffffffffffffffffffffffffffffffffffffffff" } @@ -294,16 +294,16 @@ "functionName": { "name": "and", "nodeType": "YulIdentifier", - "src": "508:3:1" + "src": "508:3:2" }, "nodeType": "YulFunctionCall", - "src": "508:54:1" + "src": "508:54:2" }, "variableNames": [ { "name": "cleaned", "nodeType": "YulIdentifier", - "src": "497:7:1" + "src": "497:7:2" } ] } @@ -315,7 +315,7 @@ { "name": "value", "nodeType": "YulTypedName", - "src": "469:5:1", + "src": "469:5:2", "type": "" } ], @@ -323,41 +323,41 @@ { "name": "cleaned", "nodeType": "YulTypedName", - "src": "479:7:1", + "src": "479:7:2", "type": "" } ], - "src": "442:126:1" + "src": "442:126:2" }, { "body": { "nodeType": "YulBlock", - "src": "619:51:1", + "src": "619:51:2", "statements": [ { "nodeType": "YulAssignment", - "src": "629:35:1", + "src": "629:35:2", "value": { "arguments": [ { "name": "value", "nodeType": "YulIdentifier", - "src": "658:5:1" + "src": "658:5:2" } ], "functionName": { "name": "cleanup_t_uint160", "nodeType": "YulIdentifier", - "src": "640:17:1" + "src": "640:17:2" }, "nodeType": "YulFunctionCall", - "src": "640:24:1" + "src": "640:24:2" }, "variableNames": [ { "name": "cleaned", "nodeType": "YulIdentifier", - "src": "629:7:1" + "src": "629:7:2" } ] } @@ -369,7 +369,7 @@ { "name": "value", "nodeType": "YulTypedName", - "src": "601:5:1", + "src": "601:5:2", "type": "" } ], @@ -377,16 +377,16 @@ { "name": "cleaned", "nodeType": "YulTypedName", - "src": "611:7:1", + "src": "611:7:2", "type": "" } ], - "src": "574:96:1" + "src": "574:96:2" }, { "body": { "nodeType": "YulBlock", - "src": "741:53:1", + "src": "741:53:2", "statements": [ { "expression": { @@ -394,35 +394,35 @@ { "name": "pos", "nodeType": "YulIdentifier", - "src": "758:3:1" + "src": "758:3:2" }, { "arguments": [ { "name": "value", "nodeType": "YulIdentifier", - "src": "781:5:1" + "src": "781:5:2" } ], "functionName": { "name": "cleanup_t_address", "nodeType": "YulIdentifier", - "src": "763:17:1" + "src": "763:17:2" }, "nodeType": "YulFunctionCall", - "src": "763:24:1" + "src": "763:24:2" } ], "functionName": { "name": "mstore", "nodeType": "YulIdentifier", - "src": "751:6:1" + "src": "751:6:2" }, "nodeType": "YulFunctionCall", - "src": "751:37:1" + "src": "751:37:2" }, "nodeType": "YulExpressionStatement", - "src": "751:37:1" + "src": "751:37:2" } ] }, @@ -432,37 +432,37 @@ { "name": "value", "nodeType": "YulTypedName", - "src": "729:5:1", + "src": "729:5:2", "type": "" }, { "name": "pos", "nodeType": "YulTypedName", - "src": "736:3:1", + "src": "736:3:2", "type": "" } ], - "src": "676:118:1" + "src": "676:118:2" }, { "body": { "nodeType": "YulBlock", - "src": "898:124:1", + "src": "898:124:2", "statements": [ { "nodeType": "YulAssignment", - "src": "908:26:1", + "src": "908:26:2", "value": { "arguments": [ { "name": "headStart", "nodeType": "YulIdentifier", - "src": "920:9:1" + "src": "920:9:2" }, { "kind": "number", "nodeType": "YulLiteral", - "src": "931:2:1", + "src": "931:2:2", "type": "", "value": "32" } @@ -470,16 +470,16 @@ "functionName": { "name": "add", "nodeType": "YulIdentifier", - "src": "916:3:1" + "src": "916:3:2" }, "nodeType": "YulFunctionCall", - "src": "916:18:1" + "src": "916:18:2" }, "variableNames": [ { "name": "tail", "nodeType": "YulIdentifier", - "src": "908:4:1" + "src": "908:4:2" } ] }, @@ -489,19 +489,19 @@ { "name": "value0", "nodeType": "YulIdentifier", - "src": "988:6:1" + "src": "988:6:2" }, { "arguments": [ { "name": "headStart", "nodeType": "YulIdentifier", - "src": "1001:9:1" + "src": "1001:9:2" }, { "kind": "number", "nodeType": "YulLiteral", - "src": "1012:1:1", + "src": "1012:1:2", "type": "", "value": "0" } @@ -509,22 +509,22 @@ "functionName": { "name": "add", "nodeType": "YulIdentifier", - "src": "997:3:1" + "src": "997:3:2" }, "nodeType": "YulFunctionCall", - "src": "997:17:1" + "src": "997:17:2" } ], "functionName": { "name": "abi_encode_t_address_to_t_address_fromStack", "nodeType": "YulIdentifier", - "src": "944:43:1" + "src": "944:43:2" }, "nodeType": "YulFunctionCall", - "src": "944:71:1" + "src": "944:71:2" }, "nodeType": "YulExpressionStatement", - "src": "944:71:1" + "src": "944:71:2" } ] }, @@ -534,13 +534,13 @@ { "name": "headStart", "nodeType": "YulTypedName", - "src": "870:9:1", + "src": "870:9:2", "type": "" }, { "name": "value0", "nodeType": "YulTypedName", - "src": "882:6:1", + "src": "882:6:2", "type": "" } ], @@ -548,26 +548,26 @@ { "name": "tail", "nodeType": "YulTypedName", - "src": "893:4:1", + "src": "893:4:2", "type": "" } ], - "src": "800:222:1" + "src": "800:222:2" }, { "body": { "nodeType": "YulBlock", - "src": "1068:35:1", + "src": "1068:35:2", "statements": [ { "nodeType": "YulAssignment", - "src": "1078:19:1", + "src": "1078:19:2", "value": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", - "src": "1094:2:1", + "src": "1094:2:2", "type": "", "value": "64" } @@ -575,16 +575,16 @@ "functionName": { "name": "mload", "nodeType": "YulIdentifier", - "src": "1088:5:1" + "src": "1088:5:2" }, "nodeType": "YulFunctionCall", - "src": "1088:9:1" + "src": "1088:9:2" }, "variableNames": [ { "name": "memPtr", "nodeType": "YulIdentifier", - "src": "1078:6:1" + "src": "1078:6:2" } ] } @@ -596,16 +596,16 @@ { "name": "memPtr", "nodeType": "YulTypedName", - "src": "1061:6:1", + "src": "1061:6:2", "type": "" } ], - "src": "1028:75:1" + "src": "1028:75:2" }, { "body": { "nodeType": "YulBlock", - "src": "1198:28:1", + "src": "1198:28:2", "statements": [ { "expression": { @@ -613,14 +613,14 @@ { "kind": "number", "nodeType": "YulLiteral", - "src": "1215:1:1", + "src": "1215:1:2", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", - "src": "1218:1:1", + "src": "1218:1:2", "type": "", "value": "0" } @@ -628,24 +628,24 @@ "functionName": { "name": "revert", "nodeType": "YulIdentifier", - "src": "1208:6:1" + "src": "1208:6:2" }, "nodeType": "YulFunctionCall", - "src": "1208:12:1" + "src": "1208:12:2" }, "nodeType": "YulExpressionStatement", - "src": "1208:12:1" + "src": "1208:12:2" } ] }, "name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", "nodeType": "YulFunctionDefinition", - "src": "1109:117:1" + "src": "1109:117:2" }, { "body": { "nodeType": "YulBlock", - "src": "1321:28:1", + "src": "1321:28:2", "statements": [ { "expression": { @@ -653,14 +653,14 @@ { "kind": "number", "nodeType": "YulLiteral", - "src": "1338:1:1", + "src": "1338:1:2", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", - "src": "1341:1:1", + "src": "1341:1:2", "type": "", "value": "0" } @@ -668,29 +668,29 @@ "functionName": { "name": "revert", "nodeType": "YulIdentifier", - "src": "1331:6:1" + "src": "1331:6:2" }, "nodeType": "YulFunctionCall", - "src": "1331:12:1" + "src": "1331:12:2" }, "nodeType": "YulExpressionStatement", - "src": "1331:12:1" + "src": "1331:12:2" } ] }, "name": "revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db", "nodeType": "YulFunctionDefinition", - "src": "1232:117:1" + "src": "1232:117:2" }, { "body": { "nodeType": "YulBlock", - "src": "1398:79:1", + "src": "1398:79:2", "statements": [ { "body": { "nodeType": "YulBlock", - "src": "1455:16:1", + "src": "1455:16:2", "statements": [ { "expression": { @@ -698,14 +698,14 @@ { "kind": "number", "nodeType": "YulLiteral", - "src": "1464:1:1", + "src": "1464:1:2", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", - "src": "1467:1:1", + "src": "1467:1:2", "type": "", "value": "0" } @@ -713,13 +713,13 @@ "functionName": { "name": "revert", "nodeType": "YulIdentifier", - "src": "1457:6:1" + "src": "1457:6:2" }, "nodeType": "YulFunctionCall", - "src": "1457:12:1" + "src": "1457:12:2" }, "nodeType": "YulExpressionStatement", - "src": "1457:12:1" + "src": "1457:12:2" } ] }, @@ -730,44 +730,44 @@ { "name": "value", "nodeType": "YulIdentifier", - "src": "1421:5:1" + "src": "1421:5:2" }, { "arguments": [ { "name": "value", "nodeType": "YulIdentifier", - "src": "1446:5:1" + "src": "1446:5:2" } ], "functionName": { "name": "cleanup_t_uint256", "nodeType": "YulIdentifier", - "src": "1428:17:1" + "src": "1428:17:2" }, "nodeType": "YulFunctionCall", - "src": "1428:24:1" + "src": "1428:24:2" } ], "functionName": { "name": "eq", "nodeType": "YulIdentifier", - "src": "1418:2:1" + "src": "1418:2:2" }, "nodeType": "YulFunctionCall", - "src": "1418:35:1" + "src": "1418:35:2" } ], "functionName": { "name": "iszero", "nodeType": "YulIdentifier", - "src": "1411:6:1" + "src": "1411:6:2" }, "nodeType": "YulFunctionCall", - "src": "1411:43:1" + "src": "1411:43:2" }, "nodeType": "YulIf", - "src": "1408:63:1" + "src": "1408:63:2" } ] }, @@ -777,41 +777,41 @@ { "name": "value", "nodeType": "YulTypedName", - "src": "1391:5:1", + "src": "1391:5:2", "type": "" } ], - "src": "1355:122:1" + "src": "1355:122:2" }, { "body": { "nodeType": "YulBlock", - "src": "1535:87:1", + "src": "1535:87:2", "statements": [ { "nodeType": "YulAssignment", - "src": "1545:29:1", + "src": "1545:29:2", "value": { "arguments": [ { "name": "offset", "nodeType": "YulIdentifier", - "src": "1567:6:1" + "src": "1567:6:2" } ], "functionName": { "name": "calldataload", "nodeType": "YulIdentifier", - "src": "1554:12:1" + "src": "1554:12:2" }, "nodeType": "YulFunctionCall", - "src": "1554:20:1" + "src": "1554:20:2" }, "variableNames": [ { "name": "value", "nodeType": "YulIdentifier", - "src": "1545:5:1" + "src": "1545:5:2" } ] }, @@ -821,19 +821,19 @@ { "name": "value", "nodeType": "YulIdentifier", - "src": "1610:5:1" + "src": "1610:5:2" } ], "functionName": { "name": "validator_revert_t_uint256", "nodeType": "YulIdentifier", - "src": "1583:26:1" + "src": "1583:26:2" }, "nodeType": "YulFunctionCall", - "src": "1583:33:1" + "src": "1583:33:2" }, "nodeType": "YulExpressionStatement", - "src": "1583:33:1" + "src": "1583:33:2" } ] }, @@ -843,13 +843,13 @@ { "name": "offset", "nodeType": "YulTypedName", - "src": "1513:6:1", + "src": "1513:6:2", "type": "" }, { "name": "end", "nodeType": "YulTypedName", - "src": "1521:3:1", + "src": "1521:3:2", "type": "" } ], @@ -857,21 +857,21 @@ { "name": "value", "nodeType": "YulTypedName", - "src": "1529:5:1", + "src": "1529:5:2", "type": "" } ], - "src": "1483:139:1" + "src": "1483:139:2" }, { "body": { "nodeType": "YulBlock", - "src": "1694:263:1", + "src": "1694:263:2", "statements": [ { "body": { "nodeType": "YulBlock", - "src": "1740:83:1", + "src": "1740:83:2", "statements": [ { "expression": { @@ -879,13 +879,13 @@ "functionName": { "name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", "nodeType": "YulIdentifier", - "src": "1742:77:1" + "src": "1742:77:2" }, "nodeType": "YulFunctionCall", - "src": "1742:79:1" + "src": "1742:79:2" }, "nodeType": "YulExpressionStatement", - "src": "1742:79:1" + "src": "1742:79:2" } ] }, @@ -896,26 +896,26 @@ { "name": "dataEnd", "nodeType": "YulIdentifier", - "src": "1715:7:1" + "src": "1715:7:2" }, { "name": "headStart", "nodeType": "YulIdentifier", - "src": "1724:9:1" + "src": "1724:9:2" } ], "functionName": { "name": "sub", "nodeType": "YulIdentifier", - "src": "1711:3:1" + "src": "1711:3:2" }, "nodeType": "YulFunctionCall", - "src": "1711:23:1" + "src": "1711:23:2" }, { "kind": "number", "nodeType": "YulLiteral", - "src": "1736:2:1", + "src": "1736:2:2", "type": "", "value": "32" } @@ -923,25 +923,25 @@ "functionName": { "name": "slt", "nodeType": "YulIdentifier", - "src": "1707:3:1" + "src": "1707:3:2" }, "nodeType": "YulFunctionCall", - "src": "1707:32:1" + "src": "1707:32:2" }, "nodeType": "YulIf", - "src": "1704:119:1" + "src": "1704:119:2" }, { "nodeType": "YulBlock", - "src": "1833:117:1", + "src": "1833:117:2", "statements": [ { "nodeType": "YulVariableDeclaration", - "src": "1848:15:1", + "src": "1848:15:2", "value": { "kind": "number", "nodeType": "YulLiteral", - "src": "1862:1:1", + "src": "1862:1:2", "type": "", "value": "0" }, @@ -949,14 +949,14 @@ { "name": "offset", "nodeType": "YulTypedName", - "src": "1852:6:1", + "src": "1852:6:2", "type": "" } ] }, { "nodeType": "YulAssignment", - "src": "1877:63:1", + "src": "1877:63:2", "value": { "arguments": [ { @@ -964,41 +964,41 @@ { "name": "headStart", "nodeType": "YulIdentifier", - "src": "1912:9:1" + "src": "1912:9:2" }, { "name": "offset", "nodeType": "YulIdentifier", - "src": "1923:6:1" + "src": "1923:6:2" } ], "functionName": { "name": "add", "nodeType": "YulIdentifier", - "src": "1908:3:1" + "src": "1908:3:2" }, "nodeType": "YulFunctionCall", - "src": "1908:22:1" + "src": "1908:22:2" }, { "name": "dataEnd", "nodeType": "YulIdentifier", - "src": "1932:7:1" + "src": "1932:7:2" } ], "functionName": { "name": "abi_decode_t_uint256", "nodeType": "YulIdentifier", - "src": "1887:20:1" + "src": "1887:20:2" }, "nodeType": "YulFunctionCall", - "src": "1887:53:1" + "src": "1887:53:2" }, "variableNames": [ { "name": "value0", "nodeType": "YulIdentifier", - "src": "1877:6:1" + "src": "1877:6:2" } ] } @@ -1012,13 +1012,13 @@ { "name": "headStart", "nodeType": "YulTypedName", - "src": "1664:9:1", + "src": "1664:9:2", "type": "" }, { "name": "dataEnd", "nodeType": "YulTypedName", - "src": "1675:7:1", + "src": "1675:7:2", "type": "" } ], @@ -1026,16 +1026,16 @@ { "name": "value0", "nodeType": "YulTypedName", - "src": "1687:6:1", + "src": "1687:6:2", "type": "" } ], - "src": "1628:329:1" + "src": "1628:329:2" }, { "body": { "nodeType": "YulBlock", - "src": "2059:73:1", + "src": "2059:73:2", "statements": [ { "expression": { @@ -1043,39 +1043,39 @@ { "name": "pos", "nodeType": "YulIdentifier", - "src": "2076:3:1" + "src": "2076:3:2" }, { "name": "length", "nodeType": "YulIdentifier", - "src": "2081:6:1" + "src": "2081:6:2" } ], "functionName": { "name": "mstore", "nodeType": "YulIdentifier", - "src": "2069:6:1" + "src": "2069:6:2" }, "nodeType": "YulFunctionCall", - "src": "2069:19:1" + "src": "2069:19:2" }, "nodeType": "YulExpressionStatement", - "src": "2069:19:1" + "src": "2069:19:2" }, { "nodeType": "YulAssignment", - "src": "2097:29:1", + "src": "2097:29:2", "value": { "arguments": [ { "name": "pos", "nodeType": "YulIdentifier", - "src": "2116:3:1" + "src": "2116:3:2" }, { "kind": "number", "nodeType": "YulLiteral", - "src": "2121:4:1", + "src": "2121:4:2", "type": "", "value": "0x20" } @@ -1083,16 +1083,16 @@ "functionName": { "name": "add", "nodeType": "YulIdentifier", - "src": "2112:3:1" + "src": "2112:3:2" }, "nodeType": "YulFunctionCall", - "src": "2112:14:1" + "src": "2112:14:2" }, "variableNames": [ { "name": "updated_pos", "nodeType": "YulIdentifier", - "src": "2097:11:1" + "src": "2097:11:2" } ] } @@ -1104,13 +1104,13 @@ { "name": "pos", "nodeType": "YulTypedName", - "src": "2031:3:1", + "src": "2031:3:2", "type": "" }, { "name": "length", "nodeType": "YulTypedName", - "src": "2036:6:1", + "src": "2036:6:2", "type": "" } ], @@ -1118,16 +1118,16 @@ { "name": "updated_pos", "nodeType": "YulTypedName", - "src": "2047:11:1", + "src": "2047:11:2", "type": "" } ], - "src": "1963:169:1" + "src": "1963:169:2" }, { "body": { "nodeType": "YulBlock", - "src": "2244:132:1", + "src": "2244:132:2", "statements": [ { "expression": { @@ -1137,12 +1137,12 @@ { "name": "memPtr", "nodeType": "YulIdentifier", - "src": "2266:6:1" + "src": "2266:6:2" }, { "kind": "number", "nodeType": "YulLiteral", - "src": "2274:1:1", + "src": "2274:1:2", "type": "", "value": "0" } @@ -1150,16 +1150,16 @@ "functionName": { "name": "add", "nodeType": "YulIdentifier", - "src": "2262:3:1" + "src": "2262:3:2" }, "nodeType": "YulFunctionCall", - "src": "2262:14:1" + "src": "2262:14:2" }, { "hexValue": "546869732066756e6374696f6e206973207265737472696374656420746f2074", "kind": "string", "nodeType": "YulLiteral", - "src": "2278:34:1", + "src": "2278:34:2", "type": "", "value": "This function is restricted to t" } @@ -1167,13 +1167,13 @@ "functionName": { "name": "mstore", "nodeType": "YulIdentifier", - "src": "2255:6:1" + "src": "2255:6:2" }, "nodeType": "YulFunctionCall", - "src": "2255:58:1" + "src": "2255:58:2" }, "nodeType": "YulExpressionStatement", - "src": "2255:58:1" + "src": "2255:58:2" }, { "expression": { @@ -1183,12 +1183,12 @@ { "name": "memPtr", "nodeType": "YulIdentifier", - "src": "2334:6:1" + "src": "2334:6:2" }, { "kind": "number", "nodeType": "YulLiteral", - "src": "2342:2:1", + "src": "2342:2:2", "type": "", "value": "32" } @@ -1196,16 +1196,16 @@ "functionName": { "name": "add", "nodeType": "YulIdentifier", - "src": "2330:3:1" + "src": "2330:3:2" }, "nodeType": "YulFunctionCall", - "src": "2330:15:1" + "src": "2330:15:2" }, { "hexValue": "686520636f6e74726163742773206f776e6572", "kind": "string", "nodeType": "YulLiteral", - "src": "2347:21:1", + "src": "2347:21:2", "type": "", "value": "he contract's owner" } @@ -1213,13 +1213,13 @@ "functionName": { "name": "mstore", "nodeType": "YulIdentifier", - "src": "2323:6:1" + "src": "2323:6:2" }, "nodeType": "YulFunctionCall", - "src": "2323:46:1" + "src": "2323:46:2" }, "nodeType": "YulExpressionStatement", - "src": "2323:46:1" + "src": "2323:46:2" } ] }, @@ -1229,31 +1229,31 @@ { "name": "memPtr", "nodeType": "YulTypedName", - "src": "2236:6:1", + "src": "2236:6:2", "type": "" } ], - "src": "2138:238:1" + "src": "2138:238:2" }, { "body": { "nodeType": "YulBlock", - "src": "2528:220:1", + "src": "2528:220:2", "statements": [ { "nodeType": "YulAssignment", - "src": "2538:74:1", + "src": "2538:74:2", "value": { "arguments": [ { "name": "pos", "nodeType": "YulIdentifier", - "src": "2604:3:1" + "src": "2604:3:2" }, { "kind": "number", "nodeType": "YulLiteral", - "src": "2609:2:1", + "src": "2609:2:2", "type": "", "value": "51" } @@ -1261,16 +1261,16 @@ "functionName": { "name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack", "nodeType": "YulIdentifier", - "src": "2545:58:1" + "src": "2545:58:2" }, "nodeType": "YulFunctionCall", - "src": "2545:67:1" + "src": "2545:67:2" }, "variableNames": [ { "name": "pos", "nodeType": "YulIdentifier", - "src": "2538:3:1" + "src": "2538:3:2" } ] }, @@ -1280,34 +1280,34 @@ { "name": "pos", "nodeType": "YulIdentifier", - "src": "2710:3:1" + "src": "2710:3:2" } ], "functionName": { "name": "store_literal_in_memory_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1", "nodeType": "YulIdentifier", - "src": "2621:88:1" + "src": "2621:88:2" }, "nodeType": "YulFunctionCall", - "src": "2621:93:1" + "src": "2621:93:2" }, "nodeType": "YulExpressionStatement", - "src": "2621:93:1" + "src": "2621:93:2" }, { "nodeType": "YulAssignment", - "src": "2723:19:1", + "src": "2723:19:2", "value": { "arguments": [ { "name": "pos", "nodeType": "YulIdentifier", - "src": "2734:3:1" + "src": "2734:3:2" }, { "kind": "number", "nodeType": "YulLiteral", - "src": "2739:2:1", + "src": "2739:2:2", "type": "", "value": "64" } @@ -1315,16 +1315,16 @@ "functionName": { "name": "add", "nodeType": "YulIdentifier", - "src": "2730:3:1" + "src": "2730:3:2" }, "nodeType": "YulFunctionCall", - "src": "2730:12:1" + "src": "2730:12:2" }, "variableNames": [ { "name": "end", "nodeType": "YulIdentifier", - "src": "2723:3:1" + "src": "2723:3:2" } ] } @@ -1336,7 +1336,7 @@ { "name": "pos", "nodeType": "YulTypedName", - "src": "2516:3:1", + "src": "2516:3:2", "type": "" } ], @@ -1344,31 +1344,31 @@ { "name": "end", "nodeType": "YulTypedName", - "src": "2524:3:1", + "src": "2524:3:2", "type": "" } ], - "src": "2382:366:1" + "src": "2382:366:2" }, { "body": { "nodeType": "YulBlock", - "src": "2925:248:1", + "src": "2925:248:2", "statements": [ { "nodeType": "YulAssignment", - "src": "2935:26:1", + "src": "2935:26:2", "value": { "arguments": [ { "name": "headStart", "nodeType": "YulIdentifier", - "src": "2947:9:1" + "src": "2947:9:2" }, { "kind": "number", "nodeType": "YulLiteral", - "src": "2958:2:1", + "src": "2958:2:2", "type": "", "value": "32" } @@ -1376,16 +1376,16 @@ "functionName": { "name": "add", "nodeType": "YulIdentifier", - "src": "2943:3:1" + "src": "2943:3:2" }, "nodeType": "YulFunctionCall", - "src": "2943:18:1" + "src": "2943:18:2" }, "variableNames": [ { "name": "tail", "nodeType": "YulIdentifier", - "src": "2935:4:1" + "src": "2935:4:2" } ] }, @@ -1397,12 +1397,12 @@ { "name": "headStart", "nodeType": "YulIdentifier", - "src": "2982:9:1" + "src": "2982:9:2" }, { "kind": "number", "nodeType": "YulLiteral", - "src": "2993:1:1", + "src": "2993:1:2", "type": "", "value": "0" } @@ -1410,68 +1410,68 @@ "functionName": { "name": "add", "nodeType": "YulIdentifier", - "src": "2978:3:1" + "src": "2978:3:2" }, "nodeType": "YulFunctionCall", - "src": "2978:17:1" + "src": "2978:17:2" }, { "arguments": [ { "name": "tail", "nodeType": "YulIdentifier", - "src": "3001:4:1" + "src": "3001:4:2" }, { "name": "headStart", "nodeType": "YulIdentifier", - "src": "3007:9:1" + "src": "3007:9:2" } ], "functionName": { "name": "sub", "nodeType": "YulIdentifier", - "src": "2997:3:1" + "src": "2997:3:2" }, "nodeType": "YulFunctionCall", - "src": "2997:20:1" + "src": "2997:20:2" } ], "functionName": { "name": "mstore", "nodeType": "YulIdentifier", - "src": "2971:6:1" + "src": "2971:6:2" }, "nodeType": "YulFunctionCall", - "src": "2971:47:1" + "src": "2971:47:2" }, "nodeType": "YulExpressionStatement", - "src": "2971:47:1" + "src": "2971:47:2" }, { "nodeType": "YulAssignment", - "src": "3027:139:1", + "src": "3027:139:2", "value": { "arguments": [ { "name": "tail", "nodeType": "YulIdentifier", - "src": "3161:4:1" + "src": "3161:4:2" } ], "functionName": { "name": "abi_encode_t_stringliteral_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1_to_t_string_memory_ptr_fromStack", "nodeType": "YulIdentifier", - "src": "3035:124:1" + "src": "3035:124:2" }, "nodeType": "YulFunctionCall", - "src": "3035:131:1" + "src": "3035:131:2" }, "variableNames": [ { "name": "tail", "nodeType": "YulIdentifier", - "src": "3027:4:1" + "src": "3027:4:2" } ] } @@ -1483,7 +1483,7 @@ { "name": "headStart", "nodeType": "YulTypedName", - "src": "2905:9:1", + "src": "2905:9:2", "type": "" } ], @@ -1491,22 +1491,22 @@ { "name": "tail", "nodeType": "YulTypedName", - "src": "2920:4:1", + "src": "2920:4:2", "type": "" } ], - "src": "2754:419:1" + "src": "2754:419:2" } ] }, "contents": "{\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n function abi_encode_t_uint256_to_t_uint256_fromStack(value, pos) {\n mstore(pos, cleanup_t_uint256(value))\n }\n\n function abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed(headStart , value0) -> tail {\n tail := add(headStart, 32)\n\n abi_encode_t_uint256_to_t_uint256_fromStack(value0, add(headStart, 0))\n\n }\n\n function cleanup_t_uint160(value) -> cleaned {\n cleaned := and(value, 0xffffffffffffffffffffffffffffffffffffffff)\n }\n\n function cleanup_t_address(value) -> cleaned {\n cleaned := cleanup_t_uint160(value)\n }\n\n function abi_encode_t_address_to_t_address_fromStack(value, pos) {\n mstore(pos, cleanup_t_address(value))\n }\n\n function abi_encode_tuple_t_address__to_t_address__fromStack_reversed(headStart , value0) -> tail {\n tail := add(headStart, 32)\n\n abi_encode_t_address_to_t_address_fromStack(value0, add(headStart, 0))\n\n }\n\n function allocate_unbounded() -> memPtr {\n memPtr := mload(64)\n }\n\n function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {\n revert(0, 0)\n }\n\n function revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() {\n revert(0, 0)\n }\n\n function validator_revert_t_uint256(value) {\n if iszero(eq(value, cleanup_t_uint256(value))) { revert(0, 0) }\n }\n\n function abi_decode_t_uint256(offset, end) -> value {\n value := calldataload(offset)\n validator_revert_t_uint256(value)\n }\n\n function abi_decode_tuple_t_uint256(headStart, dataEnd) -> value0 {\n if slt(sub(dataEnd, headStart), 32) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_uint256(add(headStart, offset), dataEnd)\n }\n\n }\n\n function array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, length) -> updated_pos {\n mstore(pos, length)\n updated_pos := add(pos, 0x20)\n }\n\n function store_literal_in_memory_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1(memPtr) {\n\n mstore(add(memPtr, 0), \"This function is restricted to t\")\n\n mstore(add(memPtr, 32), \"he contract's owner\")\n\n }\n\n function abi_encode_t_stringliteral_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1_to_t_string_memory_ptr_fromStack(pos) -> end {\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, 51)\n store_literal_in_memory_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1(pos)\n end := add(pos, 64)\n }\n\n function abi_encode_tuple_t_stringliteral_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1__to_t_string_memory_ptr__fromStack_reversed(headStart ) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_stringliteral_f60fe2d9d123295bf92ecf95167f1fa709e374da35e4c083bd39dc2d82acd8b1_to_t_string_memory_ptr_fromStack( tail)\n\n }\n\n}\n", - "id": 1, + "id": 2, "language": "Yul", "name": "#utility.yul" } ], "sourceMap": "66:352:0:-:0;;;113:10;90:33;;;;;;;;;;;;;;;;;;;;66:352;;;;;;;;;;;;;;;;", - "deployedSourceMap": "66:352:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;127:36;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;90:33;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;313:103;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;127:36;;;;:::o;90:33::-;;;;;;;;;;;;:::o;313:103::-;225:5;;;;;;;;;;211:19;;:10;:19;;;196:101;;;;;;;;;;;;:::i;:::-;;;;;;;;;402:9:::1;375:24;:36;;;;313:103:::0;:::o;7:77:1:-;44:7;73:5;62:16;;7:77;;;:::o;90:118::-;177:24;195:5;177:24;:::i;:::-;172:3;165:37;90:118;;:::o;214:222::-;307:4;345:2;334:9;330:18;322:26;;358:71;426:1;415:9;411:17;402:6;358:71;:::i;:::-;214:222;;;;:::o;442:126::-;479:7;519:42;512:5;508:54;497:65;;442:126;;;:::o;574:96::-;611:7;640:24;658:5;640:24;:::i;:::-;629:35;;574:96;;;:::o;676:118::-;763:24;781:5;763:24;:::i;:::-;758:3;751:37;676:118;;:::o;800:222::-;893:4;931:2;920:9;916:18;908:26;;944:71;1012:1;1001:9;997:17;988:6;944:71;:::i;:::-;800:222;;;;:::o;1109:117::-;1218:1;1215;1208:12;1355:122;1428:24;1446:5;1428:24;:::i;:::-;1421:5;1418:35;1408:63;;1467:1;1464;1457:12;1408:63;1355:122;:::o;1483:139::-;1529:5;1567:6;1554:20;1545:29;;1583:33;1610:5;1583:33;:::i;:::-;1483:139;;;;:::o;1628:329::-;1687:6;1736:2;1724:9;1715:7;1711:23;1707:32;1704:119;;;1742:79;;:::i;:::-;1704:119;1862:1;1887:53;1932:7;1923:6;1912:9;1908:22;1887:53;:::i;:::-;1877:63;;1833:117;1628:329;;;;:::o;1963:169::-;2047:11;2081:6;2076:3;2069:19;2121:4;2116:3;2112:14;2097:29;;1963:169;;;;:::o;2138:238::-;2278:34;2274:1;2266:6;2262:14;2255:58;2347:21;2342:2;2334:6;2330:15;2323:46;2138:238;:::o;2382:366::-;2524:3;2545:67;2609:2;2604:3;2545:67;:::i;:::-;2538:74;;2621:93;2710:3;2621:93;:::i;:::-;2739:2;2734:3;2730:12;2723:19;;2382:366;;;:::o;2754:419::-;2920:4;2958:2;2947:9;2943:18;2935:26;;3007:9;3001:4;2997:20;2993:1;2982:9;2978:17;2971:47;3035:131;3161:4;3035:131;:::i;:::-;3027:139;;2754:419;;;:::o", + "deployedSourceMap": "66:352:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;127:36;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;90:33;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;313:103;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;127:36;;;;:::o;90:33::-;;;;;;;;;;;;:::o;313:103::-;225:5;;;;;;;;;;211:19;;:10;:19;;;196:101;;;;;;;;;;;;:::i;:::-;;;;;;;;;402:9:::1;375:24;:36;;;;313:103:::0;:::o;7:77:2:-;44:7;73:5;62:16;;7:77;;;:::o;90:118::-;177:24;195:5;177:24;:::i;:::-;172:3;165:37;90:118;;:::o;214:222::-;307:4;345:2;334:9;330:18;322:26;;358:71;426:1;415:9;411:17;402:6;358:71;:::i;:::-;214:222;;;;:::o;442:126::-;479:7;519:42;512:5;508:54;497:65;;442:126;;;:::o;574:96::-;611:7;640:24;658:5;640:24;:::i;:::-;629:35;;574:96;;;:::o;676:118::-;763:24;781:5;763:24;:::i;:::-;758:3;751:37;676:118;;:::o;800:222::-;893:4;931:2;920:9;916:18;908:26;;944:71;1012:1;1001:9;997:17;988:6;944:71;:::i;:::-;800:222;;;;:::o;1109:117::-;1218:1;1215;1208:12;1355:122;1428:24;1446:5;1428:24;:::i;:::-;1421:5;1418:35;1408:63;;1467:1;1464;1457:12;1408:63;1355:122;:::o;1483:139::-;1529:5;1567:6;1554:20;1545:29;;1583:33;1610:5;1583:33;:::i;:::-;1483:139;;;;:::o;1628:329::-;1687:6;1736:2;1724:9;1715:7;1711:23;1707:32;1704:119;;;1742:79;;:::i;:::-;1704:119;1862:1;1887:53;1932:7;1923:6;1912:9;1908:22;1887:53;:::i;:::-;1877:63;;1833:117;1628:329;;;;:::o;1963:169::-;2047:11;2081:6;2076:3;2069:19;2121:4;2116:3;2112:14;2097:29;;1963:169;;;;:::o;2138:238::-;2278:34;2274:1;2266:6;2262:14;2255:58;2347:21;2342:2;2334:6;2330:15;2323:46;2138:238;:::o;2382:366::-;2524:3;2545:67;2609:2;2604:3;2545:67;:::i;:::-;2538:74;;2621:93;2710:3;2621:93;:::i;:::-;2739:2;2734:3;2730:12;2723:19;;2382:366;;;:::o;2754:419::-;2920:4;2958:2;2947:9;2943:18;2935:26;;3007:9;3001:4;2997:20;2993:1;2982:9;2978:17;2971:47;3035:131;3161:4;3035:131;:::i;:::-;3027:139;;2754:419;;;:::o", "source": "// SPDX-License-Identifier: MIT\npragma solidity >=0.4.22 <0.9.0;\n\ncontract Migrations {\n address public owner = msg.sender;\n uint public last_completed_migration;\n\n modifier restricted() {\n require(\n msg.sender == owner,\n \"This function is restricted to the contract's owner\"\n );\n _;\n }\n\n function setCompleted(uint completed) public restricted {\n last_completed_migration = completed;\n }\n}\n", "sourcePath": "C:\\dev\\voting-dapp\\contracts\\Migrations.sol", "ast": { @@ -1914,12 +1914,12 @@ "5777": { "events": {}, "links": {}, - "address": "0xDc384f5FBDcD35973Fee7ad4c9C45bd24a78bf71", - "transactionHash": "0x985ebd792e13df2617732fb830286296c42f92be72e7a768a5245c9edfe56019" + "address": "0xF98d8576dFD4EDA611B7c4CF246958b647f4345E", + "transactionHash": "0x8980ddd3ca87e913d66f83c45c3cc4647c8cf4c79e546b414972db138915c7c9" } }, "schemaVersion": "3.4.7", - "updatedAt": "2022-05-29T09:30:55.371Z", + "updatedAt": "2022-06-27T15:59:34.026Z", "networkType": "ethereum", "devdoc": { "kind": "dev", diff --git a/contracts/Voting.sol b/contracts/Voting.sol new file mode 100644 index 0000000..d1dfa98 --- /dev/null +++ b/contracts/Voting.sol @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.4.0 <0.9.0; + +contract Election { + struct Candidate { + uint256 id; + string name; + uint256 voteCount; + } + + mapping(uint256 => Candidate) candidates; + mapping(address => bool) voted; + + uint256 public candidatesCount = 0; + + constructor() { + addCandidate("Candidate 1"); + addCandidate("Candidate 2"); + } + + event Voted(uint256 indexed _candidateId); + + function addCandidate(string memory _name) private { + candidates[candidatesCount] = Candidate(candidatesCount, _name, 0); + candidatesCount++; + } + + function vote(uint256 _candidateId) public { + require(!voted[msg.sender], "You have already voted"); + require( + _candidateId >= 0 && _candidateId < candidatesCount, + "Invalid candidate ID" + ); + + candidates[_candidateId].voteCount++; + voted[msg.sender] = true; + + emit Voted(_candidateId); + } + + function getCandidateDetails(uint256 _candidateId) + public + view + returns (string memory, uint256) + { + require( + _candidateId >= 0 && _candidateId < candidatesCount, + "Invalid candidate ID" + ); + return ( + candidates[_candidateId].name, + candidates[_candidateId].voteCount + ); + } +}