morgangiraud / 0xmons-contracts-new

Smart contracts for 0xmons.xyz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

0xmons Smart Contracts

NOW:

This repository is used as a monorepo for all smart contracts developed by me (0xmons). It previously only housed contracts used for the initial 0xmons NFT ecosystem, which is detailed below.

PREVIOUSLY:

Architecture

The main contract is MonMinter.sol, which is the actual ERC-721 implementation. Using AccessControl, we can assign different contracts to be monster minters.

IMonMinter.sol is the minter interface, which is exposed to contracts with minting privileges, allowing them to mint and modify the on-chain data of monsters.

The default Mon struct is in UsesMon.sol. Contracts which want to access on-chain information about a monster inherit from this contract to use the struct.

MonCreatorInstance is a parent class that abstracts out some similarities among contracts which want to mint monsters.

MonStaker.sol is the main staking contract. Users can add and remove their staked XMON to generate Doom, which is then used to redeem monsters.

MonSpawner.sol is the spawning contract, which takes in two monsters and spawns a new monster.

The underlying token is XMON.sol, a token with a fee on transfer, settable from 1 to 10%.

Tests

There is a comprehensive set of tests in test/tests.js. Test coverage is close to 100%, and the comments explain the cases being tested for. See coverage/.

About

Smart contracts for 0xmons.xyz


Languages

Language:HTML 38.7%Language:Solidity 30.3%Language:JavaScript 28.9%Language:CSS 2.0%