Contract 0x89efe605e9ec...cc946c26f8f3
WalletThis contract is not yet documented
Know something about this contract? Switch to the History tab and suggest an edit to help preserve Ethereum history.
Key Facts
Heuristic Analysis
The following characteristics were detected through bytecode analysis and may not be accurate.
Frontier Era
The initial release of Ethereum. A bare-bones implementation for technical users.
Bytecode Overview
Verified Source Available
This contract has verified source code on Etherscan.
Show source code (Solidity)
{
"language": "Solidity",
"sources": {
"AccountingLib.sol": {
"content": "// Accounting v0.1 (not the same as the 0.1 release of this library)\r\n\r\n/// @title Accounting Lib - Accounting utilities\r\n/// @author Piper Merriam - <pipermerriam@gmail.com>\r\nlibrary AccountingLib {\r\n /*\r\n * Address: 0x89efe605e9ecbe22849cd85d5449cc946c26f8f3\r\n */\r\n struct Bank {\r\n mapping (address => uint) accountBalances;\r\n }\r\n\r\n /// @dev Low level method for adding funds to an account. Protects against overflow.\r\n /// @param self The Bank instance to operate on.\r\n /// @param accountAddress The address of the account the funds should be added to.\r\n /// @param value The amount that should be added to the account.\r\n function addFunds(Bank storage self, address accountAddress, uint value) public {\r\n if (self.accountBalances[accountAddress] + value < self.accountBalances[accountAddress]) {\r\n // Prevent Overflow.\r\n throw;\r\n }\r\n self.accountBalances[accountAddress] += value;\r\n }\r\n\r\n event _Deposit(address indexed _from, address indexed accountAddress, uint value);\r\n /// @dev Function wrapper around the _Deposit event so that it can be used by contracts. Can be used to log a deposit to an account.\r\n /// @param _from The address that deposited the funds.\r\n /// @param accountAddress The address of the account the funds were added to.\r\n /// @param value The amount that was added to the account.\r\n function Deposit(address _from, address accountAddress, uint value) public {\r\n _Deposit(_from, accountAddress, value);\r\n }\r\n\r\n\r\n /// @dev Safe function for depositing funds. Returns boolean for whether the deposit was successful\r\n /// @param self The Bank instance to operate on.\r\n /// @param accountAddress The address of the account the funds should be added to.\r\n /// @param value The amount that should be added to the account.\r\n function deposit(Bank storage self, address accountAddress, uint value) public returns (bool) {\r\n addFunds(self, accountAddress, value);\r\n return true;\r\n }\r\n\r\n event _Withdrawal(address indexed accountAddress, uint value);\r\n\r\n /// @dev Function wrapper around the _Withdrawal event so that it can be used by contracts. Can be used to log a withdrawl from an account.\r\n /// @param accountAddress The address of the account the funds were withdrawn from.\r\n /// @param value The amount that was withdrawn to the account.\r\n function Withdrawal(address accountAddress, uint value) public {\r\n _Withdrawal(accountAddress, value);\r\n }\r\n\r\n event _InsufficientFunds(address indexed accountAddress, uint value, uint balance);\r\n\r\n /// @dev Function wrapper around the _InsufficientFunds event so that it can be used by contracts. Can be used to log a failed withdrawl from an account.\r\n /// @param accountAddress The address of the account the funds were to be withdrawn from.\r\n /// @param value The amount that was attempted to be withdrawn from the account.\r\n /// @param balance The current balance of the account.\r\n function InsufficientFunds(address accountAddress, uint value, uint balance) public {\r\n _InsufficientFunds(accountAddress, value, balance);\r\n }\r\n\r\n /// @dev Low level method for removing funds from an account. Protects against underflow.\r\n /// @param self The Bank instance to operate on.\r\n /// @param accountAddress The address of the account the funds should be deducted from.\r\n /// @param value The amount that should be deducted from the account.\r\n function deductFunds(Bank storage self, address accountAddress, uint value) public {\r\n /*\r\n * Helper function that should be used for any reduction of\r\n * account funds. It has error checking to prevent\r\n * underflowing the account balance which would be REALLY bad.\r\n */\r\n if (value > self.accountBalances[accountAddress]) {\r\n // Prevent Underflow.\r\n throw;\r\n }\r\n self.accountBalances[accountAddress] -= value;\r\n }\r\n\r\n /// @dev Safe function for withdrawing funds. Returns boolean for whether the deposit was successful as well as sending the amount in ether to the account address.\r\n /// @param self The Bank instance to operate on.\r\n /// @param accountAddress The address of the account the funds should be withdrawn from.\r\n /// @param value The amount that should be withdrawn from the account.\r\n function withdraw(Bank storage self, address accountAddress, uint value) public returns (bool) {\r\n /*\r\n * Public API for withdrawing funds.\r\n */\r\n if (self.accountBalances[accountAddress] >= value) {\r\n deductFunds(self, accountAddress, value);\r\n if (!accountAddress.send(value)) {\r\n // Potentially sending money to a contract that\r\n // has a fallback function. So instead, try\r\n // tranferring the funds with the call api.\r\n if (!accountAddress.call.value(value)()) {\r\n // Revert the entire transaction. No\r\n // need to destroy the funds.\r\n throw;\r\n }\r\n }\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n uint constant DEFAULT_SEND_GAS = 100000;\r\n\r\n function sendRobust(address toAddress, uint value) public returns (bool) {\r\n if (msg.gas < DEFAULT_SEND_GAS) {\r\n return sendRobust(toAddress, value, msg.gas);\r\n }\r\n return sendRobust(toAddress, value, DEFAULT_SEND_GAS);\r\n }\r\n\r\n function sendRobust(address toAddress, uint value, uint maxGas) public returns (bool) {\r\n if (value > 0 && !toAddress.send(value)) {\r\n // Potentially sending money to a contract that\r\n // has a fallback function. So instead, try\r\n // tranferring the funds with the call api.\r\n if (!toAddress.call.gas(maxGas).value(value)()) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n}"
}
},
"settings": {
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"compilationTarget": {
"AccountingLib.sol": "AccountingLib"
}
}
}External Links
Related contracts
MemberRegistry
Same deployerOwner-controlled dynamic-array member registry.
0x1f3b19...7c161aAugust 13, 2015Members
Same deployerOwner-controlled member registry with array + mapping tracking.
0xaeb2ac...a5fd37August 14, 2015MembershipRoster
Same deployerAn Ethereum Public Trust roster contract for adding, removing, and checking members.
0xf1d327...aa0455August 14, 2015KillMul
Same deployerTest/utility contract with `suicide(address)` kill switch and a `multiply2` helper.
0x3e5e1f...7c78cdAugust 14, 2015Members
Same deployerOwner-controlled member registry using sequential id + mapping storage.
0xc6810e...db4e6fAugust 14, 2015EthereumAlarmClock
Same deployerThe first deployment of Piper Merriam's Ethereum Alarm Clock, a smart contract protocol for scheduling transactions at future block numbers, launched on Septemb
0xb0059e...cc0cc1September 22, 2015