ETH Price: $2,257.05 (-0.64%)

Transaction Decoder

Block:
4160078 at Aug-15-2017 07:51:32 AM +UTC
Transaction Fee:
0.000924356308965993 ETH $2.09
Gas Used:
231,089 Gas / 4.000001337 Gwei

Emitted Events:

4 0x279b045989bd4cd60ee4a53d2a1c0621a4b4623f.0x09e48df7857bd0c1e0d31bb8a85d42cf1874817895f171c917f6ee2cea73ec20( 0x09e48df7857bd0c1e0d31bb8a85d42cf1874817895f171c917f6ee2cea73ec20, 0000000000000000000000003315dcf4774e2092811e0df07e46bc03df49d3ea, 0000000000000000000000005ebd803404e2f2a4f7bb23f541901f00795e1f70 )

Account State Difference:

  Address   Before After State Difference Code
0x279B0459...1a4B4623F
0x3315dCF4...3Df49d3eA
0 Eth
Nonce: 0
0 Eth
Nonce: 1
From: 0 To: 1135446039619403524202016138352207812135339023439126778783100530404154628287047131436261575173055122805376197829428778122576767321622553158242749763332235063998863792388363758958056595295631555042497774188947433983151522651301609913286952630340814822649613489111724775884515006315370096586567946423511582919632683049
0x5EBd8034...0795e1f70
0 Eth
Nonce: 0
0 Eth
Nonce: 1
From: 0 To: 1135446039619403524202016138352207812135339023439126778783100530404154628287047131436261575173055122805376197829428769451457626143465163541075901579277759120439864780633872212054014336535030698151273453811692422864762470983036961036566192549591367716382163473534779528485392738869805663539461305947206701041331470377
0x6C152910...9c54F2BA1
6.445068121803438705 Eth
Nonce: 44885
6.444143765494472712 Eth
Nonce: 44886
0.000924356308965993
(Ethermine)
898.166600100942187069 Eth898.167524457251153062 Eth0.000924356308965993

Execution Trace

0x279b045989bd4cd60ee4a53d2a1c0621a4b4623f.a6ec80e2( )
  • Ambi2.hasRole( _from=0x279B045989BD4CD60Ee4a53d2a1C0621a4B4623F, _role=6465706C6F790000000000000000000000000000000000000000000000000000, _to=0x6C15291028D082E1b9358e19F15C83B9c54F2BA1 ) => ( True )
  • 0x5ebd803404e2f2a4f7bb23f541901f00795e1f70.60606040( )
  • 0x3315dcf4774e2092811e0df07e46bc03df49d3ea.60606040( )
  • 0x5ebd803404e2f2a4f7bb23f541901f00795e1f70.f8a6c595( )
    • 0x072461a5e18f444b1cf2e8dde6dfb1af39197316.f8a6c595( )
    • 0x3315dcf4774e2092811e0df07e46bc03df49d3ea.4525f804( )
      • 0xc3b2ae46792547a96b9f84405e36d0e07edcd05c.4525f804( )
        // This software is a subject to Ambisafe License Agreement.
        // No use or distribution is allowed without written permission from Ambisafe.
        // https://www.ambisafe.com/terms-of-use/
        
        pragma solidity ^0.4.8;
        
        contract Ambi2 {
            bytes32 constant OWNER = "__root__";
            uint constant LIFETIME = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
            mapping(bytes32 => uint) rolesExpiration;
            mapping(address => bool) nodes;
        
            event Assign(address indexed from, bytes32 indexed role, address indexed to, uint expirationDate);
            event Unassign(address indexed from, bytes32 indexed role, address indexed to);
            event Error(bytes32 message);
        
            modifier onlyNodeOwner(address _node) {
                if (isOwner(_node, msg.sender)) {
                    _;
                } else {
                    _error("Access denied: only node owner");
                }
            }
        
            function claimFor(address _address, address _owner) returns(bool) {
                if (nodes[_address]) {
                    _error("Access denied: already owned");
                    return false;
                }
                nodes[_address] = true;
                _assignRole(_address, OWNER, _owner, LIFETIME);
                return true;
            }
        
            function claim(address _address) returns(bool) {
                return claimFor(_address, msg.sender);
            }
        
            function assignOwner(address _node, address _owner) returns(bool) {
                return assignRole(_node, OWNER, _owner);
            }
        
            function assignRole(address _from, bytes32 _role, address _to) returns(bool) {
                return assignRoleWithExpiration(_from, _role, _to, LIFETIME);
            }
        
            function assignRoleWithExpiration(address _from, bytes32 _role, address _to, uint _expirationDate) onlyNodeOwner(_from) returns(bool) {
                if (hasRole(_from, _role, _to) && rolesExpiration[_getRoleSignature(_from, _role, _to)] == _expirationDate) {
                    _error("Role already assigned");
                    return false;
                }
                if (_isPast(_expirationDate)) {
                    _error("Invalid expiration date");
                    return false;
                }
        
                _assignRole(_from, _role, _to, _expirationDate);
                return true;
            }
        
            function _assignRole(address _from, bytes32 _role, address _to, uint _expirationDate) internal {
                rolesExpiration[_getRoleSignature(_from, _role, _to)] = _expirationDate;
                Assign(_from, _role, _to, _expirationDate);
            }
        
            function unassignOwner(address _node, address _owner) returns(bool) {
                if (_owner == msg.sender) {
                    _error("Cannot remove ownership");
                    return false;
                }
        
                return unassignRole(_node, OWNER, _owner);
            }
        
            function unassignRole(address _from, bytes32 _role, address _to) onlyNodeOwner(_from) returns(bool) {
                if (!hasRole(_from, _role, _to)) {
                    _error("Role not assigned");
                    return false;
                }
        
                delete rolesExpiration[_getRoleSignature(_from, _role, _to)];
                Unassign(_from, _role, _to);
                return true;
            }
        
            function hasRole(address _from, bytes32 _role, address _to) constant returns(bool) {
                return _isFuture(rolesExpiration[_getRoleSignature(_from, _role, _to)]);
            }
        
            function isOwner(address _node, address _owner) constant returns(bool) {
                return hasRole(_node, OWNER, _owner);
            }
        
            function _error(bytes32 _message) internal {
                Error(_message);
            }
        
            function _getRoleSignature(address _from, bytes32 _role, address _to) internal constant returns(bytes32) {
                return sha3(_from, _role, _to);
            }
        
            function _isPast(uint _timestamp) internal constant returns(bool) {
                return _timestamp < now;
            }
        
            function _isFuture(uint _timestamp) internal constant returns(bool) {
                return !_isPast(_timestamp);
            }
        }