ETH Price: $2,268.23 (-6.41%)

Transaction Decoder

Block:
5259768 at Mar-15-2018 01:12:31 PM +UTC
Transaction Fee:
0.004547349 ETH $10.31
Gas Used:
1,515,783 Gas / 3 Gwei

Account State Difference:

  Address   Before After State Difference Code
0x2EFde486...B8C77d86F
(ETH.TOWN: Deployer)
0.2 Eth
Nonce: 0
0.195452651 Eth
Nonce: 1
0.004547349
(Spark Pool)
2,736.906168347340389641 Eth2,736.910715696340389641 Eth0.004547349
0x8fe19C44...9cA96d80D
0 Eth
Nonce: 0
0 Eth
Nonce: 1
From: 0 To: 11486774327554921531055079426637150365270674572657238033349200979696674954420950198797738894232852474556157677789474552472236895784480532383373091185560844118392560360573033569798229125799709225578819826905405753409476489699768393234605580209581566957856909464501714831057435779940134695082493896870396806197984976967180799264936220261247618434286196618073268232289510200701446607274590029052706703509683764198308286554325006235293219019421192940046623282356222230871163546929880230275022261270171289641906693121646277123149681320581270425242042977227624484725865360409343635041336013524437919432616914190383969850419226763460115283611971397870578647877065869342185448427159292403171282650144526271143864035214190308078508667470213987017966474246699511051612777308401427610072272312674341588823305488702307466880752710193106487142209946741072658684401357880961774255514175681695590035852398779630458865250629061908867650799539003711540279226998833399446764056579555805429612415528416503443043300762985138719897631177274663172649952651755222130840561215107474921442715870038038638509641166296219775704452796264447899129606243363259921936890697261345784819240257935834490272599210520963726283503928763218295628255565386545600079342244322717059966074776690816277860489309369505018715754723103632802201861750091962982665199572300753145869523625727182913401453625837588523712566003389159165529822084296456457040510854924157899515007406029269874483544772717539762015580710727384840103395396526798186018738189610413527437676548249223671866956524917400820116575124350741701438215242238434925112260974736601999719408205555272575690806419596273870690725066097745468462335461799595791041282115754012829407145489139497386269846785563366154690665399178875089387998995256858546174999155341667266304522247273833079526704496457890454618778265695674553415394961020708609864029852813653881397328211771815679682251977610333946065386889696261008916592893345958175954483515308676926846796944909728766300448458502264197077440234965820145981189098783878786504276088805919124105287408344243881106457337604530664569551601298470991693576922482917111103344652025434232790077181255583445998178939577378383924757251811415729808324842739225885286620823168112280653244984004020270971794221133289575893446485762511355371884731864973946438382989373511162263071723106460594577263296692043820741673386114354260488356914792343568261663676652812814059142928264697533578561967514159634623123783004313069719995360093051014683004641643693387703889022320092452373744920972298177323420867692043234790635944101324664710092026061890122685906348786967521656123680388448140553151009560602703173123088755891775790863890819928743900334927261561670588939921785438793206763710239271892047890220775155960445072608623649647761071601967822259926898173389246667966025738101398232326991661312965786677880507529051607854310414580114766551843194850970506271517592957429754039761719970852222206396389265303557799132374058127051494580361564057634616848072808202207276126426222766087893052870048139359678578083420873403213489611775381145981864248309765378116276235105020483318700337368277942802685149767520896995484600961851847567404688250823019279690639016594925162053411224006297422343125249864946325744707145233446909013141575386884005932066454190219826519025251733550799484422246320251514071661222794046248313275326005422547921294443751749011065000524243916194366175078401257102230886762782584304149308284661720654106129384147881399710532114220393267679389573995800757518033983781235087013122733955858233269728726071712060026709093347822055536605520214961946034174479027417521740322717906462494278584595595476691043898681260462764717399558362231376194109910636269539412262492726544378819230491004432388934986236961199832052556656634939421424980656206398439961409285064633777087206895481881584444816013052810226544099439546051755156230981559382008832326490473084488857867268824052879917145232649878321204448279733856019159264600440740304401567957211615963702090957567491598499798136939794298899322449016891981786725850321439286615528082928705632607431646868090842513180280619262080600589692207325429439116972399549150574098070771707553263005894352675522990730685549028810837018599902651445186949214830085901582947305859319441553835396703974390421434159987008242959941346944507884195094802554138645225102741200938629202670344632750996794457728984103135326045681994523428885990730372914963522726127618590805223145733268690364235888710139103536125901697018193173619472932891821512098544439670017401849073780925396611539001634121007871479421178599815575745809282195816094703885920226672332372150406771825969108881635306397806499342708347571727594360953486521897007033500870968436241773229611173829221606397797918658174975137512364435853053874353695455601196799070064713237180259139666070066146302157519379070179447543843747102875521415460888388680903716588190909528361547364165280519373475613240968753931096255337683113750307461823369943167725486598625904446217495459565428225323987805242080115962508848979320632311150578733356069700845877462425171918458821921419567775767919614750251035890694099949629693567034573329917027339103436486971226708763119783061172298520443469798743457701631727862821752462958901405235818454021195925214631769353931106223384507845788683223418227316009407349902266437572230623385349996562641450502788304375311058929026907629722576703817587849929151072356795754848037612465271252961418374636152060140235972360543572101000122550284547109072239221082163393041888107446608192917845248448744955580885228577323012364010407714408836888777672916752782876594068973595618431007768908801180003624666496661018869367155965347651153483560692814897914638198984351900617990514037753366499412588158861191440363491531924058762226433609597466867990773106236048893918232019824977950413458310026231541577802369293816230028491598286713589040607960656453794412182052420032905825715086311814401833275612083442479161686308667498279874830816761966450028476804650684577675852504601481999487355677262578022221083272127022339166919075665961576783617899151158047524822983076647039066924087235107486729854217069018778463605828572998994751926947362396656680191367990741091123827754202512814349037936669482314072317320547298797388058386228705772542537688337395234518077262990152887616248718747747311281943759246167543671280312727490676671062001772015757130518606670064204211859464299529689981588210622914644664837581459363272519923362317095583548281932620001302728172127076963337088817302229538467206910188371127924592710007707384247404006213054397715703891114085177609808208901340739816506205345023994600053618744475665407246632443158958602765918422083820007962372237161934196399808351771170529315777150582016091829970978999566010398282445850924093529580285328524099204987235178213792351947264016532796269591809314514052260200914685002157941129106026152464464752845727887476059432471770162277877467869298959504790647173597926090191593403434949291514287496489432972317571931533163446724609113069594722322322709652830404756771808494283469943224842043071134237335457588151080852242454368404663851785460189443933615798224891329649279842620211994509033045189842646320754360212039012043111779498822953174892343709128674301310374592292961518384900759715072670537156412344832480410976627335440191920418434007451616968074874253366518255530232242171696199497097709671882368227116864372306477715954186412382236166751883838687996702146900287689346304001672452308528653169498003655622114243243530866144386327002597769575640520804037815794588734589994926657396160258930085122352257567613931229658928761826107797727710853492285575703622816825526620770013317225830880638170965600819079700162661582715601470681948566385784363327148906054049885211615416306263241288114201214338804294037183169865632899898395707898526820848249409265465010346086307406023633492834983997853974612442995614819059635781662292652467539535904995591914145425453775868096419329837636265938872515258992654677564359875860162690767319407081161791742756162689076713154576352188078782488025303799170066489230295571685367560839689810495476956833060592435787871788808521334348871859815590086484788204803921000823639252707501590858550361163549767644216935900914698516844319670806645333674105389383498315978207248307971413695005666890816590530544018526117770144380109298515288094442229188800232483172844705887033717922108084549928315392285889937860523964229668696276352798994684241279498881856210611350257667593796311787274053415206555828629493181754570033545601875667702001843379369966815705399983053955409265286021178418558543111664002417244740741619192179601477267566438203381811897149144484580672381816427219402652000910366446809840994743857583674812025842619191417650365758934391389500074208772220932684409333533920478516695451069306593924187651313365579570044089687090481911542026798697775637816371103845274283475403506067804057741785023593787056960559639110613912308935177152406277580313421205208233576291408707471098534512239038901369251590623051210475933268663829467873759700559085298992725756596749752429320349661552985249543877065329113592823450770527451141957232255230513079843731857301980256571443272681741381432969677249068843323746761007599126831259621303484767126211125504646999385656402527668070531599987583359129517294747445528098701697174416848276206056636838230148780690369478987861373057130236946356235922652561014934818808676946344692283940513427259972594147463686010864030908577559670243623220790890149498459268019154883467943365765190735830659366039525066410666470635368001705642800391117213704730556691486986919820624482872192638177047592171976400633879830107744149520447618695821027903960957168499529783004056112399133933674032782490163521623199222262426756447630173419452883524162992470213122978722595779950388407305599465168893024994229597571785876953109454079790624481557739063011819292444995431350592771627888311524938386328898418674759876317800626249521853486881422553008859835032181606205409676050682242771877520609370861311349304608640658646159654466455888042029962083749183999672083237036020582196591987535658346388215395760467588609157010028142320361138772393825365898137562216050171880840200976266524906396732369330461759850900724728117753467880462711188023135836438084493698066146219220763573656302616679017098201779565959224363291396543539070148386991843223259446835991780144867402557501684402251619651658402403401369974550590770524559556623608755233350540808686800634738308013984083149928229657175980493072930190179721089387567290756510490056998387890202662473204689339866819228680433229063986754316870840928364119595195546638830957464155797917520643174320448632175189585053887283140635297055624356822460270755922010657547241473574078523771824399732987971535104406325000819986894858949813807784007211160318158270359967622741950316513749495033066200473309289194726498697262330586473006967543370314221228158241807672384580599390091111829011151293022167832451350113007715793160976821974023066119123423497976734320504079933512164780084696875941653466070350053852299355602260503459905806055705248159363852569749597340453707575281743836597284529936596811612150511224955942791388509197202889315483858852235664181314978298442362827423725025908907477458927753052112955986536178239122992898171971278400078597444674773195737870158575858116205696629248162574423485585566285608553706415986727704615247448121574707266862250980670238826180178482084981060424965247949316555555886613856550006086241512345117780041501492737479166846464736536082614806346696098999074952108063980020473060473410159490944356692852722382813746266341398811286627484619692745007208645926463809450857890855962908530731308661198354355975828567476109939719506687714394608889083200032756060791559063614502792773870408006444131729150215171887792351494773166127662266001525579711028842658885862020262557353886095995057071555940987774380002604711878982705525700907111825042531811905814714620557561916964719509189633921210157352813920297

Execution Trace

ETToken.60606040( )
pragma solidity ^0.4.21;

// SafeMath is a part of Zeppelin Solidity library
// licensed under MIT License
// https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/LICENSE

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }
        uint256 c = a * b;
        assert(c / a == b);
        return c;
    }

    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        // assert(b > 0); // Solidity automatically throws when dividing by 0
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold
        return c;
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        assert(b <= a);
        return a - b;
    }

    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        assert(c >= a);
        return c;
    }
}

// https://github.com/OpenZeppelin/zeppelin-solidity

/**
 * @title ERC20Basic
 * @dev Simpler version of ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/179
 */
contract ERC20Basic {
    function totalSupply() public view returns (uint256);
    function balanceOf(address who) public view returns (uint256);
    function transfer(address to, uint256 value) public returns (bool);
    event Transfer(address indexed from, address indexed to, uint256 value);
}

/**
 * @title ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/20
 */
contract ERC20 is ERC20Basic {
    function allowance(address owner, address spender) public view returns (uint256);
    function transferFrom(address from, address to, uint256 value) public returns (bool);
    function approve(address spender, uint256 value) public returns (bool);
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

/**
 * @title Basic token
 * @dev Basic version of StandardToken, with no allowances.
 */
contract BasicToken is ERC20Basic {
    using SafeMath for uint256;

    mapping(address => uint256) balances;

    uint256 totalSupply_;

    /**
    * @dev Protection from short address attack
    */
    modifier onlyPayloadSize(uint size) {
        assert(msg.data.length == size + 4);
        _;
    }

    /**
    * @dev total number of tokens in existence
    */
    function totalSupply() public view returns (uint256) {
        return totalSupply_;
    }

    /**
    * @dev transfer token for a specified address
    * @param _to The address to transfer to.
    * @param _value The amount to be transferred.
    */
    function transfer(address _to, uint256 _value) onlyPayloadSize(2 * 32) public returns (bool) {
        require(_to != address(0));
        require(_value <= balances[msg.sender]);

        // SafeMath.sub will throw if there is not enough balance.
        balances[msg.sender] = balances[msg.sender].sub(_value);
        balances[_to] = balances[_to].add(_value);
        emit Transfer(msg.sender, _to, _value);

        _postTransferHook(msg.sender, _to, _value);

        return true;
    }

    /**
    * @dev Gets the balance of the specified address.
    * @param _owner The address to query the the balance of.
    * @return An uint256 representing the amount owned by the passed address.
    */
    function balanceOf(address _owner) public view returns (uint256 balance) {
        return balances[_owner];
    }

    /**
    * @dev Hook for custom actions to be executed after transfer has completed
    * @param _from Transferred from
    * @param _to Transferred to
    * @param _value Value transferred
    */
    function _postTransferHook(address _from, address _to, uint256 _value) internal;
}

/**
 * @title Standard ERC20 token
 *
 * @dev Implementation of the basic standard token.
 * @dev https://github.com/ethereum/EIPs/issues/20
 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
 */
contract StandardToken is ERC20, BasicToken {

    mapping (address => mapping (address => uint256)) internal allowed;


    /**
     * @dev Transfer tokens from one address to another
     * @param _from address The address which you want to send tokens from
     * @param _to address The address which you want to transfer to
     * @param _value uint256 the amount of tokens to be transferred
     */
    function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
        require(_to != address(0));
        require(_value <= balances[_from]);
        require(_value <= allowed[_from][msg.sender]);

        balances[_from] = balances[_from].sub(_value);
        balances[_to] = balances[_to].add(_value);
        allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
        emit Transfer(_from, _to, _value);

        _postTransferHook(_from, _to, _value);

        return true;
    }

    /**
     * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
     *
     * Beware that changing an allowance with this method brings the risk that someone may use both the old
     * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
     * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     * @param _spender The address which will spend the funds.
     * @param _value The amount of tokens to be spent.
     */
    function approve(address _spender, uint256 _value) public returns (bool) {
        allowed[msg.sender][_spender] = _value;
        emit Approval(msg.sender, _spender, _value);
        return true;
    }

    /**
     * @dev Function to check the amount of tokens that an owner allowed to a spender.
     * @param _owner address The address which owns the funds.
     * @param _spender address The address which will spend the funds.
     * @return A uint256 specifying the amount of tokens still available for the spender.
     */
    function allowance(address _owner, address _spender) public view returns (uint256) {
        return allowed[_owner][_spender];
    }

    /**
     * @dev Increase the amount of tokens that an owner allowed to a spender.
     *
     * approve should be called when allowed[_spender] == 0. To increment
     * allowed value is better to use this function to avoid 2 calls (and wait until
     * the first transaction is mined)
     * From MonolithDAO Token.sol
     * @param _spender The address which will spend the funds.
     * @param _addedValue The amount of tokens to increase the allowance by.
     */
    function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
        allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
        emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
        return true;
    }

    /**
     * @dev Decrease the amount of tokens that an owner allowed to a spender.
     *
     * approve should be called when allowed[_spender] == 0. To decrement
     * allowed value is better to use this function to avoid 2 calls (and wait until
     * the first transaction is mined)
     * From MonolithDAO Token.sol
     * @param _spender The address which will spend the funds.
     * @param _subtractedValue The amount of tokens to decrease the allowance by.
     */
    function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
        uint oldValue = allowed[msg.sender][_spender];
        if (_subtractedValue > oldValue) {
            allowed[msg.sender][_spender] = 0;
        } else {
            allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
        }
        emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
        return true;
    }

}

contract Owned {
    address owner;

    modifier onlyOwner {
        require(msg.sender == owner);
        _;
    }

    /// @dev Contract constructor
    function Owned() public {
        owner = msg.sender;
    }
}


contract AcceptsTokens {
    ETToken public tokenContract;

    function AcceptsTokens(address _tokenContract) public {
        tokenContract = ETToken(_tokenContract);
    }

    modifier onlyTokenContract {
        require(msg.sender == address(tokenContract));
        _;
    }

    function acceptTokens(address _from, uint256 _value, uint256 param1, uint256 param2, uint256 param3) external;
}

contract ETToken is Owned, StandardToken {
    using SafeMath for uint;

    string public name = "ETH.TOWN Token";
    string public symbol = "ETIT";
    uint8 public decimals = 18;

    address public beneficiary;
    address public oracle;
    address public heroContract;
    modifier onlyOracle {
        require(msg.sender == oracle);
        _;
    }

    mapping (uint32 => address) public floorContracts;
    mapping (address => bool) public canAcceptTokens;

    mapping (address => bool) public isMinter;

    modifier onlyMinters {
        require(msg.sender == owner || isMinter[msg.sender]);
        _;
    }

    event Dividend(uint256 value);
    event Withdrawal(address indexed to, uint256 value);
    event Burn(address indexed from, uint256 value);

    function ETToken() public {
        oracle = owner;
        beneficiary = owner;

        totalSupply_ = 0;
    }

    function setOracle(address _oracle) external onlyOwner {
        oracle = _oracle;
    }
    function setBeneficiary(address _beneficiary) external onlyOwner {
        beneficiary = _beneficiary;
    }
    function setHeroContract(address _heroContract) external onlyOwner {
        heroContract = _heroContract;
    }

    function _mintTokens(address _user, uint256 _amount) private {
        require(_user != 0x0);

        balances[_user] = balances[_user].add(_amount);
        totalSupply_ = totalSupply_.add(_amount);

        emit Transfer(address(this), _user, _amount);
    }

    function authorizeFloor(uint32 _index, address _floorContract) external onlyOwner {
        floorContracts[_index] = _floorContract;
    }

    function _acceptDividends(uint256 _value) internal {
        uint256 beneficiaryShare = _value / 5;
        uint256 poolShare = _value.sub(beneficiaryShare);

        beneficiary.transfer(beneficiaryShare);

        emit Dividend(poolShare);
    }

    function acceptDividends(uint256 _value, uint32 _floorIndex) external {
        require(floorContracts[_floorIndex] == msg.sender);

        _acceptDividends(_value);
    }

    function rewardTokensFloor(address _user, uint256 _tokens, uint32 _floorIndex) external {
        require(floorContracts[_floorIndex] == msg.sender);

        _mintTokens(_user, _tokens);
    }

    function rewardTokens(address _user, uint256 _tokens) external onlyMinters {
        _mintTokens(_user, _tokens);
    }

    function() payable public {
        // Intentionally left empty, for use by floors
    }

    function payoutDividends(address _user, uint256 _value) external onlyOracle {
        _user.transfer(_value);

        emit Withdrawal(_user, _value);
    }

    function accountAuth(uint256 /*_challenge*/) external {
        // Does nothing by design
    }

    function burn(uint256 _amount) external {
        require(balances[msg.sender] >= _amount);

        balances[msg.sender] = balances[msg.sender].sub(_amount);
        totalSupply_ = totalSupply_.sub(_amount);

        emit Burn(msg.sender, _amount);
    }

    function setCanAcceptTokens(address _address, bool _value) external onlyOwner {
        canAcceptTokens[_address] = _value;
    }

    function setIsMinter(address _address, bool _value) external onlyOwner {
        isMinter[_address] = _value;
    }

    function _invokeTokenRecipient(address _from, address _to, uint256 _value, uint256 _param1, uint256 _param2, uint256 _param3) internal {
        if (!canAcceptTokens[_to]) {
            return;
        }

        AcceptsTokens recipient = AcceptsTokens(_to);

        recipient.acceptTokens(_from, _value, _param1, _param2, _param3);
    }

    /**
    * @dev transfer token for a specified address and forward the parameters to token recipient if any
    * @param _to The address to transfer to.
    * @param _value The amount to be transferred.
    * @param _param1 Parameter 1 for the token recipient
    * @param _param2 Parameter 2 for the token recipient
    * @param _param3 Parameter 3 for the token recipient
    */
    function transferWithParams(address _to, uint256 _value, uint256 _param1, uint256 _param2, uint256 _param3) onlyPayloadSize(5 * 32) external returns (bool) {
        require(_to != address(0));
        require(_value <= balances[msg.sender]);

        // SafeMath.sub will throw if there is not enough balance.
        balances[msg.sender] = balances[msg.sender].sub(_value);
        balances[_to] = balances[_to].add(_value);
        emit Transfer(msg.sender, _to, _value);

        _invokeTokenRecipient(msg.sender, _to, _value, _param1, _param2, _param3);

        return true;
    }

    /**
    * @dev Hook for custom actions to be executed after transfer has completed
    * @param _from Transferred from
    * @param _to Transferred to
    * @param _value Value transferred
    */
    function _postTransferHook(address _from, address _to, uint256 _value) internal {
        _invokeTokenRecipient(_from, _to, _value, 0, 0, 0);
    }


}