ETH Price: $2,677.65 (-0.72%)

Contract

0x0C15Da88Abc4E8BE39D66d83a21D6A54183250f9
 

Overview

ETH Balance

2.37299617075626252 ETH

Eth Value

$6,354.05 (@ $2,677.65/ETH)

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim123188842021-04-26 23:17:031251 days ago1619479023IN
0x0C15Da88...4183250f9
0 ETH0.0025243242
Claim122967862021-04-23 13:48:311254 days ago1619185711IN
0x0C15Da88...4183250f9
0 ETH0.00600622109
Claim122967812021-04-23 13:47:311254 days ago1619185651IN
0x0C15Da88...4183250f9
0 ETH0.0055654101
Claim122967632021-04-23 13:45:091254 days ago1619185509IN
0x0C15Da88...4183250f9
0 ETH0.00633684115
Claim122949572021-04-23 6:48:571254 days ago1619160537IN
0x0C15Da88...4183250f9
0 ETH0.0060103100
Claim122834662021-04-21 12:04:101256 days ago1619006650IN
0x0C15Da88...4183250f9
0 ETH0.00655725119
Claim122832942021-04-21 11:24:061256 days ago1619004246IN
0x0C15Da88...4183250f9
0 ETH0.00619181103.02
Claim122809492021-04-21 2:52:321256 days ago1618973552IN
0x0C15Da88...4183250f9
0 ETH0.00847452141
Claim122802792021-04-21 0:19:181256 days ago1618964358IN
0x0C15Da88...4183250f9
0 ETH0.00826545150
Claim122759182021-04-20 8:29:511257 days ago1618907391IN
0x0C15Da88...4183250f9
0 ETH0.01581456287
Withdraw122696762021-04-19 9:20:021258 days ago1618824002IN
0x0C15Da88...4183250f9
0 ETH0.01743452136
Claim122696682021-04-19 9:18:041258 days ago1618823884IN
0x0C15Da88...4183250f9
0 ETH0.00754911137.00000145
Close Auction122696632021-04-19 9:17:141258 days ago1618823834IN
0x0C15Da88...4183250f9
0 ETH0.00445387143
Bid122624222021-04-18 6:13:051259 days ago1618726385IN
0x0C15Da88...4183250f9
2.5 ETH0.01128182172
Bid122599482021-04-17 21:12:161260 days ago1618693936IN
0x0C15Da88...4183250f9
1.1925402 ETH0.01394092140
Bid122598342021-04-17 20:48:411260 days ago1618692521IN
0x0C15Da88...4183250f9
0.00000012 ETH0.01363889137
Bid122595692021-04-17 19:45:441260 days ago1618688744IN
0x0C15Da88...4183250f9
0 ETH0.00615128113.74
Bid122453672021-04-15 15:07:191262 days ago1618499239IN
0x0C15Da88...4183250f9
0.00044227 ETH0.0071678872
Bid122439982021-04-15 10:06:201262 days ago1618481180IN
0x0C15Da88...4183250f9
0.01414671 ETH0.0045126270
Bid122437212021-04-15 9:06:191262 days ago1618477579IN
0x0C15Da88...4183250f9
0.01193923 ETH0.0082185487
Bid122299382021-04-13 5:47:051264 days ago1618292825IN
0x0C15Da88...4183250f9
0.00000062 ETH0.0072729577
Bid122291792021-04-13 2:58:371264 days ago1618282717IN
0x0C15Da88...4183250f9
0.00000064 ETH0.0068006872.00000145
Bid122285162021-04-13 0:29:361264 days ago1618273776IN
0x0C15Da88...4183250f9
0 ETH0.0036638177
Bid122250702021-04-12 11:46:431265 days ago1618228003IN
0x0C15Da88...4183250f9
0.01336422 ETH0.0081230486
Bid122237022021-04-12 6:43:081265 days ago1618209788IN
0x0C15Da88...4183250f9
0 ETH0.0031404166
View all transactions

Latest 7 internal transactions

Advanced mode:
Parent Transaction Hash Block From To
123188842021-04-26 23:17:031251 days ago1619479023
0x0C15Da88...4183250f9
0.1925402 ETH
122949572021-04-23 6:48:571254 days ago1619160537
0x0C15Da88...4183250f9
0.00000054 ETH
122832942021-04-21 11:24:061256 days ago1619004246
0x0C15Da88...4183250f9
0.00000002 ETH
122809492021-04-21 2:52:321256 days ago1618973552
0x0C15Da88...4183250f9
0.00034227 ETH
122696762021-04-19 9:20:021258 days ago1618824002
0x0C15Da88...4183250f9
3.74935975 ETH
122696762021-04-19 9:20:021258 days ago1618824002
0x0C15Da88...4183250f9
0.018841 ETH
122199022021-04-11 17:03:421266 days ago1618160622  Contract Creation0 ETH
Loading...
Loading

Minimal Proxy Contract for 0x9b58655d40150fbf99de182199d37b345f23029b

Contract Name:
DutchAuction

Compiler Version
v0.8.2+commit.661d1103

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 1 : Auction.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;

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

contract DutchAuction{

    IERC20 public token;
    mapping (address => uint) public reserve;
    mapping (address => uint) public committed;
    mapping (address => bool) public whitelisted;
    uint256 public startPrice;
    uint256 public tokensLeft;
    uint256 public minPrice;
    address payable public owner;
    uint256 public bought;
    uint256 public price;
    uint256 public tokensStart;
    uint256 public start;
    uint256 public finish;
    bool public whitelistOnly;
    bool public hasClaimed;
    uint256 public open; // 0 = closed, 1 = open, 2 = ended;
    address factory;

    constructor() {
        // Don't allow implementation to be initialized.
        token = IERC20(address(1));
    }

    function initialize(IERC20 _token, address payable _owner, address factory_) external {
        require(address(token) == address(0), "already initialized");
        require(address(_token) != address(0), "token can not be null");

        owner = _owner;
        token = _token;
        factory = factory_;
    }

    function startAuction(uint256 min, uint256 _startPrice, uint256 _finish, address[] memory whitelistd, bool whitelist) public{
        require (msg.sender == owner, "Not owner");
        require (open == 0, "Auction has started");

        finish = _finish;
        startPrice = _startPrice;
        minPrice = min;
        tokensLeft = token.balanceOf(address(this));
        tokensStart = token.balanceOf(address(this));
        open = 1;
        whitelistOnly = whitelist;

        if (whitelist) {
            for (uint i=0; i < whitelistd.length; i++) {
                whitelisted[whitelistd[i]] = true;
            }
        }

        start = block.timestamp;
        currentPrice();
    }

    function getCurrentPrice() public view returns (uint256) {
        uint256 returnPrice;
        if (open == 1) {
            returnPrice = startPrice*(finish - block.timestamp) / (finish - start);
            if (returnPrice < minPrice){
                returnPrice = minPrice;
            }
        }

        return returnPrice;
    }

    function currentPrice() internal returns(uint256 current) {
        require (open != 0, "Auction hasnt started");
        if (open == 1) {
            if (finish <= block.timestamp){
                open = 2;
            }
            else{
                price = startPrice*(finish - block.timestamp) / (finish - start);
                if (price < minPrice){
                    price = minPrice;
                }
            }
        }
        return price;
    }

    function closeAuction() public{
        require (msg.sender == owner, "Not owner");
        require (open == 1, "Not active");

        open = 2;
    }

    function updateWhitelist(address[] memory whitelistd) public{
        require (msg.sender == owner, "Not owner");

        for (uint256 i=0; i < whitelistd.length; i++) {
            whitelisted[whitelistd[i]] = true;
        }
    }

    function bid(uint256 amount) public payable {
        require (msg.value >= currentPrice() * amount / 10**18, "Not enough payment");
        require (open == 1, "Not active auction");

        if (whitelistOnly){
            require(whitelisted[msg.sender]);
        }

        if (tokensLeft < amount){
            amount = tokensLeft;
        }

        tokensLeft = tokensLeft - amount;
        reserve[msg.sender] += amount;
        committed[msg.sender] += msg.value;
        bought += amount;

        if (tokensLeft == 0){
            open = 2;
        }
    }

    function claim() public{
        require(open == 2, "Not closed");
        uint256 refund;
        uint256 tokens;
        tokens = reserve[msg.sender];
        committed[msg.sender] -= reserve[msg.sender] * price / 10 ** 18;
        reserve[msg.sender] = 0;
        refund = committed[msg.sender];
        committed[msg.sender] = 0;
        token.transfer(msg.sender, tokens);
        payable(msg.sender).transfer(refund);
    }

    fallback () external payable{
        if (open == 1){
            bid(msg.value*10**18/currentPrice());
        }
        else if (open==2){
            require(msg.value == 0);
            claim();
            if (msg.sender == owner){
                withdraw();
            }
        }
        else{
            revert();
        }
    }

    function withdraw() public{
        require(msg.sender == owner, "Not owner");
        require(hasClaimed == false, "Has been claimed");
        require(open == 2, "Not closed");

        hasClaimed = true;
        uint256 withdrawAmount = price * bought/10**18;
        uint256 withdrawFee = withdrawAmount / 200;

        address payable alchemyRouter = IDutchAuctionFactory(factory).getRouter();

        // send a 0.5% fee to the router
        IAlchemyRouter(alchemyRouter).deposit{value: withdrawFee}();

        owner.transfer(withdrawAmount - withdrawFee);
        token.transfer(owner, tokensLeft);
    }
}

interface IDutchAuctionFactory {
    function getRouter() external view returns (address payable);
}


interface IAlchemyRouter {
    function deposit() external payable;
}

Settings
{
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"stateMutability":"payable","type":"fallback"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"bid","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"bought","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"closeAuction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"committed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"finish","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hasClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address payable","name":"_owner","type":"address"},{"internalType":"address","name":"factory_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"open","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"reserve","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"start","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"min","type":"uint256"},{"internalType":"uint256","name":"_startPrice","type":"uint256"},{"internalType":"uint256","name":"_finish","type":"uint256"},{"internalType":"address[]","name":"whitelistd","type":"address[]"},{"internalType":"bool","name":"whitelist","type":"bool"}],"name":"startAuction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokensLeft","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokensStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"whitelistd","type":"address[]"}],"name":"updateWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"whitelistOnly","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

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
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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.