Contract

0x2f5a0719E25FFc7044F89119b0b5c19B320D8C78

Overview
0.0000 Trust Bitcoin
$0.0000
More Info
 
Contract Source Code Verified (Exact Match)
Referrals
Yes with 200 runs

0.8.10+commit.fc410830
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)

File 1 of 1 : Referrals.sol

// SPDX-License-Identifier: MIT pragma solidity 0.8.10; contract Referrals { address investmentPlan; struct Team{ uint256 member; } mapping(address => address) public mapSponsor; mapping(address => Team[10]) public mapTeam; mapping(address => mapping(uint256 => address[])) public mapTeamAddress; event TeamMember(address investor, address sponsor); constructor(address plan) { investmentPlan = address(plan); } function addMember(address investor, address sponsor) external { require(address(msg.sender) == address(investmentPlan), "Incorrect request"); require(address(investor) != address(0) && address(sponsor) != address(0), "Zero address"); require(address(investor) != address(sponsor), "Referrer different required"); require(mapSponsor[address(investor)] == address(0), "Member already added in list"); mapSponsor[address(investor)] = address(sponsor); enterTeam(address(investor)); emit TeamMember(investor, sponsor); } function enterTeam(address investor) internal { address nextSponsor = mapSponsor[address(investor)]; for(uint256 i= 0; i < 10; i++) { if(address(nextSponsor) != address(0)) { mapTeamAddress[address(nextSponsor)][i].push(address(investor)); mapTeam[address(nextSponsor)][i].member += 1; } else { break; } nextSponsor = address(mapSponsor[address(nextSponsor)]); } } function getTeam(address sponsor, uint256 level) external view returns(uint256){ return mapTeam[address(sponsor)][level].member; } function getSponsor(address teamMember) external view returns (address) { return mapSponsor[address(teamMember)]; } }
ABI Code (Solidity Standard Json-Input format)

File 1 of 1 : ABI.json

[ { "inputs": [ { "internalType": "address", "name": "plan", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "investor", "type": "address" }, { "indexed": false, "internalType": "address", "name": "sponsor", "type": "address" } ], "name": "TeamMember", "type": "event" }, { "inputs": [ { "internalType": "address", "name": "investor", "type": "address" }, { "internalType": "address", "name": "sponsor", "type": "address" } ], "name": "addMember", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "teamMember", "type": "address" } ], "name": "getSponsor", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "sponsor", "type": "address" }, { "internalType": "uint256", "name": "level", "type": "uint256" } ], "name": "getTeam", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "mapSponsor", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" }, { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "mapTeam", "outputs": [ { "internalType": "uint256", "name": "member", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" }, { "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "mapTeamAddress", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" } ]
Contract Creation Code
0x608060405234801561001057600080fd5b50600436106100625760003560e01c806365c2fc8b14610067578063743fc745146100ad57806380f78b3f146100d95780639d58b15d146100fa578063db56da811461010f578063fc880b4914610122575b600080fd5b6100906100753660046104ce565b6001602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100906100bb3660046104ce565b6001600160a01b039081166000908152600160205260409020541690565b6100ec6100e73660046104f0565b610135565b6040519081526020016100a4565b61010d61010836600461051a565b610167565b005b61009061011d36600461054d565b61035d565b6100ec6101303660046104f0565b6103a2565b6001600160a01b038216600090815260026020526040812082600a811061015e5761015e610580565b01549392505050565b6000546001600160a01b031633146101ba5760405162461bcd60e51b8152602060048201526011602482015270125b98dbdc9c9958dd081c995c5d595cdd607a1b60448201526064015b60405180910390fd5b6001600160a01b038216158015906101da57506001600160a01b03811615155b6102155760405162461bcd60e51b815260206004820152600c60248201526b5a65726f206164647265737360a01b60448201526064016101b1565b806001600160a01b0316826001600160a01b031614156102775760405162461bcd60e51b815260206004820152601b60248201527f526566657272657220646966666572656e74207265717569726564000000000060448201526064016101b1565b6001600160a01b0382811660009081526001602052604090205416156102df5760405162461bcd60e51b815260206004820152601c60248201527f4d656d62657220616c726561647920616464656420696e206c6973740000000060448201526064016101b1565b6001600160a01b03828116600090815260016020526040902080546001600160a01b031916918316919091179055610316826103c7565b604080516001600160a01b038085168252831660208201527f19eb824b0129c0bbf999607801d126441f91e6e01b3bc3fbac8b178805cb3207910160405180910390a15050565b6003602052826000526040600020602052816000526040600020818154811061038557600080fd5b6000918252602090912001546001600160a01b0316925083915050565b600260205281600052604060002081600a81106103be57600080fd5b01549150829050565b6001600160a01b03808216600090815260016020526040812054909116905b600a81101561047d576001600160a01b0382161561047d576001600160a01b03828116600081815260036020908152604080832086845282528083208054600180820183559185528385200180546001600160a01b031916968a1696909617909555928252600290522082600a811061046157610461610580565b0180546000906104729084906105ac565b909155506104829050565b505050565b6001600160a01b0391821660009081526001602052604090205490911690806104aa816105c4565b9150506103e6565b80356001600160a01b03811681146104c957600080fd5b919050565b6000602082840312156104e057600080fd5b6104e9826104b2565b9392505050565b6000806040838503121561050357600080fd5b61050c836104b2565b946020939093013593505050565b6000806040838503121561052d57600080fd5b610536836104b2565b9150610544602084016104b2565b90509250929050565b60008060006060848603121561056257600080fd5b61056b846104b2565b95602085013595506040909401359392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156105bf576105bf610596565b500190565b60006000198214156105d8576105d8610596565b506001019056fea26469706673582212209333000d7de49c2e1ce6a5e396f542b25e66c3a7cc082ed00c5120b95d2411d064736f6c634300080a0033
1. getSponsor

2. getTeam

3. mapSponsor

4. mapTeam

5. mapTeamAddress

1. addMember

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met.