web3-wizzard-lib 1.9.0__py3-none-any.whl → 1.9.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- web3_wizzard_lib/core/contract/compund_v3_bulker.py +8 -3
- web3_wizzard_lib/core/modules/bank/compound_v3.py +1 -1
- web3_wizzard_lib/core/modules/bank/mendi_finance.py +5 -5
- {web3_wizzard_lib-1.9.0.dist-info → web3_wizzard_lib-1.9.2.dist-info}/METADATA +1 -1
- {web3_wizzard_lib-1.9.0.dist-info → web3_wizzard_lib-1.9.2.dist-info}/RECORD +7 -7
- {web3_wizzard_lib-1.9.0.dist-info → web3_wizzard_lib-1.9.2.dist-info}/WHEEL +1 -1
- {web3_wizzard_lib-1.9.0.dist-info → web3_wizzard_lib-1.9.2.dist-info}/top_level.txt +0 -0
@@ -1,3 +1,5 @@
|
|
1
|
+
from loguru import logger
|
2
|
+
|
1
3
|
from sybil_engine.contract.contract import Contract
|
2
4
|
from sybil_engine.contract.transaction_executor import evm_transaction
|
3
5
|
from sybil_engine.utils.file_loader import load_abi
|
@@ -12,14 +14,17 @@ class CompoundV3BulkerContract(Contract):
|
|
12
14
|
|
13
15
|
@evm_transaction
|
14
16
|
def invoke(self, account, amount, actions):
|
15
|
-
hex_amount = decimal_to_padded_hexadecimal(amount, 32)
|
17
|
+
hex_amount = decimal_to_padded_hexadecimal(int(amount * 0.98), 32)
|
16
18
|
data = f'0x000000000000000000000000b2f97c1bd3bf02f5e74d13f02e3e26f93d77ce44000000000000000000000000ef0f48dadd0abe4f99b4c14862df303ba956bd1300000000000000000000000000000000{hex_amount}'
|
17
19
|
|
18
|
-
|
20
|
+
txn = self.contract.functions.invoke(
|
19
21
|
[hex_to_bytes(actions)],
|
20
22
|
[hex_to_bytes(data)]
|
21
|
-
)
|
23
|
+
)
|
24
|
+
|
25
|
+
contract_txn = txn.build_transaction(self.build_generic_data(account.address, False))
|
22
26
|
|
27
|
+
return contract_txn
|
23
28
|
|
24
29
|
def hex_to_bytes(hex_string):
|
25
30
|
"""
|
@@ -34,7 +34,7 @@ class CompoundV3(Bank):
|
|
34
34
|
return self.contract.supply(account, amount, erc20_token.erc20_contract.contract_address)
|
35
35
|
|
36
36
|
def redeem(self, account, amount, token):
|
37
|
-
actions = '
|
37
|
+
actions = '0x414354494f4e5f57495448445241575f4e41544956455f544f4b454e00000000'
|
38
38
|
self.contract_bulker.invoke(account, amount, actions)
|
39
39
|
|
40
40
|
def get_deposit_amount(self, account, token):
|
@@ -35,22 +35,22 @@ class MendiFinance(Bank):
|
|
35
35
|
def repay_borrow(self, account, amount):
|
36
36
|
logger.info(f"Mendi repay {amount.token}")
|
37
37
|
|
38
|
-
def redeem(self, account, amount):
|
39
|
-
me_token = f'
|
38
|
+
def redeem(self, account, amount, token):
|
39
|
+
me_token = f'mewe{token}'
|
40
40
|
mendi_token_address = get_tokens_for_chain(self.chain)[me_token]
|
41
41
|
mendi = MendiTokenContract(mendi_token_address, self.web3)
|
42
42
|
|
43
43
|
redeem_balance = mendi.balance_of(account)
|
44
44
|
|
45
45
|
if redeem_balance > 1000000000:
|
46
|
-
logger.info(f"Mendi reedem {
|
46
|
+
logger.info(f"Mendi reedem {token}")
|
47
47
|
mendi.redeem(account, redeem_balance)
|
48
48
|
else:
|
49
49
|
logger.info(f"Mendi balance is 0")
|
50
50
|
|
51
51
|
def get_deposit_amount(self, account, token):
|
52
|
-
|
53
|
-
mendi_token_address = get_tokens_for_chain(self.chain)[
|
52
|
+
me_token = f'meweETH'
|
53
|
+
mendi_token_address = get_tokens_for_chain(self.chain)[me_token]
|
54
54
|
mendi = MendiTokenContract(mendi_token_address, self.web3)
|
55
55
|
|
56
56
|
return mendi.balance_of(account)
|
@@ -11,7 +11,7 @@ web3_wizzard_lib/core/contract/bilinear_contract.py,sha256=pCTkNQa4I1TqIAn_J6WgB
|
|
11
11
|
web3_wizzard_lib/core/contract/bungee.py,sha256=vkuZmLhtdqvGOTkVe7MnIHsDGHUtm8zdqD-YYxVfkQ8,891
|
12
12
|
web3_wizzard_lib/core/contract/cog_erc20.py,sha256=wkfKC7bqBHpgZGL5xZ4737pMaD5m8oEw0huw36ssX1M,1674
|
13
13
|
web3_wizzard_lib/core/contract/compound_v3.py,sha256=ehsO6o53Av5s1dUknxj_6X4FBP4eNtZ_ZVMtvBzfTus,973
|
14
|
-
web3_wizzard_lib/core/contract/compund_v3_bulker.py,sha256=
|
14
|
+
web3_wizzard_lib/core/contract/compund_v3_bulker.py,sha256=SmmjGENtVwazJdjCI1Q2AIO_H-d51ykdLh4EYdBVTjI,1502
|
15
15
|
web3_wizzard_lib/core/contract/coredao_contract.py,sha256=-M7gBYtVCxHLtoPfhNOwUaC9gHWuZMbd_xAbt7N66Tc,1035
|
16
16
|
web3_wizzard_lib/core/contract/coredao_from_contract.py,sha256=cvQlLGjuri-1lhNKtnKJ79MDFcp_wXRFWlJRORt4ZEA,1221
|
17
17
|
web3_wizzard_lib/core/contract/dmail_send_mail.py,sha256=_MVsSvrG17uMQTXNogrfxxKBeBsO8gq6zhaVc5w2AjQ,627
|
@@ -130,10 +130,10 @@ web3_wizzard_lib/core/modules/bank/aave.py,sha256=q8dR64TviR5o8NzJJXIgbWkLqPxin9
|
|
130
130
|
web3_wizzard_lib/core/modules/bank/bank.py,sha256=LNz1C720_dG2gih2w4nG5dtRL-q43_yep5mv1Okc2qw,362
|
131
131
|
web3_wizzard_lib/core/modules/bank/basilisk.py,sha256=IsfylmROKyqssosF-ouCA_vkm5kVIRIM3L9Uam461gM,909
|
132
132
|
web3_wizzard_lib/core/modules/bank/cog_bank.py,sha256=v12iY78EESqJmZX3dJghU9HulkrK9G6T2H7tDOm3q0o,828
|
133
|
-
web3_wizzard_lib/core/modules/bank/compound_v3.py,sha256=
|
133
|
+
web3_wizzard_lib/core/modules/bank/compound_v3.py,sha256=57-1JNfg76TyKOIjaF7X65e15mOBsfnI5JzYTlz0oVc,2205
|
134
134
|
web3_wizzard_lib/core/modules/bank/eralend.py,sha256=2aVH4KMYCBwTYSslaULF0t_pQQwq9YBNOVV1_ailXS4,887
|
135
135
|
web3_wizzard_lib/core/modules/bank/layerbank.py,sha256=btJr2GA8MY7R9jLoppTLddbtgHATKIck6sbhCeKUl_I,4547
|
136
|
-
web3_wizzard_lib/core/modules/bank/mendi_finance.py,sha256=
|
136
|
+
web3_wizzard_lib/core/modules/bank/mendi_finance.py,sha256=rRb_-_9N3uc5lfEeagVKutpn0Y64gRgegJIZk6Pxksw,1954
|
137
137
|
web3_wizzard_lib/core/modules/bank/reactorfusion.py,sha256=EXxJn4u8c4F8pzaT0SMNLKQE8AJYNi4FMiZDJuimHVY,941
|
138
138
|
web3_wizzard_lib/core/modules/bank/zerolend.py,sha256=H-YUpJt98kfhyKDdRJ-EpS0O2zXS_wBV821yLAXDDno,1327
|
139
139
|
web3_wizzard_lib/core/modules/bridge/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -371,7 +371,7 @@ web3_wizzard_lib/resources/main/pairs.json,sha256=uvIFvY46Ctiw8hjGd9e-1WE0qLf_du
|
|
371
371
|
web3_wizzard_lib/resources/main/tokens.json,sha256=AoZz_I6AVoZuecNdyX5L-SnGm6TREuPrsYd2i9PJr7U,5707
|
372
372
|
web3_wizzard_lib/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
373
373
|
web3_wizzard_lib/utils/debank_utils.py,sha256=CE2SUN9RpFK_j9KjJgxf7a__VRJ75tLIw9tLrVNrn3c,484
|
374
|
-
web3_wizzard_lib-1.9.
|
375
|
-
web3_wizzard_lib-1.9.
|
376
|
-
web3_wizzard_lib-1.9.
|
377
|
-
web3_wizzard_lib-1.9.
|
374
|
+
web3_wizzard_lib-1.9.2.dist-info/METADATA,sha256=5tcMqI1rs7SXr4cceQt1Z9njRQIKIgIHZceoHYZyJHY,339
|
375
|
+
web3_wizzard_lib-1.9.2.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
376
|
+
web3_wizzard_lib-1.9.2.dist-info/top_level.txt,sha256=31sEPHxuJ1p5fpc75vHQJ8eJdSs80aCZeeT3L8YAHNg,17
|
377
|
+
web3_wizzard_lib-1.9.2.dist-info/RECORD,,
|
File without changes
|