Contract Address Details

0xd6960eFac7fF26D83fD07cF7c33588E3D6A09861

Creator
0x2f519e–097ec1 at 0x348998–f141c5
Balance
0 mADA
Tokens
Fetching tokens...
Transactions
141 Transactions
Transfers
481 Transfers
Gas Used
8,102,591
Last Balance Update
40212665
Minimal Proxy Contract for 0x2f47f3d2eff803cfd78aa530f6f57159766b2292.
EIP-1167 - minimal bytecode implementation that delegates all calls to a known address
Contract name:
BatchAuction




Optimization enabled
true
Compiler version
v0.6.12+commit.27d51765




Optimization runs
200
Verified at
2023-12-15T01:28:21.105995Z

contracts/Auctions/BatchAuction.sol

pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;

// Batch Auction
//
// An auction where contributions are swaped for a batch of tokens pro-rata
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// ---------------------------------------------------------------------
// SPDX-License-Identifier: GPL-3.0
// ---------------------------------------------------------------------

import "../OpenZeppelin/utils/ReentrancyGuard.sol";
import "../Access/IHubAccessControls.sol";
import "../Utils/SafeTransfer.sol";
import "../Utils/BoringBatchable.sol";
import "../Utils/BoringMath.sol";
import "../Utils/BoringERC20.sol";
import "../Utils/Documents.sol";
import "../interfaces/IPointList.sol";
import "../interfaces/IIHubMarket.sol";

/// @notice Attribution to delta.financial
/// @notice Attribution to dutchswap.com

contract BatchAuction is IIHubMarket, IHubAccessControls, BoringBatchable, SafeTransfer, Documents, ReentrancyGuard {
    using BoringMath for uint256;
    using BoringMath128 for uint128;
    using BoringMath64 for uint64;
    using BoringERC20 for IERC20;

    /// @notice IHubMarket template id for the factory contract.
    /// @dev For different marketplace types, this must be incremented.
    // solhint-disable-next-line const-name-snakecase
    uint256 public constant override marketTemplate = 3;

    /// @dev The placeholder ETH address.
    address private constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

    /// @notice Main market variables.
    struct MarketInfo {
        uint64 startTime;
        uint64 endTime;
        uint128 totalTokens;
    }
    MarketInfo public marketInfo;

    /// @notice Market dynamic variables.
    struct MarketStatus {
        uint128 commitmentsTotal;
        uint128 minimumCommitmentAmount;
        bool finalized;
        bool usePointList;
    }

    MarketStatus public marketStatus;

    /// @notice The token being sold.
    address public auctionToken;
    /// @notice The currency the BatchAuction accepts for payment. Can be ETH or token address.
    address public paymentCurrency;
    // TangleswapPool->fee
    uint24 public fee;
    /// @notice Address that manages auction approvals.
    address public pointList;
    address payable public wallet; // Where the auction funds will get paid
    /// @notice The post auction contract that takes the proceeds and creates a liquidity pool
    address public postAuctionLauncher;

    mapping(address => uint256) public commitments;
    /// @notice Amount of tokens to claim per address.
    mapping(address => uint256) public claimed;

    /// @notice Event for all auction data. Emmited on deployment.
    event AuctionDeployed(
        address funder,
        address token,
        uint256 totalTokens,
        address paymentCurrency,
        address admin,
        address wallet
    );

    /// @notice Event for updating auction times.  Needs to be before auction starts.
    event AuctionTimeUpdated(uint256 startTime, uint256 endTime);
    /// @notice Event for updating auction prices. Needs to be before auction starts.
    event AuctionPriceUpdated(uint256 minimumCommitmentAmount);
    /// @notice Event for updating auction wallet. Needs to be before auction starts.
    event AuctionWalletUpdated(address wallet);
    /// @notice Event for updating the point list.
    event AuctionPointListUpdated(address pointList, bool enabled);
    /// @notice Event for setting post auction launcher.
    event PostAuctionLauncherSet(address postAuctionLauncher);

    /// @notice Event for adding a commitment.
    event AddedCommitment(address addr, uint256 commitment);
    /// @notice Event for token withdrawals.
    event TokensWithdrawn(address token, address to, uint256 amount);

    /// @notice Event for finalization of the auction.
    event AuctionFinalized();
    /// @notice Event for cancellation of the auction.
    event AuctionCancelled();

    /**
     * @notice Initializes main contract variables and transfers funds for the auction.
     * @dev Init function.
     * @param _funder The address that funds the token for BatchAuction.
     * @param _token Address of the token being sold.
     * @param _totalTokens The total number of tokens to sell in auction.
     * @param _startTime Auction start time.
     * @param _endTime Auction end time.
     * @param _paymentCurrency The currency the BatchAuction accepts for payment. Can be ETH or token address.
     * @param _fee The fee amount of Tangleswap pool.
     * @param _minimumCommitmentAmount Minimum amount collected at which the auction will be successful.
     * @param _admin Address that can finalize auction.
     * @param _wallet Address where collected funds will be forwarded to.
     */
    function initAuction(
        address _funder,
        address _token,
        uint256 _totalTokens,
        uint256 _startTime,
        uint256 _endTime,
        address _paymentCurrency,
        uint24 _fee,
        uint256 _minimumCommitmentAmount,
        address _admin,
        address _pointList,
        address payable _wallet
    ) public {
        require(_endTime < 10000000000, "in seconds, not miliseconds");
        // solhint-disable-next-line not-rely-on-time
        require(_startTime >= block.timestamp, "start time is before current");
        require(_endTime > _startTime, "end must be older than start");
        require(_totalTokens > 0, "total must be greater than zero");
        require(_admin != address(0), "admin is the zero address");
        require(_wallet != address(0), "wallet is the zero address");
        require(IERC20(_token).decimals() == 18, "Token does not have 18 decimals");
        if (_paymentCurrency != ETH_ADDRESS) {
            require(IERC20(_paymentCurrency).decimals() > 0, "Payment currency is not ERC20");
        }

        marketStatus.minimumCommitmentAmount = BoringMath.to128(_minimumCommitmentAmount);

        marketInfo.startTime = BoringMath.to64(_startTime);
        marketInfo.endTime = BoringMath.to64(_endTime);
        marketInfo.totalTokens = BoringMath.to128(_totalTokens);

        auctionToken = _token;
        paymentCurrency = _paymentCurrency;
        // TangleswapPool->fee
        fee = _fee;
        wallet = _wallet;

        initAccessControls(_admin);

        _setList(_pointList);
        _safeTransferFrom(auctionToken, _funder, _totalTokens);

        emit AuctionDeployed(_funder, _token, _totalTokens, _paymentCurrency, _admin, _wallet);
        emit AuctionTimeUpdated(_startTime, _endTime);
        emit AuctionPriceUpdated(_minimumCommitmentAmount);
    }

    ///--------------------------------------------------------
    /// Commit to buying tokens!
    ///--------------------------------------------------------

    receive() external payable {
        revertBecauseUserDidNotProvideAgreement();
    }

    /**
     * @dev Attribution to the awesome delta.financial contracts
     */
    function marketParticipationAgreement() public pure returns (string memory) {
        return
            "I understand that I am interacting with a smart contract. I understand that tokens commited are subject to the token issuer and local laws where applicable. I have reviewed the code of this smart contract and understand it fully. I agree to not hold developers or other people associated with the project liable for any losses or misunderstandings";
    }

    /**
     * @dev Not using modifiers is a purposeful choice for code readability.
     */
    function revertBecauseUserDidNotProvideAgreement() internal pure {
        // solhint-disable-next-line reason-string
        revert("No agreement provided, please review the smart contract before interacting with it");
    }

    /**
     * @notice Commit ETH to buy tokens on auction.
     * @param _beneficiary Auction participant ETH address.
     */
    function commitEth(address payable _beneficiary, bool readAndAgreedToMarketParticipationAgreement) public payable {
        require(paymentCurrency == ETH_ADDRESS, "payment currency is not ETH");

        require(msg.value > 0, "Value must be higher than 0");
        if (readAndAgreedToMarketParticipationAgreement == false) {
            revertBecauseUserDidNotProvideAgreement();
        }
        _addCommitment(_beneficiary, msg.value);

        /// @notice Revert if commitmentsTotal exceeds the balance
        require(marketStatus.commitmentsTotal <= address(this).balance, "Committed ETH exceeds balance");
    }

    /**
     * @notice Buy Tokens by commiting approved ERC20 tokens to this contract address.
     * @param _amount Amount of tokens to commit.
     */
    function commitTokens(uint256 _amount, bool readAndAgreedToMarketParticipationAgreement) public {
        commitTokensFrom(msg.sender, _amount, readAndAgreedToMarketParticipationAgreement);
    }

    /**
     * @notice Checks if amount not 0 and makes the transfer and adds commitment.
     * @dev Users must approve contract prior to committing tokens to auction.
     * @param _from User ERC20 address.
     * @param _amount Amount of approved ERC20 tokens.
     */
    function commitTokensFrom(
        address _from,
        uint256 _amount,
        bool readAndAgreedToMarketParticipationAgreement
    ) public nonReentrant {
        require(paymentCurrency != ETH_ADDRESS, "Payment currency is not a token");
        if (readAndAgreedToMarketParticipationAgreement == false) {
            revertBecauseUserDidNotProvideAgreement();
        }
        require(_amount > 0, "Value must be higher than 0");
        _safeTransferFrom(paymentCurrency, msg.sender, _amount);
        _addCommitment(_from, _amount);
    }

    /// @notice Commits to an amount during an auction
    /**
     * @notice Updates commitment for this address and total commitment of the auction.
     * @param _addr Auction participant address.
     * @param _commitment The amount to commit.
     */
    function _addCommitment(address _addr, uint256 _commitment) internal {
        require(
            // solhint-disable-next-line not-rely-on-time
            block.timestamp >= marketInfo.startTime && block.timestamp <= marketInfo.endTime,
            "outside auction hours"
        );

        uint256 newCommitment = commitments[_addr].add(_commitment);
        if (marketStatus.usePointList) {
            require(IPointList(pointList).hasPoints(_addr, newCommitment), "points is less than given number");
        }
        commitments[_addr] = newCommitment;
        marketStatus.commitmentsTotal = BoringMath.to128(uint256(marketStatus.commitmentsTotal).add(_commitment));
        emit AddedCommitment(_addr, _commitment);
    }

    /**
     * @notice Calculates amount of auction tokens for user to receive.
     * @param amount Amount of tokens to commit.
     * @return Auction token amount.
     */
    function _getTokenAmount(uint256 amount) internal view returns (uint256) {
        if (marketStatus.commitmentsTotal == 0) return 0;
        return amount.mul(1e18).div(tokenPrice());
    }

    /**
     * @notice Calculates the price of each token from all commitments.
     * @return Token price.
     */
    function tokenPrice() public view returns (uint256) {
        return uint256(marketStatus.commitmentsTotal).mul(1e18).div(uint256(marketInfo.totalTokens));
    }

    ///--------------------------------------------------------
    /// Finalize Auction
    ///--------------------------------------------------------

    /// @notice Auction finishes successfully above the reserve
    /// @dev Transfer contract funds to initialized wallet.
    function finalize() public nonReentrant {
        require(
            hasAdminRole(msg.sender) ||
                wallet == msg.sender ||
                hasSmartContractRole(msg.sender) ||
                finalizeTimeExpired(),
            "Sender must be admin"
        );
        require(!marketStatus.finalized, "Auction has already finalized");
        require(marketInfo.totalTokens > 0, "Not initialized");
        // solhint-disable-next-line not-rely-on-time
        require(block.timestamp > marketInfo.endTime, "Auction has not finished yet");
        if (auctionSuccessful()) {
            /// @dev Successful auction
            /// @dev Transfer contributed tokens to wallet.
            _safeTokenPayment(paymentCurrency, wallet, uint256(marketStatus.commitmentsTotal));
        } else {
            /// @dev Failed auction
            /// @dev Return auction tokens back to wallet.
            _safeTokenPayment(auctionToken, wallet, marketInfo.totalTokens);
        }
        marketStatus.finalized = true;
        emit AuctionFinalized();
    }

    /**
     * @notice Cancel Auction
     * @dev Admin can cancel the auction before it starts
     */
    function cancelAuction() public nonReentrant {
        require(hasAdminRole(msg.sender), "sender must be an admin");
        MarketStatus storage status = marketStatus;
        require(!status.finalized, "already finalized");
        require(uint256(status.commitmentsTotal) == 0, "Funds already raised");

        _safeTokenPayment(auctionToken, wallet, uint256(marketInfo.totalTokens));

        status.finalized = true;
        emit AuctionCancelled();
    }

    /// @notice Withdraws bought tokens, or returns commitment if the sale is unsuccessful.
    function withdrawTokens() public {
        withdrawTokens(msg.sender);
    }

    /// @notice Withdraw your tokens once the Auction has ended.
    function withdrawTokens(address payable beneficiary) public nonReentrant {
        if (auctionSuccessful()) {
            require(marketStatus.finalized, "not finalized");
            /// @dev Successful auction! Transfer claimed tokens.
            uint256 tokensToClaim = tokensClaimable(beneficiary);
            require(tokensToClaim > 0, "No tokens to claim");
            claimed[beneficiary] = claimed[beneficiary].add(tokensToClaim);

            _safeTokenPayment(auctionToken, beneficiary, tokensToClaim);
        } else {
            /// @dev Auction did not meet reserve price.
            /// @dev Return committed funds back to user.
            // solhint-disable-next-line not-rely-on-time
            require(block.timestamp > marketInfo.endTime, "Auction has not finished yet");
            uint256 fundsCommitted = commitments[beneficiary];
            require(fundsCommitted > 0, "No funds committed");
            commitments[beneficiary] = 0; // Stop multiple withdrawals and free some gas
            _safeTokenPayment(paymentCurrency, beneficiary, fundsCommitted);
        }
    }

    /**
     * @notice How many tokens the user is able to claim.
     * @param _user Auction participant address.
     * @return  claimerCommitment Tokens left to claim.
     */
    function tokensClaimable(address _user) public view returns (uint256 claimerCommitment) {
        if (commitments[_user] == 0) return 0;
        uint256 unclaimedTokens = IERC20(auctionToken).balanceOf(address(this));
        claimerCommitment = _getTokenAmount(commitments[_user]);
        claimerCommitment = claimerCommitment.sub(claimed[_user]);

        if (claimerCommitment > unclaimedTokens) {
            claimerCommitment = unclaimedTokens;
        }
    }

    /**
     * @notice Checks if raised more than minimum amount.
     * @return True if tokens sold greater than or equals to the minimum commitment amount.
     */
    function auctionSuccessful() public view returns (bool) {
        return
            uint256(marketStatus.commitmentsTotal) >= uint256(marketStatus.minimumCommitmentAmount) &&
            uint256(marketStatus.commitmentsTotal) > 0;
    }

    /**
     * @notice Checks if the auction has ended.
     * @return bool True if current time is greater than auction end time.
     */
    function auctionEnded() public view returns (bool) {
        // solhint-disable-next-line not-rely-on-time
        return block.timestamp > marketInfo.endTime;
    }

    /**
     * @notice Checks if the auction has been finalised.
     * @return bool True if auction has been finalised.
     */
    function finalized() public view returns (bool) {
        return marketStatus.finalized;
    }

    /// @notice Returns true if 7 days have passed since the end of the auction
    function finalizeTimeExpired() public view returns (bool) {
        // solhint-disable-next-line not-rely-on-time
        return uint256(marketInfo.endTime) + 7 days < block.timestamp;
    }

    //--------------------------------------------------------
    // Documents
    //--------------------------------------------------------

    function setDocument(string calldata _name, string calldata _data) external {
        require(hasAdminRole(msg.sender), "sender must be an admin");
        _setDocument(_name, _data);
    }

    function setDocuments(string[] calldata _name, string[] calldata _data) external {
        require(hasAdminRole(msg.sender), "sender must be an admin");
        uint256 numDocs = _name.length;
        for (uint256 i = 0; i < numDocs; i++) {
            _setDocument(_name[i], _data[i]);
        }
    }

    function removeDocument(string calldata _name) external {
        require(hasAdminRole(msg.sender), "sender must be an admin");
        _removeDocument(_name);
    }

    //--------------------------------------------------------
    // Point Lists
    //--------------------------------------------------------

    function setList(address _list) external {
        require(hasAdminRole(msg.sender), "sender must be an admin");
        _setList(_list);
    }

    function enableList(bool _status) external {
        require(hasAdminRole(msg.sender), "sender must be an admin");
        marketStatus.usePointList = _status;

        emit AuctionPointListUpdated(pointList, marketStatus.usePointList);
    }

    function _setList(address _pointList) private {
        if (_pointList != address(0)) {
            pointList = _pointList;
            marketStatus.usePointList = true;
        }

        emit AuctionPointListUpdated(_pointList, marketStatus.usePointList);
    }

    //--------------------------------------------------------
    // Setter Functions
    //--------------------------------------------------------

    /**
     * @notice Admin can set start and end time through this function.
     * @param _startTime Auction start time.
     * @param _endTime Auction end time.
     */
    function setAuctionTime(uint256 _startTime, uint256 _endTime) external {
        require(hasAdminRole(msg.sender), "sender must be an admin");
        require(_startTime < 10000000000, "in seconds, not miliseconds");
        require(_endTime < 10000000000, "in seconds, not miliseconds");
        // solhint-disable-next-line not-rely-on-time
        require(_startTime >= block.timestamp, "start time is before current");
        require(_endTime > _startTime, "end must be older than start");

        require(marketStatus.commitmentsTotal == 0, "cannot have already started");

        marketInfo.startTime = BoringMath.to64(_startTime);
        marketInfo.endTime = BoringMath.to64(_endTime);

        emit AuctionTimeUpdated(_startTime, _endTime);
    }

    /**
     * @notice Admin can set start and min price through this function.
     * @param _minimumCommitmentAmount Auction minimum raised target.
     */
    function setAuctionPrice(uint256 _minimumCommitmentAmount) external {
        require(hasAdminRole(msg.sender), "sender must be an admin");

        require(marketStatus.commitmentsTotal == 0, "cannot have already started");

        marketStatus.minimumCommitmentAmount = BoringMath.to128(_minimumCommitmentAmount);

        emit AuctionPriceUpdated(_minimumCommitmentAmount);
    }

    /**
     * @notice Admin can set the auction wallet through this function.
     * @param _wallet Auction wallet is where funds will be sent.
     */
    function setAuctionWallet(address payable _wallet) external {
        require(hasAdminRole(msg.sender), "sender must be an admin");
        require(_wallet != address(0), "wallet is the zero address");

        wallet = _wallet;

        emit AuctionWalletUpdated(_wallet);
    }

    /**
     * @notice Admin can set the post auction contract address.
     */
    function setPostAuctionLauncher(address _postAuctionLauncher) external {
        require(hasAdminRole(msg.sender), "sender must be an admin");
        require(postAuctionLauncher == address(0), "post auction already set");

        postAuctionLauncher = _postAuctionLauncher;

        emit PostAuctionLauncherSet(_postAuctionLauncher);
    }

    //--------------------------------------------------------
    // Market Launchers
    //--------------------------------------------------------
    // solhint-disable-next-line no-empty-blocks
    function init(bytes calldata _data) external payable override {}

    function initMarket(bytes calldata _data) public override {
        (
            address _funder,
            address _token,
            uint256 _totalTokens,
            uint256 _startTime,
            uint256 _endTime,
            address _paymentCurrency,
            uint24 _fee,
            uint256 _minimumCommitmentAmount,
            address _admin,
            address _pointList,
            address payable _wallet
        ) = abi.decode(
                _data,
                (address, address, uint256, uint256, uint256, address, uint24, uint256, address, address, address)
            );
        initAuction(
            _funder,
            _token,
            _totalTokens,
            _startTime,
            _endTime,
            _paymentCurrency,
            _fee,
            _minimumCommitmentAmount,
            _admin,
            _pointList,
            _wallet
        );
    }

    function getBatchAuctionInitData(
        address _funder,
        address _token,
        uint256 _totalTokens,
        uint256 _startTime,
        uint256 _endTime,
        address _paymentCurrency,
        uint24 _fee,
        uint256 _minimumCommitmentAmount,
        address _admin,
        address _pointList,
        address payable _wallet
    ) external pure returns (bytes memory _data) {
        return
            abi.encode(
                _funder,
                _token,
                _totalTokens,
                _startTime,
                _endTime,
                _paymentCurrency,
                _fee,
                _minimumCommitmentAmount,
                _admin,
                _pointList,
                _wallet
            );
    }

    function getBaseInformation()
        external
        view
        returns (address token, uint64 startTime, uint64 endTime, bool marketFinalized)
    {
        return (auctionToken, marketInfo.startTime, marketInfo.endTime, marketStatus.finalized);
    }

    function getTotalTokens() external view returns (uint256) {
        return uint256(marketInfo.totalTokens);
    }
}
        

Contract ABI

[{"type":"event","name":"AddedCommitment","inputs":[{"type":"address","name":"addr","internalType":"address","indexed":false},{"type":"uint256","name":"commitment","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"AuctionCancelled","inputs":[],"anonymous":false},{"type":"event","name":"AuctionDeployed","inputs":[{"type":"address","name":"funder","internalType":"address","indexed":false},{"type":"address","name":"token","internalType":"address","indexed":false},{"type":"uint256","name":"totalTokens","internalType":"uint256","indexed":false},{"type":"address","name":"paymentCurrency","internalType":"address","indexed":false},{"type":"address","name":"admin","internalType":"address","indexed":false},{"type":"address","name":"wallet","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"AuctionFinalized","inputs":[],"anonymous":false},{"type":"event","name":"AuctionPointListUpdated","inputs":[{"type":"address","name":"pointList","internalType":"address","indexed":false},{"type":"bool","name":"enabled","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"AuctionPriceUpdated","inputs":[{"type":"uint256","name":"minimumCommitmentAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"AuctionTimeUpdated","inputs":[{"type":"uint256","name":"startTime","internalType":"uint256","indexed":false},{"type":"uint256","name":"endTime","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"AuctionWalletUpdated","inputs":[{"type":"address","name":"wallet","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"DocumentRemoved","inputs":[{"type":"string","name":"_name","internalType":"string","indexed":true},{"type":"string","name":"_data","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"DocumentUpdated","inputs":[{"type":"string","name":"_name","internalType":"string","indexed":true},{"type":"string","name":"_data","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"PostAuctionLauncherSet","inputs":[{"type":"address","name":"postAuctionLauncher","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"previousAdminRole","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"newAdminRole","internalType":"bytes32","indexed":true}],"anonymous":false},{"type":"event","name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"TokensWithdrawn","inputs":[{"type":"address","name":"token","internalType":"address","indexed":false},{"type":"address","name":"to","internalType":"address","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"DEFAULT_ADMIN_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"MINTER_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"OPERATOR_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"SMART_CONTRACT_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"_docNames","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addAdminRole","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addMinterRole","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addOperatorRole","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addSmartContractRole","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"auctionEnded","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"auctionSuccessful","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"auctionToken","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[{"type":"bool[]","name":"successes","internalType":"bool[]"},{"type":"bytes[]","name":"results","internalType":"bytes[]"}],"name":"batch","inputs":[{"type":"bytes[]","name":"calls","internalType":"bytes[]"},{"type":"bool","name":"revertOnFail","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"cancelAuction","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"claimed","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"commitEth","inputs":[{"type":"address","name":"_beneficiary","internalType":"address payable"},{"type":"bool","name":"readAndAgreedToMarketParticipationAgreement","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"commitTokens","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"},{"type":"bool","name":"readAndAgreedToMarketParticipationAgreement","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"commitTokensFrom","inputs":[{"type":"address","name":"_from","internalType":"address"},{"type":"uint256","name":"_amount","internalType":"uint256"},{"type":"bool","name":"readAndAgreedToMarketParticipationAgreement","internalType":"bool"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"commitments","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"enableList","inputs":[{"type":"bool","name":"_status","internalType":"bool"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint24","name":"","internalType":"uint24"}],"name":"fee","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"finalize","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"finalizeTimeExpired","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"finalized","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string[]","name":"","internalType":"string[]"}],"name":"getAllDocuments","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"token","internalType":"address"},{"type":"uint64","name":"startTime","internalType":"uint64"},{"type":"uint64","name":"endTime","internalType":"uint64"},{"type":"bool","name":"marketFinalized","internalType":"bool"}],"name":"getBaseInformation","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"bytes","name":"_data","internalType":"bytes"}],"name":"getBatchAuctionInitData","inputs":[{"type":"address","name":"_funder","internalType":"address"},{"type":"address","name":"_token","internalType":"address"},{"type":"uint256","name":"_totalTokens","internalType":"uint256"},{"type":"uint256","name":"_startTime","internalType":"uint256"},{"type":"uint256","name":"_endTime","internalType":"uint256"},{"type":"address","name":"_paymentCurrency","internalType":"address"},{"type":"uint24","name":"_fee","internalType":"uint24"},{"type":"uint256","name":"_minimumCommitmentAmount","internalType":"uint256"},{"type":"address","name":"_admin","internalType":"address"},{"type":"address","name":"_pointList","internalType":"address"},{"type":"address","name":"_wallet","internalType":"address payable"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"},{"type":"uint256","name":"","internalType":"uint256"}],"name":"getDocument","inputs":[{"type":"string","name":"_name","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getDocumentCount","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"getDocumentName","inputs":[{"type":"uint256","name":"_index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"getRoleAdmin","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getRoleMember","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getRoleMemberCount","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getTotalTokens","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"grantRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"hasAdminRole","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"hasMinterRole","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"hasOperatorRole","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"hasRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"hasSmartContractRole","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"init","inputs":[{"type":"bytes","name":"_data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initAccessControls","inputs":[{"type":"address","name":"_admin","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initAuction","inputs":[{"type":"address","name":"_funder","internalType":"address"},{"type":"address","name":"_token","internalType":"address"},{"type":"uint256","name":"_totalTokens","internalType":"uint256"},{"type":"uint256","name":"_startTime","internalType":"uint256"},{"type":"uint256","name":"_endTime","internalType":"uint256"},{"type":"address","name":"_paymentCurrency","internalType":"address"},{"type":"uint24","name":"_fee","internalType":"uint24"},{"type":"uint256","name":"_minimumCommitmentAmount","internalType":"uint256"},{"type":"address","name":"_admin","internalType":"address"},{"type":"address","name":"_pointList","internalType":"address"},{"type":"address","name":"_wallet","internalType":"address payable"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initMarket","inputs":[{"type":"bytes","name":"_data","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint64","name":"startTime","internalType":"uint64"},{"type":"uint64","name":"endTime","internalType":"uint64"},{"type":"uint128","name":"totalTokens","internalType":"uint128"}],"name":"marketInfo","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"marketParticipationAgreement","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint128","name":"commitmentsTotal","internalType":"uint128"},{"type":"uint128","name":"minimumCommitmentAmount","internalType":"uint128"},{"type":"bool","name":"finalized","internalType":"bool"},{"type":"bool","name":"usePointList","internalType":"bool"}],"name":"marketStatus","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"marketTemplate","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"paymentCurrency","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"permitToken","inputs":[{"type":"address","name":"token","internalType":"contract IERC20"},{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"deadline","internalType":"uint256"},{"type":"uint8","name":"v","internalType":"uint8"},{"type":"bytes32","name":"r","internalType":"bytes32"},{"type":"bytes32","name":"s","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"pointList","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"postAuctionLauncher","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeAdminRole","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeDocument","inputs":[{"type":"string","name":"_name","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeMinterRole","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeOperatorRole","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeSmartContractRole","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"revokeRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setAuctionPrice","inputs":[{"type":"uint256","name":"_minimumCommitmentAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setAuctionTime","inputs":[{"type":"uint256","name":"_startTime","internalType":"uint256"},{"type":"uint256","name":"_endTime","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setAuctionWallet","inputs":[{"type":"address","name":"_wallet","internalType":"address payable"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setDocument","inputs":[{"type":"string","name":"_name","internalType":"string"},{"type":"string","name":"_data","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setDocuments","inputs":[{"type":"string[]","name":"_name","internalType":"string[]"},{"type":"string[]","name":"_data","internalType":"string[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setList","inputs":[{"type":"address","name":"_list","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPostAuctionLauncher","inputs":[{"type":"address","name":"_postAuctionLauncher","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"tokenPrice","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"claimerCommitment","internalType":"uint256"}],"name":"tokensClaimable","inputs":[{"type":"address","name":"_user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address payable"}],"name":"wallet","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawTokens","inputs":[{"type":"address","name":"beneficiary","internalType":"address payable"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawTokens","inputs":[]},{"type":"receive","stateMutability":"payable"}]
            

Deployed ByteCode

Verify & Publish
0x363d3d373d3d3d363d732f47f3d2eff803cfd78aa530f6f57159766b22925af43d82803e903d91602b57fd5bf3