Skip to content

Commit

Permalink
update claim_airdrops.py - remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
godekina committed Oct 30, 2024
1 parent 45da371 commit 3ec7fb2
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions web_app/tasks/claim_airdrops.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
logger = logging.getLogger(__name__)


##1. fetch all airdops from AirDropDBConnector.get_all_unclaimed()
class AirdropClaimer:
"""
Handles the process of claiming unclaimed airdrops and updating the database.
Expand All @@ -28,7 +27,6 @@ def __init__(self):
self.starknet_clinet = StarknetClient()
self.zk_lend_airdrop = ZkLendAirdrop()

##2. create a function to claim airdrops using Starknetclient
async def claim_airdrops(self) -> None:
"""
Retrieves unclaimed airdrops, attempts to claim them on the Starknet blockchain,
Expand All @@ -37,11 +35,9 @@ async def claim_airdrops(self) -> None:
unclaimed_airdrops = self.db_connector.get_all_unclaimed()
for airdrop in unclaimed_airdrops:
try:
# get user address and proof for claim
user_contract_address = airdrop.user.contract_address
proof = self.zk_lend_airdrop.get_contract_airdrop(user_contract_address)

# accept claim
claim_succesful = await self._claim_airdrop(
user_contract_address, proof
)
Expand All @@ -58,7 +54,6 @@ async def _claim_airdrop(self, contract_address: str, proof: List[int]) -> bool:
"""
calldata = [100] + proof
try:
# Starknet contract call
await self.starknet_client._func_call(
addr=self.starknet_client._convert_address(contract_address),
selector="claim",
Expand All @@ -70,7 +65,6 @@ async def _claim_airdrop(self, contract_address: str, proof: List[int]) -> bool:
return False


# Execute claim
if __name__ == "__main__":
airdrop_claimer = AirdropClaimer()
asyncio.run(airdrop_claimer.claim_airdrops())

0 comments on commit 3ec7fb2

Please sign in to comment.