Commit Graph

76 Commits

Author SHA1 Message Date
b742e92502 optimistic swaps (#53)
* alternative flash lending (renting) design

* add rent interface

* fix stack too deep error

rearrange order of k condition math

ignore erroneous out of gas errors in tests

* try removing rent in favor of monolithic swap

IUniswapV2Borrower -> IUniswapV2Callee

update tests

* fix implementation

* clean up math a bit

* amount{0,1}In -> amount{0,1}InNet

* charge on all inputs, not just net

* removed unnecessary safemath

* add to != token check

don't indent in scope

rename reserve{0,1}Next -> reserve{0,1}Adjusted

* > instead of >=

simplify algebra

reserve{0,1}Adjusted -> balance{0,1}Adjusted

add comments

* add some optimistic swap test cases
2020-02-17 15:06:43 -07:00
55ae25109b MINIMUM_TOTAL_SUPPLY -> MINIMUM_LIQUIDITY (#51)
* MINIMUM_TOTAL_SUPPLY -> MINIMUM_LIQUIDITY

make selector private
2020-02-07 10:38:46 -05:00
a1e31c29a6 THRESHOLD -> MINIMUM_TOTAL_SUPPLY 2020-02-03 11:08:22 -05:00
e382d705d1 add THRESHOLD for pool shares balances
tentatively set to 1e6 for now
2020-01-31 15:10:21 -05:00
1a2d91c440 view -> pure for the appropriate functions 2020-01-30 15:45:23 -05:00
ff7bee4252 add IUniswapV2ERC20 methods to IUniswapV2Exchange 2020-01-30 14:08:15 -05:00
bab77458b2 whitespace + comment cleanup 2020-01-30 12:49:09 -05:00
80ce1e48c0 move from invariant -> k (compute sqrt lazily)
use getReserves more places

improve comment quality
2020-01-29 13:15:07 -05:00
1f5c9aa9e7 populate getExchange bidirectionally 2020-01-24 12:58:21 -05:00
a55aa4bfed block.number -> block.timestamp
tweak timing tests

make tests even better
2020-01-23 12:30:39 -05:00
85d6435ea2 add some comments
preface all errors with "UniswapV2: ..."

tweak the order of a few things

use abi.encodeWithSelector instead of abi.encodeWithSignature
2020-01-22 15:39:43 -05:00
794c384702 tighten up permit 2020-01-22 14:06:06 -05:00
0d35e31a89 tweak factory functions 2020-01-22 13:39:23 -05:00
1a4837bffa reorder ERC20 functions, clean up naming 2020-01-22 13:14:55 -05:00
b972227df8 update to solc@0.5.16
update waffle version and fix deprecations

move CI from circle to github actions
2020-01-22 11:47:24 -05:00
cbe801b54f remove forfeit{,from}
make name + symbol + decimals constant

add GenericERC20

rename some contracts

update tests to reflect all of this
2020-01-13 15:59:07 -05:00
f2d4021498 remove exchangeBytecode in favor of .creationCode 2020-01-07 16:44:52 -05:00
83ad498995 add getReserves to wrap single SLOAD
put a trailing _ on private variable
2020-01-06 14:52:46 -05:00
3d2493ef2c change variable name 2020-01-06 13:00:57 -05:00
b8655fee9f add "to" parameter to relevant functions 2019-12-30 17:54:02 -05:00
cdd379079d burn -> forfeit
burnFrom -> forfeitFrom
make -> mint
made -> burn
move -> swap

make deadline check >= insteand of >
2019-12-30 15:07:49 -05:00
e9e087c328 remove getTokens from the factory 2019-12-30 13:30:15 -05:00
c5e9261036 bump to solc@0.5.15 2019-12-20 13:28:21 -05:00
3c8ce4e1cc fix fee on swap implementation 2019-12-20 13:20:21 -05:00
49882ab99b forfeit -> burn
mint -> make

burn -> made
2019-12-19 18:02:49 -05:00
5add082d4f use interface in the factory 2019-12-19 12:56:54 -05:00
9e80c55338 try out fees on swap
rework admin/fee stuff in the factory
2019-12-19 10:40:26 -05:00
20ae6d1195 unsafeBurn{,from} -> forfeit{,From}
expiration -> deadline
2019-12-19 08:45:37 -05:00
c9d0ba6198 prefix burn/burnFrom in ERC20 with unsafe
fix tests for new contract code
2019-12-18 17:51:25 -05:00
580787051e change to more flexible variant
combine swap functions

name changes
2019-12-18 16:40:32 -05:00
5b15d59773 approveMeta -> permit
call factory for fee logic

fail on balances > max112

add skim

use reserves in burnLiquidity
2019-12-13 17:25:04 -05:00
4c77c630fb bulk out fee implementation 2019-12-12 18:12:23 -05:00
4e4546d0a9 bump solc to 0.5.14
chainId implementation (commented out for now)

improve events

move safeTransfer in UniswapV2

tweak error messages
2019-12-12 14:52:15 -05:00
f128ef3bc9 tweak name 2019-12-11 16:32:49 -05:00
cb20aa4604 clean up naming 2019-12-11 15:19:28 -05:00
f71bceee3d fix some edge cases and burnLiquidity bug 2019-12-11 14:50:24 -05:00
8bdf549b98 improve fee logic, make clamping logic more robust 2019-12-11 14:36:55 -05:00
12b269d686 small tweaks 2019-12-09 16:24:59 -05:00
fd95caea17 squash errors 2019-12-09 02:33:18 -05:00
7fa81c9d6f initial (borked) fee implementation 2019-12-08 16:47:09 -05:00
401d8e1e51 fix tests 2019-12-08 16:11:44 -05:00
c42fa57ac6 tweak uniswap 2019-12-08 15:53:49 -05:00
f4ab1b2fe0 tweak erc20 2019-12-08 15:06:54 -05:00
d9dec32a8b version bumps 2019-12-08 14:52:19 -05:00
90dc9f39ab tweak factory api 2019-12-08 14:45:49 -05:00
b284b63118 don't pack prices as much 2019-12-05 13:28:23 -05:00
607b1c6e6e remove all structs and rename variables 2019-12-04 18:45:28 -05:00
f06361140c uint256 -> uint
use 256 in more places

break out separate functions
2019-12-04 17:08:38 -05:00
e88ba8b09c fix interface 2019-11-26 14:05:46 -05:00
3bb8a6defb compact storing for blocknumber and oracle data 2019-11-25 17:49:04 -05:00