Skip to content

DrTranzoc/shinoid-contract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shinoid Satellite NFT Contract

This repository contains the Shinoid Satellite NFT Contract, a CosmWasm smart contract designed for atomic locking and unlocking of NFTs across IBC-enabled blockchains. It is intended for use as a "satellite" contract, enabling secure NFT transfers and game mechanics for the HonOrais ecosystem.

Features

  • IBC NFT Lock/Unlock: Securely lock and unlock NFTs across chains, with robust state restoration on timeouts or failed acknowledgments.
  • Game Mechanics: Supports "Inu Hunt" and other game flows, including board generation, traps, chests, and rewards.
  • User Data Queries: Retrieve user-specific data such as locked tokens, redeemable items, chests, keys, and active hunts.
  • Admin Controls: Update contract state, metadata, and treasury via admin-only functions.
  • Treasury Management: Deposit and withdraw native and CW20 tokens, as well as NFTs, for use as rewards.
  • Battleground Integration: Seamless integration with a main Battleground contract for updating user data and executing game operations.

Directory Structure

contracts/shinoid-contract/ ├── src/ │ ├── contract.rs # Main contract logic │ ├── datatypes.rs # Core data structures and enums │ ├── error.rs # Custom error types │ ├── helpers.rs # Utility functions │ ├── ibc.rs # IBC channel and packet handling │ ├── lib.rs # Module exports │ ├── msg.rs # Instantiate, execute, and query messages │ ├── queries.rs # Query handlers │ ├── state.rs # Persistent storage definitions │ └── tests.rs # Unit tests ├── Cargo.toml └── README.md

Compile

sudo docker run --rm -v "$(pwd)":/code
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry
cosmwasm/optimizer:0.16.0

Usage

  • Instantiate the contract with your configuration (see InstantiateMsg in msg.rs).
  • Lock/Unlock NFTs by sending CW721 messages or via IBC.
  • Interact with game mechanics using the provided execute messages.
  • Query user and contract state using the query messages.

Security

  • Only the admin can update contract state, treasury, or metadata.
  • All critical operations have permission checks and input validation.
  • IBC logic ensures correct address conversion and state restoration on failures.

License

Apache 2.0

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages