Verified contractPartial
MyNewBank
Address0x52c2d09acf0ef12c487ae0c20a92d4f9a4abbfd1
- Balance
0 ETH
- Transactions
28
- Compiler
solc 0.4.17
- Same code
Only this contract
Details
- Compiler
- solc 0.4.17+commit.bdeb9e52
- Language
- solidity
- Optimization
- No
- License
- Not stated
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 4,315,675
- Creation transaction
- 0x6500489950…842de832e3
MyNewBank.sol
pragma solidity ^0.4.17;
contract owned {
address public owner;
function owned() {
owner=msg.sender;
}
modifier onlyowner{
if (msg.sender!=owner)
throw;
_;
}
}
contract MyNewBank is owned {
address public owner;
mapping (address=>uint) public deposits;
function init() {
owner=msg.sender;
}
function() payable {
deposit();
}
function deposit() payable {
if (msg.value >= 100 finney)
deposits[msg.sender]+=msg.value;
else
throw;
}
function withdraw(uint amount) public onlyowner {
require(amount>0);
uint depo = deposits[msg.sender];
if (amount <= depo)
msg.sender.send(amount);
else
revert();
}
function kill() onlyowner {
if(this.balance==0) {
selfdestruct(msg.sender);
}
}
}Compiler settingsShow
{
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": false
},
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.