Guide: Integrate your smart contract with NeatFi

Introduction

NeatFi
NeatFi
2 min readDec 27, 2022

--

NeatFi is a smart contract protocol on the Ethereum network that allows other smart contracts to integrate with it and provide services of NeatFi to their consumers.

Smart contracts that implement any of the available NeatFi modules are called actors, interacting with the protocol through unique actor keys. While there is a minimum requirement for actors to implement at least one NeatFi module, there are no limitations on the functionality of actor smart contracts.

In fact, NeatFi encourages actors to experiment with different business models and tokenomics to bring innovative products to the DeFi space. The only cost to actors is a small protocol fee in Ether, which is charged on a per-usage basis.

Implementation (actor) contract

To integrate with NeatFi, you can either build your own smart contract with custom functionality or use the Neatswap template contract provided by the NeatFi team. The Neatswap contract includes all three available modules of NeatFi V1 — Asset Swap, Asset Sell, and Asset Auction — and implements access control using the OpenZeppelin library.

To integrate your application with NeatFi:

  1. Choose your contract option — build your own or simply copy the open-source Neatswap smart contract template.
  2. Choose the modules you want to include in your contract. If using the Neatswap template, you can simply remove the code for any modules you don’t want to use.
  3. Deploy your contract on the Ethereum network.
  4. As the contract owner, run the requestActorKey function to request an actor key for NeatFi.
  5. Submit an application on the NeatFi website, including your deployed contract address.
  6. The NeatFi team will review your request and either grant the actor key or reject the submission. Once approved, your smart contract will be integrated with NeatFi and ready to use its selected modules.

That’s it!

Note: NeatFi must be an approved operator for any 3-d party ERC token contracts that will participate in token assets swapping, selling, or auctioning. Make sure to call the appropriate approval functions for ERC-20, ERC-721 or ERC-1155 token contracts from your application’s frontend before using any NeatFi functions.

Resources

NeatFi website

NeatFi V1 smart contract

NeatFi Github

NeatFi documentation

Discord community

Twitter community

Reddit community

--

--