Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 16 from a total of 16 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Register | 17389106 | 575 days ago | IN | 0 ETH | 0.00258083 | ||||
Register | 17385501 | 575 days ago | IN | 0 ETH | 0.0017104 | ||||
Register | 17384628 | 575 days ago | IN | 0 ETH | 0.00252091 | ||||
Register | 17384048 | 575 days ago | IN | 0 ETH | 0.00317155 | ||||
Register | 17365268 | 578 days ago | IN | 0 ETH | 0.00417893 | ||||
Register | 17365213 | 578 days ago | IN | 0 ETH | 0.00313368 | ||||
Register | 17363429 | 578 days ago | IN | 0 ETH | 0.00248627 | ||||
Register | 17358519 | 579 days ago | IN | 0 ETH | 0.00279544 | ||||
Register | 17357803 | 579 days ago | IN | 0 ETH | 0.00278833 | ||||
Register | 17357542 | 579 days ago | IN | 0 ETH | 0.00185596 | ||||
Register | 17353480 | 580 days ago | IN | 0 ETH | 0.00211597 | ||||
Register | 17352478 | 580 days ago | IN | 0 ETH | 0.00206864 | ||||
Register | 17352465 | 580 days ago | IN | 0 ETH | 0.0008773 | ||||
Register | 17352460 | 580 days ago | IN | 0 ETH | 0.00250094 | ||||
Register | 17351088 | 580 days ago | IN | 0 ETH | 0.00211942 | ||||
Register | 16583839 | 688 days ago | IN | 0 ETH | 0.00267381 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
AffiliateProgram
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 10000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity =0.8.17; import "./interfaces/IAffiliateProgram.sol"; // contract AffiliateProgram is IAffiliateProgram { struct Account { bool registered; address affiliate; address[] referrals; } mapping(address => Account) public accounts; event RegisteredAffiliate(address affiliate); event RegisteredReferer(address affiliate, address referrer); function register() external { require(!accounts[msg.sender].registered, "Already registered"); accounts[msg.sender].registered = true; emit RegisteredAffiliate(msg.sender); } // @dev called by referral function register(address _affiliate) external { require(!accounts[msg.sender].registered, "Already registered"); require(_affiliate != address(0), "Zero address affiliate"); require(_affiliate != msg.sender, "You cannot refer yourself"); uint len = accounts[_affiliate].referrals.length; if (len == 0) { accounts[_affiliate].registered = true; emit RegisteredAffiliate(_affiliate); } accounts[_affiliate].referrals.push(msg.sender); accounts[msg.sender].affiliate = _affiliate; accounts[msg.sender].registered = true; emit RegisteredAffiliate(msg.sender); emit RegisteredReferer(_affiliate, msg.sender); } /** * @dev Utils function for check whether an address has the referrer */ function hasAffiliate(address _addr) external view override returns (bool result) { result = accounts[_addr].affiliate != address(0); } /** * @dev Utils function for check whether an address has the referrer */ function countReferrals(address _addr) external view override returns (uint256 amount) { amount = accounts[_addr].referrals.length; } /** * @dev Utils function for check whether an address has the referrer */ function getAffiliate(address _addr) external view override returns (address result) { result = accounts[_addr].affiliate; } /** * @dev Utils function for check whether an address has the referrer */ function getReferrals(address _addr) external view override returns (address[] memory result) { result = accounts[_addr].referrals; } }
// SPDX-License-Identifier: MIT pragma solidity =0.8.17; interface IAffiliateProgram { function hasAffiliate(address _addr) external view returns (bool result); function countReferrals(address _addr) external view returns (uint256 amount); function getAffiliate(address _addr) external view returns (address account); function getReferrals(address _addr) external view returns (address[] memory results); }
{ "optimizer": { "enabled": true, "runs": 10000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"affiliate","type":"address"}],"name":"RegisteredAffiliate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"affiliate","type":"address"},{"indexed":false,"internalType":"address","name":"referrer","type":"address"}],"name":"RegisteredReferer","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"accounts","outputs":[{"internalType":"bool","name":"registered","type":"bool"},{"internalType":"address","name":"affiliate","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"countReferrals","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"getAffiliate","outputs":[{"internalType":"address","name":"result","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"getReferrals","outputs":[{"internalType":"address[]","name":"result","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"hasAffiliate","outputs":[{"internalType":"bool","name":"result","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"register","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_affiliate","type":"address"}],"name":"register","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506107e1806100206000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80635e5c06e21161005b5780635e5c06e2146100c8578063691c10f214610134578063898ee25914610184578063bc019eed146101cb57600080fd5b80631aa3a0081461008257806341a0894d1461008c5780634420e486146100b5575b600080fd5b61008a61022e565b005b61009f61009a366004610714565b610319565b6040516100ac9190610751565b60405180910390f35b61008a6100c3366004610714565b6103aa565b6101086100d6366004610714565b60006020819052908152604090205460ff811690610100900473ffffffffffffffffffffffffffffffffffffffff1682565b60408051921515835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016100ac565b610174610142366004610714565b73ffffffffffffffffffffffffffffffffffffffff908116600090815260208190526040902054610100900416151590565b60405190151581526020016100ac565b6101bd610192366004610714565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090206001015490565b6040519081526020016100ac565b6102096101d9366004610714565b73ffffffffffffffffffffffffffffffffffffffff90811660009081526020819052604090205461010090041690565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100ac565b3360009081526020819052604090205460ff16156102ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f416c72656164792072656769737465726564000000000000000000000000000060448201526064015b60405180910390fd5b336000818152602081815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905590519182527f3a7ae7020e7cdeb58caa0f6fa4bc8f8bdfb718c1390b974b940b2dfff1eaa9c5910160405180910390a1565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602081815260409182902060010180548351818402810184019094528084526060939283018282801561039e57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610373575b50505050509050919050565b3360009081526020819052604090205460ff1615610424576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f416c72656164792072656769737465726564000000000000000000000000000060448201526064016102a4565b73ffffffffffffffffffffffffffffffffffffffff81166104a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f5a65726f206164647265737320616666696c696174650000000000000000000060448201526064016102a4565b3373ffffffffffffffffffffffffffffffffffffffff821603610520576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f596f752063616e6e6f7420726566657220796f757273656c660000000000000060448201526064016102a4565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260208190526040812060010154908190036105d25773ffffffffffffffffffffffffffffffffffffffff82166000818152602081815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905590519182527f3a7ae7020e7cdeb58caa0f6fa4bc8f8bdfb718c1390b974b940b2dfff1eaa9c5910160405180910390a15b73ffffffffffffffffffffffffffffffffffffffff8216600081815260208181526040808320600190810180548083018255908552838520018054337fffffffffffffffffffffffff000000000000000000000000000000000000000090911681179091558085529382902080547fffffffffffffffffffffff000000000000000000000000000000000000000000166101009096027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016959095171790935591519081527f3a7ae7020e7cdeb58caa0f6fa4bc8f8bdfb718c1390b974b940b2dfff1eaa9c5910160405180910390a16040805173ffffffffffffffffffffffffffffffffffffffff841681523360208201527ffaf63637882ff2d63ca76881cf92fb857130e36f350c926f9cc884b499b42b77910160405180910390a15050565b60006020828403121561072657600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461074a57600080fd5b9392505050565b6020808252825182820181905260009190848201906040850190845b8181101561079f57835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161076d565b5090969550505050505056fea2646970667358221220c2ad070b4b61707f7144fe79c01f20ea073f3fa72e377910cc754bd431c6d40264736f6c63430008110033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c80635e5c06e21161005b5780635e5c06e2146100c8578063691c10f214610134578063898ee25914610184578063bc019eed146101cb57600080fd5b80631aa3a0081461008257806341a0894d1461008c5780634420e486146100b5575b600080fd5b61008a61022e565b005b61009f61009a366004610714565b610319565b6040516100ac9190610751565b60405180910390f35b61008a6100c3366004610714565b6103aa565b6101086100d6366004610714565b60006020819052908152604090205460ff811690610100900473ffffffffffffffffffffffffffffffffffffffff1682565b60408051921515835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016100ac565b610174610142366004610714565b73ffffffffffffffffffffffffffffffffffffffff908116600090815260208190526040902054610100900416151590565b60405190151581526020016100ac565b6101bd610192366004610714565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090206001015490565b6040519081526020016100ac565b6102096101d9366004610714565b73ffffffffffffffffffffffffffffffffffffffff90811660009081526020819052604090205461010090041690565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100ac565b3360009081526020819052604090205460ff16156102ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f416c72656164792072656769737465726564000000000000000000000000000060448201526064015b60405180910390fd5b336000818152602081815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905590519182527f3a7ae7020e7cdeb58caa0f6fa4bc8f8bdfb718c1390b974b940b2dfff1eaa9c5910160405180910390a1565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602081815260409182902060010180548351818402810184019094528084526060939283018282801561039e57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610373575b50505050509050919050565b3360009081526020819052604090205460ff1615610424576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f416c72656164792072656769737465726564000000000000000000000000000060448201526064016102a4565b73ffffffffffffffffffffffffffffffffffffffff81166104a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f5a65726f206164647265737320616666696c696174650000000000000000000060448201526064016102a4565b3373ffffffffffffffffffffffffffffffffffffffff821603610520576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f596f752063616e6e6f7420726566657220796f757273656c660000000000000060448201526064016102a4565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260208190526040812060010154908190036105d25773ffffffffffffffffffffffffffffffffffffffff82166000818152602081815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905590519182527f3a7ae7020e7cdeb58caa0f6fa4bc8f8bdfb718c1390b974b940b2dfff1eaa9c5910160405180910390a15b73ffffffffffffffffffffffffffffffffffffffff8216600081815260208181526040808320600190810180548083018255908552838520018054337fffffffffffffffffffffffff000000000000000000000000000000000000000090911681179091558085529382902080547fffffffffffffffffffffff000000000000000000000000000000000000000000166101009096027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016959095171790935591519081527f3a7ae7020e7cdeb58caa0f6fa4bc8f8bdfb718c1390b974b940b2dfff1eaa9c5910160405180910390a16040805173ffffffffffffffffffffffffffffffffffffffff841681523360208201527ffaf63637882ff2d63ca76881cf92fb857130e36f350c926f9cc884b499b42b77910160405180910390a15050565b60006020828403121561072657600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461074a57600080fd5b9392505050565b6020808252825182820181905260009190848201906040850190845b8181101561079f57835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161076d565b5090969550505050505056fea2646970667358221220c2ad070b4b61707f7144fe79c01f20ea073f3fa72e377910cc754bd431c6d40264736f6c63430008110033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.