Address Contract Partially Verified
Address
0x90162f41886c0946D09999736f1C15c8a105A421
Balance
0 ETH
Nonce
1
Code Size
6560 bytes
Creator
0x69A009FF...1069 at tx 0x179d278f...de8a59
Indexed Transactions
0
Contract Bytecode
6560 bytes
0x6080604052600436106101715763ffffffff60e060020a60003504166306fdde03811461023557806307da68f51461025c578063095ea7b31461027157806313af4035146102a957806318160ddd146102ca57806323b872dd146102df578063313ce567146103095780633cebb8231461031e57806340c10f191461033f57806342966c68146103635780635ac801fe1461037b57806370a082311461039357806375f12b21146103b45780637a9e5e4b146103c95780638da5cb5b146103ea57806395d89b411461041b5780639dc29fac14610430578063a0712d6814610454578063a9059cbb1461046c578063ab67aa5814610490578063b753a98c146104ff578063bb35783b14610523578063be45fd621461054d578063be9a6555146105b6578063bf7e214f146105cb578063cae9ca51146105e0578063daea85c514610649578063dd62ed3e1461066a578063df8de3e714610691578063f2d5d56b146106b2578063f77c4791146106d6575b60085461018690600160a060020a03166106eb565b1561022e57600854604080517ff48c30540000000000000000000000000000000000000000000000000000000081523360048201529051600160a060020a039092169163f48c3054913491602480830192602092919082900301818588803b1580156101f157600080fd5b505af1158015610205573d6000803e3d6000fd5b50505050506040513d602081101561021c57600080fd5b5051151561022957600080fd5b610233565b600080fd5b005b34801561024157600080fd5b5061024a610718565b60408051918252519081900360200190f35b34801561026857600080fd5b5061023361071e565b34801561027d57600080fd5b50610295600160a060020a03600435166024356107b8565b604080519115158252519081900360200190f35b3480156102b557600080fd5b50610233600160a060020a0360043516610894565b3480156102d657600080fd5b5061024a610912565b3480156102eb57600080fd5b50610295600160a060020a0360043581169060243516604435610918565b34801561031557600080fd5b5061024a610af2565b34801561032a57600080fd5b50610233600160a060020a0360043516610af8565b34801561034b57600080fd5b50610233600160a060020a0360043516602435610b3e565b34801561036f57600080fd5b50610233600435610bc5565b34801561038757600080fd5b50610233600435610bd2565b34801561039f57600080fd5b5061024a600160a060020a0360043516610bf8565b3480156103c057600080fd5b50610295610c13565b3480156103d557600080fd5b50610233600160a060020a0360043516610c23565b3480156103f657600080fd5b506103ff610ca1565b60408051600160a060020a039092168252519081900360200190f35b34801561042757600080fd5b5061024a610cb0565b34801561043c57600080fd5b50610233600160a060020a0360043516602435610cb6565b34801561046057600080fd5b50610233600435610d3d565b34801561047857600080fd5b50610295600160a060020a0360043516602435610d47565b34801561049c57600080fd5b50604080516020601f60643560048181013592830184900484028501840190955281845261029594600160a060020a038135811695602480359092169560443595369560849401918190840183828082843750949750610d549650505050505050565b34801561050b57600080fd5b50610233600160a060020a0360043516602435610ff8565b34801561052f57600080fd5b50610233600160a060020a0360043581169060243516604435611008565b34801561055957600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610295948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506110199650505050505050565b3480156105c257600080fd5b5061023361102f565b3480156105d757600080fd5b506103ff6110c3565b3480156105ec57600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610295948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506110d29650505050505050565b34801561065557600080fd5b50610295600160a060020a03600435166111ed565b34801561067657600080fd5b5061024a600160a060020a0360043581169060243516611213565b34801561069d57600080fd5b50610233600160a060020a036004351661123e565b3480156106be57600080fd5b50610233600160a060020a0360043516602435611423565b3480156106e257600080fd5b506103ff61142e565b600080600160a060020a03831615156107075760009150610712565b823b90506000811191505b50919050565b60075481565b61073433600035600160e060020a03191661143d565b151561073f57600080fd5b60408051348082526020820183815236938301849052600435936024359384938693339360008035600160e060020a031916949092606082018484808284376040519201829003965090945050505050a450506004805474ff0000000000000000000000000000000000000000191660a060020a179055565b6008546000906107d090600160a060020a03166106eb565b1561088157600854604080517fda682aeb000000000000000000000000000000000000000000000000000000008152336004820152600160a060020a038681166024830152604482018690529151919092169163da682aeb9160648083019260209291908290030181600087803b15801561084a57600080fd5b505af115801561085e573d6000803e3d6000fd5b505050506040513d602081101561087457600080fd5b5051151561088157600080fd5b61088b8383611541565b90505b92915050565b6108aa33600035600160e060020a03191661143d565b15156108b557600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383811691909117918290556040519116907fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9490600090a250565b60005490565b60085460009061093090600160a060020a03166106eb565b156109e357600854604080517f4a393149000000000000000000000000000000000000000000000000000000008152600160a060020a03878116600483015286811660248301526044820186905291519190921691634a3931499160648083019260209291908290030181600087803b1580156109ac57600080fd5b505af11580156109c0573d6000803e3d6000fd5b505050506040513d60208110156109d657600080fd5b505115156109e357600080fd5b6109ee848484611565565b9050808015610a015750610a01836106eb565b15610aeb5782600160a060020a031660405180807f746f6b656e46616c6c6261636b28616464726573732c75696e74323536290000815250601e019050604051809103902060e060020a900485846040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a03168152602001828152602001925050506000604051808303816000875af1925050501515610aeb5782600160a060020a031684600160a060020a03167ff36a4bd3b5c7bc32d5dd2cd0cb131eebef8437ad12227c07c4018a130f6ca2fb846040518082815260200191505060405180910390a35b9392505050565b60065481565b600854600160a060020a03163314610b0f57600080fd5b6008805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b610b5433600035600160e060020a03191661143d565b1515610b5f57600080fd5b60045460a060020a900460ff1615610b7657600080fd5b610b8082826116c8565b604080518281529051600160a060020a038416916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b610bcf3382610cb6565b50565b610be833600035600160e060020a03191661143d565b1515610bf357600080fd5b600755565b600160a060020a031660009081526001602052604090205490565b60045460a060020a900460ff1681565b610c3933600035600160e060020a03191661143d565b1515610c4457600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383811691909117918290556040519116907f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada490600090a250565b600454600160a060020a031681565b60055481565b610ccc33600035600160e060020a03191661143d565b1515610cd757600080fd5b60045460a060020a900460ff1615610cee57600080fd5b610cf88282611790565b604080518281529051600091600160a060020a038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b610bcf3382610b3e565b600061088b338484610918565b6008546000908190610d6e90600160a060020a03166106eb565b15610e2157600854604080517f4a393149000000000000000000000000000000000000000000000000000000008152600160a060020a03898116600483015288811660248301526044820188905291519190921691634a3931499160648083019260209291908290030181600087803b158015610dea57600080fd5b505af1158015610dfe573d6000803e3d6000fd5b505050506040513d6020811015610e1457600080fd5b50511515610e2157600080fd5b610e2c868686611565565b1515610e3757600080fd5b610e40856106eb565b15610f3757506040517fc0ee0b8a000000000000000000000000000000000000000000000000000000008152600160a060020a03868116600483019081526024830186905260606044840190815285516064850152855188949385169363c0ee0b8a938b938a938a9360840190602085019080838360005b83811015610ed0578181015183820152602001610eb8565b50505050905090810190601f168015610efd5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015610f1e57600080fd5b505af1158015610f32573d6000803e3d6000fd5b505050505b84600160a060020a031686600160a060020a03167f9bfafdc2ae8835972d7b64ef3f8f307165ac22ceffde4a742c52da5487f45fd186866040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610fb1578181015183820152602001610f99565b50505050905090810190601f168015610fde5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a350600195945050505050565b611003338383610918565b505050565b611013838383610918565b50505050565b600061102733858585610d54565b949350505050565b61104533600035600160e060020a03191661143d565b151561105057600080fd5b60408051348082526020820183815236938301849052600435936024359384938693339360008035600160e060020a031916949092606082018484808284376040519201829003965090945050505050a450506004805474ff000000000000000000000000000000000000000019169055565b600354600160a060020a031681565b60006110de84846107b8565b15156110e957600080fd5b6040517f8f4ffcb10000000000000000000000000000000000000000000000000000000081523360048201818152602483018690523060448401819052608060648501908152865160848601528651600160a060020a038a1695638f4ffcb195948a94938a939192909160a490910190602085019080838360005b8381101561117c578181015183820152602001611164565b50505050905090810190601f1680156111a95780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156111cb57600080fd5b505af11580156111df573d6000803e3d6000fd5b506001979650505050505050565b60045460009060a060020a900460ff161561120757600080fd5b61088e826000196118ee565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b6008546000908190600160a060020a0316331461125a57600080fd5b600160a060020a03831615156112aa57600854604051600160a060020a0390911690303180156108fc02916000818181858888f193505050501580156112a4573d6000803e3d6000fd5b50611003565b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051849350600160a060020a038416916370a082319160248083019260209291908290030181600087803b15801561130e57600080fd5b505af1158015611322573d6000803e3d6000fd5b505050506040513d602081101561133857600080fd5b5051600854604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810184905290519293509084169163a9059cbb916044808201926020929091908290030181600087803b1580156113ac57600080fd5b505af11580156113c0573d6000803e3d6000fd5b505050506040513d60208110156113d657600080fd5b5050600854604080518381529051600160a060020a03928316928616917ff931edb47c50b4b4104c187b5814a9aef5f709e17e2ecf9617e860cacade929c919081900360200190a3505050565b611003823383610918565b600854600160a060020a031681565b6000600160a060020a0383163014156114585750600161088e565b600454600160a060020a03848116911614156114765750600161088e565b600354600160a060020a031615156114905750600061088e565b600354604080517fb7009613000000000000000000000000000000000000000000000000000000008152600160a060020a038681166004830152306024830152600160e060020a0319861660448301529151919092169163b70096139160648083019260209291908290030181600087803b15801561150e57600080fd5b505af1158015611522573d6000803e3d6000fd5b505050506040513d602081101561153857600080fd5b5051905061088e565b60045460009060a060020a900460ff161561155b57600080fd5b61088b83836118ee565b60045460009060a060020a900460ff161561157f57600080fd5b600160a060020a03841633148015906115bd5750600160a060020a038416600090815260026020908152604080832033845290915290205460001914155b1561161557600160a060020a03841660009081526002602090815260408083203384529091529020546115f09083611954565b600160a060020a03851660009081526002602090815260408083203384529091529020555b600160a060020a0384166000908152600160205260409020546116389083611954565b600160a060020a0380861660009081526001602052604080822093909355908516815220546116679083611964565b600160a060020a0380851660008181526001602090815260409182902094909455805186815290519193928816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35060019392505050565b6116de33600035600160e060020a03191661143d565b15156116e957600080fd5b60045460a060020a900460ff161561170057600080fd5b600160a060020a0382166000908152600160205260409020546117239082611964565b600160a060020a0383166000908152600160205260408120919091555461174a9082611964565b600055604080518281529051600160a060020a038416917f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885919081900360200190a25050565b6117a633600035600160e060020a03191661143d565b15156117b157600080fd5b60045460a060020a900460ff16156117c857600080fd5b600160a060020a03821633148015906118065750600160a060020a038216600090815260026020908152604080832033845290915290205460001914155b1561185e57600160a060020a03821660009081526002602090815260408083203384529091529020546118399082611954565b600160a060020a03831660009081526002602090815260408083203384529091529020555b600160a060020a0382166000908152600160205260409020546118819082611954565b600160a060020a038316600090815260016020526040812091909155546118a89082611954565b600055604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b8082038281111561088e57600080fd5b8082018281101561088e57600080fd00a165627a7a72305820c2381509882ef8a599897655a8d332374d416228bb8e2024de63813af7b77ce00029
Verified Source Code Partial Match
Compiler: v0.4.24+commit.e67f0147
EVM: byzantium
Optimization: Yes (200 runs)
FAN.sol 566 lines
pragma solidity ^0.4.23;
contract DSAuthority {
function canCall(
address src, address dst, bytes4 sig
) public view returns (bool);
}
contract DSAuthEvents {
event LogSetAuthority (address indexed authority);
event LogSetOwner (address indexed owner);
}
contract DSAuth is DSAuthEvents {
DSAuthority public authority;
address public owner;
constructor() public {
owner = msg.sender;
emit LogSetOwner(msg.sender);
}
function setOwner(address owner_)
public
auth
{
owner = owner_;
emit LogSetOwner(owner);
}
function setAuthority(DSAuthority authority_)
public
auth
{
authority = authority_;
emit LogSetAuthority(authority);
}
modifier auth {
require(isAuthorized(msg.sender, msg.sig));
_;
}
function isAuthorized(address src, bytes4 sig) internal view returns (bool) {
if (src == address(this)) {
return true;
} else if (src == owner) {
return true;
} else if (authority == DSAuthority(0)) {
return false;
} else {
return authority.canCall(src, this, sig);
}
}
}
contract DSNote {
event LogNote(
bytes4 indexed sig,
address indexed guy,
bytes32 indexed foo,
bytes32 indexed bar,
uint wad,
bytes fax
) anonymous;
modifier note {
bytes32 foo;
bytes32 bar;
assembly {
foo := calldataload(4)
bar := calldataload(36)
}
emit LogNote(msg.sig, msg.sender, foo, bar, msg.value, msg.data);
_;
}
}
contract DSStop is DSNote, DSAuth {
bool public stopped;
modifier stoppable {
require(!stopped);
_;
}
function stop() public auth note {
stopped = true;
}
function start() public auth note {
stopped = false;
}
}
contract ERC20Events {
event Approval(address indexed src, address indexed guy, uint wad);
event Transfer(address indexed src, address indexed dst, uint wad);
}
contract ERC20 is ERC20Events {
function totalSupply() public view returns (uint);
function balanceOf(address guy) public view returns (uint);
function allowance(address src, address guy) public view returns (uint);
function approve(address guy, uint wad) public returns (bool);
function transfer(address dst, uint wad) public returns (bool);
function transferFrom(
address src, address dst, uint wad
) public returns (bool);
}
contract DSMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x);
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x);
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x);
}
function min(uint x, uint y) internal pure returns (uint z) {
return x <= y ? x : y;
}
function max(uint x, uint y) internal pure returns (uint z) {
return x >= y ? x : y;
}
function imin(int x, int y) internal pure returns (int z) {
return x <= y ? x : y;
}
function imax(int x, int y) internal pure returns (int z) {
return x >= y ? x : y;
}
uint constant WAD = 10 ** 18;
uint constant RAY = 10 ** 27;
function wmul(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, y), WAD / 2) / WAD;
}
function rmul(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, y), RAY / 2) / RAY;
}
function wdiv(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, WAD), y / 2) / y;
}
function rdiv(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, RAY), y / 2) / y;
}
// This famous algorithm is called "exponentiation by squaring"
// and calculates x^n with x as fixed-point and n as regular unsigned.
//
// It's O(log n), instead of O(n) for naive repeated multiplication.
//
// These facts are why it works:
//
// If n is even, then x^n = (x^2)^(n/2).
// If n is odd, then x^n = x * x^(n-1),
// and applying the equation for even x gives
// x^n = x * (x^2)^((n-1) / 2).
//
// Also, EVM division is flooring and
// floor[(n-1) / 2] = floor[n / 2].
//
function rpow(uint x, uint n) internal pure returns (uint z) {
z = n % 2 != 0 ? x : RAY;
for (n /= 2; n != 0; n /= 2) {
x = rmul(x, x);
if (n % 2 != 0) {
z = rmul(z, x);
}
}
}
}
contract DSTokenBase is ERC20, DSMath {
uint256 _supply;
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) _approvals;
constructor(uint supply) public {
_balances[msg.sender] = supply;
_supply = supply;
}
function totalSupply() public view returns (uint) {
return _supply;
}
function balanceOf(address src) public view returns (uint) {
return _balances[src];
}
function allowance(address src, address guy) public view returns (uint) {
return _approvals[src][guy];
}
function transfer(address dst, uint wad) public returns (bool) {
return transferFrom(msg.sender, dst, wad);
}
function transferFrom(address src, address dst, uint wad)
public
returns (bool)
{
if (src != msg.sender) {
_approvals[src][msg.sender] = sub(_approvals[src][msg.sender], wad);
}
_balances[src] = sub(_balances[src], wad);
_balances[dst] = add(_balances[dst], wad);
emit Transfer(src, dst, wad);
return true;
}
function approve(address guy, uint wad) public returns (bool) {
_approvals[msg.sender][guy] = wad;
emit Approval(msg.sender, guy, wad);
return true;
}
}
contract DSToken is DSTokenBase(0), DSStop {
bytes32 public symbol;
uint256 public decimals = 18; // standard token precision. override to customize
constructor(bytes32 symbol_) public {
symbol = symbol_;
}
event Mint(address indexed guy, uint wad);
event Burn(address indexed guy, uint wad);
function approve(address guy) public stoppable returns (bool) {
return super.approve(guy, uint(-1));
}
function approve(address guy, uint wad) public stoppable returns (bool) {
return super.approve(guy, wad);
}
function transferFrom(address src, address dst, uint wad)
public
stoppable
returns (bool)
{
if (src != msg.sender && _approvals[src][msg.sender] != uint(-1)) {
_approvals[src][msg.sender] = sub(_approvals[src][msg.sender], wad);
}
_balances[src] = sub(_balances[src], wad);
_balances[dst] = add(_balances[dst], wad);
emit Transfer(src, dst, wad);
return true;
}
function push(address dst, uint wad) public {
transferFrom(msg.sender, dst, wad);
}
function pull(address src, uint wad) public {
transferFrom(src, msg.sender, wad);
}
function move(address src, address dst, uint wad) public {
transferFrom(src, dst, wad);
}
function mint(uint wad) public {
mint(msg.sender, wad);
}
function burn(uint wad) public {
burn(msg.sender, wad);
}
function mint(address guy, uint wad) public auth stoppable {
_balances[guy] = add(_balances[guy], wad);
_supply = add(_supply, wad);
emit Mint(guy, wad);
}
function burn(address guy, uint wad) public auth stoppable {
if (guy != msg.sender && _approvals[guy][msg.sender] != uint(-1)) {
_approvals[guy][msg.sender] = sub(_approvals[guy][msg.sender], wad);
}
_balances[guy] = sub(_balances[guy], wad);
_supply = sub(_supply, wad);
emit Burn(guy, wad);
}
// Optional token name
bytes32 public name = "";
function setName(bytes32 name_) public auth {
name = name_;
}
}
/// @title ERC223ReceivingContract - Standard contract implementation for compatibility with ERC223 tokens.
interface ERC223ReceivingContract {
/// @dev Function that is called when a user or another contract wants to transfer funds.
/// @param _from Transaction initiator, analogue of msg.sender
/// @param _value Number of tokens to transfer.
/// @param _data Data containig a function signature and/or parameters
function tokenFallback(address _from, uint256 _value, bytes _data) public;
/// @dev For ERC20 backward compatibility, same with above tokenFallback but without data.
/// The function execution could fail, but do not influence the token transfer.
/// @param _from Transaction initiator, analogue of msg.sender
/// @param _value Number of tokens to transfer.
// function tokenFallback(address _from, uint256 _value) public;
}
/// @dev The token controller contract must implement these functions
contract TokenController {
/// @notice Called when `_owner` sends ether to the MiniMe Token contract
/// @param _owner The address that sent the ether to create tokens
/// @return True if the ether is accepted, false if it throws
function proxyPayment(address _owner) payable public returns (bool);
/// @notice Notifies the controller about a token transfer allowing the
/// controller to react if desired
/// @param _from The origin of the transfer
/// @param _to The destination of the transfer
/// @param _amount The amount of the transfer
/// @return False if the controller does not authorize the transfer
function onTransfer(address _from, address _to, uint _amount) public returns (bool);
/// @notice Notifies the controller about an approval allowing the
/// controller to react if desired
/// @param _owner The address that calls `approve()`
/// @param _spender The spender in the `approve()` call
/// @param _amount The amount in the `approve()` call
/// @return False if the controller does not authorize the approval
function onApprove(address _owner, address _spender, uint _amount) public returns (bool);
}
contract Controlled {
/// @notice The address of the controller is the only address that can call
/// a function with this modifier
modifier onlyController { if (msg.sender != controller) throw; _; }
address public controller;
constructor() public { controller = msg.sender;}
/// @notice Changes the controller of the contract
/// @param _newController The new controller of the contract
function changeController(address _newController) onlyController {
controller = _newController;
}
}
interface ApproveAndCallFallBack {
function receiveApproval(address from, uint256 _amount, address _token, bytes _data) public;
}
interface ERC223 {
function transfer(address to, uint amount, bytes data) public returns (bool ok);
function transferFrom(address from, address to, uint256 amount, bytes data) public returns (bool ok);
event ERC223Transfer(address indexed from, address indexed to, uint amount, bytes data);
event ReceivingContractTokenFallbackFailed(address indexed from, address indexed to, uint amount);
}
contract FAN is DSToken("FAN"), ERC223, Controlled {
constructor() public {
setName("Fan Token");
}
/// @notice Send `_amount` tokens to `_to` from `_from` on the condition it
/// is approved by `_from`
/// @param _from The address holding the tokens being transferred
/// @param _to The address of the recipient
/// @param _amount The amount of tokens to be transferred
/// @return True if the transfer was successful
function transferFrom(address _from, address _to, uint256 _amount
) public returns (bool success) {
// Alerts the token controller of the transfer
if (isContract(controller)) {
if (!TokenController(controller).onTransfer(_from, _to, _amount))
throw;
}
success = super.transferFrom(_from, _to, _amount);
if (success && isContract(_to))
{
// ERC20 backward compatiability
if(!_to.call(bytes4(keccak256("tokenFallback(address,uint256)")), _from, _amount)) {
// do nothing when error in call in case that the _to contract is not inherited from ERC223ReceivingContract
// revert();
// bytes memory empty;
emit ReceivingContractTokenFallbackFailed(_from, _to, _amount);
// Even the fallback failed if there is such one, the transfer will not be revert since "revert()" is not called.
}
}
}
/*
* ERC 223
* Added support for the ERC 223 "tokenFallback" method in a "transfer" function with a payload.
*/
function transferFrom(address _from, address _to, uint256 _amount, bytes _data)
public
returns (bool success)
{
// Alerts the token controller of the transfer
if (isContract(controller)) {
if (!TokenController(controller).onTransfer(_from, _to, _amount))
throw;
}
require(super.transferFrom(_from, _to, _amount));
if (isContract(_to)) {
ERC223ReceivingContract receiver = ERC223ReceivingContract(_to);
receiver.tokenFallback(_from, _amount, _data);
}
emit ERC223Transfer(_from, _to, _amount, _data);
return true;
}
/*
* ERC 223
* Added support for the ERC 223 "tokenFallback" method in a "transfer" function with a payload.
* https://github.com/ethereum/EIPs/issues/223
* function transfer(address _to, uint256 _value, bytes _data) public returns (bool success);
*/
/// @notice Send `_value` tokens to `_to` from `msg.sender` and trigger
/// tokenFallback if sender is a contract.
/// @dev Function that is called when a user or another contract wants to transfer funds.
/// @param _to Address of token receiver.
/// @param _amount Number of tokens to transfer.
/// @param _data Data to be sent to tokenFallback
/// @return Returns success of function call.
function transfer(
address _to,
uint256 _amount,
bytes _data)
public
returns (bool success)
{
return transferFrom(msg.sender, _to, _amount, _data);
}
/// @notice `msg.sender` approves `_spender` to spend `_amount` tokens on
/// its behalf. This is a modified version of the ERC20 approve function
/// to be a little bit safer
/// @param _spender The address of the account able to transfer the tokens
/// @param _amount The amount of tokens to be approved for transfer
/// @return True if the approval was successful
function approve(address _spender, uint256 _amount) returns (bool success) {
// Alerts the token controller of the approve function call
if (isContract(controller)) {
if (!TokenController(controller).onApprove(msg.sender, _spender, _amount))
throw;
}
return super.approve(_spender, _amount);
}
function mint(address _guy, uint _wad) auth stoppable {
super.mint(_guy, _wad);
emit Transfer(0, _guy, _wad);
}
function burn(address _guy, uint _wad) auth stoppable {
super.burn(_guy, _wad);
emit Transfer(_guy, 0, _wad);
}
/// @notice `msg.sender` approves `_spender` to send `_amount` tokens on
/// its behalf, and then a function is triggered in the contract that is
/// being approved, `_spender`. This allows users to use their tokens to
/// interact with contracts in one function call instead of two
/// @param _spender The address of the contract able to transfer the tokens
/// @param _amount The amount of tokens to be approved for transfer
/// @return True if the function call was successful
function approveAndCall(address _spender, uint256 _amount, bytes _extraData
) returns (bool success) {
if (!approve(_spender, _amount)) throw;
ApproveAndCallFallBack(_spender).receiveApproval(
msg.sender,
_amount,
this,
_extraData
);
return true;
}
/// @dev Internal function to determine if an address is a contract
/// @param _addr The address being queried
/// @return True if `_addr` is a contract
function isContract(address _addr) constant internal returns(bool) {
uint size;
if (_addr == 0) return false;
assembly {
size := extcodesize(_addr)
}
return size>0;
}
/// @notice The fallback function: If the contract's controller has not been
/// set to 0, then the `proxyPayment` method is called which relays the
/// ether and creates tokens as described in the token controller contract
function () payable {
if (isContract(controller)) {
if (! TokenController(controller).proxyPayment.value(msg.value)(msg.sender))
throw;
} else {
throw;
}
}
//////////
// Safety Methods
//////////
/// @notice This method can be used by the controller to extract mistakenly
/// sent tokens to this contract.
/// @param _token The address of the token contract that you want to recover
/// set to 0 in case you want to extract ether.
function claimTokens(address _token) onlyController {
if (_token == 0x0) {
controller.transfer(address(this).balance);
return;
}
ERC20 token = ERC20(_token);
uint balance = token.balanceOf(this);
token.transfer(controller, balance);
emit ClaimedTokens(_token, controller, balance);
}
////////////////
// Events
////////////////
event ClaimedTokens(address indexed _token, address indexed _controller, uint _amount);
}
Read Contract
allowance 0xdd62ed3e → uint256
authority 0xbf7e214f → address
balanceOf 0x70a08231 → uint256
controller 0xf77c4791 → address
decimals 0x313ce567 → uint256
name 0x06fdde03 → bytes32
owner 0x8da5cb5b → address
stopped 0x75f12b21 → bool
symbol 0x95d89b41 → bytes32
totalSupply 0x18160ddd → uint256
Write Contract 21 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address _spender
uint256 _amount
returns: bool
approve 0xdaea85c5
address guy
returns: bool
approveAndCall 0xcae9ca51
address _spender
uint256 _amount
bytes _extraData
returns: bool
burn 0x42966c68
uint256 wad
burn 0x9dc29fac
address _guy
uint256 _wad
changeController 0x3cebb823
address _newController
claimTokens 0xdf8de3e7
address _token
mint 0x40c10f19
address _guy
uint256 _wad
mint 0xa0712d68
uint256 wad
move 0xbb35783b
address src
address dst
uint256 wad
pull 0xf2d5d56b
address src
uint256 wad
push 0xb753a98c
address dst
uint256 wad
setAuthority 0x7a9e5e4b
address authority_
setName 0x5ac801fe
bytes32 name_
setOwner 0x13af4035
address owner_
start 0xbe9a6555
No parameters
stop 0x07da68f5
No parameters
transfer 0xa9059cbb
address dst
uint256 wad
returns: bool
transfer 0xbe45fd62
address _to
uint256 _amount
bytes _data
returns: bool
transferFrom 0x23b872dd
address _from
address _to
uint256 _amount
returns: bool
transferFrom 0xab67aa58
address _from
address _to
uint256 _amount
bytes _data
returns: bool
Recent Transactions
No transactions found for this address