From 79a426a5503831bcaebf8d9c9c30bd27f27be909 Mon Sep 17 00:00:00 2001 From: Jonathan Schwartz Date: Sat, 20 Jan 2018 14:05:43 -0500 Subject: [PATCH] exchange rate working --- build/contracts/CapCoin.json | 1833 +++++++++++++++++----------- build/contracts/Migrations.json | 2 +- build/contracts/SimpleStorage.json | 2 +- contracts/CapCoin.sol | 17 +- src/components/Exchange.js | 7 +- src/components/LikePhoto.js | 2 +- src/store/user.js | 5 +- 7 files changed, 1164 insertions(+), 704 deletions(-) diff --git a/build/contracts/CapCoin.json b/build/contracts/CapCoin.json index efd3edf0..b0886c9b 100644 --- a/build/contracts/CapCoin.json +++ b/build/contracts/CapCoin.json @@ -52,6 +52,15 @@ ], "name": "buyTokens", "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "kill", + "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" @@ -228,6 +237,12 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, { "payable": true, "stateMutability": "payable", @@ -329,18 +344,18 @@ "type": "event" } ], - "bytecode": "0x6060604052620f42406001556000600255336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506116d58061005f6000396000f3006060604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630b1e7f83146100bc57806326ec928f1461011f5780633610724e146101c857806341f3004a146101eb5780634835152914610255578063507ffba514610297578063763f17c4146102f4578063832880e7146104865780638da5cb5b146105c1578063c7303c6114610616578063edf5388614610673578063f2fde38b14610749575b005b34156100c757600080fd5b6100dd6004808035906020019091905050610782565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561012a57600080fd5b6101c6600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919080359060200190919050506107c1565b005b34156101d357600080fd5b6101e960048080359060200190919050506107e1565b005b34156101f657600080fd5b6101fe6108cd565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610241578082015181840152602081019050610226565b505050509050019250505060405180910390f35b341561026057600080fd5b610295600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610961565b005b34156102a257600080fd5b6102f2600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610d60565b005b34156102ff57600080fd5b61032b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e66565b6040518080602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381038352878181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156103f05780601f106103c5576101008083540402835291602001916103f0565b820191906000526020600020905b8154815290600101906020018083116103d357829003601f168201915b50508381038252868181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104735780601f1061044857610100808354040283529160200191610473565b820191906000526020600020905b81548152906001019060200180831161045657829003601f168201915b5050965050505050505060405180910390f35b341561049157600080fd5b610499610eb4565b6040518080602001868152602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838103835288818151815260200191508051906020019080838360005b8381101561051b578082015181840152602081019050610500565b50505050905090810190601f1680156105485780820380516001836020036101000a031916815260200191505b50838103825286818151815260200191508051906020019080838360005b83811015610581578082015181840152602081019050610566565b50505050905090810190601f1680156105ae5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b34156105cc57600080fd5b6105d461111d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561062157600080fd5b610671600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611142565b005b341561067e57600080fd5b6106aa600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506113b1565b60405180806020018381526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156107395780601f1061070e57610100808354040283529160200191610739565b820191906000526020600020905b81548152906001019060200180831161071c57829003601f168201915b5050935050505060405180910390f35b341561075457600080fd5b610780600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506113d4565b005b60058181548110151561079157fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6107ca83610d60565b6107d3816107e1565b6107dc82611142565b505050565b80600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000828254019250508190555080600260008282540192505081905550806001600082825403925050819055507ffe1367e498701f2dfab80a3d41740d46fd7cba533430e611917f0f3df823279a600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546040518082815260200191505060405180910390a150565b6108d5611529565b600580548060200260200160405190810160405280929190818152602001828054801561095757602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161090d575b5050505050905090565b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002016000828254019250508190555080600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000828254019250508190555080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507f050cbab7fede968f252efba864c75069d68302f756e7f9c0093fb37faf2ba79b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000184600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000133600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015460405180888152602001806020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001868152602001806020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001838103835289818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015610cc45780601f10610c9957610100808354040283529160200191610cc4565b820191906000526020600020905b815481529060010190602001808311610ca757829003601f168201915b5050838103825286818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015610d475780601f10610d1c57610100808354040283529160200191610d47565b820191906000526020600020905b815481529060010190602001808311610d2a57829003601f168201915b5050995050505050505050505060405180910390a15050565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905081816000019080519060200190610dbb92919061153d565b50600081600101819055507f66ab3fea2083d9ba15d99b595186fe7fc18e6eba393c0fc056f420e96c3caa44826040518080602001828103825283818151815260200191508051906020019080838360005b83811015610e28578082015181840152602081019050610e0d565b50505050905090810190601f168015610e555780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b6004602052806000526040600020600091509050806000019080600101908060020154908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905084565b610ebc6115bd565b6000610ec66115bd565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015433848054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110695780601f1061103e57610100808354040283529160200191611069565b820191906000526020600020905b81548152906001019060200180831161104c57829003601f168201915b50505050509450828054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111055780601f106110da57610100808354040283529160200191611105565b820191906000526020600020905b8154815290600101906020018083116110e857829003601f168201915b50505050509250945094509450945094509091929394565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508181600001908051906020019061119d92919061153d565b5060058160020160008282540392505081905550600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018160010190805460018160011615610100020316600290046112169291906115d1565b50338160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600580548060010182816112709190611658565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050506005600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507f3b6c110dfadc879ec2bbc1dc567f9065fd5ea5846bce75fddba0f60ffcc79fac826040518080602001828103825283818151815260200191508051906020019080838360005b83811015611373578082015181840152602081019050611358565b50505050905090810190601f1680156113a05780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b600360205280600052604060002060009150905080600001908060010154905082565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561142f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561146b57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061157e57805160ff19168380011785556115ac565b828001600101855582156115ac579182015b828111156115ab578251825591602001919060010190611590565b5b5090506115b99190611684565b5090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061160a5780548555611647565b8280016001018555821561164757600052602060002091601f016020900482015b8281111561164657825482559160010191906001019061162b565b5b5090506116549190611684565b5090565b81548183558181151161167f5781836000526020600020918201910161167e9190611684565b5b505050565b6116a691905b808211156116a257600081600090555060010161168a565b5090565b905600a165627a7a72305820c8d27162de90e72ae6d5bafdd895303d2b48087064dedf0b126fd7a1747a87b00029", - "deployedBytecode": "0x6060604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630b1e7f83146100bc57806326ec928f1461011f5780633610724e146101c857806341f3004a146101eb5780634835152914610255578063507ffba514610297578063763f17c4146102f4578063832880e7146104865780638da5cb5b146105c1578063c7303c6114610616578063edf5388614610673578063f2fde38b14610749575b005b34156100c757600080fd5b6100dd6004808035906020019091905050610782565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561012a57600080fd5b6101c6600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919080359060200190919050506107c1565b005b34156101d357600080fd5b6101e960048080359060200190919050506107e1565b005b34156101f657600080fd5b6101fe6108cd565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610241578082015181840152602081019050610226565b505050509050019250505060405180910390f35b341561026057600080fd5b610295600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610961565b005b34156102a257600080fd5b6102f2600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610d60565b005b34156102ff57600080fd5b61032b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e66565b6040518080602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381038352878181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156103f05780601f106103c5576101008083540402835291602001916103f0565b820191906000526020600020905b8154815290600101906020018083116103d357829003601f168201915b50508381038252868181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104735780601f1061044857610100808354040283529160200191610473565b820191906000526020600020905b81548152906001019060200180831161045657829003601f168201915b5050965050505050505060405180910390f35b341561049157600080fd5b610499610eb4565b6040518080602001868152602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838103835288818151815260200191508051906020019080838360005b8381101561051b578082015181840152602081019050610500565b50505050905090810190601f1680156105485780820380516001836020036101000a031916815260200191505b50838103825286818151815260200191508051906020019080838360005b83811015610581578082015181840152602081019050610566565b50505050905090810190601f1680156105ae5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b34156105cc57600080fd5b6105d461111d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561062157600080fd5b610671600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611142565b005b341561067e57600080fd5b6106aa600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506113b1565b60405180806020018381526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156107395780601f1061070e57610100808354040283529160200191610739565b820191906000526020600020905b81548152906001019060200180831161071c57829003601f168201915b5050935050505060405180910390f35b341561075457600080fd5b610780600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506113d4565b005b60058181548110151561079157fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6107ca83610d60565b6107d3816107e1565b6107dc82611142565b505050565b80600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000828254019250508190555080600260008282540192505081905550806001600082825403925050819055507ffe1367e498701f2dfab80a3d41740d46fd7cba533430e611917f0f3df823279a600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546040518082815260200191505060405180910390a150565b6108d5611529565b600580548060200260200160405190810160405280929190818152602001828054801561095757602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161090d575b5050505050905090565b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002016000828254019250508190555080600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000828254019250508190555080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507f050cbab7fede968f252efba864c75069d68302f756e7f9c0093fb37faf2ba79b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000184600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000133600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015460405180888152602001806020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001868152602001806020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001838103835289818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015610cc45780601f10610c9957610100808354040283529160200191610cc4565b820191906000526020600020905b815481529060010190602001808311610ca757829003601f168201915b5050838103825286818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015610d475780601f10610d1c57610100808354040283529160200191610d47565b820191906000526020600020905b815481529060010190602001808311610d2a57829003601f168201915b5050995050505050505050505060405180910390a15050565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905081816000019080519060200190610dbb92919061153d565b50600081600101819055507f66ab3fea2083d9ba15d99b595186fe7fc18e6eba393c0fc056f420e96c3caa44826040518080602001828103825283818151815260200191508051906020019080838360005b83811015610e28578082015181840152602081019050610e0d565b50505050905090810190601f168015610e555780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b6004602052806000526040600020600091509050806000019080600101908060020154908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905084565b610ebc6115bd565b6000610ec66115bd565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015433848054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110695780601f1061103e57610100808354040283529160200191611069565b820191906000526020600020905b81548152906001019060200180831161104c57829003601f168201915b50505050509450828054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111055780601f106110da57610100808354040283529160200191611105565b820191906000526020600020905b8154815290600101906020018083116110e857829003601f168201915b50505050509250945094509450945094509091929394565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508181600001908051906020019061119d92919061153d565b5060058160020160008282540392505081905550600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018160010190805460018160011615610100020316600290046112169291906115d1565b50338160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600580548060010182816112709190611658565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050506005600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507f3b6c110dfadc879ec2bbc1dc567f9065fd5ea5846bce75fddba0f60ffcc79fac826040518080602001828103825283818151815260200191508051906020019080838360005b83811015611373578082015181840152602081019050611358565b50505050905090810190601f1680156113a05780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b600360205280600052604060002060009150905080600001908060010154905082565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561142f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561146b57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061157e57805160ff19168380011785556115ac565b828001600101855582156115ac579182015b828111156115ab578251825591602001919060010190611590565b5b5090506115b99190611684565b5090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061160a5780548555611647565b8280016001018555821561164757600052602060002091601f016020900482015b8281111561164657825482559160010191906001019061162b565b5b5090506116549190611684565b5090565b81548183558181151161167f5781836000526020600020918201910161167e9190611684565b5b505050565b6116a691905b808211156116a257600081600090555060010161168a565b5090565b905600a165627a7a72305820c8d27162de90e72ae6d5bafdd895303d2b48087064dedf0b126fd7a1747a87b00029", - "sourceMap": "87:2336:0:-;;;403:7;385:25;;433:1;414:20;;509:10:1;501:5;;:18;;;;;;;;;;;;;;;;;;87:2336:0;;;;;;", - "deployedSourceMap": "87:2336:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;699:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2251:136;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1188:207;;;;;;;;;;;;;;;;;;;;;;;;;;2170:77;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;1745:421:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;726:154;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;649:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;884:273;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;238:20:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1399:342:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;599:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;834:169:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;699:22:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;2251:136::-;2318:16;2329:4;2318:10;:16::i;:::-;2342:17;2352:6;2342:9;:17::i;:::-;2367:15;2378:3;2367:10;:15::i;:::-;2251:136;;;:::o;1188:207::-;1274:6;1233:13;:25;1247:10;1233:25;;;;;;;;;;;;;;;:37;;;:47;;;;;;;;;;;1301:6;1286:11;;:21;;;;;;;;;;;1327:6;1313:10;;:20;;;;;;;;;;;1339:51;1352:13;:25;1366:10;1352:25;;;;;;;;;;;;;;;:37;;;1339:51;;;;;;;;;;;;;;;;;;1188:207;:::o;2170:77::-;2211:9;;:::i;:::-;2237:5;2230:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2170:77;:::o;1745:421::-;1844:6;1803:13;:19;1817:4;1803:19;;;;;;;;;;;;;;;:33;;;:48;;;;;;;;;;;1892:6;1857:13;:19;1871:4;1857:19;;;;;;;;;;;;;;;:31;;;:41;;;;;;;;;;;1945:6;1904:13;:25;1918:10;1904:25;;;;;;;;;;;;;;;:37;;;:47;;;;;;;;;;;1957:204;1967:13;:19;1981:4;1967:19;;;;;;;;;;;;;;;:33;;;2008:13;:19;2022:4;2008:19;;;;;;;;;;;;;;;:24;;2034:4;2040:13;:19;2054:4;2040:19;;;;;;;;;;;;;;;:31;;;2079:13;:25;2093:10;2079:25;;;;;;;;;;;;;;;:30;;2111:10;2123:13;:25;2137:10;2123:25;;;;;;;;;;;;;;;:37;;;1957:204;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1745:421;;:::o;726:154::-;772:8;783:13;:25;797:10;783:25;;;;;;;;;;;;;;;772:36;;826:4;814;:9;;:16;;;;;;;;;;;;:::i;:::-;;855:1;836:4;:16;;:20;;;;862:13;870:4;862:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;726:154:0;;:::o;649:46::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;884:273::-;924:6;;:::i;:::-;932:4;938:6;;:::i;:::-;946:3;951:7;974:13;:25;988:10;974:25;;;;;;;;;;;;;;;:30;;1012:13;:25;1026:10;1012:25;;;;;;;;;;;;;;;:37;;;1057:13;:25;1071:10;1057:25;;;;;;;;;;;;;;;:29;;1094:13;:25;1108:10;1094:25;;;;;;;;;;;;;;;:39;;;1141:10;966:186;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;884:273;;;;;:::o;238:20:1:-;;;;;;;;;;;;;:::o;1399:342:0:-;1468:8;1479:13;:25;1493:10;1479:25;;;;;;;;;;;;;;;1468:36;;1521:3;1510:4;:8;;:14;;;;;;;;;;;;:::i;:::-;;1552:1;1530:4;:18;;;:23;;;;;;;;;;;1575:13;:25;1589:10;1575:25;;;;;;;;;;;;;;;:30;;1559:4;:13;;:46;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1624:10;1611:4;:10;;;:23;;;;;;;;;;;;;;;;;;1665:1;1641:5;:22;;;;;;;;;;;:::i;:::-;;;;;;;;;;1652:10;1641:22;;;;;;;;;;;;;;;;;;;;;;:25;;1713:1;1672:13;:25;1686:10;1672:25;;;;;;;;;;;;;;;:37;;;:42;;;;;;;;;;;1720:16;1732:3;1720:16;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1399:342:0;;:::o;599:46::-;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;834:169:1:-;654:5;;;;;;;;;;;640:19;;:10;:19;;;632:28;;;;;;;;930:1;910:22;;:8;:22;;;;902:31;;;;;;;;967:8;939:37;;960:5;;;;;;;;;;;939:37;;;;;;;;;;;;990:8;982:5;;:16;;;;;;;;;;;;;;;;;;834:169;:::o;87:2336:0:-;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o", - "source": "pragma solidity ^0.4.18;\n\nimport 'zeppelin-solidity/contracts/ownership/Ownable.sol';\n\ncontract CapCoin is Ownable {\n\n event NewUser(string name);\n event BoughtTokens(uint coinBalance);\n event CreatedPost(string url);\n event LikedPost(int lotteryAmount, string posterName,\n address poster, uint posterCoinbalance, string likerName,\n address liker, uint likerCoinbalance);\n\n uint coinSupply = 1000000;\n uint coinsBought = 0;\n\n struct User {\n string name;\n uint coinBalance;\n }\n\n struct Post {\n string url;\n string userName;\n int lotteryAmount;\n address owner;\n }\n\n mapping (address => User) public addressToUser;\n mapping (address => Post) public addressToPost;\n address[] public posts;\n\n function createUser(string name) public {\n var user = addressToUser[msg.sender];\n user.name = name;\n user.coinBalance = 0;\n NewUser(name);\n }\n\n function getUser() public view returns (string, uint, string, int, address) {\n return (addressToUser[msg.sender].name,\n addressToUser[msg.sender].coinBalance,\n addressToPost[msg.sender].url,\n addressToPost[msg.sender].lotteryAmount,\n msg.sender);\n }\n\n // need to add economics\n function buyTokens(uint amount) public {\n addressToUser[msg.sender].coinBalance += amount;\n coinsBought += amount;\n coinSupply -= amount;\n BoughtTokens(addressToUser[msg.sender].coinBalance);\n }\n\n function createPost(string url) public {\n // 5 coins per post\n var post = addressToPost[msg.sender];\n post.url = url;\n post.lotteryAmount -= 5;\n post.userName = addressToUser[msg.sender].name;\n post.owner = msg.sender;\n\n posts.push(msg.sender) -1;\n addressToUser[msg.sender].coinBalance -= 5;\n CreatedPost(url);\n }\n\n function likePost(address post, uint amount) public {\n addressToPost[post].lotteryAmount += int(amount);\n addressToUser[post].coinBalance += amount;\n addressToUser[msg.sender].coinBalance -= amount;\n LikedPost(addressToPost[post].lotteryAmount,\n addressToUser[post].name, post, addressToUser[post].coinBalance,\n addressToUser[msg.sender].name, msg.sender, addressToUser[msg.sender].coinBalance);\n }\n\n function getPosts() public view returns (address[]) {\n return posts;\n }\n\n function seed(string name, string url, uint amount) public {\n createUser(name);\n buyTokens(amount);\n createPost(url);\n }\n\n function() internal payable {}\n}\n", + "bytecode": "0x6060604052620f42406001556000600255341561001b57600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555033600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061178c806100ab6000396000f3006060604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630b1e7f83146100c757806326ec928f1461012a5780633610724e146101d357806341c0e1b5146101eb57806341f3004a14610200578063483515291461026a578063507ffba5146102ac578063763f17c414610309578063832880e71461049b5780638da5cb5b146105d6578063c7303c611461062b578063edf5388614610688578063f2fde38b1461075e575b005b34156100d257600080fd5b6100e86004808035906020019091905050610797565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561013557600080fd5b6101d1600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919080359060200190919050506107d6565b005b6101e960048080359060200190919050506107f6565b005b34156101f657600080fd5b6101fe6108f2565b005b341561020b57600080fd5b610213610985565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561025657808201518184015260208101905061023b565b505050509050019250505060405180910390f35b341561027557600080fd5b6102aa600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a19565b005b34156102b757600080fd5b610307600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610e18565b005b341561031457600080fd5b610340600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f1e565b6040518080602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381038352878181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104055780601f106103da57610100808354040283529160200191610405565b820191906000526020600020905b8154815290600101906020018083116103e857829003601f168201915b50508381038252868181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104885780601f1061045d57610100808354040283529160200191610488565b820191906000526020600020905b81548152906001019060200180831161046b57829003601f168201915b5050965050505050505060405180910390f35b34156104a657600080fd5b6104ae610f6c565b6040518080602001868152602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838103835288818151815260200191508051906020019080838360005b83811015610530578082015181840152602081019050610515565b50505050905090810190601f16801561055d5780820380516001836020036101000a031916815260200191505b50838103825286818151815260200191508051906020019080838360005b8381101561059657808201518184015260208101905061057b565b50505050905090810190601f1680156105c35780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b34156105e157600080fd5b6105e96111d5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561063657600080fd5b610686600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506111fa565b005b341561069357600080fd5b6106bf600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611468565b604051808060200183815260200182810382528481815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561074e5780601f106107235761010080835404028352916020019161074e565b820191906000526020600020905b81548152906001019060200180831161073157829003601f168201915b5050935050505060405180910390f35b341561076957600080fd5b610795600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061148b565b005b6007818154811015156107a657fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6107df83610e18565b6107e8816107f6565b6107f1826111fa565b505050565b80600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825401925050819055508060026000828254019250508190555080600160008282540392505081905550346004600082825401925050819055507ffe1367e498701f2dfab80a3d41740d46fd7cba533430e611917f0f3df823279a600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546040518082815260200191505060405180910390a150565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561098357600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b565b61098d6115e0565b6007805480602002602001604051908101604052809291908181526020018280548015610a0f57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116109c5575b5050505050905090565b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002016000828254019250508190555080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000828254019250508190555080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507f050cbab7fede968f252efba864c75069d68302f756e7f9c0093fb37faf2ba79b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000184600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000133600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015460405180888152602001806020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001868152602001806020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001838103835289818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015610d7c5780601f10610d5157610100808354040283529160200191610d7c565b820191906000526020600020905b815481529060010190602001808311610d5f57829003601f168201915b5050838103825286818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015610dff5780601f10610dd457610100808354040283529160200191610dff565b820191906000526020600020905b815481529060010190602001808311610de257829003601f168201915b5050995050505050505050505060405180910390a15050565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905081816000019080519060200190610e739291906115f4565b50600081600101819055507f66ab3fea2083d9ba15d99b595186fe7fc18e6eba393c0fc056f420e96c3caa44826040518080602001828103825283818151815260200191508051906020019080838360005b83811015610ee0578082015181840152602081019050610ec5565b50505050905090810190601f168015610f0d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b6006602052806000526040600020600091509050806000019080600101908060020154908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905084565b610f74611674565b6000610f7e611674565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015433848054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111215780601f106110f657610100808354040283529160200191611121565b820191906000526020600020905b81548152906001019060200180831161110457829003601f168201915b50505050509450828054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111bd5780601f10611192576101008083540402835291602001916111bd565b820191906000526020600020905b8154815290600101906020018083116111a057829003601f168201915b50505050509250945094509450945094509091929394565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050818160000190805190602001906112559291906115f4565b5060058160020160008282540392505081905550600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018160010190805460018160011615610100020316600290046112ce929190611688565b50338160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160078054806001018281611328919061170f565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505060058060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507f3b6c110dfadc879ec2bbc1dc567f9065fd5ea5846bce75fddba0f60ffcc79fac826040518080602001828103825283818151815260200191508051906020019080838360005b8381101561142a57808201518184015260208101905061140f565b50505050905090810190601f1680156114575780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b600560205280600052604060002060009150905080600001908060010154905082565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114e657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561152257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061163557805160ff1916838001178555611663565b82800160010185558215611663579182015b82811115611662578251825591602001919060010190611647565b5b509050611670919061173b565b5090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106116c157805485556116fe565b828001600101855582156116fe57600052602060002091601f016020900482015b828111156116fd5782548255916001019190600101906116e2565b5b50905061170b919061173b565b5090565b81548183558181151161173657818360005260206000209182019101611735919061173b565b5b505050565b61175d91905b80821115611759576000816000905550600101611741565b5090565b905600a165627a7a723058209bf6da214a14801f0c8a1e8ec9edc4bda96578d11db1b161891a9a3594209bb60029", + "deployedBytecode": "0x6060604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630b1e7f83146100c757806326ec928f1461012a5780633610724e146101d357806341c0e1b5146101eb57806341f3004a14610200578063483515291461026a578063507ffba5146102ac578063763f17c414610309578063832880e71461049b5780638da5cb5b146105d6578063c7303c611461062b578063edf5388614610688578063f2fde38b1461075e575b005b34156100d257600080fd5b6100e86004808035906020019091905050610797565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561013557600080fd5b6101d1600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919080359060200190919050506107d6565b005b6101e960048080359060200190919050506107f6565b005b34156101f657600080fd5b6101fe6108f2565b005b341561020b57600080fd5b610213610985565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561025657808201518184015260208101905061023b565b505050509050019250505060405180910390f35b341561027557600080fd5b6102aa600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a19565b005b34156102b757600080fd5b610307600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610e18565b005b341561031457600080fd5b610340600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f1e565b6040518080602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381038352878181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104055780601f106103da57610100808354040283529160200191610405565b820191906000526020600020905b8154815290600101906020018083116103e857829003601f168201915b50508381038252868181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104885780601f1061045d57610100808354040283529160200191610488565b820191906000526020600020905b81548152906001019060200180831161046b57829003601f168201915b5050965050505050505060405180910390f35b34156104a657600080fd5b6104ae610f6c565b6040518080602001868152602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838103835288818151815260200191508051906020019080838360005b83811015610530578082015181840152602081019050610515565b50505050905090810190601f16801561055d5780820380516001836020036101000a031916815260200191505b50838103825286818151815260200191508051906020019080838360005b8381101561059657808201518184015260208101905061057b565b50505050905090810190601f1680156105c35780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b34156105e157600080fd5b6105e96111d5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561063657600080fd5b610686600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506111fa565b005b341561069357600080fd5b6106bf600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611468565b604051808060200183815260200182810382528481815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561074e5780601f106107235761010080835404028352916020019161074e565b820191906000526020600020905b81548152906001019060200180831161073157829003601f168201915b5050935050505060405180910390f35b341561076957600080fd5b610795600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061148b565b005b6007818154811015156107a657fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6107df83610e18565b6107e8816107f6565b6107f1826111fa565b505050565b80600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825401925050819055508060026000828254019250508190555080600160008282540392505081905550346004600082825401925050819055507ffe1367e498701f2dfab80a3d41740d46fd7cba533430e611917f0f3df823279a600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546040518082815260200191505060405180910390a150565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561098357600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b565b61098d6115e0565b6007805480602002602001604051908101604052809291908181526020018280548015610a0f57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116109c5575b5050505050905090565b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002016000828254019250508190555080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000828254019250508190555080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507f050cbab7fede968f252efba864c75069d68302f756e7f9c0093fb37faf2ba79b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000184600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000133600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015460405180888152602001806020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001868152602001806020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001838103835289818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015610d7c5780601f10610d5157610100808354040283529160200191610d7c565b820191906000526020600020905b815481529060010190602001808311610d5f57829003601f168201915b5050838103825286818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015610dff5780601f10610dd457610100808354040283529160200191610dff565b820191906000526020600020905b815481529060010190602001808311610de257829003601f168201915b5050995050505050505050505060405180910390a15050565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905081816000019080519060200190610e739291906115f4565b50600081600101819055507f66ab3fea2083d9ba15d99b595186fe7fc18e6eba393c0fc056f420e96c3caa44826040518080602001828103825283818151815260200191508051906020019080838360005b83811015610ee0578082015181840152602081019050610ec5565b50505050905090810190601f168015610f0d5780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b6006602052806000526040600020600091509050806000019080600101908060020154908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905084565b610f74611674565b6000610f7e611674565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015433848054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111215780601f106110f657610100808354040283529160200191611121565b820191906000526020600020905b81548152906001019060200180831161110457829003601f168201915b50505050509450828054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111bd5780601f10611192576101008083540402835291602001916111bd565b820191906000526020600020905b8154815290600101906020018083116111a057829003601f168201915b50505050509250945094509450945094509091929394565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050818160000190805190602001906112559291906115f4565b5060058160020160008282540392505081905550600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018160010190805460018160011615610100020316600290046112ce929190611688565b50338160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160078054806001018281611328919061170f565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505060058060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507f3b6c110dfadc879ec2bbc1dc567f9065fd5ea5846bce75fddba0f60ffcc79fac826040518080602001828103825283818151815260200191508051906020019080838360005b8381101561142a57808201518184015260208101905061140f565b50505050905090810190601f1680156114575780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b600560205280600052604060002060009150905080600001908060010154905082565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114e657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561152257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061163557805160ff1916838001178555611663565b82800160010185558215611663579182015b82811115611662578251825591602001919060010190611647565b5b509050611670919061173b565b5090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106116c157805485556116fe565b828001600101855582156116fe57600052602060002091601f016020900482015b828111156116fd5782548255916001019190600101906116e2565b5b50905061170b919061173b565b5090565b81548183558181151161173657818360005260206000209182019101611735919061173b565b5b505050565b61175d91905b80821115611759576000816000905550600101611741565b5090565b905600a165627a7a723058209bf6da214a14801f0c8a1e8ec9edc4bda96578d11db1b161891a9a3594209bb60029", + "sourceMap": "87:2542:0:-;;;403:7;385:25;;433:1;414:20;;470:49;;;;;;;;509:10:1;501:5;;:18;;;;;;;;;;;;;;;;;;504:10:0;496:5;;:18;;;;;;;;;;;;;;;;;;87:2542;;;;;;", + "deployedSourceMap": "87:2542:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;783:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2367:136;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1272:239;;;;;;;;;;;;;;;;;;2509:93;;;;;;;;;;;;;;2286:77;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;1861:421:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;810:154;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;733:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;968:273;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;238:20:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1515:342:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;683:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;834:169:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;783:22:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;2367:136::-;2434:16;2445:4;2434:10;:16::i;:::-;2458:17;2468:6;2458:9;:17::i;:::-;2483:15;2494:3;2483:10;:15::i;:::-;2367:136;;;:::o;1272:239::-;1366:6;1325:13;:25;1339:10;1325:25;;;;;;;;;;;;;;;:37;;;:47;;;;;;;;;;;1393:6;1378:11;;:21;;;;;;;;;;;1419:6;1405:10;;:20;;;;;;;;;;;1440:9;1431:5;;:18;;;;;;;;;;;1455:51;1468:13;:25;1482:10;1468:25;;;;;;;;;;;;;;;:37;;;1455:51;;;;;;;;;;;;;;;;;;1272:239;:::o;2509:93::-;2551:5;;;;;;;;;;;2537:19;;:10;:19;;;2533:63;;;2581:5;;;;;;;;;;;2568:19;;;2533:63;2509:93::o;2286:77::-;2327:9;;:::i;:::-;2353:5;2346:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2286:77;:::o;1861:421::-;1960:6;1919:13;:19;1933:4;1919:19;;;;;;;;;;;;;;;:33;;;:48;;;;;;;;;;;2008:6;1973:13;:19;1987:4;1973:19;;;;;;;;;;;;;;;:31;;;:41;;;;;;;;;;;2061:6;2020:13;:25;2034:10;2020:25;;;;;;;;;;;;;;;:37;;;:47;;;;;;;;;;;2073:204;2083:13;:19;2097:4;2083:19;;;;;;;;;;;;;;;:33;;;2124:13;:19;2138:4;2124:19;;;;;;;;;;;;;;;:24;;2150:4;2156:13;:19;2170:4;2156:19;;;;;;;;;;;;;;;:31;;;2195:13;:25;2209:10;2195:25;;;;;;;;;;;;;;;:30;;2227:10;2239:13;:25;2253:10;2239:25;;;;;;;;;;;;;;;:37;;;2073:204;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1861:421;;:::o;810:154::-;856:8;867:13;:25;881:10;867:25;;;;;;;;;;;;;;;856:36;;910:4;898;:9;;:16;;;;;;;;;;;;:::i;:::-;;939:1;920:4;:16;;:20;;;;946:13;954:4;946:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;810:154:0;;:::o;733:46::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;968:273::-;1008:6;;:::i;:::-;1016:4;1022:6;;:::i;:::-;1030:3;1035:7;1058:13;:25;1072:10;1058:25;;;;;;;;;;;;;;;:30;;1096:13;:25;1110:10;1096:25;;;;;;;;;;;;;;;:37;;;1141:13;:25;1155:10;1141:25;;;;;;;;;;;;;;;:29;;1178:13;:25;1192:10;1178:25;;;;;;;;;;;;;;;:39;;;1225:10;1050:186;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;968:273;;;;;:::o;238:20:1:-;;;;;;;;;;;;;:::o;1515:342:0:-;1584:8;1595:13;:25;1609:10;1595:25;;;;;;;;;;;;;;;1584:36;;1637:3;1626:4;:8;;:14;;;;;;;;;;;;:::i;:::-;;1668:1;1646:4;:18;;;:23;;;;;;;;;;;1691:13;:25;1705:10;1691:25;;;;;;;;;;;;;;;:30;;1675:4;:13;;:46;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1740:10;1727:4;:10;;;:23;;;;;;;;;;;;;;;;;;1781:1;1757:5;:22;;;;;;;;;;;:::i;:::-;;;;;;;;;;1768:10;1757:22;;;;;;;;;;;;;;;;;;;;;;:25;;1829:1;1788:13;:25;1802:10;1788:25;;;;;;;;;;;;;;;:37;;;:42;;;;;;;;;;;1836:16;1848:3;1836:16;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1515:342:0;;:::o;683:46::-;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;834:169:1:-;654:5;;;;;;;;;;;640:19;;:10;:19;;;632:28;;;;;;;;930:1;910:22;;:8;:22;;;;902:31;;;;;;;;967:8;939:37;;960:5;;;;;;;;;;;939:37;;;;;;;;;;;;990:8;982:5;;:16;;;;;;;;;;;;;;;;;;834:169;:::o;87:2542:0:-;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o", + "source": "pragma solidity ^0.4.18;\n\nimport 'zeppelin-solidity/contracts/ownership/Ownable.sol';\n\ncontract CapCoin is Ownable {\n\n event NewUser(string name);\n event BoughtTokens(uint coinBalance);\n event CreatedPost(string url);\n event LikedPost(int lotteryAmount, string posterName,\n address poster, uint posterCoinbalance, string likerName,\n address liker, uint likerCoinbalance);\n\n uint coinSupply = 1000000;\n uint coinsBought = 0;\n address owner;\n uint value;\n\n function CapCoin () {\n owner = msg.sender;\n }\n\n struct User {\n string name;\n uint coinBalance;\n }\n\n struct Post {\n string url;\n string userName;\n int lotteryAmount;\n address owner;\n }\n\n mapping (address => User) public addressToUser;\n mapping (address => Post) public addressToPost;\n address[] public posts;\n\n function createUser(string name) public {\n var user = addressToUser[msg.sender];\n user.name = name;\n user.coinBalance = 0;\n NewUser(name);\n }\n\n function getUser() public view returns (string, uint, string, int, address) {\n return (addressToUser[msg.sender].name,\n addressToUser[msg.sender].coinBalance,\n addressToPost[msg.sender].url,\n addressToPost[msg.sender].lotteryAmount,\n msg.sender);\n }\n\n // need to add economics\n function buyTokens(uint amount) payable public {\n addressToUser[msg.sender].coinBalance += amount;\n coinsBought += amount;\n coinSupply -= amount;\n value += msg.value;\n BoughtTokens(addressToUser[msg.sender].coinBalance);\n }\n\n function createPost(string url) public {\n // 5 coins per post\n var post = addressToPost[msg.sender];\n post.url = url;\n post.lotteryAmount -= 5;\n post.userName = addressToUser[msg.sender].name;\n post.owner = msg.sender;\n\n posts.push(msg.sender) -1;\n addressToUser[msg.sender].coinBalance -= 5;\n CreatedPost(url);\n }\n\n function likePost(address post, uint amount) public {\n addressToPost[post].lotteryAmount += int(amount);\n addressToUser[post].coinBalance += amount;\n addressToUser[msg.sender].coinBalance -= amount;\n LikedPost(addressToPost[post].lotteryAmount,\n addressToUser[post].name, post, addressToUser[post].coinBalance,\n addressToUser[msg.sender].name, msg.sender, addressToUser[msg.sender].coinBalance);\n }\n\n function getPosts() public view returns (address[]) {\n return posts;\n }\n\n function seed(string name, string url, uint amount) public {\n createUser(name);\n buyTokens(amount);\n createPost(url);\n }\n\n function kill() {\n if (msg.sender == owner) {\n selfdestruct(owner);\n }\n }\n\n function() payable {}\n}\n", "sourcePath": "/Users/schwartzz8990/Dropbox/fullstack/capCoin/contracts/CapCoin.sol", "ast": { "attributes": { "absolutePath": "/Users/schwartzz8990/Dropbox/fullstack/capCoin/contracts/CapCoin.sol", "exportedSymbols": { "CapCoin": [ - 317 + 349 ] } }, @@ -360,10 +375,10 @@ }, { "attributes": { - "SourceUnit": 374, + "SourceUnit": 406, "absolutePath": "zeppelin-solidity/contracts/ownership/Ownable.sol", "file": "zeppelin-solidity/contracts/ownership/Ownable.sol", - "scope": 318, + "scope": 350, "symbolAliases": [ null ], @@ -376,17 +391,17 @@ { "attributes": { "contractDependencies": [ - 373 + 405 ], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "linearizedBaseContracts": [ - 317, - 373 + 349, + 405 ], "name": "CapCoin", - "scope": 318 + "scope": 350 }, "children": [ { @@ -400,7 +415,7 @@ "attributes": { "contractScope": null, "name": "Ownable", - "referencedDeclaration": 373, + "referencedDeclaration": 405, "type": "contract Ownable" }, "id": 3, @@ -758,7 +773,7 @@ "attributes": { "constant": false, "name": "coinSupply", - "scope": 317, + "scope": 349, "stateVariable": true, "storageLocation": "default", "type": "uint256", @@ -800,7 +815,7 @@ "attributes": { "constant": false, "name": "coinsBought", - "scope": 317, + "scope": 349, "stateVariable": true, "storageLocation": "default", "type": "uint256", @@ -838,11 +853,181 @@ "name": "VariableDeclaration", "src": "414:20:0" }, + { + "attributes": { + "constant": false, + "name": "owner", + "scope": 349, + "stateVariable": true, + "storageLocation": "default", + "type": "address", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "address", + "type": "address" + }, + "id": 39, + "name": "ElementaryTypeName", + "src": "438:7:0" + } + ], + "id": 40, + "name": "VariableDeclaration", + "src": "438:13:0" + }, + { + "attributes": { + "constant": false, + "name": "value", + "scope": 349, + "stateVariable": true, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 41, + "name": "ElementaryTypeName", + "src": "455:4:0" + } + ], + "id": 42, + "name": "VariableDeclaration", + "src": "455:10:0" + }, + { + "attributes": { + "constant": false, + "implemented": true, + "isConstructor": true, + "modifiers": [ + null + ], + "name": "CapCoin", + "payable": false, + "scope": 349, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": [ + { + "attributes": { + "parameters": [ + null + ] + }, + "children": [], + "id": 43, + "name": "ParameterList", + "src": "487:2:0" + }, + { + "attributes": { + "parameters": [ + null + ] + }, + "children": [], + "id": 44, + "name": "ParameterList", + "src": "490:0:0" + }, + { + "children": [ + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "=", + "type": "address" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 40, + "type": "address", + "value": "owner" + }, + "id": 45, + "name": "Identifier", + "src": "496:5:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "sender", + "referencedDeclaration": null, + "type": "address" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 417, + "type": "msg", + "value": "msg" + }, + "id": 46, + "name": "Identifier", + "src": "504:3:0" + } + ], + "id": 47, + "name": "MemberAccess", + "src": "504:10:0" + } + ], + "id": 48, + "name": "Assignment", + "src": "496:18:0" + } + ], + "id": 49, + "name": "ExpressionStatement", + "src": "496:18:0" + } + ], + "id": 50, + "name": "Block", + "src": "490:29:0" + } + ], + "id": 51, + "name": "FunctionDefinition", + "src": "470:49:0" + }, { "attributes": { "canonicalName": "CapCoin.User", "name": "User", - "scope": 317, + "scope": 349, "visibility": "public" }, "children": [ @@ -850,7 +1035,7 @@ "attributes": { "constant": false, "name": "name", - "scope": 43, + "scope": 56, "stateVariable": false, "storageLocation": "default", "type": "string storage pointer", @@ -863,20 +1048,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 39, + "id": 52, "name": "ElementaryTypeName", - "src": "457:6:0" + "src": "541:6:0" } ], - "id": 40, + "id": 53, "name": "VariableDeclaration", - "src": "457:11:0" + "src": "541:11:0" }, { "attributes": { "constant": false, "name": "coinBalance", - "scope": 43, + "scope": 56, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -889,25 +1074,25 @@ "name": "uint", "type": "uint256" }, - "id": 41, + "id": 54, "name": "ElementaryTypeName", - "src": "474:4:0" + "src": "558:4:0" } ], - "id": 42, + "id": 55, "name": "VariableDeclaration", - "src": "474:16:0" + "src": "558:16:0" } ], - "id": 43, + "id": 56, "name": "StructDefinition", - "src": "439:56:0" + "src": "523:56:0" }, { "attributes": { "canonicalName": "CapCoin.Post", "name": "Post", - "scope": 317, + "scope": 349, "visibility": "public" }, "children": [ @@ -915,7 +1100,7 @@ "attributes": { "constant": false, "name": "url", - "scope": 52, + "scope": 65, "stateVariable": false, "storageLocation": "default", "type": "string storage pointer", @@ -928,20 +1113,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 44, + "id": 57, "name": "ElementaryTypeName", - "src": "517:6:0" + "src": "601:6:0" } ], - "id": 45, + "id": 58, "name": "VariableDeclaration", - "src": "517:10:0" + "src": "601:10:0" }, { "attributes": { "constant": false, "name": "userName", - "scope": 52, + "scope": 65, "stateVariable": false, "storageLocation": "default", "type": "string storage pointer", @@ -954,20 +1139,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 46, + "id": 59, "name": "ElementaryTypeName", - "src": "533:6:0" + "src": "617:6:0" } ], - "id": 47, + "id": 60, "name": "VariableDeclaration", - "src": "533:15:0" + "src": "617:15:0" }, { "attributes": { "constant": false, "name": "lotteryAmount", - "scope": 52, + "scope": 65, "stateVariable": false, "storageLocation": "default", "type": "int256", @@ -980,20 +1165,20 @@ "name": "int", "type": "int256" }, - "id": 48, + "id": 61, "name": "ElementaryTypeName", - "src": "554:3:0" + "src": "638:3:0" } ], - "id": 49, + "id": 62, "name": "VariableDeclaration", - "src": "554:17:0" + "src": "638:17:0" }, { "attributes": { "constant": false, "name": "owner", - "scope": 52, + "scope": 65, "stateVariable": false, "storageLocation": "default", "type": "address", @@ -1006,25 +1191,25 @@ "name": "address", "type": "address" }, - "id": 50, + "id": 63, "name": "ElementaryTypeName", - "src": "577:7:0" + "src": "661:7:0" } ], - "id": 51, + "id": 64, "name": "VariableDeclaration", - "src": "577:13:0" + "src": "661:13:0" } ], - "id": 52, + "id": 65, "name": "StructDefinition", - "src": "499:96:0" + "src": "583:96:0" }, { "attributes": { "constant": false, "name": "addressToUser", - "scope": 317, + "scope": 349, "stateVariable": true, "storageLocation": "default", "type": "mapping(address => struct CapCoin.User storage ref)", @@ -1042,36 +1227,36 @@ "name": "address", "type": "address" }, - "id": 53, + "id": 66, "name": "ElementaryTypeName", - "src": "608:7:0" + "src": "692:7:0" }, { "attributes": { "contractScope": null, "name": "User", - "referencedDeclaration": 43, + "referencedDeclaration": 56, "type": "struct CapCoin.User storage pointer" }, - "id": 54, + "id": 67, "name": "UserDefinedTypeName", - "src": "619:4:0" + "src": "703:4:0" } ], - "id": 55, + "id": 68, "name": "Mapping", - "src": "599:25:0" + "src": "683:25:0" } ], - "id": 56, + "id": 69, "name": "VariableDeclaration", - "src": "599:46:0" + "src": "683:46:0" }, { "attributes": { "constant": false, "name": "addressToPost", - "scope": 317, + "scope": 349, "stateVariable": true, "storageLocation": "default", "type": "mapping(address => struct CapCoin.Post storage ref)", @@ -1089,36 +1274,36 @@ "name": "address", "type": "address" }, - "id": 57, + "id": 70, "name": "ElementaryTypeName", - "src": "658:7:0" + "src": "742:7:0" }, { "attributes": { "contractScope": null, "name": "Post", - "referencedDeclaration": 52, + "referencedDeclaration": 65, "type": "struct CapCoin.Post storage pointer" }, - "id": 58, + "id": 71, "name": "UserDefinedTypeName", - "src": "669:4:0" + "src": "753:4:0" } ], - "id": 59, + "id": 72, "name": "Mapping", - "src": "649:25:0" + "src": "733:25:0" } ], - "id": 60, + "id": 73, "name": "VariableDeclaration", - "src": "649:46:0" + "src": "733:46:0" }, { "attributes": { "constant": false, "name": "posts", - "scope": 317, + "scope": 349, "stateVariable": true, "storageLocation": "default", "type": "address[] storage ref", @@ -1137,19 +1322,19 @@ "name": "address", "type": "address" }, - "id": 61, + "id": 74, "name": "ElementaryTypeName", - "src": "699:7:0" + "src": "783:7:0" } ], - "id": 62, + "id": 75, "name": "ArrayTypeName", - "src": "699:9:0" + "src": "783:9:0" } ], - "id": 63, + "id": 76, "name": "VariableDeclaration", - "src": "699:22:0" + "src": "783:22:0" }, { "attributes": { @@ -1161,7 +1346,7 @@ ], "name": "createUser", "payable": false, - "scope": 317, + "scope": 349, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -1173,7 +1358,7 @@ "attributes": { "constant": false, "name": "name", - "scope": 91, + "scope": 104, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -1186,19 +1371,19 @@ "name": "string", "type": "string storage pointer" }, - "id": 64, + "id": 77, "name": "ElementaryTypeName", - "src": "746:6:0" + "src": "830:6:0" } ], - "id": 65, + "id": 78, "name": "VariableDeclaration", - "src": "746:11:0" + "src": "830:11:0" } ], - "id": 66, + "id": 79, "name": "ParameterList", - "src": "745:13:0" + "src": "829:13:0" }, { "attributes": { @@ -1207,16 +1392,16 @@ ] }, "children": [], - "id": 67, + "id": 80, "name": "ParameterList", - "src": "766:0:0" + "src": "850:0:0" }, { "children": [ { "attributes": { "assignments": [ - 68 + 81 ] }, "children": [ @@ -1224,7 +1409,7 @@ "attributes": { "constant": false, "name": "user", - "scope": 91, + "scope": 104, "stateVariable": false, "storageLocation": "default", "type": "struct CapCoin.User storage pointer", @@ -1233,9 +1418,9 @@ "visibility": "internal" }, "children": [], - "id": 68, + "id": 81, "name": "VariableDeclaration", - "src": "772:8:0" + "src": "856:8:0" }, { "attributes": { @@ -1253,13 +1438,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 56, + "referencedDeclaration": 69, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 69, + "id": 82, "name": "Identifier", - "src": "783:13:0" + "src": "867:13:0" }, { "attributes": { @@ -1279,28 +1464,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 385, + "referencedDeclaration": 417, "type": "msg", "value": "msg" }, - "id": 70, + "id": 83, "name": "Identifier", - "src": "797:3:0" + "src": "881:3:0" } ], - "id": 71, + "id": 84, "name": "MemberAccess", - "src": "797:10:0" + "src": "881:10:0" } ], - "id": 72, + "id": 85, "name": "IndexAccess", - "src": "783:25:0" + "src": "867:25:0" } ], - "id": 73, + "id": 86, "name": "VariableDeclarationStatement", - "src": "772:36:0" + "src": "856:36:0" }, { "children": [ @@ -1323,7 +1508,7 @@ "isPure": false, "lValueRequested": true, "member_name": "name", - "referencedDeclaration": 40, + "referencedDeclaration": 53, "type": "string storage ref" }, "children": [ @@ -1333,18 +1518,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 68, + "referencedDeclaration": 81, "type": "struct CapCoin.User storage pointer", "value": "user" }, - "id": 74, + "id": 87, "name": "Identifier", - "src": "814:4:0" + "src": "898:4:0" } ], - "id": 76, + "id": 89, "name": "MemberAccess", - "src": "814:9:0" + "src": "898:9:0" }, { "attributes": { @@ -1352,23 +1537,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 65, + "referencedDeclaration": 78, "type": "string memory", "value": "name" }, - "id": 77, + "id": 90, "name": "Identifier", - "src": "826:4:0" + "src": "910:4:0" } ], - "id": 78, + "id": 91, "name": "Assignment", - "src": "814:16:0" + "src": "898:16:0" } ], - "id": 79, + "id": 92, "name": "ExpressionStatement", - "src": "814:16:0" + "src": "898:16:0" }, { "children": [ @@ -1391,7 +1576,7 @@ "isPure": false, "lValueRequested": true, "member_name": "coinBalance", - "referencedDeclaration": 42, + "referencedDeclaration": 55, "type": "uint256" }, "children": [ @@ -1401,18 +1586,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 68, + "referencedDeclaration": 81, "type": "struct CapCoin.User storage pointer", "value": "user" }, - "id": 80, + "id": 93, "name": "Identifier", - "src": "836:4:0" + "src": "920:4:0" } ], - "id": 82, + "id": 95, "name": "MemberAccess", - "src": "836:16:0" + "src": "920:16:0" }, { "attributes": { @@ -1427,19 +1612,19 @@ "type": "int_const 0", "value": "0" }, - "id": 83, + "id": 96, "name": "Literal", - "src": "855:1:0" + "src": "939:1:0" } ], - "id": 84, + "id": 97, "name": "Assignment", - "src": "836:20:0" + "src": "920:20:0" } ], - "id": 85, + "id": 98, "name": "ExpressionStatement", - "src": "836:20:0" + "src": "920:20:0" }, { "children": [ @@ -1473,9 +1658,9 @@ "type": "function (string memory)", "value": "NewUser" }, - "id": 86, + "id": 99, "name": "Identifier", - "src": "862:7:0" + "src": "946:7:0" }, { "attributes": { @@ -1483,33 +1668,33 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 65, + "referencedDeclaration": 78, "type": "string memory", "value": "name" }, - "id": 87, + "id": 100, "name": "Identifier", - "src": "870:4:0" + "src": "954:4:0" } ], - "id": 88, + "id": 101, "name": "FunctionCall", - "src": "862:13:0" + "src": "946:13:0" } ], - "id": 89, + "id": 102, "name": "ExpressionStatement", - "src": "862:13:0" + "src": "946:13:0" } ], - "id": 90, + "id": 103, "name": "Block", - "src": "766:114:0" + "src": "850:114:0" } ], - "id": 91, + "id": 104, "name": "FunctionDefinition", - "src": "726:154:0" + "src": "810:154:0" }, { "attributes": { @@ -1521,7 +1706,7 @@ ], "name": "getUser", "payable": false, - "scope": 317, + "scope": 349, "stateMutability": "view", "superFunction": null, "visibility": "public" @@ -1534,9 +1719,9 @@ ] }, "children": [], - "id": 92, + "id": 105, "name": "ParameterList", - "src": "900:2:0" + "src": "984:2:0" }, { "children": [ @@ -1544,7 +1729,7 @@ "attributes": { "constant": false, "name": "", - "scope": 129, + "scope": 142, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -1557,20 +1742,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 93, + "id": 106, "name": "ElementaryTypeName", - "src": "924:6:0" + "src": "1008:6:0" } ], - "id": 94, + "id": 107, "name": "VariableDeclaration", - "src": "924:6:0" + "src": "1008:6:0" }, { "attributes": { "constant": false, "name": "", - "scope": 129, + "scope": 142, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -1583,20 +1768,20 @@ "name": "uint", "type": "uint256" }, - "id": 95, + "id": 108, "name": "ElementaryTypeName", - "src": "932:4:0" + "src": "1016:4:0" } ], - "id": 96, + "id": 109, "name": "VariableDeclaration", - "src": "932:4:0" + "src": "1016:4:0" }, { "attributes": { "constant": false, "name": "", - "scope": 129, + "scope": 142, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -1609,20 +1794,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 97, + "id": 110, "name": "ElementaryTypeName", - "src": "938:6:0" + "src": "1022:6:0" } ], - "id": 98, + "id": 111, "name": "VariableDeclaration", - "src": "938:6:0" + "src": "1022:6:0" }, { "attributes": { "constant": false, "name": "", - "scope": 129, + "scope": 142, "stateVariable": false, "storageLocation": "default", "type": "int256", @@ -1635,20 +1820,20 @@ "name": "int", "type": "int256" }, - "id": 99, + "id": 112, "name": "ElementaryTypeName", - "src": "946:3:0" + "src": "1030:3:0" } ], - "id": 100, + "id": 113, "name": "VariableDeclaration", - "src": "946:3:0" + "src": "1030:3:0" }, { "attributes": { "constant": false, "name": "", - "scope": 129, + "scope": 142, "stateVariable": false, "storageLocation": "default", "type": "address", @@ -1661,25 +1846,25 @@ "name": "address", "type": "address" }, - "id": 101, + "id": 114, "name": "ElementaryTypeName", - "src": "951:7:0" + "src": "1035:7:0" } ], - "id": 102, + "id": 115, "name": "VariableDeclaration", - "src": "951:7:0" + "src": "1035:7:0" } ], - "id": 103, + "id": 116, "name": "ParameterList", - "src": "923:36:0" + "src": "1007:36:0" }, { "children": [ { "attributes": { - "functionReturnParameters": 103 + "functionReturnParameters": 116 }, "children": [ { @@ -1701,7 +1886,7 @@ "isPure": false, "lValueRequested": false, "member_name": "name", - "referencedDeclaration": 40, + "referencedDeclaration": 53, "type": "string storage ref" }, "children": [ @@ -1721,13 +1906,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 56, + "referencedDeclaration": 69, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 104, + "id": 117, "name": "Identifier", - "src": "974:13:0" + "src": "1058:13:0" }, { "attributes": { @@ -1747,28 +1932,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 385, + "referencedDeclaration": 417, "type": "msg", "value": "msg" }, - "id": 105, + "id": 118, "name": "Identifier", - "src": "988:3:0" + "src": "1072:3:0" } ], - "id": 106, + "id": 119, "name": "MemberAccess", - "src": "988:10:0" + "src": "1072:10:0" } ], - "id": 107, + "id": 120, "name": "IndexAccess", - "src": "974:25:0" + "src": "1058:25:0" } ], - "id": 108, + "id": 121, "name": "MemberAccess", - "src": "974:30:0" + "src": "1058:30:0" }, { "attributes": { @@ -1778,7 +1963,7 @@ "isPure": false, "lValueRequested": false, "member_name": "coinBalance", - "referencedDeclaration": 42, + "referencedDeclaration": 55, "type": "uint256" }, "children": [ @@ -1798,13 +1983,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 56, + "referencedDeclaration": 69, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 109, + "id": 122, "name": "Identifier", - "src": "1012:13:0" + "src": "1096:13:0" }, { "attributes": { @@ -1824,28 +2009,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 385, + "referencedDeclaration": 417, "type": "msg", "value": "msg" }, - "id": 110, + "id": 123, "name": "Identifier", - "src": "1026:3:0" + "src": "1110:3:0" } ], - "id": 111, + "id": 124, "name": "MemberAccess", - "src": "1026:10:0" + "src": "1110:10:0" } ], - "id": 112, + "id": 125, "name": "IndexAccess", - "src": "1012:25:0" + "src": "1096:25:0" } ], - "id": 113, + "id": 126, "name": "MemberAccess", - "src": "1012:37:0" + "src": "1096:37:0" }, { "attributes": { @@ -1855,7 +2040,7 @@ "isPure": false, "lValueRequested": false, "member_name": "url", - "referencedDeclaration": 45, + "referencedDeclaration": 58, "type": "string storage ref" }, "children": [ @@ -1875,13 +2060,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 60, + "referencedDeclaration": 73, "type": "mapping(address => struct CapCoin.Post storage ref)", "value": "addressToPost" }, - "id": 114, + "id": 127, "name": "Identifier", - "src": "1057:13:0" + "src": "1141:13:0" }, { "attributes": { @@ -1901,28 +2086,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 385, + "referencedDeclaration": 417, "type": "msg", "value": "msg" }, - "id": 115, + "id": 128, "name": "Identifier", - "src": "1071:3:0" + "src": "1155:3:0" } ], - "id": 116, + "id": 129, "name": "MemberAccess", - "src": "1071:10:0" + "src": "1155:10:0" } ], - "id": 117, + "id": 130, "name": "IndexAccess", - "src": "1057:25:0" + "src": "1141:25:0" } ], - "id": 118, + "id": 131, "name": "MemberAccess", - "src": "1057:29:0" + "src": "1141:29:0" }, { "attributes": { @@ -1932,7 +2117,7 @@ "isPure": false, "lValueRequested": false, "member_name": "lotteryAmount", - "referencedDeclaration": 49, + "referencedDeclaration": 62, "type": "int256" }, "children": [ @@ -1952,13 +2137,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 60, + "referencedDeclaration": 73, "type": "mapping(address => struct CapCoin.Post storage ref)", "value": "addressToPost" }, - "id": 119, + "id": 132, "name": "Identifier", - "src": "1094:13:0" + "src": "1178:13:0" }, { "attributes": { @@ -1978,28 +2163,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 385, + "referencedDeclaration": 417, "type": "msg", "value": "msg" }, - "id": 120, + "id": 133, "name": "Identifier", - "src": "1108:3:0" + "src": "1192:3:0" } ], - "id": 121, + "id": 134, "name": "MemberAccess", - "src": "1108:10:0" + "src": "1192:10:0" } ], - "id": 122, + "id": 135, "name": "IndexAccess", - "src": "1094:25:0" + "src": "1178:25:0" } ], - "id": 123, + "id": 136, "name": "MemberAccess", - "src": "1094:39:0" + "src": "1178:39:0" }, { "attributes": { @@ -2019,38 +2204,38 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 385, + "referencedDeclaration": 417, "type": "msg", "value": "msg" }, - "id": 124, + "id": 137, "name": "Identifier", - "src": "1141:3:0" + "src": "1225:3:0" } ], - "id": 125, + "id": 138, "name": "MemberAccess", - "src": "1141:10:0" + "src": "1225:10:0" } ], - "id": 126, + "id": 139, "name": "TupleExpression", - "src": "973:179:0" + "src": "1057:179:0" } ], - "id": 127, + "id": 140, "name": "Return", - "src": "966:186:0" + "src": "1050:186:0" } ], - "id": 128, + "id": 141, "name": "Block", - "src": "960:197:0" + "src": "1044:197:0" } ], - "id": 129, + "id": 142, "name": "FunctionDefinition", - "src": "884:273:0" + "src": "968:273:0" }, { "attributes": { @@ -2061,9 +2246,9 @@ null ], "name": "buyTokens", - "payable": false, - "scope": 317, - "stateMutability": "nonpayable", + "payable": true, + "scope": 349, + "stateMutability": "payable", "superFunction": null, "visibility": "public" }, @@ -2074,7 +2259,7 @@ "attributes": { "constant": false, "name": "amount", - "scope": 159, + "scope": 177, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -2087,19 +2272,19 @@ "name": "uint", "type": "uint256" }, - "id": 130, + "id": 143, "name": "ElementaryTypeName", - "src": "1207:4:0" + "src": "1291:4:0" } ], - "id": 131, + "id": 144, "name": "VariableDeclaration", - "src": "1207:11:0" + "src": "1291:11:0" } ], - "id": 132, + "id": 145, "name": "ParameterList", - "src": "1206:13:0" + "src": "1290:13:0" }, { "attributes": { @@ -2108,9 +2293,9 @@ ] }, "children": [], - "id": 133, + "id": 146, "name": "ParameterList", - "src": "1227:0:0" + "src": "1319:0:0" }, { "children": [ @@ -2135,7 +2320,7 @@ "isPure": false, "lValueRequested": true, "member_name": "coinBalance", - "referencedDeclaration": 42, + "referencedDeclaration": 55, "type": "uint256" }, "children": [ @@ -2155,13 +2340,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 56, + "referencedDeclaration": 69, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 134, + "id": 147, "name": "Identifier", - "src": "1233:13:0" + "src": "1325:13:0" }, { "attributes": { @@ -2181,28 +2366,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 385, + "referencedDeclaration": 417, "type": "msg", "value": "msg" }, - "id": 135, + "id": 148, "name": "Identifier", - "src": "1247:3:0" + "src": "1339:3:0" } ], - "id": 136, + "id": 149, "name": "MemberAccess", - "src": "1247:10:0" + "src": "1339:10:0" } ], - "id": 137, + "id": 150, "name": "IndexAccess", - "src": "1233:25:0" + "src": "1325:25:0" } ], - "id": 138, + "id": 151, "name": "MemberAccess", - "src": "1233:37:0" + "src": "1325:37:0" }, { "attributes": { @@ -2210,23 +2395,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 131, + "referencedDeclaration": 144, "type": "uint256", "value": "amount" }, - "id": 139, + "id": 152, "name": "Identifier", - "src": "1274:6:0" + "src": "1366:6:0" } ], - "id": 140, + "id": 153, "name": "Assignment", - "src": "1233:47:0" + "src": "1325:47:0" } ], - "id": 141, + "id": 154, "name": "ExpressionStatement", - "src": "1233:47:0" + "src": "1325:47:0" }, { "children": [ @@ -2251,9 +2436,9 @@ "type": "uint256", "value": "coinsBought" }, - "id": 142, + "id": 155, "name": "Identifier", - "src": "1286:11:0" + "src": "1378:11:0" }, { "attributes": { @@ -2261,23 +2446,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 131, + "referencedDeclaration": 144, "type": "uint256", "value": "amount" }, - "id": 143, + "id": 156, "name": "Identifier", - "src": "1301:6:0" + "src": "1393:6:0" } ], - "id": 144, + "id": 157, "name": "Assignment", - "src": "1286:21:0" + "src": "1378:21:0" } ], - "id": 145, + "id": 158, "name": "ExpressionStatement", - "src": "1286:21:0" + "src": "1378:21:0" }, { "children": [ @@ -2302,9 +2487,9 @@ "type": "uint256", "value": "coinSupply" }, - "id": 146, + "id": 159, "name": "Identifier", - "src": "1313:10:0" + "src": "1405:10:0" }, { "attributes": { @@ -2312,23 +2497,91 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 131, + "referencedDeclaration": 144, "type": "uint256", "value": "amount" }, - "id": 147, + "id": 160, "name": "Identifier", - "src": "1327:6:0" + "src": "1419:6:0" } ], - "id": 148, + "id": 161, "name": "Assignment", - "src": "1313:20:0" + "src": "1405:20:0" } ], - "id": 149, + "id": 162, "name": "ExpressionStatement", - "src": "1313:20:0" + "src": "1405:20:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "+=", + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 42, + "type": "uint256", + "value": "value" + }, + "id": 163, + "name": "Identifier", + "src": "1431:5:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "value", + "referencedDeclaration": null, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 417, + "type": "msg", + "value": "msg" + }, + "id": 164, + "name": "Identifier", + "src": "1440:3:0" + } + ], + "id": 165, + "name": "MemberAccess", + "src": "1440:9:0" + } + ], + "id": 166, + "name": "Assignment", + "src": "1431:18:0" + } + ], + "id": 167, + "name": "ExpressionStatement", + "src": "1431:18:0" }, { "children": [ @@ -2362,9 +2615,9 @@ "type": "function (uint256)", "value": "BoughtTokens" }, - "id": 150, + "id": 168, "name": "Identifier", - "src": "1339:12:0" + "src": "1455:12:0" }, { "attributes": { @@ -2374,7 +2627,7 @@ "isPure": false, "lValueRequested": false, "member_name": "coinBalance", - "referencedDeclaration": 42, + "referencedDeclaration": 55, "type": "uint256" }, "children": [ @@ -2394,13 +2647,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 56, + "referencedDeclaration": 69, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 151, + "id": 169, "name": "Identifier", - "src": "1352:13:0" + "src": "1468:13:0" }, { "attributes": { @@ -2420,48 +2673,48 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 385, + "referencedDeclaration": 417, "type": "msg", "value": "msg" }, - "id": 152, + "id": 170, "name": "Identifier", - "src": "1366:3:0" + "src": "1482:3:0" } ], - "id": 153, + "id": 171, "name": "MemberAccess", - "src": "1366:10:0" + "src": "1482:10:0" } ], - "id": 154, + "id": 172, "name": "IndexAccess", - "src": "1352:25:0" + "src": "1468:25:0" } ], - "id": 155, + "id": 173, "name": "MemberAccess", - "src": "1352:37:0" + "src": "1468:37:0" } ], - "id": 156, + "id": 174, "name": "FunctionCall", - "src": "1339:51:0" + "src": "1455:51:0" } ], - "id": 157, + "id": 175, "name": "ExpressionStatement", - "src": "1339:51:0" + "src": "1455:51:0" } ], - "id": 158, + "id": 176, "name": "Block", - "src": "1227:168:0" + "src": "1319:192:0" } ], - "id": 159, + "id": 177, "name": "FunctionDefinition", - "src": "1188:207:0" + "src": "1272:239:0" }, { "attributes": { @@ -2473,7 +2726,7 @@ ], "name": "createPost", "payable": false, - "scope": 317, + "scope": 349, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -2485,7 +2738,7 @@ "attributes": { "constant": false, "name": "url", - "scope": 221, + "scope": 239, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -2498,19 +2751,19 @@ "name": "string", "type": "string storage pointer" }, - "id": 160, + "id": 178, "name": "ElementaryTypeName", - "src": "1419:6:0" + "src": "1535:6:0" } ], - "id": 161, + "id": 179, "name": "VariableDeclaration", - "src": "1419:10:0" + "src": "1535:10:0" } ], - "id": 162, + "id": 180, "name": "ParameterList", - "src": "1418:12:0" + "src": "1534:12:0" }, { "attributes": { @@ -2519,16 +2772,16 @@ ] }, "children": [], - "id": 163, + "id": 181, "name": "ParameterList", - "src": "1438:0:0" + "src": "1554:0:0" }, { "children": [ { "attributes": { "assignments": [ - 164 + 182 ] }, "children": [ @@ -2536,7 +2789,7 @@ "attributes": { "constant": false, "name": "post", - "scope": 221, + "scope": 239, "stateVariable": false, "storageLocation": "default", "type": "struct CapCoin.Post storage pointer", @@ -2545,9 +2798,9 @@ "visibility": "internal" }, "children": [], - "id": 164, + "id": 182, "name": "VariableDeclaration", - "src": "1468:8:0" + "src": "1584:8:0" }, { "attributes": { @@ -2565,13 +2818,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 60, + "referencedDeclaration": 73, "type": "mapping(address => struct CapCoin.Post storage ref)", "value": "addressToPost" }, - "id": 165, + "id": 183, "name": "Identifier", - "src": "1479:13:0" + "src": "1595:13:0" }, { "attributes": { @@ -2591,28 +2844,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 385, + "referencedDeclaration": 417, "type": "msg", "value": "msg" }, - "id": 166, + "id": 184, "name": "Identifier", - "src": "1493:3:0" + "src": "1609:3:0" } ], - "id": 167, + "id": 185, "name": "MemberAccess", - "src": "1493:10:0" + "src": "1609:10:0" } ], - "id": 168, + "id": 186, "name": "IndexAccess", - "src": "1479:25:0" + "src": "1595:25:0" } ], - "id": 169, + "id": 187, "name": "VariableDeclarationStatement", - "src": "1468:36:0" + "src": "1584:36:0" }, { "children": [ @@ -2635,7 +2888,7 @@ "isPure": false, "lValueRequested": true, "member_name": "url", - "referencedDeclaration": 45, + "referencedDeclaration": 58, "type": "string storage ref" }, "children": [ @@ -2645,18 +2898,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 164, + "referencedDeclaration": 182, "type": "struct CapCoin.Post storage pointer", "value": "post" }, - "id": 170, + "id": 188, "name": "Identifier", - "src": "1510:4:0" + "src": "1626:4:0" } ], - "id": 172, + "id": 190, "name": "MemberAccess", - "src": "1510:8:0" + "src": "1626:8:0" }, { "attributes": { @@ -2664,23 +2917,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 161, + "referencedDeclaration": 179, "type": "string memory", "value": "url" }, - "id": 173, + "id": 191, "name": "Identifier", - "src": "1521:3:0" + "src": "1637:3:0" } ], - "id": 174, + "id": 192, "name": "Assignment", - "src": "1510:14:0" + "src": "1626:14:0" } ], - "id": 175, + "id": 193, "name": "ExpressionStatement", - "src": "1510:14:0" + "src": "1626:14:0" }, { "children": [ @@ -2703,7 +2956,7 @@ "isPure": false, "lValueRequested": true, "member_name": "lotteryAmount", - "referencedDeclaration": 49, + "referencedDeclaration": 62, "type": "int256" }, "children": [ @@ -2713,18 +2966,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 164, + "referencedDeclaration": 182, "type": "struct CapCoin.Post storage pointer", "value": "post" }, - "id": 176, + "id": 194, "name": "Identifier", - "src": "1530:4:0" + "src": "1646:4:0" } ], - "id": 178, + "id": 196, "name": "MemberAccess", - "src": "1530:18:0" + "src": "1646:18:0" }, { "attributes": { @@ -2739,19 +2992,19 @@ "type": "int_const 5", "value": "5" }, - "id": 179, + "id": 197, "name": "Literal", - "src": "1552:1:0" + "src": "1668:1:0" } ], - "id": 180, + "id": 198, "name": "Assignment", - "src": "1530:23:0" + "src": "1646:23:0" } ], - "id": 181, + "id": 199, "name": "ExpressionStatement", - "src": "1530:23:0" + "src": "1646:23:0" }, { "children": [ @@ -2774,7 +3027,7 @@ "isPure": false, "lValueRequested": true, "member_name": "userName", - "referencedDeclaration": 47, + "referencedDeclaration": 60, "type": "string storage ref" }, "children": [ @@ -2784,18 +3037,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 164, + "referencedDeclaration": 182, "type": "struct CapCoin.Post storage pointer", "value": "post" }, - "id": 182, + "id": 200, "name": "Identifier", - "src": "1559:4:0" + "src": "1675:4:0" } ], - "id": 184, + "id": 202, "name": "MemberAccess", - "src": "1559:13:0" + "src": "1675:13:0" }, { "attributes": { @@ -2805,7 +3058,7 @@ "isPure": false, "lValueRequested": false, "member_name": "name", - "referencedDeclaration": 40, + "referencedDeclaration": 53, "type": "string storage ref" }, "children": [ @@ -2825,13 +3078,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 56, + "referencedDeclaration": 69, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 185, + "id": 203, "name": "Identifier", - "src": "1575:13:0" + "src": "1691:13:0" }, { "attributes": { @@ -2851,38 +3104,38 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 385, + "referencedDeclaration": 417, "type": "msg", "value": "msg" }, - "id": 186, + "id": 204, "name": "Identifier", - "src": "1589:3:0" + "src": "1705:3:0" } ], - "id": 187, + "id": 205, "name": "MemberAccess", - "src": "1589:10:0" + "src": "1705:10:0" } ], - "id": 188, + "id": 206, "name": "IndexAccess", - "src": "1575:25:0" + "src": "1691:25:0" } ], - "id": 189, + "id": 207, "name": "MemberAccess", - "src": "1575:30:0" + "src": "1691:30:0" } ], - "id": 190, + "id": 208, "name": "Assignment", - "src": "1559:46:0" + "src": "1675:46:0" } ], - "id": 191, + "id": 209, "name": "ExpressionStatement", - "src": "1559:46:0" + "src": "1675:46:0" }, { "children": [ @@ -2905,7 +3158,7 @@ "isPure": false, "lValueRequested": true, "member_name": "owner", - "referencedDeclaration": 51, + "referencedDeclaration": 64, "type": "address" }, "children": [ @@ -2915,18 +3168,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 164, + "referencedDeclaration": 182, "type": "struct CapCoin.Post storage pointer", "value": "post" }, - "id": 192, + "id": 210, "name": "Identifier", - "src": "1611:4:0" + "src": "1727:4:0" } ], - "id": 194, + "id": 212, "name": "MemberAccess", - "src": "1611:10:0" + "src": "1727:10:0" }, { "attributes": { @@ -2946,28 +3199,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 385, + "referencedDeclaration": 417, "type": "msg", "value": "msg" }, - "id": 195, + "id": 213, "name": "Identifier", - "src": "1624:3:0" + "src": "1740:3:0" } ], - "id": 196, + "id": 214, "name": "MemberAccess", - "src": "1624:10:0" + "src": "1740:10:0" } ], - "id": 197, + "id": 215, "name": "Assignment", - "src": "1611:23:0" + "src": "1727:23:0" } ], - "id": 198, + "id": 216, "name": "ExpressionStatement", - "src": "1611:23:0" + "src": "1727:23:0" }, { "children": [ @@ -3024,18 +3277,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 63, + "referencedDeclaration": 76, "type": "address[] storage ref", "value": "posts" }, - "id": 199, + "id": 217, "name": "Identifier", - "src": "1641:5:0" + "src": "1757:5:0" } ], - "id": 201, + "id": 219, "name": "MemberAccess", - "src": "1641:10:0" + "src": "1757:10:0" }, { "attributes": { @@ -3055,23 +3308,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 385, + "referencedDeclaration": 417, "type": "msg", "value": "msg" }, - "id": 202, + "id": 220, "name": "Identifier", - "src": "1652:3:0" + "src": "1768:3:0" } ], - "id": 203, + "id": 221, "name": "MemberAccess", - "src": "1652:10:0" + "src": "1768:10:0" } ], - "id": 204, + "id": 222, "name": "FunctionCall", - "src": "1641:22:0" + "src": "1757:22:0" }, { "attributes": { @@ -3086,19 +3339,19 @@ "type": "int_const 1", "value": "1" }, - "id": 205, + "id": 223, "name": "Literal", - "src": "1665:1:0" + "src": "1781:1:0" } ], - "id": 206, + "id": 224, "name": "BinaryOperation", - "src": "1641:25:0" + "src": "1757:25:0" } ], - "id": 207, + "id": 225, "name": "ExpressionStatement", - "src": "1641:25:0" + "src": "1757:25:0" }, { "children": [ @@ -3121,7 +3374,7 @@ "isPure": false, "lValueRequested": true, "member_name": "coinBalance", - "referencedDeclaration": 42, + "referencedDeclaration": 55, "type": "uint256" }, "children": [ @@ -3141,13 +3394,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 56, + "referencedDeclaration": 69, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 208, + "id": 226, "name": "Identifier", - "src": "1672:13:0" + "src": "1788:13:0" }, { "attributes": { @@ -3167,28 +3420,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 385, + "referencedDeclaration": 417, "type": "msg", "value": "msg" }, - "id": 209, + "id": 227, "name": "Identifier", - "src": "1686:3:0" + "src": "1802:3:0" } ], - "id": 210, + "id": 228, "name": "MemberAccess", - "src": "1686:10:0" + "src": "1802:10:0" } ], - "id": 211, + "id": 229, "name": "IndexAccess", - "src": "1672:25:0" + "src": "1788:25:0" } ], - "id": 212, + "id": 230, "name": "MemberAccess", - "src": "1672:37:0" + "src": "1788:37:0" }, { "attributes": { @@ -3203,19 +3456,19 @@ "type": "int_const 5", "value": "5" }, - "id": 213, + "id": 231, "name": "Literal", - "src": "1713:1:0" + "src": "1829:1:0" } ], - "id": 214, + "id": 232, "name": "Assignment", - "src": "1672:42:0" + "src": "1788:42:0" } ], - "id": 215, + "id": 233, "name": "ExpressionStatement", - "src": "1672:42:0" + "src": "1788:42:0" }, { "children": [ @@ -3249,9 +3502,9 @@ "type": "function (string memory)", "value": "CreatedPost" }, - "id": 216, + "id": 234, "name": "Identifier", - "src": "1720:11:0" + "src": "1836:11:0" }, { "attributes": { @@ -3259,33 +3512,33 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 161, + "referencedDeclaration": 179, "type": "string memory", "value": "url" }, - "id": 217, + "id": 235, "name": "Identifier", - "src": "1732:3:0" + "src": "1848:3:0" } ], - "id": 218, + "id": 236, "name": "FunctionCall", - "src": "1720:16:0" + "src": "1836:16:0" } ], - "id": 219, + "id": 237, "name": "ExpressionStatement", - "src": "1720:16:0" + "src": "1836:16:0" } ], - "id": 220, + "id": 238, "name": "Block", - "src": "1438:303:0" + "src": "1554:303:0" } ], - "id": 221, + "id": 239, "name": "FunctionDefinition", - "src": "1399:342:0" + "src": "1515:342:0" }, { "attributes": { @@ -3297,7 +3550,7 @@ ], "name": "likePost", "payable": false, - "scope": 317, + "scope": 349, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -3309,7 +3562,7 @@ "attributes": { "constant": false, "name": "post", - "scope": 281, + "scope": 299, "stateVariable": false, "storageLocation": "default", "type": "address", @@ -3322,20 +3575,20 @@ "name": "address", "type": "address" }, - "id": 222, + "id": 240, "name": "ElementaryTypeName", - "src": "1763:7:0" + "src": "1879:7:0" } ], - "id": 223, + "id": 241, "name": "VariableDeclaration", - "src": "1763:12:0" + "src": "1879:12:0" }, { "attributes": { "constant": false, "name": "amount", - "scope": 281, + "scope": 299, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -3348,19 +3601,19 @@ "name": "uint", "type": "uint256" }, - "id": 224, + "id": 242, "name": "ElementaryTypeName", - "src": "1777:4:0" + "src": "1893:4:0" } ], - "id": 225, + "id": 243, "name": "VariableDeclaration", - "src": "1777:11:0" + "src": "1893:11:0" } ], - "id": 226, + "id": 244, "name": "ParameterList", - "src": "1762:27:0" + "src": "1878:27:0" }, { "attributes": { @@ -3369,9 +3622,9 @@ ] }, "children": [], - "id": 227, + "id": 245, "name": "ParameterList", - "src": "1797:0:0" + "src": "1913:0:0" }, { "children": [ @@ -3396,7 +3649,7 @@ "isPure": false, "lValueRequested": true, "member_name": "lotteryAmount", - "referencedDeclaration": 49, + "referencedDeclaration": 62, "type": "int256" }, "children": [ @@ -3416,13 +3669,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 60, + "referencedDeclaration": 73, "type": "mapping(address => struct CapCoin.Post storage ref)", "value": "addressToPost" }, - "id": 228, + "id": 246, "name": "Identifier", - "src": "1803:13:0" + "src": "1919:13:0" }, { "attributes": { @@ -3430,23 +3683,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 223, + "referencedDeclaration": 241, "type": "address", "value": "post" }, - "id": 229, + "id": 247, "name": "Identifier", - "src": "1817:4:0" + "src": "1933:4:0" } ], - "id": 230, + "id": 248, "name": "IndexAccess", - "src": "1803:19:0" + "src": "1919:19:0" } ], - "id": 231, + "id": 249, "name": "MemberAccess", - "src": "1803:33:0" + "src": "1919:33:0" }, { "attributes": { @@ -3478,9 +3731,9 @@ "type": "type(int256)", "value": "int" }, - "id": 232, + "id": 250, "name": "ElementaryTypeNameExpression", - "src": "1840:3:0" + "src": "1956:3:0" }, { "attributes": { @@ -3488,28 +3741,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 225, + "referencedDeclaration": 243, "type": "uint256", "value": "amount" }, - "id": 233, + "id": 251, "name": "Identifier", - "src": "1844:6:0" + "src": "1960:6:0" } ], - "id": 234, + "id": 252, "name": "FunctionCall", - "src": "1840:11:0" + "src": "1956:11:0" } ], - "id": 235, + "id": 253, "name": "Assignment", - "src": "1803:48:0" + "src": "1919:48:0" } ], - "id": 236, + "id": 254, "name": "ExpressionStatement", - "src": "1803:48:0" + "src": "1919:48:0" }, { "children": [ @@ -3532,7 +3785,7 @@ "isPure": false, "lValueRequested": true, "member_name": "coinBalance", - "referencedDeclaration": 42, + "referencedDeclaration": 55, "type": "uint256" }, "children": [ @@ -3552,13 +3805,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 56, + "referencedDeclaration": 69, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 237, + "id": 255, "name": "Identifier", - "src": "1857:13:0" + "src": "1973:13:0" }, { "attributes": { @@ -3566,23 +3819,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 223, + "referencedDeclaration": 241, "type": "address", "value": "post" }, - "id": 238, + "id": 256, "name": "Identifier", - "src": "1871:4:0" + "src": "1987:4:0" } ], - "id": 239, + "id": 257, "name": "IndexAccess", - "src": "1857:19:0" + "src": "1973:19:0" } ], - "id": 240, + "id": 258, "name": "MemberAccess", - "src": "1857:31:0" + "src": "1973:31:0" }, { "attributes": { @@ -3590,23 +3843,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 225, + "referencedDeclaration": 243, "type": "uint256", "value": "amount" }, - "id": 241, + "id": 259, "name": "Identifier", - "src": "1892:6:0" + "src": "2008:6:0" } ], - "id": 242, + "id": 260, "name": "Assignment", - "src": "1857:41:0" + "src": "1973:41:0" } ], - "id": 243, + "id": 261, "name": "ExpressionStatement", - "src": "1857:41:0" + "src": "1973:41:0" }, { "children": [ @@ -3629,7 +3882,7 @@ "isPure": false, "lValueRequested": true, "member_name": "coinBalance", - "referencedDeclaration": 42, + "referencedDeclaration": 55, "type": "uint256" }, "children": [ @@ -3649,13 +3902,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 56, + "referencedDeclaration": 69, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 244, + "id": 262, "name": "Identifier", - "src": "1904:13:0" + "src": "2020:13:0" }, { "attributes": { @@ -3675,28 +3928,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 385, + "referencedDeclaration": 417, "type": "msg", "value": "msg" }, - "id": 245, + "id": 263, "name": "Identifier", - "src": "1918:3:0" + "src": "2034:3:0" } ], - "id": 246, + "id": 264, "name": "MemberAccess", - "src": "1918:10:0" + "src": "2034:10:0" } ], - "id": 247, + "id": 265, "name": "IndexAccess", - "src": "1904:25:0" + "src": "2020:25:0" } ], - "id": 248, + "id": 266, "name": "MemberAccess", - "src": "1904:37:0" + "src": "2020:37:0" }, { "attributes": { @@ -3704,23 +3957,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 225, + "referencedDeclaration": 243, "type": "uint256", "value": "amount" }, - "id": 249, + "id": 267, "name": "Identifier", - "src": "1945:6:0" + "src": "2061:6:0" } ], - "id": 250, + "id": 268, "name": "Assignment", - "src": "1904:47:0" + "src": "2020:47:0" } ], - "id": 251, + "id": 269, "name": "ExpressionStatement", - "src": "1904:47:0" + "src": "2020:47:0" }, { "children": [ @@ -3778,9 +4031,9 @@ "type": "function (int256,string memory,address,uint256,string memory,address,uint256)", "value": "LikedPost" }, - "id": 252, + "id": 270, "name": "Identifier", - "src": "1957:9:0" + "src": "2073:9:0" }, { "attributes": { @@ -3790,7 +4043,7 @@ "isPure": false, "lValueRequested": false, "member_name": "lotteryAmount", - "referencedDeclaration": 49, + "referencedDeclaration": 62, "type": "int256" }, "children": [ @@ -3810,13 +4063,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 60, + "referencedDeclaration": 73, "type": "mapping(address => struct CapCoin.Post storage ref)", "value": "addressToPost" }, - "id": 253, + "id": 271, "name": "Identifier", - "src": "1967:13:0" + "src": "2083:13:0" }, { "attributes": { @@ -3824,23 +4077,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 223, + "referencedDeclaration": 241, "type": "address", "value": "post" }, - "id": 254, + "id": 272, "name": "Identifier", - "src": "1981:4:0" + "src": "2097:4:0" } ], - "id": 255, + "id": 273, "name": "IndexAccess", - "src": "1967:19:0" + "src": "2083:19:0" } ], - "id": 256, + "id": 274, "name": "MemberAccess", - "src": "1967:33:0" + "src": "2083:33:0" }, { "attributes": { @@ -3850,7 +4103,7 @@ "isPure": false, "lValueRequested": false, "member_name": "name", - "referencedDeclaration": 40, + "referencedDeclaration": 53, "type": "string storage ref" }, "children": [ @@ -3870,13 +4123,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 56, + "referencedDeclaration": 69, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 257, + "id": 275, "name": "Identifier", - "src": "2008:13:0" + "src": "2124:13:0" }, { "attributes": { @@ -3884,23 +4137,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 223, + "referencedDeclaration": 241, "type": "address", "value": "post" }, - "id": 258, + "id": 276, "name": "Identifier", - "src": "2022:4:0" + "src": "2138:4:0" } ], - "id": 259, + "id": 277, "name": "IndexAccess", - "src": "2008:19:0" + "src": "2124:19:0" } ], - "id": 260, + "id": 278, "name": "MemberAccess", - "src": "2008:24:0" + "src": "2124:24:0" }, { "attributes": { @@ -3908,13 +4161,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 223, + "referencedDeclaration": 241, "type": "address", "value": "post" }, - "id": 261, + "id": 279, "name": "Identifier", - "src": "2034:4:0" + "src": "2150:4:0" }, { "attributes": { @@ -3924,7 +4177,7 @@ "isPure": false, "lValueRequested": false, "member_name": "coinBalance", - "referencedDeclaration": 42, + "referencedDeclaration": 55, "type": "uint256" }, "children": [ @@ -3944,13 +4197,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 56, + "referencedDeclaration": 69, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 262, + "id": 280, "name": "Identifier", - "src": "2040:13:0" + "src": "2156:13:0" }, { "attributes": { @@ -3958,23 +4211,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 223, + "referencedDeclaration": 241, "type": "address", "value": "post" }, - "id": 263, + "id": 281, "name": "Identifier", - "src": "2054:4:0" + "src": "2170:4:0" } ], - "id": 264, + "id": 282, "name": "IndexAccess", - "src": "2040:19:0" + "src": "2156:19:0" } ], - "id": 265, + "id": 283, "name": "MemberAccess", - "src": "2040:31:0" + "src": "2156:31:0" }, { "attributes": { @@ -3984,7 +4237,7 @@ "isPure": false, "lValueRequested": false, "member_name": "name", - "referencedDeclaration": 40, + "referencedDeclaration": 53, "type": "string storage ref" }, "children": [ @@ -4004,13 +4257,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 56, + "referencedDeclaration": 69, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 266, + "id": 284, "name": "Identifier", - "src": "2079:13:0" + "src": "2195:13:0" }, { "attributes": { @@ -4030,28 +4283,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 385, + "referencedDeclaration": 417, "type": "msg", "value": "msg" }, - "id": 267, + "id": 285, "name": "Identifier", - "src": "2093:3:0" + "src": "2209:3:0" } ], - "id": 268, + "id": 286, "name": "MemberAccess", - "src": "2093:10:0" + "src": "2209:10:0" } ], - "id": 269, + "id": 287, "name": "IndexAccess", - "src": "2079:25:0" + "src": "2195:25:0" } ], - "id": 270, + "id": 288, "name": "MemberAccess", - "src": "2079:30:0" + "src": "2195:30:0" }, { "attributes": { @@ -4071,18 +4324,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 385, + "referencedDeclaration": 417, "type": "msg", "value": "msg" }, - "id": 271, + "id": 289, "name": "Identifier", - "src": "2111:3:0" + "src": "2227:3:0" } ], - "id": 272, + "id": 290, "name": "MemberAccess", - "src": "2111:10:0" + "src": "2227:10:0" }, { "attributes": { @@ -4092,7 +4345,7 @@ "isPure": false, "lValueRequested": false, "member_name": "coinBalance", - "referencedDeclaration": 42, + "referencedDeclaration": 55, "type": "uint256" }, "children": [ @@ -4112,13 +4365,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 56, + "referencedDeclaration": 69, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 273, + "id": 291, "name": "Identifier", - "src": "2123:13:0" + "src": "2239:13:0" }, { "attributes": { @@ -4138,48 +4391,48 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 385, + "referencedDeclaration": 417, "type": "msg", "value": "msg" }, - "id": 274, + "id": 292, "name": "Identifier", - "src": "2137:3:0" + "src": "2253:3:0" } ], - "id": 275, + "id": 293, "name": "MemberAccess", - "src": "2137:10:0" + "src": "2253:10:0" } ], - "id": 276, + "id": 294, "name": "IndexAccess", - "src": "2123:25:0" + "src": "2239:25:0" } ], - "id": 277, + "id": 295, "name": "MemberAccess", - "src": "2123:37:0" + "src": "2239:37:0" } ], - "id": 278, + "id": 296, "name": "FunctionCall", - "src": "1957:204:0" + "src": "2073:204:0" } ], - "id": 279, + "id": 297, "name": "ExpressionStatement", - "src": "1957:204:0" + "src": "2073:204:0" } ], - "id": 280, + "id": 298, "name": "Block", - "src": "1797:369:0" + "src": "1913:369:0" } ], - "id": 281, + "id": 299, "name": "FunctionDefinition", - "src": "1745:421:0" + "src": "1861:421:0" }, { "attributes": { @@ -4191,7 +4444,7 @@ ], "name": "getPosts", "payable": false, - "scope": 317, + "scope": 349, "stateMutability": "view", "superFunction": null, "visibility": "public" @@ -4204,9 +4457,9 @@ ] }, "children": [], - "id": 282, + "id": 300, "name": "ParameterList", - "src": "2187:2:0" + "src": "2303:2:0" }, { "children": [ @@ -4214,7 +4467,7 @@ "attributes": { "constant": false, "name": "", - "scope": 290, + "scope": 308, "stateVariable": false, "storageLocation": "default", "type": "address[] memory", @@ -4233,30 +4486,30 @@ "name": "address", "type": "address" }, - "id": 283, + "id": 301, "name": "ElementaryTypeName", - "src": "2211:7:0" + "src": "2327:7:0" } ], - "id": 284, + "id": 302, "name": "ArrayTypeName", - "src": "2211:9:0" + "src": "2327:9:0" } ], - "id": 285, + "id": 303, "name": "VariableDeclaration", - "src": "2211:9:0" + "src": "2327:9:0" } ], - "id": 286, + "id": 304, "name": "ParameterList", - "src": "2210:11:0" + "src": "2326:11:0" }, { "children": [ { "attributes": { - "functionReturnParameters": 286 + "functionReturnParameters": 304 }, "children": [ { @@ -4265,28 +4518,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 63, + "referencedDeclaration": 76, "type": "address[] storage ref", "value": "posts" }, - "id": 287, + "id": 305, "name": "Identifier", - "src": "2237:5:0" + "src": "2353:5:0" } ], - "id": 288, + "id": 306, "name": "Return", - "src": "2230:12:0" + "src": "2346:12:0" } ], - "id": 289, + "id": 307, "name": "Block", - "src": "2222:25:0" + "src": "2338:25:0" } ], - "id": 290, + "id": 308, "name": "FunctionDefinition", - "src": "2170:77:0" + "src": "2286:77:0" }, { "attributes": { @@ -4298,7 +4551,7 @@ ], "name": "seed", "payable": false, - "scope": 317, + "scope": 349, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -4310,7 +4563,7 @@ "attributes": { "constant": false, "name": "name", - "scope": 312, + "scope": 330, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -4323,20 +4576,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 291, + "id": 309, "name": "ElementaryTypeName", - "src": "2265:6:0" + "src": "2381:6:0" } ], - "id": 292, + "id": 310, "name": "VariableDeclaration", - "src": "2265:11:0" + "src": "2381:11:0" }, { "attributes": { "constant": false, "name": "url", - "scope": 312, + "scope": 330, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -4349,20 +4602,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 293, + "id": 311, "name": "ElementaryTypeName", - "src": "2278:6:0" + "src": "2394:6:0" } ], - "id": 294, + "id": 312, "name": "VariableDeclaration", - "src": "2278:10:0" + "src": "2394:10:0" }, { "attributes": { "constant": false, "name": "amount", - "scope": 312, + "scope": 330, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -4375,19 +4628,19 @@ "name": "uint", "type": "uint256" }, - "id": 295, + "id": 313, "name": "ElementaryTypeName", - "src": "2290:4:0" + "src": "2406:4:0" } ], - "id": 296, + "id": 314, "name": "VariableDeclaration", - "src": "2290:11:0" + "src": "2406:11:0" } ], - "id": 297, + "id": 315, "name": "ParameterList", - "src": "2264:38:0" + "src": "2380:38:0" }, { "attributes": { @@ -4396,9 +4649,9 @@ ] }, "children": [], - "id": 298, + "id": 316, "name": "ParameterList", - "src": "2310:0:0" + "src": "2426:0:0" }, { "children": [ @@ -4430,13 +4683,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 91, + "referencedDeclaration": 104, "type": "function (string memory)", "value": "createUser" }, - "id": 299, + "id": 317, "name": "Identifier", - "src": "2318:10:0" + "src": "2434:10:0" }, { "attributes": { @@ -4444,23 +4697,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 292, + "referencedDeclaration": 310, "type": "string memory", "value": "name" }, - "id": 300, + "id": 318, "name": "Identifier", - "src": "2329:4:0" + "src": "2445:4:0" } ], - "id": 301, + "id": 319, "name": "FunctionCall", - "src": "2318:16:0" + "src": "2434:16:0" } ], - "id": 302, + "id": 320, "name": "ExpressionStatement", - "src": "2318:16:0" + "src": "2434:16:0" }, { "children": [ @@ -4490,13 +4743,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 159, + "referencedDeclaration": 177, "type": "function (uint256)", "value": "buyTokens" }, - "id": 303, + "id": 321, "name": "Identifier", - "src": "2342:9:0" + "src": "2458:9:0" }, { "attributes": { @@ -4504,23 +4757,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 296, + "referencedDeclaration": 314, "type": "uint256", "value": "amount" }, - "id": 304, + "id": 322, "name": "Identifier", - "src": "2352:6:0" + "src": "2468:6:0" } ], - "id": 305, + "id": 323, "name": "FunctionCall", - "src": "2342:17:0" + "src": "2458:17:0" } ], - "id": 306, + "id": 324, "name": "ExpressionStatement", - "src": "2342:17:0" + "src": "2458:17:0" }, { "children": [ @@ -4550,13 +4803,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 221, + "referencedDeclaration": 239, "type": "function (string memory)", "value": "createPost" }, - "id": 307, + "id": 325, "name": "Identifier", - "src": "2367:10:0" + "src": "2483:10:0" }, { "attributes": { @@ -4564,33 +4817,225 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 294, + "referencedDeclaration": 312, "type": "string memory", "value": "url" }, - "id": 308, + "id": 326, "name": "Identifier", - "src": "2378:3:0" + "src": "2494:3:0" } ], - "id": 309, + "id": 327, "name": "FunctionCall", - "src": "2367:15:0" + "src": "2483:15:0" } ], - "id": 310, + "id": 328, "name": "ExpressionStatement", - "src": "2367:15:0" + "src": "2483:15:0" } ], - "id": 311, + "id": 329, "name": "Block", - "src": "2310:77:0" + "src": "2426:77:0" } ], - "id": 312, + "id": 330, "name": "FunctionDefinition", - "src": "2251:136:0" + "src": "2367:136:0" + }, + { + "attributes": { + "constant": false, + "implemented": true, + "isConstructor": false, + "modifiers": [ + null + ], + "name": "kill", + "payable": false, + "scope": 349, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": [ + { + "attributes": { + "parameters": [ + null + ] + }, + "children": [], + "id": 331, + "name": "ParameterList", + "src": "2522:2:0" + }, + { + "attributes": { + "parameters": [ + null + ] + }, + "children": [], + "id": 332, + "name": "ParameterList", + "src": "2525:0:0" + }, + { + "children": [ + { + "attributes": { + "falseBody": null + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "==", + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "sender", + "referencedDeclaration": null, + "type": "address" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 417, + "type": "msg", + "value": "msg" + }, + "id": 333, + "name": "Identifier", + "src": "2537:3:0" + } + ], + "id": 334, + "name": "MemberAccess", + "src": "2537:10:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 40, + "type": "address", + "value": "owner" + }, + "id": 335, + "name": "Identifier", + "src": "2551:5:0" + } + ], + "id": 336, + "name": "BinaryOperation", + "src": "2537:19:0" + }, + { + "children": [ + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "tuple()", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 423, + "type": "function (address)", + "value": "selfdestruct" + }, + "id": 337, + "name": "Identifier", + "src": "2568:12:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 40, + "type": "address", + "value": "owner" + }, + "id": 338, + "name": "Identifier", + "src": "2581:5:0" + } + ], + "id": 339, + "name": "FunctionCall", + "src": "2568:19:0" + } + ], + "id": 340, + "name": "ExpressionStatement", + "src": "2568:19:0" + } + ], + "id": 341, + "name": "Block", + "src": "2558:38:0" + } + ], + "id": 342, + "name": "IfStatement", + "src": "2533:63:0" + } + ], + "id": 343, + "name": "Block", + "src": "2525:77:0" + } + ], + "id": 344, + "name": "FunctionDefinition", + "src": "2509:93:0" }, { "attributes": { @@ -4602,10 +5047,10 @@ ], "name": "", "payable": true, - "scope": 317, + "scope": 349, "stateMutability": "payable", "superFunction": null, - "visibility": "internal" + "visibility": "public" }, "children": [ { @@ -4615,9 +5060,9 @@ ] }, "children": [], - "id": 313, + "id": 345, "name": "ParameterList", - "src": "2399:2:0" + "src": "2614:2:0" }, { "attributes": { @@ -4626,9 +5071,9 @@ ] }, "children": [], - "id": 314, + "id": 346, "name": "ParameterList", - "src": "2419:0:0" + "src": "2625:0:0" }, { "attributes": { @@ -4637,24 +5082,24 @@ ] }, "children": [], - "id": 315, + "id": 347, "name": "Block", - "src": "2419:2:0" + "src": "2625:2:0" } ], - "id": 316, + "id": 348, "name": "FunctionDefinition", - "src": "2391:30:0" + "src": "2606:21:0" } ], - "id": 317, + "id": 349, "name": "ContractDefinition", - "src": "87:2336:0" + "src": "87:2542:0" } ], - "id": 318, + "id": 350, "name": "SourceUnit", - "src": "0:2424:0" + "src": "0:2630:0" }, "compiler": { "name": "solc", @@ -4664,9 +5109,9 @@ "5777": { "events": {}, "links": {}, - "address": "0x345ca3e014aaf5dca488057592ee47305d9b3e10" + "address": "0xf12b5dd4ead5f743c6baa640b0216200e89b60da" } }, "schemaVersion": "1.0.1", - "updatedAt": "2018-01-20T17:25:13.162Z" + "updatedAt": "2018-01-20T19:00:49.730Z" } \ No newline at end of file diff --git a/build/contracts/Migrations.json b/build/contracts/Migrations.json index 5db011e0..373501ac 100644 --- a/build/contracts/Migrations.json +++ b/build/contracts/Migrations.json @@ -823,5 +823,5 @@ } }, "schemaVersion": "1.0.1", - "updatedAt": "2018-01-20T17:25:13.159Z" + "updatedAt": "2018-01-20T19:00:49.726Z" } \ No newline at end of file diff --git a/build/contracts/SimpleStorage.json b/build/contracts/SimpleStorage.json index 73d3ec70..edca7576 100644 --- a/build/contracts/SimpleStorage.json +++ b/build/contracts/SimpleStorage.json @@ -344,5 +344,5 @@ } }, "schemaVersion": "1.0.1", - "updatedAt": "2018-01-20T17:25:13.158Z" + "updatedAt": "2018-01-20T19:00:49.725Z" } \ No newline at end of file diff --git a/contracts/CapCoin.sol b/contracts/CapCoin.sol index be58bf8f..52dc28d1 100644 --- a/contracts/CapCoin.sol +++ b/contracts/CapCoin.sol @@ -13,6 +13,12 @@ contract CapCoin is Ownable { uint coinSupply = 1000000; uint coinsBought = 0; + address owner; + uint value; + + function CapCoin () { + owner = msg.sender; + } struct User { string name; @@ -46,10 +52,11 @@ contract CapCoin is Ownable { } // need to add economics - function buyTokens(uint amount) public { + function buyTokens(uint amount) payable public { addressToUser[msg.sender].coinBalance += amount; coinsBought += amount; coinSupply -= amount; + value += msg.value; BoughtTokens(addressToUser[msg.sender].coinBalance); } @@ -85,5 +92,11 @@ contract CapCoin is Ownable { createPost(url); } - function() internal payable {} + function kill() { + if (msg.sender == owner) { + selfdestruct(owner); + } + } + + function() payable {} } diff --git a/src/components/Exchange.js b/src/components/Exchange.js index 480e1aa1..ab1ad66d 100644 --- a/src/components/Exchange.js +++ b/src/components/Exchange.js @@ -32,7 +32,7 @@ class Exchange extends Component { - this.props.buyTokens(e, this.state.value, this.props.contract.buyTokens, this.props.accounts[0])} + this.props.buyTokens(e, this.state.value, this.props.contract.buyTokens, this.props.accounts[0], this.props.web3.toWei)} label="Buy Tokens" primary={true} />

You have {this.props.user.coinBalance} Coins

@@ -43,6 +43,7 @@ class Exchange extends Component { const mapState = (state) => { return { + web3: state.web3, user: state.user, contract: state.contract, accounts: state.accounts @@ -51,9 +52,9 @@ const mapState = (state) => { const mapDispatch = (dispatch) => { return { - buyTokens: function(e, amount, contractFunc, account){ + buyTokens: function(e, amount, contractFunc, account, conversionFunc){ e.preventDefault() - return dispatch(buyTokens(amount, contractFunc, account)) + return dispatch(buyTokens(amount, contractFunc, account, conversionFunc)) } } } diff --git a/src/components/LikePhoto.js b/src/components/LikePhoto.js index 8b80b5a8..08c13542 100644 --- a/src/components/LikePhoto.js +++ b/src/components/LikePhoto.js @@ -63,7 +63,7 @@ class LikePhoto extends Component { - this.props.like(e, this.props.postUrl, this.props.postAddress, this.props.contract.likePost, this.props.accounts[0], this.state.reward)}/> + this.props.like(e, this.props.postUrl, this.props.postAddress, this.props.contract.likePost, this.props.accounts[0], this.state.reward)}/> ) } diff --git a/src/store/user.js b/src/store/user.js index 5cf2f09c..6186ab5b 100644 --- a/src/store/user.js +++ b/src/store/user.js @@ -51,9 +51,10 @@ export const addUser = (name, contractFunc, account) => }) .catch(err => console.log(err)); -export const buyTokens = (amount, contractFunc, account) => +export const buyTokens = (amount, contractFunc, account, conversionFunc) => dispatch => - contractFunc(amount, {from: account}) + contractFunc(amount, {from: account, gas: 1000000, value: conversionFunc(amount/10, 'ether')}) + // contractFunc(amount, {from: account}) .then(res => dispatch(boughtTokens(res.logs[0].args.coinBalance.c[0]))) .catch(err => console.log(err));