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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nifty-island/market-maker

v1.0.8

Published

The Nifty Island Market Maker is a razor thin protocol allowing people to trustlessly list, bid, and trade NFTs in any ERC20 currency. It provides two market implementations, `NonFungibleTokenMarket` for trading ERC721 tokens and `MultiTokenMarket` for

Readme

Island Market Maker Contracts

The Nifty Island Market Maker is a razor thin protocol allowing people to trustlessly list, bid, and trade NFTs in any ERC20 currency.
It provides two market implementations, NonFungibleTokenMarket for trading ERC721 tokens and MultiTokenMarket for trading ERC1155 tokens. Both implementations support the same event structure and implement a similar interface, with minor deviations where appropriate.


Table of Contents

Addresses

Rinkeby

NonFungibleTokenMarket: 0x8eDd2583e446E5b73d5dB0C902fA908585B52128

MultiTokenMarket: 0x46138F55D06944AD2d7b0F7384779F6a37C2dc0c

Mainnet

NonFungibleTokenMarket: 0x...

MultiTokenMarket: 0x...

Architecture

Create Market

returns (uint256 marketId) Before calling, the token owner must approve the TokenMarket to handle the NFT(s). This way, the token owner retains ownership of the token, only transferring ownership when a bid is accepted. For the MultiTokenMarket, the owner must specify what quantity he wants to put on the market.

NonFungibleTokenMarket

| Name | Type | Description | |------------------------|----------------|------------------------------------------------------------------------------------------------| | tokenContract | address | The token contract to use in the market | | tokenId | uint256 | The tokenID to use in the market | | stakeholders | Stakeholder[]| List of stakeholders: { address stakeholder, uint8 stake percentage } |

MultiTokenMarket

| Name | Type | Description | |------------------------|----------------|------------------------------------------------------------------------------------------------| | tokenContract | address | The token contract to use in the market | | tokenId | uint256 | The tokenID to use in the amount | | tokenCount | uint256 | The number of tokens to put up on the market | | stakeholders | Stakeholder[]| List of stakeholders: { address stakeholder, uint8 stake percentage } |

Remove Market

Can only be called by the market creator (owner of the NFT) | Name | Type | Description | |------------------------|----------------|------------------------------------------------------------------------------------------------| | marketId | uint256 | The market ID |

Set Ask

Each market only has one ask at a time. An ask can be thought of as a buy-now price for a single token. Any bid which exceeds the ask will automatically complete the transfer, without the normal "accept bid" step on the part of the market creator. | Name | Type | Description | |------------------------|----------------|------------------------------------------------------------------------------------------------| | marketId | uint256 | The market ID | | curency | address | The address of the ERC20 currency to set the ask in | | amount | uint256 | The ask amount |

Remove Ask

Removes the current ask for the specified market. Must be called by the creator of the market. | Name | Type | Description | |------------------------|----------------|------------------------------------------------------------------------------------------------| | marketId | uint256 | The market ID |

Create Bid

Prior to calling, the caller must approve() the TokenMarket to spend their currency. If the bid matches the given ask, the market trades the NFT and tokens to their respective parties, and removes the market. The MultiTokenMarket works the same way, except it decrements the transferred tokenCount from the market. If the market drops to a tokenCount of 0, the market is removed.

NonFungibleTokenMarket Bid

| Name | Type | Description | |------------------------|----------------|------------------------------------------------------------------------------------------------| | marketId | uint256 | The market ID | | amount | uint256 | The bid amount | | currency | uint256 | The bid currency |

MultiTokenMarket Bid

| Name | Type | Description | |------------------------|----------------|------------------------------------------------------------------------------------------------| | marketId | uint256 | The market ID | | amount | uint256 | The bid amount | | currency | uint256 | The bid currency | | tokenCount | uint256 | The number of tokens this bid is for |

Remove Bid

Removes the specified bid, if it exists. Only users that have created bids can erase them. | Name | Type | Description | |------------------------|----------------|------------------------------------------------------------------------------------------------| | marketId | uint256 | The market ID | | bidIndex | uint256 | The index of the bid in the Bids array |

Accept Bid

If the token owner likes a specified bid, then they can accept the bid, and the assets will be traded. Reverts if approve()al has been revoked by either party since creation. | Name | Type | Description | |------------------------|----------------|------------------------------------------------------------------------------------------------| | marketId | uint256 | The market ID | | bidIndex | uint256 | The index of the bid in the Bids array |

Events

Events are used by both Market types, though the tokenCount field for events created by the NonFungibleTokenMarket is always 1.

event MarketCreated(uint256 indexed marketId, address indexed tokenContract, uint256 indexed tokenId, uint256 tokenCount, address owner);
event TransferFinalized(uint256 indexed marketId, address indexed tokenContract, uint256 indexed tokenId, uint256 tokenCount, address currency, uint256 amount, address buyer);
event MarketRemoved(uint256 indexed marketId, address indexed tokenContract, uint256 indexed tokenId, uint256 tokenCount, address owner);
event BidCreated(uint256 indexed marketId, address tokenContract, uint256 tokenId, uint256 bidIndex, uint256 tokenCount, address indexed currency, uint256 indexed amount, address bidder);
event BidRemoved(uint256 indexed marketId, address tokenContract, uint256 tokenId, uint256 bidIndex, uint256 tokenCount, address indexed currency, uint256 indexed amount, address bidder);
event AskCreated(uint256 indexed marketId, address tokenContract, uint256 tokenId, address indexed currency, uint256 indexed amount);
event AskRemoved(uint256 indexed marketId, address tokenContract, uint256 tokenId, address indexed currency, uint256 indexed amount);
event MarketStakeholderAdded(uint256 indexed marketId, address tokenContract, uint256 tokenId, address indexed stakeholder, uint8 indexed stakePercentage);
event MarketFeeSet(address indexed marketContract, address indexed currencyAddress, uint8 indexed feePercentage);

Local Development

The following assumes node >= 12

Install Dependencies

npm install

Compile Contracts

npx hardhat compile

Run Tests

npm run test

Acknowledgements