Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter_items command does not detect if contract is token address #72

Open
0xAleksaOpacic opened this issue May 18, 2022 · 0 comments
Open

Comments

@0xAleksaOpacic
Copy link

Description:
I have deployed ERC-20 contract on the Polygon testnet (Mumbai)

While testing different commands, i have noticed that calling:
polygonetl filter_items -i contracts.csv -p "item['is_erc20'] or item['is_erc721']" | polygonetl extract_field -f address -o token_addresses.txt

return contract as token_address even if is_erc20 and is_erc721 items are FALSE

Enviroment:
PolygonEtl version: polygonetl, version 0.1.8
Network: Polygon Mumbai testnet
JSON-RPC: http://matic-mumbai.chainstacklabs.com/
Chain id: 80001
Transaction hash: 0x826a27ebe789e91bb06489dccf5e7382b6109f9eadccff696b32fcd64f1a0a32

Steps to reproduce:

  1. polygonetl export_blocks_and_transactions --start-block 26363958 --end-block 26363958 --provider-uri http://matic-mumbai.chainstacklabs.com --blocks-output blocks.csv --transactions-output transactions.csv
  2. polygonetl extract_csv_column --input transactions.csv --column hash --output transaction_hashes.txt
  3. polygonetl export_receipts_and_logs --transaction-hashes transaction_hashes.txt --provider-uri http://matic-mumbai.chainstacklabs.com --receipts-output receipts.csv --logs-output logs.csv
  4. polygonetl extract_token_transfers --logs logs.csv --output token_transfers.csv
  5. polygonetl extract_csv_column --input receipts.csv --column contract_address --output contract_addresses.txt
  6. polygonetl export_contracts --contract-addresses contract_addresses.txt --provider-uri http://matic-mumbai.chainstacklabs.com --output contracts.csv
  7. polygonetl filter_items -i contracts.csv -p "item['is_erc20'] or item['is_erc721']" | polygonetl extract_field -f address -o token_addresses.txt

Check contracts.csv file and for contract (addr = 0x1a1586c38e38a094e42223a31896c40598516d05) is_erc20 and is_erc721 fields are FALSE. But filter_tems method detect that they are token_addresses and returns address in token_addresses.txt

Proposed solution
FilterItem

predicate(item) return string, so this condition will always be true.

Either change method to return bool or compare to string (if predicate(item)=="True":)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant