# SIP-2: Implement a Samurai native OTC NFT solution

## Motivation

Currently, the only secondary NFT market that is compatible with Samurai Node NFTs is tofuNFT, where Samurai Node NFTs and all of its tiers (Buke, Musha, and Mononofu) can be acquired and exchanged. While utilizing tofuNFT was a wise decision at the specific point in time, there are a few problems that need to be fixed.

1. The inability to acquire or trade Samurai Node NFTs in large amounts is a major drawback and a demotivating issue for many of Samurai's active users who wish to be able to acquire, get rid of, or swap Samurai Node NFTs fast, effectively, and at scale.
2. Instead of using xHNR, the protocol's native governance token, the TofuNFT market and its collections use FTM (Fantom). The utility of the xHNR token would be increased by following this proposal as the Samurai Node NFTs would be acquired and disposed using the protocol's native xHNR governance token.
3. Because TofuNFT is an outside service provider, Samurai becomes more dependent on that party's technological capabilities, reputational standing, and terms of service. Samurai's goal is to be decentralized and function autonomously and independenťy, hence the project should support alternatives that promote no dependency on central middlemen and intermediaries.
4. Samurai Node NFTs are subject to a 3% royalty collection on TofuNFT. Samurai might have more control over its royalties by using its own, independently owned service.
5. Users are unable to conveniently and readily manage and control their Samurai Node NFTs within the primary point of engagement with the protocol (the Samurai dApp) because of the existing solution's inadequate integration capability.

Specification

Maintain and keep the Samurai Node NFT collection on tofuNFT while enhancing it with a second, independent, autonomous OTC NFT substitute that makes use of the xHNR governance token. All of the aforementioned pain issues would be addressed and resolved by the OTC NFT marketplace alternative, which would rely on a set of smart contracts that are described in more detail below.

With the help of the suggested smart contracts, OTC NFT events might happen inside of Samurai's dApp at a pre-set moment when the contract would be buying Samurai Node NFTs from its users at a set xHNR price. By selecting many Node NFTs at once, the solution would allow users to sell and dispose of their Node NFTs at scale within the dApp interface in exchange for xHNR tokens. The protocol would purchase Node NFTs using its treasury, and the treasury would then hold the purchased NFTs. To purchase Node NFTs and promote the suggested OTC NFT alternative, 3 000 000 xHNR tokens should be issued to the Treasury for the acquisition purposes.

The protocol should then sell the acquired Node NFTs that are held by the treasury to new or existing users within Samurai's dApp at a predetermined, scheduled time, at a fixed xHNR price, using the smart contracts. By choosing several NFTs at once, users would be able to quickly acquire Samurai's Node NFTs in exchange for xHNR tokens at scale. This could also potentially lead to a lower acquisition price by removing the need to pay fees associated with using the tofuNFT platform and would substantially increase the utility of the xHNR governance token.

The pricing of the Node NFTs within the OTC NFT solution should be set in xHNR token terms and according to the floor price of the NFTs on TofuNFT -\~ 15% to incentivise and encourage the use of Samurai’s OTC NFT alternative.

The tokens would be kept by the treasury if there is a positive price difference between the purchase price and the selling price of Node NFTs, which might be viewed as an xHNR-native alternative to a royalty collection.

Setting precise acquisition and selling goals, while taking into account the state of the treasury, current activity (volatility and volume) in the tofuNFT market, can all be used to predict the length of OTC NFT events and the numbers of Node NFTs attained.

I have developed the following smart contracts which take into account and are in line with the practices and technological stack observed in the protocol’s verified and publicly accessible smart contracts, codebase and governance proposals.

The proposed smart contract/Solidity code:

_pragma solidity 0.8.10;_

_contract SamuraiOTC {_\
_uint256 public buyPrice;_\
_uint256 public sellPrice;_

_IERC721 public hnrNodes;_\
_IERC20 public xHnr;_

_constructor(_\
_uint256 \_buyPrice,_\
_uint256 \_sellPrice,_\
_address \_hnrNodes,_\
_address \_xHnr_\
_) {_\
_buyPrice = \_buyPrice;_\
_sellPrice = \_sellPrice;_\
_hnrNodes = IERC721(\_hnrNodes);_\
_xHnr = IERC20(\_xHnr);_\
_}_

_function sell(uint256\[] memory \_tokenIds) public {_\
_address nodeSeller = msg.sender;_\
_uint256 amount = uint256(\_tokenIds.length) \* sellPrice;_\
_batchTransfer(\_tokenIds, true);_\
_xHnr.transfer(nodeSeller, amount);_\
_}_

_function buy(uint256\[] memory \_tokenIds) public {_\
_address nodeBuyer = msg.sender;_\
_uint256 amount = uint256(\_tokenIds.length) \* buyPrice;_\
_xHnr.transferFrom(nodeBuyer, address(this), amount);_\
_batchTransfer(\_tokenIds, false);_\
_}_

_function batchTransfer(uint256\[] memory \_tokenIds, bool isSell) public {_\
_uint256 length = \_tokenIds.length;_\
_address sender = msg.sender;_\
_address contractAddress = address(this);_

```
isSell
  ? hnrNodes.transferFrom(sender, contractAddress, _tokenIds)
  : hnrNodes.transferFrom(contractAddress, sender, _tokenIds);
```

_}_\
_}_
