Owl Protocol Smart Contract Documentation

website·Indexed 29 days ago

https://owlprotocol.github.io/contracts/docs

Technical documentation for Owl Protocol smart contracts, including VRFCoordinatorV2, VRFBeacon, and various Minter implementations (MinterSimple, MinterRandom, MinterAutoId). The suite covers NFT utilities such as Transformer, Lootbox, and EnglishAuction, as well as paymaster contracts (NFTOwnershipPaymaster, NaivePaymaster) and DNA libraries like RosalindDNA.

Tokens
25.5K
Snippets
218
Records
260
Agent score
75%

What's inside Owl Protocol

  1. Overview of ERC721Owl Contract

    ERC721Owl is a standard OwlProtocol ERC721 contract extending OpenZeppelin's ERC721BurnableUpgradeable. It is designed for compatibility with EIP1167 minimal-proxy deployment strategies, meaning initialization is handled via initializer functions rather than a standard constructor.
  2. Overview of OWL Protocol Smart Contracts

    OWL Protocol provides a suite of plug-and-play smart contracts and libraries designed for game developers and content creators. The platform simplifies the deployment of complex blockchain functionality, such as item crafting and breeding systems.
  3. Overview of MinterCore contract

    MinterCore is a decentralized NFT Minter contract designed to handle the minting of NFTs in exchange for a specified fee token. It maintains configuration for the fee token address, the recipient of the fees, the fee amount, and the target NFT contract address.
  4. Overview of NFTOwnershipPaymaster

    The NFTOwnershipPaymaster is a GSN (Gas Station Network) paymaster that approves transactions for clients who own an approved ERC721 token within a specific collection. It tracks the usage of each tokenId via a mapping and enforces a maximum limit on how many times a specific token can be used to approve a gasless transaction.
  5. Overview of CrafterMint crafting logic

    CrafterMint is a contract module that allows users to redeem a set of inputs (ingredients) for a set of outputs. The number of times a specific configuration can be crafted is limited by the craftableAmount.

    Configuration is set during initialization and is immutable; changing the ingredients requires deploying a new contract. However, the craftableAmount can be dynamically updated by an administrator using deposit and withdraw functions.

  6. Overview of MinterBreeding contract

    The MinterBreeding contract is a decentralized NFT Minter designed to handle the creation of new NFTs through a breeding process. It manages breeding rules, including the number of required parents, cooldown periods, and genetic attributes (genes and mutation rates).
  7. Overview of CrafterTransfer crafting logic

    CrafterTransfer is a contract module that enables the crafting of assets (ERC20, ERC721, ERC1155). Users can redeem a defined set of inputs for a defined set of outputs. The number of times a configuration can be crafted is limited by the craftableAmount.

    Configuration is set during initialization and is immutable; any changes to the input/output requirements require a new contract deployment. However, the craftableAmount can be dynamically adjusted by the administrator via deposit and withdraw functions.

  8. Overview of the DutchAuction contract

    The DutchAuction contract facilitates a simple on-chain Dutch Auction. The seller defines a starting ceiling price and an ending floor price; the price decreases over a specified period based on either a linear or nonlinear function.

    Key behavior:

    • The current price is calculated dynamically based on the time elapsed since the auction started.
    • To win the auction, a bidder must provide a bid that matches the current price.
    • Once a valid bid is made, the auction ends immediately.
    • The seller receives the bid amount in ERC20 tokens, and the asset is transferred to the bidder.
  9. Overview of the Rent contract mechanism

    The Rent contract enables NFT owners to lock their assets for a fixed epoch period. Upon locking, the contract mints an identical 'shadow' NFT on a separate smart contract. This shadow NFT can be sold or transferred during the rental period. Once the epoch expires, the shadow NFT is destroyed and the original NFT is returned to the owner. The contract tracks multiple concurrent rentals using a unique rentId.
  10. Overview of VRFBeacon contract

    The VRFBeacon contract acts as a central beacon for fetching random numbers from Chainlink VRF. To optimize efficiency, multiple requests occurring within a defined EPOCH_PERIOD (a specific block range) are coupled into a single request to the VRFCoordinatorV2. Consumers of this contract typically use the resulting random number as a seed to generate further random numbers for their specific use cases.