diff --git a/build/contracts/CapCoin.json b/build/contracts/CapCoin.json index 78009777..1c681f9e 100644 --- a/build/contracts/CapCoin.json +++ b/build/contracts/CapCoin.json @@ -1,20 +1,6 @@ { "contractName": "CapCoin", "abi": [ - { - "constant": true, - "inputs": [], - "name": "getUsers", - "outputs": [ - { - "name": "", - "type": "address[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, { "constant": true, "inputs": [ @@ -72,17 +58,12 @@ }, { "constant": true, - "inputs": [ - { - "name": "", - "type": "uint256" - } - ], - "name": "users", + "inputs": [], + "name": "getPosts", "outputs": [ { "name": "", - "type": "address" + "type": "address[]" } ], "payable": false, @@ -90,17 +71,21 @@ "type": "function" }, { - "constant": true, - "inputs": [], - "name": "getPosts", - "outputs": [ + "constant": false, + "inputs": [ { - "name": "", - "type": "address[]" + "name": "post", + "type": "address" + }, + { + "name": "amount", + "type": "uint256" } ], + "name": "likePost", + "outputs": [], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { @@ -138,6 +123,10 @@ { "name": "lotteryAmount", "type": "uint256" + }, + { + "name": "owner", + "type": "address" } ], "payable": false, @@ -205,22 +194,12 @@ { "name": "coinBalance", "type": "uint256" - }, - { - "name": "postNum", - "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor" - }, { "payable": true, "stateMutability": "payable", @@ -261,20 +240,62 @@ ], "name": "CreatedPost", "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "lotteryAmount", + "type": "uint256" + }, + { + "indexed": false, + "name": "posterName", + "type": "string" + }, + { + "indexed": false, + "name": "poster", + "type": "address" + }, + { + "indexed": false, + "name": "posterCoinbalance", + "type": "uint256" + }, + { + "indexed": false, + "name": "likerName", + "type": "string" + }, + { + "indexed": false, + "name": "liker", + "type": "address" + }, + { + "indexed": false, + "name": "likerCoinbalance", + "type": "uint256" + } + ], + "name": "LikedPost", + "type": "event" } ], - "bytecode": "0x6060604052620f42406000556000600155341561001b57600080fd5b60016002819055506111ed806100326000396000f3006060604052600436106100ae576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168062ce8e3e146100b05780630b1e7f831461011a57806326ec928f1461017d5780633610724e14610226578063365b98b21461024957806341f3004a146102ac578063507ffba514610316578063763f17c414610373578063832880e7146104d2578063c7303c611461060d578063edf538861461066a575b005b34156100bb57600080fd5b6100c3610747565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156101065780820151818401526020810190506100eb565b505050509050019250505060405180910390f35b341561012557600080fd5b61013b60048080359060200190919050506107db565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561018857600080fd5b610224600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001909190505061081a565b005b341561023157600080fd5b610247600480803590602001909190505061083a565b005b341561025457600080fd5b61026a6004808035906020019091905050610925565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156102b757600080fd5b6102bf610964565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156103025780820151818401526020810190506102e7565b505050509050019250505060405180910390f35b341561032157600080fd5b610371600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506109f8565b005b341561037e57600080fd5b6103aa600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b64565b60405180806020018060200184815260200183810383528681815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561043d5780601f106104125761010080835404028352916020019161043d565b820191906000526020600020905b81548152906001019060200180831161042057829003601f168201915b50508381038252858181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104c05780601f10610495576101008083540402835291602001916104c0565b820191906000526020600020905b8154815290600101906020018083116104a357829003601f168201915b50509550505050505060405180910390f35b34156104dd57600080fd5b6104e5610b8c565b6040518080602001868152602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838103835288818151815260200191508051906020019080838360005b8381101561056757808201518184015260208101905061054c565b50505050905090810190601f1680156105945780820380516001836020036101000a031916815260200191505b50838103825286818151815260200191508051906020019080838360005b838110156105cd5780820151818401526020810190506105b2565b50505050905090810190601f1680156105fa5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b341561061857600080fd5b610668600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610df5565b005b341561067557600080fd5b6106a1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611018565b60405180806020018481526020018381526020018281038252858181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156107365780601f1061070b57610100808354040283529160200191610736565b820191906000526020600020905b81548152906001019060200180831161071957829003601f168201915b505094505050505060405180910390f35b61074f611041565b60058054806020026020016040519081016040528092919081815260200182805480156107d157602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610787575b5050505050905090565b6006818154811015156107ea57fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610823836109f8565b61082c8161083a565b61083582610df5565b505050565b80600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160008282540192505081905550806001600082825401925050819055508060008082825403925050819055507ffe1367e498701f2dfab80a3d41740d46fd7cba533430e611917f0f3df823279a600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546040518082815260200191505060405180910390a150565b60058181548110151561093457fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61096c611041565b60068054806020026020016040519081016040528092919081815260200182805480156109ee57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116109a4575b5050505050905090565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905081816000019080519060200190610a53929190611055565b5060008160010181905550600160058054806001018281610a7491906110d5565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050507f66ab3fea2083d9ba15d99b595186fe7fc18e6eba393c0fc056f420e96c3caa44826040518080602001828103825283818151815260200191508051906020019080838360005b83811015610b26578082015181840152602081019050610b0b565b50505050905090810190601f168015610b535780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b6004602052806000526040600020600091509050806000019080600101908060020154905083565b610b94611101565b6000610b9e611101565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015433848054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d415780601f10610d1657610100808354040283529160200191610d41565b820191906000526020600020905b815481529060010190602001808311610d2457829003601f168201915b50505050509450828054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ddd5780601f10610db257610100808354040283529160200191610ddd565b820191906000526020600020905b815481529060010190602001808311610dc057829003601f168201915b50505050509250945094509450945094509091929394565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905081816000019080519060200190610e50929190611055565b5060058160020181905550600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001816001019080546001816001161561010002031660029004610ec0929190611115565b50600160068054806001018281610ed791906110d5565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050506005600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507f3b6c110dfadc879ec2bbc1dc567f9065fd5ea5846bce75fddba0f60ffcc79fac826040518080602001828103825283818151815260200191508051906020019080838360005b83811015610fda578082015181840152602081019050610fbf565b50505050905090810190601f1680156110075780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b600360205280600052604060002060009150905080600001908060010154908060020154905083565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061109657805160ff19168380011785556110c4565b828001600101855582156110c4579182015b828111156110c35782518255916020019190600101906110a8565b5b5090506110d1919061119c565b5090565b8154818355818115116110fc578183600052602060002091820191016110fb919061119c565b5b505050565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061114e578054855561118b565b8280016001018555821561118b57600052602060002091601f016020900482015b8281111561118a57825482559160010191906001019061116f565b5b509050611198919061119c565b5090565b6111be91905b808211156111ba5760008160009055506001016111a2565b5090565b905600a165627a7a72305820407afc28e4631aaa2922655150022efb7a20c4f0f71119d92d705b82d3217f560029", - "deployedBytecode": "0x6060604052600436106100ae576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168062ce8e3e146100b05780630b1e7f831461011a57806326ec928f1461017d5780633610724e14610226578063365b98b21461024957806341f3004a146102ac578063507ffba514610316578063763f17c414610373578063832880e7146104d2578063c7303c611461060d578063edf538861461066a575b005b34156100bb57600080fd5b6100c3610747565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156101065780820151818401526020810190506100eb565b505050509050019250505060405180910390f35b341561012557600080fd5b61013b60048080359060200190919050506107db565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561018857600080fd5b610224600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001909190505061081a565b005b341561023157600080fd5b610247600480803590602001909190505061083a565b005b341561025457600080fd5b61026a6004808035906020019091905050610925565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156102b757600080fd5b6102bf610964565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156103025780820151818401526020810190506102e7565b505050509050019250505060405180910390f35b341561032157600080fd5b610371600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506109f8565b005b341561037e57600080fd5b6103aa600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b64565b60405180806020018060200184815260200183810383528681815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561043d5780601f106104125761010080835404028352916020019161043d565b820191906000526020600020905b81548152906001019060200180831161042057829003601f168201915b50508381038252858181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104c05780601f10610495576101008083540402835291602001916104c0565b820191906000526020600020905b8154815290600101906020018083116104a357829003601f168201915b50509550505050505060405180910390f35b34156104dd57600080fd5b6104e5610b8c565b6040518080602001868152602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838103835288818151815260200191508051906020019080838360005b8381101561056757808201518184015260208101905061054c565b50505050905090810190601f1680156105945780820380516001836020036101000a031916815260200191505b50838103825286818151815260200191508051906020019080838360005b838110156105cd5780820151818401526020810190506105b2565b50505050905090810190601f1680156105fa5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b341561061857600080fd5b610668600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610df5565b005b341561067557600080fd5b6106a1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611018565b60405180806020018481526020018381526020018281038252858181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156107365780601f1061070b57610100808354040283529160200191610736565b820191906000526020600020905b81548152906001019060200180831161071957829003601f168201915b505094505050505060405180910390f35b61074f611041565b60058054806020026020016040519081016040528092919081815260200182805480156107d157602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610787575b5050505050905090565b6006818154811015156107ea57fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610823836109f8565b61082c8161083a565b61083582610df5565b505050565b80600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160008282540192505081905550806001600082825401925050819055508060008082825403925050819055507ffe1367e498701f2dfab80a3d41740d46fd7cba533430e611917f0f3df823279a600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546040518082815260200191505060405180910390a150565b60058181548110151561093457fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61096c611041565b60068054806020026020016040519081016040528092919081815260200182805480156109ee57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116109a4575b5050505050905090565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905081816000019080519060200190610a53929190611055565b5060008160010181905550600160058054806001018281610a7491906110d5565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050507f66ab3fea2083d9ba15d99b595186fe7fc18e6eba393c0fc056f420e96c3caa44826040518080602001828103825283818151815260200191508051906020019080838360005b83811015610b26578082015181840152602081019050610b0b565b50505050905090810190601f168015610b535780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b6004602052806000526040600020600091509050806000019080600101908060020154905083565b610b94611101565b6000610b9e611101565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015433848054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d415780601f10610d1657610100808354040283529160200191610d41565b820191906000526020600020905b815481529060010190602001808311610d2457829003601f168201915b50505050509450828054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ddd5780601f10610db257610100808354040283529160200191610ddd565b820191906000526020600020905b815481529060010190602001808311610dc057829003601f168201915b50505050509250945094509450945094509091929394565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905081816000019080519060200190610e50929190611055565b5060058160020181905550600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001816001019080546001816001161561010002031660029004610ec0929190611115565b50600160068054806001018281610ed791906110d5565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050506005600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507f3b6c110dfadc879ec2bbc1dc567f9065fd5ea5846bce75fddba0f60ffcc79fac826040518080602001828103825283818151815260200191508051906020019080838360005b83811015610fda578082015181840152602081019050610fbf565b50505050905090810190601f1680156110075780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b600360205280600052604060002060009150905080600001908060010154908060020154905083565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061109657805160ff19168380011785556110c4565b828001600101855582156110c4579182015b828111156110c35782518255916020019190600101906110a8565b5b5090506110d1919061119c565b5090565b8154818355818115116110fc578183600052602060002091820191016110fb919061119c565b5b505050565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061114e578054855561118b565b8280016001018555821561118b57600052602060002091601f016020900482015b8281111561118a57825482559160010191906001019061116f565b5b509050611198919061119c565b5090565b6111be91905b808211156111ba5760008160009055506001016111a2565b5090565b905600a165627a7a72305820407afc28e4631aaa2922655150022efb7a20c4f0f71119d92d705b82d3217f560029", - "sourceMap": "26:1914:0:-;;;170:7;152:25;;200:1;181:20;;226:46;;;;;;;;266:1;252:11;:15;;;;26:1914;;;;;;", - "deployedSourceMap": "26:1914:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;803:75;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;585:22:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1768:136;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1160:207;;;;;;;;;;;;;;;;;;;;;;;;;;559:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1687: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;;;;;;;;;;;;;;;;;612:187:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;509:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;882: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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1371:312:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;459:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;803:75;844:9;;:::i;:::-;868:5;861:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;803:75;:::o;585:22::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1768:136::-;1835:16;1846:4;1835:10;:16::i;:::-;1859:17;1869:6;1859:9;:17::i;:::-;1884:15;1895:3;1884:10;:15::i;:::-;1768:136;;;:::o;1160:207::-;1246:6;1205:13;:25;1219:10;1205:25;;;;;;;;;;;;;;;:37;;;:47;;;;;;;;;;;1273:6;1258:11;;:21;;;;;;;;;;;1299:6;1285:10;;:20;;;;;;;;;;;1311:51;1324:13;:25;1338:10;1324:25;;;;;;;;;;;;;;;:37;;;1311:51;;;;;;;;;;;;;;;;;;1160:207;:::o;559:22::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1687:77::-;1728:9;;:::i;:::-;1754:5;1747:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1687:77;:::o;612:187::-;658:8;669:13;:25;683:10;669:25;;;;;;;;;;;;;;;658:36;;713:4;701;:9;;:16;;;;;;;;;;;;:::i;:::-;;742:1;723:4;:16;;:20;;;;774:1;750:5;:22;;;;;;;;;;;:::i;:::-;;;;;;;;;;761:10;750:22;;;;;;;;;;;;;;;;;;;;;;:25;;781:13;789:4;781: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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;612:187:0;;:::o;509:46::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;882:274::-;922:6;;:::i;:::-;930:4;936:6;;:::i;:::-;944:4;950:7;973:13;:25;987:10;973:25;;;;;;;;;;;;;;;:30;;1011:13;:25;1025:10;1011:25;;;;;;;;;;;;;;;:37;;;1056:13;:25;1070:10;1056:25;;;;;;;;;;;;;;;:29;;1093:13;:25;1107:10;1093:25;;;;;;;;;;;;;;;:39;;;1140:10;965:186;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;882:274;;;;;:::o;1371:312::-;1440:8;1451:13;:25;1465:10;1451:25;;;;;;;;;;;;;;;1440:36;;1493:3;1482:4;:8;;:14;;;;;;;;;;;;:::i;:::-;;1523:1;1502:4;:18;;:22;;;;1546:13;:25;1560:10;1546:25;;;;;;;;;;;;;;;:30;;1530:4;:13;;:46;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1607:1;1583:5;:22;;;;;;;;;;;:::i;:::-;;;;;;;;;;1594:10;1583:22;;;;;;;;;;;;;;;;;;;;;;:25;;1655:1;1614:13;:25;1628:10;1614:25;;;;;;;;;;;;;;;:37;;;:42;;;;;;;;;;;1662:16;1674:3;1662: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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1371:312:0;;:::o;459:46::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;26:1914::-;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;:::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\n uint coinSupply = 1000000;\n uint coinsBought = 0;\n uint contractNum;\n\n function CapCoin () {\n contractNum = 1;\n }\n\n struct User {\n string name;\n uint coinBalance;\n uint postNum;\n }\n\n struct Post {\n string url;\n string userName;\n uint lotteryAmount;\n string[] captions;\n }\n\n mapping (address => User) public addressToUser;\n mapping (address => Post) public addressToPost;\n address[] public users;\n address[] public posts;\n\n function createUser(string name) public {\n var user = addressToUser[msg.sender];\n\n user.name = name;\n user.coinBalance = 0;\n\n users.push(msg.sender) -1;\n NewUser(name);\n }\n\n function getUsers() public view returns (address[]) {\n return users;\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 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\n posts.push(msg.sender) -1;\n addressToUser[msg.sender].coinBalance -= 5;\n CreatedPost(url);\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": "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", "sourcePath": "/Users/schwartzz8990/Dropbox/fullstack/capCoin/contracts/CapCoin.sol", "ast": { "attributes": { "absolutePath": "/Users/schwartzz8990/Dropbox/fullstack/capCoin/contracts/CapCoin.sol", "exportedSymbols": { "CapCoin": [ - 265 + 312 ] } }, @@ -304,10 +325,10 @@ "documentation": null, "fullyImplemented": true, "linearizedBaseContracts": [ - 265 + 312 ], "name": "CapCoin", - "scope": 266 + "scope": 313 }, "children": [ { @@ -445,11 +466,218 @@ "name": "EventDefinition", "src": "118:30:0" }, + { + "attributes": { + "anonymous": false, + "name": "LikedPost" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "indexed": false, + "name": "lotteryAmount", + "scope": 29, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 14, + "name": "ElementaryTypeName", + "src": "167:4:0" + } + ], + "id": 15, + "name": "VariableDeclaration", + "src": "167:18:0" + }, + { + "attributes": { + "constant": false, + "indexed": false, + "name": "posterName", + "scope": 29, + "stateVariable": false, + "storageLocation": "default", + "type": "string memory", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "string", + "type": "string storage pointer" + }, + "id": 16, + "name": "ElementaryTypeName", + "src": "187:6:0" + } + ], + "id": 17, + "name": "VariableDeclaration", + "src": "187:17:0" + }, + { + "attributes": { + "constant": false, + "indexed": false, + "name": "poster", + "scope": 29, + "stateVariable": false, + "storageLocation": "default", + "type": "address", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "address", + "type": "address" + }, + "id": 18, + "name": "ElementaryTypeName", + "src": "210:7:0" + } + ], + "id": 19, + "name": "VariableDeclaration", + "src": "210:14:0" + }, + { + "attributes": { + "constant": false, + "indexed": false, + "name": "posterCoinbalance", + "scope": 29, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 20, + "name": "ElementaryTypeName", + "src": "226:4:0" + } + ], + "id": 21, + "name": "VariableDeclaration", + "src": "226:22:0" + }, + { + "attributes": { + "constant": false, + "indexed": false, + "name": "likerName", + "scope": 29, + "stateVariable": false, + "storageLocation": "default", + "type": "string memory", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "string", + "type": "string storage pointer" + }, + "id": 22, + "name": "ElementaryTypeName", + "src": "250:6:0" + } + ], + "id": 23, + "name": "VariableDeclaration", + "src": "250:16:0" + }, + { + "attributes": { + "constant": false, + "indexed": false, + "name": "liker", + "scope": 29, + "stateVariable": false, + "storageLocation": "default", + "type": "address", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "address", + "type": "address" + }, + "id": 24, + "name": "ElementaryTypeName", + "src": "272:7:0" + } + ], + "id": 25, + "name": "VariableDeclaration", + "src": "272:13:0" + }, + { + "attributes": { + "constant": false, + "indexed": false, + "name": "likerCoinbalance", + "scope": 29, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 26, + "name": "ElementaryTypeName", + "src": "287:4:0" + } + ], + "id": 27, + "name": "VariableDeclaration", + "src": "287:21:0" + } + ], + "id": 28, + "name": "ParameterList", + "src": "166:143:0" + } + ], + "id": 29, + "name": "EventDefinition", + "src": "151:159:0" + }, { "attributes": { "constant": false, "name": "coinSupply", - "scope": 265, + "scope": 312, "stateVariable": true, "storageLocation": "default", "type": "uint256", @@ -461,9 +689,9 @@ "name": "uint", "type": "uint256" }, - "id": 14, + "id": 30, "name": "ElementaryTypeName", - "src": "152:4:0" + "src": "314:4:0" }, { "attributes": { @@ -478,20 +706,20 @@ "type": "int_const 1000000", "value": "1000000" }, - "id": 15, + "id": 31, "name": "Literal", - "src": "170:7:0" + "src": "332:7:0" } ], - "id": 16, + "id": 32, "name": "VariableDeclaration", - "src": "152:25:0" + "src": "314:25:0" }, { "attributes": { "constant": false, "name": "coinsBought", - "scope": 265, + "scope": 312, "stateVariable": true, "storageLocation": "default", "type": "uint256", @@ -503,9 +731,9 @@ "name": "uint", "type": "uint256" }, - "id": 17, + "id": 33, "name": "ElementaryTypeName", - "src": "181:4:0" + "src": "343:4:0" }, { "attributes": { @@ -520,150 +748,20 @@ "type": "int_const 0", "value": "0" }, - "id": 18, + "id": 34, "name": "Literal", - "src": "200:1:0" + "src": "362:1:0" } ], - "id": 19, + "id": 35, "name": "VariableDeclaration", - "src": "181:20:0" - }, - { - "attributes": { - "constant": false, - "name": "contractNum", - "scope": 265, - "stateVariable": true, - "storageLocation": "default", - "type": "uint256", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "uint", - "type": "uint256" - }, - "id": 20, - "name": "ElementaryTypeName", - "src": "205:4:0" - } - ], - "id": 21, - "name": "VariableDeclaration", - "src": "205:16:0" - }, - { - "attributes": { - "constant": false, - "implemented": true, - "isConstructor": true, - "modifiers": [ - null - ], - "name": "CapCoin", - "payable": false, - "scope": 265, - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - "children": [ - { - "attributes": { - "parameters": [ - null - ] - }, - "children": [], - "id": 22, - "name": "ParameterList", - "src": "243:2:0" - }, - { - "attributes": { - "parameters": [ - null - ] - }, - "children": [], - "id": 23, - "name": "ParameterList", - "src": "246:0:0" - }, - { - "children": [ - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "=", - "type": "uint256" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 21, - "type": "uint256", - "value": "contractNum" - }, - "id": 24, - "name": "Identifier", - "src": "252:11:0" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "31", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "number", - "type": "int_const 1", - "value": "1" - }, - "id": 25, - "name": "Literal", - "src": "266:1:0" - } - ], - "id": 26, - "name": "Assignment", - "src": "252:15:0" - } - ], - "id": 27, - "name": "ExpressionStatement", - "src": "252:15:0" - } - ], - "id": 28, - "name": "Block", - "src": "246:26:0" - } - ], - "id": 29, - "name": "FunctionDefinition", - "src": "226:46:0" + "src": "343:20:0" }, { "attributes": { "canonicalName": "CapCoin.User", "name": "User", - "scope": 265, + "scope": 312, "visibility": "public" }, "children": [ @@ -671,7 +769,7 @@ "attributes": { "constant": false, "name": "name", - "scope": 36, + "scope": 40, "stateVariable": false, "storageLocation": "default", "type": "string storage pointer", @@ -684,46 +782,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 30, + "id": 36, "name": "ElementaryTypeName", - "src": "294:6:0" + "src": "386:6:0" } ], - "id": 31, + "id": 37, "name": "VariableDeclaration", - "src": "294:11:0" + "src": "386:11:0" }, { "attributes": { "constant": false, "name": "coinBalance", - "scope": 36, - "stateVariable": false, - "storageLocation": "default", - "type": "uint256", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "uint", - "type": "uint256" - }, - "id": 32, - "name": "ElementaryTypeName", - "src": "311:4:0" - } - ], - "id": 33, - "name": "VariableDeclaration", - "src": "311:16:0" - }, - { - "attributes": { - "constant": false, - "name": "postNum", - "scope": 36, + "scope": 40, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -736,25 +808,25 @@ "name": "uint", "type": "uint256" }, - "id": 34, + "id": 38, "name": "ElementaryTypeName", - "src": "333:4:0" + "src": "403:4:0" } ], - "id": 35, + "id": 39, "name": "VariableDeclaration", - "src": "333:12:0" + "src": "403:16:0" } ], - "id": 36, + "id": 40, "name": "StructDefinition", - "src": "276:74:0" + "src": "368:56:0" }, { "attributes": { "canonicalName": "CapCoin.Post", "name": "Post", - "scope": 265, + "scope": 312, "visibility": "public" }, "children": [ @@ -762,7 +834,7 @@ "attributes": { "constant": false, "name": "url", - "scope": 46, + "scope": 49, "stateVariable": false, "storageLocation": "default", "type": "string storage pointer", @@ -775,20 +847,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 37, + "id": 41, "name": "ElementaryTypeName", - "src": "372:6:0" + "src": "446:6:0" } ], - "id": 38, + "id": 42, "name": "VariableDeclaration", - "src": "372:10:0" + "src": "446:10:0" }, { "attributes": { "constant": false, "name": "userName", - "scope": 46, + "scope": 49, "stateVariable": false, "storageLocation": "default", "type": "string storage pointer", @@ -801,20 +873,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 39, + "id": 43, "name": "ElementaryTypeName", - "src": "388:6:0" + "src": "462:6:0" } ], - "id": 40, + "id": 44, "name": "VariableDeclaration", - "src": "388:15:0" + "src": "462:15:0" }, { "attributes": { "constant": false, "name": "lotteryAmount", - "scope": 46, + "scope": 49, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -827,62 +899,51 @@ "name": "uint", "type": "uint256" }, - "id": 41, + "id": 45, "name": "ElementaryTypeName", - "src": "409:4:0" + "src": "483:4:0" } ], - "id": 42, + "id": 46, "name": "VariableDeclaration", - "src": "409:18:0" + "src": "483:18:0" }, { "attributes": { "constant": false, - "name": "captions", - "scope": 46, + "name": "owner", + "scope": 49, "stateVariable": false, "storageLocation": "default", - "type": "string storage ref[] storage pointer", + "type": "address", "value": null, "visibility": "internal" }, "children": [ { "attributes": { - "length": null, - "type": "string storage ref[] storage pointer" + "name": "address", + "type": "address" }, - "children": [ - { - "attributes": { - "name": "string", - "type": "string storage pointer" - }, - "id": 43, - "name": "ElementaryTypeName", - "src": "433:6:0" - } - ], - "id": 44, - "name": "ArrayTypeName", - "src": "433:8:0" + "id": 47, + "name": "ElementaryTypeName", + "src": "507:7:0" } ], - "id": 45, + "id": 48, "name": "VariableDeclaration", - "src": "433:17:0" + "src": "507:13:0" } ], - "id": 46, + "id": 49, "name": "StructDefinition", - "src": "354:101:0" + "src": "428:97:0" }, { "attributes": { "constant": false, "name": "addressToUser", - "scope": 265, + "scope": 312, "stateVariable": true, "storageLocation": "default", "type": "mapping(address => struct CapCoin.User storage ref)", @@ -900,36 +961,36 @@ "name": "address", "type": "address" }, - "id": 47, + "id": 50, "name": "ElementaryTypeName", - "src": "468:7:0" + "src": "538:7:0" }, { "attributes": { "contractScope": null, "name": "User", - "referencedDeclaration": 36, + "referencedDeclaration": 40, "type": "struct CapCoin.User storage pointer" }, - "id": 48, + "id": 51, "name": "UserDefinedTypeName", - "src": "479:4:0" + "src": "549:4:0" } ], - "id": 49, + "id": 52, "name": "Mapping", - "src": "459:25:0" + "src": "529:25:0" } ], - "id": 50, + "id": 53, "name": "VariableDeclaration", - "src": "459:46:0" + "src": "529:46:0" }, { "attributes": { "constant": false, "name": "addressToPost", - "scope": 265, + "scope": 312, "stateVariable": true, "storageLocation": "default", "type": "mapping(address => struct CapCoin.Post storage ref)", @@ -947,73 +1008,36 @@ "name": "address", "type": "address" }, - "id": 51, + "id": 54, "name": "ElementaryTypeName", - "src": "518:7:0" + "src": "588:7:0" }, { "attributes": { "contractScope": null, "name": "Post", - "referencedDeclaration": 46, + "referencedDeclaration": 49, "type": "struct CapCoin.Post storage pointer" }, - "id": 52, - "name": "UserDefinedTypeName", - "src": "529:4:0" - } - ], - "id": 53, - "name": "Mapping", - "src": "509:25:0" - } - ], - "id": 54, - "name": "VariableDeclaration", - "src": "509:46:0" - }, - { - "attributes": { - "constant": false, - "name": "users", - "scope": 265, - "stateVariable": true, - "storageLocation": "default", - "type": "address[] storage ref", - "value": null, - "visibility": "public" - }, - "children": [ - { - "attributes": { - "length": null, - "type": "address[] storage pointer" - }, - "children": [ - { - "attributes": { - "name": "address", - "type": "address" - }, "id": 55, - "name": "ElementaryTypeName", - "src": "559:7:0" + "name": "UserDefinedTypeName", + "src": "599:4:0" } ], "id": 56, - "name": "ArrayTypeName", - "src": "559:9:0" + "name": "Mapping", + "src": "579:25:0" } ], "id": 57, "name": "VariableDeclaration", - "src": "559:22:0" + "src": "579:46:0" }, { "attributes": { "constant": false, "name": "posts", - "scope": 265, + "scope": 312, "stateVariable": true, "storageLocation": "default", "type": "address[] storage ref", @@ -1034,17 +1058,17 @@ }, "id": 58, "name": "ElementaryTypeName", - "src": "585:7:0" + "src": "629:7:0" } ], "id": 59, "name": "ArrayTypeName", - "src": "585:9:0" + "src": "629:9:0" } ], "id": 60, "name": "VariableDeclaration", - "src": "585:22:0" + "src": "629:22:0" }, { "attributes": { @@ -1056,7 +1080,7 @@ ], "name": "createUser", "payable": false, - "scope": 265, + "scope": 312, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -1068,7 +1092,7 @@ "attributes": { "constant": false, "name": "name", - "scope": 97, + "scope": 88, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -1083,17 +1107,17 @@ }, "id": 61, "name": "ElementaryTypeName", - "src": "632:6:0" + "src": "676:6:0" } ], "id": 62, "name": "VariableDeclaration", - "src": "632:11:0" + "src": "676:11:0" } ], "id": 63, "name": "ParameterList", - "src": "631:13:0" + "src": "675:13:0" }, { "attributes": { @@ -1104,7 +1128,7 @@ "children": [], "id": 64, "name": "ParameterList", - "src": "652:0:0" + "src": "696:0:0" }, { "children": [ @@ -1119,7 +1143,7 @@ "attributes": { "constant": false, "name": "user", - "scope": 97, + "scope": 88, "stateVariable": false, "storageLocation": "default", "type": "struct CapCoin.User storage pointer", @@ -1130,7 +1154,7 @@ "children": [], "id": 65, "name": "VariableDeclaration", - "src": "658:8:0" + "src": "702:8:0" }, { "attributes": { @@ -1148,13 +1172,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 50, + "referencedDeclaration": 53, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, "id": 66, "name": "Identifier", - "src": "669:13:0" + "src": "713:13:0" }, { "attributes": { @@ -1174,28 +1198,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 277, + "referencedDeclaration": 324, "type": "msg", "value": "msg" }, "id": 67, "name": "Identifier", - "src": "683:3:0" + "src": "727:3:0" } ], "id": 68, "name": "MemberAccess", - "src": "683:10:0" + "src": "727:10:0" } ], "id": 69, "name": "IndexAccess", - "src": "669:25:0" + "src": "713:25:0" } ], "id": 70, "name": "VariableDeclarationStatement", - "src": "658:36:0" + "src": "702:36:0" }, { "children": [ @@ -1218,7 +1242,7 @@ "isPure": false, "lValueRequested": true, "member_name": "name", - "referencedDeclaration": 31, + "referencedDeclaration": 37, "type": "string storage ref" }, "children": [ @@ -1234,12 +1258,12 @@ }, "id": 71, "name": "Identifier", - "src": "701:4:0" + "src": "744:4:0" } ], "id": 73, "name": "MemberAccess", - "src": "701:9:0" + "src": "744:9:0" }, { "attributes": { @@ -1253,17 +1277,17 @@ }, "id": 74, "name": "Identifier", - "src": "713:4:0" + "src": "756:4:0" } ], "id": 75, "name": "Assignment", - "src": "701:16:0" + "src": "744:16:0" } ], "id": 76, "name": "ExpressionStatement", - "src": "701:16:0" + "src": "744:16:0" }, { "children": [ @@ -1286,7 +1310,7 @@ "isPure": false, "lValueRequested": true, "member_name": "coinBalance", - "referencedDeclaration": 33, + "referencedDeclaration": 39, "type": "uint256" }, "children": [ @@ -1302,12 +1326,12 @@ }, "id": 77, "name": "Identifier", - "src": "723:4:0" + "src": "766:4:0" } ], "id": 79, "name": "MemberAccess", - "src": "723:16:0" + "src": "766:16:0" }, { "attributes": { @@ -1324,325 +1348,87 @@ }, "id": 80, "name": "Literal", - "src": "742:1:0" + "src": "785:1:0" } ], "id": 81, "name": "Assignment", - "src": "723:20:0" + "src": "766:20:0" } ], "id": 82, "name": "ExpressionStatement", - "src": "723:20:0" + "src": "766:20:0" }, { "children": [ { "attributes": { "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, "isConstant": false, "isLValue": false, "isPure": false, + "isStructConstructorCall": false, "lValueRequested": false, - "operator": "-", - "type": "uint256" + "names": [ + null + ], + "type": "tuple()", + "type_conversion": false }, "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 5, + "type": "function (string memory)", + "value": "NewUser" + }, + "id": 83, + "name": "Identifier", + "src": "792:7:0" + }, { "attributes": { "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ + "overloadedDeclarations": [ null ], - "type": "uint256", - "type_conversion": false + "referencedDeclaration": 62, + "type": "string memory", + "value": "name" }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "push", - "referencedDeclaration": null, - "type": "function (address) returns (uint256)" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 57, - "type": "address[] storage ref", - "value": "users" - }, - "id": 83, - "name": "Identifier", - "src": "750:5:0" - } - ], - "id": 85, - "name": "MemberAccess", - "src": "750:10:0" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "sender", - "referencedDeclaration": null, - "type": "address" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 277, - "type": "msg", - "value": "msg" - }, - "id": 86, - "name": "Identifier", - "src": "761:3:0" - } - ], - "id": 87, - "name": "MemberAccess", - "src": "761:10:0" - } - ], - "id": 88, - "name": "FunctionCall", - "src": "750:22:0" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "31", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "number", - "type": "int_const 1", - "value": "1" - }, - "id": 89, - "name": "Literal", - "src": "774:1:0" - } - ], - "id": 90, - "name": "BinaryOperation", - "src": "750:25:0" - } - ], - "id": 91, - "name": "ExpressionStatement", - "src": "750:25:0" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - ], - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 5, - "type": "function (string memory)", - "value": "NewUser" - }, - "id": 92, - "name": "Identifier", - "src": "781:7:0" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 62, - "type": "string memory", - "value": "name" - }, - "id": 93, + "id": 84, "name": "Identifier", - "src": "789:4:0" + "src": "800:4:0" } ], - "id": 94, + "id": 85, "name": "FunctionCall", - "src": "781:13:0" + "src": "792:13:0" } ], - "id": 95, + "id": 86, "name": "ExpressionStatement", - "src": "781:13:0" - } - ], - "id": 96, - "name": "Block", - "src": "652:147:0" - } - ], - "id": 97, - "name": "FunctionDefinition", - "src": "612:187:0" - }, - { - "attributes": { - "constant": true, - "implemented": true, - "isConstructor": false, - "modifiers": [ - null - ], - "name": "getUsers", - "payable": false, - "scope": 265, - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - "children": [ - { - "attributes": { - "parameters": [ - null - ] - }, - "children": [], - "id": 98, - "name": "ParameterList", - "src": "820:2:0" - }, - { - "children": [ - { - "attributes": { - "constant": false, - "name": "", - "scope": 106, - "stateVariable": false, - "storageLocation": "default", - "type": "address[] memory", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "length": null, - "type": "address[] storage pointer" - }, - "children": [ - { - "attributes": { - "name": "address", - "type": "address" - }, - "id": 99, - "name": "ElementaryTypeName", - "src": "844:7:0" - } - ], - "id": 100, - "name": "ArrayTypeName", - "src": "844:9:0" - } - ], - "id": 101, - "name": "VariableDeclaration", - "src": "844:9:0" - } - ], - "id": 102, - "name": "ParameterList", - "src": "843:11:0" - }, - { - "children": [ - { - "attributes": { - "functionReturnParameters": 102 - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 57, - "type": "address[] storage ref", - "value": "users" - }, - "id": 103, - "name": "Identifier", - "src": "868:5:0" - } - ], - "id": 104, - "name": "Return", - "src": "861:12:0" + "src": "792:13:0" } ], - "id": 105, + "id": 87, "name": "Block", - "src": "855:23:0" + "src": "696:114:0" } ], - "id": 106, + "id": 88, "name": "FunctionDefinition", - "src": "803:75:0" + "src": "656:154:0" }, { "attributes": { @@ -1654,7 +1440,7 @@ ], "name": "getUser", "payable": false, - "scope": 265, + "scope": 312, "stateMutability": "view", "superFunction": null, "visibility": "public" @@ -1667,9 +1453,9 @@ ] }, "children": [], - "id": 107, + "id": 89, "name": "ParameterList", - "src": "898:2:0" + "src": "830:2:0" }, { "children": [ @@ -1677,7 +1463,7 @@ "attributes": { "constant": false, "name": "", - "scope": 144, + "scope": 126, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -1690,20 +1476,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 108, + "id": 90, "name": "ElementaryTypeName", - "src": "922:6:0" + "src": "854:6:0" } ], - "id": 109, + "id": 91, "name": "VariableDeclaration", - "src": "922:6:0" + "src": "854:6:0" }, { "attributes": { "constant": false, "name": "", - "scope": 144, + "scope": 126, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -1716,20 +1502,20 @@ "name": "uint", "type": "uint256" }, - "id": 110, + "id": 92, "name": "ElementaryTypeName", - "src": "930:4:0" + "src": "862:4:0" } ], - "id": 111, + "id": 93, "name": "VariableDeclaration", - "src": "930:4:0" + "src": "862:4:0" }, { "attributes": { "constant": false, "name": "", - "scope": 144, + "scope": 126, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -1742,20 +1528,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 112, + "id": 94, "name": "ElementaryTypeName", - "src": "936:6:0" + "src": "868:6:0" } ], - "id": 113, + "id": 95, "name": "VariableDeclaration", - "src": "936:6:0" + "src": "868:6:0" }, { "attributes": { "constant": false, "name": "", - "scope": 144, + "scope": 126, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -1768,20 +1554,20 @@ "name": "uint", "type": "uint256" }, - "id": 114, + "id": 96, "name": "ElementaryTypeName", - "src": "944:4:0" + "src": "876:4:0" } ], - "id": 115, + "id": 97, "name": "VariableDeclaration", - "src": "944:4:0" + "src": "876:4:0" }, { "attributes": { "constant": false, "name": "", - "scope": 144, + "scope": 126, "stateVariable": false, "storageLocation": "default", "type": "address", @@ -1794,25 +1580,25 @@ "name": "address", "type": "address" }, - "id": 116, + "id": 98, "name": "ElementaryTypeName", - "src": "950:7:0" + "src": "882:7:0" } ], - "id": 117, + "id": 99, "name": "VariableDeclaration", - "src": "950:7:0" + "src": "882:7:0" } ], - "id": 118, + "id": 100, "name": "ParameterList", - "src": "921:37:0" + "src": "853:37:0" }, { "children": [ { "attributes": { - "functionReturnParameters": 118 + "functionReturnParameters": 100 }, "children": [ { @@ -1834,7 +1620,7 @@ "isPure": false, "lValueRequested": false, "member_name": "name", - "referencedDeclaration": 31, + "referencedDeclaration": 37, "type": "string storage ref" }, "children": [ @@ -1854,13 +1640,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 50, + "referencedDeclaration": 53, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 119, + "id": 101, "name": "Identifier", - "src": "973:13:0" + "src": "905:13:0" }, { "attributes": { @@ -1880,28 +1666,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 277, + "referencedDeclaration": 324, "type": "msg", "value": "msg" }, - "id": 120, + "id": 102, "name": "Identifier", - "src": "987:3:0" + "src": "919:3:0" } ], - "id": 121, + "id": 103, "name": "MemberAccess", - "src": "987:10:0" + "src": "919:10:0" } ], - "id": 122, + "id": 104, "name": "IndexAccess", - "src": "973:25:0" + "src": "905:25:0" } ], - "id": 123, + "id": 105, "name": "MemberAccess", - "src": "973:30:0" + "src": "905:30:0" }, { "attributes": { @@ -1911,7 +1697,7 @@ "isPure": false, "lValueRequested": false, "member_name": "coinBalance", - "referencedDeclaration": 33, + "referencedDeclaration": 39, "type": "uint256" }, "children": [ @@ -1931,13 +1717,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 50, + "referencedDeclaration": 53, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 124, + "id": 106, "name": "Identifier", - "src": "1011:13:0" + "src": "943:13:0" }, { "attributes": { @@ -1957,28 +1743,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 277, + "referencedDeclaration": 324, "type": "msg", "value": "msg" }, - "id": 125, + "id": 107, "name": "Identifier", - "src": "1025:3:0" + "src": "957:3:0" } ], - "id": 126, + "id": 108, "name": "MemberAccess", - "src": "1025:10:0" + "src": "957:10:0" } ], - "id": 127, + "id": 109, "name": "IndexAccess", - "src": "1011:25:0" + "src": "943:25:0" } ], - "id": 128, + "id": 110, "name": "MemberAccess", - "src": "1011:37:0" + "src": "943:37:0" }, { "attributes": { @@ -1988,7 +1774,7 @@ "isPure": false, "lValueRequested": false, "member_name": "url", - "referencedDeclaration": 38, + "referencedDeclaration": 42, "type": "string storage ref" }, "children": [ @@ -2008,13 +1794,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 54, + "referencedDeclaration": 57, "type": "mapping(address => struct CapCoin.Post storage ref)", "value": "addressToPost" }, - "id": 129, + "id": 111, "name": "Identifier", - "src": "1056:13:0" + "src": "988:13:0" }, { "attributes": { @@ -2034,28 +1820,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 277, + "referencedDeclaration": 324, "type": "msg", "value": "msg" }, - "id": 130, + "id": 112, "name": "Identifier", - "src": "1070:3:0" + "src": "1002:3:0" } ], - "id": 131, + "id": 113, "name": "MemberAccess", - "src": "1070:10:0" + "src": "1002:10:0" } ], - "id": 132, + "id": 114, "name": "IndexAccess", - "src": "1056:25:0" + "src": "988:25:0" } ], - "id": 133, + "id": 115, "name": "MemberAccess", - "src": "1056:29:0" + "src": "988:29:0" }, { "attributes": { @@ -2065,7 +1851,7 @@ "isPure": false, "lValueRequested": false, "member_name": "lotteryAmount", - "referencedDeclaration": 42, + "referencedDeclaration": 46, "type": "uint256" }, "children": [ @@ -2085,13 +1871,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 54, + "referencedDeclaration": 57, "type": "mapping(address => struct CapCoin.Post storage ref)", "value": "addressToPost" }, - "id": 134, + "id": 116, "name": "Identifier", - "src": "1093:13:0" + "src": "1025:13:0" }, { "attributes": { @@ -2111,28 +1897,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 277, + "referencedDeclaration": 324, "type": "msg", "value": "msg" }, - "id": 135, + "id": 117, "name": "Identifier", - "src": "1107:3:0" + "src": "1039:3:0" } ], - "id": 136, + "id": 118, "name": "MemberAccess", - "src": "1107:10:0" + "src": "1039:10:0" } ], - "id": 137, + "id": 119, "name": "IndexAccess", - "src": "1093:25:0" + "src": "1025:25:0" } ], - "id": 138, + "id": 120, "name": "MemberAccess", - "src": "1093:39:0" + "src": "1025:39:0" }, { "attributes": { @@ -2152,38 +1938,38 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 277, + "referencedDeclaration": 324, "type": "msg", "value": "msg" }, - "id": 139, + "id": 121, "name": "Identifier", - "src": "1140:3:0" + "src": "1072:3:0" } ], - "id": 140, + "id": 122, "name": "MemberAccess", - "src": "1140:10:0" + "src": "1072:10:0" } ], - "id": 141, + "id": 123, "name": "TupleExpression", - "src": "972:179:0" + "src": "904:179:0" } ], - "id": 142, + "id": 124, "name": "Return", - "src": "965:186:0" + "src": "897:186:0" } ], - "id": 143, + "id": 125, "name": "Block", - "src": "959:197:0" + "src": "891:197:0" } ], - "id": 144, + "id": 126, "name": "FunctionDefinition", - "src": "882:274:0" + "src": "814:274:0" }, { "attributes": { @@ -2195,7 +1981,7 @@ ], "name": "buyTokens", "payable": false, - "scope": 265, + "scope": 312, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -2207,7 +1993,7 @@ "attributes": { "constant": false, "name": "amount", - "scope": 174, + "scope": 156, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -2220,19 +2006,19 @@ "name": "uint", "type": "uint256" }, - "id": 145, + "id": 127, "name": "ElementaryTypeName", - "src": "1179:4:0" + "src": "1138:4:0" } ], - "id": 146, + "id": 128, "name": "VariableDeclaration", - "src": "1179:11:0" + "src": "1138:11:0" } ], - "id": 147, + "id": 129, "name": "ParameterList", - "src": "1178:13:0" + "src": "1137:13:0" }, { "attributes": { @@ -2241,9 +2027,9 @@ ] }, "children": [], - "id": 148, + "id": 130, "name": "ParameterList", - "src": "1199:0:0" + "src": "1158:0:0" }, { "children": [ @@ -2268,7 +2054,7 @@ "isPure": false, "lValueRequested": true, "member_name": "coinBalance", - "referencedDeclaration": 33, + "referencedDeclaration": 39, "type": "uint256" }, "children": [ @@ -2288,13 +2074,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 50, + "referencedDeclaration": 53, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 149, + "id": 131, "name": "Identifier", - "src": "1205:13:0" + "src": "1164:13:0" }, { "attributes": { @@ -2314,28 +2100,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 277, + "referencedDeclaration": 324, "type": "msg", "value": "msg" }, - "id": 150, + "id": 132, "name": "Identifier", - "src": "1219:3:0" + "src": "1178:3:0" } ], - "id": 151, + "id": 133, "name": "MemberAccess", - "src": "1219:10:0" + "src": "1178:10:0" } ], - "id": 152, + "id": 134, "name": "IndexAccess", - "src": "1205:25:0" + "src": "1164:25:0" } ], - "id": 153, + "id": 135, "name": "MemberAccess", - "src": "1205:37:0" + "src": "1164:37:0" }, { "attributes": { @@ -2343,23 +2129,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 146, + "referencedDeclaration": 128, "type": "uint256", "value": "amount" }, - "id": 154, + "id": 136, "name": "Identifier", - "src": "1246:6:0" + "src": "1205:6:0" } ], - "id": 155, + "id": 137, "name": "Assignment", - "src": "1205:47:0" + "src": "1164:47:0" } ], - "id": 156, + "id": 138, "name": "ExpressionStatement", - "src": "1205:47:0" + "src": "1164:47:0" }, { "children": [ @@ -2380,13 +2166,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 19, + "referencedDeclaration": 35, "type": "uint256", "value": "coinsBought" }, - "id": 157, + "id": 139, "name": "Identifier", - "src": "1258:11:0" + "src": "1217:11:0" }, { "attributes": { @@ -2394,23 +2180,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 146, + "referencedDeclaration": 128, "type": "uint256", "value": "amount" }, - "id": 158, + "id": 140, "name": "Identifier", - "src": "1273:6:0" + "src": "1232:6:0" } ], - "id": 159, + "id": 141, "name": "Assignment", - "src": "1258:21:0" + "src": "1217:21:0" } ], - "id": 160, + "id": 142, "name": "ExpressionStatement", - "src": "1258:21:0" + "src": "1217:21:0" }, { "children": [ @@ -2431,13 +2217,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 16, + "referencedDeclaration": 32, "type": "uint256", "value": "coinSupply" }, - "id": 161, + "id": 143, "name": "Identifier", - "src": "1285:10:0" + "src": "1244:10:0" }, { "attributes": { @@ -2445,23 +2231,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 146, + "referencedDeclaration": 128, "type": "uint256", "value": "amount" }, - "id": 162, + "id": 144, "name": "Identifier", - "src": "1299:6:0" + "src": "1258:6:0" } ], - "id": 163, + "id": 145, "name": "Assignment", - "src": "1285:20:0" + "src": "1244:20:0" } ], - "id": 164, + "id": 146, "name": "ExpressionStatement", - "src": "1285:20:0" + "src": "1244:20:0" }, { "children": [ @@ -2495,9 +2281,9 @@ "type": "function (uint256)", "value": "BoughtTokens" }, - "id": 165, + "id": 147, "name": "Identifier", - "src": "1311:12:0" + "src": "1270:12:0" }, { "attributes": { @@ -2507,7 +2293,7 @@ "isPure": false, "lValueRequested": false, "member_name": "coinBalance", - "referencedDeclaration": 33, + "referencedDeclaration": 39, "type": "uint256" }, "children": [ @@ -2527,13 +2313,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 50, + "referencedDeclaration": 53, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 166, + "id": 148, "name": "Identifier", - "src": "1324:13:0" + "src": "1283:13:0" }, { "attributes": { @@ -2553,48 +2339,48 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 277, + "referencedDeclaration": 324, "type": "msg", "value": "msg" }, - "id": 167, + "id": 149, "name": "Identifier", - "src": "1338:3:0" + "src": "1297:3:0" } ], - "id": 168, + "id": 150, "name": "MemberAccess", - "src": "1338:10:0" + "src": "1297:10:0" } ], - "id": 169, + "id": 151, "name": "IndexAccess", - "src": "1324:25:0" + "src": "1283:25:0" } ], - "id": 170, + "id": 152, "name": "MemberAccess", - "src": "1324:37:0" + "src": "1283:37:0" } ], - "id": 171, + "id": 153, "name": "FunctionCall", - "src": "1311:51:0" + "src": "1270:51:0" } ], - "id": 172, + "id": 154, "name": "ExpressionStatement", - "src": "1311:51:0" + "src": "1270:51:0" } ], - "id": 173, + "id": 155, "name": "Block", - "src": "1199:168:0" + "src": "1158:168:0" } ], - "id": 174, + "id": 156, "name": "FunctionDefinition", - "src": "1160:207:0" + "src": "1119:207:0" }, { "attributes": { @@ -2606,7 +2392,7 @@ ], "name": "createPost", "payable": false, - "scope": 265, + "scope": 312, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -2618,7 +2404,7 @@ "attributes": { "constant": false, "name": "url", - "scope": 229, + "scope": 218, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -2631,19 +2417,19 @@ "name": "string", "type": "string storage pointer" }, - "id": 175, + "id": 157, "name": "ElementaryTypeName", - "src": "1391:6:0" + "src": "1350:6:0" } ], - "id": 176, + "id": 158, "name": "VariableDeclaration", - "src": "1391:10:0" + "src": "1350:10:0" } ], - "id": 177, + "id": 159, "name": "ParameterList", - "src": "1390:12:0" + "src": "1349:12:0" }, { "attributes": { @@ -2652,16 +2438,16 @@ ] }, "children": [], - "id": 178, + "id": 160, "name": "ParameterList", - "src": "1410:0:0" + "src": "1369:0:0" }, { "children": [ { "attributes": { "assignments": [ - 179 + 161 ] }, "children": [ @@ -2669,7 +2455,7 @@ "attributes": { "constant": false, "name": "post", - "scope": 229, + "scope": 218, "stateVariable": false, "storageLocation": "default", "type": "struct CapCoin.Post storage pointer", @@ -2678,9 +2464,9 @@ "visibility": "internal" }, "children": [], - "id": 179, + "id": 161, "name": "VariableDeclaration", - "src": "1440:8:0" + "src": "1399:8:0" }, { "attributes": { @@ -2698,13 +2484,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 54, + "referencedDeclaration": 57, "type": "mapping(address => struct CapCoin.Post storage ref)", "value": "addressToPost" }, - "id": 180, + "id": 162, "name": "Identifier", - "src": "1451:13:0" + "src": "1410:13:0" }, { "attributes": { @@ -2724,28 +2510,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 277, + "referencedDeclaration": 324, "type": "msg", "value": "msg" }, - "id": 181, + "id": 163, "name": "Identifier", - "src": "1465:3:0" + "src": "1424:3:0" } ], - "id": 182, + "id": 164, "name": "MemberAccess", - "src": "1465:10:0" + "src": "1424:10:0" } ], - "id": 183, + "id": 165, "name": "IndexAccess", - "src": "1451:25:0" + "src": "1410:25:0" } ], - "id": 184, + "id": 166, "name": "VariableDeclarationStatement", - "src": "1440:36:0" + "src": "1399:36:0" }, { "children": [ @@ -2768,7 +2554,7 @@ "isPure": false, "lValueRequested": true, "member_name": "url", - "referencedDeclaration": 38, + "referencedDeclaration": 42, "type": "string storage ref" }, "children": [ @@ -2778,18 +2564,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 179, + "referencedDeclaration": 161, "type": "struct CapCoin.Post storage pointer", "value": "post" }, - "id": 185, + "id": 167, "name": "Identifier", - "src": "1482:4:0" + "src": "1441:4:0" } ], - "id": 187, + "id": 169, "name": "MemberAccess", - "src": "1482:8:0" + "src": "1441:8:0" }, { "attributes": { @@ -2797,23 +2583,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 176, + "referencedDeclaration": 158, "type": "string memory", "value": "url" }, - "id": 188, + "id": 170, "name": "Identifier", - "src": "1493:3:0" + "src": "1452:3:0" } ], - "id": 189, + "id": 171, "name": "Assignment", - "src": "1482:14:0" + "src": "1441:14:0" } ], - "id": 190, + "id": 172, "name": "ExpressionStatement", - "src": "1482:14:0" + "src": "1441:14:0" }, { "children": [ @@ -2824,7 +2610,7 @@ "isLValue": false, "isPure": false, "lValueRequested": false, - "operator": "=", + "operator": "-=", "type": "uint256" }, "children": [ @@ -2836,7 +2622,7 @@ "isPure": false, "lValueRequested": true, "member_name": "lotteryAmount", - "referencedDeclaration": 42, + "referencedDeclaration": 46, "type": "uint256" }, "children": [ @@ -2846,18 +2632,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 179, + "referencedDeclaration": 161, "type": "struct CapCoin.Post storage pointer", "value": "post" }, - "id": 191, + "id": 173, "name": "Identifier", - "src": "1502:4:0" + "src": "1461:4:0" } ], - "id": 193, + "id": 175, "name": "MemberAccess", - "src": "1502:18:0" + "src": "1461:18:0" }, { "attributes": { @@ -2872,19 +2658,19 @@ "type": "int_const 5", "value": "5" }, - "id": 194, + "id": 176, "name": "Literal", - "src": "1523:1:0" + "src": "1483:1:0" } ], - "id": 195, + "id": 177, "name": "Assignment", - "src": "1502:22:0" + "src": "1461:23:0" } ], - "id": 196, + "id": 178, "name": "ExpressionStatement", - "src": "1502:22:0" + "src": "1461:23:0" }, { "children": [ @@ -2905,30 +2691,1170 @@ "isConstant": false, "isLValue": true, "isPure": false, - "lValueRequested": true, - "member_name": "userName", - "referencedDeclaration": 40, - "type": "string storage ref" + "lValueRequested": true, + "member_name": "userName", + "referencedDeclaration": 44, + "type": "string storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 161, + "type": "struct CapCoin.Post storage pointer", + "value": "post" + }, + "id": 179, + "name": "Identifier", + "src": "1490:4:0" + } + ], + "id": 181, + "name": "MemberAccess", + "src": "1490:13:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "member_name": "name", + "referencedDeclaration": 37, + "type": "string storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct CapCoin.User storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 53, + "type": "mapping(address => struct CapCoin.User storage ref)", + "value": "addressToUser" + }, + "id": 182, + "name": "Identifier", + "src": "1506:13:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "sender", + "referencedDeclaration": null, + "type": "address" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 324, + "type": "msg", + "value": "msg" + }, + "id": 183, + "name": "Identifier", + "src": "1520:3:0" + } + ], + "id": 184, + "name": "MemberAccess", + "src": "1520:10:0" + } + ], + "id": 185, + "name": "IndexAccess", + "src": "1506:25:0" + } + ], + "id": 186, + "name": "MemberAccess", + "src": "1506:30:0" + } + ], + "id": 187, + "name": "Assignment", + "src": "1490:46:0" + } + ], + "id": 188, + "name": "ExpressionStatement", + "src": "1490:46:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "=", + "type": "address" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "member_name": "owner", + "referencedDeclaration": 48, + "type": "address" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 161, + "type": "struct CapCoin.Post storage pointer", + "value": "post" + }, + "id": 189, + "name": "Identifier", + "src": "1542:4:0" + } + ], + "id": 191, + "name": "MemberAccess", + "src": "1542:10:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "sender", + "referencedDeclaration": null, + "type": "address" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 324, + "type": "msg", + "value": "msg" + }, + "id": 192, + "name": "Identifier", + "src": "1555:3:0" + } + ], + "id": 193, + "name": "MemberAccess", + "src": "1555:10:0" + } + ], + "id": 194, + "name": "Assignment", + "src": "1542:23:0" + } + ], + "id": 195, + "name": "ExpressionStatement", + "src": "1542:23:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "-", + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "uint256", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "push", + "referencedDeclaration": null, + "type": "function (address) returns (uint256)" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 60, + "type": "address[] storage ref", + "value": "posts" + }, + "id": 196, + "name": "Identifier", + "src": "1572:5:0" + } + ], + "id": 198, + "name": "MemberAccess", + "src": "1572:10:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "sender", + "referencedDeclaration": null, + "type": "address" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 324, + "type": "msg", + "value": "msg" + }, + "id": 199, + "name": "Identifier", + "src": "1583:3:0" + } + ], + "id": 200, + "name": "MemberAccess", + "src": "1583:10:0" + } + ], + "id": 201, + "name": "FunctionCall", + "src": "1572:22:0" + }, + { + "attributes": { + "argumentTypes": null, + "hexvalue": "31", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "number", + "type": "int_const 1", + "value": "1" + }, + "id": 202, + "name": "Literal", + "src": "1596:1:0" + } + ], + "id": 203, + "name": "BinaryOperation", + "src": "1572:25:0" + } + ], + "id": 204, + "name": "ExpressionStatement", + "src": "1572:25:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "-=", + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "member_name": "coinBalance", + "referencedDeclaration": 39, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct CapCoin.User storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 53, + "type": "mapping(address => struct CapCoin.User storage ref)", + "value": "addressToUser" + }, + "id": 205, + "name": "Identifier", + "src": "1603:13:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "sender", + "referencedDeclaration": null, + "type": "address" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 324, + "type": "msg", + "value": "msg" + }, + "id": 206, + "name": "Identifier", + "src": "1617:3:0" + } + ], + "id": 207, + "name": "MemberAccess", + "src": "1617:10:0" + } + ], + "id": 208, + "name": "IndexAccess", + "src": "1603:25:0" + } + ], + "id": 209, + "name": "MemberAccess", + "src": "1603:37:0" + }, + { + "attributes": { + "argumentTypes": null, + "hexvalue": "35", + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "subdenomination": null, + "token": "number", + "type": "int_const 5", + "value": "5" + }, + "id": 210, + "name": "Literal", + "src": "1644:1:0" + } + ], + "id": 211, + "name": "Assignment", + "src": "1603:42:0" + } + ], + "id": 212, + "name": "ExpressionStatement", + "src": "1603:42:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "tuple()", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 13, + "type": "function (string memory)", + "value": "CreatedPost" + }, + "id": 213, + "name": "Identifier", + "src": "1651:11:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 158, + "type": "string memory", + "value": "url" + }, + "id": 214, + "name": "Identifier", + "src": "1663:3:0" + } + ], + "id": 215, + "name": "FunctionCall", + "src": "1651:16:0" + } + ], + "id": 216, + "name": "ExpressionStatement", + "src": "1651:16:0" + } + ], + "id": 217, + "name": "Block", + "src": "1369:303:0" + } + ], + "id": 218, + "name": "FunctionDefinition", + "src": "1330:342:0" + }, + { + "attributes": { + "constant": false, + "implemented": true, + "isConstructor": false, + "modifiers": [ + null + ], + "name": "likePost", + "payable": false, + "scope": 312, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "name": "post", + "scope": 276, + "stateVariable": false, + "storageLocation": "default", + "type": "address", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "address", + "type": "address" + }, + "id": 219, + "name": "ElementaryTypeName", + "src": "1694:7:0" + } + ], + "id": 220, + "name": "VariableDeclaration", + "src": "1694:12:0" + }, + { + "attributes": { + "constant": false, + "name": "amount", + "scope": 276, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 221, + "name": "ElementaryTypeName", + "src": "1708:4:0" + } + ], + "id": 222, + "name": "VariableDeclaration", + "src": "1708:11:0" + } + ], + "id": 223, + "name": "ParameterList", + "src": "1693:27:0" + }, + { + "attributes": { + "parameters": [ + null + ] + }, + "children": [], + "id": 224, + "name": "ParameterList", + "src": "1728:0:0" + }, + { + "children": [ + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "+=", + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "member_name": "lotteryAmount", + "referencedDeclaration": 46, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct CapCoin.Post storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 57, + "type": "mapping(address => struct CapCoin.Post storage ref)", + "value": "addressToPost" + }, + "id": 225, + "name": "Identifier", + "src": "1734:13:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 220, + "type": "address", + "value": "post" + }, + "id": 226, + "name": "Identifier", + "src": "1748:4:0" + } + ], + "id": 227, + "name": "IndexAccess", + "src": "1734:19:0" + } + ], + "id": 228, + "name": "MemberAccess", + "src": "1734:33:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 222, + "type": "uint256", + "value": "amount" + }, + "id": 229, + "name": "Identifier", + "src": "1771:6:0" + } + ], + "id": 230, + "name": "Assignment", + "src": "1734:43:0" + } + ], + "id": 231, + "name": "ExpressionStatement", + "src": "1734:43:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "+=", + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "member_name": "coinBalance", + "referencedDeclaration": 39, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct CapCoin.User storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 53, + "type": "mapping(address => struct CapCoin.User storage ref)", + "value": "addressToUser" + }, + "id": 232, + "name": "Identifier", + "src": "1783:13:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 220, + "type": "address", + "value": "post" + }, + "id": 233, + "name": "Identifier", + "src": "1797:4:0" + } + ], + "id": 234, + "name": "IndexAccess", + "src": "1783:19:0" + } + ], + "id": 235, + "name": "MemberAccess", + "src": "1783:31:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 222, + "type": "uint256", + "value": "amount" + }, + "id": 236, + "name": "Identifier", + "src": "1818:6:0" + } + ], + "id": 237, + "name": "Assignment", + "src": "1783:41:0" + } + ], + "id": 238, + "name": "ExpressionStatement", + "src": "1783:41:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "operator": "-=", + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "member_name": "coinBalance", + "referencedDeclaration": 39, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct CapCoin.User storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 53, + "type": "mapping(address => struct CapCoin.User storage ref)", + "value": "addressToUser" + }, + "id": 239, + "name": "Identifier", + "src": "1830:13:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "member_name": "sender", + "referencedDeclaration": null, + "type": "address" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 324, + "type": "msg", + "value": "msg" + }, + "id": 240, + "name": "Identifier", + "src": "1844:3:0" + } + ], + "id": 241, + "name": "MemberAccess", + "src": "1844:10:0" + } + ], + "id": 242, + "name": "IndexAccess", + "src": "1830:25:0" + } + ], + "id": 243, + "name": "MemberAccess", + "src": "1830:37:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 222, + "type": "uint256", + "value": "amount" + }, + "id": 244, + "name": "Identifier", + "src": "1871:6:0" + } + ], + "id": 245, + "name": "Assignment", + "src": "1830:47:0" + } + ], + "id": 246, + "name": "ExpressionStatement", + "src": "1830:47:0" + }, + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "tuple()", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 29, + "type": "function (uint256,string memory,address,uint256,string memory,address,uint256)", + "value": "LikedPost" + }, + "id": 247, + "name": "Identifier", + "src": "1883:9:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "member_name": "lotteryAmount", + "referencedDeclaration": 46, + "type": "uint256" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct CapCoin.Post storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 57, + "type": "mapping(address => struct CapCoin.Post storage ref)", + "value": "addressToPost" + }, + "id": 248, + "name": "Identifier", + "src": "1893:13:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 220, + "type": "address", + "value": "post" + }, + "id": 249, + "name": "Identifier", + "src": "1907:4:0" + } + ], + "id": 250, + "name": "IndexAccess", + "src": "1893:19:0" + } + ], + "id": 251, + "name": "MemberAccess", + "src": "1893:33:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "member_name": "name", + "referencedDeclaration": 37, + "type": "string storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct CapCoin.User storage ref" + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 53, + "type": "mapping(address => struct CapCoin.User storage ref)", + "value": "addressToUser" + }, + "id": 252, + "name": "Identifier", + "src": "1934:13:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 220, + "type": "address", + "value": "post" + }, + "id": 253, + "name": "Identifier", + "src": "1948:4:0" + } + ], + "id": 254, + "name": "IndexAccess", + "src": "1934:19:0" + } + ], + "id": 255, + "name": "MemberAccess", + "src": "1934:24:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 220, + "type": "address", + "value": "post" + }, + "id": 256, + "name": "Identifier", + "src": "1960:4:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "member_name": "coinBalance", + "referencedDeclaration": 39, + "type": "uint256" }, "children": [ { "attributes": { "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 179, - "type": "struct CapCoin.Post storage pointer", - "value": "post" + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "type": "struct CapCoin.User storage ref" }, - "id": 197, - "name": "Identifier", - "src": "1530:4:0" + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 53, + "type": "mapping(address => struct CapCoin.User storage ref)", + "value": "addressToUser" + }, + "id": 257, + "name": "Identifier", + "src": "1966:13:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 220, + "type": "address", + "value": "post" + }, + "id": 258, + "name": "Identifier", + "src": "1980:4:0" + } + ], + "id": 259, + "name": "IndexAccess", + "src": "1966:19:0" } ], - "id": 199, + "id": 260, "name": "MemberAccess", - "src": "1530:13:0" + "src": "1966:31:0" }, { "attributes": { @@ -2938,7 +3864,7 @@ "isPure": false, "lValueRequested": false, "member_name": "name", - "referencedDeclaration": 31, + "referencedDeclaration": 37, "type": "string storage ref" }, "children": [ @@ -2958,13 +3884,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 50, + "referencedDeclaration": 53, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 200, + "id": 261, "name": "Identifier", - "src": "1546:13:0" + "src": "2005:13:0" }, { "attributes": { @@ -2984,192 +3910,69 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 277, + "referencedDeclaration": 324, "type": "msg", "value": "msg" }, - "id": 201, + "id": 262, "name": "Identifier", - "src": "1560:3:0" + "src": "2019:3:0" } ], - "id": 202, + "id": 263, "name": "MemberAccess", - "src": "1560:10:0" + "src": "2019:10:0" } ], - "id": 203, + "id": 264, "name": "IndexAccess", - "src": "1546:25:0" + "src": "2005:25:0" } ], - "id": 204, + "id": 265, "name": "MemberAccess", - "src": "1546:30:0" - } - ], - "id": 205, - "name": "Assignment", - "src": "1530:46:0" - } - ], - "id": 206, - "name": "ExpressionStatement", - "src": "1530:46:0" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "src": "2005:30:0" }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "-", - "type": "uint256" - }, - "children": [ { "attributes": { "argumentTypes": null, "isConstant": false, "isLValue": false, "isPure": false, - "isStructConstructorCall": false, "lValueRequested": false, - "names": [ - null - ], - "type": "uint256", - "type_conversion": false + "member_name": "sender", + "referencedDeclaration": null, + "type": "address" }, "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "push", - "referencedDeclaration": null, - "type": "function (address) returns (uint256)" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 60, - "type": "address[] storage ref", - "value": "posts" - }, - "id": 207, - "name": "Identifier", - "src": "1583:5:0" - } - ], - "id": 209, - "name": "MemberAccess", - "src": "1583:10:0" - }, { "attributes": { "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "sender", - "referencedDeclaration": null, - "type": "address" + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 324, + "type": "msg", + "value": "msg" }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 277, - "type": "msg", - "value": "msg" - }, - "id": 210, - "name": "Identifier", - "src": "1594:3:0" - } - ], - "id": 211, - "name": "MemberAccess", - "src": "1594:10:0" + "id": 266, + "name": "Identifier", + "src": "2037:3:0" } ], - "id": 212, - "name": "FunctionCall", - "src": "1583:22:0" + "id": 267, + "name": "MemberAccess", + "src": "2037:10:0" }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "31", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "number", - "type": "int_const 1", - "value": "1" - }, - "id": 213, - "name": "Literal", - "src": "1607:1:0" - } - ], - "id": 214, - "name": "BinaryOperation", - "src": "1583:25:0" - } - ], - "id": 215, - "name": "ExpressionStatement", - "src": "1583:25:0" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "-=", - "type": "uint256" - }, - "children": [ { "attributes": { "argumentTypes": null, "isConstant": false, "isLValue": true, "isPure": false, - "lValueRequested": true, + "lValueRequested": false, "member_name": "coinBalance", - "referencedDeclaration": 33, + "referencedDeclaration": 39, "type": "uint256" }, "children": [ @@ -3189,13 +3992,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 50, + "referencedDeclaration": 53, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 216, + "id": 268, "name": "Identifier", - "src": "1614:13:0" + "src": "2049:13:0" }, { "attributes": { @@ -3215,125 +4018,48 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 277, + "referencedDeclaration": 324, "type": "msg", "value": "msg" }, - "id": 217, + "id": 269, "name": "Identifier", - "src": "1628:3:0" + "src": "2063:3:0" } ], - "id": 218, + "id": 270, "name": "MemberAccess", - "src": "1628:10:0" + "src": "2063:10:0" } ], - "id": 219, + "id": 271, "name": "IndexAccess", - "src": "1614:25:0" + "src": "2049:25:0" } ], - "id": 220, + "id": 272, "name": "MemberAccess", - "src": "1614:37:0" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "35", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "number", - "type": "int_const 5", - "value": "5" - }, - "id": 221, - "name": "Literal", - "src": "1655:1:0" - } - ], - "id": 222, - "name": "Assignment", - "src": "1614:42:0" - } - ], - "id": 223, - "name": "ExpressionStatement", - "src": "1614:42:0" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - ], - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 13, - "type": "function (string memory)", - "value": "CreatedPost" - }, - "id": 224, - "name": "Identifier", - "src": "1662:11:0" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 176, - "type": "string memory", - "value": "url" - }, - "id": 225, - "name": "Identifier", - "src": "1674:3:0" + "src": "2049:37:0" } ], - "id": 226, + "id": 273, "name": "FunctionCall", - "src": "1662:16:0" + "src": "1883:204:0" } ], - "id": 227, + "id": 274, "name": "ExpressionStatement", - "src": "1662:16:0" + "src": "1883:204:0" } ], - "id": 228, + "id": 275, "name": "Block", - "src": "1410:273:0" + "src": "1728:364:0" } ], - "id": 229, + "id": 276, "name": "FunctionDefinition", - "src": "1371:312:0" + "src": "1676:416:0" }, { "attributes": { @@ -3345,7 +4071,7 @@ ], "name": "getPosts", "payable": false, - "scope": 265, + "scope": 312, "stateMutability": "view", "superFunction": null, "visibility": "public" @@ -3358,9 +4084,9 @@ ] }, "children": [], - "id": 230, + "id": 277, "name": "ParameterList", - "src": "1704:2:0" + "src": "2113:2:0" }, { "children": [ @@ -3368,7 +4094,7 @@ "attributes": { "constant": false, "name": "", - "scope": 238, + "scope": 285, "stateVariable": false, "storageLocation": "default", "type": "address[] memory", @@ -3387,30 +4113,30 @@ "name": "address", "type": "address" }, - "id": 231, + "id": 278, "name": "ElementaryTypeName", - "src": "1728:7:0" + "src": "2137:7:0" } ], - "id": 232, + "id": 279, "name": "ArrayTypeName", - "src": "1728:9:0" + "src": "2137:9:0" } ], - "id": 233, + "id": 280, "name": "VariableDeclaration", - "src": "1728:9:0" + "src": "2137:9:0" } ], - "id": 234, + "id": 281, "name": "ParameterList", - "src": "1727:11:0" + "src": "2136:11:0" }, { "children": [ { "attributes": { - "functionReturnParameters": 234 + "functionReturnParameters": 281 }, "children": [ { @@ -3423,24 +4149,24 @@ "type": "address[] storage ref", "value": "posts" }, - "id": 235, + "id": 282, "name": "Identifier", - "src": "1754:5:0" + "src": "2163:5:0" } ], - "id": 236, + "id": 283, "name": "Return", - "src": "1747:12:0" + "src": "2156:12:0" } ], - "id": 237, + "id": 284, "name": "Block", - "src": "1739:25:0" + "src": "2148:25:0" } ], - "id": 238, + "id": 285, "name": "FunctionDefinition", - "src": "1687:77:0" + "src": "2096:77:0" }, { "attributes": { @@ -3452,7 +4178,7 @@ ], "name": "seed", "payable": false, - "scope": 265, + "scope": 312, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -3464,7 +4190,7 @@ "attributes": { "constant": false, "name": "name", - "scope": 260, + "scope": 307, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -3477,20 +4203,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 239, + "id": 286, "name": "ElementaryTypeName", - "src": "1782:6:0" + "src": "2191:6:0" } ], - "id": 240, + "id": 287, "name": "VariableDeclaration", - "src": "1782:11:0" + "src": "2191:11:0" }, { "attributes": { "constant": false, "name": "url", - "scope": 260, + "scope": 307, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -3503,20 +4229,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 241, + "id": 288, "name": "ElementaryTypeName", - "src": "1795:6:0" + "src": "2204:6:0" } ], - "id": 242, + "id": 289, "name": "VariableDeclaration", - "src": "1795:10:0" + "src": "2204:10:0" }, { "attributes": { "constant": false, "name": "amount", - "scope": 260, + "scope": 307, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -3529,19 +4255,19 @@ "name": "uint", "type": "uint256" }, - "id": 243, + "id": 290, "name": "ElementaryTypeName", - "src": "1807:4:0" + "src": "2216:4:0" } ], - "id": 244, + "id": 291, "name": "VariableDeclaration", - "src": "1807:11:0" + "src": "2216:11:0" } ], - "id": 245, + "id": 292, "name": "ParameterList", - "src": "1781:38:0" + "src": "2190:38:0" }, { "attributes": { @@ -3550,9 +4276,9 @@ ] }, "children": [], - "id": 246, + "id": 293, "name": "ParameterList", - "src": "1827:0:0" + "src": "2236:0:0" }, { "children": [ @@ -3584,13 +4310,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 97, + "referencedDeclaration": 88, "type": "function (string memory)", "value": "createUser" }, - "id": 247, + "id": 294, "name": "Identifier", - "src": "1835:10:0" + "src": "2244:10:0" }, { "attributes": { @@ -3598,23 +4324,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 240, + "referencedDeclaration": 287, "type": "string memory", "value": "name" }, - "id": 248, + "id": 295, "name": "Identifier", - "src": "1846:4:0" + "src": "2255:4:0" } ], - "id": 249, + "id": 296, "name": "FunctionCall", - "src": "1835:16:0" + "src": "2244:16:0" } ], - "id": 250, + "id": 297, "name": "ExpressionStatement", - "src": "1835:16:0" + "src": "2244:16:0" }, { "children": [ @@ -3644,13 +4370,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 174, + "referencedDeclaration": 156, "type": "function (uint256)", "value": "buyTokens" }, - "id": 251, + "id": 298, "name": "Identifier", - "src": "1859:9:0" + "src": "2268:9:0" }, { "attributes": { @@ -3658,23 +4384,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 244, + "referencedDeclaration": 291, "type": "uint256", "value": "amount" }, - "id": 252, + "id": 299, "name": "Identifier", - "src": "1869:6:0" + "src": "2278:6:0" } ], - "id": 253, + "id": 300, "name": "FunctionCall", - "src": "1859:17:0" + "src": "2268:17:0" } ], - "id": 254, + "id": 301, "name": "ExpressionStatement", - "src": "1859:17:0" + "src": "2268:17:0" }, { "children": [ @@ -3704,13 +4430,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 229, + "referencedDeclaration": 218, "type": "function (string memory)", "value": "createPost" }, - "id": 255, + "id": 302, "name": "Identifier", - "src": "1884:10:0" + "src": "2293:10:0" }, { "attributes": { @@ -3718,33 +4444,33 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 242, + "referencedDeclaration": 289, "type": "string memory", "value": "url" }, - "id": 256, + "id": 303, "name": "Identifier", - "src": "1895:3:0" + "src": "2304:3:0" } ], - "id": 257, + "id": 304, "name": "FunctionCall", - "src": "1884:15:0" + "src": "2293:15:0" } ], - "id": 258, + "id": 305, "name": "ExpressionStatement", - "src": "1884:15:0" + "src": "2293:15:0" } ], - "id": 259, + "id": 306, "name": "Block", - "src": "1827:77:0" + "src": "2236:77:0" } ], - "id": 260, + "id": 307, "name": "FunctionDefinition", - "src": "1768:136:0" + "src": "2177:136:0" }, { "attributes": { @@ -3756,7 +4482,7 @@ ], "name": "", "payable": true, - "scope": 265, + "scope": 312, "stateMutability": "payable", "superFunction": null, "visibility": "internal" @@ -3769,9 +4495,9 @@ ] }, "children": [], - "id": 261, + "id": 308, "name": "ParameterList", - "src": "1916:2:0" + "src": "2325:2:0" }, { "attributes": { @@ -3780,9 +4506,9 @@ ] }, "children": [], - "id": 262, + "id": 309, "name": "ParameterList", - "src": "1936:0:0" + "src": "2345:0:0" }, { "attributes": { @@ -3791,24 +4517,24 @@ ] }, "children": [], - "id": 263, + "id": 310, "name": "Block", - "src": "1936:2:0" + "src": "2345:2:0" } ], - "id": 264, + "id": 311, "name": "FunctionDefinition", - "src": "1908:30:0" + "src": "2317:30:0" } ], - "id": 265, + "id": 312, "name": "ContractDefinition", - "src": "26:1914:0" + "src": "26:2323:0" } ], - "id": 266, + "id": 313, "name": "SourceUnit", - "src": "0:1941:0" + "src": "0:2350:0" }, "compiler": { "name": "solc", @@ -3822,5 +4548,5 @@ } }, "schemaVersion": "1.0.1", - "updatedAt": "2018-01-19T16:26:08.225Z" + "updatedAt": "2018-01-19T23:48:42.211Z" } \ No newline at end of file diff --git a/build/contracts/Migrations.json b/build/contracts/Migrations.json index 5f271dba..1a09dbe2 100644 --- a/build/contracts/Migrations.json +++ b/build/contracts/Migrations.json @@ -823,5 +823,5 @@ } }, "schemaVersion": "1.0.1", - "updatedAt": "2018-01-19T16:26:08.222Z" + "updatedAt": "2018-01-19T23:48:42.207Z" } \ No newline at end of file diff --git a/build/contracts/SimpleStorage.json b/build/contracts/SimpleStorage.json index 86d1dbfa..4856db35 100644 --- a/build/contracts/SimpleStorage.json +++ b/build/contracts/SimpleStorage.json @@ -344,5 +344,5 @@ } }, "schemaVersion": "1.0.1", - "updatedAt": "2018-01-19T16:26:08.220Z" + "updatedAt": "2018-01-19T23:48:42.206Z" } \ No newline at end of file diff --git a/contracts/CapCoin.sol b/contracts/CapCoin.sol index 44a0fed8..5eae5fde 100644 --- a/contracts/CapCoin.sol +++ b/contracts/CapCoin.sol @@ -5,47 +5,36 @@ contract CapCoin { event NewUser(string name); event BoughtTokens(uint coinBalance); event CreatedPost(string url); + event LikedPost(uint lotteryAmount, string posterName, + address poster, uint posterCoinbalance, string likerName, + address liker, uint likerCoinbalance); uint coinSupply = 1000000; uint coinsBought = 0; - uint contractNum; - - function CapCoin () { - contractNum = 1; - } struct User { string name; uint coinBalance; - uint postNum; } struct Post { string url; string userName; uint lotteryAmount; - string[] captions; + address owner; } mapping (address => User) public addressToUser; mapping (address => Post) public addressToPost; - address[] public users; address[] public posts; function createUser(string name) public { var user = addressToUser[msg.sender]; - user.name = name; user.coinBalance = 0; - - users.push(msg.sender) -1; NewUser(name); } - function getUsers() public view returns (address[]) { - return users; - } - function getUser() public view returns (string, uint, string, uint, address) { return (addressToUser[msg.sender].name, addressToUser[msg.sender].coinBalance, @@ -54,6 +43,7 @@ contract CapCoin { msg.sender); } + // need to add economics function buyTokens(uint amount) public { addressToUser[msg.sender].coinBalance += amount; coinsBought += amount; @@ -65,14 +55,24 @@ contract CapCoin { // 5 coins per post var post = addressToPost[msg.sender]; post.url = url; - post.lotteryAmount = 5; + post.lotteryAmount -= 5; post.userName = addressToUser[msg.sender].name; + post.owner = msg.sender; posts.push(msg.sender) -1; addressToUser[msg.sender].coinBalance -= 5; CreatedPost(url); } + function likePost(address post, uint amount) public { + addressToPost[post].lotteryAmount += amount; + addressToUser[post].coinBalance += amount; + addressToUser[msg.sender].coinBalance -= amount; + LikedPost(addressToPost[post].lotteryAmount, + addressToUser[post].name, post, addressToUser[post].coinBalance, + addressToUser[msg.sender].name, msg.sender, addressToUser[msg.sender].coinBalance); + } + function getPosts() public view returns (address[]) { return posts; } diff --git a/src/components/CreatePost.js b/src/components/CreatePost.js index c3c3495c..526fdeaa 100644 --- a/src/components/CreatePost.js +++ b/src/components/CreatePost.js @@ -25,7 +25,7 @@ class CreatePost extends Component { {this.props.user ?