ETH Price: $2,461.34 (+1.88%)

Transaction Decoder

Block:
8872323 at Nov-04-2019 04:16:21 PM +UTC
Transaction Fee:
0.0011548 ETH $2.84
Gas Used:
57,740 Gas / 20 Gwei

Emitted Events:

141 0xa4463f9ff0d87531232c8c4819b536c332da6eac.0x4791c50923dfb6217d0f4e45cd4e2dbc03b2e6f2b4e47b04abb512c4bc361a4b( 0x4791c50923dfb6217d0f4e45cd4e2dbc03b2e6f2b4e47b04abb512c4bc361a4b, 0x000000000000000000000000987fb1d0e725621e2a3ce4c2ef3cbf9d04022fd6, 0x000000000000000000000000000000000000000000000000003ee500e65d9b37, 0x000000000000000000000000000000000000000000000000377d49411215f800, 000000000000000000000000000000000000000000000010ce1d3d8cb3180000, 000000000000000000000000000000000000000000000000000000000000000a )

Account State Difference:

  Address   Before After State Difference Code
(Spark Pool)
47.399568799025815749 Eth47.400723599025815749 Eth0.0011548
0x987fb1d0...D04022fd6
18.782357810857088049 Eth
Nonce: 7
18.798906251440803688 Eth
Nonce: 8
0.016548440583715639
0xa4463f9F...332DA6EAc 193.34033133786148184 Eth193.322628097277766201 Eth0.017703240583715639

Execution Trace

0xa4463f9ff0d87531232c8c4819b536c332da6eac.CALL( )
  • EtherollToken.CALL( )
  • EtherollToken.balanceOf( 0x987fb1d0E725621E2a3cE4C2Ef3CbF9D04022fd6 ) => ( 3998432588000000000 )
  • EtherollToken.CALL( )
  • EtherollToken.balanceOf( 0x987fb1d0E725621E2a3cE4C2Ef3CbF9D04022fd6 ) => ( 3998432588000000000 )
  • ETH 0.017703240583715639 0x987fb1d0e725621e2a3ce4c2ef3cbf9d04022fd6.CALL( )
  • EtherollToken.balanceOf( 0x987fb1d0E725621E2a3cE4C2Ef3CbF9D04022fd6 ) => ( 3998432588000000000 )
    pragma solidity ^0.4.2;
    
    /* 
    `* is owned
    */
    contract owned {
    
        address public owner;
    
        function owned() {
            owner = msg.sender;
        }
    
        modifier onlyOwner {
            if (msg.sender != owner) throw;
            _;
        }
    
        function ownerTransferOwnership(address newOwner)
            onlyOwner
        {
            owner = newOwner;
        }
    
    }
    
    /* 
    * safe math
    */
    contract DSSafeAddSub {
    
        function safeToAdd(uint a, uint b) internal returns (bool) {
            return (a + b >= a);
        }
        
        function safeAdd(uint a, uint b) internal returns (uint) {
            if (!safeToAdd(a, b)) throw;
            return a + b;
        }
    
        function safeToSubtract(uint a, uint b) internal returns (bool) {
            return (b <= a);
        }
    
        function safeSub(uint a, uint b) internal returns (uint) {
            if (!safeToSubtract(a, b)) throw;
            return a - b;
        } 
    
    }
    
    
    /**
     *
     * @title  EtherollToken
     * 
     * The official token powering etheroll.
     * EtherollToken is a ERC.20 standard token with some custom functionality
     *
     */ 
    
    
    contract EtherollToken is owned, DSSafeAddSub {
    
        /* check address */
        modifier onlyBy(address _account) {
            if (msg.sender != _account) throw;
            _;
        }    
    
        /* vars */
        string public standard = 'Token 1.0';
        string public name = "DICE";
        string public symbol = "ROL";
        uint8 public decimals = 16;
        uint public totalSupply = 250000000000000000000000; 
    
        address public priviledgedAddress;  
        bool public tokensFrozen;
        uint public crowdfundDeadline = now + 2 * 1 weeks;       
        uint public nextFreeze = now + 12 * 1 weeks;
        uint public nextThaw = now + 13 * 1 weeks;
       
    
        /* map balances */
        mapping (address => uint) public balanceOf;
        mapping (address => mapping (address => uint)) public allowance;  
    
        /* events */
        event Transfer(address indexed _from, address indexed _to, uint256 _value);
        event Approval(address indexed _owner, address indexed _spender, uint256 _value);
        event LogTokensFrozen(bool indexed Frozen);    
    
        /*
        *  @notice sends all tokens to msg.sender on init    
        */  
        function EtherollToken(){
            /* send creator all initial tokens 25,000,000 */
            balanceOf[msg.sender] = 250000000000000000000000;
            /* tokens are not frozen */  
            tokensFrozen = false;                                      
    
        }  
    
        /*
        *  @notice public function    
        *  @param _to address to send tokens to   
        *  @param _value number of tokens to transfer 
        *  @returns boolean success         
        */     
        function transfer(address _to, uint _value) public
            returns (bool success)    
        {
            if(tokensFrozen && msg.sender != priviledgedAddress) return false;  /* transfer only by priviledgedAddress during crowdfund or reward phases */
            if (balanceOf[msg.sender] < _value) return false;                   /* check if the sender has enough */
            if (balanceOf[_to] + _value < balanceOf[_to]) return false;         /* check for overflows */              
            balanceOf[msg.sender] -=  _value;                                   /* subtract from the sender */
            balanceOf[_to] += _value;                                           /* add the same to the recipient */
            Transfer(msg.sender, _to, _value);                                  /* notify anyone listening that this transfer took place */
            return true;
        }      
    
        /*
        *  @notice public function    
        *  @param _from address to send tokens from 
        *  @param _to address to send tokens to   
        *  @param _value number of tokens to transfer     
        *  @returns boolean success      
        *  another contract attempts to spend tokens on your behalf
        */       
        function transferFrom(address _from, address _to, uint _value) public
            returns (bool success) 
        {                
            if(tokensFrozen && msg.sender != priviledgedAddress) return false;  /* transfer only by priviledgedAddress during crowdfund or reward phases */
            if (balanceOf[_from] < _value) return false;                        /* check if the sender has enough */
            if (balanceOf[_to] + _value < balanceOf[_to]) return false;         /* check for overflows */                
            if (_value > allowance[_from][msg.sender]) return false;            /* check allowance */
            balanceOf[_from] -= _value;                                         /* subtract from the sender */
            balanceOf[_to] += _value;                                           /* add the same to the recipient */
            allowance[_from][msg.sender] -= _value;                             /* reduce allowance */
            Transfer(_from, _to, _value);                                       /* notify anyone listening that this transfer took place */
            return true;
        }        
     
        /*
        *  @notice public function    
        *  @param _spender address being granted approval to spend on behalf of msg.sender
        *  @param _value number of tokens granted approval for _spender to spend on behalf of msg.sender    
        *  @returns boolean success      
        *  approves another contract to spend some tokens on your behalf
        */      
        function approve(address _spender, uint _value) public
            returns (bool success)
        {
            /* set allowance for _spender on behalf of msg.sender */
            allowance[msg.sender][_spender] = _value;
    
            /* log event about transaction */
            Approval(msg.sender, _spender, _value);        
            return true;
        } 
      
        /*
        *  @notice address restricted function 
        *  crowdfund contract calls this to burn its unsold coins 
        */     
        function priviledgedAddressBurnUnsoldCoins() public
            /* only crowdfund contract can call this */
            onlyBy(priviledgedAddress)
        {
            /* totalSupply should equal total tokens in circulation */
            totalSupply = safeSub(totalSupply, balanceOf[priviledgedAddress]); 
            /* burns unsold tokens from crowdfund address */
            balanceOf[priviledgedAddress] = 0;
        }
    
        /*
        *  @notice public function 
        *  locks/unlocks tokens on a recurring cycle
        */         
        function updateTokenStatus() public
        {
            
            /* locks tokens during initial crowdfund period */
            if(now < crowdfundDeadline){                       
                tokensFrozen = true;         
                LogTokensFrozen(tokensFrozen);  
            }  
    
            /* locks tokens */
            if(now >= nextFreeze){          
                tokensFrozen = true;
                LogTokensFrozen(tokensFrozen);  
            }
    
            /* unlocks tokens */
            if(now >= nextThaw){         
                tokensFrozen = false;
                nextFreeze = now + 12 * 1 weeks;
                nextThaw = now + 13 * 1 weeks;              
                LogTokensFrozen(tokensFrozen);  
            }        
          
        }                              
    
        /*
        *  @notice owner restricted function
        *  @param _newPriviledgedAddress the address
        *  only this address can burn unsold tokens
        *  transfer tokens only by priviledgedAddress during crowdfund or reward phases
        */      
        function ownerSetPriviledgedAddress(address _newPriviledgedAddress) public 
            onlyOwner
        {
            priviledgedAddress = _newPriviledgedAddress;
        }   
                        
        
    }