Skip to content

Commit

Permalink
Pool whitelist added
Browse files Browse the repository at this point in the history
  • Loading branch information
igorsereda committed Dec 4, 2023
1 parent 0d69200 commit cd3ee8c
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/demo_uniswap/handlers/factory/pool_created.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,24 @@
from tortoise.exceptions import OperationalError

POOL_BLACKLIST = {'0x8fe8d9bb8eeba3ed688069c3d6b556c9ca258248'}
POOL_WHITELIST = {
'0x7bea39867e4169dbe237d55c8242a8f2fcdcc387',
'0x7858e59e0c01ea06df3af3d20ac7b0003275d4bf',
'0xbb256c2f1b677e27118b0345fd2b3894d2e6d487',
'0x4e68ccd3e89f51c3074ca5072bbac773960dfa36',
'0x788f0399b9f012926e255d9f22ceea845b8f7a32',
'0xfaace66bd25abff62718abd6db97560e414ec074',
'0x86e69d1ae728c9cd229f07bbf34e01bf27258354',
'0x85498e26aa6b5c7c8ac32ee8e872d95fb98640c4',
'0xbfa7b27ac817d57f938541e0e86dbec32a03ce53',
'0xb2cd930798efa9b6cb042f073a2ccea5012e7abf',
'0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8',
'0xf15054bc50c39ad15fdc67f2aedd7c2c945ca5f6',
'0x2f62f2b4c5fcd7570a709dec05d68ea19c82a9ec',
'0x2efec2097beede290b2eed63e2faf5ecbbc528fc',
'0xc2ceaa15e6120d51daac0c90540922695fcb0fc7',
'0x1d42064fc4beb5f8aaf85f4617ae8b3b5b8bd801',
}
WETH_ADDRESS = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'


Expand Down Expand Up @@ -38,8 +56,8 @@ async def pool_created(
ctx: HandlerContext,
event: SubsquidEvent[PoolCreated],
) -> None:
if event.payload.pool in POOL_BLACKLIST:
ctx.logger.info('Pool %s is blacklisted', event.payload.pool)
if event.payload.pool not in POOL_WHITELIST:
ctx.logger.info('Pool %s is not whitelisted', event.payload.pool)
return

factory_address = cast(EvmContractConfig, ctx.config.get_contract('factory')).address
Expand Down Expand Up @@ -72,4 +90,4 @@ async def pool_created(
# NOTE: Could present after wipe with immune_tables
with suppress(OperationalError):
await pool.save()
pool.cache()
pool.cache()

0 comments on commit cd3ee8c

Please sign in to comment.