From 87792e21cdfb3e6fb2fbac86985f14f3944c3adc Mon Sep 17 00:00:00 2001 From: Jonathan Schwartz Date: Sat, 20 Jan 2018 12:41:00 -0500 Subject: [PATCH] fixes negative number bug, and renders post properly after creating a post --- build/contracts/CapCoin.json | 1706 +++++++++++++++------------- build/contracts/Migrations.json | 2 +- build/contracts/SimpleStorage.json | 2 +- contracts/CapCoin.sol | 12 +- readme.md | 1 + src/components/CreatePost.js | 6 +- src/components/Explore.js | 4 +- src/store/posts.js | 7 +- 8 files changed, 932 insertions(+), 808 deletions(-) diff --git a/build/contracts/CapCoin.json b/build/contracts/CapCoin.json index 1c681f9e..efd3edf0 100644 --- a/build/contracts/CapCoin.json +++ b/build/contracts/CapCoin.json @@ -122,7 +122,7 @@ }, { "name": "lotteryAmount", - "type": "uint256" + "type": "int256" }, { "name": "owner", @@ -152,7 +152,7 @@ }, { "name": "", - "type": "uint256" + "type": "int256" }, { "name": "", @@ -163,6 +163,20 @@ "stateMutability": "view", "type": "function" }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, { "constant": false, "inputs": [ @@ -200,6 +214,20 @@ "stateMutability": "view", "type": "function" }, + { + "constant": false, + "inputs": [ + { + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, { "payable": true, "stateMutability": "payable", @@ -247,7 +275,7 @@ { "indexed": false, "name": "lotteryAmount", - "type": "uint256" + "type": "int256" }, { "indexed": false, @@ -282,20 +310,37 @@ ], "name": "LikedPost", "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" } ], - "bytecode": "0x6060604052620f42406000556000600155341561001b57600080fd5b6114b68061002a6000396000f3006060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630b1e7f83146100a657806326ec928f146101095780633610724e146101b257806341f3004a146101d5578063483515291461023f578063507ffba514610281578063763f17c4146102de578063832880e714610470578063c7303c61146105ab578063edf5388614610608575b005b34156100b157600080fd5b6100c760048080359060200190919050506106de565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561011457600080fd5b6101b0600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001909190505061071d565b005b34156101bd57600080fd5b6101d3600480803590602001909190505061073d565b005b34156101e057600080fd5b6101e8610828565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561022b578082015181840152602081019050610210565b505050509050019250505060405180910390f35b341561024a57600080fd5b61027f600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108bc565b005b341561028c57600080fd5b6102dc600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610cbb565b005b34156102e957600080fd5b610315600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dc1565b6040518080602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381038352878181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156103da5780601f106103af576101008083540402835291602001916103da565b820191906000526020600020905b8154815290600101906020018083116103bd57829003601f168201915b505083810382528681815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561045d5780601f106104325761010080835404028352916020019161045d565b820191906000526020600020905b81548152906001019060200180831161044057829003601f168201915b5050965050505050505060405180910390f35b341561047b57600080fd5b610483610e0f565b6040518080602001868152602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838103835288818151815260200191508051906020019080838360005b838110156105055780820151818401526020810190506104ea565b50505050905090810190601f1680156105325780820380516001836020036101000a031916815260200191505b50838103825286818151815260200191508051906020019080838360005b8381101561056b578082015181840152602081019050610550565b50505050905090810190601f1680156105985780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b34156105b657600080fd5b610606600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611078565b005b341561061357600080fd5b61063f600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506112e7565b60405180806020018381526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156106ce5780601f106106a3576101008083540402835291602001916106ce565b820191906000526020600020905b8154815290600101906020018083116106b157829003601f168201915b5050935050505060405180910390f35b6004818154811015156106ed57fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61072683610cbb565b61072f8161073d565b61073882611078565b505050565b80600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160008282540192505081905550806001600082825401925050819055508060008082825403925050819055507ffe1367e498701f2dfab80a3d41740d46fd7cba533430e611917f0f3df823279a600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546040518082815260200191505060405180910390a150565b61083061130a565b60048054806020026020016040519081016040528092919081815260200182805480156108b257602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610868575b5050505050905090565b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002016000828254019250508190555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000828254019250508190555080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507fbff1ac68a13cbdab28e6de75699dd1ba01a6aa53a81fb91d17a43b4b12d38267600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000184600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000133600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015460405180888152602001806020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001868152602001806020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001838103835289818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015610c1f5780601f10610bf457610100808354040283529160200191610c1f565b820191906000526020600020905b815481529060010190602001808311610c0257829003601f168201915b5050838103825286818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015610ca25780601f10610c7757610100808354040283529160200191610ca2565b820191906000526020600020905b815481529060010190602001808311610c8557829003601f168201915b5050995050505050505050505060405180910390a15050565b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905081816000019080519060200190610d1692919061131e565b50600081600101819055507f66ab3fea2083d9ba15d99b595186fe7fc18e6eba393c0fc056f420e96c3caa44826040518080602001828103825283818151815260200191508051906020019080838360005b83811015610d83578082015181840152602081019050610d68565b50505050905090810190601f168015610db05780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b6003602052806000526040600020600091509050806000019080600101908060020154908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905084565b610e1761139e565b6000610e2161139e565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015433848054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610fc45780601f10610f9957610100808354040283529160200191610fc4565b820191906000526020600020905b815481529060010190602001808311610fa757829003601f168201915b50505050509450828054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110605780601f1061103557610100808354040283529160200191611060565b820191906000526020600020905b81548152906001019060200180831161104357829003601f168201915b50505050509250945094509450945094509091929394565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050818160000190805190602001906110d392919061131e565b5060058160020160008282540392505081905550600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181600101908054600181600116156101000203166002900461114c9291906113b2565b50338160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600480548060010182816111a69190611439565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050506005600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507f3b6c110dfadc879ec2bbc1dc567f9065fd5ea5846bce75fddba0f60ffcc79fac826040518080602001828103825283818151815260200191508051906020019080838360005b838110156112a957808201518184015260208101905061128e565b50505050905090810190601f1680156112d65780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b600260205280600052604060002060009150905080600001908060010154905082565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061135f57805160ff191683800117855561138d565b8280016001018555821561138d579182015b8281111561138c578251825591602001919060010190611371565b5b50905061139a9190611465565b5090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106113eb5780548555611428565b8280016001018555821561142857600052602060002091601f016020900482015b8281111561142757825482559160010191906001019061140c565b5b5090506114359190611465565b5090565b8154818355818115116114605781836000526020600020918201910161145f9190611465565b5b505050565b61148791905b8082111561148357600081600090555060010161146b565b5090565b905600a165627a7a72305820c072614d4e15ca2592eb0198844951eab32bd2b8c304acafb0db042e9add91f20029", - "deployedBytecode": "0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630b1e7f83146100a657806326ec928f146101095780633610724e146101b257806341f3004a146101d5578063483515291461023f578063507ffba514610281578063763f17c4146102de578063832880e714610470578063c7303c61146105ab578063edf5388614610608575b005b34156100b157600080fd5b6100c760048080359060200190919050506106de565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561011457600080fd5b6101b0600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001909190505061071d565b005b34156101bd57600080fd5b6101d3600480803590602001909190505061073d565b005b34156101e057600080fd5b6101e8610828565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561022b578082015181840152602081019050610210565b505050509050019250505060405180910390f35b341561024a57600080fd5b61027f600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108bc565b005b341561028c57600080fd5b6102dc600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610cbb565b005b34156102e957600080fd5b610315600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dc1565b6040518080602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381038352878181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156103da5780601f106103af576101008083540402835291602001916103da565b820191906000526020600020905b8154815290600101906020018083116103bd57829003601f168201915b505083810382528681815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561045d5780601f106104325761010080835404028352916020019161045d565b820191906000526020600020905b81548152906001019060200180831161044057829003601f168201915b5050965050505050505060405180910390f35b341561047b57600080fd5b610483610e0f565b6040518080602001868152602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838103835288818151815260200191508051906020019080838360005b838110156105055780820151818401526020810190506104ea565b50505050905090810190601f1680156105325780820380516001836020036101000a031916815260200191505b50838103825286818151815260200191508051906020019080838360005b8381101561056b578082015181840152602081019050610550565b50505050905090810190601f1680156105985780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b34156105b657600080fd5b610606600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611078565b005b341561061357600080fd5b61063f600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506112e7565b60405180806020018381526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156106ce5780601f106106a3576101008083540402835291602001916106ce565b820191906000526020600020905b8154815290600101906020018083116106b157829003601f168201915b5050935050505060405180910390f35b6004818154811015156106ed57fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61072683610cbb565b61072f8161073d565b61073882611078565b505050565b80600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160008282540192505081905550806001600082825401925050819055508060008082825403925050819055507ffe1367e498701f2dfab80a3d41740d46fd7cba533430e611917f0f3df823279a600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546040518082815260200191505060405180910390a150565b61083061130a565b60048054806020026020016040519081016040528092919081815260200182805480156108b257602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610868575b5050505050905090565b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002016000828254019250508190555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000828254019250508190555080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507fbff1ac68a13cbdab28e6de75699dd1ba01a6aa53a81fb91d17a43b4b12d38267600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000184600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000133600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015460405180888152602001806020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001868152602001806020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001838103835289818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015610c1f5780601f10610bf457610100808354040283529160200191610c1f565b820191906000526020600020905b815481529060010190602001808311610c0257829003601f168201915b5050838103825286818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015610ca25780601f10610c7757610100808354040283529160200191610ca2565b820191906000526020600020905b815481529060010190602001808311610c8557829003601f168201915b5050995050505050505050505060405180910390a15050565b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905081816000019080519060200190610d1692919061131e565b50600081600101819055507f66ab3fea2083d9ba15d99b595186fe7fc18e6eba393c0fc056f420e96c3caa44826040518080602001828103825283818151815260200191508051906020019080838360005b83811015610d83578082015181840152602081019050610d68565b50505050905090810190601f168015610db05780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b6003602052806000526040600020600091509050806000019080600101908060020154908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905084565b610e1761139e565b6000610e2161139e565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015433848054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610fc45780601f10610f9957610100808354040283529160200191610fc4565b820191906000526020600020905b815481529060010190602001808311610fa757829003601f168201915b50505050509450828054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110605780601f1061103557610100808354040283529160200191611060565b820191906000526020600020905b81548152906001019060200180831161104357829003601f168201915b50505050509250945094509450945094509091929394565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050818160000190805190602001906110d392919061131e565b5060058160020160008282540392505081905550600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181600101908054600181600116156101000203166002900461114c9291906113b2565b50338160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600480548060010182816111a69190611439565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050506005600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507f3b6c110dfadc879ec2bbc1dc567f9065fd5ea5846bce75fddba0f60ffcc79fac826040518080602001828103825283818151815260200191508051906020019080838360005b838110156112a957808201518184015260208101905061128e565b50505050905090810190601f1680156112d65780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b600260205280600052604060002060009150905080600001908060010154905082565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061135f57805160ff191683800117855561138d565b8280016001018555821561138d579182015b8281111561138c578251825591602001919060010190611371565b5b50905061139a9190611465565b5090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106113eb5780548555611428565b8280016001018555821561142857600052602060002091601f016020900482015b8281111561142757825482559160010191906001019061140c565b5b5090506114359190611465565b5090565b8154818355818115116114605781836000526020600020918201910161145f9190611465565b5b505050565b61148791905b8082111561148357600081600090555060010161146b565b5090565b905600a165627a7a72305820c072614d4e15ca2592eb0198844951eab32bd2b8c304acafb0db042e9add91f20029", - "sourceMap": "26:2323:0:-;;;332:7;314:25;;362:1;343:20;;26:2323;;;;;;;;;;;;;;", - "deployedSourceMap": "26:2323:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;629:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2177:136;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1119:207;;;;;;;;;;;;;;;;;;;;;;;;;;2096: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;;;;;;;;;;;;;;;;;1676:416:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;656:154;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;579:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;814:274;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1330:342:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;529:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;629:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;2177:136::-;2244:16;2255:4;2244:10;:16::i;:::-;2268:17;2278:6;2268:9;:17::i;:::-;2293:15;2304:3;2293:10;:15::i;:::-;2177:136;;;:::o;1119:207::-;1205:6;1164:13;:25;1178:10;1164:25;;;;;;;;;;;;;;;:37;;;:47;;;;;;;;;;;1232:6;1217:11;;:21;;;;;;;;;;;1258:6;1244:10;;:20;;;;;;;;;;;1270:51;1283:13;:25;1297:10;1283:25;;;;;;;;;;;;;;;:37;;;1270:51;;;;;;;;;;;;;;;;;;1119:207;:::o;2096:77::-;2137:9;;:::i;:::-;2163:5;2156:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2096:77;:::o;1676:416::-;1771:6;1734:13;:19;1748:4;1734:19;;;;;;;;;;;;;;;:33;;;:43;;;;;;;;;;;1818:6;1783:13;:19;1797:4;1783:19;;;;;;;;;;;;;;;:31;;;:41;;;;;;;;;;;1871:6;1830:13;:25;1844:10;1830:25;;;;;;;;;;;;;;;:37;;;:47;;;;;;;;;;;1883:204;1893:13;:19;1907:4;1893:19;;;;;;;;;;;;;;;:33;;;1934:13;:19;1948:4;1934:19;;;;;;;;;;;;;;;:24;;1960:4;1966:13;:19;1980:4;1966:19;;;;;;;;;;;;;;;:31;;;2005:13;:25;2019:10;2005:25;;;;;;;;;;;;;;;:30;;2037:10;2049:13;:25;2063:10;2049:25;;;;;;;;;;;;;;;:37;;;1883:204;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1676:416;;:::o;656:154::-;702:8;713:13;:25;727:10;713:25;;;;;;;;;;;;;;;702:36;;756:4;744;:9;;:16;;;;;;;;;;;;:::i;:::-;;785:1;766:4;:16;;:20;;;;792:13;800:4;792: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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;656:154:0;;:::o;579:46::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;814:274::-;854:6;;:::i;:::-;862:4;868:6;;:::i;:::-;876:4;882:7;905:13;:25;919:10;905:25;;;;;;;;;;;;;;;:30;;943:13;:25;957:10;943:25;;;;;;;;;;;;;;;:37;;;988:13;:25;1002:10;988:25;;;;;;;;;;;;;;;:29;;1025:13;:25;1039:10;1025:25;;;;;;;;;;;;;;;:39;;;1072:10;897:186;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;814:274;;;;;:::o;1330:342::-;1399:8;1410:13;:25;1424:10;1410:25;;;;;;;;;;;;;;;1399:36;;1452:3;1441:4;:8;;:14;;;;;;;;;;;;:::i;:::-;;1483:1;1461:4;:18;;;:23;;;;;;;;;;;1506:13;:25;1520:10;1506:25;;;;;;;;;;;;;;;:30;;1490:4;:13;;:46;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1555:10;1542:4;:10;;;:23;;;;;;;;;;;;;;;;;;1596:1;1572:5;:22;;;;;;;;;;;:::i;:::-;;;;;;;;;;1583:10;1572:22;;;;;;;;;;;;;;;;;;;;;;:25;;1644:1;1603:13;:25;1617:10;1603:25;;;;;;;;;;;;;;;:37;;;:42;;;;;;;;;;;1651:16;1663:3;1651:16;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1330:342:0;;:::o;529:46::-;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;26:2323::-;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o", - "source": "pragma solidity ^0.4.18;\n\ncontract CapCoin {\n\n event NewUser(string name);\n event BoughtTokens(uint coinBalance);\n event CreatedPost(string url);\n event LikedPost(uint lotteryAmount, string posterName,\n address poster, uint posterCoinbalance, string likerName,\n address liker, uint likerCoinbalance);\n\n uint coinSupply = 1000000;\n uint coinsBought = 0;\n\n struct User {\n string name;\n uint coinBalance;\n }\n\n struct Post {\n string url;\n string userName;\n uint lotteryAmount;\n address owner;\n }\n\n mapping (address => User) public addressToUser;\n mapping (address => Post) public addressToPost;\n address[] public posts;\n\n function createUser(string name) public {\n var user = addressToUser[msg.sender];\n user.name = name;\n user.coinBalance = 0;\n NewUser(name);\n }\n\n function getUser() public view returns (string, uint, string, uint, address) {\n return (addressToUser[msg.sender].name,\n addressToUser[msg.sender].coinBalance,\n addressToPost[msg.sender].url,\n addressToPost[msg.sender].lotteryAmount,\n msg.sender);\n }\n\n // need to add economics\n function buyTokens(uint amount) public {\n addressToUser[msg.sender].coinBalance += amount;\n coinsBought += amount;\n coinSupply -= amount;\n BoughtTokens(addressToUser[msg.sender].coinBalance);\n }\n\n function createPost(string url) public {\n // 5 coins per post\n var post = addressToPost[msg.sender];\n post.url = url;\n post.lotteryAmount -= 5;\n post.userName = addressToUser[msg.sender].name;\n post.owner = msg.sender;\n\n posts.push(msg.sender) -1;\n addressToUser[msg.sender].coinBalance -= 5;\n CreatedPost(url);\n }\n\n function likePost(address post, uint amount) public {\n addressToPost[post].lotteryAmount += amount;\n addressToUser[post].coinBalance += amount;\n addressToUser[msg.sender].coinBalance -= amount;\n LikedPost(addressToPost[post].lotteryAmount,\n addressToUser[post].name, post, addressToUser[post].coinBalance,\n addressToUser[msg.sender].name, msg.sender, addressToUser[msg.sender].coinBalance);\n }\n\n function getPosts() public view returns (address[]) {\n return posts;\n }\n\n function seed(string name, string url, uint amount) public {\n createUser(name);\n buyTokens(amount);\n createPost(url);\n }\n\n function() internal payable {}\n}\n", + "bytecode": "0x6060604052620f42406001556000600255336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506116d58061005f6000396000f3006060604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630b1e7f83146100bc57806326ec928f1461011f5780633610724e146101c857806341f3004a146101eb5780634835152914610255578063507ffba514610297578063763f17c4146102f4578063832880e7146104865780638da5cb5b146105c1578063c7303c6114610616578063edf5388614610673578063f2fde38b14610749575b005b34156100c757600080fd5b6100dd6004808035906020019091905050610782565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561012a57600080fd5b6101c6600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919080359060200190919050506107c1565b005b34156101d357600080fd5b6101e960048080359060200190919050506107e1565b005b34156101f657600080fd5b6101fe6108cd565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610241578082015181840152602081019050610226565b505050509050019250505060405180910390f35b341561026057600080fd5b610295600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610961565b005b34156102a257600080fd5b6102f2600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610d60565b005b34156102ff57600080fd5b61032b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e66565b6040518080602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381038352878181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156103f05780601f106103c5576101008083540402835291602001916103f0565b820191906000526020600020905b8154815290600101906020018083116103d357829003601f168201915b50508381038252868181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104735780601f1061044857610100808354040283529160200191610473565b820191906000526020600020905b81548152906001019060200180831161045657829003601f168201915b5050965050505050505060405180910390f35b341561049157600080fd5b610499610eb4565b6040518080602001868152602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838103835288818151815260200191508051906020019080838360005b8381101561051b578082015181840152602081019050610500565b50505050905090810190601f1680156105485780820380516001836020036101000a031916815260200191505b50838103825286818151815260200191508051906020019080838360005b83811015610581578082015181840152602081019050610566565b50505050905090810190601f1680156105ae5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b34156105cc57600080fd5b6105d461111d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561062157600080fd5b610671600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611142565b005b341561067e57600080fd5b6106aa600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506113b1565b60405180806020018381526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156107395780601f1061070e57610100808354040283529160200191610739565b820191906000526020600020905b81548152906001019060200180831161071c57829003601f168201915b5050935050505060405180910390f35b341561075457600080fd5b610780600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506113d4565b005b60058181548110151561079157fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6107ca83610d60565b6107d3816107e1565b6107dc82611142565b505050565b80600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000828254019250508190555080600260008282540192505081905550806001600082825403925050819055507ffe1367e498701f2dfab80a3d41740d46fd7cba533430e611917f0f3df823279a600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546040518082815260200191505060405180910390a150565b6108d5611529565b600580548060200260200160405190810160405280929190818152602001828054801561095757602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161090d575b5050505050905090565b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002016000828254019250508190555080600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000828254019250508190555080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507f050cbab7fede968f252efba864c75069d68302f756e7f9c0093fb37faf2ba79b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000184600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000133600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015460405180888152602001806020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001868152602001806020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001838103835289818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015610cc45780601f10610c9957610100808354040283529160200191610cc4565b820191906000526020600020905b815481529060010190602001808311610ca757829003601f168201915b5050838103825286818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015610d475780601f10610d1c57610100808354040283529160200191610d47565b820191906000526020600020905b815481529060010190602001808311610d2a57829003601f168201915b5050995050505050505050505060405180910390a15050565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905081816000019080519060200190610dbb92919061153d565b50600081600101819055507f66ab3fea2083d9ba15d99b595186fe7fc18e6eba393c0fc056f420e96c3caa44826040518080602001828103825283818151815260200191508051906020019080838360005b83811015610e28578082015181840152602081019050610e0d565b50505050905090810190601f168015610e555780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b6004602052806000526040600020600091509050806000019080600101908060020154908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905084565b610ebc6115bd565b6000610ec66115bd565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015433848054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110695780601f1061103e57610100808354040283529160200191611069565b820191906000526020600020905b81548152906001019060200180831161104c57829003601f168201915b50505050509450828054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111055780601f106110da57610100808354040283529160200191611105565b820191906000526020600020905b8154815290600101906020018083116110e857829003601f168201915b50505050509250945094509450945094509091929394565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508181600001908051906020019061119d92919061153d565b5060058160020160008282540392505081905550600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018160010190805460018160011615610100020316600290046112169291906115d1565b50338160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600580548060010182816112709190611658565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050506005600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507f3b6c110dfadc879ec2bbc1dc567f9065fd5ea5846bce75fddba0f60ffcc79fac826040518080602001828103825283818151815260200191508051906020019080838360005b83811015611373578082015181840152602081019050611358565b50505050905090810190601f1680156113a05780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b600360205280600052604060002060009150905080600001908060010154905082565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561142f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561146b57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061157e57805160ff19168380011785556115ac565b828001600101855582156115ac579182015b828111156115ab578251825591602001919060010190611590565b5b5090506115b99190611684565b5090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061160a5780548555611647565b8280016001018555821561164757600052602060002091601f016020900482015b8281111561164657825482559160010191906001019061162b565b5b5090506116549190611684565b5090565b81548183558181151161167f5781836000526020600020918201910161167e9190611684565b5b505050565b6116a691905b808211156116a257600081600090555060010161168a565b5090565b905600a165627a7a72305820c8d27162de90e72ae6d5bafdd895303d2b48087064dedf0b126fd7a1747a87b00029", + "deployedBytecode": "0x6060604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630b1e7f83146100bc57806326ec928f1461011f5780633610724e146101c857806341f3004a146101eb5780634835152914610255578063507ffba514610297578063763f17c4146102f4578063832880e7146104865780638da5cb5b146105c1578063c7303c6114610616578063edf5388614610673578063f2fde38b14610749575b005b34156100c757600080fd5b6100dd6004808035906020019091905050610782565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561012a57600080fd5b6101c6600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919080359060200190919050506107c1565b005b34156101d357600080fd5b6101e960048080359060200190919050506107e1565b005b34156101f657600080fd5b6101fe6108cd565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610241578082015181840152602081019050610226565b505050509050019250505060405180910390f35b341561026057600080fd5b610295600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610961565b005b34156102a257600080fd5b6102f2600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610d60565b005b34156102ff57600080fd5b61032b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e66565b6040518080602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381038352878181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156103f05780601f106103c5576101008083540402835291602001916103f0565b820191906000526020600020905b8154815290600101906020018083116103d357829003601f168201915b50508381038252868181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104735780601f1061044857610100808354040283529160200191610473565b820191906000526020600020905b81548152906001019060200180831161045657829003601f168201915b5050965050505050505060405180910390f35b341561049157600080fd5b610499610eb4565b6040518080602001868152602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838103835288818151815260200191508051906020019080838360005b8381101561051b578082015181840152602081019050610500565b50505050905090810190601f1680156105485780820380516001836020036101000a031916815260200191505b50838103825286818151815260200191508051906020019080838360005b83811015610581578082015181840152602081019050610566565b50505050905090810190601f1680156105ae5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b34156105cc57600080fd5b6105d461111d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561062157600080fd5b610671600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611142565b005b341561067e57600080fd5b6106aa600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506113b1565b60405180806020018381526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156107395780601f1061070e57610100808354040283529160200191610739565b820191906000526020600020905b81548152906001019060200180831161071c57829003601f168201915b5050935050505060405180910390f35b341561075457600080fd5b610780600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506113d4565b005b60058181548110151561079157fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6107ca83610d60565b6107d3816107e1565b6107dc82611142565b505050565b80600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000828254019250508190555080600260008282540192505081905550806001600082825403925050819055507ffe1367e498701f2dfab80a3d41740d46fd7cba533430e611917f0f3df823279a600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546040518082815260200191505060405180910390a150565b6108d5611529565b600580548060200260200160405190810160405280929190818152602001828054801561095757602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161090d575b5050505050905090565b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002016000828254019250508190555080600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000828254019250508190555080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507f050cbab7fede968f252efba864c75069d68302f756e7f9c0093fb37faf2ba79b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000184600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000133600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015460405180888152602001806020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001868152602001806020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001838103835289818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015610cc45780601f10610c9957610100808354040283529160200191610cc4565b820191906000526020600020905b815481529060010190602001808311610ca757829003601f168201915b5050838103825286818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015610d475780601f10610d1c57610100808354040283529160200191610d47565b820191906000526020600020905b815481529060010190602001808311610d2a57829003601f168201915b5050995050505050505050505060405180910390a15050565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905081816000019080519060200190610dbb92919061153d565b50600081600101819055507f66ab3fea2083d9ba15d99b595186fe7fc18e6eba393c0fc056f420e96c3caa44826040518080602001828103825283818151815260200191508051906020019080838360005b83811015610e28578082015181840152602081019050610e0d565b50505050905090810190601f168015610e555780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b6004602052806000526040600020600091509050806000019080600101908060020154908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905084565b610ebc6115bd565b6000610ec66115bd565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015433848054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110695780601f1061103e57610100808354040283529160200191611069565b820191906000526020600020905b81548152906001019060200180831161104c57829003601f168201915b50505050509450828054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111055780601f106110da57610100808354040283529160200191611105565b820191906000526020600020905b8154815290600101906020018083116110e857829003601f168201915b50505050509250945094509450945094509091929394565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508181600001908051906020019061119d92919061153d565b5060058160020160008282540392505081905550600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018160010190805460018160011615610100020316600290046112169291906115d1565b50338160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600580548060010182816112709190611658565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050506005600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507f3b6c110dfadc879ec2bbc1dc567f9065fd5ea5846bce75fddba0f60ffcc79fac826040518080602001828103825283818151815260200191508051906020019080838360005b83811015611373578082015181840152602081019050611358565b50505050905090810190601f1680156113a05780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b600360205280600052604060002060009150905080600001908060010154905082565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561142f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561146b57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061157e57805160ff19168380011785556115ac565b828001600101855582156115ac579182015b828111156115ab578251825591602001919060010190611590565b5b5090506115b99190611684565b5090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061160a5780548555611647565b8280016001018555821561164757600052602060002091601f016020900482015b8281111561164657825482559160010191906001019061162b565b5b5090506116549190611684565b5090565b81548183558181151161167f5781836000526020600020918201910161167e9190611684565b5b505050565b6116a691905b808211156116a257600081600090555060010161168a565b5090565b905600a165627a7a72305820c8d27162de90e72ae6d5bafdd895303d2b48087064dedf0b126fd7a1747a87b00029", + "sourceMap": "87:2336:0:-;;;403:7;385:25;;433:1;414:20;;509:10:1;501:5;;:18;;;;;;;;;;;;;;;;;;87:2336:0;;;;;;", + "deployedSourceMap": "87:2336:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;699:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2251:136;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1188:207;;;;;;;;;;;;;;;;;;;;;;;;;;2170:77;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;1745:421:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;726:154;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;649:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;884:273;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;238:20:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1399:342:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;599:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;834:169:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;699:22:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;2251:136::-;2318:16;2329:4;2318:10;:16::i;:::-;2342:17;2352:6;2342:9;:17::i;:::-;2367:15;2378:3;2367:10;:15::i;:::-;2251:136;;;:::o;1188:207::-;1274:6;1233:13;:25;1247:10;1233:25;;;;;;;;;;;;;;;:37;;;:47;;;;;;;;;;;1301:6;1286:11;;:21;;;;;;;;;;;1327:6;1313:10;;:20;;;;;;;;;;;1339:51;1352:13;:25;1366:10;1352:25;;;;;;;;;;;;;;;:37;;;1339:51;;;;;;;;;;;;;;;;;;1188:207;:::o;2170:77::-;2211:9;;:::i;:::-;2237:5;2230:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2170:77;:::o;1745:421::-;1844:6;1803:13;:19;1817:4;1803:19;;;;;;;;;;;;;;;:33;;;:48;;;;;;;;;;;1892:6;1857:13;:19;1871:4;1857:19;;;;;;;;;;;;;;;:31;;;:41;;;;;;;;;;;1945:6;1904:13;:25;1918:10;1904:25;;;;;;;;;;;;;;;:37;;;:47;;;;;;;;;;;1957:204;1967:13;:19;1981:4;1967:19;;;;;;;;;;;;;;;:33;;;2008:13;:19;2022:4;2008:19;;;;;;;;;;;;;;;:24;;2034:4;2040:13;:19;2054:4;2040:19;;;;;;;;;;;;;;;:31;;;2079:13;:25;2093:10;2079:25;;;;;;;;;;;;;;;:30;;2111:10;2123:13;:25;2137:10;2123:25;;;;;;;;;;;;;;;:37;;;1957:204;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1745:421;;:::o;726:154::-;772:8;783:13;:25;797:10;783:25;;;;;;;;;;;;;;;772:36;;826:4;814;:9;;:16;;;;;;;;;;;;:::i;:::-;;855:1;836:4;:16;;:20;;;;862:13;870:4;862:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;726:154:0;;:::o;649:46::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;884:273::-;924:6;;:::i;:::-;932:4;938:6;;:::i;:::-;946:3;951:7;974:13;:25;988:10;974:25;;;;;;;;;;;;;;;:30;;1012:13;:25;1026:10;1012:25;;;;;;;;;;;;;;;:37;;;1057:13;:25;1071:10;1057:25;;;;;;;;;;;;;;;:29;;1094:13;:25;1108:10;1094:25;;;;;;;;;;;;;;;:39;;;1141:10;966:186;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;884:273;;;;;:::o;238:20:1:-;;;;;;;;;;;;;:::o;1399:342:0:-;1468:8;1479:13;:25;1493:10;1479:25;;;;;;;;;;;;;;;1468:36;;1521:3;1510:4;:8;;:14;;;;;;;;;;;;:::i;:::-;;1552:1;1530:4;:18;;;:23;;;;;;;;;;;1575:13;:25;1589:10;1575:25;;;;;;;;;;;;;;;:30;;1559:4;:13;;:46;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1624:10;1611:4;:10;;;:23;;;;;;;;;;;;;;;;;;1665:1;1641:5;:22;;;;;;;;;;;:::i;:::-;;;;;;;;;;1652:10;1641:22;;;;;;;;;;;;;;;;;;;;;;:25;;1713:1;1672:13;:25;1686:10;1672:25;;;;;;;;;;;;;;;:37;;;:42;;;;;;;;;;;1720:16;1732:3;1720:16;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:2;8:100;;;99:1;94:3;90;84:5;80:1;75:3;71;64:6;52:2;49:1;45:3;40:15;;8:100;;;12:14;3:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1399:342:0;;:::o;599:46::-;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;834:169:1:-;654:5;;;;;;;;;;;640:19;;:10;:19;;;632:28;;;;;;;;930:1;910:22;;:8;:22;;;;902:31;;;;;;;;967:8;939:37;;960:5;;;;;;;;;;;939:37;;;;;;;;;;;;990:8;982:5;;:16;;;;;;;;;;;;;;;;;;834:169;:::o;87:2336:0:-;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o", + "source": "pragma solidity ^0.4.18;\n\nimport 'zeppelin-solidity/contracts/ownership/Ownable.sol';\n\ncontract CapCoin is Ownable {\n\n event NewUser(string name);\n event BoughtTokens(uint coinBalance);\n event CreatedPost(string url);\n event LikedPost(int lotteryAmount, string posterName,\n address poster, uint posterCoinbalance, string likerName,\n address liker, uint likerCoinbalance);\n\n uint coinSupply = 1000000;\n uint coinsBought = 0;\n\n struct User {\n string name;\n uint coinBalance;\n }\n\n struct Post {\n string url;\n string userName;\n int lotteryAmount;\n address owner;\n }\n\n mapping (address => User) public addressToUser;\n mapping (address => Post) public addressToPost;\n address[] public posts;\n\n function createUser(string name) public {\n var user = addressToUser[msg.sender];\n user.name = name;\n user.coinBalance = 0;\n NewUser(name);\n }\n\n function getUser() public view returns (string, uint, string, int, address) {\n return (addressToUser[msg.sender].name,\n addressToUser[msg.sender].coinBalance,\n addressToPost[msg.sender].url,\n addressToPost[msg.sender].lotteryAmount,\n msg.sender);\n }\n\n // need to add economics\n function buyTokens(uint amount) public {\n addressToUser[msg.sender].coinBalance += amount;\n coinsBought += amount;\n coinSupply -= amount;\n BoughtTokens(addressToUser[msg.sender].coinBalance);\n }\n\n function createPost(string url) public {\n // 5 coins per post\n var post = addressToPost[msg.sender];\n post.url = url;\n post.lotteryAmount -= 5;\n post.userName = addressToUser[msg.sender].name;\n post.owner = msg.sender;\n\n posts.push(msg.sender) -1;\n addressToUser[msg.sender].coinBalance -= 5;\n CreatedPost(url);\n }\n\n function likePost(address post, uint amount) public {\n addressToPost[post].lotteryAmount += int(amount);\n addressToUser[post].coinBalance += amount;\n addressToUser[msg.sender].coinBalance -= amount;\n LikedPost(addressToPost[post].lotteryAmount,\n addressToUser[post].name, post, addressToUser[post].coinBalance,\n addressToUser[msg.sender].name, msg.sender, addressToUser[msg.sender].coinBalance);\n }\n\n function getPosts() public view returns (address[]) {\n return posts;\n }\n\n function seed(string name, string url, uint amount) public {\n createUser(name);\n buyTokens(amount);\n createPost(url);\n }\n\n function() internal payable {}\n}\n", "sourcePath": "/Users/schwartzz8990/Dropbox/fullstack/capCoin/contracts/CapCoin.sol", "ast": { "attributes": { "absolutePath": "/Users/schwartzz8990/Dropbox/fullstack/capCoin/contracts/CapCoin.sol", "exportedSymbols": { "CapCoin": [ - 312 + 317 ] } }, @@ -315,22 +360,58 @@ }, { "attributes": { - "baseContracts": [ + "SourceUnit": 374, + "absolutePath": "zeppelin-solidity/contracts/ownership/Ownable.sol", + "file": "zeppelin-solidity/contracts/ownership/Ownable.sol", + "scope": 318, + "symbolAliases": [ null ], + "unitAlias": "" + }, + "id": 2, + "name": "ImportDirective", + "src": "26:59:0" + }, + { + "attributes": { "contractDependencies": [ - null + 373 ], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "linearizedBaseContracts": [ - 312 + 317, + 373 ], "name": "CapCoin", - "scope": 313 + "scope": 318 }, "children": [ + { + "attributes": { + "arguments": [ + null + ] + }, + "children": [ + { + "attributes": { + "contractScope": null, + "name": "Ownable", + "referencedDeclaration": 373, + "type": "contract Ownable" + }, + "id": 3, + "name": "UserDefinedTypeName", + "src": "107:7:0" + } + ], + "id": 4, + "name": "InheritanceSpecifier", + "src": "107:7:0" + }, { "attributes": { "anonymous": false, @@ -344,7 +425,7 @@ "constant": false, "indexed": false, "name": "name", - "scope": 5, + "scope": 8, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -357,24 +438,24 @@ "name": "string", "type": "string storage pointer" }, - "id": 2, + "id": 5, "name": "ElementaryTypeName", - "src": "62:6:0" + "src": "134:6:0" } ], - "id": 3, + "id": 6, "name": "VariableDeclaration", - "src": "62:11:0" + "src": "134:11:0" } ], - "id": 4, + "id": 7, "name": "ParameterList", - "src": "61:13:0" + "src": "133:13:0" } ], - "id": 5, + "id": 8, "name": "EventDefinition", - "src": "48:27:0" + "src": "120:27:0" }, { "attributes": { @@ -389,7 +470,7 @@ "constant": false, "indexed": false, "name": "coinBalance", - "scope": 9, + "scope": 12, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -402,24 +483,24 @@ "name": "uint", "type": "uint256" }, - "id": 6, + "id": 9, "name": "ElementaryTypeName", - "src": "97:4:0" + "src": "169:4:0" } ], - "id": 7, + "id": 10, "name": "VariableDeclaration", - "src": "97:16:0" + "src": "169:16:0" } ], - "id": 8, + "id": 11, "name": "ParameterList", - "src": "96:18:0" + "src": "168:18:0" } ], - "id": 9, + "id": 12, "name": "EventDefinition", - "src": "78:37:0" + "src": "150:37:0" }, { "attributes": { @@ -434,7 +515,7 @@ "constant": false, "indexed": false, "name": "url", - "scope": 13, + "scope": 16, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -447,24 +528,24 @@ "name": "string", "type": "string storage pointer" }, - "id": 10, + "id": 13, "name": "ElementaryTypeName", - "src": "136:6:0" + "src": "208:6:0" } ], - "id": 11, + "id": 14, "name": "VariableDeclaration", - "src": "136:10:0" + "src": "208:10:0" } ], - "id": 12, + "id": 15, "name": "ParameterList", - "src": "135:12:0" + "src": "207:12:0" } ], - "id": 13, + "id": 16, "name": "EventDefinition", - "src": "118:30:0" + "src": "190:30:0" }, { "attributes": { @@ -479,34 +560,34 @@ "constant": false, "indexed": false, "name": "lotteryAmount", - "scope": 29, + "scope": 32, "stateVariable": false, "storageLocation": "default", - "type": "uint256", + "type": "int256", "value": null, "visibility": "internal" }, "children": [ { "attributes": { - "name": "uint", - "type": "uint256" + "name": "int", + "type": "int256" }, - "id": 14, + "id": 17, "name": "ElementaryTypeName", - "src": "167:4:0" + "src": "239:3:0" } ], - "id": 15, + "id": 18, "name": "VariableDeclaration", - "src": "167:18:0" + "src": "239:17:0" }, { "attributes": { "constant": false, "indexed": false, "name": "posterName", - "scope": 29, + "scope": 32, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -519,21 +600,21 @@ "name": "string", "type": "string storage pointer" }, - "id": 16, + "id": 19, "name": "ElementaryTypeName", - "src": "187:6:0" + "src": "258:6:0" } ], - "id": 17, + "id": 20, "name": "VariableDeclaration", - "src": "187:17:0" + "src": "258:17:0" }, { "attributes": { "constant": false, "indexed": false, "name": "poster", - "scope": 29, + "scope": 32, "stateVariable": false, "storageLocation": "default", "type": "address", @@ -546,21 +627,21 @@ "name": "address", "type": "address" }, - "id": 18, + "id": 21, "name": "ElementaryTypeName", - "src": "210:7:0" + "src": "281:7:0" } ], - "id": 19, + "id": 22, "name": "VariableDeclaration", - "src": "210:14:0" + "src": "281:14:0" }, { "attributes": { "constant": false, "indexed": false, "name": "posterCoinbalance", - "scope": 29, + "scope": 32, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -573,21 +654,21 @@ "name": "uint", "type": "uint256" }, - "id": 20, + "id": 23, "name": "ElementaryTypeName", - "src": "226:4:0" + "src": "297:4:0" } ], - "id": 21, + "id": 24, "name": "VariableDeclaration", - "src": "226:22:0" + "src": "297:22:0" }, { "attributes": { "constant": false, "indexed": false, "name": "likerName", - "scope": 29, + "scope": 32, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -600,21 +681,21 @@ "name": "string", "type": "string storage pointer" }, - "id": 22, + "id": 25, "name": "ElementaryTypeName", - "src": "250:6:0" + "src": "321:6:0" } ], - "id": 23, + "id": 26, "name": "VariableDeclaration", - "src": "250:16:0" + "src": "321:16:0" }, { "attributes": { "constant": false, "indexed": false, "name": "liker", - "scope": 29, + "scope": 32, "stateVariable": false, "storageLocation": "default", "type": "address", @@ -627,21 +708,21 @@ "name": "address", "type": "address" }, - "id": 24, + "id": 27, "name": "ElementaryTypeName", - "src": "272:7:0" + "src": "343:7:0" } ], - "id": 25, + "id": 28, "name": "VariableDeclaration", - "src": "272:13:0" + "src": "343:13:0" }, { "attributes": { "constant": false, "indexed": false, "name": "likerCoinbalance", - "scope": 29, + "scope": 32, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -654,30 +735,30 @@ "name": "uint", "type": "uint256" }, - "id": 26, + "id": 29, "name": "ElementaryTypeName", - "src": "287:4:0" + "src": "358:4:0" } ], - "id": 27, + "id": 30, "name": "VariableDeclaration", - "src": "287:21:0" + "src": "358:21:0" } ], - "id": 28, + "id": 31, "name": "ParameterList", - "src": "166:143:0" + "src": "238:142:0" } ], - "id": 29, + "id": 32, "name": "EventDefinition", - "src": "151:159:0" + "src": "223:158:0" }, { "attributes": { "constant": false, "name": "coinSupply", - "scope": 312, + "scope": 317, "stateVariable": true, "storageLocation": "default", "type": "uint256", @@ -689,9 +770,9 @@ "name": "uint", "type": "uint256" }, - "id": 30, + "id": 33, "name": "ElementaryTypeName", - "src": "314:4:0" + "src": "385:4:0" }, { "attributes": { @@ -706,20 +787,20 @@ "type": "int_const 1000000", "value": "1000000" }, - "id": 31, + "id": 34, "name": "Literal", - "src": "332:7:0" + "src": "403:7:0" } ], - "id": 32, + "id": 35, "name": "VariableDeclaration", - "src": "314:25:0" + "src": "385:25:0" }, { "attributes": { "constant": false, "name": "coinsBought", - "scope": 312, + "scope": 317, "stateVariable": true, "storageLocation": "default", "type": "uint256", @@ -731,9 +812,9 @@ "name": "uint", "type": "uint256" }, - "id": 33, + "id": 36, "name": "ElementaryTypeName", - "src": "343:4:0" + "src": "414:4:0" }, { "attributes": { @@ -748,20 +829,20 @@ "type": "int_const 0", "value": "0" }, - "id": 34, + "id": 37, "name": "Literal", - "src": "362:1:0" + "src": "433:1:0" } ], - "id": 35, + "id": 38, "name": "VariableDeclaration", - "src": "343:20:0" + "src": "414:20:0" }, { "attributes": { "canonicalName": "CapCoin.User", "name": "User", - "scope": 312, + "scope": 317, "visibility": "public" }, "children": [ @@ -769,7 +850,7 @@ "attributes": { "constant": false, "name": "name", - "scope": 40, + "scope": 43, "stateVariable": false, "storageLocation": "default", "type": "string storage pointer", @@ -782,20 +863,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 36, + "id": 39, "name": "ElementaryTypeName", - "src": "386:6:0" + "src": "457:6:0" } ], - "id": 37, + "id": 40, "name": "VariableDeclaration", - "src": "386:11:0" + "src": "457:11:0" }, { "attributes": { "constant": false, "name": "coinBalance", - "scope": 40, + "scope": 43, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -808,25 +889,25 @@ "name": "uint", "type": "uint256" }, - "id": 38, + "id": 41, "name": "ElementaryTypeName", - "src": "403:4:0" + "src": "474:4:0" } ], - "id": 39, + "id": 42, "name": "VariableDeclaration", - "src": "403:16:0" + "src": "474:16:0" } ], - "id": 40, + "id": 43, "name": "StructDefinition", - "src": "368:56:0" + "src": "439:56:0" }, { "attributes": { "canonicalName": "CapCoin.Post", "name": "Post", - "scope": 312, + "scope": 317, "visibility": "public" }, "children": [ @@ -834,7 +915,7 @@ "attributes": { "constant": false, "name": "url", - "scope": 49, + "scope": 52, "stateVariable": false, "storageLocation": "default", "type": "string storage pointer", @@ -847,20 +928,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 41, + "id": 44, "name": "ElementaryTypeName", - "src": "446:6:0" + "src": "517:6:0" } ], - "id": 42, + "id": 45, "name": "VariableDeclaration", - "src": "446:10:0" + "src": "517:10:0" }, { "attributes": { "constant": false, "name": "userName", - "scope": 49, + "scope": 52, "stateVariable": false, "storageLocation": "default", "type": "string storage pointer", @@ -873,46 +954,46 @@ "name": "string", "type": "string storage pointer" }, - "id": 43, + "id": 46, "name": "ElementaryTypeName", - "src": "462:6:0" + "src": "533:6:0" } ], - "id": 44, + "id": 47, "name": "VariableDeclaration", - "src": "462:15:0" + "src": "533:15:0" }, { "attributes": { "constant": false, "name": "lotteryAmount", - "scope": 49, + "scope": 52, "stateVariable": false, "storageLocation": "default", - "type": "uint256", + "type": "int256", "value": null, "visibility": "internal" }, "children": [ { "attributes": { - "name": "uint", - "type": "uint256" + "name": "int", + "type": "int256" }, - "id": 45, + "id": 48, "name": "ElementaryTypeName", - "src": "483:4:0" + "src": "554:3:0" } ], - "id": 46, + "id": 49, "name": "VariableDeclaration", - "src": "483:18:0" + "src": "554:17:0" }, { "attributes": { "constant": false, "name": "owner", - "scope": 49, + "scope": 52, "stateVariable": false, "storageLocation": "default", "type": "address", @@ -925,25 +1006,25 @@ "name": "address", "type": "address" }, - "id": 47, + "id": 50, "name": "ElementaryTypeName", - "src": "507:7:0" + "src": "577:7:0" } ], - "id": 48, + "id": 51, "name": "VariableDeclaration", - "src": "507:13:0" + "src": "577:13:0" } ], - "id": 49, + "id": 52, "name": "StructDefinition", - "src": "428:97:0" + "src": "499:96:0" }, { "attributes": { "constant": false, "name": "addressToUser", - "scope": 312, + "scope": 317, "stateVariable": true, "storageLocation": "default", "type": "mapping(address => struct CapCoin.User storage ref)", @@ -961,36 +1042,36 @@ "name": "address", "type": "address" }, - "id": 50, + "id": 53, "name": "ElementaryTypeName", - "src": "538:7:0" + "src": "608:7:0" }, { "attributes": { "contractScope": null, "name": "User", - "referencedDeclaration": 40, + "referencedDeclaration": 43, "type": "struct CapCoin.User storage pointer" }, - "id": 51, + "id": 54, "name": "UserDefinedTypeName", - "src": "549:4:0" + "src": "619:4:0" } ], - "id": 52, + "id": 55, "name": "Mapping", - "src": "529:25:0" + "src": "599:25:0" } ], - "id": 53, + "id": 56, "name": "VariableDeclaration", - "src": "529:46:0" + "src": "599:46:0" }, { "attributes": { "constant": false, "name": "addressToPost", - "scope": 312, + "scope": 317, "stateVariable": true, "storageLocation": "default", "type": "mapping(address => struct CapCoin.Post storage ref)", @@ -1008,36 +1089,36 @@ "name": "address", "type": "address" }, - "id": 54, + "id": 57, "name": "ElementaryTypeName", - "src": "588:7:0" + "src": "658:7:0" }, { "attributes": { "contractScope": null, "name": "Post", - "referencedDeclaration": 49, + "referencedDeclaration": 52, "type": "struct CapCoin.Post storage pointer" }, - "id": 55, + "id": 58, "name": "UserDefinedTypeName", - "src": "599:4:0" + "src": "669:4:0" } ], - "id": 56, + "id": 59, "name": "Mapping", - "src": "579:25:0" + "src": "649:25:0" } ], - "id": 57, + "id": 60, "name": "VariableDeclaration", - "src": "579:46:0" + "src": "649:46:0" }, { "attributes": { "constant": false, "name": "posts", - "scope": 312, + "scope": 317, "stateVariable": true, "storageLocation": "default", "type": "address[] storage ref", @@ -1056,19 +1137,19 @@ "name": "address", "type": "address" }, - "id": 58, + "id": 61, "name": "ElementaryTypeName", - "src": "629:7:0" + "src": "699:7:0" } ], - "id": 59, + "id": 62, "name": "ArrayTypeName", - "src": "629:9:0" + "src": "699:9:0" } ], - "id": 60, + "id": 63, "name": "VariableDeclaration", - "src": "629:22:0" + "src": "699:22:0" }, { "attributes": { @@ -1080,7 +1161,7 @@ ], "name": "createUser", "payable": false, - "scope": 312, + "scope": 317, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -1092,7 +1173,7 @@ "attributes": { "constant": false, "name": "name", - "scope": 88, + "scope": 91, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -1105,19 +1186,19 @@ "name": "string", "type": "string storage pointer" }, - "id": 61, + "id": 64, "name": "ElementaryTypeName", - "src": "676:6:0" + "src": "746:6:0" } ], - "id": 62, + "id": 65, "name": "VariableDeclaration", - "src": "676:11:0" + "src": "746:11:0" } ], - "id": 63, + "id": 66, "name": "ParameterList", - "src": "675:13:0" + "src": "745:13:0" }, { "attributes": { @@ -1126,16 +1207,16 @@ ] }, "children": [], - "id": 64, + "id": 67, "name": "ParameterList", - "src": "696:0:0" + "src": "766:0:0" }, { "children": [ { "attributes": { "assignments": [ - 65 + 68 ] }, "children": [ @@ -1143,7 +1224,7 @@ "attributes": { "constant": false, "name": "user", - "scope": 88, + "scope": 91, "stateVariable": false, "storageLocation": "default", "type": "struct CapCoin.User storage pointer", @@ -1152,9 +1233,9 @@ "visibility": "internal" }, "children": [], - "id": 65, + "id": 68, "name": "VariableDeclaration", - "src": "702:8:0" + "src": "772:8:0" }, { "attributes": { @@ -1172,13 +1253,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 53, + "referencedDeclaration": 56, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 66, + "id": 69, "name": "Identifier", - "src": "713:13:0" + "src": "783:13:0" }, { "attributes": { @@ -1198,28 +1279,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 324, + "referencedDeclaration": 385, "type": "msg", "value": "msg" }, - "id": 67, + "id": 70, "name": "Identifier", - "src": "727:3:0" + "src": "797:3:0" } ], - "id": 68, + "id": 71, "name": "MemberAccess", - "src": "727:10:0" + "src": "797:10:0" } ], - "id": 69, + "id": 72, "name": "IndexAccess", - "src": "713:25:0" + "src": "783:25:0" } ], - "id": 70, + "id": 73, "name": "VariableDeclarationStatement", - "src": "702:36:0" + "src": "772:36:0" }, { "children": [ @@ -1242,7 +1323,7 @@ "isPure": false, "lValueRequested": true, "member_name": "name", - "referencedDeclaration": 37, + "referencedDeclaration": 40, "type": "string storage ref" }, "children": [ @@ -1252,18 +1333,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 65, + "referencedDeclaration": 68, "type": "struct CapCoin.User storage pointer", "value": "user" }, - "id": 71, + "id": 74, "name": "Identifier", - "src": "744:4:0" + "src": "814:4:0" } ], - "id": 73, + "id": 76, "name": "MemberAccess", - "src": "744:9:0" + "src": "814:9:0" }, { "attributes": { @@ -1271,23 +1352,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 62, + "referencedDeclaration": 65, "type": "string memory", "value": "name" }, - "id": 74, + "id": 77, "name": "Identifier", - "src": "756:4:0" + "src": "826:4:0" } ], - "id": 75, + "id": 78, "name": "Assignment", - "src": "744:16:0" + "src": "814:16:0" } ], - "id": 76, + "id": 79, "name": "ExpressionStatement", - "src": "744:16:0" + "src": "814:16:0" }, { "children": [ @@ -1310,7 +1391,7 @@ "isPure": false, "lValueRequested": true, "member_name": "coinBalance", - "referencedDeclaration": 39, + "referencedDeclaration": 42, "type": "uint256" }, "children": [ @@ -1320,18 +1401,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 65, + "referencedDeclaration": 68, "type": "struct CapCoin.User storage pointer", "value": "user" }, - "id": 77, + "id": 80, "name": "Identifier", - "src": "766:4:0" + "src": "836:4:0" } ], - "id": 79, + "id": 82, "name": "MemberAccess", - "src": "766:16:0" + "src": "836:16:0" }, { "attributes": { @@ -1346,19 +1427,19 @@ "type": "int_const 0", "value": "0" }, - "id": 80, + "id": 83, "name": "Literal", - "src": "785:1:0" + "src": "855:1:0" } ], - "id": 81, + "id": 84, "name": "Assignment", - "src": "766:20:0" + "src": "836:20:0" } ], - "id": 82, + "id": 85, "name": "ExpressionStatement", - "src": "766:20:0" + "src": "836:20:0" }, { "children": [ @@ -1388,13 +1469,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 5, + "referencedDeclaration": 8, "type": "function (string memory)", "value": "NewUser" }, - "id": 83, + "id": 86, "name": "Identifier", - "src": "792:7:0" + "src": "862:7:0" }, { "attributes": { @@ -1402,33 +1483,33 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 62, + "referencedDeclaration": 65, "type": "string memory", "value": "name" }, - "id": 84, + "id": 87, "name": "Identifier", - "src": "800:4:0" + "src": "870:4:0" } ], - "id": 85, + "id": 88, "name": "FunctionCall", - "src": "792:13:0" + "src": "862:13:0" } ], - "id": 86, + "id": 89, "name": "ExpressionStatement", - "src": "792:13:0" + "src": "862:13:0" } ], - "id": 87, + "id": 90, "name": "Block", - "src": "696:114:0" + "src": "766:114:0" } ], - "id": 88, + "id": 91, "name": "FunctionDefinition", - "src": "656:154:0" + "src": "726:154:0" }, { "attributes": { @@ -1440,7 +1521,7 @@ ], "name": "getUser", "payable": false, - "scope": 312, + "scope": 317, "stateMutability": "view", "superFunction": null, "visibility": "public" @@ -1453,9 +1534,9 @@ ] }, "children": [], - "id": 89, + "id": 92, "name": "ParameterList", - "src": "830:2:0" + "src": "900:2:0" }, { "children": [ @@ -1463,7 +1544,7 @@ "attributes": { "constant": false, "name": "", - "scope": 126, + "scope": 129, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -1476,20 +1557,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 90, + "id": 93, "name": "ElementaryTypeName", - "src": "854:6:0" + "src": "924:6:0" } ], - "id": 91, + "id": 94, "name": "VariableDeclaration", - "src": "854:6:0" + "src": "924:6:0" }, { "attributes": { "constant": false, "name": "", - "scope": 126, + "scope": 129, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -1502,20 +1583,20 @@ "name": "uint", "type": "uint256" }, - "id": 92, + "id": 95, "name": "ElementaryTypeName", - "src": "862:4:0" + "src": "932:4:0" } ], - "id": 93, + "id": 96, "name": "VariableDeclaration", - "src": "862:4:0" + "src": "932:4:0" }, { "attributes": { "constant": false, "name": "", - "scope": 126, + "scope": 129, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -1528,46 +1609,46 @@ "name": "string", "type": "string storage pointer" }, - "id": 94, + "id": 97, "name": "ElementaryTypeName", - "src": "868:6:0" + "src": "938:6:0" } ], - "id": 95, + "id": 98, "name": "VariableDeclaration", - "src": "868:6:0" + "src": "938:6:0" }, { "attributes": { "constant": false, "name": "", - "scope": 126, + "scope": 129, "stateVariable": false, "storageLocation": "default", - "type": "uint256", + "type": "int256", "value": null, "visibility": "internal" }, "children": [ { "attributes": { - "name": "uint", - "type": "uint256" + "name": "int", + "type": "int256" }, - "id": 96, + "id": 99, "name": "ElementaryTypeName", - "src": "876:4:0" + "src": "946:3:0" } ], - "id": 97, + "id": 100, "name": "VariableDeclaration", - "src": "876:4:0" + "src": "946:3:0" }, { "attributes": { "constant": false, "name": "", - "scope": 126, + "scope": 129, "stateVariable": false, "storageLocation": "default", "type": "address", @@ -1580,25 +1661,25 @@ "name": "address", "type": "address" }, - "id": 98, + "id": 101, "name": "ElementaryTypeName", - "src": "882:7:0" + "src": "951:7:0" } ], - "id": 99, + "id": 102, "name": "VariableDeclaration", - "src": "882:7:0" + "src": "951:7:0" } ], - "id": 100, + "id": 103, "name": "ParameterList", - "src": "853:37:0" + "src": "923:36:0" }, { "children": [ { "attributes": { - "functionReturnParameters": 100 + "functionReturnParameters": 103 }, "children": [ { @@ -1609,7 +1690,7 @@ "isLValue": false, "isPure": false, "lValueRequested": false, - "type": "tuple(string storage ref,uint256,string storage ref,uint256,address)" + "type": "tuple(string storage ref,uint256,string storage ref,int256,address)" }, "children": [ { @@ -1620,7 +1701,7 @@ "isPure": false, "lValueRequested": false, "member_name": "name", - "referencedDeclaration": 37, + "referencedDeclaration": 40, "type": "string storage ref" }, "children": [ @@ -1640,13 +1721,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 53, + "referencedDeclaration": 56, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 101, + "id": 104, "name": "Identifier", - "src": "905:13:0" + "src": "974:13:0" }, { "attributes": { @@ -1666,28 +1747,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 324, + "referencedDeclaration": 385, "type": "msg", "value": "msg" }, - "id": 102, + "id": 105, "name": "Identifier", - "src": "919:3:0" + "src": "988:3:0" } ], - "id": 103, + "id": 106, "name": "MemberAccess", - "src": "919:10:0" + "src": "988:10:0" } ], - "id": 104, + "id": 107, "name": "IndexAccess", - "src": "905:25:0" + "src": "974:25:0" } ], - "id": 105, + "id": 108, "name": "MemberAccess", - "src": "905:30:0" + "src": "974:30:0" }, { "attributes": { @@ -1697,7 +1778,7 @@ "isPure": false, "lValueRequested": false, "member_name": "coinBalance", - "referencedDeclaration": 39, + "referencedDeclaration": 42, "type": "uint256" }, "children": [ @@ -1717,13 +1798,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 53, + "referencedDeclaration": 56, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 106, + "id": 109, "name": "Identifier", - "src": "943:13:0" + "src": "1012:13:0" }, { "attributes": { @@ -1743,28 +1824,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 324, + "referencedDeclaration": 385, "type": "msg", "value": "msg" }, - "id": 107, + "id": 110, "name": "Identifier", - "src": "957:3:0" + "src": "1026:3:0" } ], - "id": 108, + "id": 111, "name": "MemberAccess", - "src": "957:10:0" + "src": "1026:10:0" } ], - "id": 109, + "id": 112, "name": "IndexAccess", - "src": "943:25:0" + "src": "1012:25:0" } ], - "id": 110, + "id": 113, "name": "MemberAccess", - "src": "943:37:0" + "src": "1012:37:0" }, { "attributes": { @@ -1774,7 +1855,7 @@ "isPure": false, "lValueRequested": false, "member_name": "url", - "referencedDeclaration": 42, + "referencedDeclaration": 45, "type": "string storage ref" }, "children": [ @@ -1794,13 +1875,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 57, + "referencedDeclaration": 60, "type": "mapping(address => struct CapCoin.Post storage ref)", "value": "addressToPost" }, - "id": 111, + "id": 114, "name": "Identifier", - "src": "988:13:0" + "src": "1057:13:0" }, { "attributes": { @@ -1820,28 +1901,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 324, + "referencedDeclaration": 385, "type": "msg", "value": "msg" }, - "id": 112, + "id": 115, "name": "Identifier", - "src": "1002:3:0" + "src": "1071:3:0" } ], - "id": 113, + "id": 116, "name": "MemberAccess", - "src": "1002:10:0" + "src": "1071:10:0" } ], - "id": 114, + "id": 117, "name": "IndexAccess", - "src": "988:25:0" + "src": "1057:25:0" } ], - "id": 115, + "id": 118, "name": "MemberAccess", - "src": "988:29:0" + "src": "1057:29:0" }, { "attributes": { @@ -1851,8 +1932,8 @@ "isPure": false, "lValueRequested": false, "member_name": "lotteryAmount", - "referencedDeclaration": 46, - "type": "uint256" + "referencedDeclaration": 49, + "type": "int256" }, "children": [ { @@ -1871,13 +1952,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 57, + "referencedDeclaration": 60, "type": "mapping(address => struct CapCoin.Post storage ref)", "value": "addressToPost" }, - "id": 116, + "id": 119, "name": "Identifier", - "src": "1025:13:0" + "src": "1094:13:0" }, { "attributes": { @@ -1897,28 +1978,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 324, + "referencedDeclaration": 385, "type": "msg", "value": "msg" }, - "id": 117, + "id": 120, "name": "Identifier", - "src": "1039:3:0" + "src": "1108:3:0" } ], - "id": 118, + "id": 121, "name": "MemberAccess", - "src": "1039:10:0" + "src": "1108:10:0" } ], - "id": 119, + "id": 122, "name": "IndexAccess", - "src": "1025:25:0" + "src": "1094:25:0" } ], - "id": 120, + "id": 123, "name": "MemberAccess", - "src": "1025:39:0" + "src": "1094:39:0" }, { "attributes": { @@ -1938,38 +2019,38 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 324, + "referencedDeclaration": 385, "type": "msg", "value": "msg" }, - "id": 121, + "id": 124, "name": "Identifier", - "src": "1072:3:0" + "src": "1141:3:0" } ], - "id": 122, + "id": 125, "name": "MemberAccess", - "src": "1072:10:0" + "src": "1141:10:0" } ], - "id": 123, + "id": 126, "name": "TupleExpression", - "src": "904:179:0" + "src": "973:179:0" } ], - "id": 124, + "id": 127, "name": "Return", - "src": "897:186:0" + "src": "966:186:0" } ], - "id": 125, + "id": 128, "name": "Block", - "src": "891:197:0" + "src": "960:197:0" } ], - "id": 126, + "id": 129, "name": "FunctionDefinition", - "src": "814:274:0" + "src": "884:273:0" }, { "attributes": { @@ -1981,7 +2062,7 @@ ], "name": "buyTokens", "payable": false, - "scope": 312, + "scope": 317, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -1993,7 +2074,7 @@ "attributes": { "constant": false, "name": "amount", - "scope": 156, + "scope": 159, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -2006,19 +2087,19 @@ "name": "uint", "type": "uint256" }, - "id": 127, + "id": 130, "name": "ElementaryTypeName", - "src": "1138:4:0" + "src": "1207:4:0" } ], - "id": 128, + "id": 131, "name": "VariableDeclaration", - "src": "1138:11:0" + "src": "1207:11:0" } ], - "id": 129, + "id": 132, "name": "ParameterList", - "src": "1137:13:0" + "src": "1206:13:0" }, { "attributes": { @@ -2027,9 +2108,9 @@ ] }, "children": [], - "id": 130, + "id": 133, "name": "ParameterList", - "src": "1158:0:0" + "src": "1227:0:0" }, { "children": [ @@ -2054,7 +2135,7 @@ "isPure": false, "lValueRequested": true, "member_name": "coinBalance", - "referencedDeclaration": 39, + "referencedDeclaration": 42, "type": "uint256" }, "children": [ @@ -2074,13 +2155,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 53, + "referencedDeclaration": 56, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 131, + "id": 134, "name": "Identifier", - "src": "1164:13:0" + "src": "1233:13:0" }, { "attributes": { @@ -2100,28 +2181,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 324, + "referencedDeclaration": 385, "type": "msg", "value": "msg" }, - "id": 132, + "id": 135, "name": "Identifier", - "src": "1178:3:0" + "src": "1247:3:0" } ], - "id": 133, + "id": 136, "name": "MemberAccess", - "src": "1178:10:0" + "src": "1247:10:0" } ], - "id": 134, + "id": 137, "name": "IndexAccess", - "src": "1164:25:0" + "src": "1233:25:0" } ], - "id": 135, + "id": 138, "name": "MemberAccess", - "src": "1164:37:0" + "src": "1233:37:0" }, { "attributes": { @@ -2129,23 +2210,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 128, + "referencedDeclaration": 131, "type": "uint256", "value": "amount" }, - "id": 136, + "id": 139, "name": "Identifier", - "src": "1205:6:0" + "src": "1274:6:0" } ], - "id": 137, + "id": 140, "name": "Assignment", - "src": "1164:47:0" + "src": "1233:47:0" } ], - "id": 138, + "id": 141, "name": "ExpressionStatement", - "src": "1164:47:0" + "src": "1233:47:0" }, { "children": [ @@ -2166,13 +2247,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 35, + "referencedDeclaration": 38, "type": "uint256", "value": "coinsBought" }, - "id": 139, + "id": 142, "name": "Identifier", - "src": "1217:11:0" + "src": "1286:11:0" }, { "attributes": { @@ -2180,23 +2261,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 128, + "referencedDeclaration": 131, "type": "uint256", "value": "amount" }, - "id": 140, + "id": 143, "name": "Identifier", - "src": "1232:6:0" + "src": "1301:6:0" } ], - "id": 141, + "id": 144, "name": "Assignment", - "src": "1217:21:0" + "src": "1286:21:0" } ], - "id": 142, + "id": 145, "name": "ExpressionStatement", - "src": "1217:21:0" + "src": "1286:21:0" }, { "children": [ @@ -2217,13 +2298,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 32, + "referencedDeclaration": 35, "type": "uint256", "value": "coinSupply" }, - "id": 143, + "id": 146, "name": "Identifier", - "src": "1244:10:0" + "src": "1313:10:0" }, { "attributes": { @@ -2231,23 +2312,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 128, + "referencedDeclaration": 131, "type": "uint256", "value": "amount" }, - "id": 144, + "id": 147, "name": "Identifier", - "src": "1258:6:0" + "src": "1327:6:0" } ], - "id": 145, + "id": 148, "name": "Assignment", - "src": "1244:20:0" + "src": "1313:20:0" } ], - "id": 146, + "id": 149, "name": "ExpressionStatement", - "src": "1244:20:0" + "src": "1313:20:0" }, { "children": [ @@ -2277,13 +2358,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 9, + "referencedDeclaration": 12, "type": "function (uint256)", "value": "BoughtTokens" }, - "id": 147, + "id": 150, "name": "Identifier", - "src": "1270:12:0" + "src": "1339:12:0" }, { "attributes": { @@ -2293,7 +2374,7 @@ "isPure": false, "lValueRequested": false, "member_name": "coinBalance", - "referencedDeclaration": 39, + "referencedDeclaration": 42, "type": "uint256" }, "children": [ @@ -2313,13 +2394,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 53, + "referencedDeclaration": 56, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 148, + "id": 151, "name": "Identifier", - "src": "1283:13:0" + "src": "1352:13:0" }, { "attributes": { @@ -2339,48 +2420,48 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 324, + "referencedDeclaration": 385, "type": "msg", "value": "msg" }, - "id": 149, + "id": 152, "name": "Identifier", - "src": "1297:3:0" + "src": "1366:3:0" } ], - "id": 150, + "id": 153, "name": "MemberAccess", - "src": "1297:10:0" + "src": "1366:10:0" } ], - "id": 151, + "id": 154, "name": "IndexAccess", - "src": "1283:25:0" + "src": "1352:25:0" } ], - "id": 152, + "id": 155, "name": "MemberAccess", - "src": "1283:37:0" + "src": "1352:37:0" } ], - "id": 153, + "id": 156, "name": "FunctionCall", - "src": "1270:51:0" + "src": "1339:51:0" } ], - "id": 154, + "id": 157, "name": "ExpressionStatement", - "src": "1270:51:0" + "src": "1339:51:0" } ], - "id": 155, + "id": 158, "name": "Block", - "src": "1158:168:0" + "src": "1227:168:0" } ], - "id": 156, + "id": 159, "name": "FunctionDefinition", - "src": "1119:207:0" + "src": "1188:207:0" }, { "attributes": { @@ -2392,7 +2473,7 @@ ], "name": "createPost", "payable": false, - "scope": 312, + "scope": 317, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -2404,7 +2485,7 @@ "attributes": { "constant": false, "name": "url", - "scope": 218, + "scope": 221, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -2417,19 +2498,19 @@ "name": "string", "type": "string storage pointer" }, - "id": 157, + "id": 160, "name": "ElementaryTypeName", - "src": "1350:6:0" + "src": "1419:6:0" } ], - "id": 158, + "id": 161, "name": "VariableDeclaration", - "src": "1350:10:0" + "src": "1419:10:0" } ], - "id": 159, + "id": 162, "name": "ParameterList", - "src": "1349:12:0" + "src": "1418:12:0" }, { "attributes": { @@ -2438,16 +2519,16 @@ ] }, "children": [], - "id": 160, + "id": 163, "name": "ParameterList", - "src": "1369:0:0" + "src": "1438:0:0" }, { "children": [ { "attributes": { "assignments": [ - 161 + 164 ] }, "children": [ @@ -2455,7 +2536,7 @@ "attributes": { "constant": false, "name": "post", - "scope": 218, + "scope": 221, "stateVariable": false, "storageLocation": "default", "type": "struct CapCoin.Post storage pointer", @@ -2464,9 +2545,9 @@ "visibility": "internal" }, "children": [], - "id": 161, + "id": 164, "name": "VariableDeclaration", - "src": "1399:8:0" + "src": "1468:8:0" }, { "attributes": { @@ -2484,13 +2565,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 57, + "referencedDeclaration": 60, "type": "mapping(address => struct CapCoin.Post storage ref)", "value": "addressToPost" }, - "id": 162, + "id": 165, "name": "Identifier", - "src": "1410:13:0" + "src": "1479:13:0" }, { "attributes": { @@ -2510,28 +2591,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 324, + "referencedDeclaration": 385, "type": "msg", "value": "msg" }, - "id": 163, + "id": 166, "name": "Identifier", - "src": "1424:3:0" + "src": "1493:3:0" } ], - "id": 164, + "id": 167, "name": "MemberAccess", - "src": "1424:10:0" + "src": "1493:10:0" } ], - "id": 165, + "id": 168, "name": "IndexAccess", - "src": "1410:25:0" + "src": "1479:25:0" } ], - "id": 166, + "id": 169, "name": "VariableDeclarationStatement", - "src": "1399:36:0" + "src": "1468:36:0" }, { "children": [ @@ -2554,7 +2635,7 @@ "isPure": false, "lValueRequested": true, "member_name": "url", - "referencedDeclaration": 42, + "referencedDeclaration": 45, "type": "string storage ref" }, "children": [ @@ -2564,18 +2645,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 161, + "referencedDeclaration": 164, "type": "struct CapCoin.Post storage pointer", "value": "post" }, - "id": 167, + "id": 170, "name": "Identifier", - "src": "1441:4:0" + "src": "1510:4:0" } ], - "id": 169, + "id": 172, "name": "MemberAccess", - "src": "1441:8:0" + "src": "1510:8:0" }, { "attributes": { @@ -2583,23 +2664,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 158, + "referencedDeclaration": 161, "type": "string memory", "value": "url" }, - "id": 170, + "id": 173, "name": "Identifier", - "src": "1452:3:0" + "src": "1521:3:0" } ], - "id": 171, + "id": 174, "name": "Assignment", - "src": "1441:14:0" + "src": "1510:14:0" } ], - "id": 172, + "id": 175, "name": "ExpressionStatement", - "src": "1441:14:0" + "src": "1510:14:0" }, { "children": [ @@ -2611,7 +2692,7 @@ "isPure": false, "lValueRequested": false, "operator": "-=", - "type": "uint256" + "type": "int256" }, "children": [ { @@ -2622,8 +2703,8 @@ "isPure": false, "lValueRequested": true, "member_name": "lotteryAmount", - "referencedDeclaration": 46, - "type": "uint256" + "referencedDeclaration": 49, + "type": "int256" }, "children": [ { @@ -2632,18 +2713,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 161, + "referencedDeclaration": 164, "type": "struct CapCoin.Post storage pointer", "value": "post" }, - "id": 173, + "id": 176, "name": "Identifier", - "src": "1461:4:0" + "src": "1530:4:0" } ], - "id": 175, + "id": 178, "name": "MemberAccess", - "src": "1461:18:0" + "src": "1530:18:0" }, { "attributes": { @@ -2658,19 +2739,19 @@ "type": "int_const 5", "value": "5" }, - "id": 176, + "id": 179, "name": "Literal", - "src": "1483:1:0" + "src": "1552:1:0" } ], - "id": 177, + "id": 180, "name": "Assignment", - "src": "1461:23:0" + "src": "1530:23:0" } ], - "id": 178, + "id": 181, "name": "ExpressionStatement", - "src": "1461:23:0" + "src": "1530:23:0" }, { "children": [ @@ -2693,7 +2774,7 @@ "isPure": false, "lValueRequested": true, "member_name": "userName", - "referencedDeclaration": 44, + "referencedDeclaration": 47, "type": "string storage ref" }, "children": [ @@ -2703,18 +2784,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 161, + "referencedDeclaration": 164, "type": "struct CapCoin.Post storage pointer", "value": "post" }, - "id": 179, + "id": 182, "name": "Identifier", - "src": "1490:4:0" + "src": "1559:4:0" } ], - "id": 181, + "id": 184, "name": "MemberAccess", - "src": "1490:13:0" + "src": "1559:13:0" }, { "attributes": { @@ -2724,7 +2805,7 @@ "isPure": false, "lValueRequested": false, "member_name": "name", - "referencedDeclaration": 37, + "referencedDeclaration": 40, "type": "string storage ref" }, "children": [ @@ -2744,13 +2825,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 53, + "referencedDeclaration": 56, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 182, + "id": 185, "name": "Identifier", - "src": "1506:13:0" + "src": "1575:13:0" }, { "attributes": { @@ -2770,38 +2851,38 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 324, + "referencedDeclaration": 385, "type": "msg", "value": "msg" }, - "id": 183, + "id": 186, "name": "Identifier", - "src": "1520:3:0" + "src": "1589:3:0" } ], - "id": 184, + "id": 187, "name": "MemberAccess", - "src": "1520:10:0" + "src": "1589:10:0" } ], - "id": 185, + "id": 188, "name": "IndexAccess", - "src": "1506:25:0" + "src": "1575:25:0" } ], - "id": 186, + "id": 189, "name": "MemberAccess", - "src": "1506:30:0" + "src": "1575:30:0" } ], - "id": 187, + "id": 190, "name": "Assignment", - "src": "1490:46:0" + "src": "1559:46:0" } ], - "id": 188, + "id": 191, "name": "ExpressionStatement", - "src": "1490:46:0" + "src": "1559:46:0" }, { "children": [ @@ -2824,7 +2905,7 @@ "isPure": false, "lValueRequested": true, "member_name": "owner", - "referencedDeclaration": 48, + "referencedDeclaration": 51, "type": "address" }, "children": [ @@ -2834,18 +2915,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 161, + "referencedDeclaration": 164, "type": "struct CapCoin.Post storage pointer", "value": "post" }, - "id": 189, + "id": 192, "name": "Identifier", - "src": "1542:4:0" + "src": "1611:4:0" } ], - "id": 191, + "id": 194, "name": "MemberAccess", - "src": "1542:10:0" + "src": "1611:10:0" }, { "attributes": { @@ -2865,28 +2946,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 324, + "referencedDeclaration": 385, "type": "msg", "value": "msg" }, - "id": 192, + "id": 195, "name": "Identifier", - "src": "1555:3:0" + "src": "1624:3:0" } ], - "id": 193, + "id": 196, "name": "MemberAccess", - "src": "1555:10:0" + "src": "1624:10:0" } ], - "id": 194, + "id": 197, "name": "Assignment", - "src": "1542:23:0" + "src": "1611:23:0" } ], - "id": 195, + "id": 198, "name": "ExpressionStatement", - "src": "1542:23:0" + "src": "1611:23:0" }, { "children": [ @@ -2943,18 +3024,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 60, + "referencedDeclaration": 63, "type": "address[] storage ref", "value": "posts" }, - "id": 196, + "id": 199, "name": "Identifier", - "src": "1572:5:0" + "src": "1641:5:0" } ], - "id": 198, + "id": 201, "name": "MemberAccess", - "src": "1572:10:0" + "src": "1641:10:0" }, { "attributes": { @@ -2974,23 +3055,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 324, + "referencedDeclaration": 385, "type": "msg", "value": "msg" }, - "id": 199, + "id": 202, "name": "Identifier", - "src": "1583:3:0" + "src": "1652:3:0" } ], - "id": 200, + "id": 203, "name": "MemberAccess", - "src": "1583:10:0" + "src": "1652:10:0" } ], - "id": 201, + "id": 204, "name": "FunctionCall", - "src": "1572:22:0" + "src": "1641:22:0" }, { "attributes": { @@ -3005,19 +3086,19 @@ "type": "int_const 1", "value": "1" }, - "id": 202, + "id": 205, "name": "Literal", - "src": "1596:1:0" + "src": "1665:1:0" } ], - "id": 203, + "id": 206, "name": "BinaryOperation", - "src": "1572:25:0" + "src": "1641:25:0" } ], - "id": 204, + "id": 207, "name": "ExpressionStatement", - "src": "1572:25:0" + "src": "1641:25:0" }, { "children": [ @@ -3040,7 +3121,7 @@ "isPure": false, "lValueRequested": true, "member_name": "coinBalance", - "referencedDeclaration": 39, + "referencedDeclaration": 42, "type": "uint256" }, "children": [ @@ -3060,13 +3141,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 53, + "referencedDeclaration": 56, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 205, + "id": 208, "name": "Identifier", - "src": "1603:13:0" + "src": "1672:13:0" }, { "attributes": { @@ -3086,28 +3167,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 324, + "referencedDeclaration": 385, "type": "msg", "value": "msg" }, - "id": 206, + "id": 209, "name": "Identifier", - "src": "1617:3:0" + "src": "1686:3:0" } ], - "id": 207, + "id": 210, "name": "MemberAccess", - "src": "1617:10:0" + "src": "1686:10:0" } ], - "id": 208, + "id": 211, "name": "IndexAccess", - "src": "1603:25:0" + "src": "1672:25:0" } ], - "id": 209, + "id": 212, "name": "MemberAccess", - "src": "1603:37:0" + "src": "1672:37:0" }, { "attributes": { @@ -3122,19 +3203,19 @@ "type": "int_const 5", "value": "5" }, - "id": 210, + "id": 213, "name": "Literal", - "src": "1644:1:0" + "src": "1713:1:0" } ], - "id": 211, + "id": 214, "name": "Assignment", - "src": "1603:42:0" + "src": "1672:42:0" } ], - "id": 212, + "id": 215, "name": "ExpressionStatement", - "src": "1603:42:0" + "src": "1672:42:0" }, { "children": [ @@ -3164,13 +3245,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 13, + "referencedDeclaration": 16, "type": "function (string memory)", "value": "CreatedPost" }, - "id": 213, + "id": 216, "name": "Identifier", - "src": "1651:11:0" + "src": "1720:11:0" }, { "attributes": { @@ -3178,33 +3259,33 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 158, + "referencedDeclaration": 161, "type": "string memory", "value": "url" }, - "id": 214, + "id": 217, "name": "Identifier", - "src": "1663:3:0" + "src": "1732:3:0" } ], - "id": 215, + "id": 218, "name": "FunctionCall", - "src": "1651:16:0" + "src": "1720:16:0" } ], - "id": 216, + "id": 219, "name": "ExpressionStatement", - "src": "1651:16:0" + "src": "1720:16:0" } ], - "id": 217, + "id": 220, "name": "Block", - "src": "1369:303:0" + "src": "1438:303:0" } ], - "id": 218, + "id": 221, "name": "FunctionDefinition", - "src": "1330:342:0" + "src": "1399:342:0" }, { "attributes": { @@ -3216,7 +3297,7 @@ ], "name": "likePost", "payable": false, - "scope": 312, + "scope": 317, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -3228,7 +3309,7 @@ "attributes": { "constant": false, "name": "post", - "scope": 276, + "scope": 281, "stateVariable": false, "storageLocation": "default", "type": "address", @@ -3241,20 +3322,20 @@ "name": "address", "type": "address" }, - "id": 219, + "id": 222, "name": "ElementaryTypeName", - "src": "1694:7:0" + "src": "1763:7:0" } ], - "id": 220, + "id": 223, "name": "VariableDeclaration", - "src": "1694:12:0" + "src": "1763:12:0" }, { "attributes": { "constant": false, "name": "amount", - "scope": 276, + "scope": 281, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -3267,19 +3348,19 @@ "name": "uint", "type": "uint256" }, - "id": 221, + "id": 224, "name": "ElementaryTypeName", - "src": "1708:4:0" + "src": "1777:4:0" } ], - "id": 222, + "id": 225, "name": "VariableDeclaration", - "src": "1708:11:0" + "src": "1777:11:0" } ], - "id": 223, + "id": 226, "name": "ParameterList", - "src": "1693:27:0" + "src": "1762:27:0" }, { "attributes": { @@ -3288,9 +3369,9 @@ ] }, "children": [], - "id": 224, + "id": 227, "name": "ParameterList", - "src": "1728:0:0" + "src": "1797:0:0" }, { "children": [ @@ -3304,7 +3385,7 @@ "isPure": false, "lValueRequested": false, "operator": "+=", - "type": "uint256" + "type": "int256" }, "children": [ { @@ -3315,8 +3396,8 @@ "isPure": false, "lValueRequested": true, "member_name": "lotteryAmount", - "referencedDeclaration": 46, - "type": "uint256" + "referencedDeclaration": 49, + "type": "int256" }, "children": [ { @@ -3335,13 +3416,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 57, + "referencedDeclaration": 60, "type": "mapping(address => struct CapCoin.Post storage ref)", "value": "addressToPost" }, - "id": 225, + "id": 228, "name": "Identifier", - "src": "1734:13:0" + "src": "1803:13:0" }, { "attributes": { @@ -3349,47 +3430,86 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 220, + "referencedDeclaration": 223, "type": "address", "value": "post" }, - "id": 226, + "id": 229, "name": "Identifier", - "src": "1748:4:0" + "src": "1817:4:0" } ], - "id": 227, + "id": 230, "name": "IndexAccess", - "src": "1734:19:0" + "src": "1803:19:0" } ], - "id": 228, + "id": 231, "name": "MemberAccess", - "src": "1734:33:0" + "src": "1803:33:0" }, { "attributes": { "argumentTypes": null, - "overloadedDeclarations": [ + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ null ], - "referencedDeclaration": 222, - "type": "uint256", - "value": "amount" + "type": "int256", + "type_conversion": true }, - "id": 229, - "name": "Identifier", - "src": "1771:6:0" + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "type": "type(int256)", + "value": "int" + }, + "id": 232, + "name": "ElementaryTypeNameExpression", + "src": "1840:3:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 225, + "type": "uint256", + "value": "amount" + }, + "id": 233, + "name": "Identifier", + "src": "1844:6:0" + } + ], + "id": 234, + "name": "FunctionCall", + "src": "1840:11:0" } ], - "id": 230, + "id": 235, "name": "Assignment", - "src": "1734:43:0" + "src": "1803:48:0" } ], - "id": 231, + "id": 236, "name": "ExpressionStatement", - "src": "1734:43:0" + "src": "1803:48:0" }, { "children": [ @@ -3412,7 +3532,7 @@ "isPure": false, "lValueRequested": true, "member_name": "coinBalance", - "referencedDeclaration": 39, + "referencedDeclaration": 42, "type": "uint256" }, "children": [ @@ -3432,13 +3552,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 53, + "referencedDeclaration": 56, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 232, + "id": 237, "name": "Identifier", - "src": "1783:13:0" + "src": "1857:13:0" }, { "attributes": { @@ -3446,23 +3566,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 220, + "referencedDeclaration": 223, "type": "address", "value": "post" }, - "id": 233, + "id": 238, "name": "Identifier", - "src": "1797:4:0" + "src": "1871:4:0" } ], - "id": 234, + "id": 239, "name": "IndexAccess", - "src": "1783:19:0" + "src": "1857:19:0" } ], - "id": 235, + "id": 240, "name": "MemberAccess", - "src": "1783:31:0" + "src": "1857:31:0" }, { "attributes": { @@ -3470,23 +3590,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 222, + "referencedDeclaration": 225, "type": "uint256", "value": "amount" }, - "id": 236, + "id": 241, "name": "Identifier", - "src": "1818:6:0" + "src": "1892:6:0" } ], - "id": 237, + "id": 242, "name": "Assignment", - "src": "1783:41:0" + "src": "1857:41:0" } ], - "id": 238, + "id": 243, "name": "ExpressionStatement", - "src": "1783:41:0" + "src": "1857:41:0" }, { "children": [ @@ -3509,7 +3629,7 @@ "isPure": false, "lValueRequested": true, "member_name": "coinBalance", - "referencedDeclaration": 39, + "referencedDeclaration": 42, "type": "uint256" }, "children": [ @@ -3529,13 +3649,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 53, + "referencedDeclaration": 56, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 239, + "id": 244, "name": "Identifier", - "src": "1830:13:0" + "src": "1904:13:0" }, { "attributes": { @@ -3555,28 +3675,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 324, + "referencedDeclaration": 385, "type": "msg", "value": "msg" }, - "id": 240, + "id": 245, "name": "Identifier", - "src": "1844:3:0" + "src": "1918:3:0" } ], - "id": 241, + "id": 246, "name": "MemberAccess", - "src": "1844:10:0" + "src": "1918:10:0" } ], - "id": 242, + "id": 247, "name": "IndexAccess", - "src": "1830:25:0" + "src": "1904:25:0" } ], - "id": 243, + "id": 248, "name": "MemberAccess", - "src": "1830:37:0" + "src": "1904:37:0" }, { "attributes": { @@ -3584,23 +3704,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 222, + "referencedDeclaration": 225, "type": "uint256", "value": "amount" }, - "id": 244, + "id": 249, "name": "Identifier", - "src": "1871:6:0" + "src": "1945:6:0" } ], - "id": 245, + "id": 250, "name": "Assignment", - "src": "1830:47:0" + "src": "1904:47:0" } ], - "id": 246, + "id": 251, "name": "ExpressionStatement", - "src": "1830:47:0" + "src": "1904:47:0" }, { "children": [ @@ -3623,8 +3743,8 @@ "attributes": { "argumentTypes": [ { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_int256", + "typeString": "int256" }, { "typeIdentifier": "t_string_storage", @@ -3654,13 +3774,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 29, - "type": "function (uint256,string memory,address,uint256,string memory,address,uint256)", + "referencedDeclaration": 32, + "type": "function (int256,string memory,address,uint256,string memory,address,uint256)", "value": "LikedPost" }, - "id": 247, + "id": 252, "name": "Identifier", - "src": "1883:9:0" + "src": "1957:9:0" }, { "attributes": { @@ -3670,8 +3790,8 @@ "isPure": false, "lValueRequested": false, "member_name": "lotteryAmount", - "referencedDeclaration": 46, - "type": "uint256" + "referencedDeclaration": 49, + "type": "int256" }, "children": [ { @@ -3690,13 +3810,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 57, + "referencedDeclaration": 60, "type": "mapping(address => struct CapCoin.Post storage ref)", "value": "addressToPost" }, - "id": 248, + "id": 253, "name": "Identifier", - "src": "1893:13:0" + "src": "1967:13:0" }, { "attributes": { @@ -3704,23 +3824,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 220, + "referencedDeclaration": 223, "type": "address", "value": "post" }, - "id": 249, + "id": 254, "name": "Identifier", - "src": "1907:4:0" + "src": "1981:4:0" } ], - "id": 250, + "id": 255, "name": "IndexAccess", - "src": "1893:19:0" + "src": "1967:19:0" } ], - "id": 251, + "id": 256, "name": "MemberAccess", - "src": "1893:33:0" + "src": "1967:33:0" }, { "attributes": { @@ -3730,7 +3850,7 @@ "isPure": false, "lValueRequested": false, "member_name": "name", - "referencedDeclaration": 37, + "referencedDeclaration": 40, "type": "string storage ref" }, "children": [ @@ -3750,13 +3870,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 53, + "referencedDeclaration": 56, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 252, + "id": 257, "name": "Identifier", - "src": "1934:13:0" + "src": "2008:13:0" }, { "attributes": { @@ -3764,23 +3884,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 220, + "referencedDeclaration": 223, "type": "address", "value": "post" }, - "id": 253, + "id": 258, "name": "Identifier", - "src": "1948:4:0" + "src": "2022:4:0" } ], - "id": 254, + "id": 259, "name": "IndexAccess", - "src": "1934:19:0" + "src": "2008:19:0" } ], - "id": 255, + "id": 260, "name": "MemberAccess", - "src": "1934:24:0" + "src": "2008:24:0" }, { "attributes": { @@ -3788,13 +3908,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 220, + "referencedDeclaration": 223, "type": "address", "value": "post" }, - "id": 256, + "id": 261, "name": "Identifier", - "src": "1960:4:0" + "src": "2034:4:0" }, { "attributes": { @@ -3804,7 +3924,7 @@ "isPure": false, "lValueRequested": false, "member_name": "coinBalance", - "referencedDeclaration": 39, + "referencedDeclaration": 42, "type": "uint256" }, "children": [ @@ -3824,13 +3944,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 53, + "referencedDeclaration": 56, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 257, + "id": 262, "name": "Identifier", - "src": "1966:13:0" + "src": "2040:13:0" }, { "attributes": { @@ -3838,23 +3958,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 220, + "referencedDeclaration": 223, "type": "address", "value": "post" }, - "id": 258, + "id": 263, "name": "Identifier", - "src": "1980:4:0" + "src": "2054:4:0" } ], - "id": 259, + "id": 264, "name": "IndexAccess", - "src": "1966:19:0" + "src": "2040:19:0" } ], - "id": 260, + "id": 265, "name": "MemberAccess", - "src": "1966:31:0" + "src": "2040:31:0" }, { "attributes": { @@ -3864,7 +3984,7 @@ "isPure": false, "lValueRequested": false, "member_name": "name", - "referencedDeclaration": 37, + "referencedDeclaration": 40, "type": "string storage ref" }, "children": [ @@ -3884,13 +4004,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 53, + "referencedDeclaration": 56, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 261, + "id": 266, "name": "Identifier", - "src": "2005:13:0" + "src": "2079:13:0" }, { "attributes": { @@ -3910,28 +4030,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 324, + "referencedDeclaration": 385, "type": "msg", "value": "msg" }, - "id": 262, + "id": 267, "name": "Identifier", - "src": "2019:3:0" + "src": "2093:3:0" } ], - "id": 263, + "id": 268, "name": "MemberAccess", - "src": "2019:10:0" + "src": "2093:10:0" } ], - "id": 264, + "id": 269, "name": "IndexAccess", - "src": "2005:25:0" + "src": "2079:25:0" } ], - "id": 265, + "id": 270, "name": "MemberAccess", - "src": "2005:30:0" + "src": "2079:30:0" }, { "attributes": { @@ -3951,18 +4071,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 324, + "referencedDeclaration": 385, "type": "msg", "value": "msg" }, - "id": 266, + "id": 271, "name": "Identifier", - "src": "2037:3:0" + "src": "2111:3:0" } ], - "id": 267, + "id": 272, "name": "MemberAccess", - "src": "2037:10:0" + "src": "2111:10:0" }, { "attributes": { @@ -3972,7 +4092,7 @@ "isPure": false, "lValueRequested": false, "member_name": "coinBalance", - "referencedDeclaration": 39, + "referencedDeclaration": 42, "type": "uint256" }, "children": [ @@ -3992,13 +4112,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 53, + "referencedDeclaration": 56, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 268, + "id": 273, "name": "Identifier", - "src": "2049:13:0" + "src": "2123:13:0" }, { "attributes": { @@ -4018,48 +4138,48 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 324, + "referencedDeclaration": 385, "type": "msg", "value": "msg" }, - "id": 269, + "id": 274, "name": "Identifier", - "src": "2063:3:0" + "src": "2137:3:0" } ], - "id": 270, + "id": 275, "name": "MemberAccess", - "src": "2063:10:0" + "src": "2137:10:0" } ], - "id": 271, + "id": 276, "name": "IndexAccess", - "src": "2049:25:0" + "src": "2123:25:0" } ], - "id": 272, + "id": 277, "name": "MemberAccess", - "src": "2049:37:0" + "src": "2123:37:0" } ], - "id": 273, + "id": 278, "name": "FunctionCall", - "src": "1883:204:0" + "src": "1957:204:0" } ], - "id": 274, + "id": 279, "name": "ExpressionStatement", - "src": "1883:204:0" + "src": "1957:204:0" } ], - "id": 275, + "id": 280, "name": "Block", - "src": "1728:364:0" + "src": "1797:369:0" } ], - "id": 276, + "id": 281, "name": "FunctionDefinition", - "src": "1676:416:0" + "src": "1745:421:0" }, { "attributes": { @@ -4071,7 +4191,7 @@ ], "name": "getPosts", "payable": false, - "scope": 312, + "scope": 317, "stateMutability": "view", "superFunction": null, "visibility": "public" @@ -4084,9 +4204,9 @@ ] }, "children": [], - "id": 277, + "id": 282, "name": "ParameterList", - "src": "2113:2:0" + "src": "2187:2:0" }, { "children": [ @@ -4094,7 +4214,7 @@ "attributes": { "constant": false, "name": "", - "scope": 285, + "scope": 290, "stateVariable": false, "storageLocation": "default", "type": "address[] memory", @@ -4113,30 +4233,30 @@ "name": "address", "type": "address" }, - "id": 278, + "id": 283, "name": "ElementaryTypeName", - "src": "2137:7:0" + "src": "2211:7:0" } ], - "id": 279, + "id": 284, "name": "ArrayTypeName", - "src": "2137:9:0" + "src": "2211:9:0" } ], - "id": 280, + "id": 285, "name": "VariableDeclaration", - "src": "2137:9:0" + "src": "2211:9:0" } ], - "id": 281, + "id": 286, "name": "ParameterList", - "src": "2136:11:0" + "src": "2210:11:0" }, { "children": [ { "attributes": { - "functionReturnParameters": 281 + "functionReturnParameters": 286 }, "children": [ { @@ -4145,28 +4265,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 60, + "referencedDeclaration": 63, "type": "address[] storage ref", "value": "posts" }, - "id": 282, + "id": 287, "name": "Identifier", - "src": "2163:5:0" + "src": "2237:5:0" } ], - "id": 283, + "id": 288, "name": "Return", - "src": "2156:12:0" + "src": "2230:12:0" } ], - "id": 284, + "id": 289, "name": "Block", - "src": "2148:25:0" + "src": "2222:25:0" } ], - "id": 285, + "id": 290, "name": "FunctionDefinition", - "src": "2096:77:0" + "src": "2170:77:0" }, { "attributes": { @@ -4178,7 +4298,7 @@ ], "name": "seed", "payable": false, - "scope": 312, + "scope": 317, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -4190,7 +4310,7 @@ "attributes": { "constant": false, "name": "name", - "scope": 307, + "scope": 312, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -4203,20 +4323,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 286, + "id": 291, "name": "ElementaryTypeName", - "src": "2191:6:0" + "src": "2265:6:0" } ], - "id": 287, + "id": 292, "name": "VariableDeclaration", - "src": "2191:11:0" + "src": "2265:11:0" }, { "attributes": { "constant": false, "name": "url", - "scope": 307, + "scope": 312, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -4229,20 +4349,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 288, + "id": 293, "name": "ElementaryTypeName", - "src": "2204:6:0" + "src": "2278:6:0" } ], - "id": 289, + "id": 294, "name": "VariableDeclaration", - "src": "2204:10:0" + "src": "2278:10:0" }, { "attributes": { "constant": false, "name": "amount", - "scope": 307, + "scope": 312, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -4255,19 +4375,19 @@ "name": "uint", "type": "uint256" }, - "id": 290, + "id": 295, "name": "ElementaryTypeName", - "src": "2216:4:0" + "src": "2290:4:0" } ], - "id": 291, + "id": 296, "name": "VariableDeclaration", - "src": "2216:11:0" + "src": "2290:11:0" } ], - "id": 292, + "id": 297, "name": "ParameterList", - "src": "2190:38:0" + "src": "2264:38:0" }, { "attributes": { @@ -4276,9 +4396,9 @@ ] }, "children": [], - "id": 293, + "id": 298, "name": "ParameterList", - "src": "2236:0:0" + "src": "2310:0:0" }, { "children": [ @@ -4310,13 +4430,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 88, + "referencedDeclaration": 91, "type": "function (string memory)", "value": "createUser" }, - "id": 294, + "id": 299, "name": "Identifier", - "src": "2244:10:0" + "src": "2318:10:0" }, { "attributes": { @@ -4324,23 +4444,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 287, + "referencedDeclaration": 292, "type": "string memory", "value": "name" }, - "id": 295, + "id": 300, "name": "Identifier", - "src": "2255:4:0" + "src": "2329:4:0" } ], - "id": 296, + "id": 301, "name": "FunctionCall", - "src": "2244:16:0" + "src": "2318:16:0" } ], - "id": 297, + "id": 302, "name": "ExpressionStatement", - "src": "2244:16:0" + "src": "2318:16:0" }, { "children": [ @@ -4370,13 +4490,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 156, + "referencedDeclaration": 159, "type": "function (uint256)", "value": "buyTokens" }, - "id": 298, + "id": 303, "name": "Identifier", - "src": "2268:9:0" + "src": "2342:9:0" }, { "attributes": { @@ -4384,23 +4504,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 291, + "referencedDeclaration": 296, "type": "uint256", "value": "amount" }, - "id": 299, + "id": 304, "name": "Identifier", - "src": "2278:6:0" + "src": "2352:6:0" } ], - "id": 300, + "id": 305, "name": "FunctionCall", - "src": "2268:17:0" + "src": "2342:17:0" } ], - "id": 301, + "id": 306, "name": "ExpressionStatement", - "src": "2268:17:0" + "src": "2342:17:0" }, { "children": [ @@ -4430,13 +4550,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 218, + "referencedDeclaration": 221, "type": "function (string memory)", "value": "createPost" }, - "id": 302, + "id": 307, "name": "Identifier", - "src": "2293:10:0" + "src": "2367:10:0" }, { "attributes": { @@ -4444,33 +4564,33 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 289, + "referencedDeclaration": 294, "type": "string memory", "value": "url" }, - "id": 303, + "id": 308, "name": "Identifier", - "src": "2304:3:0" + "src": "2378:3:0" } ], - "id": 304, + "id": 309, "name": "FunctionCall", - "src": "2293:15:0" + "src": "2367:15:0" } ], - "id": 305, + "id": 310, "name": "ExpressionStatement", - "src": "2293:15:0" + "src": "2367:15:0" } ], - "id": 306, + "id": 311, "name": "Block", - "src": "2236:77:0" + "src": "2310:77:0" } ], - "id": 307, + "id": 312, "name": "FunctionDefinition", - "src": "2177:136:0" + "src": "2251:136:0" }, { "attributes": { @@ -4482,7 +4602,7 @@ ], "name": "", "payable": true, - "scope": 312, + "scope": 317, "stateMutability": "payable", "superFunction": null, "visibility": "internal" @@ -4495,9 +4615,9 @@ ] }, "children": [], - "id": 308, + "id": 313, "name": "ParameterList", - "src": "2325:2:0" + "src": "2399:2:0" }, { "attributes": { @@ -4506,9 +4626,9 @@ ] }, "children": [], - "id": 309, + "id": 314, "name": "ParameterList", - "src": "2345:0:0" + "src": "2419:0:0" }, { "attributes": { @@ -4517,24 +4637,24 @@ ] }, "children": [], - "id": 310, + "id": 315, "name": "Block", - "src": "2345:2:0" + "src": "2419:2:0" } ], - "id": 311, + "id": 316, "name": "FunctionDefinition", - "src": "2317:30:0" + "src": "2391:30:0" } ], - "id": 312, + "id": 317, "name": "ContractDefinition", - "src": "26:2323:0" + "src": "87:2336:0" } ], - "id": 313, + "id": 318, "name": "SourceUnit", - "src": "0:2350:0" + "src": "0:2424:0" }, "compiler": { "name": "solc", @@ -4548,5 +4668,5 @@ } }, "schemaVersion": "1.0.1", - "updatedAt": "2018-01-19T23:48:42.211Z" + "updatedAt": "2018-01-20T17:25:13.162Z" } \ No newline at end of file diff --git a/build/contracts/Migrations.json b/build/contracts/Migrations.json index 1a09dbe2..5db011e0 100644 --- a/build/contracts/Migrations.json +++ b/build/contracts/Migrations.json @@ -823,5 +823,5 @@ } }, "schemaVersion": "1.0.1", - "updatedAt": "2018-01-19T23:48:42.207Z" + "updatedAt": "2018-01-20T17:25:13.159Z" } \ No newline at end of file diff --git a/build/contracts/SimpleStorage.json b/build/contracts/SimpleStorage.json index 4856db35..73d3ec70 100644 --- a/build/contracts/SimpleStorage.json +++ b/build/contracts/SimpleStorage.json @@ -344,5 +344,5 @@ } }, "schemaVersion": "1.0.1", - "updatedAt": "2018-01-19T23:48:42.206Z" + "updatedAt": "2018-01-20T17:25:13.158Z" } \ No newline at end of file diff --git a/contracts/CapCoin.sol b/contracts/CapCoin.sol index 5eae5fde..be58bf8f 100644 --- a/contracts/CapCoin.sol +++ b/contracts/CapCoin.sol @@ -1,11 +1,13 @@ pragma solidity ^0.4.18; -contract CapCoin { +import 'zeppelin-solidity/contracts/ownership/Ownable.sol'; + +contract CapCoin is Ownable { event NewUser(string name); event BoughtTokens(uint coinBalance); event CreatedPost(string url); - event LikedPost(uint lotteryAmount, string posterName, + event LikedPost(int lotteryAmount, string posterName, address poster, uint posterCoinbalance, string likerName, address liker, uint likerCoinbalance); @@ -20,7 +22,7 @@ contract CapCoin { struct Post { string url; string userName; - uint lotteryAmount; + int lotteryAmount; address owner; } @@ -35,7 +37,7 @@ contract CapCoin { NewUser(name); } - function getUser() public view returns (string, uint, string, uint, address) { + function getUser() public view returns (string, uint, string, int, address) { return (addressToUser[msg.sender].name, addressToUser[msg.sender].coinBalance, addressToPost[msg.sender].url, @@ -65,7 +67,7 @@ contract CapCoin { } function likePost(address post, uint amount) public { - addressToPost[post].lotteryAmount += amount; + addressToPost[post].lotteryAmount += int(amount); addressToUser[post].coinBalance += amount; addressToUser[msg.sender].coinBalance -= amount; LikedPost(addressToPost[post].lotteryAmount, diff --git a/readme.md b/readme.md index 11b0cb07..4852f409 100644 --- a/readme.md +++ b/readme.md @@ -9,4 +9,5 @@ c87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3 ae6ae8e5ccbfb04590405997ee2d52d2b330726137b875053c36d94e974d162f +0dbbe8e4ae425a6d2687f1a7e3ba17bc98c673636790f1b8ad91193c05875ef1 http://127.0.0.1:7545 diff --git a/src/components/CreatePost.js b/src/components/CreatePost.js index 526fdeaa..0dff5c5c 100644 --- a/src/components/CreatePost.js +++ b/src/components/CreatePost.js @@ -42,7 +42,7 @@ class CreatePost extends Component { /> - this.props.post(e, this.state.postUrl, this.props.contract.createPost, this.props.accounts[0])} + this.props.post(e, this.state.postUrl, this.props.contract.createPost, this.props.accounts[0], this.props.user.name)} label="Create Post" primary={true} /> @@ -71,9 +71,9 @@ const mapState = (state) => { const mapDispatch = (dispatch) => { return { - post: function(e, postUrl, contractFunc, account){ + post: function(e, postUrl, contractFunc, account, username){ e.preventDefault(); - return dispatch(post(postUrl, contractFunc, account)); + return dispatch(post(postUrl, contractFunc, account, username)); } } } diff --git a/src/components/Explore.js b/src/components/Explore.js index d17f7523..9dc1bc07 100644 --- a/src/components/Explore.js +++ b/src/components/Explore.js @@ -22,7 +22,7 @@ class Explore extends Component {

Explore

{this.props.posts.length > 0 && this.props.posts.map(post => -
+
-
+
)} ) diff --git a/src/store/posts.js b/src/store/posts.js index df594462..b4509dc5 100644 --- a/src/store/posts.js +++ b/src/store/posts.js @@ -23,14 +23,15 @@ const likedPost = post => ({type: LIKED_POST, post}); * THUNK CREATORS */ -export const post = (url, contractFunc, account) => +export const post = (url, contractFunc, account, username) => dispatch => contractFunc(url, {from: account}) .then(res => { let newPost = {} newPost.postUrl = res.logs[0].args.url; - newPost.account = account; - newPost.tokenPot = -5 + newPost.address = account; + newPost.tokenPot = -5; + newPost.username = username; return dispatch(createPost(newPost)); }) .catch(err => console.log(err));