Uniswap v2 review

Uniswap logo
  • mint : increase liquidity
  • burn : decrease liquidity
  • approve: approve the amount to be sold
  • transfer: transfer the amount from you to buyer
  • transferFrom: transfer the amount from third party to buyer
  • permit: sign an approval off-chain, reduce 2 step process to 1 step
  • createPair: create the token pair that is sold and bought
  • setFeeTo: set the transaction fee
  • mint: update the balance after liquidity is increased
  • burn: update the balance after liquidity is reduced
  • swap: adjust the balance of tokens so that the invariant stays constant (The product of pair x * y = k is invariant)
  • migrate: support migration from v1 exchange
  • removeLiquidity: called by frontend to remove liquidity
  • addLiquidity: called by frontend to increase liquidity
  • a series of swap functions
new Contract(address, ABI, getProviderOrSigner(library, account) as any)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store