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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@1inch/limit-order-protocol-contract

v4.2.1

Published

1inch Limit Order Protocol

Downloads

224

Readme

1inch Limit Order Protocol Smart Contract

Build Status Coverage Status

Version warning

The master branch contains the latest work-in-progress version of limit orders. It hasn't been audited and may contain severe security issues or may not work at all.

Please, use the commit tagged version to get the latest production version that has passed through a series of security audits:

About

You can find the latest general overview and documentation on the 1inch limit orders protocol in the description.md. Documentation for this and previous versions can be found on the 1inch documentation portal.

The repository contains smart contracts for EVM-based blockchains (such as Ethereum, Binance Smart Chain, etc.). These contracts are a core part of the 1inch limit order protocol, allowing users to create limit orders off-chain that can be filled on-chain. A limit order is a data structure signed according to EIP-712.

Limit Order

The key features of the protocol are extreme flexibility and high gas efficiency, which are achieved with the following features

Basic features

  • Select an asset receiver for an order.
  • Choose whether to allow or disallow partial and multiple fills.
  • Define conditions that must be met before execution can proceed (e.g. stop-loss, take-profit orders).
  • Specify interactions (arbitrary maker's code) to execute before and after order filling.
  • Choose an approval scheme for token spend (approve, permit, permit2).
  • Request that WETH be unwrapped to ETH either before (to sell ETH) or after the swap (to receive ETH).
  • Make an order private by specifying the only allowed taker's address.
  • Set the order's expiration date.
  • Assign a nonce or epoch to the order for easy cancellation later.

Advanced features

  • Define a proxy to handle transfers of assets that are not compliant with IERC20, allowing the swapping of non-ERC20 tokens, such as ERC721 or ERC1155.
  • Define functions to calculate, on-chain, the exchange rate for maker and taker assets. These functions can be used to implement dutch auctions (where the rate decreases over time) or range orders (where the rate depends on the volume already filled), among others.

RFQ orders

Separate RFQ order are deprecated in v4. To create the most gas efficient order use a basic order without extensions.

Supported tokens

  • ERC 20
  • ERC 721
  • ERC 1155
  • Other token standards could be supported via external extension

Deployments & audits (Limit Orders Protocol v4):

You can find 1inch Router v6 and 1inch Limit Order protocol v4 deployments here:

Ethereum mainnet: 0x111111125421ca6dc452d289314280a0f8842a65

BSC mainnet: 0x111111125421ca6dc452d289314280a0f8842a65

Polygon mainnet: 0x111111125421ca6dc452d289314280a0f8842a65

Optimism Mainnet: 0x111111125421ca6dc452d289314280a0f8842a65

Arbitrum One: 0x111111125421ca6dc452d289314280a0f8842a65

Gnosis Chain: 0x111111125421ca6dc452d289314280a0f8842a65

Avalanche: 0x111111125421ca6dc452d289314280a0f8842a65

Fantom: 0x111111125421ca6dc452d289314280a0f8842a65

Aurora: 0x111111125421ca6dc452d289314280a0f8842a65

Kaia: 0x111111125421ca6dc452d289314280a0f8842a65

Base: 0x111111125421ca6dc452d289314280a0f8842a65

zkSync Era: 0x6fd4383cb451173d5f9304f041c7bcbf27d561ff

You can find audit reports on etherscan and in the separate audit repository.

Utils library (Limit Orders Protocol v4)

Plenty of utils that helps create & sign orders are available in our typescript utils library: