diff --git a/build/contracts/CapCoin.json b/build/contracts/CapCoin.json index d6b00d85..78009777 100644 --- a/build/contracts/CapCoin.json +++ b/build/contracts/CapCoin.json @@ -34,6 +34,28 @@ "stateMutability": "view", "type": "function" }, + { + "constant": false, + "inputs": [ + { + "name": "name", + "type": "string" + }, + { + "name": "url", + "type": "string" + }, + { + "name": "amount", + "type": "uint256" + } + ], + "name": "seed", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, { "constant": false, "inputs": [ @@ -67,6 +89,20 @@ "stateMutability": "view", "type": "function" }, + { + "constant": true, + "inputs": [], + "name": "getPosts", + "outputs": [ + { + "name": "", + "type": "address[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, { "constant": false, "inputs": [ @@ -95,6 +131,10 @@ "name": "url", "type": "string" }, + { + "name": "userName", + "type": "string" + }, { "name": "lotteryAmount", "type": "uint256" @@ -124,6 +164,10 @@ { "name": "", "type": "uint256" + }, + { + "name": "", + "type": "address" } ], "payable": false, @@ -219,18 +263,18 @@ "type": "event" } ], - "bytecode": "0x6060604052620f42406000556000600155341561001b57600080fd5b6001600281905550610e5d806100326000396000f300606060405260043610610098576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168062ce8e3e1461009a5780630b1e7f83146101045780633610724e14610167578063365b98b21461018a578063507ffba5146101ed578063763f17c41461024a578063832880e714610320578063c7303c6114610428578063edf5388614610485575b005b34156100a557600080fd5b6100ad610562565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156100f05780820151818401526020810190506100d5565b505050509050019250505060405180910390f35b341561010f57600080fd5b61012560048080359060200190919050506105f6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561017257600080fd5b6101886004808035906020019091905050610635565b005b341561019557600080fd5b6101ab6004808035906020019091905050610720565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101f857600080fd5b610248600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061075f565b005b341561025557600080fd5b610281600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506108cb565b60405180806020018381526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156103105780601f106102e557610100808354040283529160200191610310565b820191906000526020600020905b8154815290600101906020018083116102f357829003601f168201915b5050935050505060405180910390f35b341561032b57600080fd5b6103336108ee565b604051808060200185815260200180602001848152602001838103835287818151815260200191508051906020019080838360005b83811015610383578082015181840152602081019050610368565b50505050905090810190601f1680156103b05780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156103e95780820151818401526020810190506103ce565b50505050905090810190601f1680156104165780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b341561043357600080fd5b610483600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610b52565b005b341561049057600080fd5b6104bc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d0f565b60405180806020018481526020018381526020018281038252858181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156105515780601f1061052657610100808354040283529160200191610551565b820191906000526020600020905b81548152906001019060200180831161053457829003601f168201915b505094505050505060405180910390f35b61056a610d38565b60058054806020026020016040519081016040528092919081815260200182805480156105ec57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116105a2575b5050505050905090565b60068181548110151561060557fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b80600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160008282540192505081905550806001600082825401925050819055508060008082825403925050819055507ffe1367e498701f2dfab80a3d41740d46fd7cba533430e611917f0f3df823279a600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546040518082815260200191505060405180910390a150565b60058181548110151561072f57fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050818160000190805190602001906107ba929190610d4c565b50600081600101819055506001600580548060010182816107db9190610dcc565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050507f66ab3fea2083d9ba15d99b595186fe7fc18e6eba393c0fc056f420e96c3caa44826040518080602001828103825283818151815260200191508051906020019080838360005b8381101561088d578082015181840152602081019050610872565b50505050905090810190601f1680156108ba5780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b600460205280600052604060002060009150905080600001908060010154905082565b6108f6610df8565b6000610900610df8565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154838054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aa15780601f10610a7657610100808354040283529160200191610aa1565b820191906000526020600020905b815481529060010190602001808311610a8457829003601f168201915b50505050509350818054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b3d5780601f10610b1257610100808354040283529160200191610b3d565b820191906000526020600020905b815481529060010190602001808311610b2057829003601f168201915b50505050509150935093509350935090919293565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905081816000019080519060200190610bad929190610d4c565b5060058160010181905550600160068054806001018281610bce9190610dcc565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050506005600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507f3b6c110dfadc879ec2bbc1dc567f9065fd5ea5846bce75fddba0f60ffcc79fac826040518080602001828103825283818151815260200191508051906020019080838360005b83811015610cd1578082015181840152602081019050610cb6565b50505050905090810190601f168015610cfe5780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b600360205280600052604060002060009150905080600001908060010154908060020154905083565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610d8d57805160ff1916838001178555610dbb565b82800160010185558215610dbb579182015b82811115610dba578251825591602001919060010190610d9f565b5b509050610dc89190610e0c565b5090565b815481835581811511610df357818360005260206000209182019101610df29190610e0c565b5b505050565b602060405190810160405280600081525090565b610e2e91905b80821115610e2a576000816000905550600101610e12565b5090565b905600a165627a7a723058208250da5121e6843ef4de46d1a13b5495e399c896acfd7db568a1c91654e623d90029", - "deployedBytecode": "0x606060405260043610610098576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168062ce8e3e1461009a5780630b1e7f83146101045780633610724e14610167578063365b98b21461018a578063507ffba5146101ed578063763f17c41461024a578063832880e714610320578063c7303c6114610428578063edf5388614610485575b005b34156100a557600080fd5b6100ad610562565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156100f05780820151818401526020810190506100d5565b505050509050019250505060405180910390f35b341561010f57600080fd5b61012560048080359060200190919050506105f6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561017257600080fd5b6101886004808035906020019091905050610635565b005b341561019557600080fd5b6101ab6004808035906020019091905050610720565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101f857600080fd5b610248600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061075f565b005b341561025557600080fd5b610281600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506108cb565b60405180806020018381526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156103105780601f106102e557610100808354040283529160200191610310565b820191906000526020600020905b8154815290600101906020018083116102f357829003601f168201915b5050935050505060405180910390f35b341561032b57600080fd5b6103336108ee565b604051808060200185815260200180602001848152602001838103835287818151815260200191508051906020019080838360005b83811015610383578082015181840152602081019050610368565b50505050905090810190601f1680156103b05780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156103e95780820151818401526020810190506103ce565b50505050905090810190601f1680156104165780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b341561043357600080fd5b610483600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610b52565b005b341561049057600080fd5b6104bc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d0f565b60405180806020018481526020018381526020018281038252858181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156105515780601f1061052657610100808354040283529160200191610551565b820191906000526020600020905b81548152906001019060200180831161053457829003601f168201915b505094505050505060405180910390f35b61056a610d38565b60058054806020026020016040519081016040528092919081815260200182805480156105ec57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116105a2575b5050505050905090565b60068181548110151561060557fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b80600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160008282540192505081905550806001600082825401925050819055508060008082825403925050819055507ffe1367e498701f2dfab80a3d41740d46fd7cba533430e611917f0f3df823279a600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546040518082815260200191505060405180910390a150565b60058181548110151561072f57fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050818160000190805190602001906107ba929190610d4c565b50600081600101819055506001600580548060010182816107db9190610dcc565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050507f66ab3fea2083d9ba15d99b595186fe7fc18e6eba393c0fc056f420e96c3caa44826040518080602001828103825283818151815260200191508051906020019080838360005b8381101561088d578082015181840152602081019050610872565b50505050905090810190601f1680156108ba5780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b600460205280600052604060002060009150905080600001908060010154905082565b6108f6610df8565b6000610900610df8565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154838054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aa15780601f10610a7657610100808354040283529160200191610aa1565b820191906000526020600020905b815481529060010190602001808311610a8457829003601f168201915b50505050509350818054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b3d5780601f10610b1257610100808354040283529160200191610b3d565b820191906000526020600020905b815481529060010190602001808311610b2057829003601f168201915b50505050509150935093509350935090919293565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905081816000019080519060200190610bad929190610d4c565b5060058160010181905550600160068054806001018281610bce9190610dcc565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050506005600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600082825403925050819055507f3b6c110dfadc879ec2bbc1dc567f9065fd5ea5846bce75fddba0f60ffcc79fac826040518080602001828103825283818151815260200191508051906020019080838360005b83811015610cd1578082015181840152602081019050610cb6565b50505050905090810190601f168015610cfe5780820380516001836020036101000a031916815260200191505b509250505060405180910390a15050565b600360205280600052604060002060009150905080600001908060010154908060020154905083565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610d8d57805160ff1916838001178555610dbb565b82800160010185558215610dbb579182015b82811115610dba578251825591602001919060010190610d9f565b5b509050610dc89190610e0c565b5090565b815481835581811511610df357818360005260206000209182019101610df29190610e0c565b5b505050565b602060405190810160405280600081525090565b610e2e91905b80821115610e2a576000816000905550600101610e12565b5090565b905600a165627a7a723058208250da5121e6843ef4de46d1a13b5495e399c896acfd7db568a1c91654e623d90029", - "sourceMap": "26:1569:0:-;;;170:7;152:25;;200:1;181:20;;226:46;;;;;;;;266:1;252:11;:15;;;;26:1569;;;;;;", - "deployedSourceMap": "26:1569:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;759: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;;;;;;;;;;;;;;;;;541:22:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1089:207;;;;;;;;;;;;;;;;;;;;;;;;;;515:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;568:187;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;465:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;838:247;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1300:259:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;415:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;759:75;800:9;;:::i;:::-;824:5;817:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;759:75;:::o;541:22::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1089:207::-;1175:6;1134:13;:25;1148:10;1134:25;;;;;;;;;;;;;;;:37;;;:47;;;;;;;;;;;1202:6;1187:11;;:21;;;;;;;;;;;1228:6;1214:10;;:20;;;;;;;;;;;1240:51;1253:13;:25;1267:10;1253:25;;;;;;;;;;;;;;;:37;;;1240:51;;;;;;;;;;;;;;;;;;1089:207;:::o;515:22::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;568:187::-;614:8;625:13;:25;639:10;625:25;;;;;;;;;;;;;;;614:36;;669:4;657;:9;;:16;;;;;;;;;;;;:::i;:::-;;698:1;679:4;:16;;:20;;;;730:1;706:5;:22;;;;;;;;;;;:::i;:::-;;;;;;;;;;717:10;706:22;;;;;;;;;;;;;;;;;;;;;;:25;;737:13;745:4;737: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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;568:187:0;;:::o;465:46::-;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;838:247::-;878:6;;:::i;:::-;886:4;892:6;;:::i;:::-;900:4;920:13;:25;934:10;920:25;;;;;;;;;;;;;;;:30;;958:13;:25;972:10;958:25;;;;;;;;;;;;;;;:37;;;1003:13;:25;1017:10;1003:25;;;;;;;;;;;;;;;:29;;1040:13;:25;1054:10;1040:25;;;;;;;;;;;;;;;:39;;;912:168;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;838:247;;;;:::o;1300:259::-;1369:8;1380:13;:25;1394:10;1380:25;;;;;;;;;;;;;;;1369:36;;1422:3;1411:4;:8;;:14;;;;;;;;;;;;:::i;:::-;;1452:1;1431:4;:18;;:22;;;;1483:1;1459:5;:22;;;;;;;;;;;:::i;:::-;;;;;;;;;;1470:10;1459:22;;;;;;;;;;;;;;;;;;;;;;:25;;1531:1;1490:13;:25;1504:10;1490:25;;;;;;;;;;;;;;;:37;;;:42;;;;;;;;;;;1538:16;1550:3;1538: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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1300:259:0;;:::o;415:46::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;26:1569::-;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::o;:::-;;;;;;;;;;;;;;;:::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 uint lotteryAmount;\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) {\n return (addressToUser[msg.sender].name,\n addressToUser[msg.sender].coinBalance,\n addressToPost[msg.sender].url,\n addressToPost[msg.sender].lotteryAmount);\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 posts.push(msg.sender) -1;\n addressToUser[msg.sender].coinBalance -= 5;\n CreatedPost(url);\n }\n\n function() internal payable {}\n}\n", + "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", "sourcePath": "/Users/schwartzz8990/Dropbox/fullstack/capCoin/contracts/CapCoin.sol", "ast": { "attributes": { "absolutePath": "/Users/schwartzz8990/Dropbox/fullstack/capCoin/contracts/CapCoin.sol", "exportedSymbols": { "CapCoin": [ - 215 + 265 ] } }, @@ -260,10 +304,10 @@ "documentation": null, "fullyImplemented": true, "linearizedBaseContracts": [ - 215 + 265 ], "name": "CapCoin", - "scope": 216 + "scope": 266 }, "children": [ { @@ -405,7 +449,7 @@ "attributes": { "constant": false, "name": "coinSupply", - "scope": 215, + "scope": 265, "stateVariable": true, "storageLocation": "default", "type": "uint256", @@ -447,7 +491,7 @@ "attributes": { "constant": false, "name": "coinsBought", - "scope": 215, + "scope": 265, "stateVariable": true, "storageLocation": "default", "type": "uint256", @@ -489,7 +533,7 @@ "attributes": { "constant": false, "name": "contractNum", - "scope": 215, + "scope": 265, "stateVariable": true, "storageLocation": "default", "type": "uint256", @@ -521,7 +565,7 @@ ], "name": "CapCoin", "payable": false, - "scope": 215, + "scope": 265, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -619,7 +663,7 @@ "attributes": { "canonicalName": "CapCoin.User", "name": "User", - "scope": 215, + "scope": 265, "visibility": "public" }, "children": [ @@ -710,7 +754,7 @@ "attributes": { "canonicalName": "CapCoin.Post", "name": "Post", - "scope": 215, + "scope": 265, "visibility": "public" }, "children": [ @@ -718,7 +762,7 @@ "attributes": { "constant": false, "name": "url", - "scope": 41, + "scope": 46, "stateVariable": false, "storageLocation": "default", "type": "string storage pointer", @@ -740,11 +784,37 @@ "name": "VariableDeclaration", "src": "372:10:0" }, + { + "attributes": { + "constant": false, + "name": "userName", + "scope": 46, + "stateVariable": false, + "storageLocation": "default", + "type": "string storage pointer", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "string", + "type": "string storage pointer" + }, + "id": 39, + "name": "ElementaryTypeName", + "src": "388:6:0" + } + ], + "id": 40, + "name": "VariableDeclaration", + "src": "388:15:0" + }, { "attributes": { "constant": false, "name": "lotteryAmount", - "scope": 41, + "scope": 46, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -757,25 +827,62 @@ "name": "uint", "type": "uint256" }, - "id": 39, + "id": 41, "name": "ElementaryTypeName", - "src": "388:4:0" + "src": "409:4:0" } ], - "id": 40, + "id": 42, + "name": "VariableDeclaration", + "src": "409:18:0" + }, + { + "attributes": { + "constant": false, + "name": "captions", + "scope": 46, + "stateVariable": false, + "storageLocation": "default", + "type": "string storage ref[] storage pointer", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "length": null, + "type": "string storage ref[] storage pointer" + }, + "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": 45, "name": "VariableDeclaration", - "src": "388:18:0" + "src": "433:17:0" } ], - "id": 41, + "id": 46, "name": "StructDefinition", - "src": "354:57:0" + "src": "354:101:0" }, { "attributes": { "constant": false, "name": "addressToUser", - "scope": 215, + "scope": 265, "stateVariable": true, "storageLocation": "default", "type": "mapping(address => struct CapCoin.User storage ref)", @@ -793,9 +900,9 @@ "name": "address", "type": "address" }, - "id": 42, + "id": 47, "name": "ElementaryTypeName", - "src": "424:7:0" + "src": "468:7:0" }, { "attributes": { @@ -804,25 +911,25 @@ "referencedDeclaration": 36, "type": "struct CapCoin.User storage pointer" }, - "id": 43, + "id": 48, "name": "UserDefinedTypeName", - "src": "435:4:0" + "src": "479:4:0" } ], - "id": 44, + "id": 49, "name": "Mapping", - "src": "415:25:0" + "src": "459:25:0" } ], - "id": 45, + "id": 50, "name": "VariableDeclaration", - "src": "415:46:0" + "src": "459:46:0" }, { "attributes": { "constant": false, "name": "addressToPost", - "scope": 215, + "scope": 265, "stateVariable": true, "storageLocation": "default", "type": "mapping(address => struct CapCoin.Post storage ref)", @@ -840,36 +947,36 @@ "name": "address", "type": "address" }, - "id": 46, + "id": 51, "name": "ElementaryTypeName", - "src": "474:7:0" + "src": "518:7:0" }, { "attributes": { "contractScope": null, "name": "Post", - "referencedDeclaration": 41, + "referencedDeclaration": 46, "type": "struct CapCoin.Post storage pointer" }, - "id": 47, + "id": 52, "name": "UserDefinedTypeName", - "src": "485:4:0" + "src": "529:4:0" } ], - "id": 48, + "id": 53, "name": "Mapping", - "src": "465:25:0" + "src": "509:25:0" } ], - "id": 49, + "id": 54, "name": "VariableDeclaration", - "src": "465:46:0" + "src": "509:46:0" }, { "attributes": { "constant": false, "name": "users", - "scope": 215, + "scope": 265, "stateVariable": true, "storageLocation": "default", "type": "address[] storage ref", @@ -888,25 +995,25 @@ "name": "address", "type": "address" }, - "id": 50, + "id": 55, "name": "ElementaryTypeName", - "src": "515:7:0" + "src": "559:7:0" } ], - "id": 51, + "id": 56, "name": "ArrayTypeName", - "src": "515:9:0" + "src": "559:9:0" } ], - "id": 52, + "id": 57, "name": "VariableDeclaration", - "src": "515:22:0" + "src": "559:22:0" }, { "attributes": { "constant": false, "name": "posts", - "scope": 215, + "scope": 265, "stateVariable": true, "storageLocation": "default", "type": "address[] storage ref", @@ -925,19 +1032,19 @@ "name": "address", "type": "address" }, - "id": 53, + "id": 58, "name": "ElementaryTypeName", - "src": "541:7:0" + "src": "585:7:0" } ], - "id": 54, + "id": 59, "name": "ArrayTypeName", - "src": "541:9:0" + "src": "585:9:0" } ], - "id": 55, + "id": 60, "name": "VariableDeclaration", - "src": "541:22:0" + "src": "585:22:0" }, { "attributes": { @@ -949,7 +1056,7 @@ ], "name": "createUser", "payable": false, - "scope": 215, + "scope": 265, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -961,7 +1068,7 @@ "attributes": { "constant": false, "name": "name", - "scope": 92, + "scope": 97, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -974,19 +1081,19 @@ "name": "string", "type": "string storage pointer" }, - "id": 56, + "id": 61, "name": "ElementaryTypeName", - "src": "588:6:0" + "src": "632:6:0" } ], - "id": 57, + "id": 62, "name": "VariableDeclaration", - "src": "588:11:0" + "src": "632:11:0" } ], - "id": 58, + "id": 63, "name": "ParameterList", - "src": "587:13:0" + "src": "631:13:0" }, { "attributes": { @@ -995,16 +1102,16 @@ ] }, "children": [], - "id": 59, + "id": 64, "name": "ParameterList", - "src": "608:0:0" + "src": "652:0:0" }, { "children": [ { "attributes": { "assignments": [ - 60 + 65 ] }, "children": [ @@ -1012,7 +1119,7 @@ "attributes": { "constant": false, "name": "user", - "scope": 92, + "scope": 97, "stateVariable": false, "storageLocation": "default", "type": "struct CapCoin.User storage pointer", @@ -1021,9 +1128,9 @@ "visibility": "internal" }, "children": [], - "id": 60, + "id": 65, "name": "VariableDeclaration", - "src": "614:8:0" + "src": "658:8:0" }, { "attributes": { @@ -1041,13 +1148,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 45, + "referencedDeclaration": 50, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 61, + "id": 66, "name": "Identifier", - "src": "625:13:0" + "src": "669:13:0" }, { "attributes": { @@ -1067,28 +1174,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 227, + "referencedDeclaration": 277, "type": "msg", "value": "msg" }, - "id": 62, + "id": 67, "name": "Identifier", - "src": "639:3:0" + "src": "683:3:0" } ], - "id": 63, + "id": 68, "name": "MemberAccess", - "src": "639:10:0" + "src": "683:10:0" } ], - "id": 64, + "id": 69, "name": "IndexAccess", - "src": "625:25:0" + "src": "669:25:0" } ], - "id": 65, + "id": 70, "name": "VariableDeclarationStatement", - "src": "614:36:0" + "src": "658:36:0" }, { "children": [ @@ -1121,18 +1228,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 60, + "referencedDeclaration": 65, "type": "struct CapCoin.User storage pointer", "value": "user" }, - "id": 66, + "id": 71, "name": "Identifier", - "src": "657:4:0" + "src": "701:4:0" } ], - "id": 68, + "id": 73, "name": "MemberAccess", - "src": "657:9:0" + "src": "701:9:0" }, { "attributes": { @@ -1140,23 +1247,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 57, + "referencedDeclaration": 62, "type": "string memory", "value": "name" }, - "id": 69, + "id": 74, "name": "Identifier", - "src": "669:4:0" + "src": "713:4:0" } ], - "id": 70, + "id": 75, "name": "Assignment", - "src": "657:16:0" + "src": "701:16:0" } ], - "id": 71, + "id": 76, "name": "ExpressionStatement", - "src": "657:16:0" + "src": "701:16:0" }, { "children": [ @@ -1189,18 +1296,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 60, + "referencedDeclaration": 65, "type": "struct CapCoin.User storage pointer", "value": "user" }, - "id": 72, + "id": 77, "name": "Identifier", - "src": "679:4:0" + "src": "723:4:0" } ], - "id": 74, + "id": 79, "name": "MemberAccess", - "src": "679:16:0" + "src": "723:16:0" }, { "attributes": { @@ -1215,19 +1322,19 @@ "type": "int_const 0", "value": "0" }, - "id": 75, + "id": 80, "name": "Literal", - "src": "698:1:0" + "src": "742:1:0" } ], - "id": 76, + "id": 81, "name": "Assignment", - "src": "679:20:0" + "src": "723:20:0" } ], - "id": 77, + "id": 82, "name": "ExpressionStatement", - "src": "679:20:0" + "src": "723:20:0" }, { "children": [ @@ -1284,18 +1391,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 52, + "referencedDeclaration": 57, "type": "address[] storage ref", "value": "users" }, - "id": 78, + "id": 83, "name": "Identifier", - "src": "706:5:0" + "src": "750:5:0" } ], - "id": 80, + "id": 85, "name": "MemberAccess", - "src": "706:10:0" + "src": "750:10:0" }, { "attributes": { @@ -1315,23 +1422,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 227, + "referencedDeclaration": 277, "type": "msg", "value": "msg" }, - "id": 81, + "id": 86, "name": "Identifier", - "src": "717:3:0" + "src": "761:3:0" } ], - "id": 82, + "id": 87, "name": "MemberAccess", - "src": "717:10:0" + "src": "761:10:0" } ], - "id": 83, + "id": 88, "name": "FunctionCall", - "src": "706:22:0" + "src": "750:22:0" }, { "attributes": { @@ -1346,19 +1453,19 @@ "type": "int_const 1", "value": "1" }, - "id": 84, + "id": 89, "name": "Literal", - "src": "730:1:0" + "src": "774:1:0" } ], - "id": 85, + "id": 90, "name": "BinaryOperation", - "src": "706:25:0" + "src": "750:25:0" } ], - "id": 86, + "id": 91, "name": "ExpressionStatement", - "src": "706:25:0" + "src": "750:25:0" }, { "children": [ @@ -1392,9 +1499,9 @@ "type": "function (string memory)", "value": "NewUser" }, - "id": 87, + "id": 92, "name": "Identifier", - "src": "737:7:0" + "src": "781:7:0" }, { "attributes": { @@ -1402,33 +1509,33 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 57, + "referencedDeclaration": 62, "type": "string memory", "value": "name" }, - "id": 88, + "id": 93, "name": "Identifier", - "src": "745:4:0" + "src": "789:4:0" } ], - "id": 89, + "id": 94, "name": "FunctionCall", - "src": "737:13:0" + "src": "781:13:0" } ], - "id": 90, + "id": 95, "name": "ExpressionStatement", - "src": "737:13:0" + "src": "781:13:0" } ], - "id": 91, + "id": 96, "name": "Block", - "src": "608:147:0" + "src": "652:147:0" } ], - "id": 92, + "id": 97, "name": "FunctionDefinition", - "src": "568:187:0" + "src": "612:187:0" }, { "attributes": { @@ -1440,7 +1547,7 @@ ], "name": "getUsers", "payable": false, - "scope": 215, + "scope": 265, "stateMutability": "view", "superFunction": null, "visibility": "public" @@ -1453,9 +1560,9 @@ ] }, "children": [], - "id": 93, + "id": 98, "name": "ParameterList", - "src": "776:2:0" + "src": "820:2:0" }, { "children": [ @@ -1463,7 +1570,7 @@ "attributes": { "constant": false, "name": "", - "scope": 101, + "scope": 106, "stateVariable": false, "storageLocation": "default", "type": "address[] memory", @@ -1482,30 +1589,30 @@ "name": "address", "type": "address" }, - "id": 94, + "id": 99, "name": "ElementaryTypeName", - "src": "800:7:0" + "src": "844:7:0" } ], - "id": 95, + "id": 100, "name": "ArrayTypeName", - "src": "800:9:0" + "src": "844:9:0" } ], - "id": 96, + "id": 101, "name": "VariableDeclaration", - "src": "800:9:0" + "src": "844:9:0" } ], - "id": 97, + "id": 102, "name": "ParameterList", - "src": "799:11:0" + "src": "843:11:0" }, { "children": [ { "attributes": { - "functionReturnParameters": 97 + "functionReturnParameters": 102 }, "children": [ { @@ -1514,28 +1621,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 52, + "referencedDeclaration": 57, "type": "address[] storage ref", "value": "users" }, - "id": 98, + "id": 103, "name": "Identifier", - "src": "824:5:0" + "src": "868:5:0" } ], - "id": 99, + "id": 104, "name": "Return", - "src": "817:12:0" + "src": "861:12:0" } ], - "id": 100, + "id": 105, "name": "Block", - "src": "811:23:0" + "src": "855:23:0" } ], - "id": 101, + "id": 106, "name": "FunctionDefinition", - "src": "759:75:0" + "src": "803:75:0" }, { "attributes": { @@ -1547,7 +1654,7 @@ ], "name": "getUser", "payable": false, - "scope": 215, + "scope": 265, "stateMutability": "view", "superFunction": null, "visibility": "public" @@ -1560,9 +1667,9 @@ ] }, "children": [], - "id": 102, + "id": 107, "name": "ParameterList", - "src": "854:2:0" + "src": "898:2:0" }, { "children": [ @@ -1570,7 +1677,7 @@ "attributes": { "constant": false, "name": "", - "scope": 135, + "scope": 144, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -1583,20 +1690,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 103, + "id": 108, "name": "ElementaryTypeName", - "src": "878:6:0" + "src": "922:6:0" } ], - "id": 104, + "id": 109, "name": "VariableDeclaration", - "src": "878:6:0" + "src": "922:6:0" }, { "attributes": { "constant": false, "name": "", - "scope": 135, + "scope": 144, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -1609,20 +1716,20 @@ "name": "uint", "type": "uint256" }, - "id": 105, + "id": 110, "name": "ElementaryTypeName", - "src": "886:4:0" + "src": "930:4:0" } ], - "id": 106, + "id": 111, "name": "VariableDeclaration", - "src": "886:4:0" + "src": "930:4:0" }, { "attributes": { "constant": false, "name": "", - "scope": 135, + "scope": 144, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -1635,20 +1742,20 @@ "name": "string", "type": "string storage pointer" }, - "id": 107, + "id": 112, "name": "ElementaryTypeName", - "src": "892:6:0" + "src": "936:6:0" } ], - "id": 108, + "id": 113, "name": "VariableDeclaration", - "src": "892:6:0" + "src": "936:6:0" }, { "attributes": { "constant": false, "name": "", - "scope": 135, + "scope": 144, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -1661,25 +1768,51 @@ "name": "uint", "type": "uint256" }, - "id": 109, + "id": 114, + "name": "ElementaryTypeName", + "src": "944:4:0" + } + ], + "id": 115, + "name": "VariableDeclaration", + "src": "944:4:0" + }, + { + "attributes": { + "constant": false, + "name": "", + "scope": 144, + "stateVariable": false, + "storageLocation": "default", + "type": "address", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "address", + "type": "address" + }, + "id": 116, "name": "ElementaryTypeName", - "src": "900:4:0" + "src": "950:7:0" } ], - "id": 110, + "id": 117, "name": "VariableDeclaration", - "src": "900:4:0" + "src": "950:7:0" } ], - "id": 111, + "id": 118, "name": "ParameterList", - "src": "877:28:0" + "src": "921:37:0" }, { "children": [ { "attributes": { - "functionReturnParameters": 111 + "functionReturnParameters": 118 }, "children": [ { @@ -1690,7 +1823,7 @@ "isLValue": false, "isPure": false, "lValueRequested": false, - "type": "tuple(string storage ref,uint256,string storage ref,uint256)" + "type": "tuple(string storage ref,uint256,string storage ref,uint256,address)" }, "children": [ { @@ -1721,13 +1854,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 45, + "referencedDeclaration": 50, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 112, + "id": 119, "name": "Identifier", - "src": "920:13:0" + "src": "973:13:0" }, { "attributes": { @@ -1747,28 +1880,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 227, + "referencedDeclaration": 277, "type": "msg", "value": "msg" }, - "id": 113, + "id": 120, "name": "Identifier", - "src": "934:3:0" + "src": "987:3:0" } ], - "id": 114, + "id": 121, "name": "MemberAccess", - "src": "934:10:0" + "src": "987:10:0" } ], - "id": 115, + "id": 122, "name": "IndexAccess", - "src": "920:25:0" + "src": "973:25:0" } ], - "id": 116, + "id": 123, "name": "MemberAccess", - "src": "920:30:0" + "src": "973:30:0" }, { "attributes": { @@ -1798,13 +1931,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 45, + "referencedDeclaration": 50, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 117, + "id": 124, "name": "Identifier", - "src": "958:13:0" + "src": "1011:13:0" }, { "attributes": { @@ -1824,28 +1957,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 227, + "referencedDeclaration": 277, "type": "msg", "value": "msg" }, - "id": 118, + "id": 125, "name": "Identifier", - "src": "972:3:0" + "src": "1025:3:0" } ], - "id": 119, + "id": 126, "name": "MemberAccess", - "src": "972:10:0" + "src": "1025:10:0" } ], - "id": 120, + "id": 127, "name": "IndexAccess", - "src": "958:25:0" + "src": "1011:25:0" } ], - "id": 121, + "id": 128, "name": "MemberAccess", - "src": "958:37:0" + "src": "1011:37:0" }, { "attributes": { @@ -1875,13 +2008,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 49, + "referencedDeclaration": 54, "type": "mapping(address => struct CapCoin.Post storage ref)", "value": "addressToPost" }, - "id": 122, + "id": 129, "name": "Identifier", - "src": "1003:13:0" + "src": "1056:13:0" }, { "attributes": { @@ -1901,28 +2034,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 227, + "referencedDeclaration": 277, "type": "msg", "value": "msg" }, - "id": 123, + "id": 130, "name": "Identifier", - "src": "1017:3:0" + "src": "1070:3:0" } ], - "id": 124, + "id": 131, "name": "MemberAccess", - "src": "1017:10:0" + "src": "1070:10:0" } ], - "id": 125, + "id": 132, "name": "IndexAccess", - "src": "1003:25:0" + "src": "1056:25:0" } ], - "id": 126, + "id": 133, "name": "MemberAccess", - "src": "1003:29:0" + "src": "1056:29:0" }, { "attributes": { @@ -1932,7 +2065,7 @@ "isPure": false, "lValueRequested": false, "member_name": "lotteryAmount", - "referencedDeclaration": 40, + "referencedDeclaration": 42, "type": "uint256" }, "children": [ @@ -1952,13 +2085,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 49, + "referencedDeclaration": 54, "type": "mapping(address => struct CapCoin.Post storage ref)", "value": "addressToPost" }, - "id": 127, + "id": 134, "name": "Identifier", - "src": "1040:13:0" + "src": "1093:13:0" }, { "attributes": { @@ -1978,48 +2111,79 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 227, + "referencedDeclaration": 277, "type": "msg", "value": "msg" }, - "id": 128, + "id": 135, "name": "Identifier", - "src": "1054:3:0" + "src": "1107:3:0" } ], - "id": 129, + "id": 136, "name": "MemberAccess", - "src": "1054:10:0" + "src": "1107:10:0" } ], - "id": 130, + "id": 137, "name": "IndexAccess", - "src": "1040:25:0" + "src": "1093:25:0" + } + ], + "id": 138, + "name": "MemberAccess", + "src": "1093:39: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": 139, + "name": "Identifier", + "src": "1140:3:0" } ], - "id": 131, + "id": 140, "name": "MemberAccess", - "src": "1040:39:0" + "src": "1140:10:0" } ], - "id": 132, + "id": 141, "name": "TupleExpression", - "src": "919:161:0" + "src": "972:179:0" } ], - "id": 133, + "id": 142, "name": "Return", - "src": "912:168:0" + "src": "965:186:0" } ], - "id": 134, + "id": 143, "name": "Block", - "src": "906:179:0" + "src": "959:197:0" } ], - "id": 135, + "id": 144, "name": "FunctionDefinition", - "src": "838:247:0" + "src": "882:274:0" }, { "attributes": { @@ -2031,7 +2195,7 @@ ], "name": "buyTokens", "payable": false, - "scope": 215, + "scope": 265, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -2043,7 +2207,7 @@ "attributes": { "constant": false, "name": "amount", - "scope": 165, + "scope": 174, "stateVariable": false, "storageLocation": "default", "type": "uint256", @@ -2056,19 +2220,19 @@ "name": "uint", "type": "uint256" }, - "id": 136, + "id": 145, "name": "ElementaryTypeName", - "src": "1108:4:0" + "src": "1179:4:0" } ], - "id": 137, + "id": 146, "name": "VariableDeclaration", - "src": "1108:11:0" + "src": "1179:11:0" } ], - "id": 138, + "id": 147, "name": "ParameterList", - "src": "1107:13:0" + "src": "1178:13:0" }, { "attributes": { @@ -2077,9 +2241,9 @@ ] }, "children": [], - "id": 139, + "id": 148, "name": "ParameterList", - "src": "1128:0:0" + "src": "1199:0:0" }, { "children": [ @@ -2124,13 +2288,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 45, + "referencedDeclaration": 50, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 140, + "id": 149, "name": "Identifier", - "src": "1134:13:0" + "src": "1205:13:0" }, { "attributes": { @@ -2150,28 +2314,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 227, + "referencedDeclaration": 277, "type": "msg", "value": "msg" }, - "id": 141, + "id": 150, "name": "Identifier", - "src": "1148:3:0" + "src": "1219:3:0" } ], - "id": 142, + "id": 151, "name": "MemberAccess", - "src": "1148:10:0" + "src": "1219:10:0" } ], - "id": 143, + "id": 152, "name": "IndexAccess", - "src": "1134:25:0" + "src": "1205:25:0" } ], - "id": 144, + "id": 153, "name": "MemberAccess", - "src": "1134:37:0" + "src": "1205:37:0" }, { "attributes": { @@ -2179,23 +2343,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 137, + "referencedDeclaration": 146, "type": "uint256", "value": "amount" }, - "id": 145, + "id": 154, "name": "Identifier", - "src": "1175:6:0" + "src": "1246:6:0" } ], - "id": 146, + "id": 155, "name": "Assignment", - "src": "1134:47:0" + "src": "1205:47:0" } ], - "id": 147, + "id": 156, "name": "ExpressionStatement", - "src": "1134:47:0" + "src": "1205:47:0" }, { "children": [ @@ -2220,9 +2384,9 @@ "type": "uint256", "value": "coinsBought" }, - "id": 148, + "id": 157, "name": "Identifier", - "src": "1187:11:0" + "src": "1258:11:0" }, { "attributes": { @@ -2230,23 +2394,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 137, + "referencedDeclaration": 146, "type": "uint256", "value": "amount" }, - "id": 149, + "id": 158, "name": "Identifier", - "src": "1202:6:0" + "src": "1273:6:0" } ], - "id": 150, + "id": 159, "name": "Assignment", - "src": "1187:21:0" + "src": "1258:21:0" } ], - "id": 151, + "id": 160, "name": "ExpressionStatement", - "src": "1187:21:0" + "src": "1258:21:0" }, { "children": [ @@ -2271,9 +2435,9 @@ "type": "uint256", "value": "coinSupply" }, - "id": 152, + "id": 161, "name": "Identifier", - "src": "1214:10:0" + "src": "1285:10:0" }, { "attributes": { @@ -2281,23 +2445,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 137, + "referencedDeclaration": 146, "type": "uint256", "value": "amount" }, - "id": 153, + "id": 162, "name": "Identifier", - "src": "1228:6:0" + "src": "1299:6:0" } ], - "id": 154, + "id": 163, "name": "Assignment", - "src": "1214:20:0" + "src": "1285:20:0" } ], - "id": 155, + "id": 164, "name": "ExpressionStatement", - "src": "1214:20:0" + "src": "1285:20:0" }, { "children": [ @@ -2331,9 +2495,9 @@ "type": "function (uint256)", "value": "BoughtTokens" }, - "id": 156, + "id": 165, "name": "Identifier", - "src": "1240:12:0" + "src": "1311:12:0" }, { "attributes": { @@ -2363,13 +2527,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 45, + "referencedDeclaration": 50, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 157, + "id": 166, "name": "Identifier", - "src": "1253:13:0" + "src": "1324:13:0" }, { "attributes": { @@ -2389,48 +2553,48 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 227, + "referencedDeclaration": 277, "type": "msg", "value": "msg" }, - "id": 158, + "id": 167, "name": "Identifier", - "src": "1267:3:0" + "src": "1338:3:0" } ], - "id": 159, + "id": 168, "name": "MemberAccess", - "src": "1267:10:0" + "src": "1338:10:0" } ], - "id": 160, + "id": 169, "name": "IndexAccess", - "src": "1253:25:0" + "src": "1324:25:0" } ], - "id": 161, + "id": 170, "name": "MemberAccess", - "src": "1253:37:0" + "src": "1324:37:0" } ], - "id": 162, + "id": 171, "name": "FunctionCall", - "src": "1240:51:0" + "src": "1311:51:0" } ], - "id": 163, + "id": 172, "name": "ExpressionStatement", - "src": "1240:51:0" + "src": "1311:51:0" } ], - "id": 164, + "id": 173, "name": "Block", - "src": "1128:168:0" + "src": "1199:168:0" } ], - "id": 165, + "id": 174, "name": "FunctionDefinition", - "src": "1089:207:0" + "src": "1160:207:0" }, { "attributes": { @@ -2442,7 +2606,7 @@ ], "name": "createPost", "payable": false, - "scope": 215, + "scope": 265, "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" @@ -2454,7 +2618,7 @@ "attributes": { "constant": false, "name": "url", - "scope": 210, + "scope": 229, "stateVariable": false, "storageLocation": "default", "type": "string memory", @@ -2467,19 +2631,19 @@ "name": "string", "type": "string storage pointer" }, - "id": 166, + "id": 175, "name": "ElementaryTypeName", - "src": "1320:6:0" + "src": "1391:6:0" } ], - "id": 167, + "id": 176, "name": "VariableDeclaration", - "src": "1320:10:0" + "src": "1391:10:0" } ], - "id": 168, + "id": 177, "name": "ParameterList", - "src": "1319:12:0" + "src": "1390:12:0" }, { "attributes": { @@ -2488,16 +2652,16 @@ ] }, "children": [], - "id": 169, + "id": 178, "name": "ParameterList", - "src": "1339:0:0" + "src": "1410:0:0" }, { "children": [ { "attributes": { "assignments": [ - 170 + 179 ] }, "children": [ @@ -2505,7 +2669,7 @@ "attributes": { "constant": false, "name": "post", - "scope": 210, + "scope": 229, "stateVariable": false, "storageLocation": "default", "type": "struct CapCoin.Post storage pointer", @@ -2514,9 +2678,9 @@ "visibility": "internal" }, "children": [], - "id": 170, + "id": 179, "name": "VariableDeclaration", - "src": "1369:8:0" + "src": "1440:8:0" }, { "attributes": { @@ -2534,13 +2698,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 49, + "referencedDeclaration": 54, "type": "mapping(address => struct CapCoin.Post storage ref)", "value": "addressToPost" }, - "id": 171, + "id": 180, "name": "Identifier", - "src": "1380:13:0" + "src": "1451:13:0" }, { "attributes": { @@ -2560,28 +2724,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 227, + "referencedDeclaration": 277, "type": "msg", "value": "msg" }, - "id": 172, + "id": 181, "name": "Identifier", - "src": "1394:3:0" + "src": "1465:3:0" } ], - "id": 173, + "id": 182, "name": "MemberAccess", - "src": "1394:10:0" + "src": "1465:10:0" } ], - "id": 174, + "id": 183, "name": "IndexAccess", - "src": "1380:25:0" + "src": "1451:25:0" } ], - "id": 175, + "id": 184, "name": "VariableDeclarationStatement", - "src": "1369:36:0" + "src": "1440:36:0" }, { "children": [ @@ -2614,18 +2778,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 170, + "referencedDeclaration": 179, "type": "struct CapCoin.Post storage pointer", "value": "post" }, - "id": 176, + "id": 185, "name": "Identifier", - "src": "1411:4:0" + "src": "1482:4:0" } ], - "id": 178, + "id": 187, "name": "MemberAccess", - "src": "1411:8:0" + "src": "1482:8:0" }, { "attributes": { @@ -2633,23 +2797,23 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 167, + "referencedDeclaration": 176, "type": "string memory", "value": "url" }, - "id": 179, + "id": 188, "name": "Identifier", - "src": "1422:3:0" + "src": "1493:3:0" } ], - "id": 180, + "id": 189, "name": "Assignment", - "src": "1411:14:0" + "src": "1482:14:0" } ], - "id": 181, + "id": 190, "name": "ExpressionStatement", - "src": "1411:14:0" + "src": "1482:14:0" }, { "children": [ @@ -2672,7 +2836,7 @@ "isPure": false, "lValueRequested": true, "member_name": "lotteryAmount", - "referencedDeclaration": 40, + "referencedDeclaration": 42, "type": "uint256" }, "children": [ @@ -2682,18 +2846,18 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 170, + "referencedDeclaration": 179, "type": "struct CapCoin.Post storage pointer", "value": "post" }, - "id": 182, + "id": 191, "name": "Identifier", - "src": "1431:4:0" + "src": "1502:4:0" } ], - "id": 184, + "id": 193, "name": "MemberAccess", - "src": "1431:18:0" + "src": "1502:18:0" }, { "attributes": { @@ -2708,98 +2872,84 @@ "type": "int_const 5", "value": "5" }, - "id": 185, + "id": 194, "name": "Literal", - "src": "1452:1:0" + "src": "1523:1:0" } ], - "id": 186, + "id": 195, "name": "Assignment", - "src": "1431:22:0" + "src": "1502:22:0" } ], - "id": 187, + "id": 196, "name": "ExpressionStatement", - "src": "1431:22:0" + "src": "1502:22:0" }, { "children": [ { "attributes": { "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, - "operator": "-", - "type": "uint256" + "operator": "=", + "type": "string storage ref" }, "children": [ { "attributes": { "argumentTypes": null, "isConstant": false, - "isLValue": false, + "isLValue": true, "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "uint256", - "type_conversion": false + "lValueRequested": true, + "member_name": "userName", + "referencedDeclaration": 40, + "type": "string storage ref" }, "children": [ { "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } + "argumentTypes": null, + "overloadedDeclarations": [ + null ], - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "push", - "referencedDeclaration": null, - "type": "function (address) returns (uint256)" + "referencedDeclaration": 179, + "type": "struct CapCoin.Post storage pointer", + "value": "post" }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 55, - "type": "address[] storage ref", - "value": "posts" - }, - "id": 188, - "name": "Identifier", - "src": "1459:5:0" - } - ], - "id": 190, - "name": "MemberAccess", - "src": "1459:10:0" - }, + "id": 197, + "name": "Identifier", + "src": "1530:4:0" + } + ], + "id": 199, + "name": "MemberAccess", + "src": "1530:13:0" + }, + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "member_name": "name", + "referencedDeclaration": 31, + "type": "string storage ref" + }, + "children": [ { "attributes": { "argumentTypes": null, "isConstant": false, - "isLValue": false, + "isLValue": true, "isPure": false, "lValueRequested": false, - "member_name": "sender", - "referencedDeclaration": null, - "type": "address" + "type": "struct CapCoin.User storage ref" }, "children": [ { @@ -2808,27 +2958,172 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 227, - "type": "msg", - "value": "msg" + "referencedDeclaration": 50, + "type": "mapping(address => struct CapCoin.User storage ref)", + "value": "addressToUser" }, - "id": 191, + "id": 200, "name": "Identifier", - "src": "1470:3:0" - } - ], - "id": 192, - "name": "MemberAccess", - "src": "1470:10:0" - } - ], - "id": 193, - "name": "FunctionCall", - "src": "1459:22:0" - }, - { - "attributes": { - "argumentTypes": null, + "src": "1546: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": 277, + "type": "msg", + "value": "msg" + }, + "id": 201, + "name": "Identifier", + "src": "1560:3:0" + } + ], + "id": 202, + "name": "MemberAccess", + "src": "1560:10:0" + } + ], + "id": 203, + "name": "IndexAccess", + "src": "1546:25:0" + } + ], + "id": 204, + "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" + }, + "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": 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" + }, + "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": 212, + "name": "FunctionCall", + "src": "1583:22:0" + }, + { + "attributes": { + "argumentTypes": null, "hexvalue": "31", "isConstant": false, "isLValue": false, @@ -2839,19 +3134,19 @@ "type": "int_const 1", "value": "1" }, - "id": 194, + "id": 213, "name": "Literal", - "src": "1483:1:0" + "src": "1607:1:0" } ], - "id": 195, + "id": 214, "name": "BinaryOperation", - "src": "1459:25:0" + "src": "1583:25:0" } ], - "id": 196, + "id": 215, "name": "ExpressionStatement", - "src": "1459:25:0" + "src": "1583:25:0" }, { "children": [ @@ -2894,13 +3189,13 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 45, + "referencedDeclaration": 50, "type": "mapping(address => struct CapCoin.User storage ref)", "value": "addressToUser" }, - "id": 197, + "id": 216, "name": "Identifier", - "src": "1490:13:0" + "src": "1614:13:0" }, { "attributes": { @@ -2920,28 +3215,28 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 227, + "referencedDeclaration": 277, "type": "msg", "value": "msg" }, - "id": 198, + "id": 217, "name": "Identifier", - "src": "1504:3:0" + "src": "1628:3:0" } ], - "id": 199, + "id": 218, "name": "MemberAccess", - "src": "1504:10:0" + "src": "1628:10:0" } ], - "id": 200, + "id": 219, "name": "IndexAccess", - "src": "1490:25:0" + "src": "1614:25:0" } ], - "id": 201, + "id": 220, "name": "MemberAccess", - "src": "1490:37:0" + "src": "1614:37:0" }, { "attributes": { @@ -2956,19 +3251,19 @@ "type": "int_const 5", "value": "5" }, - "id": 202, + "id": 221, "name": "Literal", - "src": "1531:1:0" + "src": "1655:1:0" } ], - "id": 203, + "id": 222, "name": "Assignment", - "src": "1490:42:0" + "src": "1614:42:0" } ], - "id": 204, + "id": 223, "name": "ExpressionStatement", - "src": "1490:42:0" + "src": "1614:42:0" }, { "children": [ @@ -3002,9 +3297,420 @@ "type": "function (string memory)", "value": "CreatedPost" }, - "id": 205, + "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" + } + ], + "id": 226, + "name": "FunctionCall", + "src": "1662:16:0" + } + ], + "id": 227, + "name": "ExpressionStatement", + "src": "1662:16:0" + } + ], + "id": 228, + "name": "Block", + "src": "1410:273:0" + } + ], + "id": 229, + "name": "FunctionDefinition", + "src": "1371:312:0" + }, + { + "attributes": { + "constant": true, + "implemented": true, + "isConstructor": false, + "modifiers": [ + null + ], + "name": "getPosts", + "payable": false, + "scope": 265, + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + "children": [ + { + "attributes": { + "parameters": [ + null + ] + }, + "children": [], + "id": 230, + "name": "ParameterList", + "src": "1704:2:0" + }, + { + "children": [ + { + "attributes": { + "constant": false, + "name": "", + "scope": 238, + "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": 231, + "name": "ElementaryTypeName", + "src": "1728:7:0" + } + ], + "id": 232, + "name": "ArrayTypeName", + "src": "1728:9:0" + } + ], + "id": 233, + "name": "VariableDeclaration", + "src": "1728:9:0" + } + ], + "id": 234, + "name": "ParameterList", + "src": "1727:11:0" + }, + { + "children": [ + { + "attributes": { + "functionReturnParameters": 234 + }, + "children": [ + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 60, + "type": "address[] storage ref", + "value": "posts" + }, + "id": 235, + "name": "Identifier", + "src": "1754:5:0" + } + ], + "id": 236, + "name": "Return", + "src": "1747:12:0" + } + ], + "id": 237, + "name": "Block", + "src": "1739:25:0" + } + ], + "id": 238, + "name": "FunctionDefinition", + "src": "1687:77:0" + }, + { + "attributes": { + "constant": false, + "implemented": true, + "isConstructor": false, + "modifiers": [ + null + ], + "name": "seed", + "payable": false, + "scope": 265, + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + "children": [ + { + "children": [ + { + "attributes": { + "constant": false, + "name": "name", + "scope": 260, + "stateVariable": false, + "storageLocation": "default", + "type": "string memory", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "string", + "type": "string storage pointer" + }, + "id": 239, + "name": "ElementaryTypeName", + "src": "1782:6:0" + } + ], + "id": 240, + "name": "VariableDeclaration", + "src": "1782:11:0" + }, + { + "attributes": { + "constant": false, + "name": "url", + "scope": 260, + "stateVariable": false, + "storageLocation": "default", + "type": "string memory", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "string", + "type": "string storage pointer" + }, + "id": 241, + "name": "ElementaryTypeName", + "src": "1795:6:0" + } + ], + "id": 242, + "name": "VariableDeclaration", + "src": "1795:10:0" + }, + { + "attributes": { + "constant": false, + "name": "amount", + "scope": 260, + "stateVariable": false, + "storageLocation": "default", + "type": "uint256", + "value": null, + "visibility": "internal" + }, + "children": [ + { + "attributes": { + "name": "uint", + "type": "uint256" + }, + "id": 243, + "name": "ElementaryTypeName", + "src": "1807:4:0" + } + ], + "id": 244, + "name": "VariableDeclaration", + "src": "1807:11:0" + } + ], + "id": 245, + "name": "ParameterList", + "src": "1781:38:0" + }, + { + "attributes": { + "parameters": [ + null + ] + }, + "children": [], + "id": 246, + "name": "ParameterList", + "src": "1827:0:0" + }, + { + "children": [ + { + "children": [ + { + "attributes": { + "argumentTypes": null, + "isConstant": false, + "isLValue": false, + "isPure": false, + "isStructConstructorCall": false, + "lValueRequested": false, + "names": [ + null + ], + "type": "tuple()", + "type_conversion": false + }, + "children": [ + { + "attributes": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 97, + "type": "function (string memory)", + "value": "createUser" + }, + "id": 247, + "name": "Identifier", + "src": "1835:10:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 240, + "type": "string memory", + "value": "name" + }, + "id": 248, + "name": "Identifier", + "src": "1846:4:0" + } + ], + "id": 249, + "name": "FunctionCall", + "src": "1835:16:0" + } + ], + "id": 250, + "name": "ExpressionStatement", + "src": "1835:16: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" + } + ], + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 174, + "type": "function (uint256)", + "value": "buyTokens" + }, + "id": 251, + "name": "Identifier", + "src": "1859:9:0" + }, + { + "attributes": { + "argumentTypes": null, + "overloadedDeclarations": [ + null + ], + "referencedDeclaration": 244, + "type": "uint256", + "value": "amount" + }, + "id": 252, + "name": "Identifier", + "src": "1869:6:0" + } + ], + "id": 253, + "name": "FunctionCall", + "src": "1859:17:0" + } + ], + "id": 254, + "name": "ExpressionStatement", + "src": "1859:17: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": 229, + "type": "function (string memory)", + "value": "createPost" + }, + "id": 255, "name": "Identifier", - "src": "1538:11:0" + "src": "1884:10:0" }, { "attributes": { @@ -3012,33 +3718,33 @@ "overloadedDeclarations": [ null ], - "referencedDeclaration": 167, + "referencedDeclaration": 242, "type": "string memory", "value": "url" }, - "id": 206, + "id": 256, "name": "Identifier", - "src": "1550:3:0" + "src": "1895:3:0" } ], - "id": 207, + "id": 257, "name": "FunctionCall", - "src": "1538:16:0" + "src": "1884:15:0" } ], - "id": 208, + "id": 258, "name": "ExpressionStatement", - "src": "1538:16:0" + "src": "1884:15:0" } ], - "id": 209, + "id": 259, "name": "Block", - "src": "1339:220:0" + "src": "1827:77:0" } ], - "id": 210, + "id": 260, "name": "FunctionDefinition", - "src": "1300:259:0" + "src": "1768:136:0" }, { "attributes": { @@ -3050,7 +3756,7 @@ ], "name": "", "payable": true, - "scope": 215, + "scope": 265, "stateMutability": "payable", "superFunction": null, "visibility": "internal" @@ -3063,9 +3769,9 @@ ] }, "children": [], - "id": 211, + "id": 261, "name": "ParameterList", - "src": "1571:2:0" + "src": "1916:2:0" }, { "attributes": { @@ -3074,9 +3780,9 @@ ] }, "children": [], - "id": 212, + "id": 262, "name": "ParameterList", - "src": "1591:0:0" + "src": "1936:0:0" }, { "attributes": { @@ -3085,24 +3791,24 @@ ] }, "children": [], - "id": 213, + "id": 263, "name": "Block", - "src": "1591:2:0" + "src": "1936:2:0" } ], - "id": 214, + "id": 264, "name": "FunctionDefinition", - "src": "1563:30:0" + "src": "1908:30:0" } ], - "id": 215, + "id": 265, "name": "ContractDefinition", - "src": "26:1569:0" + "src": "26:1914:0" } ], - "id": 216, + "id": 266, "name": "SourceUnit", - "src": "0:1596:0" + "src": "0:1941:0" }, "compiler": { "name": "solc", @@ -3116,5 +3822,5 @@ } }, "schemaVersion": "1.0.1", - "updatedAt": "2018-01-19T04:15:13.230Z" + "updatedAt": "2018-01-19T16:26:08.225Z" } \ No newline at end of file diff --git a/build/contracts/Migrations.json b/build/contracts/Migrations.json index 0a710b3f..5f271dba 100644 --- a/build/contracts/Migrations.json +++ b/build/contracts/Migrations.json @@ -823,5 +823,5 @@ } }, "schemaVersion": "1.0.1", - "updatedAt": "2018-01-19T04:15:13.232Z" + "updatedAt": "2018-01-19T16:26:08.222Z" } \ No newline at end of file diff --git a/build/contracts/SimpleStorage.json b/build/contracts/SimpleStorage.json index c39922f9..86d1dbfa 100644 --- a/build/contracts/SimpleStorage.json +++ b/build/contracts/SimpleStorage.json @@ -344,5 +344,5 @@ } }, "schemaVersion": "1.0.1", - "updatedAt": "2018-01-19T04:15:13.219Z" + "updatedAt": "2018-01-19T16:26:08.220Z" } \ No newline at end of file diff --git a/contracts/CapCoin.sol b/contracts/CapCoin.sol index 4b9c04f6..44a0fed8 100644 --- a/contracts/CapCoin.sol +++ b/contracts/CapCoin.sol @@ -22,7 +22,9 @@ contract CapCoin { struct Post { string url; + string userName; uint lotteryAmount; + string[] captions; } mapping (address => User) public addressToUser; @@ -44,11 +46,12 @@ contract CapCoin { return users; } - function getUser() public view returns (string, uint, string, uint) { + function getUser() public view returns (string, uint, string, uint, address) { return (addressToUser[msg.sender].name, addressToUser[msg.sender].coinBalance, addressToPost[msg.sender].url, - addressToPost[msg.sender].lotteryAmount); + addressToPost[msg.sender].lotteryAmount, + msg.sender); } function buyTokens(uint amount) public { @@ -63,10 +66,22 @@ contract CapCoin { var post = addressToPost[msg.sender]; post.url = url; post.lotteryAmount = 5; + post.userName = addressToUser[msg.sender].name; + posts.push(msg.sender) -1; addressToUser[msg.sender].coinBalance -= 5; CreatedPost(url); } + function getPosts() public view returns (address[]) { + return posts; + } + + function seed(string name, string url, uint amount) public { + createUser(name); + buyTokens(amount); + createPost(url); + } + function() internal payable {} } diff --git a/readme.md b/readme.md index 7e9a99a0..11b0cb07 100644 --- a/readme.md +++ b/readme.md @@ -8,5 +8,5 @@ c87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3 - +ae6ae8e5ccbfb04590405997ee2d52d2b330726137b875053c36d94e974d162f http://127.0.0.1:7545 diff --git a/src/App.js b/src/App.js index 894bebf2..fc53f6ee 100644 --- a/src/App.js +++ b/src/App.js @@ -20,16 +20,19 @@ class App extends Component { componentWillMount() { this.collectBlockchainInfo() + .then(() => { + this.props.findUser(this.props.contract.getUser, this.props.accounts[0]) + }) } async collectBlockchainInfo() { // Get network provider, web3, and truffle contract instance and store them on state. - await this.props.getWeb3() - await this.props.getContract(this.props.web3) - await this.props.getAccounts(this.props.web3) - await this.props.findUser(this.props.contract.getUser, this.props.accounts[0]) + return Promise.all([await this.props.getWeb3(), + this.props.getContract(this.props.web3), + this.props.getAccounts(this.props.web3)]) } + render() { return (