• Stars
    star
    152
  • Rank 244,685 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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 v2 (here) to get the latest production version that has passed through a series of security audits.

About

You can find general overview and docs on 1inch limit orders protocol here.

This repository contains a smart contract for EVM based blockchains (Ethereum, Binance Smart Chain, etc.), this contract is core part of 1inch limit order protocol.

Contract allows users to place limit orders, that later could be filled on-chain. Limit order itself is a data structure created off-chain and signed according to EIP-712.

Key features of the protocol is extreme flexibility and high gas efficiency that achieved by using following order types.

Limit Order

Extremely flexible limit order, can be configured with:

  1. Order execution predicate.
    • Typical usage is checking that certain time stamp or block number. With this you can set certain expiration time.
    • You can specify construct any predicate that you want, for example check that certain price is higher than oracle price, to implement stop loss or take profit strategies
  2. Helper function for asset price evaluation.
    • Function that will allow to extract assets price from arbitrary on-chain source
  3. Callback, for to notify maker on order execution.

RFQ order

Gas optimized order with restricted capabilities suitable for market makers

  • Support expiration time
  • Support cancellation by order id
  • RFQ Order could be filled only once
  • Partial Fill is possible (once)

Supported tokens

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

Deployments & audits:

You can find 1inch limit order protocol deployments here:

Ethereum mainnet: 0x119c71D3BbAC22029622cbaEc24854d3D32D2828

BSC mainnet: 0x1e38Eff998DF9d3669E32f4ff400031385Bf6362

Polygon mainnet: 0x94Bc2a1C732BcAd7343B25af48385Fe76E08734f

Optimism Mainnet: 0x11431a89893025D2a48dCA4EddC396f8C8117187

Arbitrun One: 0x7F069df72b7A39bCE9806e3AfaF579E54D8CF2b9

Gnosis Chain: 0x54431918cEC22932fCF97E54769F4E00f646690F

Avalanche: 0x0F85A912448279111694F4Ba4F85dC641c54b594

Kovan Testnet: 0xa218543cc21ee9388Fa1E509F950FD127Ca82155

Fantom Opera: 0x11DEE30E710B8d4a8630392781Cc3c0046365d4c

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

Utils library

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

More Repositories

1

shieldy

@shieldy_bot Telegram bot repository
TypeScript
793
star
2

1inchProtocol

1inch Protocol – fully on-chain DeFi aggregation protocol
Solidity
565
star
3

spot-price-aggregator

Liquidity-weighted dex price oracle for offchain price discovery
JavaScript
163
star
4

solidity-utils

TypeScript
121
star
5

1inch-token

Solidity
114
star
6

mooniswap

Mooniswap
JavaScript
108
star
7

chi

Chi Gastoken by 1inch
Solidity
98
star
8

farming

JavaScript
97
star
9

multicall

TypeScript
82
star
10

liquidity-protocol

JavaScript
81
star
11

1inch-v2-contracts

Solidity
63
star
12

merkle-distribution

JavaScript
53
star
13

token-plugins

JavaScript
48
star
14

1IPs

48
star
15

limit-order-protocol-utils

TypeScript
43
star
16

1inch-docs

CSS
41
star
17

1inch-audits

38
star
18

limit-order-settlement

JavaScript
36
star
19

gDAI.io

gDAI - Gas less DAI transfers by using GSN, Fulcrum and KyberNetwork
TypeScript
32
star
20

gnosis.1inch.exchange

Gnosis 1inch dApp
TypeScript
31
star
21

permit-signed-approvals-utils

TypeScript
25
star
22

fusion-sdk

TypeScript
25
star
23

dexcandles

DEX trades candles (5m/15m/1h/4h/1d/1w)
TypeScript
21
star
24

evm-helpers

Solidity
17
star
25

solidity-dispatcher-miner

Rust
16
star
26

QRToken

Token Drop in Real World
TypeScript
10
star
27

1lend.io

Cryptocurrency lending aggregator
TypeScript
9
star
28

BEARROWING

Borrowing aggregator
Solidity
9
star
29

solidity-audit-checklist

9
star
30

approved.zone

Ethereum smart contracts approvals dashboard
TypeScript
9
star
31

fixed-rate-swap

JavaScript
8
star
32

1x.ag

Leverage aggregator
TypeScript
8
star
33

fusion-resolver-example

TypeScript
8
star
34

1inch-sdk-go

SDK of 1inch APIs for golang
Go
8
star
35

embedded-widget

TypeScript
7
star
36

ERC3652

Solidity
7
star
37

governance-contracts

JavaScript
7
star
38

limit-order-sdk-py

1inch Limit Order Protocol v4 SDK Python
Python
7
star
39

st1inch

Solidity
7
star
40

fusion-101

1inch Fusion 101: Basic how-to examples for public workshops
TypeScript
6
star
41

delegating

JavaScript
6
star
42

evm-trace

JavaScript
6
star
43

MultiKyber

Kyber smart contract wrapper for cTokens, iTokens and sTokens native support
Solidity
6
star
44

calldata-compressor

JavaScript
5
star
45

penetration-tools

Tools repository for penetration tools
5
star
46

1hop

CDP migration aggregator
TypeScript
5
star
47

1inch-uni-addresses

5
star
48

address-token-miner

Rust
5
star
49

address-token

JavaScript
4
star
50

nuTube.network

Incentivized, decentralized livestream p2p network
TypeScript
4
star
51

desktop-dapp

Desktop version of app.1inch.io
TypeScript
4
star
52

candles-subgraph

TypeScript
4
star
53

LimitSwapSubgraph

TypeScript
3
star
54

solidity-selector-miner

Rust
2
star
55

1inch-airdrop

Python
2
star
56

fee-collector

JavaScript
2
star
57

jobocar

Self Sharing Car - Jobocar
TypeScript
2
star
58

VIC.cards

Β«Very Important Contact CardsΒ» to prioritise you communications
TypeScript
2
star
59

BalancerRegistry

0x65e67cbc342712df67494acefc06fe951ee93982
Solidity
2
star
60

limit-order-parser

TypeScript
2
star
61

Donatocracy

JavaScript
1
star
62

dev-portal-101

101 for developer portal
TypeScript
1
star
63

paymaster-zksync

JavaScript
1
star
64

1inch-liquidity-protocol-audits

1
star
65

Arweavify

Chrome plugin for Arweave relayers verification
JavaScript
1
star
66

cross-chain-sdk

TypeScript
1
star
67

vested-token

Solidity
1
star
68

cross-chain-swap

Solidity
1
star
69

dev-portal-apis-examples

We are giving you a hands-on experience of how the Web3 APIs can be used to create engaging and dynamic decentralized applications.
1
star