From 9bc7708f1ebabf7bc9e35d246de3b6d5dbe5ade7 Mon Sep 17 00:00:00 2001 From: Jonathan Schwartz Date: Sun, 21 Jan 2018 12:28:42 -0500 Subject: [PATCH 1/3] a user can successfully cash out, implementing a choice mechanism and fee --- build/contracts/CapCoin.json | 2519 +++++++++++++++++++--------- build/contracts/Migrations.json | 4 +- build/contracts/SimpleStorage.json | 2 +- contracts/CapCoin.sol | 13 + src/components/Exchange.js | 13 +- src/store/user.js | 11 +- 6 files changed, 1741 insertions(+), 821 deletions(-) diff --git a/build/contracts/CapCoin.json b/build/contracts/CapCoin.json index b9442981..d184bd33 100644 --- a/build/contracts/CapCoin.json +++ b/build/contracts/CapCoin.json @@ -20,6 +20,24 @@ "stateMutability": "view", "type": "function" }, + { + "constant": false, + "inputs": [ + { + "name": "weiAmount", + "type": "uint256" + }, + { + "name": "coinAmount", + "type": "uint256" + } + ], + "name": "cashOut", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, { "constant": false, "inputs": [ @@ -107,6 +125,20 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "constant": true, + "inputs": [], + "name": "getContractBal", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, { "constant": true, "inputs": [ @@ -343,6 +375,23 @@ "name": "LikedPost", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "newCoinbalance", + "type": "uint256" + }, + { + "indexed": false, + "name": "user", + "type": "address" + } + ], + "name": "CashedOut", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -361,18 +410,18 @@ "type": "event" } ], - "bytecode": "0x6060604052620f42406001556000600255341561001b57600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555033600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611929806100ab6000396000f3006060604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630b1e7f83146100c75780633610724e1461012a578063392338f51461014257806341c0e1b5146101e257806341f3004a146101f75780634835152914610261578063507ffba5146102a3578063763f17c414610300578063832880e71461051b5780638da5cb5b14610656578063d36a3e5e146106ab578063edf5388614610797578063f2fde38b1461086d575b005b34156100d257600080fd5b6100e860048080359060200190919050506108a6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61014060048080359060200190919050506108e5565b005b341561014d57600080fd5b6101e0600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506109e1565b005b34156101ed57600080fd5b6101f5610cd6565b005b341561020257600080fd5b61020a610d69565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561024d578082015181840152602081019050610232565b505050509050019250505060405180910390f35b341561026c57600080fd5b6102a1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610dfd565b005b34156102ae57600080fd5b6102fe600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506111fc565b005b341561030b57600080fd5b610337600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611302565b6040518080602001806020018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001806020018481038452898181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104005780601f106103d557610100808354040283529160200191610400565b820191906000526020600020905b8154815290600101906020018083116103e357829003601f168201915b50508481038352888181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104835780601f1061045857610100808354040283529160200191610483565b820191906000526020600020905b81548152906001019060200180831161046657829003601f168201915b50508481038252858181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156105065780601f106104db57610100808354040283529160200191610506565b820191906000526020600020905b8154815290600101906020018083116104e957829003601f168201915b50509850505050505050505060405180910390f35b341561052657600080fd5b61052e611355565b6040518080602001868152602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838103835288818151815260200191508051906020019080838360005b838110156105b0578082015181840152602081019050610595565b50505050905090810190601f1680156105dd5780820380516001836020036101000a031916815260200191505b50838103825286818151815260200191508051906020019080838360005b838110156106165780820151818401526020810190506105fb565b50505050905090810190601f1680156106435780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b341561066157600080fd5b6106696115be565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106b657600080fd5b610795600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506115e3565b005b34156107a257600080fd5b6107ce600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611605565b604051808060200183815260200182810382528481815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561085d5780601f106108325761010080835404028352916020019161085d565b820191906000526020600020905b81548152906001019060200180831161084057829003601f168201915b5050935050505060405180910390f35b341561087857600080fd5b6108a4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611628565b005b6007818154811015156108b557fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b80600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825401925050819055508060026000828254019250508190555080600160008282540392505081905550346004600082825401925050819055507ffe1367e498701f2dfab80a3d41740d46fd7cba533430e611917f0f3df823279a600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546040518082815260200191505060405180910390a150565b6000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905082816000019080519060200190610a3c92919061177d565b5060058160020160008282540392505081905550600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001816001019080546001816001161561010002031660029004610ab59291906117fd565b50338160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081816004019080519060200190610b1192919061177d565b50600160078054806001018281610b289190611884565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505060058060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507fbdf2d095118b35ed77302e18d5db303371ab8e69762dea74b3b96b8bddc781f98383604051808060200180602001838103835285818151815260200191508051906020019080838360005b83811015610c2f578082015181840152602081019050610c14565b50505050905090810190601f168015610c5c5780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b83811015610c95578082015181840152602081019050610c7a565b50505050905090810190601f168015610cc25780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a1505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d6757600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b565b610d716118b0565b6007805480602002602001604051908101604052809291908181526020018280548015610df357602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610da9575b5050505050905090565b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002016000828254019250508190555080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000828254019250508190555080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507f050cbab7fede968f252efba864c75069d68302f756e7f9c0093fb37faf2ba79b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000184600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000133600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015460405180888152602001806020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001868152602001806020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381038352898181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156111605780601f1061113557610100808354040283529160200191611160565b820191906000526020600020905b81548152906001019060200180831161114357829003601f168201915b50508381038252868181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156111e35780601f106111b8576101008083540402835291602001916111e3565b820191906000526020600020905b8154815290600101906020018083116111c657829003601f168201915b5050995050505050505050505060405180910390a15050565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508181600001908051906020019061125792919061177d565b50600081600101819055507f66ab3fea2083d9ba15d99b595186fe7fc18e6eba393c0fc056f420e96c3caa44826040518080602001828103825283818151815260200191508051906020019080838360005b838110156112c45780820151818401526020810190506112a9565b50505050905090810190601f1680156112f15780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b6006602052806000526040600020600091509050806000019080600101908060020154908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600401905085565b61135d6118c4565b60006113676118c4565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015433848054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561150a5780601f106114df5761010080835404028352916020019161150a565b820191906000526020600020905b8154815290600101906020018083116114ed57829003601f168201915b50505050509450828054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115a65780601f1061157b576101008083540402835291602001916115a6565b820191906000526020600020905b81548152906001019060200180831161158957829003601f168201915b50505050509250945094509450945094509091929394565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6115ec846111fc565b6115f5826108e5565b6115ff83826109e1565b50505050565b600560205280600052604060002060009150905080600001908060010154905082565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561168357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156116bf57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106117be57805160ff19168380011785556117ec565b828001600101855582156117ec579182015b828111156117eb5782518255916020019190600101906117d0565b5b5090506117f991906118d8565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106118365780548555611873565b8280016001018555821561187357600052602060002091601f016020900482015b82811115611872578254825591600101919060010190611857565b5b50905061188091906118d8565b5090565b8154818355818115116118ab578183600052602060002091820191016118aa91906118d8565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b6118fa91905b808211156118f65760008160009055506001016118de565b5090565b905600a165627a7a7230582064bb6b709ff92ac45497816404687cef18fdf549a72690d5f4e9f3de1ab516490029", - "deployedBytecode": "0x6060604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630b1e7f83146100c75780633610724e1461012a578063392338f51461014257806341c0e1b5146101e257806341f3004a146101f75780634835152914610261578063507ffba5146102a3578063763f17c414610300578063832880e71461051b5780638da5cb5b14610656578063d36a3e5e146106ab578063edf5388614610797578063f2fde38b1461086d575b005b34156100d257600080fd5b6100e860048080359060200190919050506108a6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61014060048080359060200190919050506108e5565b005b341561014d57600080fd5b6101e0600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506109e1565b005b34156101ed57600080fd5b6101f5610cd6565b005b341561020257600080fd5b61020a610d69565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561024d578082015181840152602081019050610232565b505050509050019250505060405180910390f35b341561026c57600080fd5b6102a1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610dfd565b005b34156102ae57600080fd5b6102fe600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506111fc565b005b341561030b57600080fd5b610337600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611302565b6040518080602001806020018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001806020018481038452898181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104005780601f106103d557610100808354040283529160200191610400565b820191906000526020600020905b8154815290600101906020018083116103e357829003601f168201915b50508481038352888181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104835780601f1061045857610100808354040283529160200191610483565b820191906000526020600020905b81548152906001019060200180831161046657829003601f168201915b50508481038252858181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156105065780601f106104db57610100808354040283529160200191610506565b820191906000526020600020905b8154815290600101906020018083116104e957829003601f168201915b50509850505050505050505060405180910390f35b341561052657600080fd5b61052e611355565b6040518080602001868152602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838103835288818151815260200191508051906020019080838360005b838110156105b0578082015181840152602081019050610595565b50505050905090810190601f1680156105dd5780820380516001836020036101000a031916815260200191505b50838103825286818151815260200191508051906020019080838360005b838110156106165780820151818401526020810190506105fb565b50505050905090810190601f1680156106435780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b341561066157600080fd5b6106696115be565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106b657600080fd5b610795600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506115e3565b005b34156107a257600080fd5b6107ce600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611605565b604051808060200183815260200182810382528481815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561085d5780601f106108325761010080835404028352916020019161085d565b820191906000526020600020905b81548152906001019060200180831161084057829003601f168201915b5050935050505060405180910390f35b341561087857600080fd5b6108a4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611628565b005b6007818154811015156108b557fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b80600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825401925050819055508060026000828254019250508190555080600160008282540392505081905550346004600082825401925050819055507ffe1367e498701f2dfab80a3d41740d46fd7cba533430e611917f0f3df823279a600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546040518082815260200191505060405180910390a150565b6000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905082816000019080519060200190610a3c92919061177d565b5060058160020160008282540392505081905550600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001816001019080546001816001161561010002031660029004610ab59291906117fd565b50338160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081816004019080519060200190610b1192919061177d565b50600160078054806001018281610b289190611884565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505060058060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507fbdf2d095118b35ed77302e18d5db303371ab8e69762dea74b3b96b8bddc781f98383604051808060200180602001838103835285818151815260200191508051906020019080838360005b83811015610c2f578082015181840152602081019050610c14565b50505050905090810190601f168015610c5c5780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b83811015610c95578082015181840152602081019050610c7a565b50505050905090810190601f168015610cc25780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a1505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d6757600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b565b610d716118b0565b6007805480602002602001604051908101604052809291908181526020018280548015610df357602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610da9575b5050505050905090565b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002016000828254019250508190555080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000828254019250508190555080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507f050cbab7fede968f252efba864c75069d68302f756e7f9c0093fb37faf2ba79b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000184600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000133600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015460405180888152602001806020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001868152602001806020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381038352898181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156111605780601f1061113557610100808354040283529160200191611160565b820191906000526020600020905b81548152906001019060200180831161114357829003601f168201915b50508381038252868181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156111e35780601f106111b8576101008083540402835291602001916111e3565b820191906000526020600020905b8154815290600101906020018083116111c657829003601f168201915b5050995050505050505050505060405180910390a15050565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508181600001908051906020019061125792919061177d565b50600081600101819055507f66ab3fea2083d9ba15d99b595186fe7fc18e6eba393c0fc056f420e96c3caa44826040518080602001828103825283818151815260200191508051906020019080838360005b838110156112c45780820151818401526020810190506112a9565b50505050905090810190601f1680156112f15780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b6006602052806000526040600020600091509050806000019080600101908060020154908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600401905085565b61135d6118c4565b60006113676118c4565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015433848054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561150a5780601f106114df5761010080835404028352916020019161150a565b820191906000526020600020905b8154815290600101906020018083116114ed57829003601f168201915b50505050509450828054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115a65780601f1061157b576101008083540402835291602001916115a6565b820191906000526020600020905b81548152906001019060200180831161158957829003601f168201915b50505050509250945094509450945094509091929394565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6115ec846111fc565b6115f5826108e5565b6115ff83826109e1565b50505050565b600560205280600052604060002060009150905080600001908060010154905082565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561168357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156116bf57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106117be57805160ff19168380011785556117ec565b828001600101855582156117ec579182015b828111156117eb5782518255916020019190600101906117d0565b5b5090506117f991906118d8565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106118365780548555611873565b8280016001018555821561187357600052602060002091601f016020900482015b82811115611872578254825591600101919060010190611857565b5b50905061188091906118d8565b5090565b8154818355818115116118ab578183600052602060002091820191016118aa91906118d8565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b6118fa91905b808211156118f65760008160009055506001016118de565b5090565b905600a165627a7a7230582064bb6b709ff92ac45497816404687cef18fdf549a72690d5f4e9f3de1ab516490029", - "sourceMap": "87:2656:0:-;;;419:7;401:25;;449:1;430:20;;486:49;;;;;;;;509:10:1;501:5;;:18;;;;;;;;;;;;;;;;;;520:10:0;512:5;;:18;;;;;;;;;;;;;;;;;;87:2656;;;;;;", - "deployedSourceMap": "87:2656:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;819:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1308:239;;;;;;;;;;;;;;;;;;1551:395;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2623:93;;;;;;;;;;;;;;2375: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;;;;;;;;;;;;;;;;;1950:421:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;846:154;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;769:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1004: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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2456:161:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;719:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;834:169:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;819:22:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1308:239::-;1402:6;1361:13;:25;1375:10;1361:25;;;;;;;;;;;;;;;:37;;;:47;;;;;;;;;;;1429:6;1414:11;;:21;;;;;;;;;;;1455:6;1441:10;;:20;;;;;;;;;;;1476:9;1467:5;;:18;;;;;;;;;;;1491:51;1504:13;:25;1518:10;1504:25;;;;;;;;;;;;;;;:37;;;1491:51;;;;;;;;;;;;;;;;;;1308:239;:::o;1551:395::-;1636:8;1647:13;:25;1661:10;1647:25;;;;;;;;;;;;;;;1636:36;;1689:3;1678:4;:8;;:14;;;;;;;;;;;;:::i;:::-;;1720:1;1698:4;:18;;;:23;;;;;;;;;;;1743:13;:25;1757:10;1743:25;;;;;;;;;;;;;;;:30;;1727:4;:13;;:46;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1792:10;1779:4;:10;;;:23;;;;;;;;;;;;;;;;;;1823:7;1808:4;:12;;:22;;;;;;;;;;;;:::i;:::-;;1861:1;1837:5;:22;;;;;;;;;;;:::i;:::-;;;;;;;;;;1848:10;1837:22;;;;;;;;;;;;;;;;;;;;;;:25;;1909:1;1868:13;:25;1882:10;1868:25;;;;;;;;;;;;;;;:37;;;:42;;;;;;;;;;;1916:25;1928:3;1933:7;1916:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1551:395:0;;;:::o;2623:93::-;2665:5;;;;;;;;;;;2651:19;;:10;:19;;;2647:63;;;2695:5;;;;;;;;;;;2682:19;;;2647:63;2623:93::o;2375:77::-;2416:9;;:::i;:::-;2442:5;2435:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2375:77;:::o;1950:421::-;2049:6;2008:13;:19;2022:4;2008:19;;;;;;;;;;;;;;;:33;;;:48;;;;;;;;;;;2097:6;2062:13;:19;2076:4;2062:19;;;;;;;;;;;;;;;:31;;;:41;;;;;;;;;;;2150:6;2109:13;:25;2123:10;2109:25;;;;;;;;;;;;;;;:37;;;:47;;;;;;;;;;;2162:204;2172:13;:19;2186:4;2172:19;;;;;;;;;;;;;;;:33;;;2213:13;:19;2227:4;2213:19;;;;;;;;;;;;;;;:24;;2239:4;2245:13;:19;2259:4;2245:19;;;;;;;;;;;;;;;:31;;;2284:13;:25;2298:10;2284:25;;;;;;;;;;;;;;;:30;;2316:10;2328:13;:25;2342:10;2328:25;;;;;;;;;;;;;;;:37;;;2162:204;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1950:421;;:::o;846:154::-;892:8;903:13;:25;917:10;903:25;;;;;;;;;;;;;;;892:36;;946:4;934;:9;;:16;;;;;;;;;;;;:::i;:::-;;975:1;956:4;:16;;:20;;;;982:13;990:4;982: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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;846:154:0;;:::o;769:46::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1004:273::-;1044:6;;:::i;:::-;1052:4;1058:6;;:::i;:::-;1066:3;1071:7;1094:13;:25;1108:10;1094:25;;;;;;;;;;;;;;;:30;;1132:13;:25;1146:10;1132:25;;;;;;;;;;;;;;;:37;;;1177:13;:25;1191:10;1177:25;;;;;;;;;;;;;;;:29;;1214:13;:25;1228:10;1214:25;;;;;;;;;;;;;;;:39;;;1261:10;1086:186;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1004:273;;;;;:::o;238:20:1:-;;;;;;;;;;;;;:::o;2456:161:0:-;2539:16;2550:4;2539:10;:16::i;:::-;2563:17;2573:6;2563:9;:17::i;:::-;2588:24;2599:3;2604:7;2588:10;:24::i;:::-;2456:161;;;;:::o;719: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:2656:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;:::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, string caption);\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 string caption;\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, string caption) 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 post.caption = caption;\n\n posts.push(msg.sender) -1;\n addressToUser[msg.sender].coinBalance -= 5;\n CreatedPost(url, caption);\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, string caption) public {\n createUser(name);\n buyTokens(amount);\n createPost(url, caption);\n }\n\n function kill() {\n if (msg.sender == owner) {\n selfdestruct(owner);\n }\n }\n\n function() payable {}\n}\n", + "bytecode": "0x6060604052620f42406001556000600255341561001b57600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555033600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611b3c806100ab6000396000f3006060604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630b1e7f83146100dd578063218ead0e146101405780633610724e1461016c578063392338f51461018457806341c0e1b51461022457806341f3004a1461023957806348351529146102a3578063507ffba5146102e55780635d9fa6fc14610342578063763f17c41461036b578063832880e7146105865780638da5cb5b146106c1578063d36a3e5e14610716578063edf5388614610802578063f2fde38b146108d8575b005b34156100e857600080fd5b6100fe6004808035906020019091905050610911565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561014b57600080fd5b61016a6004808035906020019091908035906020019091905050610950565b005b6101826004808035906020019091905050610aee565b005b341561018f57600080fd5b610222600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610bea565b005b341561022f57600080fd5b610237610edf565b005b341561024457600080fd5b61024c610f72565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561028f578082015181840152602081019050610274565b505050509050019250505060405180910390f35b34156102ae57600080fd5b6102e3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611006565b005b34156102f057600080fd5b610340600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611405565b005b341561034d57600080fd5b61035561150b565b6040518082815260200191505060405180910390f35b341561037657600080fd5b6103a2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611515565b6040518080602001806020018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018060200184810384528981815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561046b5780601f106104405761010080835404028352916020019161046b565b820191906000526020600020905b81548152906001019060200180831161044e57829003601f168201915b50508481038352888181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104ee5780601f106104c3576101008083540402835291602001916104ee565b820191906000526020600020905b8154815290600101906020018083116104d157829003601f168201915b50508481038252858181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156105715780601f1061054657610100808354040283529160200191610571565b820191906000526020600020905b81548152906001019060200180831161055457829003601f168201915b50509850505050505050505060405180910390f35b341561059157600080fd5b610599611568565b6040518080602001868152602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838103835288818151815260200191508051906020019080838360005b8381101561061b578082015181840152602081019050610600565b50505050905090810190601f1680156106485780820380516001836020036101000a031916815260200191505b50838103825286818151815260200191508051906020019080838360005b83811015610681578082015181840152602081019050610666565b50505050905090810190601f1680156106ae5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b34156106cc57600080fd5b6106d46117d1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561072157600080fd5b610800600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506117f6565b005b341561080d57600080fd5b610839600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611818565b60405180806020018381526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156108c85780601f1061089d576101008083540402835291602001916108c8565b820191906000526020600020905b8154815290600101906020018083116108ab57829003601f168201915b5050935050505060405180910390f35b34156108e357600080fd5b61090f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061183b565b005b60078181548110151561092057fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b80600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015411151561099d57fe5b80600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160008282540392505081905550816004600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501515610a3d57600080fd5b7f4c12d48f294572a29358d7265616951cb31b5e172f2242688869dfd2ec9ce5d8600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015433604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a15050565b80600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825401925050819055508060026000828254019250508190555080600160008282540392505081905550346004600082825401925050819055507ffe1367e498701f2dfab80a3d41740d46fd7cba533430e611917f0f3df823279a600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546040518082815260200191505060405180910390a150565b6000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905082816000019080519060200190610c45929190611990565b5060058160020160008282540392505081905550600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001816001019080546001816001161561010002031660029004610cbe929190611a10565b50338160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081816004019080519060200190610d1a929190611990565b50600160078054806001018281610d319190611a97565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505060058060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507fbdf2d095118b35ed77302e18d5db303371ab8e69762dea74b3b96b8bddc781f98383604051808060200180602001838103835285818151815260200191508051906020019080838360005b83811015610e38578082015181840152602081019050610e1d565b50505050905090810190601f168015610e655780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b83811015610e9e578082015181840152602081019050610e83565b50505050905090810190601f168015610ecb5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a1505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610f7057600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b565b610f7a611ac3565b6007805480602002602001604051908101604052809291908181526020018280548015610ffc57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610fb2575b5050505050905090565b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002016000828254019250508190555080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000828254019250508190555080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507f050cbab7fede968f252efba864c75069d68302f756e7f9c0093fb37faf2ba79b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000184600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000133600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015460405180888152602001806020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001868152602001806020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381038352898181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156113695780601f1061133e57610100808354040283529160200191611369565b820191906000526020600020905b81548152906001019060200180831161134c57829003601f168201915b50508381038252868181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156113ec5780601f106113c1576101008083540402835291602001916113ec565b820191906000526020600020905b8154815290600101906020018083116113cf57829003601f168201915b5050995050505050505050505060405180910390a15050565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905081816000019080519060200190611460929190611990565b50600081600101819055507f66ab3fea2083d9ba15d99b595186fe7fc18e6eba393c0fc056f420e96c3caa44826040518080602001828103825283818151815260200191508051906020019080838360005b838110156114cd5780820151818401526020810190506114b2565b50505050905090810190601f1680156114fa5780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b6000600454905090565b6006602052806000526040600020600091509050806000019080600101908060020154908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600401905085565b611570611ad7565b600061157a611ad7565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015433848054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561171d5780601f106116f25761010080835404028352916020019161171d565b820191906000526020600020905b81548152906001019060200180831161170057829003601f168201915b50505050509450828054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156117b95780601f1061178e576101008083540402835291602001916117b9565b820191906000526020600020905b81548152906001019060200180831161179c57829003601f168201915b50505050509250945094509450945094509091929394565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6117ff84611405565b61180882610aee565b6118128382610bea565b50505050565b600560205280600052604060002060009150905080600001908060010154905082565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561189657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156118d257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106119d157805160ff19168380011785556119ff565b828001600101855582156119ff579182015b828111156119fe5782518255916020019190600101906119e3565b5b509050611a0c9190611aeb565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611a495780548555611a86565b82800160010185558215611a8657600052602060002091601f016020900482015b82811115611a85578254825591600101919060010190611a6a565b5b509050611a939190611aeb565b5090565b815481835581811511611abe57818360005260206000209182019101611abd9190611aeb565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b611b0d91905b80821115611b09576000816000905550600101611af1565b5090565b905600a165627a7a72305820b3352d416397cf35b2efc9a0971010a70f22b22585b8799f9ca42376024f29b70029", + "deployedBytecode": "0x6060604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630b1e7f83146100dd578063218ead0e146101405780633610724e1461016c578063392338f51461018457806341c0e1b51461022457806341f3004a1461023957806348351529146102a3578063507ffba5146102e55780635d9fa6fc14610342578063763f17c41461036b578063832880e7146105865780638da5cb5b146106c1578063d36a3e5e14610716578063edf5388614610802578063f2fde38b146108d8575b005b34156100e857600080fd5b6100fe6004808035906020019091905050610911565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561014b57600080fd5b61016a6004808035906020019091908035906020019091905050610950565b005b6101826004808035906020019091905050610aee565b005b341561018f57600080fd5b610222600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610bea565b005b341561022f57600080fd5b610237610edf565b005b341561024457600080fd5b61024c610f72565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561028f578082015181840152602081019050610274565b505050509050019250505060405180910390f35b34156102ae57600080fd5b6102e3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611006565b005b34156102f057600080fd5b610340600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611405565b005b341561034d57600080fd5b61035561150b565b6040518082815260200191505060405180910390f35b341561037657600080fd5b6103a2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611515565b6040518080602001806020018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018060200184810384528981815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561046b5780601f106104405761010080835404028352916020019161046b565b820191906000526020600020905b81548152906001019060200180831161044e57829003601f168201915b50508481038352888181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104ee5780601f106104c3576101008083540402835291602001916104ee565b820191906000526020600020905b8154815290600101906020018083116104d157829003601f168201915b50508481038252858181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156105715780601f1061054657610100808354040283529160200191610571565b820191906000526020600020905b81548152906001019060200180831161055457829003601f168201915b50509850505050505050505060405180910390f35b341561059157600080fd5b610599611568565b6040518080602001868152602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838103835288818151815260200191508051906020019080838360005b8381101561061b578082015181840152602081019050610600565b50505050905090810190601f1680156106485780820380516001836020036101000a031916815260200191505b50838103825286818151815260200191508051906020019080838360005b83811015610681578082015181840152602081019050610666565b50505050905090810190601f1680156106ae5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b34156106cc57600080fd5b6106d46117d1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561072157600080fd5b610800600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506117f6565b005b341561080d57600080fd5b610839600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611818565b60405180806020018381526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156108c85780601f1061089d576101008083540402835291602001916108c8565b820191906000526020600020905b8154815290600101906020018083116108ab57829003601f168201915b5050935050505060405180910390f35b34156108e357600080fd5b61090f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061183b565b005b60078181548110151561092057fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b80600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015411151561099d57fe5b80600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160008282540392505081905550816004600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501515610a3d57600080fd5b7f4c12d48f294572a29358d7265616951cb31b5e172f2242688869dfd2ec9ce5d8600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015433604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a15050565b80600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825401925050819055508060026000828254019250508190555080600160008282540392505081905550346004600082825401925050819055507ffe1367e498701f2dfab80a3d41740d46fd7cba533430e611917f0f3df823279a600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546040518082815260200191505060405180910390a150565b6000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905082816000019080519060200190610c45929190611990565b5060058160020160008282540392505081905550600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001816001019080546001816001161561010002031660029004610cbe929190611a10565b50338160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081816004019080519060200190610d1a929190611990565b50600160078054806001018281610d319190611a97565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505060058060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507fbdf2d095118b35ed77302e18d5db303371ab8e69762dea74b3b96b8bddc781f98383604051808060200180602001838103835285818151815260200191508051906020019080838360005b83811015610e38578082015181840152602081019050610e1d565b50505050905090810190601f168015610e655780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b83811015610e9e578082015181840152602081019050610e83565b50505050905090810190601f168015610ecb5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a1505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610f7057600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b565b610f7a611ac3565b6007805480602002602001604051908101604052809291908181526020018280548015610ffc57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610fb2575b5050505050905090565b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002016000828254019250508190555080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000828254019250508190555080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507f050cbab7fede968f252efba864c75069d68302f756e7f9c0093fb37faf2ba79b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000184600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000133600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015460405180888152602001806020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001868152602001806020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381038352898181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156113695780601f1061133e57610100808354040283529160200191611369565b820191906000526020600020905b81548152906001019060200180831161134c57829003601f168201915b50508381038252868181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156113ec5780601f106113c1576101008083540402835291602001916113ec565b820191906000526020600020905b8154815290600101906020018083116113cf57829003601f168201915b5050995050505050505050505060405180910390a15050565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905081816000019080519060200190611460929190611990565b50600081600101819055507f66ab3fea2083d9ba15d99b595186fe7fc18e6eba393c0fc056f420e96c3caa44826040518080602001828103825283818151815260200191508051906020019080838360005b838110156114cd5780820151818401526020810190506114b2565b50505050905090810190601f1680156114fa5780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b6000600454905090565b6006602052806000526040600020600091509050806000019080600101908060020154908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600401905085565b611570611ad7565b600061157a611ad7565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015433848054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561171d5780601f106116f25761010080835404028352916020019161171d565b820191906000526020600020905b81548152906001019060200180831161170057829003601f168201915b50505050509450828054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156117b95780601f1061178e576101008083540402835291602001916117b9565b820191906000526020600020905b81548152906001019060200180831161179c57829003601f168201915b50505050509250945094509450945094509091929394565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6117ff84611405565b61180882610aee565b6118128382610bea565b50505050565b600560205280600052604060002060009150905080600001908060010154905082565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561189657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156118d257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106119d157805160ff19168380011785556119ff565b828001600101855582156119ff579182015b828111156119fe5782518255916020019190600101906119e3565b5b509050611a0c9190611aeb565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611a495780548555611a86565b82800160010185558215611a8657600052602060002091601f016020900482015b82811115611a85578254825591600101919060010190611a6a565b5b509050611a939190611aeb565b5090565b815481835581811511611abe57818360005260206000209182019101611abd9190611aeb565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b611b0d91905b80821115611b09576000816000905550600101611af1565b5090565b905600a165627a7a72305820b3352d416397cf35b2efc9a0971010a70f22b22585b8799f9ca42376024f29b70029", + "sourceMap": "87:3115:0:-;;;473:7;455:25;;503:1;484:20;;540:49;;;;;;;;509:10:1;501:5;;:18;;;;;;;;;;;;;;;;;;574:10:0;566:5;;:18;;;;;;;;;;;;;;;;;;87:3115;;;;;;", + "deployedSourceMap": "87:3115:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;873:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2675:319;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1362:239;;;;;;;;;;;;;;;;;;1605:395;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3082:93;;;;;;;;;;;;;;2429: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;;;;;;;;;;;;;;;;;2004:421:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;900:154;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2998:78;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;823:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1058: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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2510:161:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;773:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;834:169:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;873:22:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;2675:319::-;2787:10;2747:13;:25;2761:10;2747:25;;;;;;;;;;;;;;;:37;;;:50;2740:58;;;;;;2847:10;2806:13;:25;2820:10;2806:25;;;;;;;;;;;;;;;:37;;;:51;;;;;;;;;;;2874:9;2865:5;;:18;;;;;;;;;;;2891:10;:19;;:30;2911:9;2891:30;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2929:60;2939:13;:25;2953:10;2939:25;;;;;;;;;;;;;;;:37;;;2978:10;2929:60;;;;;;;;;;;;;;;;;;;;;;;;;;;;2675:319;;:::o;1362:239::-;1456:6;1415:13;:25;1429:10;1415:25;;;;;;;;;;;;;;;:37;;;:47;;;;;;;;;;;1483:6;1468:11;;:21;;;;;;;;;;;1509:6;1495:10;;:20;;;;;;;;;;;1530:9;1521:5;;:18;;;;;;;;;;;1545:51;1558:13;:25;1572:10;1558:25;;;;;;;;;;;;;;;:37;;;1545:51;;;;;;;;;;;;;;;;;;1362:239;:::o;1605:395::-;1690:8;1701:13;:25;1715:10;1701:25;;;;;;;;;;;;;;;1690:36;;1743:3;1732:4;:8;;:14;;;;;;;;;;;;:::i;:::-;;1774:1;1752:4;:18;;;:23;;;;;;;;;;;1797:13;:25;1811:10;1797:25;;;;;;;;;;;;;;;:30;;1781:4;:13;;:46;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1846:10;1833:4;:10;;;:23;;;;;;;;;;;;;;;;;;1877:7;1862:4;:12;;:22;;;;;;;;;;;;:::i;:::-;;1915:1;1891:5;:22;;;;;;;;;;;:::i;:::-;;;;;;;;;;1902:10;1891:22;;;;;;;;;;;;;;;;;;;;;;:25;;1963:1;1922:13;:25;1936:10;1922:25;;;;;;;;;;;;;;;:37;;;:42;;;;;;;;;;;1970:25;1982:3;1987:7;1970:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1605:395:0;;;:::o;3082:93::-;3124:5;;;;;;;;;;;3110:19;;:10;:19;;;3106:63;;;3154:5;;;;;;;;;;;3141:19;;;3106:63;3082:93::o;2429:77::-;2470:9;;:::i;:::-;2496:5;2489:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2429:77;:::o;2004:421::-;2103:6;2062:13;:19;2076:4;2062:19;;;;;;;;;;;;;;;:33;;;:48;;;;;;;;;;;2151:6;2116:13;:19;2130:4;2116:19;;;;;;;;;;;;;;;:31;;;:41;;;;;;;;;;;2204:6;2163:13;:25;2177:10;2163:25;;;;;;;;;;;;;;;:37;;;:47;;;;;;;;;;;2216:204;2226:13;:19;2240:4;2226:19;;;;;;;;;;;;;;;:33;;;2267:13;:19;2281:4;2267:19;;;;;;;;;;;;;;;:24;;2293:4;2299:13;:19;2313:4;2299:19;;;;;;;;;;;;;;;:31;;;2338:13;:25;2352:10;2338:25;;;;;;;;;;;;;;;:30;;2370:10;2382:13;:25;2396:10;2382:25;;;;;;;;;;;;;;;:37;;;2216:204;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2004:421;;:::o;900:154::-;946:8;957:13;:25;971:10;957:25;;;;;;;;;;;;;;;946:36;;1000:4;988;:9;;:16;;;;;;;;;;;;:::i;:::-;;1029:1;1010:4;:16;;:20;;;;1036:13;1044:4;1036: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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;900:154:0;;:::o;2998:78::-;3045:4;3066:5;;3059:12;;2998:78;:::o;823:46::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1058:273::-;1098:6;;:::i;:::-;1106:4;1112:6;;:::i;:::-;1120:3;1125:7;1148:13;:25;1162:10;1148:25;;;;;;;;;;;;;;;:30;;1186:13;:25;1200:10;1186:25;;;;;;;;;;;;;;;:37;;;1231:13;:25;1245:10;1231:25;;;;;;;;;;;;;;;:29;;1268:13;:25;1282:10;1268:25;;;;;;;;;;;;;;;:39;;;1315:10;1140:186;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1058:273;;;;;:::o;238:20:1:-;;;;;;;;;;;;;:::o;2510:161:0:-;2593:16;2604:4;2593:10;:16::i;:::-;2617:17;2627:6;2617:9;:17::i;:::-;2642:24;2653:3;2658:7;2642:10;:24::i;:::-;2510:161;;;;:::o;773: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:3115:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;:::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, string caption);\n event LikedPost(int lotteryAmount, string posterName,\n address poster, uint posterCoinbalance, string likerName,\n address liker, uint likerCoinbalance);\n event CashedOut(uint newCoinbalance, address user);\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 string caption;\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, string caption) 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 post.caption = caption;\n\n posts.push(msg.sender) -1;\n addressToUser[msg.sender].coinBalance -= 5;\n CreatedPost(url, caption);\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, string caption) public {\n createUser(name);\n buyTokens(amount);\n createPost(url, caption);\n }\n\n function cashOut(uint weiAmount, uint coinAmount) public {\n assert(addressToUser[msg.sender].coinBalance > coinAmount);\n addressToUser[msg.sender].coinBalance -= coinAmount;\n value -= weiAmount;\n msg.sender.transfer(weiAmount);\n CashedOut(addressToUser[msg.sender].coinBalance, msg.sender);\n }\n\n function getContractBal() public view returns (uint) {\n return value;\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": [ - 365 + 427 ] } }, @@ -392,10 +441,10 @@ }, { "attributes": { - "SourceUnit": 422, + "SourceUnit": 484, "absolutePath": "zeppelin-solidity/contracts/ownership/Ownable.sol", "file": "zeppelin-solidity/contracts/ownership/Ownable.sol", - "scope": 366, + "scope": 428, "symbolAliases": [ null ], @@ -408,17 +457,17 @@ { "attributes": { "contractDependencies": [ - 421 + 483 ], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "linearizedBaseContracts": [ - 365, - 421 + 427, + 483 ], "name": "CapCoin", - "scope": 366 + "scope": 428 }, "children": [ { @@ -432,7 +481,7 @@ "attributes": { "contractScope": null, "name": "Ownable", - "referencedDeclaration": 421, + "referencedDeclaration": 483, "type": "contract Ownable" }, "id": 3, @@ -813,11 +862,83 @@ "name": "EventDefinition", "src": "239:158:0" }, + { + "attributes": { + "anonymous": false, + "name": "CashedOut" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "indexed": false, + "name": "newCoinbalance", + "scope": 40, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 35, + "name": "ElementaryTypeName", + "src": "416:4:0" + } + ], + "id": 36, + "name": "VariableDeclaration", + "src": "416:19:0" + }, + { + "attributes": { + "constant": false, + "indexed": false, + "name": "user", + "scope": 40, + "stateVariable": false, + "storageLocation": "default", + "type": "address", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "address", + "type": "address" + }, + "id": 37, + "name": "ElementaryTypeName", + "src": "437:7:0" + } + ], + "id": 38, + "name": "VariableDeclaration", + "src": "437:12:0" + } + ], + "id": 39, + "name": "ParameterList", + "src": "415:35:0" + } + ], + "id": 40, + "name": "EventDefinition", + "src": "400:51:0" + }, { "attributes": { "constant": false, "name": "coinSupply", - "scope": 365, + "scope": 427, "stateVariable": true, "storageLocation": "default", "type": "uint256", @@ -829,9 +950,9 @@ "name": "uint", "type": "uint256" }, - "id": 35, + "id": 41, "name": "ElementaryTypeName", - "src": "401:4:0" + "src": "455:4:0" }, { "attributes": { @@ -846,20 +967,20 @@ "type": "int_const 1000000", "value": "1000000" }, - "id": 36, + "id": 42, "name": "Literal", - "src": "419:7:0" + "src": "473:7:0" } ], - "id": 37, + "id": 43, "name": "VariableDeclaration", - "src": "401:25:0" + "src": "455:25:0" }, { "attributes": { "constant": false, "name": "coinsBought", - "scope": 365, + "scope": 427, "stateVariable": true, "storageLocation": "default", "type": "uint256", @@ -871,9 +992,9 @@ "name": "uint", "type": "uint256" }, - "id": 38, + "id": 44, "name": "ElementaryTypeName", - "src": "430:4:0" + "src": "484:4:0" }, { "attributes": { @@ -888,20 +1009,20 @@ "type": "int_const 0", "value": "0" }, - "id": 39, + "id": 45, "name": "Literal", - "src": "449:1:0" + "src": "503:1:0" } ], - "id": 40, + "id": 46, "name": "VariableDeclaration", - "src": "430:20:0" + "src": "484:20:0" }, { "attributes": { "constant": false, "name": "owner", - "scope": 365, + "scope": 427, "stateVariable": true, "storageLocation": "default", "type": "address", @@ -914,20 +1035,20 @@ "name": "address", "type": "address" }, - "id": 41, + "id": 47, "name": "ElementaryTypeName", - "src": "454:7:0" + "src": "508:7:0" } ], - "id": 42, + "id": 48, "name": "VariableDeclaration", - "src": "454:13:0" + "src": "508:13:0" }, { "attributes": { "constant": false, "name": "value", - "scope": 365, + "scope": 427, "stateVariable": true, "storageLocation": "default", "type": "uint256", @@ -940,14 +1061,14 @@ "name": "uint", "type": "uint256" }, - "id": 43, + "id": 49, "name": "ElementaryTypeName", - "src": "471:4:0" + "src": "525:4:0" } ], - "id": 44, + "id": 50, "name": "VariableDeclaration", - "src": "471:10:0" + "src": "525:10:0" }, { "attributes": { @@ -959,7 +1080,7 @@ ], "name": "CapCoin", "payable": false, - "scope": 365, + "scope": 427, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -972,9 +1093,9 @@ ] }, "children": [], - "id": 45, + "id": 51, "name": "ParameterList", - "src": "503:2:0" + "src": "557:2:0" }, { "attributes": { @@ -983,9 +1104,9 @@ ] }, "children": [], - "id": 46, + "id": 52, "name": "ParameterList", - "src": "506:0:0" + "src": "560:0:0" }, { "children": [ @@ -1008,13 +1129,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 42, + "referencedDeclaration": 48, "type": "address", "value": "owner" }, - "id": 47, + "id": 53, "name": "Identifier", - "src": "512:5:0" + "src": "566:5:0" }, { "attributes": { @@ -1034,44 +1155,44 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 433, + "referencedDeclaration": 495, "type": "msg", "value": "msg" }, - "id": 48, + "id": 54, "name": "Identifier", - "src": "520:3:0" + "src": "574:3:0" } ], - "id": 49, + "id": 55, "name": "MemberAccess", - "src": "520:10:0" + "src": "574:10:0" } ], - "id": 50, + "id": 56, "name": "Assignment", - "src": "512:18:0" + "src": "566:18:0" } ], - "id": 51, + "id": 57, "name": "ExpressionStatement", - "src": "512:18:0" + "src": "566:18:0" } ], - "id": 52, + "id": 58, "name": "Block", - "src": "506:29:0" + "src": "560:29:0" } ], - "id": 53, + "id": 59, "name": "FunctionDefinition", - "src": "486:49:0" + "src": "540:49:0" }, { "attributes": { "canonicalName": "CapCoin.User", "name": "User", - "scope": 365, + "scope": 427, "visibility": "public" }, "children": [ @@ -1079,7 +1200,7 @@ "attributes": { "constant": false, "name": "name", - "scope": 58, + "scope": 64, "stateVariable": false, "storageLocation": "default", "type": "string storage pointer", @@ -1092,20 +1213,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 54, + "id": 60, "name": "ElementaryTypeName", - "src": "557:6:0" + "src": "611:6:0" } ], - "id": 55, + "id": 61, "name": "VariableDeclaration", - "src": "557:11:0" + "src": "611:11:0" }, { "attributes": { "constant": false, "name": "coinBalance", - "scope": 58, + "scope": 64, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -1118,25 +1239,25 @@ "name": "uint", "type": "uint256" }, - "id": 56, + "id": 62, "name": "ElementaryTypeName", - "src": "574:4:0" + "src": "628:4:0" } ], - "id": 57, + "id": 63, "name": "VariableDeclaration", - "src": "574:16:0" + "src": "628:16:0" } ], - "id": 58, + "id": 64, "name": "StructDefinition", - "src": "539:56:0" + "src": "593:56:0" }, { "attributes": { "canonicalName": "CapCoin.Post", "name": "Post", - "scope": 365, + "scope": 427, "visibility": "public" }, "children": [ @@ -1144,7 +1265,7 @@ "attributes": { "constant": false, "name": "url", - "scope": 69, + "scope": 75, "stateVariable": false, "storageLocation": "default", "type": "string storage pointer", @@ -1157,20 +1278,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 59, + "id": 65, "name": "ElementaryTypeName", - "src": "617:6:0" + "src": "671:6:0" } ], - "id": 60, + "id": 66, "name": "VariableDeclaration", - "src": "617:10:0" + "src": "671:10:0" }, { "attributes": { "constant": false, "name": "userName", - "scope": 69, + "scope": 75, "stateVariable": false, "storageLocation": "default", "type": "string storage pointer", @@ -1183,20 +1304,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 61, + "id": 67, "name": "ElementaryTypeName", - "src": "633:6:0" + "src": "687:6:0" } ], - "id": 62, + "id": 68, "name": "VariableDeclaration", - "src": "633:15:0" + "src": "687:15:0" }, { "attributes": { "constant": false, "name": "lotteryAmount", - "scope": 69, + "scope": 75, "stateVariable": false, "storageLocation": "default", "type": "int256", @@ -1209,20 +1330,20 @@ "name": "int", "type": "int256" }, - "id": 63, + "id": 69, "name": "ElementaryTypeName", - "src": "654:3:0" + "src": "708:3:0" } ], - "id": 64, + "id": 70, "name": "VariableDeclaration", - "src": "654:17:0" + "src": "708:17:0" }, { "attributes": { "constant": false, "name": "owner", - "scope": 69, + "scope": 75, "stateVariable": false, "storageLocation": "default", "type": "address", @@ -1235,20 +1356,20 @@ "name": "address", "type": "address" }, - "id": 65, + "id": 71, "name": "ElementaryTypeName", - "src": "677:7:0" + "src": "731:7:0" } ], - "id": 66, + "id": 72, "name": "VariableDeclaration", - "src": "677:13:0" + "src": "731:13:0" }, { "attributes": { "constant": false, "name": "caption", - "scope": 69, + "scope": 75, "stateVariable": false, "storageLocation": "default", "type": "string storage pointer", @@ -1261,25 +1382,25 @@ "name": "string", "type": "string storage pointer" }, - "id": 67, + "id": 73, "name": "ElementaryTypeName", - "src": "696:6:0" + "src": "750:6:0" } ], - "id": 68, + "id": 74, "name": "VariableDeclaration", - "src": "696:14:0" + "src": "750:14:0" } ], - "id": 69, + "id": 75, "name": "StructDefinition", - "src": "599:116:0" + "src": "653:116:0" }, { "attributes": { "constant": false, "name": "addressToUser", - "scope": 365, + "scope": 427, "stateVariable": true, "storageLocation": "default", "type": "mapping(address => struct CapCoin.User storage ref)", @@ -1297,36 +1418,36 @@ "name": "address", "type": "address" }, - "id": 70, + "id": 76, "name": "ElementaryTypeName", - "src": "728:7:0" + "src": "782:7:0" }, { "attributes": { "contractScope": null, "name": "User", - "referencedDeclaration": 58, + "referencedDeclaration": 64, "type": "struct CapCoin.User storage pointer" }, - "id": 71, + "id": 77, "name": "UserDefinedTypeName", - "src": "739:4:0" + "src": "793:4:0" } ], - "id": 72, + "id": 78, "name": "Mapping", - "src": "719:25:0" + "src": "773:25:0" } ], - "id": 73, + "id": 79, "name": "VariableDeclaration", - "src": "719:46:0" + "src": "773:46:0" }, { "attributes": { "constant": false, "name": "addressToPost", - "scope": 365, + "scope": 427, "stateVariable": true, "storageLocation": "default", "type": "mapping(address => struct CapCoin.Post storage ref)", @@ -1344,36 +1465,36 @@ "name": "address", "type": "address" }, - "id": 74, + "id": 80, "name": "ElementaryTypeName", - "src": "778:7:0" + "src": "832:7:0" }, { "attributes": { "contractScope": null, "name": "Post", - "referencedDeclaration": 69, + "referencedDeclaration": 75, "type": "struct CapCoin.Post storage pointer" }, - "id": 75, + "id": 81, "name": "UserDefinedTypeName", - "src": "789:4:0" + "src": "843:4:0" } ], - "id": 76, + "id": 82, "name": "Mapping", - "src": "769:25:0" + "src": "823:25:0" } ], - "id": 77, + "id": 83, "name": "VariableDeclaration", - "src": "769:46:0" + "src": "823:46:0" }, { "attributes": { "constant": false, "name": "posts", - "scope": 365, + "scope": 427, "stateVariable": true, "storageLocation": "default", "type": "address[] storage ref", @@ -1392,19 +1513,19 @@ "name": "address", "type": "address" }, - "id": 78, + "id": 84, "name": "ElementaryTypeName", - "src": "819:7:0" + "src": "873:7:0" } ], - "id": 79, + "id": 85, "name": "ArrayTypeName", - "src": "819:9:0" + "src": "873:9:0" } ], - "id": 80, + "id": 86, "name": "VariableDeclaration", - "src": "819:22:0" + "src": "873:22:0" }, { "attributes": { @@ -1416,7 +1537,7 @@ ], "name": "createUser", "payable": false, - "scope": 365, + "scope": 427, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -1428,7 +1549,7 @@ "attributes": { "constant": false, "name": "name", - "scope": 108, + "scope": 114, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -1441,19 +1562,19 @@ "name": "string", "type": "string storage pointer" }, - "id": 81, + "id": 87, "name": "ElementaryTypeName", - "src": "866:6:0" + "src": "920:6:0" } ], - "id": 82, + "id": 88, "name": "VariableDeclaration", - "src": "866:11:0" + "src": "920:11:0" } ], - "id": 83, + "id": 89, "name": "ParameterList", - "src": "865:13:0" + "src": "919:13:0" }, { "attributes": { @@ -1462,16 +1583,16 @@ ] }, "children": [], - "id": 84, + "id": 90, "name": "ParameterList", - "src": "886:0:0" + "src": "940:0:0" }, { "children": [ { "attributes": { "assignments": [ - 85 + 91 ] }, "children": [ @@ -1479,7 +1600,7 @@ "attributes": { "constant": false, "name": "user", - "scope": 108, + "scope": 114, "stateVariable": false, "storageLocation": "default", "type": "struct CapCoin.User storage pointer", @@ -1488,9 +1609,9 @@ "visibility": "internal" }, "children": [], - "id": 85, + "id": 91, "name": "VariableDeclaration", - "src": "892:8:0" + "src": "946:8:0" }, { "attributes": { @@ -1508,13 +1629,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 73, + "referencedDeclaration": 79, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 86, + "id": 92, "name": "Identifier", - "src": "903:13:0" + "src": "957:13:0" }, { "attributes": { @@ -1534,28 +1655,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 433, + "referencedDeclaration": 495, "type": "msg", "value": "msg" }, - "id": 87, + "id": 93, "name": "Identifier", - "src": "917:3:0" + "src": "971:3:0" } ], - "id": 88, + "id": 94, "name": "MemberAccess", - "src": "917:10:0" + "src": "971:10:0" } ], - "id": 89, + "id": 95, "name": "IndexAccess", - "src": "903:25:0" + "src": "957:25:0" } ], - "id": 90, + "id": 96, "name": "VariableDeclarationStatement", - "src": "892:36:0" + "src": "946:36:0" }, { "children": [ @@ -1578,7 +1699,7 @@ "isPure": false, "lValueRequested": true, "member_name": "name", - "referencedDeclaration": 55, + "referencedDeclaration": 61, "type": "string storage ref" }, "children": [ @@ -1588,18 +1709,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 85, + "referencedDeclaration": 91, "type": "struct CapCoin.User storage pointer", "value": "user" }, - "id": 91, + "id": 97, "name": "Identifier", - "src": "934:4:0" + "src": "988:4:0" } ], - "id": 93, + "id": 99, "name": "MemberAccess", - "src": "934:9:0" + "src": "988:9:0" }, { "attributes": { @@ -1607,23 +1728,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 82, + "referencedDeclaration": 88, "type": "string memory", "value": "name" }, - "id": 94, + "id": 100, "name": "Identifier", - "src": "946:4:0" + "src": "1000:4:0" } ], - "id": 95, + "id": 101, "name": "Assignment", - "src": "934:16:0" + "src": "988:16:0" } ], - "id": 96, + "id": 102, "name": "ExpressionStatement", - "src": "934:16:0" + "src": "988:16:0" }, { "children": [ @@ -1646,7 +1767,7 @@ "isPure": false, "lValueRequested": true, "member_name": "coinBalance", - "referencedDeclaration": 57, + "referencedDeclaration": 63, "type": "uint256" }, "children": [ @@ -1656,18 +1777,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 85, + "referencedDeclaration": 91, "type": "struct CapCoin.User storage pointer", "value": "user" }, - "id": 97, + "id": 103, "name": "Identifier", - "src": "956:4:0" + "src": "1010:4:0" } ], - "id": 99, + "id": 105, "name": "MemberAccess", - "src": "956:16:0" + "src": "1010:16:0" }, { "attributes": { @@ -1682,19 +1803,19 @@ "type": "int_const 0", "value": "0" }, - "id": 100, + "id": 106, "name": "Literal", - "src": "975:1:0" + "src": "1029:1:0" } ], - "id": 101, + "id": 107, "name": "Assignment", - "src": "956:20:0" + "src": "1010:20:0" } ], - "id": 102, + "id": 108, "name": "ExpressionStatement", - "src": "956:20:0" + "src": "1010:20:0" }, { "children": [ @@ -1728,9 +1849,9 @@ "type": "function (string memory)", "value": "NewUser" }, - "id": 103, + "id": 109, "name": "Identifier", - "src": "982:7:0" + "src": "1036:7:0" }, { "attributes": { @@ -1738,33 +1859,33 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 82, + "referencedDeclaration": 88, "type": "string memory", "value": "name" }, - "id": 104, + "id": 110, "name": "Identifier", - "src": "990:4:0" + "src": "1044:4:0" } ], - "id": 105, + "id": 111, "name": "FunctionCall", - "src": "982:13:0" + "src": "1036:13:0" } ], - "id": 106, + "id": 112, "name": "ExpressionStatement", - "src": "982:13:0" + "src": "1036:13:0" } ], - "id": 107, + "id": 113, "name": "Block", - "src": "886:114:0" + "src": "940:114:0" } ], - "id": 108, + "id": 114, "name": "FunctionDefinition", - "src": "846:154:0" + "src": "900:154:0" }, { "attributes": { @@ -1776,7 +1897,7 @@ ], "name": "getUser", "payable": false, - "scope": 365, + "scope": 427, "stateMutability": "view", "superFunction": null, "visibility": "public" @@ -1789,9 +1910,9 @@ ] }, "children": [], - "id": 109, + "id": 115, "name": "ParameterList", - "src": "1020:2:0" + "src": "1074:2:0" }, { "children": [ @@ -1799,7 +1920,7 @@ "attributes": { "constant": false, "name": "", - "scope": 146, + "scope": 152, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -1812,20 +1933,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 110, + "id": 116, "name": "ElementaryTypeName", - "src": "1044:6:0" + "src": "1098:6:0" } ], - "id": 111, + "id": 117, "name": "VariableDeclaration", - "src": "1044:6:0" + "src": "1098:6:0" }, { "attributes": { "constant": false, "name": "", - "scope": 146, + "scope": 152, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -1838,20 +1959,20 @@ "name": "uint", "type": "uint256" }, - "id": 112, + "id": 118, "name": "ElementaryTypeName", - "src": "1052:4:0" + "src": "1106:4:0" } ], - "id": 113, + "id": 119, "name": "VariableDeclaration", - "src": "1052:4:0" + "src": "1106:4:0" }, { "attributes": { "constant": false, "name": "", - "scope": 146, + "scope": 152, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -1864,20 +1985,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 114, + "id": 120, "name": "ElementaryTypeName", - "src": "1058:6:0" + "src": "1112:6:0" } ], - "id": 115, + "id": 121, "name": "VariableDeclaration", - "src": "1058:6:0" + "src": "1112:6:0" }, { "attributes": { "constant": false, "name": "", - "scope": 146, + "scope": 152, "stateVariable": false, "storageLocation": "default", "type": "int256", @@ -1890,20 +2011,20 @@ "name": "int", "type": "int256" }, - "id": 116, + "id": 122, "name": "ElementaryTypeName", - "src": "1066:3:0" + "src": "1120:3:0" } ], - "id": 117, + "id": 123, "name": "VariableDeclaration", - "src": "1066:3:0" + "src": "1120:3:0" }, { "attributes": { "constant": false, "name": "", - "scope": 146, + "scope": 152, "stateVariable": false, "storageLocation": "default", "type": "address", @@ -1916,25 +2037,25 @@ "name": "address", "type": "address" }, - "id": 118, + "id": 124, "name": "ElementaryTypeName", - "src": "1071:7:0" + "src": "1125:7:0" } ], - "id": 119, + "id": 125, "name": "VariableDeclaration", - "src": "1071:7:0" + "src": "1125:7:0" } ], - "id": 120, + "id": 126, "name": "ParameterList", - "src": "1043:36:0" + "src": "1097:36:0" }, { "children": [ { "attributes": { - "functionReturnParameters": 120 + "functionReturnParameters": 126 }, "children": [ { @@ -1956,7 +2077,7 @@ "isPure": false, "lValueRequested": false, "member_name": "name", - "referencedDeclaration": 55, + "referencedDeclaration": 61, "type": "string storage ref" }, "children": [ @@ -1976,13 +2097,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 73, + "referencedDeclaration": 79, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 121, + "id": 127, "name": "Identifier", - "src": "1094:13:0" + "src": "1148:13:0" }, { "attributes": { @@ -2002,28 +2123,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 433, + "referencedDeclaration": 495, "type": "msg", "value": "msg" }, - "id": 122, + "id": 128, "name": "Identifier", - "src": "1108:3:0" + "src": "1162:3:0" } ], - "id": 123, + "id": 129, "name": "MemberAccess", - "src": "1108:10:0" + "src": "1162:10:0" } ], - "id": 124, + "id": 130, "name": "IndexAccess", - "src": "1094:25:0" + "src": "1148:25:0" } ], - "id": 125, + "id": 131, "name": "MemberAccess", - "src": "1094:30:0" + "src": "1148:30:0" }, { "attributes": { @@ -2033,7 +2154,7 @@ "isPure": false, "lValueRequested": false, "member_name": "coinBalance", - "referencedDeclaration": 57, + "referencedDeclaration": 63, "type": "uint256" }, "children": [ @@ -2053,13 +2174,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 73, + "referencedDeclaration": 79, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 126, + "id": 132, "name": "Identifier", - "src": "1132:13:0" + "src": "1186:13:0" }, { "attributes": { @@ -2079,28 +2200,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 433, + "referencedDeclaration": 495, "type": "msg", "value": "msg" }, - "id": 127, + "id": 133, "name": "Identifier", - "src": "1146:3:0" + "src": "1200:3:0" } ], - "id": 128, + "id": 134, "name": "MemberAccess", - "src": "1146:10:0" + "src": "1200:10:0" } ], - "id": 129, + "id": 135, "name": "IndexAccess", - "src": "1132:25:0" + "src": "1186:25:0" } ], - "id": 130, + "id": 136, "name": "MemberAccess", - "src": "1132:37:0" + "src": "1186:37:0" }, { "attributes": { @@ -2110,7 +2231,7 @@ "isPure": false, "lValueRequested": false, "member_name": "url", - "referencedDeclaration": 60, + "referencedDeclaration": 66, "type": "string storage ref" }, "children": [ @@ -2130,13 +2251,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 77, + "referencedDeclaration": 83, "type": "mapping(address => struct CapCoin.Post storage ref)", "value": "addressToPost" }, - "id": 131, + "id": 137, "name": "Identifier", - "src": "1177:13:0" + "src": "1231:13:0" }, { "attributes": { @@ -2156,28 +2277,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 433, + "referencedDeclaration": 495, "type": "msg", "value": "msg" }, - "id": 132, + "id": 138, "name": "Identifier", - "src": "1191:3:0" + "src": "1245:3:0" } ], - "id": 133, + "id": 139, "name": "MemberAccess", - "src": "1191:10:0" + "src": "1245:10:0" } ], - "id": 134, + "id": 140, "name": "IndexAccess", - "src": "1177:25:0" + "src": "1231:25:0" } ], - "id": 135, + "id": 141, "name": "MemberAccess", - "src": "1177:29:0" + "src": "1231:29:0" }, { "attributes": { @@ -2187,7 +2308,7 @@ "isPure": false, "lValueRequested": false, "member_name": "lotteryAmount", - "referencedDeclaration": 64, + "referencedDeclaration": 70, "type": "int256" }, "children": [ @@ -2207,13 +2328,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 77, + "referencedDeclaration": 83, "type": "mapping(address => struct CapCoin.Post storage ref)", "value": "addressToPost" }, - "id": 136, + "id": 142, "name": "Identifier", - "src": "1214:13:0" + "src": "1268:13:0" }, { "attributes": { @@ -2233,28 +2354,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 433, + "referencedDeclaration": 495, "type": "msg", "value": "msg" }, - "id": 137, + "id": 143, "name": "Identifier", - "src": "1228:3:0" + "src": "1282:3:0" } ], - "id": 138, + "id": 144, "name": "MemberAccess", - "src": "1228:10:0" + "src": "1282:10:0" } ], - "id": 139, + "id": 145, "name": "IndexAccess", - "src": "1214:25:0" + "src": "1268:25:0" } ], - "id": 140, + "id": 146, "name": "MemberAccess", - "src": "1214:39:0" + "src": "1268:39:0" }, { "attributes": { @@ -2274,38 +2395,38 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 433, + "referencedDeclaration": 495, "type": "msg", "value": "msg" }, - "id": 141, + "id": 147, "name": "Identifier", - "src": "1261:3:0" + "src": "1315:3:0" } ], - "id": 142, + "id": 148, "name": "MemberAccess", - "src": "1261:10:0" + "src": "1315:10:0" } ], - "id": 143, + "id": 149, "name": "TupleExpression", - "src": "1093:179:0" + "src": "1147:179:0" } ], - "id": 144, + "id": 150, "name": "Return", - "src": "1086:186:0" + "src": "1140:186:0" } ], - "id": 145, + "id": 151, "name": "Block", - "src": "1080:197:0" + "src": "1134:197:0" } ], - "id": 146, + "id": 152, "name": "FunctionDefinition", - "src": "1004:273:0" + "src": "1058:273:0" }, { "attributes": { @@ -2317,7 +2438,7 @@ ], "name": "buyTokens", "payable": true, - "scope": 365, + "scope": 427, "stateMutability": "payable", "superFunction": null, "visibility": "public" @@ -2329,7 +2450,7 @@ "attributes": { "constant": false, "name": "amount", - "scope": 181, + "scope": 187, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -2342,19 +2463,19 @@ "name": "uint", "type": "uint256" }, - "id": 147, + "id": 153, "name": "ElementaryTypeName", - "src": "1327:4:0" + "src": "1381:4:0" } ], - "id": 148, + "id": 154, "name": "VariableDeclaration", - "src": "1327:11:0" + "src": "1381:11:0" } ], - "id": 149, + "id": 155, "name": "ParameterList", - "src": "1326:13:0" + "src": "1380:13:0" }, { "attributes": { @@ -2363,9 +2484,9 @@ ] }, "children": [], - "id": 150, + "id": 156, "name": "ParameterList", - "src": "1355:0:0" + "src": "1409:0:0" }, { "children": [ @@ -2390,7 +2511,7 @@ "isPure": false, "lValueRequested": true, "member_name": "coinBalance", - "referencedDeclaration": 57, + "referencedDeclaration": 63, "type": "uint256" }, "children": [ @@ -2410,13 +2531,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 73, + "referencedDeclaration": 79, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 151, + "id": 157, "name": "Identifier", - "src": "1361:13:0" + "src": "1415:13:0" }, { "attributes": { @@ -2436,28 +2557,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 433, + "referencedDeclaration": 495, "type": "msg", "value": "msg" }, - "id": 152, + "id": 158, "name": "Identifier", - "src": "1375:3:0" + "src": "1429:3:0" } ], - "id": 153, + "id": 159, "name": "MemberAccess", - "src": "1375:10:0" + "src": "1429:10:0" } ], - "id": 154, + "id": 160, "name": "IndexAccess", - "src": "1361:25:0" + "src": "1415:25:0" } ], - "id": 155, + "id": 161, "name": "MemberAccess", - "src": "1361:37:0" + "src": "1415:37:0" }, { "attributes": { @@ -2465,23 +2586,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 148, + "referencedDeclaration": 154, "type": "uint256", "value": "amount" }, - "id": 156, + "id": 162, "name": "Identifier", - "src": "1402:6:0" + "src": "1456:6:0" } ], - "id": 157, + "id": 163, "name": "Assignment", - "src": "1361:47:0" + "src": "1415:47:0" } ], - "id": 158, + "id": 164, "name": "ExpressionStatement", - "src": "1361:47:0" + "src": "1415:47:0" }, { "children": [ @@ -2502,13 +2623,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 40, + "referencedDeclaration": 46, "type": "uint256", "value": "coinsBought" }, - "id": 159, + "id": 165, "name": "Identifier", - "src": "1414:11:0" + "src": "1468:11:0" }, { "attributes": { @@ -2516,23 +2637,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 148, + "referencedDeclaration": 154, "type": "uint256", "value": "amount" }, - "id": 160, + "id": 166, "name": "Identifier", - "src": "1429:6:0" + "src": "1483:6:0" } ], - "id": 161, + "id": 167, "name": "Assignment", - "src": "1414:21:0" + "src": "1468:21:0" } ], - "id": 162, + "id": 168, "name": "ExpressionStatement", - "src": "1414:21:0" + "src": "1468:21:0" }, { "children": [ @@ -2553,13 +2674,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 37, + "referencedDeclaration": 43, "type": "uint256", "value": "coinSupply" }, - "id": 163, + "id": 169, "name": "Identifier", - "src": "1441:10:0" + "src": "1495:10:0" }, { "attributes": { @@ -2567,23 +2688,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 148, + "referencedDeclaration": 154, "type": "uint256", "value": "amount" }, - "id": 164, + "id": 170, "name": "Identifier", - "src": "1455:6:0" + "src": "1509:6:0" } ], - "id": 165, + "id": 171, "name": "Assignment", - "src": "1441:20:0" + "src": "1495:20:0" } ], - "id": 166, + "id": 172, "name": "ExpressionStatement", - "src": "1441:20:0" + "src": "1495:20:0" }, { "children": [ @@ -2604,13 +2725,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 44, + "referencedDeclaration": 50, "type": "uint256", "value": "value" }, - "id": 167, + "id": 173, "name": "Identifier", - "src": "1467:5:0" + "src": "1521:5:0" }, { "attributes": { @@ -2630,28 +2751,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 433, + "referencedDeclaration": 495, "type": "msg", "value": "msg" }, - "id": 168, + "id": 174, "name": "Identifier", - "src": "1476:3:0" + "src": "1530:3:0" } ], - "id": 169, + "id": 175, "name": "MemberAccess", - "src": "1476:9:0" + "src": "1530:9:0" } ], - "id": 170, + "id": 176, "name": "Assignment", - "src": "1467:18:0" + "src": "1521:18:0" } ], - "id": 171, + "id": 177, "name": "ExpressionStatement", - "src": "1467:18:0" + "src": "1521:18:0" }, { "children": [ @@ -2685,9 +2806,9 @@ "type": "function (uint256)", "value": "BoughtTokens" }, - "id": 172, + "id": 178, "name": "Identifier", - "src": "1491:12:0" + "src": "1545:12:0" }, { "attributes": { @@ -2697,7 +2818,7 @@ "isPure": false, "lValueRequested": false, "member_name": "coinBalance", - "referencedDeclaration": 57, + "referencedDeclaration": 63, "type": "uint256" }, "children": [ @@ -2717,13 +2838,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 73, + "referencedDeclaration": 79, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 173, + "id": 179, "name": "Identifier", - "src": "1504:13:0" + "src": "1558:13:0" }, { "attributes": { @@ -2743,48 +2864,48 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 433, + "referencedDeclaration": 495, "type": "msg", "value": "msg" }, - "id": 174, + "id": 180, "name": "Identifier", - "src": "1518:3:0" + "src": "1572:3:0" } ], - "id": 175, + "id": 181, "name": "MemberAccess", - "src": "1518:10:0" + "src": "1572:10:0" } ], - "id": 176, + "id": 182, "name": "IndexAccess", - "src": "1504:25:0" + "src": "1558:25:0" } ], - "id": 177, + "id": 183, "name": "MemberAccess", - "src": "1504:37:0" + "src": "1558:37:0" } ], - "id": 178, + "id": 184, "name": "FunctionCall", - "src": "1491:51:0" + "src": "1545:51:0" } ], - "id": 179, + "id": 185, "name": "ExpressionStatement", - "src": "1491:51:0" + "src": "1545:51:0" } ], - "id": 180, + "id": 186, "name": "Block", - "src": "1355:192:0" + "src": "1409:192:0" } ], - "id": 181, + "id": 187, "name": "FunctionDefinition", - "src": "1308:239:0" + "src": "1362:239:0" }, { "attributes": { @@ -2796,7 +2917,7 @@ ], "name": "createPost", "payable": false, - "scope": 365, + "scope": 427, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -2808,7 +2929,7 @@ "attributes": { "constant": false, "name": "url", - "scope": 252, + "scope": 258, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -2821,20 +2942,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 182, + "id": 188, "name": "ElementaryTypeName", - "src": "1571:6:0" + "src": "1625:6:0" } ], - "id": 183, + "id": 189, "name": "VariableDeclaration", - "src": "1571:10:0" + "src": "1625:10:0" }, { "attributes": { "constant": false, "name": "caption", - "scope": 252, + "scope": 258, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -2847,19 +2968,19 @@ "name": "string", "type": "string storage pointer" }, - "id": 184, + "id": 190, "name": "ElementaryTypeName", - "src": "1583:6:0" + "src": "1637:6:0" } ], - "id": 185, + "id": 191, "name": "VariableDeclaration", - "src": "1583:14:0" + "src": "1637:14:0" } ], - "id": 186, + "id": 192, "name": "ParameterList", - "src": "1570:28:0" + "src": "1624:28:0" }, { "attributes": { @@ -2868,16 +2989,16 @@ ] }, "children": [], - "id": 187, + "id": 193, "name": "ParameterList", - "src": "1606:0:0" + "src": "1660:0:0" }, { "children": [ { "attributes": { "assignments": [ - 188 + 194 ] }, "children": [ @@ -2885,7 +3006,7 @@ "attributes": { "constant": false, "name": "post", - "scope": 252, + "scope": 258, "stateVariable": false, "storageLocation": "default", "type": "struct CapCoin.Post storage pointer", @@ -2894,9 +3015,9 @@ "visibility": "internal" }, "children": [], - "id": 188, + "id": 194, "name": "VariableDeclaration", - "src": "1636:8:0" + "src": "1690:8:0" }, { "attributes": { @@ -2914,13 +3035,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 77, + "referencedDeclaration": 83, "type": "mapping(address => struct CapCoin.Post storage ref)", "value": "addressToPost" }, - "id": 189, + "id": 195, "name": "Identifier", - "src": "1647:13:0" + "src": "1701:13:0" }, { "attributes": { @@ -2940,28 +3061,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 433, + "referencedDeclaration": 495, "type": "msg", "value": "msg" }, - "id": 190, + "id": 196, "name": "Identifier", - "src": "1661:3:0" + "src": "1715:3:0" } ], - "id": 191, + "id": 197, "name": "MemberAccess", - "src": "1661:10:0" + "src": "1715:10:0" } ], - "id": 192, + "id": 198, "name": "IndexAccess", - "src": "1647:25:0" + "src": "1701:25:0" } ], - "id": 193, + "id": 199, "name": "VariableDeclarationStatement", - "src": "1636:36:0" + "src": "1690:36:0" }, { "children": [ @@ -2984,7 +3105,7 @@ "isPure": false, "lValueRequested": true, "member_name": "url", - "referencedDeclaration": 60, + "referencedDeclaration": 66, "type": "string storage ref" }, "children": [ @@ -2994,18 +3115,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 188, + "referencedDeclaration": 194, "type": "struct CapCoin.Post storage pointer", "value": "post" }, - "id": 194, + "id": 200, "name": "Identifier", - "src": "1678:4:0" + "src": "1732:4:0" } ], - "id": 196, + "id": 202, "name": "MemberAccess", - "src": "1678:8:0" + "src": "1732:8:0" }, { "attributes": { @@ -3013,23 +3134,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 183, + "referencedDeclaration": 189, "type": "string memory", "value": "url" }, - "id": 197, + "id": 203, "name": "Identifier", - "src": "1689:3:0" + "src": "1743:3:0" } ], - "id": 198, + "id": 204, "name": "Assignment", - "src": "1678:14:0" + "src": "1732:14:0" } ], - "id": 199, + "id": 205, "name": "ExpressionStatement", - "src": "1678:14:0" + "src": "1732:14:0" }, { "children": [ @@ -3052,7 +3173,7 @@ "isPure": false, "lValueRequested": true, "member_name": "lotteryAmount", - "referencedDeclaration": 64, + "referencedDeclaration": 70, "type": "int256" }, "children": [ @@ -3062,18 +3183,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 188, + "referencedDeclaration": 194, "type": "struct CapCoin.Post storage pointer", "value": "post" }, - "id": 200, + "id": 206, "name": "Identifier", - "src": "1698:4:0" + "src": "1752:4:0" } ], - "id": 202, + "id": 208, "name": "MemberAccess", - "src": "1698:18:0" + "src": "1752:18:0" }, { "attributes": { @@ -3088,19 +3209,19 @@ "type": "int_const 5", "value": "5" }, - "id": 203, + "id": 209, "name": "Literal", - "src": "1720:1:0" + "src": "1774:1:0" } ], - "id": 204, + "id": 210, "name": "Assignment", - "src": "1698:23:0" + "src": "1752:23:0" } ], - "id": 205, + "id": 211, "name": "ExpressionStatement", - "src": "1698:23:0" + "src": "1752:23:0" }, { "children": [ @@ -3123,7 +3244,7 @@ "isPure": false, "lValueRequested": true, "member_name": "userName", - "referencedDeclaration": 62, + "referencedDeclaration": 68, "type": "string storage ref" }, "children": [ @@ -3133,18 +3254,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 188, + "referencedDeclaration": 194, "type": "struct CapCoin.Post storage pointer", "value": "post" }, - "id": 206, + "id": 212, "name": "Identifier", - "src": "1727:4:0" + "src": "1781:4:0" } ], - "id": 208, + "id": 214, "name": "MemberAccess", - "src": "1727:13:0" + "src": "1781:13:0" }, { "attributes": { @@ -3154,7 +3275,7 @@ "isPure": false, "lValueRequested": false, "member_name": "name", - "referencedDeclaration": 55, + "referencedDeclaration": 61, "type": "string storage ref" }, "children": [ @@ -3174,13 +3295,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 73, + "referencedDeclaration": 79, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 209, + "id": 215, "name": "Identifier", - "src": "1743:13:0" + "src": "1797:13:0" }, { "attributes": { @@ -3200,38 +3321,38 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 433, + "referencedDeclaration": 495, "type": "msg", "value": "msg" }, - "id": 210, + "id": 216, "name": "Identifier", - "src": "1757:3:0" + "src": "1811:3:0" } ], - "id": 211, + "id": 217, "name": "MemberAccess", - "src": "1757:10:0" + "src": "1811:10:0" } ], - "id": 212, + "id": 218, "name": "IndexAccess", - "src": "1743:25:0" + "src": "1797:25:0" } ], - "id": 213, + "id": 219, "name": "MemberAccess", - "src": "1743:30:0" + "src": "1797:30:0" } ], - "id": 214, + "id": 220, "name": "Assignment", - "src": "1727:46:0" + "src": "1781:46:0" } ], - "id": 215, + "id": 221, "name": "ExpressionStatement", - "src": "1727:46:0" + "src": "1781:46:0" }, { "children": [ @@ -3254,7 +3375,7 @@ "isPure": false, "lValueRequested": true, "member_name": "owner", - "referencedDeclaration": 66, + "referencedDeclaration": 72, "type": "address" }, "children": [ @@ -3264,18 +3385,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 188, + "referencedDeclaration": 194, "type": "struct CapCoin.Post storage pointer", "value": "post" }, - "id": 216, + "id": 222, "name": "Identifier", - "src": "1779:4:0" + "src": "1833:4:0" } ], - "id": 218, + "id": 224, "name": "MemberAccess", - "src": "1779:10:0" + "src": "1833:10:0" }, { "attributes": { @@ -3295,28 +3416,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 433, + "referencedDeclaration": 495, "type": "msg", "value": "msg" }, - "id": 219, + "id": 225, "name": "Identifier", - "src": "1792:3:0" + "src": "1846:3:0" } ], - "id": 220, + "id": 226, "name": "MemberAccess", - "src": "1792:10:0" + "src": "1846:10:0" } ], - "id": 221, + "id": 227, "name": "Assignment", - "src": "1779:23:0" + "src": "1833:23:0" } ], - "id": 222, + "id": 228, "name": "ExpressionStatement", - "src": "1779:23:0" + "src": "1833:23:0" }, { "children": [ @@ -3339,7 +3460,7 @@ "isPure": false, "lValueRequested": true, "member_name": "caption", - "referencedDeclaration": 68, + "referencedDeclaration": 74, "type": "string storage ref" }, "children": [ @@ -3349,18 +3470,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 188, + "referencedDeclaration": 194, "type": "struct CapCoin.Post storage pointer", "value": "post" }, - "id": 223, + "id": 229, "name": "Identifier", - "src": "1808:4:0" + "src": "1862:4:0" } ], - "id": 225, + "id": 231, "name": "MemberAccess", - "src": "1808:12:0" + "src": "1862:12:0" }, { "attributes": { @@ -3368,23 +3489,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 185, + "referencedDeclaration": 191, "type": "string memory", "value": "caption" }, - "id": 226, + "id": 232, "name": "Identifier", - "src": "1823:7:0" + "src": "1877:7:0" } ], - "id": 227, + "id": 233, "name": "Assignment", - "src": "1808:22:0" + "src": "1862:22:0" } ], - "id": 228, + "id": 234, "name": "ExpressionStatement", - "src": "1808:22:0" + "src": "1862:22:0" }, { "children": [ @@ -3441,18 +3562,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 80, + "referencedDeclaration": 86, "type": "address[] storage ref", "value": "posts" }, - "id": 229, + "id": 235, "name": "Identifier", - "src": "1837:5:0" + "src": "1891:5:0" } ], - "id": 231, + "id": 237, "name": "MemberAccess", - "src": "1837:10:0" + "src": "1891:10:0" }, { "attributes": { @@ -3472,23 +3593,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 433, + "referencedDeclaration": 495, "type": "msg", "value": "msg" }, - "id": 232, + "id": 238, "name": "Identifier", - "src": "1848:3:0" + "src": "1902:3:0" } ], - "id": 233, + "id": 239, "name": "MemberAccess", - "src": "1848:10:0" + "src": "1902:10:0" } ], - "id": 234, + "id": 240, "name": "FunctionCall", - "src": "1837:22:0" + "src": "1891:22:0" }, { "attributes": { @@ -3503,19 +3624,19 @@ "type": "int_const 1", "value": "1" }, - "id": 235, + "id": 241, "name": "Literal", - "src": "1861:1:0" + "src": "1915:1:0" } ], - "id": 236, + "id": 242, "name": "BinaryOperation", - "src": "1837:25:0" + "src": "1891:25:0" } ], - "id": 237, + "id": 243, "name": "ExpressionStatement", - "src": "1837:25:0" + "src": "1891:25:0" }, { "children": [ @@ -3538,7 +3659,7 @@ "isPure": false, "lValueRequested": true, "member_name": "coinBalance", - "referencedDeclaration": 57, + "referencedDeclaration": 63, "type": "uint256" }, "children": [ @@ -3558,13 +3679,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 73, + "referencedDeclaration": 79, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 238, + "id": 244, "name": "Identifier", - "src": "1868:13:0" + "src": "1922:13:0" }, { "attributes": { @@ -3584,28 +3705,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 433, + "referencedDeclaration": 495, "type": "msg", "value": "msg" }, - "id": 239, + "id": 245, "name": "Identifier", - "src": "1882:3:0" + "src": "1936:3:0" } ], - "id": 240, + "id": 246, "name": "MemberAccess", - "src": "1882:10:0" + "src": "1936:10:0" } ], - "id": 241, + "id": 247, "name": "IndexAccess", - "src": "1868:25:0" + "src": "1922:25:0" } ], - "id": 242, + "id": 248, "name": "MemberAccess", - "src": "1868:37:0" + "src": "1922:37:0" }, { "attributes": { @@ -3620,19 +3741,19 @@ "type": "int_const 5", "value": "5" }, - "id": 243, + "id": 249, "name": "Literal", - "src": "1909:1:0" + "src": "1963:1:0" } ], - "id": 244, + "id": 250, "name": "Assignment", - "src": "1868:42:0" + "src": "1922:42:0" } ], - "id": 245, + "id": 251, "name": "ExpressionStatement", - "src": "1868:42:0" + "src": "1922:42:0" }, { "children": [ @@ -3670,9 +3791,9 @@ "type": "function (string memory,string memory)", "value": "CreatedPost" }, - "id": 246, + "id": 252, "name": "Identifier", - "src": "1916:11:0" + "src": "1970:11:0" }, { "attributes": { @@ -3680,13 +3801,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 183, + "referencedDeclaration": 189, "type": "string memory", "value": "url" }, - "id": 247, + "id": 253, "name": "Identifier", - "src": "1928:3:0" + "src": "1982:3:0" }, { "attributes": { @@ -3694,33 +3815,33 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 185, + "referencedDeclaration": 191, "type": "string memory", "value": "caption" }, - "id": 248, + "id": 254, "name": "Identifier", - "src": "1933:7:0" + "src": "1987:7:0" } ], - "id": 249, + "id": 255, "name": "FunctionCall", - "src": "1916:25:0" + "src": "1970:25:0" } ], - "id": 250, + "id": 256, "name": "ExpressionStatement", - "src": "1916:25:0" + "src": "1970:25:0" } ], - "id": 251, + "id": 257, "name": "Block", - "src": "1606:340:0" + "src": "1660:340:0" } ], - "id": 252, + "id": 258, "name": "FunctionDefinition", - "src": "1551:395:0" + "src": "1605:395:0" }, { "attributes": { @@ -3732,7 +3853,7 @@ ], "name": "likePost", "payable": false, - "scope": 365, + "scope": 427, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -3744,7 +3865,7 @@ "attributes": { "constant": false, "name": "post", - "scope": 312, + "scope": 318, "stateVariable": false, "storageLocation": "default", "type": "address", @@ -3757,20 +3878,20 @@ "name": "address", "type": "address" }, - "id": 253, + "id": 259, "name": "ElementaryTypeName", - "src": "1968:7:0" + "src": "2022:7:0" } ], - "id": 254, + "id": 260, "name": "VariableDeclaration", - "src": "1968:12:0" + "src": "2022:12:0" }, { "attributes": { "constant": false, "name": "amount", - "scope": 312, + "scope": 318, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -3783,19 +3904,19 @@ "name": "uint", "type": "uint256" }, - "id": 255, + "id": 261, "name": "ElementaryTypeName", - "src": "1982:4:0" + "src": "2036:4:0" } ], - "id": 256, + "id": 262, "name": "VariableDeclaration", - "src": "1982:11:0" + "src": "2036:11:0" } ], - "id": 257, + "id": 263, "name": "ParameterList", - "src": "1967:27:0" + "src": "2021:27:0" }, { "attributes": { @@ -3804,9 +3925,9 @@ ] }, "children": [], - "id": 258, + "id": 264, "name": "ParameterList", - "src": "2002:0:0" + "src": "2056:0:0" }, { "children": [ @@ -3831,7 +3952,7 @@ "isPure": false, "lValueRequested": true, "member_name": "lotteryAmount", - "referencedDeclaration": 64, + "referencedDeclaration": 70, "type": "int256" }, "children": [ @@ -3851,13 +3972,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 77, + "referencedDeclaration": 83, "type": "mapping(address => struct CapCoin.Post storage ref)", "value": "addressToPost" }, - "id": 259, + "id": 265, "name": "Identifier", - "src": "2008:13:0" + "src": "2062:13:0" }, { "attributes": { @@ -3865,23 +3986,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 254, + "referencedDeclaration": 260, "type": "address", "value": "post" }, - "id": 260, + "id": 266, "name": "Identifier", - "src": "2022:4:0" + "src": "2076:4:0" } ], - "id": 261, + "id": 267, "name": "IndexAccess", - "src": "2008:19:0" + "src": "2062:19:0" } ], - "id": 262, + "id": 268, "name": "MemberAccess", - "src": "2008:33:0" + "src": "2062:33:0" }, { "attributes": { @@ -3913,9 +4034,9 @@ "type": "type(int256)", "value": "int" }, - "id": 263, + "id": 269, "name": "ElementaryTypeNameExpression", - "src": "2045:3:0" + "src": "2099:3:0" }, { "attributes": { @@ -3923,28 +4044,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 256, + "referencedDeclaration": 262, "type": "uint256", "value": "amount" }, - "id": 264, + "id": 270, "name": "Identifier", - "src": "2049:6:0" + "src": "2103:6:0" } ], - "id": 265, + "id": 271, "name": "FunctionCall", - "src": "2045:11:0" + "src": "2099:11:0" } ], - "id": 266, + "id": 272, "name": "Assignment", - "src": "2008:48:0" + "src": "2062:48:0" } ], - "id": 267, + "id": 273, "name": "ExpressionStatement", - "src": "2008:48:0" + "src": "2062:48:0" }, { "children": [ @@ -3967,7 +4088,7 @@ "isPure": false, "lValueRequested": true, "member_name": "coinBalance", - "referencedDeclaration": 57, + "referencedDeclaration": 63, "type": "uint256" }, "children": [ @@ -3987,13 +4108,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 73, + "referencedDeclaration": 79, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 268, + "id": 274, "name": "Identifier", - "src": "2062:13:0" + "src": "2116:13:0" }, { "attributes": { @@ -4001,23 +4122,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 254, + "referencedDeclaration": 260, "type": "address", "value": "post" }, - "id": 269, + "id": 275, "name": "Identifier", - "src": "2076:4:0" + "src": "2130:4:0" } ], - "id": 270, + "id": 276, "name": "IndexAccess", - "src": "2062:19:0" + "src": "2116:19:0" } ], - "id": 271, + "id": 277, "name": "MemberAccess", - "src": "2062:31:0" + "src": "2116:31:0" }, { "attributes": { @@ -4025,23 +4146,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 256, + "referencedDeclaration": 262, "type": "uint256", "value": "amount" }, - "id": 272, + "id": 278, "name": "Identifier", - "src": "2097:6:0" + "src": "2151:6:0" } ], - "id": 273, + "id": 279, "name": "Assignment", - "src": "2062:41:0" + "src": "2116:41:0" } ], - "id": 274, + "id": 280, "name": "ExpressionStatement", - "src": "2062:41:0" + "src": "2116:41:0" }, { "children": [ @@ -4064,7 +4185,7 @@ "isPure": false, "lValueRequested": true, "member_name": "coinBalance", - "referencedDeclaration": 57, + "referencedDeclaration": 63, "type": "uint256" }, "children": [ @@ -4084,13 +4205,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 73, + "referencedDeclaration": 79, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 275, + "id": 281, "name": "Identifier", - "src": "2109:13:0" + "src": "2163:13:0" }, { "attributes": { @@ -4110,28 +4231,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 433, + "referencedDeclaration": 495, "type": "msg", "value": "msg" }, - "id": 276, + "id": 282, "name": "Identifier", - "src": "2123:3:0" + "src": "2177:3:0" } ], - "id": 277, + "id": 283, "name": "MemberAccess", - "src": "2123:10:0" + "src": "2177:10:0" } ], - "id": 278, + "id": 284, "name": "IndexAccess", - "src": "2109:25:0" + "src": "2163:25:0" } ], - "id": 279, + "id": 285, "name": "MemberAccess", - "src": "2109:37:0" + "src": "2163:37:0" }, { "attributes": { @@ -4139,23 +4260,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 256, + "referencedDeclaration": 262, "type": "uint256", "value": "amount" }, - "id": 280, + "id": 286, "name": "Identifier", - "src": "2150:6:0" + "src": "2204:6:0" } ], - "id": 281, + "id": 287, "name": "Assignment", - "src": "2109:47:0" + "src": "2163:47:0" } ], - "id": 282, + "id": 288, "name": "ExpressionStatement", - "src": "2109:47:0" + "src": "2163:47:0" }, { "children": [ @@ -4213,9 +4334,9 @@ "type": "function (int256,string memory,address,uint256,string memory,address,uint256)", "value": "LikedPost" }, - "id": 283, + "id": 289, "name": "Identifier", - "src": "2162:9:0" + "src": "2216:9:0" }, { "attributes": { @@ -4225,7 +4346,7 @@ "isPure": false, "lValueRequested": false, "member_name": "lotteryAmount", - "referencedDeclaration": 64, + "referencedDeclaration": 70, "type": "int256" }, "children": [ @@ -4245,13 +4366,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 77, + "referencedDeclaration": 83, "type": "mapping(address => struct CapCoin.Post storage ref)", "value": "addressToPost" }, - "id": 284, + "id": 290, "name": "Identifier", - "src": "2172:13:0" + "src": "2226:13:0" }, { "attributes": { @@ -4259,23 +4380,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 254, + "referencedDeclaration": 260, "type": "address", "value": "post" }, - "id": 285, + "id": 291, "name": "Identifier", - "src": "2186:4:0" + "src": "2240:4:0" } ], - "id": 286, + "id": 292, "name": "IndexAccess", - "src": "2172:19:0" + "src": "2226:19:0" } ], - "id": 287, + "id": 293, "name": "MemberAccess", - "src": "2172:33:0" + "src": "2226:33:0" }, { "attributes": { @@ -4285,7 +4406,7 @@ "isPure": false, "lValueRequested": false, "member_name": "name", - "referencedDeclaration": 55, + "referencedDeclaration": 61, "type": "string storage ref" }, "children": [ @@ -4305,13 +4426,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 73, + "referencedDeclaration": 79, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 288, + "id": 294, "name": "Identifier", - "src": "2213:13:0" + "src": "2267:13:0" }, { "attributes": { @@ -4319,23 +4440,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 254, + "referencedDeclaration": 260, "type": "address", "value": "post" }, - "id": 289, + "id": 295, "name": "Identifier", - "src": "2227:4:0" + "src": "2281:4:0" } ], - "id": 290, + "id": 296, "name": "IndexAccess", - "src": "2213:19:0" + "src": "2267:19:0" } ], - "id": 291, + "id": 297, "name": "MemberAccess", - "src": "2213:24:0" + "src": "2267:24:0" }, { "attributes": { @@ -4343,13 +4464,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 254, + "referencedDeclaration": 260, "type": "address", "value": "post" }, - "id": 292, + "id": 298, "name": "Identifier", - "src": "2239:4:0" + "src": "2293:4:0" }, { "attributes": { @@ -4359,7 +4480,7 @@ "isPure": false, "lValueRequested": false, "member_name": "coinBalance", - "referencedDeclaration": 57, + "referencedDeclaration": 63, "type": "uint256" }, "children": [ @@ -4379,13 +4500,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 73, + "referencedDeclaration": 79, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 293, + "id": 299, "name": "Identifier", - "src": "2245:13:0" + "src": "2299:13:0" }, { "attributes": { @@ -4393,23 +4514,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 254, + "referencedDeclaration": 260, "type": "address", "value": "post" }, - "id": 294, + "id": 300, "name": "Identifier", - "src": "2259:4:0" + "src": "2313:4:0" } ], - "id": 295, + "id": 301, "name": "IndexAccess", - "src": "2245:19:0" + "src": "2299:19:0" } ], - "id": 296, + "id": 302, "name": "MemberAccess", - "src": "2245:31:0" + "src": "2299:31:0" }, { "attributes": { @@ -4419,7 +4540,7 @@ "isPure": false, "lValueRequested": false, "member_name": "name", - "referencedDeclaration": 55, + "referencedDeclaration": 61, "type": "string storage ref" }, "children": [ @@ -4439,13 +4560,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 73, + "referencedDeclaration": 79, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 297, + "id": 303, "name": "Identifier", - "src": "2284:13:0" + "src": "2338:13:0" }, { "attributes": { @@ -4465,28 +4586,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 433, + "referencedDeclaration": 495, "type": "msg", "value": "msg" }, - "id": 298, + "id": 304, "name": "Identifier", - "src": "2298:3:0" + "src": "2352:3:0" } ], - "id": 299, + "id": 305, "name": "MemberAccess", - "src": "2298:10:0" + "src": "2352:10:0" } ], - "id": 300, + "id": 306, "name": "IndexAccess", - "src": "2284:25:0" + "src": "2338:25:0" } ], - "id": 301, + "id": 307, "name": "MemberAccess", - "src": "2284:30:0" + "src": "2338:30:0" }, { "attributes": { @@ -4506,18 +4627,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 433, + "referencedDeclaration": 495, "type": "msg", "value": "msg" }, - "id": 302, + "id": 308, "name": "Identifier", - "src": "2316:3:0" + "src": "2370:3:0" } ], - "id": 303, + "id": 309, "name": "MemberAccess", - "src": "2316:10:0" + "src": "2370:10:0" }, { "attributes": { @@ -4527,7 +4648,7 @@ "isPure": false, "lValueRequested": false, "member_name": "coinBalance", - "referencedDeclaration": 57, + "referencedDeclaration": 63, "type": "uint256" }, "children": [ @@ -4547,13 +4668,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 73, + "referencedDeclaration": 79, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 304, + "id": 310, "name": "Identifier", - "src": "2328:13:0" + "src": "2382:13:0" }, { "attributes": { @@ -4573,48 +4694,48 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 433, + "referencedDeclaration": 495, "type": "msg", "value": "msg" }, - "id": 305, + "id": 311, "name": "Identifier", - "src": "2342:3:0" + "src": "2396:3:0" } ], - "id": 306, + "id": 312, "name": "MemberAccess", - "src": "2342:10:0" + "src": "2396:10:0" } ], - "id": 307, + "id": 313, "name": "IndexAccess", - "src": "2328:25:0" + "src": "2382:25:0" } ], - "id": 308, + "id": 314, "name": "MemberAccess", - "src": "2328:37:0" + "src": "2382:37:0" } ], - "id": 309, + "id": 315, "name": "FunctionCall", - "src": "2162:204:0" + "src": "2216:204:0" } ], - "id": 310, + "id": 316, "name": "ExpressionStatement", - "src": "2162:204:0" + "src": "2216:204:0" } ], - "id": 311, + "id": 317, "name": "Block", - "src": "2002:369:0" + "src": "2056:369:0" } ], - "id": 312, + "id": 318, "name": "FunctionDefinition", - "src": "1950:421:0" + "src": "2004:421:0" }, { "attributes": { @@ -4626,7 +4747,7 @@ ], "name": "getPosts", "payable": false, - "scope": 365, + "scope": 427, "stateMutability": "view", "superFunction": null, "visibility": "public" @@ -4639,9 +4760,9 @@ ] }, "children": [], - "id": 313, + "id": 319, "name": "ParameterList", - "src": "2392:2:0" + "src": "2446:2:0" }, { "children": [ @@ -4649,7 +4770,7 @@ "attributes": { "constant": false, "name": "", - "scope": 321, + "scope": 327, "stateVariable": false, "storageLocation": "default", "type": "address[] memory", @@ -4668,30 +4789,30 @@ "name": "address", "type": "address" }, - "id": 314, + "id": 320, "name": "ElementaryTypeName", - "src": "2416:7:0" + "src": "2470:7:0" } ], - "id": 315, + "id": 321, "name": "ArrayTypeName", - "src": "2416:9:0" + "src": "2470:9:0" } ], - "id": 316, + "id": 322, "name": "VariableDeclaration", - "src": "2416:9:0" + "src": "2470:9:0" } ], - "id": 317, + "id": 323, "name": "ParameterList", - "src": "2415:11:0" + "src": "2469:11:0" }, { "children": [ { "attributes": { - "functionReturnParameters": 317 + "functionReturnParameters": 323 }, "children": [ { @@ -4700,28 +4821,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 80, + "referencedDeclaration": 86, "type": "address[] storage ref", "value": "posts" }, - "id": 318, + "id": 324, "name": "Identifier", - "src": "2442:5:0" + "src": "2496:5:0" } ], - "id": 319, + "id": 325, "name": "Return", - "src": "2435:12:0" + "src": "2489:12:0" } ], - "id": 320, + "id": 326, "name": "Block", - "src": "2427:25:0" + "src": "2481:25:0" } ], - "id": 321, + "id": 327, "name": "FunctionDefinition", - "src": "2375:77:0" + "src": "2429:77:0" }, { "attributes": { @@ -4733,7 +4854,7 @@ ], "name": "seed", "payable": false, - "scope": 365, + "scope": 427, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -4745,7 +4866,7 @@ "attributes": { "constant": false, "name": "name", - "scope": 346, + "scope": 352, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -4758,20 +4879,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 322, + "id": 328, "name": "ElementaryTypeName", - "src": "2470:6:0" + "src": "2524:6:0" } ], - "id": 323, + "id": 329, "name": "VariableDeclaration", - "src": "2470:11:0" + "src": "2524:11:0" }, { "attributes": { "constant": false, "name": "url", - "scope": 346, + "scope": 352, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -4784,20 +4905,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 324, + "id": 330, "name": "ElementaryTypeName", - "src": "2483:6:0" + "src": "2537:6:0" } ], - "id": 325, + "id": 331, "name": "VariableDeclaration", - "src": "2483:10:0" + "src": "2537:10:0" }, { "attributes": { "constant": false, "name": "amount", - "scope": 346, + "scope": 352, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -4810,20 +4931,20 @@ "name": "uint", "type": "uint256" }, - "id": 326, + "id": 332, "name": "ElementaryTypeName", - "src": "2495:4:0" + "src": "2549:4:0" } ], - "id": 327, + "id": 333, "name": "VariableDeclaration", - "src": "2495:11:0" + "src": "2549:11:0" }, { "attributes": { "constant": false, "name": "caption", - "scope": 346, + "scope": 352, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -4836,19 +4957,19 @@ "name": "string", "type": "string storage pointer" }, - "id": 328, + "id": 334, "name": "ElementaryTypeName", - "src": "2508:6:0" + "src": "2562:6:0" } ], - "id": 329, + "id": 335, "name": "VariableDeclaration", - "src": "2508:14:0" + "src": "2562:14:0" } ], - "id": 330, + "id": 336, "name": "ParameterList", - "src": "2469:54:0" + "src": "2523:54:0" }, { "attributes": { @@ -4857,9 +4978,9 @@ ] }, "children": [], - "id": 331, + "id": 337, "name": "ParameterList", - "src": "2531:0:0" + "src": "2585:0:0" }, { "children": [ @@ -4891,13 +5012,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 108, + "referencedDeclaration": 114, "type": "function (string memory)", "value": "createUser" }, - "id": 332, + "id": 338, "name": "Identifier", - "src": "2539:10:0" + "src": "2593:10:0" }, { "attributes": { @@ -4905,23 +5026,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 323, + "referencedDeclaration": 329, "type": "string memory", "value": "name" }, - "id": 333, + "id": 339, "name": "Identifier", - "src": "2550:4:0" + "src": "2604:4:0" } ], - "id": 334, + "id": 340, "name": "FunctionCall", - "src": "2539:16:0" + "src": "2593:16:0" } ], - "id": 335, + "id": 341, "name": "ExpressionStatement", - "src": "2539:16:0" + "src": "2593:16:0" }, { "children": [ @@ -4951,13 +5072,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 181, + "referencedDeclaration": 187, "type": "function (uint256)", "value": "buyTokens" }, - "id": 336, + "id": 342, "name": "Identifier", - "src": "2563:9:0" + "src": "2617:9:0" }, { "attributes": { @@ -4965,23 +5086,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 327, + "referencedDeclaration": 333, "type": "uint256", "value": "amount" }, - "id": 337, + "id": 343, "name": "Identifier", - "src": "2573:6:0" + "src": "2627:6:0" } ], - "id": 338, + "id": 344, "name": "FunctionCall", - "src": "2563:17:0" + "src": "2617:17:0" } ], - "id": 339, + "id": 345, "name": "ExpressionStatement", - "src": "2563:17:0" + "src": "2617:17:0" }, { "children": [ @@ -5015,13 +5136,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 252, + "referencedDeclaration": 258, "type": "function (string memory,string memory)", "value": "createPost" }, - "id": 340, + "id": 346, "name": "Identifier", - "src": "2588:10:0" + "src": "2642:10:0" }, { "attributes": { @@ -5029,13 +5150,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 325, + "referencedDeclaration": 331, "type": "string memory", "value": "url" }, - "id": 341, + "id": 347, "name": "Identifier", - "src": "2599:3:0" + "src": "2653:3:0" }, { "attributes": { @@ -5043,33 +5164,801 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 329, + "referencedDeclaration": 335, "type": "string memory", "value": "caption" }, - "id": 342, + "id": 348, "name": "Identifier", - "src": "2604:7:0" + "src": "2658:7:0" } ], - "id": 343, + "id": 349, "name": "FunctionCall", - "src": "2588:24:0" + "src": "2642:24:0" } ], - "id": 344, + "id": 350, "name": "ExpressionStatement", - "src": "2588:24:0" + "src": "2642:24:0" + } + ], + "id": 351, + "name": "Block", + "src": "2585:86:0" + } + ], + "id": 352, + "name": "FunctionDefinition", + "src": "2510:161:0" + }, + { + "attributes": { + "constant": false, + "implemented": true, + "isConstructor": false, + "modifiers": [ + null + ], + "name": "cashOut", + "payable": false, + "scope": 427, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "name": "weiAmount", + "scope": 400, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 353, + "name": "ElementaryTypeName", + "src": "2692:4:0" + } + ], + "id": 354, + "name": "VariableDeclaration", + "src": "2692:14:0" + }, + { + "attributes": { + "constant": false, + "name": "coinAmount", + "scope": 400, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 355, + "name": "ElementaryTypeName", + "src": "2708:4:0" + } + ], + "id": 356, + "name": "VariableDeclaration", + "src": "2708:15:0" + } + ], + "id": 357, + "name": "ParameterList", + "src": "2691:33:0" + }, + { + "attributes": { + "parameters": [ + null + ] + }, + "children": [], + "id": 358, + "name": "ParameterList", + "src": "2732:0: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_bool", + "typeString": "bool" + } + ], + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 486, + "type": "function (bool) pure", + "value": "assert" + }, + "id": 359, + "name": "Identifier", + "src": "2740:6:0" + }, + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": ">", + "type": "bool" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "member_name": "coinBalance", + "referencedDeclaration": 63, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct CapCoin.User storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 79, + "type": "mapping(address => struct CapCoin.User storage ref)", + "value": "addressToUser" + }, + "id": 360, + "name": "Identifier", + "src": "2747:13: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": 495, + "type": "msg", + "value": "msg" + }, + "id": 361, + "name": "Identifier", + "src": "2761:3:0" + } + ], + "id": 362, + "name": "MemberAccess", + "src": "2761:10:0" + } + ], + "id": 363, + "name": "IndexAccess", + "src": "2747:25:0" + } + ], + "id": 364, + "name": "MemberAccess", + "src": "2747:37:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 356, + "type": "uint256", + "value": "coinAmount" + }, + "id": 365, + "name": "Identifier", + "src": "2787:10:0" + } + ], + "id": 366, + "name": "BinaryOperation", + "src": "2747:50:0" + } + ], + "id": 367, + "name": "FunctionCall", + "src": "2740:58:0" + } + ], + "id": 368, + "name": "ExpressionStatement", + "src": "2740:58:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "-=", + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "member_name": "coinBalance", + "referencedDeclaration": 63, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct CapCoin.User storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 79, + "type": "mapping(address => struct CapCoin.User storage ref)", + "value": "addressToUser" + }, + "id": 369, + "name": "Identifier", + "src": "2806:13: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": 495, + "type": "msg", + "value": "msg" + }, + "id": 370, + "name": "Identifier", + "src": "2820:3:0" + } + ], + "id": 371, + "name": "MemberAccess", + "src": "2820:10:0" + } + ], + "id": 372, + "name": "IndexAccess", + "src": "2806:25:0" + } + ], + "id": 373, + "name": "MemberAccess", + "src": "2806:37:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 356, + "type": "uint256", + "value": "coinAmount" + }, + "id": 374, + "name": "Identifier", + "src": "2847:10:0" + } + ], + "id": 375, + "name": "Assignment", + "src": "2806:51:0" + } + ], + "id": 376, + "name": "ExpressionStatement", + "src": "2806:51:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "-=", + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 50, + "type": "uint256", + "value": "value" + }, + "id": 377, + "name": "Identifier", + "src": "2865:5:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 354, + "type": "uint256", + "value": "weiAmount" + }, + "id": 378, + "name": "Identifier", + "src": "2874:9:0" + } + ], + "id": 379, + "name": "Assignment", + "src": "2865:18:0" + } + ], + "id": 380, + "name": "ExpressionStatement", + "src": "2865:18:0" + }, + { + "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_uint256", + "typeString": "uint256" + } + ], + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "transfer", + "referencedDeclaration": null, + "type": "function (uint256)" + }, + "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": 495, + "type": "msg", + "value": "msg" + }, + "id": 381, + "name": "Identifier", + "src": "2891:3:0" + } + ], + "id": 384, + "name": "MemberAccess", + "src": "2891:10:0" + } + ], + "id": 385, + "name": "MemberAccess", + "src": "2891:19:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 354, + "type": "uint256", + "value": "weiAmount" + }, + "id": 386, + "name": "Identifier", + "src": "2911:9:0" + } + ], + "id": 387, + "name": "FunctionCall", + "src": "2891:30:0" + } + ], + "id": 388, + "name": "ExpressionStatement", + "src": "2891:30:0" + }, + { + "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_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 40, + "type": "function (uint256,address)", + "value": "CashedOut" + }, + "id": 389, + "name": "Identifier", + "src": "2929:9:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "member_name": "coinBalance", + "referencedDeclaration": 63, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct CapCoin.User storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 79, + "type": "mapping(address => struct CapCoin.User storage ref)", + "value": "addressToUser" + }, + "id": 390, + "name": "Identifier", + "src": "2939:13: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": 495, + "type": "msg", + "value": "msg" + }, + "id": 391, + "name": "Identifier", + "src": "2953:3:0" + } + ], + "id": 392, + "name": "MemberAccess", + "src": "2953:10:0" + } + ], + "id": 393, + "name": "IndexAccess", + "src": "2939:25:0" + } + ], + "id": 394, + "name": "MemberAccess", + "src": "2939:37: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": 495, + "type": "msg", + "value": "msg" + }, + "id": 395, + "name": "Identifier", + "src": "2978:3:0" + } + ], + "id": 396, + "name": "MemberAccess", + "src": "2978:10:0" + } + ], + "id": 397, + "name": "FunctionCall", + "src": "2929:60:0" + } + ], + "id": 398, + "name": "ExpressionStatement", + "src": "2929:60:0" + } + ], + "id": 399, + "name": "Block", + "src": "2732:262:0" + } + ], + "id": 400, + "name": "FunctionDefinition", + "src": "2675:319:0" + }, + { + "attributes": { + "constant": true, + "implemented": true, + "isConstructor": false, + "modifiers": [ + null + ], + "name": "getContractBal", + "payable": false, + "scope": 427, + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + "children": [ + { + "attributes": { + "parameters": [ + null + ] + }, + "children": [], + "id": 401, + "name": "ParameterList", + "src": "3021:2:0" + }, + { + "children": [ + { + "attributes": { + "constant": false, + "name": "", + "scope": 408, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 402, + "name": "ElementaryTypeName", + "src": "3045:4:0" + } + ], + "id": 403, + "name": "VariableDeclaration", + "src": "3045:4:0" + } + ], + "id": 404, + "name": "ParameterList", + "src": "3044:6:0" + }, + { + "children": [ + { + "attributes": { + "functionReturnParameters": 404 + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 50, + "type": "uint256", + "value": "value" + }, + "id": 405, + "name": "Identifier", + "src": "3066:5:0" + } + ], + "id": 406, + "name": "Return", + "src": "3059:12:0" } ], - "id": 345, + "id": 407, "name": "Block", - "src": "2531:86:0" + "src": "3051:25:0" } ], - "id": 346, + "id": 408, "name": "FunctionDefinition", - "src": "2456:161:0" + "src": "2998:78:0" }, { "attributes": { @@ -5081,7 +5970,7 @@ ], "name": "kill", "payable": false, - "scope": 365, + "scope": 427, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -5094,9 +5983,9 @@ ] }, "children": [], - "id": 347, + "id": 409, "name": "ParameterList", - "src": "2636:2:0" + "src": "3095:2:0" }, { "attributes": { @@ -5105,9 +5994,9 @@ ] }, "children": [], - "id": 348, + "id": 410, "name": "ParameterList", - "src": "2639:0:0" + "src": "3098:0:0" }, { "children": [ @@ -5149,18 +6038,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 433, + "referencedDeclaration": 495, "type": "msg", "value": "msg" }, - "id": 349, + "id": 411, "name": "Identifier", - "src": "2651:3:0" + "src": "3110:3:0" } ], - "id": 350, + "id": 412, "name": "MemberAccess", - "src": "2651:10:0" + "src": "3110:10:0" }, { "attributes": { @@ -5168,18 +6057,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 42, + "referencedDeclaration": 48, "type": "address", "value": "owner" }, - "id": 351, + "id": 413, "name": "Identifier", - "src": "2665:5:0" + "src": "3124:5:0" } ], - "id": 352, + "id": 414, "name": "BinaryOperation", - "src": "2651:19:0" + "src": "3110:19:0" }, { "children": [ @@ -5211,13 +6100,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 439, + "referencedDeclaration": 501, "type": "function (address)", "value": "selfdestruct" }, - "id": 353, + "id": 415, "name": "Identifier", - "src": "2682:12:0" + "src": "3141:12:0" }, { "attributes": { @@ -5225,43 +6114,43 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 42, + "referencedDeclaration": 48, "type": "address", "value": "owner" }, - "id": 354, + "id": 416, "name": "Identifier", - "src": "2695:5:0" + "src": "3154:5:0" } ], - "id": 355, + "id": 417, "name": "FunctionCall", - "src": "2682:19:0" + "src": "3141:19:0" } ], - "id": 356, + "id": 418, "name": "ExpressionStatement", - "src": "2682:19:0" + "src": "3141:19:0" } ], - "id": 357, + "id": 419, "name": "Block", - "src": "2672:38:0" + "src": "3131:38:0" } ], - "id": 358, + "id": 420, "name": "IfStatement", - "src": "2647:63:0" + "src": "3106:63:0" } ], - "id": 359, + "id": 421, "name": "Block", - "src": "2639:77:0" + "src": "3098:77:0" } ], - "id": 360, + "id": 422, "name": "FunctionDefinition", - "src": "2623:93:0" + "src": "3082:93:0" }, { "attributes": { @@ -5273,7 +6162,7 @@ ], "name": "", "payable": true, - "scope": 365, + "scope": 427, "stateMutability": "payable", "superFunction": null, "visibility": "public" @@ -5286,9 +6175,9 @@ ] }, "children": [], - "id": 361, + "id": 423, "name": "ParameterList", - "src": "2728:2:0" + "src": "3187:2:0" }, { "attributes": { @@ -5297,9 +6186,9 @@ ] }, "children": [], - "id": 362, + "id": 424, "name": "ParameterList", - "src": "2739:0:0" + "src": "3198:0:0" }, { "attributes": { @@ -5308,24 +6197,24 @@ ] }, "children": [], - "id": 363, + "id": 425, "name": "Block", - "src": "2739:2:0" + "src": "3198:2:0" } ], - "id": 364, + "id": 426, "name": "FunctionDefinition", - "src": "2720:21:0" + "src": "3179:21:0" } ], - "id": 365, + "id": 427, "name": "ContractDefinition", - "src": "87:2656:0" + "src": "87:3115:0" } ], - "id": 366, + "id": 428, "name": "SourceUnit", - "src": "0:2744:0" + "src": "0:3203:0" }, "compiler": { "name": "solc", @@ -5335,9 +6224,9 @@ "5777": { "events": {}, "links": {}, - "address": "0x345ca3e014aaf5dca488057592ee47305d9b3e10" + "address": "0xf328c11c4df88d18fcbd30ad38d8b4714f4b33bf" } }, "schemaVersion": "1.0.1", - "updatedAt": "2018-01-20T19:30:59.029Z" + "updatedAt": "2018-01-21T16:59:00.395Z" } \ No newline at end of file diff --git a/build/contracts/Migrations.json b/build/contracts/Migrations.json index 9e661d10..476a3c6f 100644 --- a/build/contracts/Migrations.json +++ b/build/contracts/Migrations.json @@ -819,9 +819,9 @@ "5777": { "events": {}, "links": {}, - "address": "0x8cdaf0cd259887258bc13a92c0a6da92698644c0" + "address": "0x2eca6fcfef74e2c8d03fbaf0ff6712314c9bd58b" } }, "schemaVersion": "1.0.1", - "updatedAt": "2018-01-20T19:30:59.025Z" + "updatedAt": "2018-01-21T16:59:00.389Z" } \ No newline at end of file diff --git a/build/contracts/SimpleStorage.json b/build/contracts/SimpleStorage.json index b8b6d9c1..79ad5451 100644 --- a/build/contracts/SimpleStorage.json +++ b/build/contracts/SimpleStorage.json @@ -344,5 +344,5 @@ } }, "schemaVersion": "1.0.1", - "updatedAt": "2018-01-20T19:30:59.025Z" + "updatedAt": "2018-01-21T16:59:00.388Z" } \ No newline at end of file diff --git a/contracts/CapCoin.sol b/contracts/CapCoin.sol index 08831083..3121e85f 100644 --- a/contracts/CapCoin.sol +++ b/contracts/CapCoin.sol @@ -10,6 +10,7 @@ contract CapCoin is Ownable { event LikedPost(int lotteryAmount, string posterName, address poster, uint posterCoinbalance, string likerName, address liker, uint likerCoinbalance); + event CashedOut(uint newCoinbalance, address user); uint coinSupply = 1000000; uint coinsBought = 0; @@ -94,6 +95,18 @@ contract CapCoin is Ownable { createPost(url, caption); } + function cashOut(uint weiAmount, uint coinAmount) public { + assert(addressToUser[msg.sender].coinBalance > coinAmount); + addressToUser[msg.sender].coinBalance -= coinAmount; + value -= weiAmount; + msg.sender.transfer(weiAmount); + CashedOut(addressToUser[msg.sender].coinBalance, msg.sender); + } + + function getContractBal() public view returns (uint) { + return value; + } + function kill() { if (msg.sender == owner) { selfdestruct(owner); diff --git a/src/components/Exchange.js b/src/components/Exchange.js index ab1ad66d..4fa50a70 100644 --- a/src/components/Exchange.js +++ b/src/components/Exchange.js @@ -3,7 +3,7 @@ import {connect} from 'react-redux' import SelectField from 'material-ui/SelectField'; import MenuItem from 'material-ui/MenuItem'; import RaisedButton from 'material-ui/RaisedButton'; -import { buyTokens } from '../store/user'; +import { buyTokens, cashOut } from '../store/user'; class Exchange extends Component { @@ -35,6 +35,11 @@ class Exchange extends Component { this.props.buyTokens(e, this.state.value, this.props.contract.buyTokens, this.props.accounts[0], this.props.web3.toWei)} label="Buy Tokens" primary={true} /> + + this.props.cashOut(e, this.props.user.coinBalance - 1, this.props.contract.cashOut, this.props.accounts[0], this.props.web3.toWei)} + label="Cash Out" primary={true} + />

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

); @@ -54,7 +59,11 @@ const mapDispatch = (dispatch) => { return { buyTokens: function(e, amount, contractFunc, account, conversionFunc){ e.preventDefault() - return dispatch(buyTokens(amount, contractFunc, account, conversionFunc)) + return dispatch(buyTokens(amount, contractFunc, account, conversionFunc)); + }, + cashOut: function(e, amount, contractFunc, account, conversionFunc) { + e.preventDefault() + return dispatch(cashOut(amount, contractFunc, account, conversionFunc)); } } } diff --git a/src/store/user.js b/src/store/user.js index 6186ab5b..a2d56d5a 100644 --- a/src/store/user.js +++ b/src/store/user.js @@ -13,6 +13,7 @@ const CREATE_USER = 'CREATE_USER'; const BUY_TOKENS = 'BUY_TOKENS'; const LIKED_POST = 'LIKED_POST'; const CREATE_POST = 'CREATE_POST'; +const CASHED_OUT = 'CASHED_OUT'; /** * ACTION CREATORS @@ -20,6 +21,7 @@ const CREATE_POST = 'CREATE_POST'; const getUser = user => ({type: GET_USER, user}) const createUser = user => ({type: CREATE_USER, user}) const boughtTokens = amount => ({type: BUY_TOKENS, amount}) +const cashedOut = amount => ({type: CASHED_OUT, amount}) /** * THUNK CREATORS @@ -54,10 +56,15 @@ export const addUser = (name, contractFunc, account) => export const buyTokens = (amount, contractFunc, account, conversionFunc) => dispatch => 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)); +export const cashOut = (amount, contractFunc, account, conversionFunc) => + dispatch => + contractFunc(conversionFunc(amount/10, 'wei'), amount, {from: account, gas: 1000000}) + .then(res => dispatch(cashedOut(res.logs[0].args.newCoinbalance.c[0]))) + .catch(err => console.log(err)); + /** * REDUCER */ @@ -77,6 +84,8 @@ export default function (state = defaultUser, action) { updatedUser.postLottery = action.post.tokenPot; updatedUser.coinBalance -= 5; return updatedUser; + case CASHED_OUT: + return Object.assign({}, state, {coinBalance: action.amount}); default: return state } From b6c109edde7dd7ab48187b8ce247cd2e4c192bcf Mon Sep 17 00:00:00 2001 From: Jonathan Schwartz Date: Sun, 21 Jan 2018 12:44:22 -0500 Subject: [PATCH 2/3] finishes cash out functionality --- contracts/CapCoin.sol | 2 +- src/components/Exchange.js | 27 ++++++++++++++++++++------- src/store/user.js | 4 ++-- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/contracts/CapCoin.sol b/contracts/CapCoin.sol index 3121e85f..70ea98f0 100644 --- a/contracts/CapCoin.sol +++ b/contracts/CapCoin.sol @@ -97,7 +97,7 @@ contract CapCoin is Ownable { function cashOut(uint weiAmount, uint coinAmount) public { assert(addressToUser[msg.sender].coinBalance > coinAmount); - addressToUser[msg.sender].coinBalance -= coinAmount; + addressToUser[msg.sender].coinBalance -= coinAmount + 1; value -= weiAmount; msg.sender.transfer(weiAmount); CashedOut(addressToUser[msg.sender].coinBalance, msg.sender); diff --git a/src/components/Exchange.js b/src/components/Exchange.js index 4fa50a70..cc1af628 100644 --- a/src/components/Exchange.js +++ b/src/components/Exchange.js @@ -4,15 +4,17 @@ import SelectField from 'material-ui/SelectField'; import MenuItem from 'material-ui/MenuItem'; import RaisedButton from 'material-ui/RaisedButton'; import { buyTokens, cashOut } from '../store/user'; +import TextField from 'material-ui/TextField'; class Exchange extends Component { constructor(props) { super(props); - this.state = {value: 1}; + this.state = {value: 1, cashOutAmount: ""}; } handleChange = (event, index, value) => this.setState({value}); + handleCashOutTextChange = (event) => this.setState({cashOutAmount: event.target.value}) render() { return ( @@ -35,12 +37,23 @@ class Exchange extends Component { this.props.buyTokens(e, this.state.value, this.props.contract.buyTokens, this.props.accounts[0], this.props.web3.toWei)} label="Buy Tokens" primary={true} /> - - this.props.cashOut(e, this.props.user.coinBalance - 1, this.props.contract.cashOut, this.props.accounts[0], this.props.web3.toWei)} - label="Cash Out" primary={true} - /> -

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

+

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


+ {this.props.user.coinBalance > 0 && +
+
+ + this.props.cashOut(e, Number(this.state.cashOutAmount - 1), this.props.contract.cashOut, this.props.accounts[0], this.props.web3.toWei)} + label="Cash Out" primary={true} + /> +

*NOTE: There is a 1 coin fee for cashing out*

+
+ } ); } diff --git a/src/store/user.js b/src/store/user.js index a2d56d5a..c0e3dc45 100644 --- a/src/store/user.js +++ b/src/store/user.js @@ -61,7 +61,7 @@ export const buyTokens = (amount, contractFunc, account, conversionFunc) => export const cashOut = (amount, contractFunc, account, conversionFunc) => dispatch => - contractFunc(conversionFunc(amount/10, 'wei'), amount, {from: account, gas: 1000000}) + contractFunc(conversionFunc(amount/10, 'ether'), amount, {from: account, gas: 1000000}) .then(res => dispatch(cashedOut(res.logs[0].args.newCoinbalance.c[0]))) .catch(err => console.log(err)); @@ -85,7 +85,7 @@ export default function (state = defaultUser, action) { updatedUser.coinBalance -= 5; return updatedUser; case CASHED_OUT: - return Object.assign({}, state, {coinBalance: action.amount}); + return Object.assign({}, state, {coinBalance: action.amount - 1}); default: return state } From d66fb0ea1ab5e15d800c31eada549601c17e440b Mon Sep 17 00:00:00 2001 From: Jonathan Schwartz Date: Sun, 21 Jan 2018 12:46:40 -0500 Subject: [PATCH 3/3] adds error handling to the cash out functionality --- src/components/Exchange.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Exchange.js b/src/components/Exchange.js index cc1af628..ba061c0d 100644 --- a/src/components/Exchange.js +++ b/src/components/Exchange.js @@ -44,6 +44,7 @@ class Exchange extends Component { hintText="Cash Out Amount" value={this.state.cashOutAmount} onChange={this.handleCashOutTextChange} + errorText={this.state.cashOutAmount > this.props.user.coinBalance - 1 && "Amount Needs to be less than your current coin balance"} />