Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from vyper.interfaces import ERC20
- contract Compound():
- def redeem(quantity: uint256) -> uint256: modifying
- def mint(quantity: uint256) -> uint256: modifying
- def approve(target: address, quantity: uint256) -> bool: modifying
- def balanceOf(target: address) -> uint256: constant
- def transfer(to: address, tokens: uint256) -> bool: modifying
- owner: address
- cusdc_token: Compound
- usdc_token: ERC20
- @public
- def __init__():
- self.owner = msg.sender
- self.cusdc_token = Compound(0x39AA39c021dfbaE8faC545936693aC917d5E7563)
- self.usdc_token = ERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48)
- self.usdc_token.approve(self.cusdc_token, 99998075535048195174647562)
- @public
- def kill():
- if msg.sender == self.owner:
- selfdestruct(self.owner)
- @public
- def compound(quantity: uint256, trans_cost: uint256):
- assert self.usdc_token.transferFrom(msg.sender, self, quantity)
- assert self.cusdc_token.mint(quantity) == 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement