|
4 | 4 | [](https://coveralls.io/github/CryptoManiacsZone/mooniswap?branch=master)
|
5 | 5 |
|
6 | 6 | AMM with a beautiful mind
|
| 7 | + |
| 8 | +## Factory Address |
| 9 | +[https://etherscan.io/address/0x71CD6666064C3A1354a3B4dca5fA1E2D3ee7D303](https://etherscan.io/address/0x71CD6666064C3A1354a3B4dca5fA1E2D3ee7D303) |
| 10 | + |
| 11 | +## Swap |
| 12 | +```solidity |
| 13 | +/** |
| 14 | +* @param src address of the source token to exchange |
| 15 | +* @param dst token address that will received |
| 16 | +* @param amount amount to exchange |
| 17 | +* @param minReturn minimal amount of the dst token that will receive (if result < minReturn then transaction fails) |
| 18 | +* @param referral 1/20 from LP fees will be minted to referral wallet address (in liquidity token) (in case of address(0) no mints) |
| 19 | +* @return result received amount |
| 20 | +*/ |
| 21 | +function swap(address src, address dst, uint256 amount, uint256 minReturn, address referral) external payable returns(uint256 result); |
| 22 | +``` |
| 23 | + |
| 24 | +## Deposit |
| 25 | +```solidity |
| 26 | +/** |
| 27 | +* @dev provide liquidity to the pool and earn on trading fees |
| 28 | +* @param amounts [amount0, amount1] for liquidity provision (each amount sorted by token0 and token1) |
| 29 | +* @param minAmounts minimal amounts that will be charged from sender address to liquidity pool (each amount sorted by token0 and token1) |
| 30 | +* @return fairSupply received liquidity token amount |
| 31 | +*/ |
| 32 | +function deposit(uint256[] calldata amounts, uint256[] calldata minAmounts) external payable returns(uint256 fairSupply); |
| 33 | +``` |
| 34 | + |
| 35 | +## Withdraw |
| 36 | +```solidity |
| 37 | +/** |
| 38 | +* @dev withdraw liquidity from the pool |
| 39 | +* @param amount amount to burn in exchange for underlying tokens |
| 40 | +* @param minReturns minimal amounts that will be transferred to sender address in underlying tokens (each amount sorted by token0 and token1) |
| 41 | +*/ |
| 42 | +function withdraw(uint256 amount, uint256[] memory minReturns) external; |
| 43 | +``` |
| 44 | + |
| 45 | +## Create new pool |
| 46 | +```solidity |
| 47 | +/** |
| 48 | +* @dev tokens will be sorted and stored according to token0 < token1 |
| 49 | +* @param tokenA |
| 50 | +* @param tokenB |
| 51 | +* @return pool created pool address |
| 52 | +*/ |
| 53 | +function deploy(address tokenA, address tokenB) public returns(address pool); |
| 54 | +``` |
0 commit comments