SHARE
TWEET

Untitled

a guest Aug 19th, 2019 105 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from vyper.interfaces import ERC20
  2.  
  3. contract Compound():
  4.     def redeem(quantity: uint256) -> uint256: modifying
  5.     def mint(quantity: uint256) -> uint256: modifying
  6.     def approve(target: address, quantity: uint256) -> bool: modifying
  7.     def balanceOf(target: address) -> uint256: constant
  8.     def transfer(to: address, tokens: uint256) -> bool: modifying
  9.  
  10. owner: address
  11. cusdc_token: Compound
  12. usdc_token: ERC20
  13.  
  14.  
  15. @public
  16. def __init__():
  17.     self.owner = msg.sender
  18.     self.cusdc_token = Compound(0x39AA39c021dfbaE8faC545936693aC917d5E7563)
  19.     self.usdc_token = ERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48)
  20.  
  21.     self.usdc_token.approve(self.cusdc_token, 99998075535048195174647562)
  22.  
  23. @public
  24. def kill():
  25.     if msg.sender == self.owner:
  26.         selfdestruct(self.owner)
  27.  
  28. @public
  29. def compound(quantity: uint256, trans_cost: uint256):
  30.     assert self.usdc_token.transferFrom(msg.sender, self, quantity)
  31.     assert self.cusdc_token.mint(quantity) == 0
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top