npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

octo-defi-nft

v1.0.1

Published

A NFT Collection created by DaoOcean-Labs

Downloads

166

Readme

CryptoOcto Solidity Smart Contract

A NFT Collection designed by DAOcean Labs

This Solidity smart contract, named CryptoOcto, facilitates the creation and breeding of unique digital octopus (Octo) tokens using ERC721 standards. These tokens can be bred together to generate new ones, reflecting generations and specific cooldown periods.

Overview

The CryptoOcto contract manages the minting, breeding, and properties of Octo tokens. Each Octo has a generation, cooldown period, and breeding cost associated with it.

Features

Roles

  • Minter Role: Responsible for minting new Octo tokens.

Constants

  • MAX_TOKEN_SUPPLY: Defines the maximum number of Octo tokens that can be minted (set at 1000).
  • BASE_COOLDOWN, COOLDOWN_MULTIPLIER, COOLDOWN_FACTOR: Parameters determining cooldown periods for breeding.
  • BASE_BREED_COST: Base cost for breeding two Octos.

Functions

  • Minting: Allows the safe creation of new Octo tokens, assigned to specific addresses.
  • Breeding: Combines two tokens to create a new one, inheriting characteristics and incurring a breeding cost.
  • Token Information Retrieval: Provides access to token details, such as generation, cooldown, and breeding cost.

Contract Structure

State Variables

  • MINTER_ROLE: Role identifier for the minter.
  • BASE_URI: Base URI for token metadata stored on IPFS.
  • MAX_TOKEN_SUPPLY: Maximum supply limit for Octo tokens.
  • Cooldown and breeding cost parameters.

Events

  • Breed: Triggered when two Octos breed to create a new token.
  • Cooldown: Signals a change in the cooldown period for a specific Octo token.

Functions

External / Public Functions

  • safeMint: Safely mints new Octo tokens.
  • breed: Breeds two Octos to create a new token.

Internal Functions

  • Functions handling token initialization, URI generation, cooldown setting, and validation checks.

Public View / Pure Functions

  • supportsInterface: Checks supported interfaces for the contract.
  • Functions for retrieving Octo information, token URIs, breeding costs, and receiver address.

Usage

  1. Minting: Only designated minters can create new Octo tokens.
  2. Breeding: Owners of two Octos can breed them together to generate a new token with combined traits.
  3. Token Information: Users can retrieve details about specific Octo tokens, including their generation, cooldown, and associated metadata.

Note

  • Ensure designated roles are assigned for minting.
  • Check token cooldowns before attempting breeding.
  • Validate sufficient funds for breeding costs.

Disclaimer

This README serves as documentation for the CryptoOcto smart contract. It's essential to review and understand the contract's functionality and potential implications before usage.

License

This smart contract is licensed under the MIT License (SPDX-License-Identifier: MIT).

Getting Started

  • Use Foundry:
forge install
forge test
  • Use Hardhat:
npm install
npx hardhat test

Features

  • Write / run tests with either Hardhat or Foundry:
forge test
# or
npx hardhat test
  • Use Hardhat's task framework
npx hardhat example
  • Install libraries with Foundry which work with Hardhat.
forge install rari-capital/solmate # Already in this repo, just an example

Notes