Page cover image

Venera

Contract Overview

The Venera smart contract serves as the primary orchestrator, coordinating the functionalities of VeneraSale and VeneraAuction. This contract unifies the core features required for trading music in NFT format on the blockchain.


Technical Specifications

Functions and Responsibilities

  1. Contract Coordination: Venera integrates the functionalities of VeneraSale and VeneraAuction, enabling seamless trade interactions for NFT.

  2. Ownership Management: Inherits from OpenZeppelin's Ownable contract, allowing exclusive access for the contract owner to essential functionalities.

  3. Ether Balance Operations:

    • getBalance(): Retrieves the current Ether balance of the contract.

    • withdraw(): Enables the contract owner to withdraw the entire Ether balance.

  4. Fallback Function:

    • receive() external payable: Allows the contract to receive Ether.

https://github.com/venvnft/venv-sc/blob/main/contracts/Venera.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.22;

import "@openzeppelin/contracts/access/Ownable.sol";
import "./VeneraSale.sol";
import "./VeneraAuction.sol";

/**
 * @title Venera
 * @custom:version 1.0.0
 * @author Kigrok (playa.arb)
 * @notice Smart contract serving as a marketplace for music in NFT format, 
 * facilitating sales and auctions for ERC721 and ERC1155 NFT.
*/

contract Venera is Ownable, VeneraSale, VeneraAuction {

    constructor(address initialOwner) Ownable(initialOwner) {}

    receive() external payable {}

    /**
     * @notice Retrieves the current Ether balance of the contract.
     * @return uint The Ether balance of the contract.
     * @dev This function returns the current balance of the contract in Ether.
     */
    function getBalance() external view returns(uint) {
        return address(this).balance;
    }

    /**
     * @notice Allows the contract owner to withdraw the entire Ether balance.
     * @dev This function enables the contract owner to withdraw the entire Ether balance held by the contract.
     *      It requires that the contract holds a positive balance and transfers the funds to the contract owner.
     *      Restricted to the contract owner only.
     */
    function withdraw() external onlyOwner {
        require(address(this).balance > 0, "No balance to withdraw");
        payable(owner()).transfer(address(this).balance);
    }
}

Integration with Other Contracts

  • VeneraSale: Handles direct sales of NFT at fixed prices.

  • VeneraAuction: Manages NFT auctions, facilitating bidding and auction finalization.


Key Dependencies


Technical Architecture

The contract employs Solidity version ^0.8.22 and is developed in compliance with Ethereum's ERC721 and ERC1155 standards. It integrates essential modifiers for data validation and relies on secure blockchain operations for transparent and reliable NFT trading.

Venera acts as the control center, managing the intricate operations of sales and auctions, ensuring a seamless and secure platform for trading music in the form of NFT.

Last updated