Skip to content

Commit 51a5073

Browse files
committed
bugfix with harvesting position rewards
1 parent 90c7584 commit 51a5073

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

alpha_homora_v2/position.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,15 @@ def claim_all_rewards(self) -> tuple[str, dict]:
9090
"""
9191

9292
encoded_spell_func = self.platform.prepare_claim_all_rewards()
93+
94+
pool_info = self.get_pool_info()
95+
96+
try:
97+
spell_address = Web3.toChecksumAddress(pool_info['spellAddress'])
98+
except KeyError:
99+
spell_address = Web3.toChecksumAddress(self.platform.address)
93100

94-
encoded_bank_func = self.homora_bank.functions.execute(self.pos_id, self.platform.address, encoded_spell_func)
101+
encoded_bank_func = self.homora_bank.functions.execute(self.pos_id, spell_address, encoded_spell_func)
95102

96103
tx_hash, receipt = self.sign_and_send(
97104
encoded_bank_func

0 commit comments

Comments
 (0)