vocdoni / census3

Golang library and a HTTP/API service that can be used to fetch an updated list of token holders for a Ethereum ERC20, ERC721, ERC777, or other external providers (ex. POAPs or GitcoinPassport).
GNU Affero General Public License v3.0
9 stars 2 forks source link

F/farcaster r1 #157

Closed jordipainan closed 9 months ago

jordipainan commented 9 months ago

Summary by CodeRabbit

github-actions[bot] commented 9 months ago

Image description CodeRabbit

Walkthrough

This pull request introduces support for Farcaster tokens in the census creation process, adds new SQL queries and tables for user management and fid-appkey mappings, and modifies existing providers to include a CensusKeys method. It also includes necessary configuration changes and database updates to accommodate these new features.

Changes

Files Summary
api/api.go, api/censuses.go Added support for farcaster tokens in the census creation process, including logging, field updates, and a new transformCensus method.
cmd/census3/main.go, contracts/bindContract.sh, example.env Enabled farcaster support in the codebase, added new ABI declarations, commented out previous ABIs, and introduced a new configuration variable CENSUS3_FARCASTER.
db/* Ensured non-empty database name before initialization, added 'farcaster' token type, introduced new SQL query StrategyTokensContainsType, added last_block column to tokens table, updated version information in generated code comments, and modified insert tokens query.
scanner/providers/farcaster/* Introduced a new farcaster package with database connections, initialization functions, methods to update user data, SQL statements for users and fid_appkeys tables, SQL queries for user management and fid-appkey mappings, struct definitions, and new SQL queries for interacting with users and fid_appkeys tables.
scanner/providers/gitcoin/gitcoin_provider.go, scanner/providers/holders_provider.go, scanner/providers/poap/poap_provider.go, scanner/providers/web3/erc20_provider.go, scanner/providers/web3/erc721_provider.go, scanner/providers/web3/erc777_provider.go Added a new CensusKeys method to various provider structs that returns data as is without transformation.
scanner/providers/types.go, scanner/providers/web3/const.go, scanner/providers/web3/web3_provider.go Added a new contract type "FARCASTER", new log topics related to farcaster functionality, and a new field DB *db.Database in the Web3ProviderConfig struct.

🐇💻

In the land of code where the shadows lie, A rabbit hopped forth under the cloudless sky. With each line written, each test case passed, The software grew stronger, its foundations vast. Farcaster tokens now join the fray, As we celebrate this coding day! 🎉


Uplevel your code reviews with CodeRabbit Pro ### CodeRabbit Pro If you like this project, please support us by purchasing the [Pro version](https://coderabbit.ai). The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects.
jordipainan commented 9 months ago

squash commits please