Skip to content

Instantly share code, notes, and snippets.

@jgarzik
Created November 25, 2020 18:51
Show Gist options
  • Save jgarzik/3a27cb0e1408f45587c5967d2f53d108 to your computer and use it in GitHub Desktop.
Save jgarzik/3a27cb0e1408f45587c5967d2f53d108 to your computer and use it in GitHub Desktop.

LPX Token Specification

External components

LPX calls external, on-chain contracts for the following systems:

ERC20 standard ABIs

  • name(), symbol(), decimals(): as with OpenZeppelin ERC20
  • totalSupply(), balanceOf(): as with OpenZeppelin ERC20
  • allowance(), increaseAllowance(), decreaseAllowance(), approve(): as with OpenZeppelin ERC20
  • transfer(), transferFrom(): as with OpenZeppelin ERC20
  • burn(): as with OpenZeppelin ERC20

ERC20 enhancements

LPX specific ABIs

  • bootstrapMint(amount): Receive USDC to contract. Mint LPX tokens to sender on a 1:1 basis. Maximum 1,000,000 LPX may be minted this way, then this facility is disabled permanently.
  • mint(source_token, amount): Receive any amount of ERC20 whitelisted tokens. Charge 1% fee. Mint LPX, based on on-chain LPX/$TOKEN price oracle. Store tokens by adding liquidity to LPX/$TOKEN Uniswap pair.
  • redeem(lpx amount, target_token): Receive any amount of LPX. Charge 2% fee. Withdraw liquidity from Uniswap pair, and send to caller. Burn LPX.
  • sweep(token): Uniswap token to LPX. Burn LPX.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment