false
true
0

Contract Address Details

0xbefA4C3Af0048Fb34B9f97A3c8a9a0506a337637

Contract Name
DopeDistributor
Creator
0xbbd48a–2e79f2 at 0x9a7e78–39886b
Balance
0 PLS ( )
Tokens
Fetching tokens...
Transactions
2 Transactions
Transfers
110 Transfers
Gas Used
81,497
Last Balance Update
25965126
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
DopeDistributor




Optimization enabled
true
Compiler version
v0.8.20+commit.a1b79de6




Optimization runs
200
EVM Version
shanghai




Verified at
2025-02-13T02:42:17.050495Z

Constructor Arguments

0x000000000000000000000000bbd48ad4ef9994e514d0ea2277e2fec3b32e79f2

Arg [0] (address) : 0xbbd48ad4ef9994e514d0ea2277e2fec3b32e79f2

              

Contract source code

// File: lib/openzeppelin-contracts/contracts/utils/Context.sol


// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @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;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

// File: lib/openzeppelin-contracts/contracts/access/Ownable.sol


// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;


/**
 * @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.
 *
 * The initial owner is set to the address provided by the deployer. 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;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling 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 {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _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: lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol


// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
interface IERC20 {
    /**
     * @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);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

// File: src/interface/IDividendDistributor.sol


pragma solidity 0.8.20;

interface IDividendDistributor {
    function initialize() external;
    function setDistributionCriteria(
        uint256 _minPeriod,
        uint256 _minDistribution,
        uint256 _claimAfter
    ) external;
    function setShare(
        address shareholder,
        uint256 amount,
        bool exclude
    ) external;
    function deposit() external payable;
    function claimDividend(address shareholder) external;
    function getUnpaidEarnings(
        address shareholder
    ) external view returns (uint256);
    function getPaidDividends(
        address shareholder
    ) external view returns (uint256);
    function getTotalPaid() external view returns (uint256);
    function getClaimTime(address shareholder) external view returns (uint256);
    function getTotalDividends() external view returns (uint256);
    function getTotalDistributed() external view returns (uint256);
    function countShareholders() external view returns (uint256);
    function migrate(address newDistributor) external;
    function process() external;
}

// File: src/interface/IDexRouter.sol


pragma solidity 0.8.20;

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

    function WPLS() external pure returns (address);

    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external;

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;

    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external payable;

    function swapExactETHForTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable returns (uint[] memory amounts);

    function swapETHForExactTokens(
        uint amountOut,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable returns (uint[] memory amounts);

    function addLiquidityETH(
        address token,
        uint256 amountTokenDesired,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    )
        external
        payable
        returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint amountADesired,
        uint amountBDesired,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB, uint liquidity);

    function getAmountsOut(
        uint256 amountIn,
        address[] calldata path
    ) external view returns (uint256[] memory amounts);
}

// File: src/interface/IDopeDistributor.sol


pragma solidity 0.8.20;

interface IDopeDistributor {
    function process(address _token, address _tokenAddressToBuy) external;
}

// File: src/taxtoken/DopeDistributor.sol

//  __      __.__              .__
// /  \    /  \__| ____   ____ |__| ____    ____
// \   \/\/   /  |/    \ /    \|  |/    \  / ___\
//  \        /|  |   |  \   |  \  |   |  \/ /_/  >
//   \__/\  / |__|___|  /___|  /__|___|  /\___  /
//        \/          \/     \/        \//_____/

pragma solidity 0.8.20;






contract DopeDistributor is IDopeDistributor, Ownable {
    address constant WPLS = 0xA1077a294dDE1B09bB078844df40758a5D0f9a27;
    address routerAddress = 0x165C3410fC91EF562C50559f7d2289fEbed552d9;
    IDexRouter dexRouter = IDexRouter(routerAddress);

    address collector;

    constructor(address _collector) Ownable(msg.sender) {
        collector = _collector;
    }

    function process(
        address _token,
        address _tokenAddressToBuy
    ) external override {
        swapTokensForTokens(_token, _tokenAddressToBuy);

        IERC20 tokenToBuy = IERC20(_tokenAddressToBuy);

        tokenToBuy.transfer(collector, tokenToBuy.balanceOf(address(this)));
    }

    function swapTokensForTokens(address _tokenIn, address _tokenOut) private {
        address[] memory path = new address[](2);
        path[0] = _tokenIn;
        path[1] = _tokenOut;

        uint256 amountIn = IERC20(_tokenIn).balanceOf(address(this));

        if (
            IERC20(_tokenIn).allowance(address(this), routerAddress) <= amountIn
        ) {
            IERC20(_tokenIn).approve(routerAddress, type(uint256).max);
        }

        dexRouter.swapExactTokensForTokensSupportingFeeOnTransferTokens(
            amountIn,
            0,
            path,
            address(this),
            block.timestamp
        );
    }

    function swapTokensForEth(address _token) private {
        address[] memory path = new address[](2);
        path[0] = _token;
        path[1] = WPLS;

        uint256 amountIn = IERC20(_token).balanceOf(address(this));

        if (
            IERC20(_token).allowance(address(this), routerAddress) <= amountIn
        ) {
            IERC20(_token).approve(routerAddress, type(uint256).max);
        }

        dexRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(
            amountIn,
            0,
            path,
            address(this),
            block.timestamp
        );
    }

    function cleanUpPls() external onlyOwner {
        bool success;
        (success, ) = msg.sender.call{value: address(this).balance}("");
        require(success, "Transfer failed");
    }

    function cleanUpToken(address _token) external onlyOwner {
        IERC20(_token).transfer(
            msg.sender,
            IERC20(_token).balanceOf(address(this))
        );
    }

    function updateRouterAddress(address _routerAddress) external onlyOwner {
        routerAddress = _routerAddress;
        dexRouter = IDexRouter(routerAddress);
    }

    function updateCollector(address _collector) external onlyOwner {
        collector = _collector;
    }
}
        

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_collector","internalType":"address"}]},{"type":"error","name":"OwnableInvalidOwner","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"error","name":"OwnableUnauthorizedAccount","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"cleanUpPls","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"cleanUpToken","inputs":[{"type":"address","name":"_token","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"process","inputs":[{"type":"address","name":"_token","internalType":"address"},{"type":"address","name":"_tokenAddressToBuy","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateCollector","inputs":[{"type":"address","name":"_collector","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateRouterAddress","inputs":[{"type":"address","name":"_routerAddress","internalType":"address"}]}]
              

Contract Creation Code

Verify & Publish
0x60806040526001805473165c3410fc91ef562c50559f7d2289febed552d96001600160a01b03199182168117909255600280549091169091179055348015610045575f80fd5b5060405161098938038061098983398101604081905261006491610107565b338061008957604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b610092816100b8565b50600380546001600160a01b0319166001600160a01b0392909216919091179055610134565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f60208284031215610117575f80fd5b81516001600160a01b038116811461012d575f80fd5b9392505050565b610848806101415f395ff3fe608060405234801561000f575f80fd5b5060043610610084575f3560e01c8063aee3b32911610058578063aee3b329146100d6578063c316c98b146100e9578063c741632e146100fc578063f2fde38b14610104575f80fd5b8062e6be7b146100885780631563d2ce1461009d578063715018a6146100b05780638da5cb5b146100b8575b5f80fd5b61009b610096366004610708565b610117565b005b61009b6100ab366004610728565b61014b565b61009b610240565b5f54604080516001600160a01b039092168252519081900360200190f35b61009b6100e4366004610708565b610253565b61009b6100f7366004610708565b61033b565b61009b610365565b61009b610112366004610708565b6103fe565b61011f610438565b600180546001600160a01b039092166001600160a01b0319928316811790915560028054909216179055565b6101558282610464565b6003546040516370a0823160e01b815230600482015282916001600160a01b038084169263a9059cbb92919091169083906370a0823190602401602060405180830381865afa1580156101aa573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101ce9190610759565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303815f875af1158015610216573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061023a9190610770565b50505050565b610248610438565b6102515f61069e565b565b61025b610438565b6040516370a0823160e01b81523060048201526001600160a01b0382169063a9059cbb90339083906370a0823190602401602060405180830381865afa1580156102a7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102cb9190610759565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303815f875af1158015610313573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103379190610770565b5050565b610343610438565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b61036d610438565b6040515f90339047908381818185875af1925050503d805f81146103ac576040519150601f19603f3d011682016040523d82523d5f602084013e6103b1565b606091505b505080915050806103fb5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064015b60405180910390fd5b50565b610406610438565b6001600160a01b03811661042f57604051631e4fbdf760e01b81525f60048201526024016103f2565b6103fb8161069e565b5f546001600160a01b031633146102515760405163118cdaa760e01b81523360048201526024016103f2565b6040805160028082526060820183525f9260208301908036833701905050905082815f815181106104975761049761078f565b60200260200101906001600160a01b031690816001600160a01b03168152505081816001815181106104cb576104cb61078f565b6001600160a01b0392831660209182029290920101526040516370a0823160e01b81523060048201525f918516906370a0823190602401602060405180830381865afa15801561051d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105419190610759565b600154604051636eb1769f60e11b81523060048201526001600160a01b03918216602482015291925082919086169063dd62ed3e90604401602060405180830381865afa158015610594573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105b89190610759565b116106335760015460405163095ea7b360e01b81526001600160a01b0391821660048201525f1960248201529085169063095ea7b3906044016020604051808303815f875af115801561060d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106319190610770565b505b600254604051635c11d79560e01b81526001600160a01b0390911690635c11d7959061066b9084905f908790309042906004016107a3565b5f604051808303815f87803b158015610682575f80fd5b505af1158015610694573d5f803e3d5ffd5b5050505050505050565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b0381168114610703575f80fd5b919050565b5f60208284031215610718575f80fd5b610721826106ed565b9392505050565b5f8060408385031215610739575f80fd5b610742836106ed565b9150610750602084016106ed565b90509250929050565b5f60208284031215610769575f80fd5b5051919050565b5f60208284031215610780575f80fd5b81518015158114610721575f80fd5b634e487b7160e01b5f52603260045260245ffd5b5f60a082018783526020878185015260a0604085015281875180845260c08601915082890193505f5b818110156107f15784516001600160a01b0316835293830193918301916001016107cc565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220c0588d1f20e8a862051086847136b8a21e682d2a2b36471b801eba0b6b249db664736f6c63430008140033000000000000000000000000bbd48ad4ef9994e514d0ea2277e2fec3b32e79f2

Deployed ByteCode

0x608060405234801561000f575f80fd5b5060043610610084575f3560e01c8063aee3b32911610058578063aee3b329146100d6578063c316c98b146100e9578063c741632e146100fc578063f2fde38b14610104575f80fd5b8062e6be7b146100885780631563d2ce1461009d578063715018a6146100b05780638da5cb5b146100b8575b5f80fd5b61009b610096366004610708565b610117565b005b61009b6100ab366004610728565b61014b565b61009b610240565b5f54604080516001600160a01b039092168252519081900360200190f35b61009b6100e4366004610708565b610253565b61009b6100f7366004610708565b61033b565b61009b610365565b61009b610112366004610708565b6103fe565b61011f610438565b600180546001600160a01b039092166001600160a01b0319928316811790915560028054909216179055565b6101558282610464565b6003546040516370a0823160e01b815230600482015282916001600160a01b038084169263a9059cbb92919091169083906370a0823190602401602060405180830381865afa1580156101aa573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101ce9190610759565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303815f875af1158015610216573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061023a9190610770565b50505050565b610248610438565b6102515f61069e565b565b61025b610438565b6040516370a0823160e01b81523060048201526001600160a01b0382169063a9059cbb90339083906370a0823190602401602060405180830381865afa1580156102a7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102cb9190610759565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303815f875af1158015610313573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103379190610770565b5050565b610343610438565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b61036d610438565b6040515f90339047908381818185875af1925050503d805f81146103ac576040519150601f19603f3d011682016040523d82523d5f602084013e6103b1565b606091505b505080915050806103fb5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064015b60405180910390fd5b50565b610406610438565b6001600160a01b03811661042f57604051631e4fbdf760e01b81525f60048201526024016103f2565b6103fb8161069e565b5f546001600160a01b031633146102515760405163118cdaa760e01b81523360048201526024016103f2565b6040805160028082526060820183525f9260208301908036833701905050905082815f815181106104975761049761078f565b60200260200101906001600160a01b031690816001600160a01b03168152505081816001815181106104cb576104cb61078f565b6001600160a01b0392831660209182029290920101526040516370a0823160e01b81523060048201525f918516906370a0823190602401602060405180830381865afa15801561051d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105419190610759565b600154604051636eb1769f60e11b81523060048201526001600160a01b03918216602482015291925082919086169063dd62ed3e90604401602060405180830381865afa158015610594573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105b89190610759565b116106335760015460405163095ea7b360e01b81526001600160a01b0391821660048201525f1960248201529085169063095ea7b3906044016020604051808303815f875af115801561060d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106319190610770565b505b600254604051635c11d79560e01b81526001600160a01b0390911690635c11d7959061066b9084905f908790309042906004016107a3565b5f604051808303815f87803b158015610682575f80fd5b505af1158015610694573d5f803e3d5ffd5b5050505050505050565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b0381168114610703575f80fd5b919050565b5f60208284031215610718575f80fd5b610721826106ed565b9392505050565b5f8060408385031215610739575f80fd5b610742836106ed565b9150610750602084016106ed565b90509250929050565b5f60208284031215610769575f80fd5b5051919050565b5f60208284031215610780575f80fd5b81518015158114610721575f80fd5b634e487b7160e01b5f52603260045260245ffd5b5f60a082018783526020878185015260a0604085015281875180845260c08601915082890193505f5b818110156107f15784516001600160a01b0316835293830193918301916001016107cc565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220c0588d1f20e8a862051086847136b8a21e682d2a2b36471b801eba0b6b249db664736f6c63430008140033