Transaction Hash:
Block:
5381516 at Apr-04-2018 10:26:26 PM +UTC
Transaction Fee:
0.000231112109131089 ETH
$0.46
Gas Used:
231,089 Gas / 1.000100001 Gwei
Emitted Events:
| 53 |
0x71d271f8b14adef568f8f28f1587ce7271ac4ca5.0x09e48df7857bd0c1e0d31bb8a85d42cf1874817895f171c917f6ee2cea73ec20( 0x09e48df7857bd0c1e0d31bb8a85d42cf1874817895f171c917f6ee2cea73ec20, 000000000000000000000000a779473e42b04fc1b2dd55a308a0d1dc03c427af, 000000000000000000000000675365b65b7624ba9ecb9e77f44bdf48882cb23a )
|
Account State Difference:
| Address | Before | After | State Difference | ||
|---|---|---|---|---|---|
|
0x52bc44d5...b7d7bE3b5
Miner
| (Nanopool) | 5,058.478729286055820937 Eth | 5,058.478960398164952026 Eth | 0.000231112109131089 | |
| 0x675365B6...8882cb23A |
0 Eth
Nonce: 0
|
0 Eth
Nonce: 1
| |||
| 0x71d271f8...271AC4Ca5 | |||||
| 0x9901C66F...708BECA70 |
13.04027878338550233 Eth
Nonce: 364402
|
13.040047671276371241 Eth
Nonce: 364403
| 0.000231112109131089 | ||
| 0xA779473e...c03c427aF |
0 Eth
Nonce: 0
|
0 Eth
Nonce: 1
|
Execution Trace
0x71d271f8b14adef568f8f28f1587ce7271ac4ca5.a6ec80e2( )
-
Ambi2.hasRole( _from=0x71d271f8B14adEf568F8f28f1587ce7271AC4Ca5, _role=6465706C6F790000000000000000000000000000000000000000000000000000, _to=0x9901C66F2d4b95F7074b553DA78084D708BECA70 ) => ( True ) -
0x675365b65b7624ba9ecb9e77f44bdf48882cb23a.60606040( ) -
0xa779473e42b04fc1b2dd55a308a0d1dc03c427af.60606040( ) 0x675365b65b7624ba9ecb9e77f44bdf48882cb23a.f8a6c595( )-
0x072461a5e18f444b1cf2e8dde6dfb1af39197316.f8a6c595( )
-
0xa779473e42b04fc1b2dd55a308a0d1dc03c427af.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);
}
}