UNPKG

@josojo/realitytoken-contracts

Version:
972 lines (971 loc) 129 kB
{ "contractName": "OutcomeToken", "abi": [ { "constant": false, "inputs": [ { "name": "spender", "type": "address" }, { "name": "value", "type": "uint256" } ], "name": "approve", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "totalSupply", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "from", "type": "address" }, { "name": "to", "type": "address" }, { "name": "value", "type": "uint256" } ], "name": "transferFrom", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "name": "owner", "type": "address" } ], "name": "balanceOf", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "to", "type": "address" }, { "name": "value", "type": "uint256" } ], "name": "transfer", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "name": "owner", "type": "address" }, { "name": "spender", "type": "address" } ], "name": "allowance", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "eventContract", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "inputs": [], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "owner", "type": "address" }, { "indexed": false, "name": "amount", "type": "uint256" } ], "name": "Issuance", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "owner", "type": "address" }, { "indexed": false, "name": "amount", "type": "uint256" } ], "name": "Revocation", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "from", "type": "address" }, { "indexed": true, "name": "to", "type": "address" }, { "indexed": false, "name": "value", "type": "uint256" } ], "name": "Transfer", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "owner", "type": "address" }, { "indexed": true, "name": "spender", "type": "address" }, { "indexed": false, "name": "value", "type": "uint256" } ], "name": "Approval", "type": "event" }, { "constant": false, "inputs": [ { "name": "_for", "type": "address" }, { "name": "outcomeTokenCount", "type": "uint256" } ], "name": "issue", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "_for", "type": "address" }, { "name": "outcomeTokenCount", "type": "uint256" } ], "name": "revoke", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "bytecode": "0x608060405234801561001057600080fd5b5060038054600160a060020a03191633179055610b42806100326000396000f3006080604052600436106100985763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b3811461009d57806318160ddd146100d557806323b872dd146100fc57806370a0823114610126578063867904b414610147578063a9059cbb1461016d578063dd62ed3e14610191578063e274fd24146101b8578063eac449d9146101e9575b600080fd5b3480156100a957600080fd5b506100c1600160a060020a036004351660243561020d565b604080519115158252519081900360200190f35b3480156100e157600080fd5b506100ea610274565b60408051918252519081900360200190f35b34801561010857600080fd5b506100c1600160a060020a036004358116906024351660443561027a565b34801561013257600080fd5b506100ea600160a060020a0360043516610548565b34801561015357600080fd5b5061016b600160a060020a0360043516602435610563565b005b34801561017957600080fd5b506100c1600160a060020a036004351660243561072f565b34801561019d57600080fd5b506100ea600160a060020a0360043581169060243516610910565b3480156101c457600080fd5b506101cd61093b565b60408051600160a060020a039092168252519081900360200190f35b3480156101f557600080fd5b5061016b600160a060020a036004351660243561094a565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60025490565b600160a060020a0383166000908152602081815260408083205481517fe31c71c4000000000000000000000000000000000000000000000000000000008152600481019190915260248101859052905173__Math__________________________________9263e31c71c49260448082019391829003018186803b15801561030157600080fd5b505af4158015610315573d6000803e3d6000fd5b505050506040513d602081101561032b57600080fd5b505115806103f55750600160a060020a03841660009081526001602090815260408083203384528252918290205482517fe31c71c4000000000000000000000000000000000000000000000000000000008152600481019190915260248101859052915173__Math__________________________________9263e31c71c4926044808301939192829003018186803b1580156103c757600080fd5b505af41580156103db573d6000803e3d6000fd5b505050506040513d60208110156103f157600080fd5b5051155b806104b25750600160a060020a038316600090815260208181526040918290205482517f4e30a66c000000000000000000000000000000000000000000000000000000008152600481019190915260248101859052915173__Math__________________________________92634e30a66c926044808301939192829003018186803b15801561048457600080fd5b505af4158015610498573d6000803e3d6000fd5b505050506040513d60208110156104ae57600080fd5b5051155b156104bf57506000610541565b600160a060020a038085166000818152602081815260408083208054889003905560018252808320338452825280832080548890039055938716808352828252918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b9392505050565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a0316331461057a57600080fd5b600160a060020a038216600090815260208181526040918290205482517f771602f7000000000000000000000000000000000000000000000000000000008152600481019190915260248101849052915173__Math__________________________________9263771602f7926044808301939192829003018186803b15801561060357600080fd5b505af4158015610617573d6000803e3d6000fd5b505050506040513d602081101561062d57600080fd5b5051600160a060020a038316600090815260208181526040918290209290925560025481517f771602f7000000000000000000000000000000000000000000000000000000008152600481019190915260248101849052905173__Math__________________________________9263771602f79260448082019391829003018186803b1580156106bd57600080fd5b505af41580156106d1573d6000803e3d6000fd5b505050506040513d60208110156106e757600080fd5b5051600255604080518281529051600160a060020a038416917f9cb9c14f7bc76e3a89b796b091850526236115352a198b1e472f00e91376bbcb919081900360200190a25050565b336000908152602081815260408083205481517fe31c71c4000000000000000000000000000000000000000000000000000000008152600481019190915260248101859052905173__Math__________________________________9263e31c71c49260448082019391829003018186803b1580156107ad57600080fd5b505af41580156107c1573d6000803e3d6000fd5b505050506040513d60208110156107d757600080fd5b505115806108975750600160a060020a038316600090815260208181526040918290205482517f4e30a66c000000000000000000000000000000000000000000000000000000008152600481019190915260248101859052915173__Math__________________________________92634e30a66c926044808301939192829003018186803b15801561086957600080fd5b505af415801561087d573d6000803e3d6000fd5b505050506040513d602081101561089357600080fd5b5051155b156108a45750600061026e565b3360008181526020818152604080832080548790039055600160a060020a03871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600354600160a060020a031681565b600354600160a060020a0316331461096157600080fd5b600160a060020a038216600090815260208181526040918290205482517fb67d77c5000000000000000000000000000000000000000000000000000000008152600481019190915260248101849052915173__Math__________________________________9263b67d77c5926044808301939192829003018186803b1580156109ea57600080fd5b505af41580156109fe573d6000803e3d6000fd5b505050506040513d6020811015610a1457600080fd5b5051600160a060020a038316600090815260208181526040918290209290925560025481517fb67d77c5000000000000000000000000000000000000000000000000000000008152600481019190915260248101849052905173__Math__________________________________9263b67d77c59260448082019391829003018186803b158015610aa457600080fd5b505af4158015610ab8573d6000803e3d6000fd5b505050506040513d6020811015610ace57600080fd5b5051600255604080518281529051600160a060020a038416917ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e9919081900360200190a250505600a165627a7a7230582015dee1493b2a008fd9d35176443c9d91e7a538255810dbb9197e1d4a79d9bb120029", "deployedBytecode": "0x6080604052600436106100985763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b3811461009d57806318160ddd146100d557806323b872dd146100fc57806370a0823114610126578063867904b414610147578063a9059cbb1461016d578063dd62ed3e14610191578063e274fd24146101b8578063eac449d9146101e9575b600080fd5b3480156100a957600080fd5b506100c1600160a060020a036004351660243561020d565b604080519115158252519081900360200190f35b3480156100e157600080fd5b506100ea610274565b60408051918252519081900360200190f35b34801561010857600080fd5b506100c1600160a060020a036004358116906024351660443561027a565b34801561013257600080fd5b506100ea600160a060020a0360043516610548565b34801561015357600080fd5b5061016b600160a060020a0360043516602435610563565b005b34801561017957600080fd5b506100c1600160a060020a036004351660243561072f565b34801561019d57600080fd5b506100ea600160a060020a0360043581169060243516610910565b3480156101c457600080fd5b506101cd61093b565b60408051600160a060020a039092168252519081900360200190f35b3480156101f557600080fd5b5061016b600160a060020a036004351660243561094a565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60025490565b600160a060020a0383166000908152602081815260408083205481517fe31c71c4000000000000000000000000000000000000000000000000000000008152600481019190915260248101859052905173__Math__________________________________9263e31c71c49260448082019391829003018186803b15801561030157600080fd5b505af4158015610315573d6000803e3d6000fd5b505050506040513d602081101561032b57600080fd5b505115806103f55750600160a060020a03841660009081526001602090815260408083203384528252918290205482517fe31c71c4000000000000000000000000000000000000000000000000000000008152600481019190915260248101859052915173__Math__________________________________9263e31c71c4926044808301939192829003018186803b1580156103c757600080fd5b505af41580156103db573d6000803e3d6000fd5b505050506040513d60208110156103f157600080fd5b5051155b806104b25750600160a060020a038316600090815260208181526040918290205482517f4e30a66c000000000000000000000000000000000000000000000000000000008152600481019190915260248101859052915173__Math__________________________________92634e30a66c926044808301939192829003018186803b15801561048457600080fd5b505af4158015610498573d6000803e3d6000fd5b505050506040513d60208110156104ae57600080fd5b5051155b156104bf57506000610541565b600160a060020a038085166000818152602081815260408083208054889003905560018252808320338452825280832080548890039055938716808352828252918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b9392505050565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a0316331461057a57600080fd5b600160a060020a038216600090815260208181526040918290205482517f771602f7000000000000000000000000000000000000000000000000000000008152600481019190915260248101849052915173__Math__________________________________9263771602f7926044808301939192829003018186803b15801561060357600080fd5b505af4158015610617573d6000803e3d6000fd5b505050506040513d602081101561062d57600080fd5b5051600160a060020a038316600090815260208181526040918290209290925560025481517f771602f7000000000000000000000000000000000000000000000000000000008152600481019190915260248101849052905173__Math__________________________________9263771602f79260448082019391829003018186803b1580156106bd57600080fd5b505af41580156106d1573d6000803e3d6000fd5b505050506040513d60208110156106e757600080fd5b5051600255604080518281529051600160a060020a038416917f9cb9c14f7bc76e3a89b796b091850526236115352a198b1e472f00e91376bbcb919081900360200190a25050565b336000908152602081815260408083205481517fe31c71c4000000000000000000000000000000000000000000000000000000008152600481019190915260248101859052905173__Math__________________________________9263e31c71c49260448082019391829003018186803b1580156107ad57600080fd5b505af41580156107c1573d6000803e3d6000fd5b505050506040513d60208110156107d757600080fd5b505115806108975750600160a060020a038316600090815260208181526040918290205482517f4e30a66c000000000000000000000000000000000000000000000000000000008152600481019190915260248101859052915173__Math__________________________________92634e30a66c926044808301939192829003018186803b15801561086957600080fd5b505af415801561087d573d6000803e3d6000fd5b505050506040513d602081101561089357600080fd5b5051155b156108a45750600061026e565b3360008181526020818152604080832080548790039055600160a060020a03871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600354600160a060020a031681565b600354600160a060020a0316331461096157600080fd5b600160a060020a038216600090815260208181526040918290205482517fb67d77c5000000000000000000000000000000000000000000000000000000008152600481019190915260248101849052915173__Math__________________________________9263b67d77c5926044808301939192829003018186803b1580156109ea57600080fd5b505af41580156109fe573d6000803e3d6000fd5b505050506040513d6020811015610a1457600080fd5b5051600160a060020a038316600090815260208181526040918290209290925560025481517fb67d77c5000000000000000000000000000000000000000000000000000000008152600481019190915260248101849052905173__Math__________________________________9263b67d77c59260448082019391829003018186803b158015610aa457600080fd5b505af4158015610ab8573d6000803e3d6000fd5b505050506040513d6020811015610ace57600080fd5b5051600255604080518281529051600160a060020a038416917ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e9919081900360200190a250505600a165627a7a7230582015dee1493b2a008fd9d35176443c9d91e7a538255810dbb9197e1d4a79d9bb120029", "sourceMap": "184:1552:12:-;;;741:86;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;794:13:12;:26;;-1:-1:-1;;;;;;794:26:12;810:10;794:26;;;184:1552;;;;;;", "deployedSourceMap": "184:1552:12:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1951:211:13;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1951:211:13;-1:-1:-1;;;;;1951:211:13;;;;;;;;;;;;;;;;;;;;;;;;;2887:117;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2887:117:13;;;;;;;;;;;;;;;;;;;;1275:459;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1275:459:13;-1:-1:-1;;;;;1275:459:13;;;;;;;;;;;;2676:132;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2676:132:13;-1:-1:-1;;;;;2676:132:13;;;;;1012:268:12;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1012:268:12;-1:-1:-1;;;;;1012:268:12;;;;;;;;;613:350:13;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;613:350:13;-1:-1:-1;;;;;613:350:13;;;;;;;2372:160;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2372:160:13;-1:-1:-1;;;;;2372:160:13;;;;;;;;;;428:28:12;;8:9:-1;5:2;;;30:1;27;20:12;5:2;428:28:12;;;;;;;;-1:-1:-1;;;;;428:28:12;;;;;;;;;;;;;;1463:271;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1463:271:12;-1:-1:-1;;;;;1463:271:12;;;;;;;1951:211:13;2060:10;2029:4;2049:22;;;:10;:22;;;;;;;;-1:-1:-1;;;;;2049:31:13;;;;;;;;;;;:39;;;2098:36;;;;;;;2029:4;;2049:31;;2060:10;;2098:36;;;;;;;;-1:-1:-1;2151:4:13;1951:211;;;;;:::o;2887:117::-;2986:11;;2887:117;:::o;1275:459::-;-1:-1:-1;;;;;1395:14:13;;1367:4;1395:14;;;;;;;;;;;;:31;;;;;;;;;;;;;;;;;;;;:24;;;;:31;;;;;;;;;;;:24;:31;;;5:2:-1;;;;30:1;27;20:12;5:2;1395:31:13;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1395:31:13;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1395:31:13;1394:32;;:94;;-1:-1:-1;;;;;;1443:16:13;;;;;;:10;:16;;;;;;;;1460:10;1443:28;;;;;;;;;:45;;;;;;;;;;;;;;;;;;;;:38;;;;:45;;;;;:16;;:45;;;;;:38;:45;;;5:2:-1;;;;30:1;27;20:12;5:2;1443:45:13;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1443:45:13;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1443:45:13;1442:46;1394:94;:140;;;-1:-1:-1;;;;;;1505:12:13;;:8;:12;;;;;;;;;;;;;:29;;;;;;;;;;;;;;;;;;;;:22;;;;:29;;;;;:12;;:29;;;;;:22;:29;;;5:2:-1;;;;30:1;27;20:12;5:2;1505:29:13;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1505:29:13;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1505:29:13;1504:30;1394:140;1387:173;;;-1:-1:-1;1555:5:13;1548:12;;1387:173;-1:-1:-1;;;;;1570:14:13;;;:8;:14;;;;;;;;;;;:23;;;;;;;-1:-1:-1;1603:16:13;;;;;1620:10;1603:28;;;;;;;:37;;;;;;;1650:12;;;;;;;;;;;;;:21;;;;;;1681:25;;;;;;;1650:12;;1681:25;;;;;;;;;;;-1:-1:-1;1723:4:13;1275:459;;;;;;:::o;2676:132::-;-1:-1:-1;;;;;2786:15:13;2759:4;2786:15;;;;;;;;;;;;2676:132::o;1012:268:12:-;609:13;;-1:-1:-1;;;;;609:13:12;595:10;:27;587:36;;;;;;-1:-1:-1;;;;;1135:14:12;;:8;:14;;;;;;;;;;;;;:37;;;;;;;;;;;;;;;;;;;;:18;;;;:37;;;;;:14;;:37;;;;;:18;:37;;;5:2:-1;;;;30:1;27;20:12;5:2;1135:37:12;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1135:37:12;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1135:37:12;-1:-1:-1;;;;;1118:14:12;;:8;:14;;;1135:37;1118:14;;;;;;;;:54;;;;1196:11;;:34;;;;;;;;;;;;;;;;;;;;:15;;;;:34;;;;;;;;;;;:15;:34;;;5:2:-1;;;;30:1;27;20:12;5:2;1196:34:12;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1196:34:12;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1196:34:12;1182:11;:48;1240:33;;;;;;;;-1:-1:-1;;;;;1240:33:12;;;;;;;;;1196:34;1240:33;;;1012:268;;:::o;613:350:13:-;724:10;687:4;715:20;;;;;;;;;;;;:37;;;;;;;;;;;;;;;;;;;;:30;;;;:37;;;;;;;;;;;:30;:37;;;5:2:-1;;;;30:1;27;20:12;5:2;715:37:13;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;715:37:13;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;715:37:13;714:38;;:84;;-1:-1:-1;;;;;;769:12:13;;:8;:12;;;;;;;;;;;;;:29;;;;;;;;;;;;;;;;;;;;:22;;;;:29;;;;;:12;;:29;;;;;:22;:29;;;5:2:-1;;;;30:1;27;20:12;5:2;769:29:13;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;769:29:13;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;769:29:13;768:30;714:84;707:117;;;-1:-1:-1;819:5:13;812:12;;707:117;843:10;834:8;:20;;;;;;;;;;;:29;;;;;;;-1:-1:-1;;;;;873:12:13;;;;;;;;;:21;;;;;;904:31;;;;;;;873:12;;843:10;904:31;;;;;;;;;;;-1:-1:-1;952:4:13;613:350;;;;:::o;2372:160::-;-1:-1:-1;;;;;2499:17:13;;;2472:4;2499:17;;;:10;:17;;;;;;;;:26;;;;;;;;;;;;;2372:160::o;428:28:12:-;;;-1:-1:-1;;;;;428:28:12;;:::o;1463:271::-;609:13;;-1:-1:-1;;;;;609:13:12;595:10;:27;587:36;;;;;;-1:-1:-1;;;;;1587:14:12;;:8;:14;;;;;;;;;;;;;:37;;;;;;;;;;;;;;;;;;;;:18;;;;:37;;;;;:14;;:37;;;;;:18;:37;;;5:2:-1;;;;30:1;27;20:12;5:2;1587:37:12;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1587:37:12;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1587:37:12;-1:-1:-1;;;;;1570:14:12;;:8;:14;;;1587:37;1570:14;;;;;;;;:54;;;;1648:11;;:34;;;;;;;;;;;;;;;;;;;;:15;;;;:34;;;;;;;;;;;:15;:34;;;5:2:-1;;;;30:1;27;20:12;5:2;1648:34:12;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1648:34:12;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1648:34:12;1634:11;:48;1692:35;;;;;;;;-1:-1:-1;;;;;1692:35:12;;;;;;;;;1648:34;1692:35;;;1463:271;;:::o", "source": "pragma solidity ^0.4.15;\nimport \"../Tokens/StandardToken.sol\";\n\n\n/// @title Outcome token contract - Issuing and revoking outcome tokens\n/// @author Stefan George - <stefan@gnosis.pm>\ncontract OutcomeToken is StandardToken {\n using Math for *;\n\n /*\n * Events\n */\n event Issuance(address indexed owner, uint amount);\n event Revocation(address indexed owner, uint amount);\n\n /*\n * Storage\n */\n address public eventContract;\n\n /*\n * Modifiers\n */\n modifier isEventContract () {\n // Only event contract is allowed to proceed\n require(msg.sender == eventContract);\n _;\n }\n\n /*\n * Public functions\n */\n /// @dev Constructor sets events contract address\n function OutcomeToken()\n public\n {\n eventContract = msg.sender;\n }\n \n /// @dev Events contract issues new tokens for address. Returns success\n /// @param _for Address of receiver\n /// @param outcomeTokenCount Number of tokens to issue\n function issue(address _for, uint outcomeTokenCount)\n public\n isEventContract\n {\n balances[_for] = balances[_for].add(outcomeTokenCount);\n totalTokens = totalTokens.add(outcomeTokenCount);\n Issuance(_for, outcomeTokenCount);\n }\n\n /// @dev Events contract revokes tokens for address. Returns success\n /// @param _for Address of token holder\n /// @param outcomeTokenCount Number of tokens to revoke\n function revoke(address _for, uint outcomeTokenCount)\n public\n isEventContract\n {\n balances[_for] = balances[_for].sub(outcomeTokenCount);\n totalTokens = totalTokens.sub(outcomeTokenCount);\n Revocation(_for, outcomeTokenCount);\n }\n}\n", "sourcePath": "@gnosis.pm/pm-contracts/contracts/Tokens/OutcomeToken.sol", "ast": { "absolutePath": "@gnosis.pm/pm-contracts/contracts/Tokens/OutcomeToken.sol", "exportedSymbols": { "OutcomeToken": [ 3085 ] }, "id": 3086, "nodeType": "SourceUnit", "nodes": [ { "id": 2979, "literals": [ "solidity", "^", "0.4", ".15" ], "nodeType": "PragmaDirective", "src": "0:24:12" }, { "absolutePath": "@gnosis.pm/pm-contracts/contracts/Tokens/StandardToken.sol", "file": "../Tokens/StandardToken.sol", "id": 2980, "nodeType": "ImportDirective", "scope": 3086, "sourceUnit": 3292, "src": "25:37:12", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 2981, "name": "StandardToken", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 3291, "src": "209:13:12", "typeDescriptions": { "typeIdentifier": "t_contract$_StandardToken_$3291", "typeString": "contract StandardToken" } }, "id": 2982, "nodeType": "InheritanceSpecifier", "src": "209:13:12" } ], "contractDependencies": [ 3291, 3360 ], "contractKind": "contract", "documentation": "@title Outcome token contract - Issuing and revoking outcome tokens\n @author Stefan George - <stefan@gnosis.pm>", "fullyImplemented": true, "id": 3085, "linearizedBaseContracts": [ 3085, 3291, 3360 ], "name": "OutcomeToken", "nodeType": "ContractDefinition", "nodes": [ { "id": 2984, "libraryName": { "contractScope": null, "id": 2983, "name": "Math", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4611, "src": "235:4:12", "typeDescriptions": { "typeIdentifier": "t_contract$_Math_$4611", "typeString": "library Math" } }, "nodeType": "UsingForDirective", "src": "229:17:12", "typeName": null }, { "anonymous": false, "documentation": null, "id": 2990, "name": "Issuance", "nodeType": "EventDefinition", "parameters": { "id": 2989, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2986, "indexed": true, "name": "owner", "nodeType": "VariableDeclaration", "scope": 2990, "src": "297:21:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2985, "name": "address", "nodeType": "ElementaryTypeName", "src": "297:7:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2988, "indexed": false, "name": "amount", "nodeType": "VariableDeclaration", "scope": 2990, "src": "320:11:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2987, "name": "uint", "nodeType": "ElementaryTypeName", "src": "320:4:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "296:36:12" }, "src": "282:51:12" }, { "anonymous": false, "documentation": null, "id": 2996, "name": "Revocation", "nodeType": "EventDefinition", "parameters": { "id": 2995, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2992, "indexed": true, "name": "owner", "nodeType": "VariableDeclaration", "scope": 2996, "src": "355:21:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2991, "name": "address", "nodeType": "ElementaryTypeName", "src": "355:7:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2994, "indexed": false, "name": "amount", "nodeType": "VariableDeclaration", "scope": 2996, "src": "378:11:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2993, "name": "uint", "nodeType": "ElementaryTypeName", "src": "378:4:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "354:36:12" }, "src": "338:53:12" }, { "constant": false, "id": 2998, "name": "eventContract", "nodeType": "VariableDeclaration", "scope": 3085, "src": "428:28:12", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2997, "name": "address", "nodeType": "ElementaryTypeName", "src": "428:7:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "public" }, { "body": { "id": 3008, "nodeType": "Block", "src": "524:117:12", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 3004, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 3001, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9180, "src": "595:3:12", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 3002, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "595:10:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 3003, "name": "eventContract", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2998, "src": "609:13:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "595:27:12", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 3000, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 9183, 9184 ], "referencedDeclaration": 9183, "src": "587:7:12", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 3005, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "587:36:12", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 3006, "nodeType": "ExpressionStatement", "src": "587:36:12" }, { "id": 3007, "nodeType": "PlaceholderStatement", "src": "633:1:12" } ] }, "documentation": null, "id": 3009, "name": "isEventContract", "nodeType": "ModifierDefinition", "parameters": { "id": 2999, "nodeType": "ParameterList", "parameters": [], "src": "521:2:12" }, "src": "496:145:12", "visibility": "internal" }, { "body": { "id": 3017, "nodeType": "Block", "src": "784:43:12", "statements": [ { "expression": { "argumentTypes": null, "id": 3015, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 3012, "name": "eventContract", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2998, "src": "794:13:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 3013, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9180, "src": "810:3:12", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 3014, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "810:10:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "794:26:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 3016, "nodeType": "ExpressionStatement", "src": "794:26:12" } ] }, "documentation": "@dev Constructor sets events contract address", "id": 3018, "implemented": true, "isConstructor": true, "isDeclaredConst": false, "modifiers": [], "name": "OutcomeToken", "nodeType": "FunctionDefinition", "parameters": { "id": 3010, "nodeType": "ParameterList", "parameters": [], "src": "762:2:12" }, "payable": false, "returnParameters": { "id": 3011, "nodeType": "ParameterList", "parameters": [], "src": "784:0:12" }, "scope": 3085, "src": "741:86:12", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 3050, "nodeType": "Block", "src": "1108:172:12", "statements": [ { "expression": { "argumentTypes": null, "id": 3036, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "id": 3027, "name": "balances", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3097, "src": "1118:8:12", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, "id": 3029, "indexExpression": { "argumentTypes": null, "id": 3028, "name": "_for", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3020, "src": "1127:4:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "1118:14:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 3034, "name": "outcomeTokenCount", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3022, "src": "1154:17:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "id": 3030, "name": "balances", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3097, "src": "1135:8:12", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, "id": 3032, "indexExpression": { "argumentTypes": null, "id": 3031, "name": "_for", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3020, "src": "1144:4:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", "src": "1135:14:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 3033, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "add", "nodeType": "MemberAccess", "referencedDeclaration": 4417, "src": "1135:18:12", "typeDescriptions": { "typeIdentifier": "t_function_delegatecall_view$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", "typeString": "function (uint256,uint256) view returns (uint256)" } }, "id": 3035, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1135:37:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1118:54:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 3037, "nodeType": "ExpressionStatement", "src": "1118:54:12" }, { "expression": { "argumentTypes": null, "id": 3043, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 3038, "name": "totalTokens", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3105, "src": "1182:11:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 3041, "name": "outcomeTokenCount", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3022, "src": "1212:17:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "argumentTypes": null, "id": 3039, "name": "totalTokens", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3105, "src": "1196:11:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 3040,