Transaction Hash:
Block:
4126564 at Aug-07-2017 03:52:27 AM +UTC
Transaction Fee:
0.0001396008232668 ETH
$0.29
Gas Used:
232,668 Gas / 0.6000001 Gwei
Emitted Events:
| 65 |
0x5e3b08cd8a3b909e4396eda0818d5b1e4f43d4da.0x09e48df7857bd0c1e0d31bb8a85d42cf1874817895f171c917f6ee2cea73ec20( 0x09e48df7857bd0c1e0d31bb8a85d42cf1874817895f171c917f6ee2cea73ec20, 0000000000000000000000002170fcc259e4670b07d3894093995a23059dfd49, 0000000000000000000000005f6505bc6a6f6faa05fe3c606637cf8e7b4f0814 )
|
Account State Difference:
| Address | Before | After | State Difference | ||
|---|---|---|---|---|---|
| 0x2170FCc2...3059dFD49 |
0 Eth
Nonce: 0
|
0 Eth
Nonce: 1
| |||
| 0x5E3b08cD...E4f43d4dA | |||||
| 0x5F6505Bc...E7B4F0814 |
0 Eth
Nonce: 0
|
0 Eth
Nonce: 1
| |||
| 0x6C152910...9c54F2BA1 |
0.302484584165626516 Eth
Nonce: 20517
|
0.302344983342359716 Eth
Nonce: 20518
| 0.0001396008232668 | ||
|
0xb2930B35...e543a0347
Miner
| (MiningPoolHub: Old Address) | 21,985.472708194968814945 Eth | 21,985.472847795792081745 Eth | 0.0001396008232668 |
Execution Trace
0x5e3b08cd8a3b909e4396eda0818d5b1e4f43d4da.a6ec80e2( )
-
Ambi2.hasRole( _from=0x5E3b08cD8a3B909e4396EdA0818d5b1E4f43d4dA, _role=6465706C6F790000000000000000000000000000000000000000000000000000, _to=0x6C15291028D082E1b9358e19F15C83B9c54F2BA1 ) => ( True ) -
0x5f6505bc6a6f6faa05fe3c606637cf8e7b4f0814.60606040( ) -
0x2170fcc259e4670b07d3894093995a23059dfd49.60606040( ) 0x5f6505bc6a6f6faa05fe3c606637cf8e7b4f0814.f8a6c595( )-
0x94f323acad9382b99dd41298f6b64fc919166291.f8a6c595( )
-
0x2170fcc259e4670b07d3894093995a23059dfd49.4525f804( )-
0xa229469fd1eb571d53dea6c7d34f25712f881902.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);
}
}