Contract
0xE575c9abD35Fa94F1949f7d559056bB66FddEB51
1
Contract Overview
Balance:
0 Ether
More Info
My Name Tag:
Not Available
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
JCBank
Compiler Version
v0.4.26+commit.4563c3fc
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2019-10-14 */ pragma solidity ^0.4.26; contract JCBank { mapping (address => uint) public balance; mapping (uint => bool) public got_flag; uint128 secret; constructor (uint128 init_secret) public { secret = init_secret; } function deposit() public payable { balance[msg.sender] += msg.value; } function withdraw(uint amount) public { require(balance[msg.sender] >= amount); msg.sender.call.value(amount)(); balance[msg.sender] -= amount; } function get_flag_1(uint128 guess) public view returns(string) { require(guess == secret); bytes memory h = new bytes(32); for (uint i = 0; i < 32; i++) { uint b = (secret >> (4 * i)) & 0xF; if (b < 10) { h[31 - i] = byte(b + 48); } else { h[31 - i] = byte(b + 87); } } return string(abi.encodePacked("flag{", h, "}")); } function get_flag_2(uint user_id) public { require(balance[msg.sender] > 1000000000000 ether); got_flag[user_id] = true; balance[msg.sender] = 0; } }
[{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"guess","type":"uint128"}],"name":"get_flag_1","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"user_id","type":"uint256"}],"name":"get_flag_2","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"deposit","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"got_flag","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"init_secret","type":"uint128"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]
Contract Creation Code
608060405234801561001057600080fd5b506040516020806107958339810180604052810190808051906020019092919050505080600260006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550506107198061007c6000396000f300608060405260043610610078576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461007d578063323ea5da146100aa578063c5bfdb1114610162578063d0e30db01461018f578063d82c61d814610199578063e3d670d7146101de575b600080fd5b34801561008957600080fd5b506100a860048036038101908080359060200190929190505050610235565b005b3480156100b657600080fd5b506100e760048036038101908080356fffffffffffffffffffffffffffffffff1690602001909291905050506102fe565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561012757808201518184015260208101905061010c565b50505050905090810190601f1680156101545780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561016e57600080fd5b5061018d6004803603810190808035906020019092919050505061059c565b005b610197610667565b005b3480156101a557600080fd5b506101c4600480360381019080803590602001909291905050506106b5565b604051808215151515815260200191505060405180910390f35b3480156101ea57600080fd5b5061021f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506106d5565b6040518082815260200191505060405180910390f35b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561028257600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168160405160006040518083038185875af19250505050806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555050565b606080600080600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16856fffffffffffffffffffffffffffffffff1614151561035457600080fd5b60206040519080825280601f01601f1916602001820160405280156103885781602001602082028038833980820191505090505b509250600091505b60208210156104d557600f82600402600260009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff169060020a9004166fffffffffffffffffffffffffffffffff169050600a81101561046057603081017f0100000000000000000000000000000000000000000000000000000000000000028383601f0381518110151561042b57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506104c8565b605781017f0100000000000000000000000000000000000000000000000000000000000000028383601f0381518110151561049757fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b8180600101925050610390565b8260405160200180807f666c61677b00000000000000000000000000000000000000000000000000000081525060050182805190602001908083835b6020831015156105365780518252602082019150602081019050602083039250610511565b6001836020036101000a038019825116818451168082178552505050505050905001807f7d000000000000000000000000000000000000000000000000000000000000008152506001019150506040516020818303038152906040529350505050919050565b6c0c9f2c9cd04674edea400000006000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115156105f557600080fd5b600180600083815260200190815260200160002060006101000a81548160ff02191690831515021790555060008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b346000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550565b60016020528060005260406000206000915054906101000a900460ff1681565b600060205280600052604060002060009150905054815600a165627a7a72305820156148ab8b6b0152761cc875555bed05335acdfdf2ee70f9b38a8cb82001af590029000000000000000000000000000000000175bddc0da1bd47369c47861f48c8ac
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000175bddc0da1bd47369c47861f48c8ac
-----Decoded View---------------
Arg [0] : init_secret (uint128): 1940577538063170034860903343625652396
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000175bddc0da1bd47369c47861f48c8ac
Deployed ByteCode Sourcemap
28:1153:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;347:177;;8:9:-1;5:2;;;30:1;27;20:12;5:2;347:177:0;;;;;;;;;;;;;;;;;;;;;;;;;;532:459;;8:9:-1;5:2;;;30:1;27;20:12;5:2;532:459:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;532:459:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;999:179;;8:9:-1;5:2;;;30:1;27;20:12;5:2;999:179:0;;;;;;;;;;;;;;;;;;;;;;;;;;254:85;;;;;;98:38;;8:9:-1;5:2;;;30:1;27;20:12;5:2;98:38:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;51:40;;8:9:-1;5:2;;;30:1;27;20:12;5:2;51:40:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;347:177;427:6;404:7;:19;412:10;404:19;;;;;;;;;;;;;;;;:29;;396:38;;;;;;;;445:10;:15;;467:6;445:31;;;;;;;;;;;;;;;;;;510:6;487:7;:19;495:10;487:19;;;;;;;;;;;;;;;;:29;;;;;;;;;;;347:177;:::o;532:459::-;587:6;643:14;689:6;729;623;;;;;;;;;;;614:15;;:5;:15;;;606:24;;;;;;;;670:2;660:13;;;;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;148:4;140:6;136:17;126:27;;0:157;660:13:0;;;;643:30;;698:1;689:10;;684:241;705:2;701:1;:6;684:241;;;760:3;754:1;750;:5;739:6;;;;;;;;;;;:17;;;;;;;738:25;729:34;;;;786:2;782:1;:6;778:136;;;830:2;826:1;:6;821:12;;809:1;816;811:2;:6;809:9;;;;;;;;;;;;;;:24;;;;;;;;;;;778:136;;;895:2;891:1;:6;886:12;;874:1;881;876:2;:6;874:9;;;;;;;;;;;;;;:24;;;;;;;;;;;778:136;709:3;;;;;;;684:241;;;975:1;949:33;;;;;;;;;;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;949:33:0;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;949:33:0;;;935:48;;532:459;;;;;;:::o;999:179::-;1081:19;1059:7;:19;1067:10;1059:19;;;;;;;;;;;;;;;;:41;1051:50;;;;;;;;1132:4;1112:8;:17;1121:7;1112:17;;;;;;;;;;;;:24;;;;;;;;;;;;;;;;;;1169:1;1147:7;:19;1155:10;1147:19;;;;;;;;;;;;;;;:23;;;;999:179;:::o;254:85::-;322:9;299:7;:19;307:10;299:19;;;;;;;;;;;;;;;;:32;;;;;;;;;;;254:85::o;98:38::-;;;;;;;;;;;;;;;;;;;;;;:::o;51:40::-;;;;;;;;;;;;;;;;;:::o
Swarm Source
bzzr://156148ab8b6b0152761cc875555bed05335acdfdf2ee70f9b38a8cb82001af59
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.