UNPKG

dc-protocol

Version:

Start ganache and deploy our contracts

1,054 lines 399 kB
{ "contractName": "ERC20Token", "abi": [ { "constant": true, "inputs": [], "name": "totalSupply", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "_owner", "type": "address" } ], "name": "balanceOf", "outputs": [ { "name": "balance", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "_to", "type": "address" }, { "name": "_amount", "type": "uint256" } ], "name": "transfer", "outputs": [ { "name": "success", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "_spender", "type": "address" }, { "name": "_amount", "type": "uint256" } ], "name": "approve", "outputs": [ { "name": "success", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "_from", "type": "address" }, { "name": "_to", "type": "address" }, { "name": "_amount", "type": "uint256" } ], "name": "transferFrom", "outputs": [ { "name": "success", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "name": "_owner", "type": "address" }, { "name": "_spender", "type": "address" } ], "name": "allowance", "outputs": [ { "name": "remaining", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" } ], "bytecode": "0x60806040526000805534801561001457600080fd5b5061049a806100246000396000f3006080604052600436106100775763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b3811461007c57806318160ddd146100b457806323b872dd146100db57806370a0823114610105578063a9059cbb14610126578063dd62ed3e1461014a575b600080fd5b34801561008857600080fd5b506100a0600160a060020a0360043516602435610171565b604080519115158252519081900360200190f35b3480156100c057600080fd5b506100c96101dc565b60408051918252519081900360200190f35b3480156100e757600080fd5b506100a0600160a060020a03600435811690602435166044356101e2565b34801561011157600080fd5b506100c9600160a060020a036004351661033e565b34801561013257600080fd5b506100a0600160a060020a0360043516602435610359565b34801561015657600080fd5b506100c9600160a060020a0360043581169060243516610422565b60008115806101a15750336000908152600260209081526040808320600160a060020a0387168452909152902054155b15156101ac57600080fd5b50336000908152600260209081526040808320600160a060020a0386168452909152902081905560015b92915050565b60005490565b600160a060020a038316600090815260016020526040812054821180159061022d5750600160a060020a03841660009081526002602090815260408083203384529091529020548211155b80156102395750600082115b801561025e5750600160a060020a038316600090815260016020526040902054828101115b1561033357600160a060020a03841660009081526001602052604090205461028c908363ffffffff61044d16565b600160a060020a03851660009081526001602090815260408083209390935560028152828220338352905220546102c9908363ffffffff61044d16565b600160a060020a03808616600090815260026020908152604080832033845282528083209490945591861681526001909152205461030d908363ffffffff61045f16565b600160a060020a0384166000908152600160208190526040909120919091559050610337565b5060005b9392505050565b600160a060020a031660009081526001602052604090205490565b3360009081526001602052604081205482118015906103785750600082115b801561039d5750600160a060020a038316600090815260016020526040902054828101115b1561041a57336000908152600160205260409020546103c2908363ffffffff61044d16565b3360009081526001602052604080822092909255600160a060020a038516815220546103f4908363ffffffff61045f16565b600160a060020a03841660009081526001602081905260409091209190915590506101d6565b5060006101d6565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60008282111561045957fe5b50900390565b60008282018381101561033757fe00a165627a7a72305820586513bb28017762c4cdf365fe1e6fa78d718094fe29418bcebff37a7245f29b0029", "deployedBytecode": "0x6080604052600436106100775763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b3811461007c57806318160ddd146100b457806323b872dd146100db57806370a0823114610105578063a9059cbb14610126578063dd62ed3e1461014a575b600080fd5b34801561008857600080fd5b506100a0600160a060020a0360043516602435610171565b604080519115158252519081900360200190f35b3480156100c057600080fd5b506100c96101dc565b60408051918252519081900360200190f35b3480156100e757600080fd5b506100a0600160a060020a03600435811690602435166044356101e2565b34801561011157600080fd5b506100c9600160a060020a036004351661033e565b34801561013257600080fd5b506100a0600160a060020a0360043516602435610359565b34801561015657600080fd5b506100c9600160a060020a0360043581169060243516610422565b60008115806101a15750336000908152600260209081526040808320600160a060020a0387168452909152902054155b15156101ac57600080fd5b50336000908152600260209081526040808320600160a060020a0386168452909152902081905560015b92915050565b60005490565b600160a060020a038316600090815260016020526040812054821180159061022d5750600160a060020a03841660009081526002602090815260408083203384529091529020548211155b80156102395750600082115b801561025e5750600160a060020a038316600090815260016020526040902054828101115b1561033357600160a060020a03841660009081526001602052604090205461028c908363ffffffff61044d16565b600160a060020a03851660009081526001602090815260408083209390935560028152828220338352905220546102c9908363ffffffff61044d16565b600160a060020a03808616600090815260026020908152604080832033845282528083209490945591861681526001909152205461030d908363ffffffff61045f16565b600160a060020a0384166000908152600160208190526040909120919091559050610337565b5060005b9392505050565b600160a060020a031660009081526001602052604090205490565b3360009081526001602052604081205482118015906103785750600082115b801561039d5750600160a060020a038316600090815260016020526040902054828101115b1561041a57336000908152600160205260409020546103c2908363ffffffff61044d16565b3360009081526001602052604080822092909255600160a060020a038516815220546103f4908363ffffffff61045f16565b600160a060020a03841660009081526001602081905260409091209190915590506101d6565b5060006101d6565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60008282111561045957fe5b50900390565b60008282018381101561033757fe00a165627a7a72305820586513bb28017762c4cdf365fe1e6fa78d718094fe29418bcebff37a7245f29b0029", "sourceMap": "1646:4417:16:-;;;1905:1;1882:24;;1646:4417;8:9:-1;5:2;;;30:1;27;20:12;5:2;1646:4417:16;;;;;;;", "deployedSourceMap": "1646:4417:16:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4066:622;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4066:622:16;-1:-1:-1;;;;;4066:622:16;;;;;;;;;;;;;;;;;;;;;;;;;2644:89;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2644:89:16;;;;;;;;;;;;;;;;;;;;5050:565;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;5050:565:16;-1:-1:-1;;;;;5050:565:16;;;;;;;;;;;;2969:113;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2969:113:16;-1:-1:-1;;;;;2969:113:16;;;;;3316:394;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3316:394:16;-1:-1:-1;;;;;3316:394:16;;;;;;;5895:165;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;5895:165:16;-1:-1:-1;;;;;5895:165:16;;;;;;;;;;4066:622;4165:12;4556;;;4555:54;;-1:-1:-1;4582:10:16;4574:19;;;;:7;:19;;;;;;;;-1:-1:-1;;;;;4574:29:16;;;;;;;;;;:34;4555:54;4547:63;;;;;;;;-1:-1:-1;4629:10:16;4621:19;;;;:7;:19;;;;;;;;-1:-1:-1;;;;;4621:29:16;;;;;;;;;:39;;;4677:4;4066:622;;;;;:::o;2644:89::-;2688:7;2714:12;2644:89;:::o;5050:565::-;-1:-1:-1;;;;;5205:15:16;;5172:12;5205:15;;;:8;:15;;;;;;:26;-1:-1:-1;5205:26:16;;;:67;;-1:-1:-1;;;;;;5235:14:16;;;;;;:7;:14;;;;;;;;5250:10;5235:26;;;;;;;;:37;-1:-1:-1;5235:37:16;5205:67;:82;;;;;5286:1;5276:7;:11;5205:82;:125;;;;-1:-1:-1;;;;;;5317:13:16;;;;;;:8;:13;;;;;;5291:23;;;:39;5205:125;5201:408;;;-1:-1:-1;;;;;5364:15:16;;;;;;:8;:15;;;;;;:28;;5384:7;5364:28;:19;:28;:::i;:::-;-1:-1:-1;;;;;5346:15:16;;;;;;:8;:15;;;;;;;;:46;;;;5435:7;:14;;;;;5450:10;5435:26;;;;;;:39;;5466:7;5435:39;:30;:39;:::i;:::-;-1:-1:-1;;;;;5406:14:16;;;;;;;:7;:14;;;;;;;;5421:10;5406:26;;;;;;;:68;;;;5504:13;;;;;:8;:13;;;;;:26;;5522:7;5504:26;:17;:26;:::i;:::-;-1:-1:-1;;;;;5488:13:16;;;;;;:8;:13;;;;;;;;:42;;;;:8;-1:-1:-1;5544:11:16;;5201:408;-1:-1:-1;5593:5:16;5201:408;5050:565;;;;;:::o;2969:113::-;-1:-1:-1;;;;;3059:16:16;3025:15;3059:16;;;:8;:16;;;;;;;2969:113::o;3316:394::-;3417:10;3380:12;3408:20;;;:8;:20;;;;;;:31;-1:-1:-1;3408:31:16;;;:46;;;3453:1;3443:7;:11;3408:46;:89;;;;-1:-1:-1;;;;;;3484:13:16;;;;;;:8;:13;;;;;;3458:23;;;:39;3408:89;3404:300;;;3545:10;3536:20;;;;:8;:20;;;;;;:33;;3561:7;3536:33;:24;:33;:::i;:::-;3522:10;3513:20;;;;:8;:20;;;;;;:56;;;;-1:-1:-1;;;;;3599:13:16;;;;;;:26;;3617:7;3599:26;:17;:26;:::i;:::-;-1:-1:-1;;;;;3583:13:16;;;;;;:8;:13;;;;;;;;:42;;;;:8;-1:-1:-1;3639:11:16;;3404:300;-1:-1:-1;3688:5:16;3681:12;;5895:165;-1:-1:-1;;;;;6028:15:16;;;5992:17;6028:15;;;:7;:15;;;;;;;;:25;;;;;;;;;;;;;5895:165::o;865:110:11:-;923:7;945:6;;;;938:14;;;;-1:-1:-1;965:5:11;;;865:110::o;1035:129::-;1093:7;1120:5;;;1138:6;;;;1131:14;;", "source": "pragma solidity ^0.4.11;\n\n// ----------------------------------------------------------------------------\n// Dao.Casino Crowdsale Token Contract\n//\n// NOTE: This is the new Dao.Casino token contract as the old Dao.Casino\n// crowdsale/token contract was attached to a buggy Parity multisig that\n// was vulnerable to hackers\n//\n// Enjoy. (c) BokkyPooBah / Bok Consulting Pty Ltd for Dao.Casino 2017\n// The MIT Licence.\n// ----------------------------------------------------------------------------\n\n\n// ----------------------------------------------------------------------------\n// Safe maths, borrowed from OpenZeppelin\n// ----------------------------------------------------------------------------\nimport '../library/SafeMath.sol';\n\n\n// ----------------------------------------------------------------------------\n// Owned contract\n// ----------------------------------------------------------------------------\ncontract Owned {\n address public owner;\n address public newOwner;\n\n constructor() public {\n owner = msg.sender;\n }\n\n modifier onlyOwner {\n require(msg.sender == owner);\n _;\n }\n\n function transferOwnership(address _newOwner) public onlyOwner {\n newOwner = _newOwner;\n }\n \n function acceptOwnership() public {\n if (msg.sender == newOwner) {\n owner = newOwner;\n }\n }\n}\n\n// ----------------------------------------------------------------------------\n// ERC20 Token, with the addition of symbol, name and decimals\n// https://github.com/ethereum/EIPs/issues/20\n// ----------------------------------------------------------------------------\ncontract ERC20Token {\n using SafeMath for uint;\n\n // ------------------------------------------------------------------------\n // Total Supply\n // ------------------------------------------------------------------------\n uint256 _totalSupply = 0;\n\n // ------------------------------------------------------------------------\n // Balances for each account\n // ------------------------------------------------------------------------\n mapping(address => uint256) balances;\n\n // ------------------------------------------------------------------------\n // Owner of account approves the transfer of an amount to another account\n // ------------------------------------------------------------------------\n mapping(address => mapping (address => uint256)) allowed;\n\n // ------------------------------------------------------------------------\n // Get the total token supply\n // ------------------------------------------------------------------------\n function totalSupply() public view returns (uint256) {\n return _totalSupply;\n }\n\n // ------------------------------------------------------------------------\n // Get the account balance of another account with address _owner\n // ------------------------------------------------------------------------\n function balanceOf(address _owner) public view returns (uint256 balance) {\n return balances[_owner];\n }\n\n // ------------------------------------------------------------------------\n // Transfer the balance from owner's account to another account\n // ------------------------------------------------------------------------\n function transfer(address _to, uint256 _amount) public returns (bool success) {\n if (balances[msg.sender] >= _amount && _amount > 0 && balances[_to] + _amount > balances[_to]) {\n balances[msg.sender] = balances[msg.sender].sub(_amount);\n balances[_to] = balances[_to].add(_amount);\n return true;\n } else {\n return false;\n }\n }\n\n // ------------------------------------------------------------------------\n // Allow _spender to withdraw from your account, multiple times, up to the\n // _value amount. If this function is called again it overwrites the\n // current allowance with _value.\n // ------------------------------------------------------------------------\n function approve(\n address _spender,\n uint256 _amount\n ) \n public returns (bool success) \n {\n // Borrowed from the MiniMeToken contract\n // To change the approve amount you first have to reduce the addresses`\n // allowance to zero by calling `approve(_spender,0)` if it is not\n // already 0 to mitigate the race condition described here:\n // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n require((_amount == 0) || (allowed[msg.sender][_spender] == 0));\n\n allowed[msg.sender][_spender] = _amount;\n return true;\n }\n\n // ------------------------------------------------------------------------\n // Spender of tokens transfer an amount of tokens from the token owner's\n // balance to the spender's account. The owner of the tokens must already\n // have approve(...)-d this transfer\n // ------------------------------------------------------------------------\n function transferFrom(\n address _from,\n address _to,\n uint256 _amount\n ) \n public returns (bool success) \n {\n if (balances[_from] >= _amount && allowed[_from][msg.sender] >= _amount && _amount > 0 && balances[_to] + _amount > balances[_to]) {\n balances[_from] = balances[_from].sub(_amount);\n allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);\n balances[_to] = balances[_to].add(_amount);\n return true;\n } else {\n return false;\n }\n }\n\n // ------------------------------------------------------------------------\n // Returns the amount of tokens approved by the owner that can be\n // transferred to the spender's account\n // ------------------------------------------------------------------------\n function allowance(\n address _owner, \n address _spender\n ) public view returns (uint256 remaining)\n {\n return allowed[_owner][_spender];\n }\n\n}\n\n\ncontract ERC20 is ERC20Token, Owned {\n\n // ------------------------------------------------------------------------\n // Token information\n // ------------------------------------------------------------------------\n string public constant name = \"TEST BET\";\n string public constant symbol = \"BET\";\n uint8 public constant decimals = 18;\n\n constructor() public {\n }\n\n // ------------------------------------------------------------------------\n // Only for testing in testnet\n // ------------------------------------------------------------------------\n function faucet() public {\n balances[msg.sender] = balances[msg.sender].add(10000 ether);\n _totalSupply = _totalSupply.add(10000 ether);\n }\n\n // ------------------------------------------------------------------------\n // Owner can transfer out any accidentally sent ERC20 tokens\n // ------------------------------------------------------------------------\n function transferAnyERC20Token(address tokenAddress, uint amount)\n public onlyOwner returns (bool success) \n {\n return ERC20Token(tokenAddress).transfer(owner, amount);\n }\n}", "sourcePath": "/Users/fanyshu/Documents/Projects/DCLabs/monorepo/packages/dc-sdk-example/dapp/contracts/token/ERC20.sol", "ast": { "absolutePath": "/Users/fanyshu/Documents/Projects/DCLabs/monorepo/packages/dc-sdk-example/dapp/contracts/token/ERC20.sol", "exportedSymbols": { "ERC20": [ 3262 ], "ERC20Token": [ 3200 ], "Owned": [ 2962 ] }, "id": 3263, "nodeType": "SourceUnit", "nodes": [ { "id": 2910, "literals": [ "solidity", "^", "0.4", ".11" ], "nodeType": "PragmaDirective", "src": "0:24:16" }, { "absolutePath": "/Users/fanyshu/Documents/Projects/DCLabs/monorepo/packages/dc-sdk-example/dapp/contracts/library/SafeMath.sol", "file": "../library/SafeMath.sol", "id": 2911, "nodeType": "ImportDirective", "scope": 3263, "sourceUnit": 1928, "src": "713:33:16", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 2962, "linearizedBaseContracts": [ 2962 ], "name": "Owned", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 2913, "name": "owner", "nodeType": "VariableDeclaration", "scope": 2962, "src": "948:20:16", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2912, "name": "address", "nodeType": "ElementaryTypeName", "src": "948:7:16", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 2915, "name": "newOwner", "nodeType": "VariableDeclaration", "scope": 2962, "src": "974:23:16", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2914, "name": "address", "nodeType": "ElementaryTypeName", "src": "974:7:16", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "public" }, { "body": { "id": 2923, "nodeType": "Block", "src": "1025:35:16", "statements": [ { "expression": { "argumentTypes": null, "id": 2921, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2918, "name": "owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2913, "src": "1035:5:16", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 2919, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3277, "src": "1043:3:16", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 2920, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1043:10:16", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "1035:18:16", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 2922, "nodeType": "ExpressionStatement", "src": "1035:18:16" } ] }, "documentation": null, "id": 2924, "implemented": true, "isConstructor": true, "isDeclaredConst": false, "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 2916, "nodeType": "ParameterList", "parameters": [], "src": "1015:2:16" }, "payable": false, "returnParameters": { "id": 2917, "nodeType": "ParameterList", "parameters": [], "src": "1025:0:16" }, "scope": 2962, "src": "1004:56:16", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 2934, "nodeType": "Block", "src": "1085:56:16", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 2930, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 2927, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3277, "src": "1103:3:16", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 2928, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1103:10:16", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 2929, "name": "owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2913, "src": "1117:5:16", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "1103:19:16", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 2926, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 3280, 3281 ], "referencedDeclaration": 3280, "src": "1095:7:16", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 2931, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1095:28:16", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2932, "nodeType": "ExpressionStatement", "src": "1095:28:16" }, { "id": 2933, "nodeType": "PlaceholderStatement", "src": "1133:1:16" } ] }, "documentation": null, "id": 2935, "name": "onlyOwner", "nodeType": "ModifierDefinition", "parameters": { "id": 2925, "nodeType": "ParameterList", "parameters": [], "src": "1085:0:16" }, "src": "1066:75:16", "visibility": "internal" }, { "body": { "id": 2946, "nodeType": "Block", "src": "1210:37:16", "statements": [ { "expression": { "argumentTypes": null, "id": 2944, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2942, "name": "newOwner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2915, "src": "1220:8:16", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 2943, "name": "_newOwner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2937, "src": "1231:9:16", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "1220:20:16", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 2945, "nodeType": "ExpressionStatement", "src": "1220:20:16" } ] }, "documentation": null, "id": 2947, "implemented": true, "isConstructor": false, "isDeclaredConst": false, "modifiers": [ { "arguments": null, "id": 2940, "modifierName": { "argumentTypes": null, "id": 2939, "name": "onlyOwner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2935, "src": "1200:9:16", "typeDescriptions": { "typeIdentifier": "t_modifier$__$", "typeString": "modifier ()" } }, "nodeType": "ModifierInvocation", "src": "1200:9:16" } ], "name": "transferOwnership", "nodeType": "FunctionDefinition", "parameters": { "id": 2938, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2937, "name": "_newOwner", "nodeType": "VariableDeclaration", "scope": 2947, "src": "1174:17:16", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2936, "name": "address", "nodeType": "ElementaryTypeName", "src": "1174:7:16", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "1173:19:16" }, "payable": false, "returnParameters": { "id": 2941, "nodeType": "ParameterList", "parameters": [], "src": "1210:0:16" }, "scope": 2962, "src": "1147:100:16", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 2960, "nodeType": "Block", "src": "1288:85:16", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 2953, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 2950, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3277, "src": "1302:3:16", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 2951, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1302:10:16", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 2952, "name": "newOwner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2915, "src": "1316:8:16", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "1302:22:16", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 2959, "nodeType": "IfStatement", "src": "1298:69:16", "trueBody": { "id": 2958, "nodeType": "Block", "src": "1326:41:16", "statements": [ { "expression": { "argumentTypes": null, "id": 2956, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2954, "name": "owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2913, "src": "1340:5:16", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 2955, "name": "newOwner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2915, "src": "1348:8:16", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "1340:16:16", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 2957, "nodeType": "ExpressionStatement", "src": "1340:16:16" } ] } } ] }, "documentation": null, "id": 2961, "implemented": true, "isConstructor": false, "isDeclaredConst": false, "modifiers": [], "name": "acceptOwnership", "nodeType": "FunctionDefinition", "parameters": { "id": 2948, "nodeType": "ParameterList", "parameters": [], "src": "1278:2:16" }, "payable": false, "returnParameters": { "id": 2949, "nodeType": "ParameterList", "parameters": [], "src": "1288:0:16" }, "scope": 2962, "src": "1254:119:16", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" } ], "scope": 3263, "src": "927:448:16" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 3200, "linearizedBaseContracts": [ 3200 ], "name": "ERC20Token", "nodeType": "ContractDefinition", "nodes": [ { "id": 2965, "libraryName": { "contractScope": null, "id": 2963, "name": "SafeMath", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1927, "src": "1678:8:16", "typeDescriptions": { "typeIdentifier": "t_contract$_SafeMath_$1927", "typeString": "library SafeMath" } }, "nodeType": "UsingForDirective", "src": "1672:24:16", "typeName": { "id": 2964, "name": "uint", "nodeType": "ElementaryTypeName", "src": "1691:4:16", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, { "constant": false, "id": 2968, "name": "_totalSupply", "nodeType": "VariableDeclaration", "scope": 3200, "src": "1882:24:16", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2966, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1882:7:16", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": { "argumentTypes": null, "hexValue": "30", "id": 2967, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1905:1:16", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "visibility": "internal" }, { "constant": false, "id": 2972, "name": "balances", "nodeType": "VariableDeclaration", "scope": 3200, "src": "2106:36:16", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "typeName": { "id": 2971, "keyType": { "id": 2969, "name": "address", "nodeType": "ElementaryTypeName", "src": "2114:7:16", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Mapping", "src": "2106:27:16", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "valueType": { "id": 2970, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2125:7:16", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2978, "name": "allowed", "nodeType": "VariableDeclaration", "scope": 3200, "src": "2387:56:16", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", "typeString": "mapping(address => mapping(address => uint256))" }, "typeName": { "id": 2977, "keyType": { "id": 2973, "name": "address", "nodeType": "ElementaryTypeName", "src": "2395:7:16", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Mapping", "src": "2387:48:16", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", "typeString": "mapping(address => mapping(address => uint256))" }, "valueType": { "id": 2976, "keyType": { "id": 2974, "name": "address", "nodeType": "ElementaryTypeName", "src": "2415:7:16", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Mapping", "src": "2406:28:16", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "valueType": { "id": 2975, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2426:7:16", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } } }, "value": null, "visibility": "internal" }, { "body": { "id": 2985, "nodeType": "Block", "src": "2697:36:16", "statements": [ { "expression": { "argumentTypes": null, "id": 2983, "name": "_totalSupply", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2968, "src": "2714:12:16", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2982, "id": 2984, "nodeType": "Return", "src": "2707:19:16" } ] }, "documentation": null, "id": 2986, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "totalSupply", "nodeType": "FunctionDefinition", "parameters": { "id": 2979, "nodeType": "ParameterList", "parameters": [], "src": "2664:2:16" }, "payable": false, "returnParameters": { "id": 2982, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2981, "name": "", "nodeType": "VariableDeclaration", "scope": 2986, "src": "2688:7:16", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2980, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2688:7:16", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "2687:9:16" }, "scope": 3200, "src": "2644:89:16", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 2997, "nodeType": "Block", "src": "3042:40:16", "statements": [ { "expression": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "id": 2993, "name": "balances", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2972, "src": "3059:8:16", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, "id": 2995, "indexExpr