ETH Price: $2,389.67 (+2.76%)

Contract

0xF5b957108627d26C8DC305898e28076E8F764fa1
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60806040141271802022-02-02 14:31:20959 days ago1643812280IN
 Create: BillboardsCollective
0 ETH0.12844983110.95519314

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BillboardsCollective

Compiler Version
v0.6.8+commit.0bbfe453

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 10 : BillboardContract.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.6.8;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@zoralabs/core/dist/contracts/interfaces/IMarket.sol";
import "@zoralabs/core/dist/contracts/interfaces/IMedia.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";

interface ERC721Owner {
  function ownerOf(uint256 token) external view returns (address);
}

/// @title Billboards colective contracts
/// @author The Coinvise Team
/// @notice This contract implements functionalities from the zora Contracts - https://github.com/ourzora/core
/// @dev a number of the logic here actually happens in the zora contracts
contract BillboardsCollective is IERC721Receiver, Initializable {
  using SafeMath for uint256;

  /// @notice Mapping of address to boolean
  mapping(address => bool) public isAdmin;

  /// @notice Address of WETH
  address wethAddress;

  /// @notice address of the zora contracts
  IMedia MediaContract;
  IMarket MarketContract;

  ERC721Owner MediaOwner;

  IERC20 wethInstance;

  address mainAdmin;

  /// @notice Emitted when contract WETH balance is withdrawn
  /// @param _to The address the balance was sent to
  /// @param _contractBal The amount of the contract balance that was sent
  event ContractBalanceWithdrawn(address _to, uint256 _contractBal);

  /// @notice restricts function call to only admin wherever applied
  modifier onlyAdmin() {
    require(
      isAdmin[msg.sender] == true,
      "only an admin can call this function"
    );
    _;
  }

  /// @notice restricts function call to only main admin wherever applied
  modifier onlyMainAdmin() {
    require(
      msg.sender == mainAdmin,
      "only the main admin can call this function"
    );
    _;
  }

  /// @notice BillboardsCollective constructor
  /**
   * @dev We cannot have constructors in upgradeable contracts,
   *      therefore we define an initialize function which we call
   *      manually once the contract is deployed.
   *      the initializer modififer ensures that this can only be called once.
   *      in practice, the openzeppelin library automatically calls the initialize
   *      function once deployed.
   */
  /// @param _mainAdmin Address of the main admin (super admin)
  /// @param _mediaContractAddress is the address of zora media contract
  /// @param _marketContractAddress is the address if zora market contract
  /// @param _wethAddress Address of WETH
  function initialize(
    address _mainAdmin,
    address _mediaContractAddress,
    address _marketContractAddress,
    address _wethAddress
  ) public initializer {
    MediaContract = IMedia(_mediaContractAddress);
    MarketContract = IMarket(_marketContractAddress);
    MediaOwner = ERC721Owner(_mediaContractAddress);
    wethAddress = _wethAddress;
    wethInstance = IERC20(_wethAddress);
    mainAdmin = _mainAdmin;
    isAdmin[_mainAdmin] = true;
  }

  function viewMainAdmin() public view returns (address) {
    return mainAdmin;
  }

  function addAdmin(address _newAdmin) public onlyMainAdmin {
    isAdmin[_newAdmin] = true;
  }

  function removeAdmin(address _adminAddress) public onlyMainAdmin {
    require(
      isAdmin[_adminAddress] == true,
      "this address is currently not an admin"
    );
    isAdmin[_adminAddress] = false;
  }

  /// @notice This function mints a Media, it calls the mint function in the zora Media contract
  /// @dev This function is only callable by admin
  /// @param tokenURI A valid URI of the content represented by this token
  /// @param metadataURI A valid URI of the metadata associated with this token
  /// @param contentHash A SHA256 hash of the content pointed to by tokenURI
  /// @param metadataHash A SHA256 hash of the content pointed to by metadataURI
  function MintMedia(
    string memory tokenURI,
    string memory metadataURI,
    bytes32 contentHash,
    bytes32 metadataHash
  ) public onlyAdmin {
    IMedia.MediaData memory newData = IMedia.MediaData(
      tokenURI,
      metadataURI,
      contentHash,
      metadataHash
    );
    IMarket.BidShares memory bid_Share = IMarket.BidShares(
      Decimal.D256(0 * 10**18),
      Decimal.D256(15 * 10**18),
      Decimal.D256(85 * 10**18)
    );

    MediaContract.mint(newData, bid_Share);
  }

  /**
   * @notice This function mints mulitple Medias, it calls the mint function in the zora Media contract,
   * The zora contracts doesn't have a function to batch Mint, we only pass arrays here
   */
  /// @dev This function is only callable by admin - it takes an array of parameters described in the next lines
  /// @param allTokenURI an array of valid URIs of the contents represented by this tokens
  /// @param allMetadataURI an array of valid URIs of the metadata associated with this tokens
  /// @param allContentHash an array of SHA256 hash of the contents pointed to by each tokenURI
  /// @param allMetadataHash an array of SHA256 hash of the contents pointed to by each metadataURI
  /// @return returns boolean value
  function BatchMintMedia(
    string[] memory allTokenURI,
    string[] memory allMetadataURI,
    bytes32[] memory allContentHash,
    bytes32[] memory allMetadataHash
  ) public onlyAdmin returns (bool) {
    for (uint256 i = 0; i < allTokenURI.length; i++) {
      IMedia.MediaData memory newData = IMedia.MediaData(
        allTokenURI[i],
        allMetadataURI[i],
        allContentHash[i],
        allMetadataHash[i]
      );
      IMarket.BidShares memory bid_Share = IMarket.BidShares(
        Decimal.D256(0 * 10**18),
        Decimal.D256(15 * 10**18),
        Decimal.D256(85 * 10**18)
      );
      MediaContract.mint(newData, bid_Share);
    }
    return true;
  }

  /// @notice Function to get the owner of a media
  /// @param tokenId The id of the media
  /// @return The address of the owner
  function OwnerOfMedia(uint256 tokenId) public view returns (address) {
    return MediaOwner.ownerOf(tokenId);
  }

  /// @notice this function returns bidshares on a particular Media when it is sold
  /// @param tokenId id of the media
  /// @return returns the bid shares
  function MediaBidShares(uint256 tokenId)
    public
    view
    returns (IMarket.BidShares memory)
  {
    return MarketContract.bidSharesForToken(tokenId);
  }

  /// @notice this function is an implementation from the openzepellin IERC721Reciever
  /**
   * @dev Whenever an IERC721 tokenId token is transferred to this contract via IERC721.safeTransferFrom by operator from `from`,
   * this function is called.
   * It must return its Solidity selector to confirm the token transfer.
   * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
   */
  function onERC721Received(
    address,
    address,
    uint256,
    bytes memory
  ) public virtual override returns (bytes4) {
    return this.onERC721Received.selector;
  }

  /// @notice this functionality implements the set Ask in zora contracts
  /// @dev the actual logic happens in the zora contracts
  /// @param _amount the amount to set on the Media
  /// @param _tokenId the id of the media
  function setToSale(uint256 _amount, uint256 _tokenId) public {
    IMarket.Ask memory saleCondition = IMarket.Ask(_amount, wethAddress);
    MediaContract.setAsk(_tokenId, saleCondition);
  }

  /// @notice this functionality implements the setAsk for multiple Media in a single function call with uniform amount
  /// @dev zora Media contract doesn't have a function to batch setAsk, we only pass in an array of ids from here
  /// @param _amount amount to set the Medias to
  /// @param _tokenIds an array of token Ids
  function batchSetSale(uint256 _amount, uint256[] memory _tokenIds) public {
    for (uint256 i = 0; i < _tokenIds.length; i++) {
      IMarket.Ask memory saleCondition = IMarket.Ask(_amount, wethAddress);
      MediaContract.setAsk(_tokenIds[i], saleCondition);
    }
  }

  /// @notice Function to see the current ask price on a tokenId
  /// @param tokenId The tokenId of the Media
  /// @return uint256 The ask price of the tokenId
  function currentAskPrice(uint256 tokenId) public view returns (uint256) {
    return MarketContract.currentAskForToken(tokenId).amount;
  }

  /// @notice Function to see the current WETH balance
  /// @return uint256 The current WETH balance
  function wethBalanceOfContract() public view returns (uint256) {
    return wethInstance.balanceOf(address(this));
  }

  /// @notice Function to withdraw the current WETH balance
  /// @param _wallet The address to send the WETH to
  function withdrawContractBalance(address _wallet) public onlyMainAdmin {
    uint256 wethBal = wethBalanceOfContract();
    wethInstance.transfer(_wallet, wethBal);

    emit ContractBalanceWithdrawn(_wallet, wethBal);
  }
}

File 2 of 10 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4);
}

File 3 of 10 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

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

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

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

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

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

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

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

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: modulo by zero");
        return a % b;
    }

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

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

File 4 of 10 : IMarket.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity 0.6.8;
pragma experimental ABIEncoderV2;

import {Decimal} from "../Decimal.sol";

/**
 * @title Interface for Zora Protocol's Market
 */
interface IMarket {
    struct Bid {
        // Amount of the currency being bid
        uint256 amount;
        // Address to the ERC20 token being used to bid
        address currency;
        // Address of the bidder
        address bidder;
        // Address of the recipient
        address recipient;
        // % of the next sale to award the current owner
        Decimal.D256 sellOnShare;
    }

    struct Ask {
        // Amount of the currency being asked
        uint256 amount;
        // Address to the ERC20 token being asked
        address currency;
    }

    struct BidShares {
        // % of sale value that goes to the _previous_ owner of the nft
        Decimal.D256 prevOwner;
        // % of sale value that goes to the original creator of the nft
        Decimal.D256 creator;
        // % of sale value that goes to the seller (current owner) of the nft
        Decimal.D256 owner;
    }

    event BidCreated(uint256 indexed tokenId, Bid bid);
    event BidRemoved(uint256 indexed tokenId, Bid bid);
    event BidFinalized(uint256 indexed tokenId, Bid bid);
    event AskCreated(uint256 indexed tokenId, Ask ask);
    event AskRemoved(uint256 indexed tokenId, Ask ask);
    event BidShareUpdated(uint256 indexed tokenId, BidShares bidShares);

    function bidForTokenBidder(uint256 tokenId, address bidder)
        external
        view
        returns (Bid memory);

    function currentAskForToken(uint256 tokenId)
        external
        view
        returns (Ask memory);

    function bidSharesForToken(uint256 tokenId)
        external
        view
        returns (BidShares memory);

    function isValidBid(uint256 tokenId, uint256 bidAmount)
        external
        view
        returns (bool);

    function isValidBidShares(BidShares calldata bidShares)
        external
        pure
        returns (bool);

    function splitShare(Decimal.D256 calldata sharePercentage, uint256 amount)
        external
        pure
        returns (uint256);

    function configure(address mediaContractAddress) external;

    function setBidShares(uint256 tokenId, BidShares calldata bidShares)
        external;

    function setAsk(uint256 tokenId, Ask calldata ask) external;

    function removeAsk(uint256 tokenId) external;

    function setBid(
        uint256 tokenId,
        Bid calldata bid,
        address spender
    ) external;

    function removeBid(uint256 tokenId, address bidder) external;

    function acceptBid(uint256 tokenId, Bid calldata expectedBid) external;
}

File 5 of 10 : IMedia.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity 0.6.8;
pragma experimental ABIEncoderV2;

import {IMarket} from "./IMarket.sol";

/**
 * @title Interface for Zora Protocol's Media
 */
interface IMedia {
    struct EIP712Signature {
        uint256 deadline;
        uint8 v;
        bytes32 r;
        bytes32 s;
    }

    struct MediaData {
        // A valid URI of the content represented by this token
        string tokenURI;
        // A valid URI of the metadata associated with this token
        string metadataURI;
        // A SHA256 hash of the content pointed to by tokenURI
        bytes32 contentHash;
        // A SHA256 hash of the content pointed to by metadataURI
        bytes32 metadataHash;
    }

    event TokenURIUpdated(uint256 indexed _tokenId, address owner, string _uri);
    event TokenMetadataURIUpdated(
        uint256 indexed _tokenId,
        address owner,
        string _uri
    );

    /**
     * @notice Return the metadata URI for a piece of media given the token URI
     */
    function tokenMetadataURI(uint256 tokenId)
        external
        view
        returns (string memory);

    /**
     * @notice Mint new media for msg.sender.
     */
    function mint(MediaData calldata data, IMarket.BidShares calldata bidShares)
        external;

    /**
     * @notice EIP-712 mintWithSig method. Mints new media for a creator given a valid signature.
     */
    function mintWithSig(
        address creator,
        MediaData calldata data,
        IMarket.BidShares calldata bidShares,
        EIP712Signature calldata sig
    ) external;

    /**
     * @notice Transfer the token with the given ID to a given address.
     * Save the previous owner before the transfer, in case there is a sell-on fee.
     * @dev This can only be called by the auction contract specified at deployment
     */
    function auctionTransfer(uint256 tokenId, address recipient) external;

    /**
     * @notice Set the ask on a piece of media
     */
    function setAsk(uint256 tokenId, IMarket.Ask calldata ask) external;

    /**
     * @notice Remove the ask on a piece of media
     */
    function removeAsk(uint256 tokenId) external;

    /**
     * @notice Set the bid on a piece of media
     */
    function setBid(uint256 tokenId, IMarket.Bid calldata bid) external;

    /**
     * @notice Remove the bid on a piece of media
     */
    function removeBid(uint256 tokenId) external;

    function acceptBid(uint256 tokenId, IMarket.Bid calldata bid) external;

    /**
     * @notice Revoke approval for a piece of media
     */
    function revokeApproval(uint256 tokenId) external;

    /**
     * @notice Update the token URI
     */
    function updateTokenURI(uint256 tokenId, string calldata tokenURI) external;

    /**
     * @notice Update the token metadata uri
     */
    function updateTokenMetadataURI(
        uint256 tokenId,
        string calldata metadataURI
    ) external;

    /**
     * @notice EIP-712 permit method. Sets an approved spender given a valid signature.
     */
    function permit(
        address spender,
        uint256 tokenId,
        EIP712Signature calldata sig
    ) external;
}

File 6 of 10 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.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);
}

File 7 of 10 : Initializable.sol
// SPDX-License-Identifier: MIT

// solhint-disable-next-line compiler-version
pragma solidity >=0.4.24 <0.8.0;

import "../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 */
abstract contract Initializable {

    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /// @dev Returns true if and only if the function is running in the constructor
    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

File 8 of 10 : Decimal.sol
/*
    Copyright 2019 dYdX Trading Inc.
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/

pragma solidity 0.6.8;
pragma experimental ABIEncoderV2;

/**
 * NOTE: This file is a clone of the dydx protocol's Decimal.sol contract. It was forked from https://github.com/dydxprotocol/solo
 * at commit 2d8454e02702fe5bc455b848556660629c3cad36
 *
 * It has not been modified other than to use a newer solidity in the pragma to match the rest of the contract suite of this project
 */

import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
import {Math} from "./Math.sol";

/**
 * @title Decimal
 *
 * Library that defines a fixed-point number with 18 decimal places.
 */
library Decimal {
    using SafeMath for uint256;

    // ============ Constants ============

    uint256 constant BASE_POW = 18;
    uint256 constant BASE = 10**BASE_POW;

    // ============ Structs ============

    struct D256 {
        uint256 value;
    }

    // ============ Functions ============

    function one() internal pure returns (D256 memory) {
        return D256({value: BASE});
    }

    function onePlus(D256 memory d) internal pure returns (D256 memory) {
        return D256({value: d.value.add(BASE)});
    }

    function mul(uint256 target, D256 memory d)
        internal
        pure
        returns (uint256)
    {
        return Math.getPartial(target, d.value, BASE);
    }

    function div(uint256 target, D256 memory d)
        internal
        pure
        returns (uint256)
    {
        return Math.getPartial(target, BASE, d.value);
    }
}

File 9 of 10 : Math.sol
pragma solidity 0.6.8;
pragma experimental ABIEncoderV2;

import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";

/**
 * @title Math
 *
 * Library for non-standard Math functions
 * NOTE: This file is a clone of the dydx protocol's Decimal.sol contract.
 * It was forked from https://github.com/dydxprotocol/solo at commit
 * 2d8454e02702fe5bc455b848556660629c3cad36. It has not been modified other than to use a
 * newer solidity in the pragma to match the rest of the contract suite of this project.
 */
library Math {
    using SafeMath for uint256;

    // ============ Library Functions ============

    /*
     * Return target * (numerator / denominator).
     */
    function getPartial(
        uint256 target,
        uint256 numerator,
        uint256 denominator
    ) internal pure returns (uint256) {
        return target.mul(numerator).div(denominator);
    }

    /*
     * Return target * (numerator / denominator), but rounded up.
     */
    function getPartialRoundUp(
        uint256 target,
        uint256 numerator,
        uint256 denominator
    ) internal pure returns (uint256) {
        if (target == 0 || numerator == 0) {
            // SafeMath will check for zero denominator
            return SafeMath.div(0, denominator);
        }
        return target.mul(numerator).sub(1).div(denominator).add(1);
    }

    function to128(uint256 number) internal pure returns (uint128) {
        uint128 result = uint128(number);
        require(result == number, "Math: Unsafe cast to uint128");
        return result;
    }

    function to96(uint256 number) internal pure returns (uint96) {
        uint96 result = uint96(number);
        require(result == number, "Math: Unsafe cast to uint96");
        return result;
    }

    function to32(uint256 number) internal pure returns (uint32) {
        uint32 result = uint32(number);
        require(result == number, "Math: Unsafe cast to uint32");
        return result;
    }

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

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

File 10 of 10 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_contractBal","type":"uint256"}],"name":"ContractBalanceWithdrawn","type":"event"},{"inputs":[{"internalType":"string[]","name":"allTokenURI","type":"string[]"},{"internalType":"string[]","name":"allMetadataURI","type":"string[]"},{"internalType":"bytes32[]","name":"allContentHash","type":"bytes32[]"},{"internalType":"bytes32[]","name":"allMetadataHash","type":"bytes32[]"}],"name":"BatchMintMedia","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"MediaBidShares","outputs":[{"components":[{"components":[{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct Decimal.D256","name":"prevOwner","type":"tuple"},{"components":[{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct Decimal.D256","name":"creator","type":"tuple"},{"components":[{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct Decimal.D256","name":"owner","type":"tuple"}],"internalType":"struct IMarket.BidShares","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"tokenURI","type":"string"},{"internalType":"string","name":"metadataURI","type":"string"},{"internalType":"bytes32","name":"contentHash","type":"bytes32"},{"internalType":"bytes32","name":"metadataHash","type":"bytes32"}],"name":"MintMedia","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"OwnerOfMedia","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newAdmin","type":"address"}],"name":"addAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"batchSetSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"currentAskPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_mainAdmin","type":"address"},{"internalType":"address","name":"_mediaContractAddress","type":"address"},{"internalType":"address","name":"_marketContractAddress","type":"address"},{"internalType":"address","name":"_wethAddress","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_adminAddress","type":"address"}],"name":"removeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"setToSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"viewMainAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wethBalanceOfContract","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_wallet","type":"address"}],"name":"withdrawContractBalance","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b506113fa806100206000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c80637048027511610097578063a400c2be11610066578063a400c2be146101ff578063b25a689f14610207578063ee6e45ae14610227578063f8c8765e1461023a576100f5565b806370480275146101b357806371fde3b2146101c65780637c988a23146101d957806384684d43146101ec576100f5565b806324d7806c116100d357806324d7806c1461014b57806345d4af201461016b5780634f801e2a1461018057806357fbb9df146101a0576100f5565b8063150b7a02146100fa5780631785f53c146101235780631c02c1a914610138575b600080fd5b61010d610108366004610de3565b61024d565b60405161011a9190611194565b60405180910390f35b610136610131366004610d49565b61025d565b005b610136610146366004610f09565b6102ef565b61015e610159366004610d49565b61040a565b60405161011a9190611189565b61017361041f565b60405161011a9190611338565b61019361018e366004611005565b6104a5565b60405161011a919061115c565b6101366101ae366004610d49565b61052c565b6101366101c1366004610d49565b610623565b6101366101d43660046110d4565b610674565b6101366101e7366004611035565b6106fc565b61015e6101fa366004610e4d565b6107b5565b610193610939565b61021a610215366004611005565b610948565b60405161011a91906112cb565b610173610235366004611005565b6109cf565b610136610248366004610d88565b610a57565b630a85bd0160e11b949350505050565b6007546001600160a01b031633146102905760405162461bcd60e51b815260040161028790611281565b60405180910390fd5b6001600160a01b03811660009081526001602081905260409091205460ff161515146102ce5760405162461bcd60e51b8152600401610287906111ed565b6001600160a01b03166000908152600160205260409020805460ff19169055565b3360009081526001602081905260409091205460ff161515146103245760405162461bcd60e51b8152600401610287906111a9565b61032c610b72565b6040518060800160405280868152602001858152602001848152602001838152509050610357610b99565b5060408051608081018252600060608201908152815281516020818101845267d02ab486cedc00008252808301919091528251908101835268049b9ca9a6943400008152818301526003549151632cca323760e01b815290916001600160a01b031690632cca3237906103d090859085906004016112d9565b600060405180830381600087803b1580156103ea57600080fd5b505af11580156103fe573d6000803e3d6000fd5b50505050505050505050565b60016020526000908152604090205460ff1681565b6006546040516370a0823160e01b81526000916001600160a01b0316906370a082319061045090309060040161115c565b60206040518083038186803b15801561046857600080fd5b505afa15801561047c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a0919061101d565b905090565b6005546040516331a9108f60e11b81526000916001600160a01b031690636352211e906104d6908590600401611338565b60206040518083038186803b1580156104ee57600080fd5b505afa158015610502573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105269190610d6c565b92915050565b6007546001600160a01b031633146105565760405162461bcd60e51b815260040161028790611281565b600061056061041f565b60065460405163a9059cbb60e01b81529192506001600160a01b03169063a9059cbb906105939085908590600401611170565b602060405180830381600087803b1580156105ad57600080fd5b505af11580156105c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e59190610ee9565b507f9ca86e26e8d02952f920895df7583aa717e8ebc63cd0708c0879da89b9a074458282604051610617929190611170565b60405180910390a15050565b6007546001600160a01b0316331461064d5760405162461bcd60e51b815260040161028790611281565b6001600160a01b03166000908152600160208190526040909120805460ff19169091179055565b61067c610bcb565b506040805180820182528381526002546001600160a01b039081166020830152600354925163062f24b760e41b8152919216906362f24b70906106c59085908590600401611341565b600060405180830381600087803b1580156106df57600080fd5b505af11580156106f3573d6000803e3d6000fd5b50505050505050565b60005b81518110156107b057610710610bcb565b50604080518082019091528381526002546001600160a01b03908116602083015260035484519116906362f24b709085908590811061074b57fe5b6020026020010151836040518363ffffffff1660e01b8152600401610771929190611341565b600060405180830381600087803b15801561078b57600080fd5b505af115801561079f573d6000803e3d6000fd5b5050600190930192506106ff915050565b505050565b33600090815260016020819052604082205460ff161515146107e95760405162461bcd60e51b8152600401610287906111a9565b60005b855181101561092d576107fd610b72565b604051806080016040528088848151811061081457fe5b6020026020010151815260200187848151811061082d57fe5b6020026020010151815260200186848151811061084657fe5b6020026020010151815260200185848151811061085f57fe5b60200260200101518152509050610874610b99565b5060408051608081018252600060608201908152815281516020818101845267d02ab486cedc00008252808301919091528251908101835268049b9ca9a6943400008152818301526003549151632cca323760e01b815290916001600160a01b031690632cca3237906108ed90859085906004016112d9565b600060405180830381600087803b15801561090757600080fd5b505af115801561091b573d6000803e3d6000fd5b5050600190940193506107ec92505050565b50600195945050505050565b6007546001600160a01b031690565b610950610b99565b60048054604051637ce702c160e11b81526001600160a01b039091169163f9ce05829161097f91869101611338565b60606040518083038186803b15801561099757600080fd5b505afa1580156109ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105269190610fb3565b60048054604051632bc0327b60e11b81526000926001600160a01b039092169163578064f691610a0191869101611338565b604080518083038186803b158015610a1857600080fd5b505afa158015610a2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a509190610f7a565b5192915050565b600054610100900460ff1680610a705750610a70610b5b565b80610a7e575060005460ff16155b610a9a5760405162461bcd60e51b815260040161028790611233565b600054610100900460ff16158015610ac5576000805460ff1961ff0019909116610100171660011790555b600380546001600160a01b03199081166001600160a01b03878116918217909355600480548316878516179055600580548316909117905560028054821685841690811790915560068054831690911790556007805490911691871691821790556000908152600160208190526040909120805460ff191690911790558015610b54576000805461ff00191690555b5050505050565b6000610b6630610b6c565b15905090565b3b151590565b60408051608081018252606080825260208201819052600092820183905281019190915290565b6040518060600160405280610bac610be2565b8152602001610bb9610be2565b8152602001610bc6610be2565b905290565b604080518082019091526000808252602082015290565b6040518060200160405280600081525090565b600082601f830112610c05578081fd5b8135610c18610c138261138c565b611365565b818152915060208083019084810181840286018201871015610c3957600080fd5b60005b84811015610c5857813584529282019290820190600101610c3c565b505050505092915050565b600082601f830112610c73578081fd5b8135610c81610c138261138c565b818152915060208083019084810160005b84811015610c5857610ca9888484358a0101610cbb565b84529282019290820190600101610c92565b600082601f830112610ccb578081fd5b813567ffffffffffffffff811115610ce1578182fd5b610cf4601f8201601f1916602001611365565b9150808252836020828501011115610d0b57600080fd5b8060208401602084013760009082016020015292915050565b600060208284031215610d35578081fd5b610d3f6020611365565b9151825250919050565b600060208284031215610d5a578081fd5b8135610d65816113ac565b9392505050565b600060208284031215610d7d578081fd5b8151610d65816113ac565b60008060008060808587031215610d9d578283fd5b8435610da8816113ac565b93506020850135610db8816113ac565b92506040850135610dc8816113ac565b91506060850135610dd8816113ac565b939692955090935050565b60008060008060808587031215610df8578384fd5b8435610e03816113ac565b93506020850135610e13816113ac565b925060408501359150606085013567ffffffffffffffff811115610e35578182fd5b610e4187828801610cbb565b91505092959194509250565b60008060008060808587031215610e62578384fd5b843567ffffffffffffffff80821115610e79578586fd5b610e8588838901610c63565b95506020870135915080821115610e9a578485fd5b610ea688838901610c63565b94506040870135915080821115610ebb578384fd5b610ec788838901610bf5565b93506060870135915080821115610edc578283fd5b50610e4187828801610bf5565b600060208284031215610efa578081fd5b81518015158114610d65578182fd5b60008060008060808587031215610f1e578182fd5b843567ffffffffffffffff80821115610f35578384fd5b610f4188838901610cbb565b95506020870135915080821115610f56578384fd5b50610f6387828801610cbb565b949794965050505060408301359260600135919050565b600060408284031215610f8b578081fd5b610f956040611365565b825181526020830151610fa7816113ac565b60208201529392505050565b600060608284031215610fc4578081fd5b610fce6060611365565b610fd88484610d24565b8152610fe78460208501610d24565b6020820152610ff98460408501610d24565b60408201529392505050565b600060208284031215611016578081fd5b5035919050565b60006020828403121561102e578081fd5b5051919050565b60008060408385031215611047578182fd5b8235915060208084013567ffffffffffffffff811115611065578283fd5b80850186601f820112611076578384fd5b80359150611086610c138361138c565b82815283810190828501858502840186018a10156110a2578687fd5b8693505b848410156110c45780358352600193909301929185019185016110a6565b5080955050505050509250929050565b600080604083850312156110e6578182fd5b50508035926020909101359150565b60008151808452815b8181101561111a576020818501810151868301820152016110fe565b8181111561112b5782602083870101525b50601f01601f19169290920160200192915050565b8051518252602080820151519083015260409081015151910152565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b6001600160e01b031991909116815260200190565b60208082526024908201527f6f6e6c7920616e2061646d696e2063616e2063616c6c20746869732066756e636040820152633a34b7b760e11b606082015260800190565b60208082526026908201527f7468697320616464726573732069732063757272656e746c79206e6f7420616e6040820152651030b236b4b760d11b606082015260800190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602a908201527f6f6e6c7920746865206d61696e2061646d696e2063616e2063616c6c207468696040820152693990333ab731ba34b7b760b11b606082015260800190565b606081016105268284611140565b60006080825283516080808401526112f56101008401826110f5565b6020860151848203607f190160a0860152915061131281836110f5565b604087015160c0860152606087015160e08601529250610d659150506020830184611140565b90815260200190565b918252805160208084019190915201516001600160a01b0316604082015260600190565b60405181810167ffffffffffffffff8111828210171561138457600080fd5b604052919050565b600067ffffffffffffffff8211156113a2578081fd5b5060209081020190565b6001600160a01b03811681146113c157600080fd5b5056fea2646970667358221220b65dd7415e5eaa8d46ae37bf2afdc329bb8b7d23cefa587057961b23c1470fc364736f6c63430006080033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80637048027511610097578063a400c2be11610066578063a400c2be146101ff578063b25a689f14610207578063ee6e45ae14610227578063f8c8765e1461023a576100f5565b806370480275146101b357806371fde3b2146101c65780637c988a23146101d957806384684d43146101ec576100f5565b806324d7806c116100d357806324d7806c1461014b57806345d4af201461016b5780634f801e2a1461018057806357fbb9df146101a0576100f5565b8063150b7a02146100fa5780631785f53c146101235780631c02c1a914610138575b600080fd5b61010d610108366004610de3565b61024d565b60405161011a9190611194565b60405180910390f35b610136610131366004610d49565b61025d565b005b610136610146366004610f09565b6102ef565b61015e610159366004610d49565b61040a565b60405161011a9190611189565b61017361041f565b60405161011a9190611338565b61019361018e366004611005565b6104a5565b60405161011a919061115c565b6101366101ae366004610d49565b61052c565b6101366101c1366004610d49565b610623565b6101366101d43660046110d4565b610674565b6101366101e7366004611035565b6106fc565b61015e6101fa366004610e4d565b6107b5565b610193610939565b61021a610215366004611005565b610948565b60405161011a91906112cb565b610173610235366004611005565b6109cf565b610136610248366004610d88565b610a57565b630a85bd0160e11b949350505050565b6007546001600160a01b031633146102905760405162461bcd60e51b815260040161028790611281565b60405180910390fd5b6001600160a01b03811660009081526001602081905260409091205460ff161515146102ce5760405162461bcd60e51b8152600401610287906111ed565b6001600160a01b03166000908152600160205260409020805460ff19169055565b3360009081526001602081905260409091205460ff161515146103245760405162461bcd60e51b8152600401610287906111a9565b61032c610b72565b6040518060800160405280868152602001858152602001848152602001838152509050610357610b99565b5060408051608081018252600060608201908152815281516020818101845267d02ab486cedc00008252808301919091528251908101835268049b9ca9a6943400008152818301526003549151632cca323760e01b815290916001600160a01b031690632cca3237906103d090859085906004016112d9565b600060405180830381600087803b1580156103ea57600080fd5b505af11580156103fe573d6000803e3d6000fd5b50505050505050505050565b60016020526000908152604090205460ff1681565b6006546040516370a0823160e01b81526000916001600160a01b0316906370a082319061045090309060040161115c565b60206040518083038186803b15801561046857600080fd5b505afa15801561047c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a0919061101d565b905090565b6005546040516331a9108f60e11b81526000916001600160a01b031690636352211e906104d6908590600401611338565b60206040518083038186803b1580156104ee57600080fd5b505afa158015610502573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105269190610d6c565b92915050565b6007546001600160a01b031633146105565760405162461bcd60e51b815260040161028790611281565b600061056061041f565b60065460405163a9059cbb60e01b81529192506001600160a01b03169063a9059cbb906105939085908590600401611170565b602060405180830381600087803b1580156105ad57600080fd5b505af11580156105c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e59190610ee9565b507f9ca86e26e8d02952f920895df7583aa717e8ebc63cd0708c0879da89b9a074458282604051610617929190611170565b60405180910390a15050565b6007546001600160a01b0316331461064d5760405162461bcd60e51b815260040161028790611281565b6001600160a01b03166000908152600160208190526040909120805460ff19169091179055565b61067c610bcb565b506040805180820182528381526002546001600160a01b039081166020830152600354925163062f24b760e41b8152919216906362f24b70906106c59085908590600401611341565b600060405180830381600087803b1580156106df57600080fd5b505af11580156106f3573d6000803e3d6000fd5b50505050505050565b60005b81518110156107b057610710610bcb565b50604080518082019091528381526002546001600160a01b03908116602083015260035484519116906362f24b709085908590811061074b57fe5b6020026020010151836040518363ffffffff1660e01b8152600401610771929190611341565b600060405180830381600087803b15801561078b57600080fd5b505af115801561079f573d6000803e3d6000fd5b5050600190930192506106ff915050565b505050565b33600090815260016020819052604082205460ff161515146107e95760405162461bcd60e51b8152600401610287906111a9565b60005b855181101561092d576107fd610b72565b604051806080016040528088848151811061081457fe5b6020026020010151815260200187848151811061082d57fe5b6020026020010151815260200186848151811061084657fe5b6020026020010151815260200185848151811061085f57fe5b60200260200101518152509050610874610b99565b5060408051608081018252600060608201908152815281516020818101845267d02ab486cedc00008252808301919091528251908101835268049b9ca9a6943400008152818301526003549151632cca323760e01b815290916001600160a01b031690632cca3237906108ed90859085906004016112d9565b600060405180830381600087803b15801561090757600080fd5b505af115801561091b573d6000803e3d6000fd5b5050600190940193506107ec92505050565b50600195945050505050565b6007546001600160a01b031690565b610950610b99565b60048054604051637ce702c160e11b81526001600160a01b039091169163f9ce05829161097f91869101611338565b60606040518083038186803b15801561099757600080fd5b505afa1580156109ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105269190610fb3565b60048054604051632bc0327b60e11b81526000926001600160a01b039092169163578064f691610a0191869101611338565b604080518083038186803b158015610a1857600080fd5b505afa158015610a2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a509190610f7a565b5192915050565b600054610100900460ff1680610a705750610a70610b5b565b80610a7e575060005460ff16155b610a9a5760405162461bcd60e51b815260040161028790611233565b600054610100900460ff16158015610ac5576000805460ff1961ff0019909116610100171660011790555b600380546001600160a01b03199081166001600160a01b03878116918217909355600480548316878516179055600580548316909117905560028054821685841690811790915560068054831690911790556007805490911691871691821790556000908152600160208190526040909120805460ff191690911790558015610b54576000805461ff00191690555b5050505050565b6000610b6630610b6c565b15905090565b3b151590565b60408051608081018252606080825260208201819052600092820183905281019190915290565b6040518060600160405280610bac610be2565b8152602001610bb9610be2565b8152602001610bc6610be2565b905290565b604080518082019091526000808252602082015290565b6040518060200160405280600081525090565b600082601f830112610c05578081fd5b8135610c18610c138261138c565b611365565b818152915060208083019084810181840286018201871015610c3957600080fd5b60005b84811015610c5857813584529282019290820190600101610c3c565b505050505092915050565b600082601f830112610c73578081fd5b8135610c81610c138261138c565b818152915060208083019084810160005b84811015610c5857610ca9888484358a0101610cbb565b84529282019290820190600101610c92565b600082601f830112610ccb578081fd5b813567ffffffffffffffff811115610ce1578182fd5b610cf4601f8201601f1916602001611365565b9150808252836020828501011115610d0b57600080fd5b8060208401602084013760009082016020015292915050565b600060208284031215610d35578081fd5b610d3f6020611365565b9151825250919050565b600060208284031215610d5a578081fd5b8135610d65816113ac565b9392505050565b600060208284031215610d7d578081fd5b8151610d65816113ac565b60008060008060808587031215610d9d578283fd5b8435610da8816113ac565b93506020850135610db8816113ac565b92506040850135610dc8816113ac565b91506060850135610dd8816113ac565b939692955090935050565b60008060008060808587031215610df8578384fd5b8435610e03816113ac565b93506020850135610e13816113ac565b925060408501359150606085013567ffffffffffffffff811115610e35578182fd5b610e4187828801610cbb565b91505092959194509250565b60008060008060808587031215610e62578384fd5b843567ffffffffffffffff80821115610e79578586fd5b610e8588838901610c63565b95506020870135915080821115610e9a578485fd5b610ea688838901610c63565b94506040870135915080821115610ebb578384fd5b610ec788838901610bf5565b93506060870135915080821115610edc578283fd5b50610e4187828801610bf5565b600060208284031215610efa578081fd5b81518015158114610d65578182fd5b60008060008060808587031215610f1e578182fd5b843567ffffffffffffffff80821115610f35578384fd5b610f4188838901610cbb565b95506020870135915080821115610f56578384fd5b50610f6387828801610cbb565b949794965050505060408301359260600135919050565b600060408284031215610f8b578081fd5b610f956040611365565b825181526020830151610fa7816113ac565b60208201529392505050565b600060608284031215610fc4578081fd5b610fce6060611365565b610fd88484610d24565b8152610fe78460208501610d24565b6020820152610ff98460408501610d24565b60408201529392505050565b600060208284031215611016578081fd5b5035919050565b60006020828403121561102e578081fd5b5051919050565b60008060408385031215611047578182fd5b8235915060208084013567ffffffffffffffff811115611065578283fd5b80850186601f820112611076578384fd5b80359150611086610c138361138c565b82815283810190828501858502840186018a10156110a2578687fd5b8693505b848410156110c45780358352600193909301929185019185016110a6565b5080955050505050509250929050565b600080604083850312156110e6578182fd5b50508035926020909101359150565b60008151808452815b8181101561111a576020818501810151868301820152016110fe565b8181111561112b5782602083870101525b50601f01601f19169290920160200192915050565b8051518252602080820151519083015260409081015151910152565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b6001600160e01b031991909116815260200190565b60208082526024908201527f6f6e6c7920616e2061646d696e2063616e2063616c6c20746869732066756e636040820152633a34b7b760e11b606082015260800190565b60208082526026908201527f7468697320616464726573732069732063757272656e746c79206e6f7420616e6040820152651030b236b4b760d11b606082015260800190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602a908201527f6f6e6c7920746865206d61696e2061646d696e2063616e2063616c6c207468696040820152693990333ab731ba34b7b760b11b606082015260800190565b606081016105268284611140565b60006080825283516080808401526112f56101008401826110f5565b6020860151848203607f190160a0860152915061131281836110f5565b604087015160c0860152606087015160e08601529250610d659150506020830184611140565b90815260200190565b918252805160208084019190915201516001600160a01b0316604082015260600190565b60405181810167ffffffffffffffff8111828210171561138457600080fd5b604052919050565b600067ffffffffffffffff8211156113a2578081fd5b5060209081020190565b6001600160a01b03811681146113c157600080fd5b5056fea2646970667358221220b65dd7415e5eaa8d46ae37bf2afdc329bb8b7d23cefa587057961b23c1470fc364736f6c63430006080033

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  ]

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.