ETH Price: $3,273.63 (+4.66%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

> 10 Token Transfers found.

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DrainContract

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license
/**
 *Submitted for verification at Etherscan.io on 2021-01-08
*/

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.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);
}

/*
 * @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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

/**
 * @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.
 */
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 () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view 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 {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

contract DrainContract is Ownable {
	
	// DUCK TOKEN
	IERC20 public duck;
	address public controllerAddress;
	
	constructor(address _duckTokenAddress, address _controllerAddress) public {
		duck = IERC20(_duckTokenAddress);
		controllerAddress = _controllerAddress;
		duck.approve(_controllerAddress, uint(-1));
	}

	function approve() public onlyOwner {
		duck.approve(controllerAddress, uint(-1));
	}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_duckTokenAddress","type":"address"},{"internalType":"address","name":"_controllerAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"controllerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"duck","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5060405161055e38038061055e8339818101604052604081101561003357600080fd5b508051602090910151600061004661013b565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600180546001600160a01b038085166001600160a01b03199283161792839055600280548583169316831790556040805163095ea7b360e01b8152600481019390935260001960248401525192169163095ea7b3916044808201926020929091908290030181600087803b15801561010757600080fd5b505af115801561011b573d6000803e3d6000fd5b505050506040513d602081101561013157600080fd5b5061013f92505050565b3390565b6104108061014e6000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806312424e3f146100675780634b24ea4714610071578063715018a6146100955780638da5cb5b1461009d578063d5226a1c146100a5578063f2fde38b146100ad575b600080fd5b61006f6100d3565b005b6100796101c5565b604080516001600160a01b039092168252519081900360200190f35b61006f6101d4565b610079610288565b610079610297565b61006f600480360360208110156100c357600080fd5b50356001600160a01b03166102a6565b6100db6103b0565b6000546001600160a01b0390811691161461013d576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001546002546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b15801561019757600080fd5b505af11580156101ab573d6000803e3d6000fd5b505050506040513d60208110156101c157600080fd5b5050565b6002546001600160a01b031681565b6101dc6103b0565b6000546001600160a01b0390811691161461023e576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6001546001600160a01b031681565b6102ae6103b0565b6000546001600160a01b03908116911614610310576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166103555760405162461bcd60e51b81526004018080602001828103825260268152602001806103b56026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b339056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a2646970667358221220331958d964cc4daf2614837f1bb243101c769296b238c552f6f76185aa6f231864736f6c634300060c0033000000000000000000000000c0ba369c8db6eb3924965e5c4fd0b4c1b91e305f000000000000000000000000d8e3a7019425509f43f61d664a4daf426927af07

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100625760003560e01c806312424e3f146100675780634b24ea4714610071578063715018a6146100955780638da5cb5b1461009d578063d5226a1c146100a5578063f2fde38b146100ad575b600080fd5b61006f6100d3565b005b6100796101c5565b604080516001600160a01b039092168252519081900360200190f35b61006f6101d4565b610079610288565b610079610297565b61006f600480360360208110156100c357600080fd5b50356001600160a01b03166102a6565b6100db6103b0565b6000546001600160a01b0390811691161461013d576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001546002546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b15801561019757600080fd5b505af11580156101ab573d6000803e3d6000fd5b505050506040513d60208110156101c157600080fd5b5050565b6002546001600160a01b031681565b6101dc6103b0565b6000546001600160a01b0390811691161461023e576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6001546001600160a01b031681565b6102ae6103b0565b6000546001600160a01b03908116911614610310576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166103555760405162461bcd60e51b81526004018080602001828103825260268152602001806103b56026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b339056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a2646970667358221220331958d964cc4daf2614837f1bb243101c769296b238c552f6f76185aa6f231864736f6c634300060c0033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000c0ba369c8db6eb3924965e5c4fd0b4c1b91e305f000000000000000000000000d8e3a7019425509f43f61d664a4daf426927af07

-----Decoded View---------------
Arg [0] : _duckTokenAddress (address): 0xC0bA369c8Db6eB3924965e5c4FD0b4C1B91e305F
Arg [1] : _controllerAddress (address): 0xD8E3A7019425509f43f61D664A4Daf426927af07

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000c0ba369c8db6eb3924965e5c4fd0b4c1b91e305f
Arg [1] : 000000000000000000000000d8e3a7019425509f43f61d664a4daf426927af07


Deployed Bytecode Sourcemap

5876:419:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6205:87;;;:::i;:::-;;5955:32;;;:::i;:::-;;;;-1:-1:-1;;;;;5955:32:0;;;;;;;;;;;;;;5322:148;;;:::i;4680:79::-;;;:::i;5933:18::-;;;:::i;5625:244::-;;;;;;;;;;;;;;;;-1:-1:-1;5625:244:0;-1:-1:-1;;;;;5625:244:0;;:::i;6205:87::-;4902:12;:10;:12::i;:::-;4892:6;;-1:-1:-1;;;;;4892:6:0;;;:22;;;4884:67;;;;;-1:-1:-1;;;4884:67:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6246:4:::1;::::0;6259:17:::1;::::0;6246:41:::1;::::0;;-1:-1:-1;;;6246:41:0;;-1:-1:-1;;;;;6259:17:0;;::::1;6246:41;::::0;::::1;::::0;-1:-1:-1;;6246:41:0;;;;;;:4;;;::::1;::::0;:12:::1;::::0;:41;;;;;::::1;::::0;;;;;;;;:4:::1;::::0;:41;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;;6205:87:0:o;5955:32::-;;;-1:-1:-1;;;;;5955:32:0;;:::o;5322:148::-;4902:12;:10;:12::i;:::-;4892:6;;-1:-1:-1;;;;;4892:6:0;;;:22;;;4884:67;;;;;-1:-1:-1;;;4884:67:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5429:1:::1;5413:6:::0;;5392:40:::1;::::0;-1:-1:-1;;;;;5413:6:0;;::::1;::::0;5392:40:::1;::::0;5429:1;;5392:40:::1;5460:1;5443:19:::0;;-1:-1:-1;;;;;;5443:19:0::1;::::0;;5322:148::o;4680:79::-;4718:7;4745:6;-1:-1:-1;;;;;4745:6:0;4680:79;:::o;5933:18::-;;;-1:-1:-1;;;;;5933:18:0;;:::o;5625:244::-;4902:12;:10;:12::i;:::-;4892:6;;-1:-1:-1;;;;;4892:6:0;;;:22;;;4884:67;;;;;-1:-1:-1;;;4884:67:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;5714:22:0;::::1;5706:73;;;;-1:-1:-1::0;;;5706:73:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5816:6;::::0;;5795:38:::1;::::0;-1:-1:-1;;;;;5795:38:0;;::::1;::::0;5816:6;::::1;::::0;5795:38:::1;::::0;::::1;5844:6;:17:::0;;-1:-1:-1;;;;;;5844:17:0::1;-1:-1:-1::0;;;;;5844:17:0;;;::::1;::::0;;;::::1;::::0;;5625:244::o;3318:106::-;3406:10;3318:106;:::o

Swarm Source

ipfs://331958d964cc4daf2614837f1bb243101c769296b238c552f6f76185aa6f2318

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.