Transaction Hash:
Block:
7971512 at Jun-16-2019 07:55:06 PM +UTC
Transaction Fee:
0.002118036 ETH
$4.19
Gas Used:
176,503 Gas / 12 Gwei
Emitted Events:
Account State Difference:
| Address | Before | After | State Difference | ||
|---|---|---|---|---|---|
| 0x08f25258...4aED662c1 | 0.012077400933596033 Eth | 0.023324436665083583 Eth | 0.01124703573148755 | ||
| 0x0f1c3eec...ab4c080B6 | 0.030782262154033927 Eth | 0.032656768109281852 Eth | 0.001874505955247925 | ||
| 0x232D684A...60A76cc73 | 0.071766489235270725 Eth | 0.07364099519051865 Eth | 0.001874505955247925 | ||
| 0x4CbbF243...Cf0747955 |
0.10301005007838782 Eth
Nonce: 1
|
0.048405847331445919 Eth
Nonce: 2
| 0.054604202746941901 | ||
|
0x52bc44d5...b7d7bE3b5
Miner
| (Nanopool) | 5,170.998497495617967668 Eth | 5,171.000615531617967668 Eth | 0.002118036 | |
| 0x57CCe169...7Eaf3fF2b | 0.040046944438308369 Eth | 0.053168486125043845 Eth | 0.013121541686735476 | ||
| 0x5f05A8B9...64564301c | 0.180223746589491727 Eth | 0.183972758499987577 Eth | 0.00374901191049585 | ||
| 0x5Fc03fDf...CCa7BcB8B | 0.070219296624344444 Eth | 0.072093802579592369 Eth | 0.001874505955247925 | ||
| 0x827bDfdF...D18AA6Eae | 0.08619547357326293 Eth | 0.08994448548375878 Eth | 0.00374901191049585 | ||
| 0x8E5319dc...dA2BeCC81 | 0.03789366564228012 Eth | 0.04164267755277597 Eth | 0.00374901191049585 | ||
| 0x96Ac1F87...a00A76b02 | 0.023176342154033927 Eth | 0.025050848109281852 Eth | 0.001874505955247925 | ||
| 0xa25e4A3e...63cfF3607 | 0.047348697031287824 Eth | 0.049223202986535749 Eth | 0.001874505955247925 | ||
| 0xb01d6ADD...3B42f87Df | 0.051036365060824375 Eth | 0.054785376971320225 Eth | 0.00374901191049585 | ||
| 0xc674D36B...FC9995eF3 | 0.381347279097585927 Eth | 0.383221785052833852 Eth | 0.001874505955247925 | ||
| 0xEECDA218...C3BaB370f | 0.318056995167136062 Eth | 0.319931501122383987 Eth | 0.001874505955247925 |
Execution Trace
ETH 0.052486166746941901
SuperOneSpots.distributeCommission( beneficiaries=[0x5Fc03fDf88e0aD5F102D1fb4b2550a6CCa7BcB8B, 0x232D684A0C97bF1b828050ec6AB039760A76cc73, 0xa25e4A3eC30f4E23C00e53F5d2035D663cfF3607, 0x96Ac1F872510398a05207dd1a1c7D2Fa00A76b02, 0xc674D36B9094Ced598686ba266e60D0FC9995eF3, 0xb01d6ADD06F0ec4427B0B6eafdcf8443B42f87Df, 0x08f2525850AEBb0b4BbBdA3BD9982734aED662c1, 0x0f1c3eec07a5d6c021589509F7Ed3Baab4c080B6, 0x8E5319dcF9B5D612cEEe03fbe2A6F64dA2BeCC81, 0x827bDfdF99fB74359CD1C468706D37eD18AA6Eae, 0x57CCe16963710028e573CeC79bA7a6e7Eaf3fF2b, 0x5f05A8B9a86fb46CddC7Ad93A62880d64564301c, 0xEECDA21882df3B0B01502bCE8Ff6e94C3BaB370f], amounts=[1874505955247925, 1874505955247925, 1874505955247925, 1874505955247925, 1874505955247925, 3749011910495850, 11247035731487550, 1874505955247925, 3749011910495850, 3749011910495850, 13121541686735476, 3749011910495850, 1874505955247925] )
- ETH 0.001874505955247925
0x5fc03fdf88e0ad5f102d1fb4b2550a6cca7bcb8b.CALL( ) - ETH 0.001874505955247925
0x232d684a0c97bf1b828050ec6ab039760a76cc73.CALL( ) - ETH 0.001874505955247925
0xa25e4a3ec30f4e23c00e53f5d2035d663cff3607.CALL( ) - ETH 0.001874505955247925
0x96ac1f872510398a05207dd1a1c7d2fa00a76b02.CALL( ) - ETH 0.001874505955247925
0xc674d36b9094ced598686ba266e60d0fc9995ef3.CALL( ) - ETH 0.00374901191049585
0xb01d6add06f0ec4427b0b6eafdcf8443b42f87df.CALL( ) - ETH 0.01124703573148755
0x08f2525850aebb0b4bbbda3bd9982734aed662c1.CALL( ) - ETH 0.001874505955247925
0x0f1c3eec07a5d6c021589509f7ed3baab4c080b6.CALL( ) - ETH 0.00374901191049585
0x8e5319dcf9b5d612ceee03fbe2a6f64da2becc81.CALL( ) - ETH 0.00374901191049585
0x827bdfdf99fb74359cd1c468706d37ed18aa6eae.CALL( ) - ETH 0.013121541686735476
0x57cce16963710028e573cec79ba7a6e7eaf3ff2b.CALL( ) - ETH 0.00374901191049585
0x5f05a8b9a86fb46cddc7ad93a62880d64564301c.CALL( ) - ETH 0.001874505955247925
0xeecda21882df3b0b01502bce8ff6e94c3bab370f.CALL( )
distributeCommission[SuperOneSpots (ln:231)]
transfer[SuperOneSpots (ln:234)]CommissionSent[SuperOneSpots (ln:235)]
pragma solidity ^0.5.7;
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public{
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract User is Ownable {
event UserRegistered(address internal_wallet_address, address external_wallet_address, address referrer, bytes32 nick_name, bytes32 geo_location);
event UserNickNameUpdated(address external_wallet_address, bytes32 old_nick_name, bytes32 new_nick_name);
event UserGeoLocationUpdated(address external_wallet_address, bytes32 old_geo_location, bytes32 new_geo_location);
struct UserDetails {
bytes32 nick_name;
address payable referrer;
bytes32 geo_location;
}
// address details
mapping(address => UserDetails) public users;
// mapping of internal wallet to external wallet
mapping(address => address) public internal_to_external;
// mapping of external wallet to internal wallet
mapping(address => address) public external_to_internal;
// all referees for an address
mapping(address => address[]) public referees;
constructor() public {
UserDetails memory root = UserDetails({
nick_name : "new",
referrer : address(0),
geo_location : "51.507351,-0.127758" // London
});
users[msg.sender] = root;
internal_to_external[msg.sender] = msg.sender;
}
/**
* @dev method to register users, can be called by admin only
* @param _internal_wallet_addresses internal wallet addresses array
* @param _external_wallet_addresses external wallet addresses array
* @param _referrers referrers array
* @param _nick_names nick names array
* @param _geo_locations geo locations array
*/
function registerUsers(
address payable[] calldata _internal_wallet_addresses,
address payable[] calldata _external_wallet_addresses,
address payable[] calldata _referrers,
bytes32[] calldata _nick_names,
bytes32[] calldata _geo_locations) external onlyOwner() {
for (uint256 i; i < _internal_wallet_addresses.length; i++) {
UserDetails memory ud = UserDetails({
nick_name : _nick_names[i],
referrer : _referrers[i],
geo_location : _geo_locations[i]
});
users[_external_wallet_addresses[i]] = ud;
referees[_referrers[i]].push(_external_wallet_addresses[i]);
internal_to_external[_internal_wallet_addresses[i]] = _external_wallet_addresses[i];
external_to_internal[_external_wallet_addresses[i]] = _internal_wallet_addresses[i];
emit UserRegistered(_internal_wallet_addresses[i], _external_wallet_addresses[i], _referrers[i], _nick_names[i], _geo_locations[i]);
}
}
/**
* @dev method to register user, can be called by admin only
* @param _internal_wallet_address internal wallet address
* @param _external_wallet_address external wallet address
* @param _referrer referrer
* @param _nick_name nick name
* @param _geo_location geo location
*/
function registerUser(
address payable _internal_wallet_address,
address payable _external_wallet_address,
address payable _referrer,
bytes32 _nick_name,
bytes32 _geo_location) external onlyOwner() {
UserDetails memory ud = UserDetails({
nick_name : _nick_name,
referrer : _referrer,
geo_location : _geo_location
});
users[_external_wallet_address] = ud;
referees[_referrer].push(_external_wallet_address);
internal_to_external[_internal_wallet_address] = _external_wallet_address;
external_to_internal[_external_wallet_address] = _internal_wallet_address;
emit UserRegistered(_internal_wallet_address, _external_wallet_address, _referrer, _nick_name, _geo_location);
}
/**
* @dev method to update users nick name, can be called external address only
* @param _nick_name new nick name
*/
function updateNickname(bytes32 _nick_name) external {
require(external_to_internal[msg.sender] != address(0));
UserDetails memory ud = users[msg.sender];
require(ud.nick_name != bytes32(0), "user does not esist!");
bytes32 old_nick_name = ud.nick_name;
ud.nick_name = _nick_name;
users[msg.sender] = ud;
emit UserNickNameUpdated(msg.sender, old_nick_name, _nick_name);
}
/**
* @dev method to update users geo location, can be called external address only
* @param _geo_location new geo location
*/
function updateGeoLocation(bytes32 _geo_location) external {
require(external_to_internal[msg.sender] != address(0));
UserDetails memory ud = users[msg.sender];
require(ud.nick_name != bytes32(0), "user does not esist!");
bytes32 old_geo_location = ud.geo_location;
ud.geo_location = _geo_location;
users[msg.sender] = ud;
emit UserGeoLocationUpdated(msg.sender, old_geo_location, _geo_location);
}
/**
* @dev Throws if called by any account other than the internal wallet.
*/
modifier onlyInternalWallets() {
require(internal_to_external[msg.sender] != address(0));
_;
}
}
contract SuperOneSpots is User {
event Withdrawal(address wallet, uint256 weiAmount);
event CommissionSent(address indexed from, address to, uint256 amount);
// coordinates to Spot index first is level(x) then mapping of y to owner address
mapping(uint256 => mapping(uint256 => address)) public coordinates;
// mapping to return what to add according to x index
mapping(uint256 => uint256) public x_addition;
// mapping to return what to add according to y index
mapping(uint256 => uint256) public y_addition;
// Constructor to bootstartp the contract
constructor() public {
// initial coordinates belongs to owner
coordinates[0][0] = msg.sender;
uint256 x_factor = 1;
uint256 y_factor;
//pre fill x_addition for level calculation in the tree
for (uint256 i; i < 128; i++) {
// for x_addition
if ((i + 2) >= (2 * (2 ** x_factor))) {
x_factor += 1;
y_factor = 1;
} else {
y_factor += 1;
}
x_addition[i] = x_factor;
y_addition[i] = y_factor - 1;
}
}
/**
* @dev method to assign spots, can be called by admin only
* @param coord_x coordinate x of the tree to start
* @param coord_y coordinate y of the tree to start
* @param _count count of spots to be assigned
*/
function assignSpotsByAdmin(uint256 coord_x, uint256 coord_y, uint _count, address external_wallet_address) external onlyOwner() {
require(_count < 128);
coordinates[coord_x][coord_y] = external_wallet_address;
for (uint256 i; i < _count - 1; i++) {
coordinates[coord_x + x_addition[i]][coord_y * (2 * (2 ** (x_addition[i] - 1))) + y_addition[i]] = external_wallet_address;
}
}
/**
* @dev method to assign spots, can be called by internal wallets only
* @param coord_x coordinate x of the tree to start
* @param coord_y coordinate y of the tree to start
* @param _count count of spots to be assigned
*/
function assignSpots(uint256 coord_x, uint256 coord_y, uint _count) external onlyInternalWallets() {
require(_count < 128);
address wallet = internal_to_external[msg.sender];
coordinates[coord_x][coord_y] = wallet;
for (uint256 i; i < _count - 1; i++) {
coordinates[coord_x + x_addition[i]][coord_y * (2 * (2 ** (x_addition[i] - 1))) + y_addition[i]] = wallet;
}
}
/**
* @dev method to distribute Comission, can be called by internal wallets only
* @param beneficiaries address to which funds will be transferred
* @param amounts the amount of index wise benificiaries
*/
function distributeCommission(address payable[] calldata beneficiaries, uint256[] calldata amounts) external payable onlyInternalWallets() {
require(beneficiaries.length == amounts.length);
for (uint256 i; i < beneficiaries.length; i++) {
beneficiaries[i].transfer(amounts[i]);
emit CommissionSent(internal_to_external[msg.sender], beneficiaries[i], amounts[i]);
}
}
/**
* @dev method to withdraw funds only by owner
* @param _wallet address to which funds will be transferred
*/
function withdraw(address payable _wallet) onlyOwner() public {
uint256 weiAmount = address(this).balance;
require(weiAmount > 0);
_wallet.transfer(weiAmount);
emit Withdrawal(_wallet, weiAmount);
}
function checkSpots(uint256[] calldata x, uint256[] calldata y) external view returns (address[] memory){
address[] memory addresses;
for (uint256 i; i < x.length; i++) {
addresses[i] = coordinates[x[i]][y[i]];
}
return addresses;
}
}