Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0x3F43045e1192e217F9EE7db11FABAfB700B5249C
Balance 0 ETH
Nonce 1
Code Size 5873 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

5873 bytes
0x608060405234801561000f575f80fd5b50600436106101e7575f3560e01c806375f0a87411610109578063a457c2d71161009e578063dbe66ca01161006e578063dbe66ca014610401578063dd62ed3e14610423578063e2f456051461045b578063f2fde38b14610464575f80fd5b8063a457c2d7146103b5578063a9059cbb146103c8578063aacebbe3146103db578063d07ea4e2146103ee575f80fd5b80638a8c523c116100d95780638a8c523c1461038c5780638da5cb5b1461039457806392136913146103a457806395d89b41146103ad575f80fd5b806375f0a8741461035a5780637bce5a041461036d578063860a32ec1461037657806389f9a1d314610383575f80fd5b80633f3018931161017f5780634ada218b1161014f5780634ada218b146103045780636ddd17131461031657806370a082311461032a578063715018a614610352575f80fd5b80633f3018931461029e578063404e5129146102b357806342966c68146102c657806349bd5a5e146102d9575f80fd5b80631ab99e12116101ba5780631ab99e121461026057806323b872dd14610269578063313ce5671461027c578063395093511461028b575f80fd5b806306fdde03146101eb578063095ea7b31461020957806316c021291461022c57806318160ddd1461024e575b5f80fd5b6101f3610477565b60405161020091906112ea565b60405180910390f35b61021c610217366004611349565b610507565b6040519015158152602001610200565b61021c61023a366004611373565b600f6020525f908152604090205460ff1681565b6003545b604051908152602001610200565b61025260085481565b61021c610277366004611395565b61051d565b60405160128152602001610200565b61021c610299366004611349565b6105ca565b6102b16102ac3660046113d3565b610605565b005b6102b16102c1366004611407565b61068e565b6102b16102d436600461143a565b6106e1565b600c546102ec906001600160a01b031681565b6040516001600160a01b039091168152602001610200565b60065461021c90610100900460ff1681565b60065461021c906301000000900460ff1681565b610252610338366004611373565b6001600160a01b03165f9081526001602052604090205490565b6102b16106ee565b600d546102ec906001600160a01b031681565b61025260095481565b60065461021c9060ff1681565b61025260075481565b6102b1610722565b5f546001600160a01b03166102ec565b610252600a5481565b6101f36107b8565b61021c6103c3366004611349565b6107c7565b61021c6103d6366004611349565b61085f565b6102b16103e9366004611373565b61086b565b6102b16103fc366004611451565b6108b6565b61021c61040f366004611373565b60106020525f908152604090205460ff1681565b610252610431366004611481565b6001600160a01b039182165f90815260026020908152604080832093909416825291909152205490565b610252600b5481565b6102b1610472366004611373565b6108f9565b606060048054610486906114b8565b80601f01602080910402602001604051908101604052809291908181526020018280546104b2906114b8565b80156104fd5780601f106104d4576101008083540402835291602001916104fd565b820191905f5260205f20905b8154815290600101906020018083116104e057829003601f168201915b5050505050905090565b5f610513338484610990565b5060015b92915050565b5f610529848484610ab3565b6001600160a01b0384165f908152600260209081526040808320338452909152902054828110156105b25760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6105bf8533858403610990565b506001949350505050565b335f8181526002602090815260408083206001600160a01b03871684529091528120549091610513918590610600908690611504565b610990565b5f546001600160a01b0316331461062e5760405162461bcd60e51b81526004016105a990611517565b6009829055600a81905560636106448284611504565b111561068a5760405162461bcd60e51b81526020600482015260156024820152744d61782046656573206c696d69742069732039392560581b60448201526064016105a9565b5050565b5f546001600160a01b031633146106b75760405162461bcd60e51b81526004016105a990611517565b6001600160a01b03919091165f908152600f60205260409020805460ff1916911515919091179055565b6106eb3382610e7a565b50565b5f546001600160a01b031633146107175760405162461bcd60e51b81526004016105a990611517565b6107205f610fc5565b565b5f546001600160a01b0316331461074b5760405162461bcd60e51b81526004016105a990611517565b600654610100900460ff16156107a35760405162461bcd60e51b815260206004820152601860248201527f54726164696e6720616c726561647920656e61626c65642e000000000000000060448201526064016105a9565b6006805463ff00ff0019166301000100179055565b606060058054610486906114b8565b335f9081526002602090815260408083206001600160a01b0386168452909152812054828110156108485760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016105a9565b6108553385858403610990565b5060019392505050565b5f610513338484610ab3565b5f546001600160a01b031633146108945760405162461bcd60e51b81526004016105a990611517565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b5f546001600160a01b031633146108df5760405162461bcd60e51b81526004016105a990611517565b6006805460ff191693151593909317909255600755600855565b5f546001600160a01b031633146109225760405162461bcd60e51b81526004016105a990611517565b6001600160a01b0381166109875760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105a9565b6106eb81610fc5565b6001600160a01b0383166109f25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105a9565b6001600160a01b038216610a535760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105a9565b6001600160a01b038381165f8181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ad95760405162461bcd60e51b81526004016105a99061154c565b6001600160a01b038216610aff5760405162461bcd60e51b81526004016105a990611591565b6001600160a01b0382165f908152600f602052604090205460ff16158015610b3f57506001600160a01b0383165f908152600f602052604090205460ff16155b610b795760405162461bcd60e51b815260206004820152600b60248201526a109b1858dadb1a5cdd195960aa1b60448201526064016105a9565b600654610100900460ff1680610ba657506001600160a01b0383165f9081526010602052604090205460ff165b80610bc857506001600160a01b0382165f9081526010602052604090205460ff165b610c145760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016105a9565b805f03610c2b57610c2683835f611014565b505050565b60065460ff168015610c4a5750600c546001600160a01b038481169116145b15610ce85760075481610c71846001600160a01b03165f9081526001602052604090205490565b610c7b9190611504565b11158015610cb3575060085481610ca6846001600160a01b03165f9081526001602052604090205490565b610cb09190611504565b10155b610ce85760405162461bcd60e51b8152602060048201526006602482015265119bdc989a5960d21b60448201526064016105a9565b305f90815260016020526040902054600b5481108015908190610d14575060065462010000900460ff16155b8015610d2d5750600c546001600160a01b038581169116145b8015610d4257506006546301000000900460ff165b15610d6e576006805462ff0000191662010000179055610d6182611167565b6006805462ff0000191690555b6006546001600160a01b0386165f9081526010602052604090205460ff62010000909204821615911680610db957506001600160a01b0385165f9081526010602052604090205460ff165b15610dc157505f5b5f8115610e6657600c546001600160a01b038781169116148015610de657505f600a54115b15610e08576064600a5486610dfb91906115d4565b610e0591906115eb565b90505b600c546001600160a01b038881169116148015610e2657505f600954115b15610e4857606460095486610e3b91906115d4565b610e4591906115eb565b90505b8015610e5957610e59873083611014565b610e63818661160a565b94505b610e71878787611014565b50505050505050565b6001600160a01b038216610eda5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016105a9565b6001600160a01b0382165f9081526001602052604090205481811015610f4d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016105a9565b6001600160a01b0383165f908152600160205260408120838303905560038054849290610f7b90849061160a565b90915550506040518281525f906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03831661103a5760405162461bcd60e51b81526004016105a99061154c565b6001600160a01b0382166110605760405162461bcd60e51b81526004016105a990611591565b6001600160a01b0383165f90815260016020526040902054818110156110d75760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016105a9565b6001600160a01b038085165f9081526001602052604080822085850390559185168152908120805484929061110d908490611504565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161115991815260200190565b60405180910390a350505050565b6040805160028082526060820183525f9260208301908036833701905050905030815f8151811061119a5761119a61161d565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156111f1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112159190611631565b816001815181106112285761122861161d565b6001600160a01b03928316602091820292909201810191909152600e54305f9081526002835260408082209290941681529152205482111561127d57600e5461127d9030906001600160a01b03165f19610990565b600e54600d5460405163791ac94760e01b81526001600160a01b039283169263791ac947926112b99287925f928892911690429060040161164c565b5f604051808303815f87803b1580156112d0575f80fd5b505af11580156112e2573d5f803e3d5ffd5b505050505050565b5f6020808352835180828501525f5b81811015611315578581018301518582016040015282016112f9565b505f604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b03811681146106eb575f80fd5b5f806040838503121561135a575f80fd5b823561136581611335565b946020939093013593505050565b5f60208284031215611383575f80fd5b813561138e81611335565b9392505050565b5f805f606084860312156113a7575f80fd5b83356113b281611335565b925060208401356113c281611335565b929592945050506040919091013590565b5f80604083850312156113e4575f80fd5b50508035926020909101359150565b80358015158114611402575f80fd5b919050565b5f8060408385031215611418575f80fd5b823561142381611335565b9150611431602084016113f3565b90509250929050565b5f6020828403121561144a575f80fd5b5035919050565b5f805f60608486031215611463575f80fd5b61146c846113f3565b95602085013595506040909401359392505050565b5f8060408385031215611492575f80fd5b823561149d81611335565b915060208301356114ad81611335565b809150509250929050565b600181811c908216806114cc57607f821691505b6020821081036114ea57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610517576105176114f0565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b8082028115828204841417610517576105176114f0565b5f8261160557634e487b7160e01b5f52601260045260245ffd5b500490565b81810381811115610517576105176114f0565b634e487b7160e01b5f52603260045260245ffd5b5f60208284031215611641575f80fd5b815161138e81611335565b5f60a082018783526020878185015260a0604085015281875180845260c08601915082890193505f5b8181101561169a5784516001600160a01b031683529383019391830191600101611675565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220d7bf7954920c1724422b848d5aa8fea973ab20a369afa84d9ea93d86ae97995964736f6c63430008140033

Verified Source Code Full Match

Compiler: v0.8.20+commit.a1b79de6 EVM: shanghai Optimization: Yes (200 runs)
Hkd.sol 762 lines
/*  

Hong Kong Dollar

Website: https://hkdollar.info/
TG: https://t.me/HongKongDollarERC20/
Twitter: https://twitter.com/HongDollarERC20/
                                                                                                                                            
*/


// File @openzeppelin/contracts/utils/[email protected]

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Context.sol)


pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}


// File @openzeppelin/contracts/access/[email protected]


// OpenZeppelin Contracts v4.4.0 (access/Ownable.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}


// File @openzeppelin/contracts/token/ERC20/[email protected]


// OpenZeppelin Contracts v4.4.0 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}


// File @openzeppelin/contracts/token/ERC20/extensions/[email protected]


// OpenZeppelin Contracts v4.4.0 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}


// File @openzeppelin/contracts/token/ERC20/[email protected]


// OpenZeppelin Contracts v4.4.0 (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;



/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        unchecked {
            _approve(sender, _msgSender(), currentAllowance - amount);
        }

        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(_msgSender(), spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[sender] = senderBalance - amount;
        }
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);

        _afterTokenTransfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

interface IUniswapV2Factory {
    event PairCreated(address indexed token0, address indexed token1, address pair, uint);
    
    function createPair(address tokenA, address tokenB) external returns (address pair);
 
}


interface IUniswapV2Router02 {
    function factory() external pure returns (address);

    function WETH() external pure returns (address);

    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external;
}
// File contracts/Hkd.sol

pragma solidity ^0.8.0;


contract Hkd is Ownable, ERC20 {
    bool public limited = true;
    bool public tradingEnabled;
    bool private swapping;
    bool public swapEnabled;

    uint256 public maxHoldingAmount = 14749475000000000000000000000;
    uint256 public minHoldingAmount;

    uint256 public buyMarketingFee = 0;
    uint256 public sellMarketingFee = 30;

    uint256 public swapTokensAtAmount = 100000 * 1e18;
    address public uniswapV2Pair;
    address public marketingWallet;
    IUniswapV2Router02 router = IUniswapV2Router02 (0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); //uniswap v2 router
    mapping(address => bool) public blacklists;
    mapping(address => bool) public excludedFromFees;



    constructor() ERC20(unicode"HONG KONG DOLLAR", "HKD") {
         address _uniswapV2Pair = IUniswapV2Factory(router.factory())
            .createPair(address(this), router.WETH());
           uniswapV2Pair   = _uniswapV2Pair;
           marketingWallet = address(0xe7026aE70EeCD2B5bBa044CaFceb967712cD8Bf1);

           excludedFromFees[address(this)] = true;
           excludedFromFees[msg.sender] = true;
           excludedFromFees[marketingWallet] = true;

            _mint(msg.sender, 589979000000000000000000000000); //589,979,000,000  HKD
    }

    function blacklist(address _address, bool _isBlacklisting) external onlyOwner {
        blacklists[_address] = _isBlacklisting;
    }

    function setRule(bool _limited, uint256 _maxHoldingAmount, uint256 _minHoldingAmount) external onlyOwner {
        limited = _limited;

        maxHoldingAmount = _maxHoldingAmount;
        minHoldingAmount = _minHoldingAmount;
    }

    function setMarketingFee (uint256 buy, uint256 sell) external onlyOwner {
        buyMarketingFee = buy;
        sellMarketingFee = sell;
        require (buyMarketingFee + sellMarketingFee <= 99, "Max Fees limit is 99%");
    }

      function enableTrading() external onlyOwner{
        require(!tradingEnabled, "Trading already enabled.");
        tradingEnabled = true;
        swapEnabled = true;
    }

    function updateMarketingWallet (address newWallet) external onlyOwner {
        marketingWallet = newWallet;
    }

    function _transfer(address from,address to,uint256 amount) internal  override {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");
         require(!blacklists[to] && !blacklists[from], "Blacklisted");
        require(tradingEnabled || excludedFromFees[from] || excludedFromFees[to], "Trading not yet enabled!");
       
        if (amount == 0) {
            super._transfer(from, to, 0);
            return;
        }

        if (limited && from == uniswapV2Pair) {
            require(balanceOf(to) + amount <= maxHoldingAmount && balanceOf(to) + amount >= minHoldingAmount, "Forbid");
        }

		uint256 contractTokenBalance = balanceOf(address(this));

        bool canSwap = contractTokenBalance >= swapTokensAtAmount;

        if (canSwap &&
            !swapping &&
            to == uniswapV2Pair &&
            swapEnabled
        ) {
            swapping = true;
                
            swapAndLiquify(contractTokenBalance);

            swapping = false;
        }

         bool takeFee = !swapping;
 
        // if any account belongs to _isExcludedFromFee account then remove the fee
        if (excludedFromFees[from] || excludedFromFees[to]) {
            takeFee = false;
        }
 

       uint256 fees = 0;
        // only take fees on buys/sells, do not take on wallet transfers
        if (takeFee) {
            // on sell
            if (to == uniswapV2Pair && sellMarketingFee > 0) {
                fees = (amount * sellMarketingFee) / 100;
               
            }
            // on buy
            if (from == uniswapV2Pair && buyMarketingFee > 0) {
                fees = (amount * buyMarketingFee) / 100;
               
            }
 
            if (fees > 0) {
                super._transfer(from, address(this), fees);
            }
 
            amount -= fees;
        }

        super._transfer(from, to, amount);
    }

     function swapAndLiquify(uint256 tokens) private {
       
        address[] memory path = new address[](2);
        path[0] = address(this);
        path[1] = router.WETH();
        if(allowance(address(this), address(router)) < tokens ){
       _approve(address(this), address(router), ~uint256(0));
        }
       router.swapExactTokensForETHSupportingFeeOnTransferTokens(
           tokens,
            0,
            path,
            marketingWallet,
            block.timestamp);
        
    }

    function burn(uint256 value) external {
        _burn(msg.sender, value);
    }
}

Read Contract

allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
blacklists 0x16c02129 → bool
buyMarketingFee 0x7bce5a04 → uint256
decimals 0x313ce567 → uint8
excludedFromFees 0xdbe66ca0 → bool
limited 0x860a32ec → bool
marketingWallet 0x75f0a874 → address
maxHoldingAmount 0x89f9a1d3 → uint256
minHoldingAmount 0x1ab99e12 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
sellMarketingFee 0x92136913 → uint256
swapEnabled 0x6ddd1713 → bool
swapTokensAtAmount 0xe2f45605 → uint256
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
tradingEnabled 0x4ada218b → bool
uniswapV2Pair 0x49bd5a5e → address

Write Contract 13 functions

These functions modify contract state and require a wallet transaction to execute.

approve 0x095ea7b3
address spender
uint256 amount
returns: bool
blacklist 0x404e5129
address _address
bool _isBlacklisting
burn 0x42966c68
uint256 value
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
enableTrading 0x8a8c523c
No parameters
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
renounceOwnership 0x715018a6
No parameters
setMarketingFee 0x3f301893
uint256 buy
uint256 sell
setRule 0xd07ea4e2
bool _limited
uint256 _maxHoldingAmount
uint256 _minHoldingAmount
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
updateMarketingWallet 0xaacebbe3
address newWallet

Recent Transactions

No transactions found for this address