Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/1inch/mooniswap
Mooniswap
https://github.com/1inch/mooniswap
Last synced: about 2 months ago
JSON representation
Mooniswap
- Host: GitHub
- URL: https://github.com/1inch/mooniswap
- Owner: 1inch
- License: mit
- Created: 2020-07-23T10:19:54.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-21T19:11:57.000Z (about 4 years ago)
- Last Synced: 2024-05-20T21:43:22.316Z (8 months ago)
- Language: JavaScript
- Size: 705 KB
- Stars: 108
- Watchers: 20
- Forks: 59
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- DeFi-Map - github
README
# Mooniswap
[![Build Status](https://github.com/CryptoManiacsZone/mooniswap/workflows/CI/badge.svg)](https://github.com/CryptoManiacsZone/mooniswap/actions)
[![Coverage Status](https://coveralls.io/repos/github/CryptoManiacsZone/mooniswap/badge.svg?branch=master)](https://coveralls.io/github/CryptoManiacsZone/mooniswap?branch=master)AMM with a beautiful mind
## Factory Address
[https://etherscan.io/address/0x71CD6666064C3A1354a3B4dca5fA1E2D3ee7D303](https://etherscan.io/address/0x71CD6666064C3A1354a3B4dca5fA1E2D3ee7D303)## Swap
```solidity
/**
* @param src address of the source token to exchange
* @param dst token address that will received
* @param amount amount to exchange
* @param minReturn minimal amount of the dst token that will receive (if result < minReturn then transaction fails)
* @param referral 1/20 from LP fees will be minted to referral wallet address (in liquidity token) (in case of address(0) no mints)
* @return result received amount
*/
function swap(address src, address dst, uint256 amount, uint256 minReturn, address referral) external payable returns(uint256 result);
```## Deposit
```solidity
/**
* @dev provide liquidity to the pool and earn on trading fees
* @param amounts [amount0, amount1] for liquidity provision (each amount sorted by token0 and token1)
* @param minAmounts minimal amounts that will be charged from sender address to liquidity pool (each amount sorted by token0 and token1)
* @return fairSupply received liquidity token amount
*/
function deposit(uint256[] calldata amounts, uint256[] calldata minAmounts) external payable returns(uint256 fairSupply);
```## Withdraw
```solidity
/**
* @dev withdraw liquidity from the pool
* @param amount amount to burn in exchange for underlying tokens
* @param minReturns minimal amounts that will be transferred to sender address in underlying tokens (each amount sorted by token0 and token1)
*/
function withdraw(uint256 amount, uint256[] memory minReturns) external;
```## Create new pool
```solidity
/**
* @dev tokens will be sorted and stored according to token0 < token1
* @param tokenA
* @param tokenB
* @return pool created pool address
*/
function deploy(address tokenA, address tokenB) public returns(address pool);
```