Contract Address Details

Contract
0x0000000000000000000000000000000000001002
Balance
0.0 @G ($0.0)
Tokens
0 Tokens
$0.0 USD
Transactions
Gas Used
0
Contract Source Code Verified
Contract NameFilterContract
Compiler Versionv0.8.17+commit.8df45f5f
Optimization EnabledYes
Other SettingsDefault evmVersion
Contract Source Code (Solidity)
1
// SPDX-License-Identifier: MIT
2
 
3
pragma solidity ^0.8.6;
4
 
5
interface IKYCContract {
6
function level(address addr) external view returns (uint);
7
}
8
 
9
contract FilterContract {
10
 
11
// Filter levels of the users.
12
mapping(address => uint) filterLevel;
13
IKYCContract public kycContract;
14
 
15
event FilterLevelChanged(address indexed user, uint indexed level);
16
 
17
/**
18
* Setter of the users filter level.
19
*/
20
function setFilterLevel(uint _level) external {
21
filterLevel[msg.sender] = _level;
22
emit FilterLevelChanged(msg.sender, _level);
23
}
24
 
25
/**
26
* Getter of the users filter level.
27
*/
28
function viewFilterLevel() external view returns(uint){
29
return(filterLevel[msg.sender]);
30
}
31
 
32
/**
33
* Returns true if sender kyc level is greater than destination's filter level.
34
*/
35
function filter(address _sender, address _destination) external view returns(bool) {
36
return(kycContract.level(_sender) >= filterLevel[_destination]);
37
}
38
}
Contract ABI
[{"name": "FilterLevelChanged", "type": "event", "inputs": [{"name": "user", "type": "address", "indexed": true, "internalType": "address"}, {"name": "level", "type": "uint256", "indexed": true, "internalType": "uint256"}], "anonymous": false}, {"name": "filter", "type": "function", "inputs": [{"name": "_sender", "type": "address", "internalType": "address"}, {"name": "_destination", "type": "address", "internalType": "address"}], "outputs": [{"name": "", "type": "bool", "internalType": "bool"}], "stateMutability": "view"}, {"name": "kycContract", "type": "function", "inputs": [], "outputs": [{"name": "", "type": "address", "internalType": "contract IKYCContract"}], "stateMutability": "view"}, {"name": "setFilterLevel", "type": "function", "inputs": [{"name": "_level", "type": "uint256", "internalType": "uint256"}], "outputs": [], "stateMutability": "nonpayable"}, {"name": "viewFilterLevel", "type": "function", "inputs": [], "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}]
Contract Creation Code
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80632cea8391146100515780636d3123eb14610074578063d1a23b901461009f578063e1917fda146100b4575b600080fd5b336000908152602081905260409020546040519081526020015b60405180910390f35b600154610087906001600160a01b031681565b6040516001600160a01b03909116815260200161006b565b6100b26100ad3660046101a0565b6100d7565b005b6100c76100c23660046101d5565b610114565b604051901515815260200161006b565b33600081815260208190526040808220849055518392917f2ac7de9de5ad40921e24320f86f2fcb6f4c55726e82e2a173f9cee5dc62342f791a350565b6001600160a01b03818116600090815260208190526040808220546001549151636a0db6db60e11b815286851660048201529293909291169063d41b6db690602401602060405180830381865afa158015610173573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101979190610208565b10159392505050565b6000602082840312156101b257600080fd5b5035919050565b80356001600160a01b03811681146101d057600080fd5b919050565b600080604083850312156101e857600080fd5b6101f1836101b9565b91506101ff602084016101b9565b90509250929050565b60006020828403121561021a57600080fd5b505191905056fea2646970667358221220db37876039486f4fddd046c6f6c3b861c3d08c71e893564b7e838013ae2f4fab64736f6c63430008130033
©2022-now by Graphite