Created
February 15, 2025 14:35
-
-
Save rfikki/4e5d6c41a9968470f086d67fb3952eb5 to your computer and use it in GitHub Desktop.
Source Verification for Etherscan.io Contract: 0x8494F777d13503BE928BB22b1F4ae3289E634FD3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Submitted to Etherscan.io for verification for contract at 0x8494F777d13503BE928BB22b1F4ae3289E634FD3 | |
/* rfikki was here in 2015 */ | |
contract currency { | |
struct Account { | |
uint balance; | |
mapping ( address => uint) withdrawers; | |
} | |
mapping ( address => Account ) accounts; | |
event CoinSent(address indexed from, uint256 value, address indexed to); | |
/* Set Currency Maximum Balance */ | |
function currency() { | |
accounts[msg.sender].balance = 1000000000000; /* There will forever be a maximum one trillion tokens */ | |
} | |
/* Send _value amount of coins to address _to */ | |
function sendCoin(uint _value, address _to) returns (bool _success) { | |
if (accounts[msg.sender].balance >= _value && _value < 340282366920938463463374607431768211456) { | |
accounts[msg.sender].balance -= _value; | |
accounts[_to].balance += _value; | |
CoinSent(msg.sender, _value, _to); | |
_success = true; | |
} | |
else _success = false; | |
} | |
/* Send _value amount of coins from address _from to address _to */ | |
function sendCoinFrom(address _from, uint _value, address _to) returns (bool _success) { | |
uint auth = accounts[_from].withdrawers[msg.sender]; | |
if (accounts[_from].balance >= _value && auth >= _value && _value < 340282366920938463463374607431768211456) { | |
accounts[_from].withdrawers[msg.sender] -= _value; | |
accounts[_from].balance -= _value; | |
accounts[_to].balance += _value; | |
CoinSent(_from, _value, _to); | |
_success = true; | |
_success = true; | |
} | |
else _success = false; | |
} | |
/* Get your coin balance */ | |
function coinBalance() constant returns (uint _r) { | |
_r = accounts[msg.sender].balance; | |
} | |
/* Get the coin balance of another account with address _addr */ | |
function coinBalanceOf(address _addr) constant returns (uint _r) { | |
_r = accounts[_addr].balance; | |
} | |
/* Allow _addr to direct debit from your account with full custody. Only implement if absolutely required and use carefully. See approveOnce below for a more limited method. */ | |
function approve(address _addr) { | |
accounts[msg.sender].withdrawers[_addr] = 340282366920938463463374607431768211456; | |
} | |
/* Returns 1 if _proxy is allowed to direct debit from your account */ | |
function isApproved(address _proxy) returns (bool _r) { | |
_r = (accounts[msg.sender].withdrawers[_proxy] > 0); | |
} | |
/* Makes a one-time approval for _addr to send a maximum amount of currency equal to _maxValue */ | |
function approveOnce(address _addr, uint256 _maxValue) { | |
accounts[msg.sender].withdrawers[_addr] += _maxValue; | |
} | |
/* Disapprove address _addr to direct debit from your account if it was previously approved. Must reset both one-time and full custody approvals. */ | |
function disapprove(address _addr) { | |
accounts[msg.sender].withdrawers[_addr] = 0; /* We Disapprove - 2015 - Aug - 24 Proposed ERC20 Standard - Not Final*/ | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6060604052361561006c5760e060020a600035046315770d99811461006e578063673448dd146100a157806367eae672146100dc578063930b7a2314610252578063bbd39ac01461028b578063c86a90fe146102ab578063d26c8a8a14610342578063daea85c514610360575b005b61006c600435600160a060020a033381166000908152602081815260408083209385168352600190930190529081205550565b33600160a060020a039081166000908152602081815260408083206004359490941683526001909301905290812054115b6060908152602090f35b6100d2600435602435604435600160a060020a0380841660008181526020818152604080832033959095168352600185018252822054928252819052915484901080159061012a5750838110155b80156101395750608060020a84105b1561024a57836000600050600087600160a060020a03168152602001908152602001600020600050600101600050600033600160a060020a03168152602001908152602001600020600082828250540392505081905550836000600050600087600160a060020a03168152602001908152602001600020600050600001600082828250540392505081905550836000600050600085600160a060020a0316815260200190815260200160002060005060000160008282825054019250508190555082600160a060020a031685600160a060020a03167fa9ba2cffdaa9586597138c75c9ed44a43a3d45760a05b942dd6db22f58c8690c866040518082815260200191505060405180910390a3600191505b509392505050565b33600160a060020a039081166000908152602081815260408083206004359490941683526001909301905220805460243501905561006c565b600160a060020a03600435166000908152602081905260409020546100d2565b6100d2600435602435600160a060020a0333166000908152602081905260408120548390108015906102e05750608060020a83105b1561033c57604080822080548590039055600160a060020a03838116808452918320805486019055606085815233909116907fa9ba2cffdaa9586597138c75c9ed44a43a3d45760a05b942dd6db22f58c8690c90602090a35060015b92915050565b33600160a060020a03166000908152602081905260409020546100d2565b61006c600435600160a060020a0333811660009081526020818152604080832093851683526001909301905220608060020a90555056 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Solidity version: 0.1.3-0/.-/clang/int linked to libethereum-0.9.92-0/.-/clang/int | |
Change to: | |
v0.1.3+commit.028f561d | |
Enable Optimization | |
These settings from: https://chriseth.github.io/browser-solidity/#version=soljson-v0.1.3+commit.028f561d.js&optimize=true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment