diff --git a/PROJECT_NAME/README.md b/PROJECT_NAME/README.md deleted file mode 100644 index 4c3cb741d..000000000 --- a/PROJECT_NAME/README.md +++ /dev/null @@ -1,33 +0,0 @@ - -# ⚡ Hackathon Project Template ⚡ -_This is a sample submission repository. -Please [__fork this repo__](https://help.github.com/articles/fork-a-repo/) and use this as a starting point for your hackathon project._ - -## Project Name -### Team name -#### Hackathon Track - -##### Region location - -##### Team Members -- Teammate 1, role -- Teammate 2, role -- Teammate 3, role - -#### Project Description -Provide a clear statement of the challenges/issues/problems/gaps your project engages as well as a brief, high-level description of how your project engages the areas you've identified. What is the value of your approach? Who are the intended users? - -#### Summary -Describe the basic functionality of your project. What are the features you were able to implement? What features would you like to implement? - -#### URLs -List any URLs relevant to demonstrating your prototype - -#### Presentation -List any links to your presentation or any related visuals you want to share. - -#### Next Steps -What do you need to do next to turn this prototype into a working solution? - -#### License -This repository includes an [unlicensed](http://unlicense.org/) statement though you may want to [choose a different license](https://choosealicense.com/). diff --git a/README.md b/README.md index c731edb03..18746ca2d 100644 --- a/README.md +++ b/README.md @@ -1,169 +1,88 @@ -# ⚡ Build with Celo Hackathon ⚡ -Build with Celo Hackathon is a three (3) phase hackathon event focused on Regenerative Finance (#ReFi) within DAOs, NFTs, Gaming (GameFi), Social Impact (SocialFI) and developer tooling/infrastructure on the Celo platform. - -## Hackathon Facilitation -Celo selected Hackerearth to facilitate the hackathon expereince. To learn more information about the Build on Celo hackathon event and register, navigate to Hackerearth Build on Celo hackathon site: [link](https://build-with-celo.hackerearth.com/) - -## Hackathon Tracks: - - - __DAO Track:__ - - Build decentralized web applications facilitating DAOs within ReFi, ReFi DAO Tools, and ReFi DAO Infrastructure. - - __NFT, Gaming and Creator Track:__ - - Build an application incorporating ReFi, ReFi creators tools, and ReFi creators infrastructure - - __Social Impact Track:__ - - Build a decentralized web applications focused on social impact within ReFi, Social impact ReFi Tools, and Social impact ReFi Infrastructure - -## Timeline - -#### Github commit schedule: - -- 9/26 - Idea submission open until 9/26 - -- 9/19 - Fork this repo -- 9/23 - Change README -- 9/30 - At least 3 commits -- 10/7 - At least 3 commits -- 10/14 - At least 3 commits -- 10/21 - At least 3 commits -- 10/28 - At least 3 commits -- 11/4 - At least 3 commits - -Three (3) phase hackathon event starting August 26th, 2022. -### Phase 1: Idea - - Hackathon Phase 1 Kick-off - August 26th, 2022 - - Project Idea Submissions Due - September 26, 2022 - - Idea Submissions Evaluated on rolling basis - -### Phase 2: Hack/build MVP - - Hackathon Phase 2 Kick off - September 19th, 2022 - - Project Submissions Due - November 6th, 2022 - - Evaluations - November 7th - December 4th, 2022 - -### Phase 3: Iterate & Pitch with Celo - - Hackathon Phase 3 Kick off - TBD - -## Process -**Hackathon participants will need to:** - - 1. [Fork this repo](#hackathon-repo-process) - 2. Utilize [HackerEarth](https://build-with-celo.hackerearth.com/) to: - - Manage and collaborate with your team - - Submit your project for final evaluation - -## Hackathon Repo Process - - 1. Fork this repo - - Press the Fork button - 2. Create project branch - 3. Make your changes within new branch! - - Copy the folder named **Project_Name** - - Rename the copied folder with your project name - - Modify project details within your project folder **Readme.md** - - Project Name - - Brief Description - - Team members & roles - - Hackathon track - - Project details - - Demonstartion video _(*Phase 2 & 3, Required)_ - - Requirements _(*Phase 2 & 3, Required)_ - - Instructions to build & test _(*Phase 2 & 3, Required)_ - - 4. Add, commit, and push the changes - - Add the files you've changed and commit them with a descriptive message. - 5. Submit your pull request _(*Phase 2 & 3, Required)_ - - Submit to the maintainers for approval. Head over to the original repositories Pull Requests tab, you should see an automatic suggestion from GitHub to create a pull request from your new branch. - - Utilize your project name as the title for your initial pull Requests - - Provide a brief project description within the pull request comment - -***Congrats, your officially a Build with Celo Hackathon participant!*** - - -## Developer tools and resources - -This section contains information about some of the key tools and resources that will help developers start building applications on Celo. - -For a comprehensive list of resources and information, review [Celo Docs.](https://docs.celo.org/) - -### QUICK START GUIDES - -View the [Developer Code Examples page](https://docs.celo.org/developer#quickstart) to get started using the Celo SDKs with guided coding exercises. - -### Tutorials -- [Tutorial - Celo Developer Blog](https://docs.celo.org/blog) - -### TOOLS - -#### Boilerplates -- [celo-composer](https://github.com/celo-org/celo-composer#celo-composer) - - Celo Composer allows you to quickly build, deploy, and iterate on decentralized applications using Celo. It provides a number of frameworks, examples, and Celo specific functionality to help you get started with your next dApp. - -#### SDKs - -- [ContractKit](https://docs.celo.org/developer/contractkit#what-is-contractkit) - - Javascript package of Celo blockchain utilities - - Manage connections to the Celo blockchain, accounts, send transactions, interact with smart contracts, etc. - - A set of wrappers around the core protocol smart contracts to easily connect with contracts related to governance, validators, on-chain exchange, etc. - - Includes [web3.js](https://web3js.readthedocs.io/en/v1.2.4/) -- [Celo Ethers.js Wrapper](https://github.com/celo-tools/celo-ethers-wrapper) (experimental) - - A minimal wrapper to make [ethers.js](https://docs.ethers.io/v5/) compatible with the Celo network -- [use-react](https://github.com/celo-org/react-celo) - - The easiest way to access Celo in your React applications 🔥. react-celo is a React hook for managing access to Celo with a built-in headless modal system for connecting to your users wallet of choice. - - Now your DApp can be made available to everyone in the Celo ecosystem, from Valora users to self custodied Ledger users. - - By default react-celo is styled so that you can drop it into your application and go, however it's fully customisable so you can maintain a consistent UX throughout your application. -- [DappKit](https://docs.celo.org/developer-guide/dappkit) - - Easily connect to the [Valora](http://valoraapp.com/) wallet with your React Native mobile application - - Valora manages user account, private keys and transaction signing, so you can focus on building your dapp - - Learn more and see the code with the [Dappkit truffle box](https://github.com/critesjosh/celo-dappkit) -- [Python SDK](https://github.com/blaize-tech/celo-sdk-py) -- [Java SDK](https://github.com/blaize-tech/celo-sdk-java) - - [Android with Java SDK](https://github.com/bcamacho/celo-android-java-sdk-test-example) -- [iOS SDK](https://github.com/heymateag/celoiossdk) - - - -#### Infrastructure - -- [Valora](https://valoraapp.com/) provides a clean, intuitive UI where users can send transactions and interact with smart contracts -- [Forno](https://stackedit.io/developer-guide/forno) -- Node access service so you can connect your dapp to the Celo blockchain without having to run node infrastructure -- [ODIS](https://stackedit.io/developer-resources/contractkit/odis.md) -- Oblivious decentralized identity service -- Lightweight identity layer that makes it easy to send cryptocurrency to a phone number -- Blockscout block explorers -- [Alfajores testnet](http://alfajores-blockscout.celo-testnet.org/) & [mainnet](http://explorer.celo.org/) -- [Stats.celo.org](http://stats.celo.org/) to check network activity and health - - -#### Networks +## Project Name -- [Alfajores Testnet](https://docs.celo.org/getting-started/alfajores-testnet) -- [Faucet](https://celo.org/developers/faucet) for free testnet CELO and cUSD -- [Forno](https://docs.celo.org/developer-guide/forno) supports connections to alfajores -- Requires Alfajores Celo wallet for mobile device testing (please request, support@clabs.co) -- [Baklava testnet](https://docs.celo.org/getting-started/baklava-testnet) for validators and testing protocol changes +Celo Network Tokens Analytics Dapp +### Team name +DappLooker -#### Ethereum Tools +#### Hackathon Track -- Similarities between Celo and Ethereum means you can use many of the most popular Ethereum developer tools. -- Celo supports the EVM, so tools for writing smart contracts in Solidity (or any language that compiles to EVM bytecode) are compatible with Celo -- ERC20, NFT (ERC721) and other smart contract interface standards are supported, see [Celo for Ethereum Developers](https://docs.celo.org/developer-guide/celo-for-eth-devs) -- [Truffle](https://www.trufflesuite.com/) -- [OpenZeppelin](https://openzeppelin.com/) -- [Remix](https://remix.ethereum.org/) +Implement Celo Network Tokens Analytics Dapp to Track Performance Metrics. -#### Ongoing projects +##### Region location +India -- [Community projects](https://docs.celo.org/developer-guide/celo-dapp-gallery) -- [Grant recipients](https://celo.org/experience/grants/directory) +##### Team Members +- Abhay - Blockchain Engineer +- Hitesh - Data Engineer -#### Web wallets - - [celowallet.app](https://celowallet.app/) - - [Celo Terminal](https://github.com/zviadm/celoterminal/) +#### Project Description +- Implemented Celo Network Tokens subgraph -#### Community +Subgraph is indexing transactions data of Celo network token contracts. Subgraph is then queried to display key performance metrics and KPIs. +The subgraph contains entities for below token contracts: -- Join our [Discord](https://chat.celo.org/) -- [Discourse Forum](https://forum.celo.org/) + - Celo(ERC20): 0x471EcE3750Da237f93B8E339c536989b8978a438 + + - cUSD: 0x765DE816845861e75A25fCA122bb6898B8B1282a + + - cEUR: 0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73** + + - cREAL: **0xe8537a3d056DA446677B9E9d6c5dB704EaAb4787** + + - stCELO: **0xa97be82bee72a809fe4b3ad158535879028babcb** + +- Implemented Analytics Dapp by querying data from subgraph + The analytics Dapp tracks below performance metrics: + + - Celo Tokens TVL + - Unique Users with atleast 1 Transaction + - Daily TVL + - Weekly Transaction Volume + - Weekly Gas Consumed + +#### Summary + +Implemented below functionalities in the project: +- Implement Analytics Dapp +- Implement Celo Network Tokens subgraph + +Below Performance Metrics are tracked: + +- **Token details and Number of users per token** + + Token Details + +- **Daily Transaction Volume** + + Daily TVL + +- **Weekly Transaction Volume** + + Weekly Transaction Volume + + +- **Weekly Gas Consumed.** + + Weekly Gas Consumed + + +#### URLs +Celo Network Tokens Subgraph - https://thegraph.com/hosted-service/subgraph/dapplooker/celo-tokens-analytics-subgraph + +Celo Network Tokens Analytics Dapp - https://analytics.dapplooker.com/public/dashboard/f97e8ce0-4b76-4ce4-9a89-ef3aaf9642f6 + +#### Presentation +Celo Network Tokens Subgraph - https://thegraph.com/hosted-service/subgraph/dapplooker/celo-tokens-analytics-subgraph + +Celo Network Tokens Analytics Dapp - https://analytics.dapplooker.com/public/dashboard/f97e8ce0-4b76-4ce4-9a89-ef3aaf9642f6 + +#### Next Steps +- Integrate more Celo network tokens +- Detailed analytics Dapp for each token +- Set Alerts on token transactions + +#### License +This repository includes an [unlicensed](http://unlicense.org/) statement though you may want to [choose a different license](https://choosealicense.com/). diff --git a/celo-tokens-analytics-dapp/abis/ERC20.json b/celo-tokens-analytics-dapp/abis/ERC20.json new file mode 100644 index 000000000..405d6b364 --- /dev/null +++ b/celo-tokens-analytics-dapp/abis/ERC20.json @@ -0,0 +1,222 @@ +[ + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_from", + "type": "address" + }, + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "balance", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_owner", + "type": "address" + }, + { + "name": "_spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "payable": true, + "stateMutability": "payable", + "type": "fallback" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "from", + "type": "address" + }, + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + } +] diff --git a/celo-tokens-analytics-dapp/abis/ERC20NameBytes.json b/celo-tokens-analytics-dapp/abis/ERC20NameBytes.json new file mode 100644 index 000000000..2d3c877a8 --- /dev/null +++ b/celo-tokens-analytics-dapp/abis/ERC20NameBytes.json @@ -0,0 +1,17 @@ +[ + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } +] diff --git a/celo-tokens-analytics-dapp/abis/ERC20SymbolBytes.json b/celo-tokens-analytics-dapp/abis/ERC20SymbolBytes.json new file mode 100644 index 000000000..a76d61636 --- /dev/null +++ b/celo-tokens-analytics-dapp/abis/ERC20SymbolBytes.json @@ -0,0 +1,17 @@ +[ + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } +] diff --git a/celo-tokens-analytics-dapp/abis/Moo.json b/celo-tokens-analytics-dapp/abis/Moo.json new file mode 100644 index 000000000..9958e4040 --- /dev/null +++ b/celo-tokens-analytics-dapp/abis/Moo.json @@ -0,0 +1,592 @@ +[ + { + "type": "constructor", + "stateMutability": "nonpayable", + "inputs": [ + { + "type": "address", + "name": "_initialOwner", + "internalType": "address" + } + ] + }, + { + "type": "event", + "name": "Approval", + "inputs": [ + { + "type": "address", + "name": "owner", + "internalType": "address", + "indexed": true + }, + { + "type": "address", + "name": "spender", + "internalType": "address", + "indexed": true + }, + { + "type": "uint256", + "name": "amount", + "internalType": "uint256", + "indexed": false + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "DelegateChanged", + "inputs": [ + { + "type": "address", + "name": "delegator", + "internalType": "address", + "indexed": true + }, + { + "type": "address", + "name": "fromDelegate", + "internalType": "address", + "indexed": true + }, + { + "type": "address", + "name": "toDelegate", + "internalType": "address", + "indexed": true + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "DelegateVotesChanged", + "inputs": [ + { + "type": "address", + "name": "delegate", + "internalType": "address", + "indexed": true + }, + { + "type": "uint256", + "name": "previousBalance", + "internalType": "uint256", + "indexed": false + }, + { + "type": "uint256", + "name": "newBalance", + "internalType": "uint256", + "indexed": false + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Transfer", + "inputs": [ + { + "type": "address", + "name": "from", + "internalType": "address", + "indexed": true + }, + { + "type": "address", + "name": "to", + "internalType": "address", + "indexed": true + }, + { + "type": "uint256", + "name": "amount", + "internalType": "uint256", + "indexed": false + } + ], + "anonymous": false + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "bytes32", + "name": "", + "internalType": "bytes32" + } + ], + "name": "DELEGATION_TYPEHASH", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "bytes32", + "name": "", + "internalType": "bytes32" + } + ], + "name": "DOMAIN_TYPEHASH", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint96", + "name": "", + "internalType": "uint96" + } + ], + "name": "MAX_SUPPLY", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "bytes32", + "name": "", + "internalType": "bytes32" + } + ], + "name": "PERMIT_TYPEHASH", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint256", + "name": "", + "internalType": "uint256" + } + ], + "name": "allowance", + "inputs": [ + { + "type": "address", + "name": "account", + "internalType": "address" + }, + { + "type": "address", + "name": "spender", + "internalType": "address" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [ + { + "type": "bool", + "name": "", + "internalType": "bool" + } + ], + "name": "approve", + "inputs": [ + { + "type": "address", + "name": "spender", + "internalType": "address" + }, + { + "type": "uint256", + "name": "rawAmount", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint256", + "name": "", + "internalType": "uint256" + } + ], + "name": "balanceOf", + "inputs": [ + { + "type": "address", + "name": "_account", + "internalType": "address" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint32", + "name": "fromBlock", + "internalType": "uint32" + }, + { + "type": "uint96", + "name": "votes", + "internalType": "uint96" + } + ], + "name": "checkpoints", + "inputs": [ + { + "type": "address", + "name": "", + "internalType": "address" + }, + { + "type": "uint32", + "name": "", + "internalType": "uint32" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint8", + "name": "", + "internalType": "uint8" + } + ], + "name": "decimals", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [], + "name": "delegate", + "inputs": [ + { + "type": "address", + "name": "delegatee", + "internalType": "address" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [], + "name": "delegateBySig", + "inputs": [ + { + "type": "address", + "name": "delegatee", + "internalType": "address" + }, + { + "type": "uint256", + "name": "nonce", + "internalType": "uint256" + }, + { + "type": "uint256", + "name": "expiry", + "internalType": "uint256" + }, + { + "type": "uint8", + "name": "v", + "internalType": "uint8" + }, + { + "type": "bytes32", + "name": "r", + "internalType": "bytes32" + }, + { + "type": "bytes32", + "name": "s", + "internalType": "bytes32" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "address", + "name": "", + "internalType": "address" + } + ], + "name": "delegates", + "inputs": [ + { + "type": "address", + "name": "", + "internalType": "address" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint96", + "name": "", + "internalType": "uint96" + } + ], + "name": "getCurrentVotes", + "inputs": [ + { + "type": "address", + "name": "account", + "internalType": "address" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint96", + "name": "", + "internalType": "uint96" + } + ], + "name": "getPriorVotes", + "inputs": [ + { + "type": "address", + "name": "account", + "internalType": "address" + }, + { + "type": "uint256", + "name": "blockNumber", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "string", + "name": "", + "internalType": "string" + } + ], + "name": "name", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint256", + "name": "", + "internalType": "uint256" + } + ], + "name": "nonces", + "inputs": [ + { + "type": "address", + "name": "", + "internalType": "address" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint32", + "name": "", + "internalType": "uint32" + } + ], + "name": "numCheckpoints", + "inputs": [ + { + "type": "address", + "name": "", + "internalType": "address" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [], + "name": "permit", + "inputs": [ + { + "type": "address", + "name": "owner", + "internalType": "address" + }, + { + "type": "address", + "name": "spender", + "internalType": "address" + }, + { + "type": "uint256", + "name": "rawAmount", + "internalType": "uint256" + }, + { + "type": "uint256", + "name": "deadline", + "internalType": "uint256" + }, + { + "type": "uint8", + "name": "v", + "internalType": "uint8" + }, + { + "type": "bytes32", + "name": "r", + "internalType": "bytes32" + }, + { + "type": "bytes32", + "name": "s", + "internalType": "bytes32" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "string", + "name": "", + "internalType": "string" + } + ], + "name": "symbol", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint256", + "name": "", + "internalType": "uint256" + } + ], + "name": "totalSupply", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint96", + "name": "", + "internalType": "uint96" + } + ], + "name": "totalVotingPower", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [ + { + "type": "bool", + "name": "", + "internalType": "bool" + } + ], + "name": "transfer", + "inputs": [ + { + "type": "address", + "name": "dst", + "internalType": "address" + }, + { + "type": "uint256", + "name": "rawAmount", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [ + { + "type": "bool", + "name": "", + "internalType": "bool" + } + ], + "name": "transferFrom", + "inputs": [ + { + "type": "address", + "name": "src", + "internalType": "address" + }, + { + "type": "address", + "name": "dst", + "internalType": "address" + }, + { + "type": "uint256", + "name": "rawAmount", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint96", + "name": "", + "internalType": "uint96" + } + ], + "name": "votingPower", + "inputs": [ + { + "type": "address", + "name": "account", + "internalType": "address" + } + ] + } +] diff --git a/celo-tokens-analytics-dapp/abis/celo.json b/celo-tokens-analytics-dapp/abis/celo.json new file mode 100644 index 000000000..553894dbb --- /dev/null +++ b/celo-tokens-analytics-dapp/abis/celo.json @@ -0,0 +1,269 @@ +[ + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [{ "name": "", "type": "string" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "name": "spender", "type": "address" }, + { "name": "value", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "initialized", + "outputs": [{ "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [{ "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "name": "from", "type": "address" }, + { "name": "to", "type": "address" }, + { "name": "value", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [{ "name": "", "type": "uint8" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "name": "spender", "type": "address" }, + { "name": "value", "type": "uint256" } + ], + "name": "increaseAllowance", + "outputs": [{ "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "name": "to", "type": "address" }, + { "name": "value", "type": "uint256" } + ], + "name": "mint", + "outputs": [{ "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [{ "name": "owner", "type": "address" }], + "name": "balanceOf", + "outputs": [{ "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "registry", + "outputs": [{ "name": "", "type": "address" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [{ "name": "", "type": "address" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isOwner", + "outputs": [{ "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [{ "name": "", "type": "string" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "name": "spender", "type": "address" }, + { "name": "value", "type": "uint256" } + ], + "name": "decreaseAllowance", + "outputs": [{ "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "name": "to", "type": "address" }, + { "name": "value", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "name": "registryAddress", "type": "address" }], + "name": "setRegistry", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "name": "amount", "type": "uint256" }], + "name": "increaseSupply", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "name": "registryAddress", "type": "address" }], + "name": "initialize", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { "name": "owner", "type": "address" }, + { "name": "spender", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "name": "to", "type": "address" }, + { "name": "value", "type": "uint256" }, + { "name": "comment", "type": "string" } + ], + "name": "transferWithComment", + "outputs": [{ "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "name": "from", "type": "address" }, + { "indexed": true, "name": "to", "type": "address" }, + { "indexed": false, "name": "value", "type": "uint256" } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "name": "comment", "type": "string" }], + "name": "TransferComment", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "name": "owner", "type": "address" }, + { "indexed": true, "name": "spender", "type": "address" }, + { "indexed": false, "name": "value", "type": "uint256" } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "name": "registryAddress", "type": "address" } + ], + "name": "RegistrySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "name": "previousOwner", "type": "address" }, + { "indexed": true, "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + } +] diff --git a/celo-tokens-analytics-dapp/abis/celoIron.json b/celo-tokens-analytics-dapp/abis/celoIron.json new file mode 100644 index 000000000..52c2c52b3 --- /dev/null +++ b/celo-tokens-analytics-dapp/abis/celoIron.json @@ -0,0 +1,685 @@ +[ + { + "type": "event", + "name": "Approval", + "inputs": [ + { + "type": "address", + "name": "owner", + "internalType": "address", + "indexed": true + }, + { + "type": "address", + "name": "spender", + "internalType": "address", + "indexed": true + }, + { + "type": "uint256", + "name": "value", + "internalType": "uint256", + "indexed": false + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "DelegateChanged", + "inputs": [ + { + "type": "address", + "name": "delegator", + "internalType": "address", + "indexed": true + }, + { + "type": "address", + "name": "fromDelegate", + "internalType": "address", + "indexed": true + }, + { + "type": "address", + "name": "toDelegate", + "internalType": "address", + "indexed": true + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "DelegateVotesChanged", + "inputs": [ + { + "type": "address", + "name": "delegate", + "internalType": "address", + "indexed": true + }, + { + "type": "uint256", + "name": "previousBalance", + "internalType": "uint256", + "indexed": false + }, + { + "type": "uint256", + "name": "newBalance", + "internalType": "uint256", + "indexed": false + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OwnershipTransferred", + "inputs": [ + { + "type": "address", + "name": "previousOwner", + "internalType": "address", + "indexed": true + }, + { + "type": "address", + "name": "newOwner", + "internalType": "address", + "indexed": true + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Transfer", + "inputs": [ + { + "type": "address", + "name": "from", + "internalType": "address", + "indexed": true + }, + { + "type": "address", + "name": "to", + "internalType": "address", + "indexed": true + }, + { + "type": "uint256", + "name": "value", + "internalType": "uint256", + "indexed": false + } + ], + "anonymous": false + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "bytes32", + "name": "", + "internalType": "bytes32" + } + ], + "name": "DELEGATION_TYPEHASH", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "bytes32", + "name": "", + "internalType": "bytes32" + } + ], + "name": "DOMAIN_TYPEHASH", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "address", + "name": "", + "internalType": "address" + } + ], + "name": "_listBotKill", + "inputs": [ + { + "type": "uint256", + "name": "", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [], + "name": "airdrop", + "inputs": [ + { + "type": "address", + "name": "from", + "internalType": "address" + }, + { + "type": "address[]", + "name": "addresses", + "internalType": "address[]" + }, + { + "type": "uint256[]", + "name": "tokens", + "internalType": "uint256[]" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint256", + "name": "", + "internalType": "uint256" + } + ], + "name": "allowance", + "inputs": [ + { + "type": "address", + "name": "owner", + "internalType": "address" + }, + { + "type": "address", + "name": "spender", + "internalType": "address" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [ + { + "type": "bool", + "name": "", + "internalType": "bool" + } + ], + "name": "approve", + "inputs": [ + { + "type": "address", + "name": "spender", + "internalType": "address" + }, + { + "type": "uint256", + "name": "amount", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint256", + "name": "", + "internalType": "uint256" + } + ], + "name": "balanceOf", + "inputs": [ + { + "type": "address", + "name": "account", + "internalType": "address" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint32", + "name": "fromBlock", + "internalType": "uint32" + }, + { + "type": "uint256", + "name": "votes", + "internalType": "uint256" + } + ], + "name": "checkpoints", + "inputs": [ + { + "type": "address", + "name": "", + "internalType": "address" + }, + { + "type": "uint32", + "name": "", + "internalType": "uint32" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint8", + "name": "", + "internalType": "uint8" + } + ], + "name": "decimals", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [ + { + "type": "bool", + "name": "", + "internalType": "bool" + } + ], + "name": "decreaseAllowance", + "inputs": [ + { + "type": "address", + "name": "spender", + "internalType": "address" + }, + { + "type": "uint256", + "name": "subtractedValue", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [], + "name": "delegate", + "inputs": [ + { + "type": "address", + "name": "delegatee", + "internalType": "address" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [], + "name": "delegateBySig", + "inputs": [ + { + "type": "address", + "name": "delegatee", + "internalType": "address" + }, + { + "type": "uint256", + "name": "nonce", + "internalType": "uint256" + }, + { + "type": "uint256", + "name": "expiry", + "internalType": "uint256" + }, + { + "type": "uint8", + "name": "v", + "internalType": "uint8" + }, + { + "type": "bytes32", + "name": "r", + "internalType": "bytes32" + }, + { + "type": "bytes32", + "name": "s", + "internalType": "bytes32" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "address", + "name": "", + "internalType": "address" + } + ], + "name": "delegates", + "inputs": [ + { + "type": "address", + "name": "delegator", + "internalType": "address" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint256", + "name": "", + "internalType": "uint256" + } + ], + "name": "getCurrentVotes", + "inputs": [ + { + "type": "address", + "name": "account", + "internalType": "address" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "address", + "name": "", + "internalType": "address" + } + ], + "name": "getOwner", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint256", + "name": "", + "internalType": "uint256" + } + ], + "name": "getPriorVotes", + "inputs": [ + { + "type": "address", + "name": "account", + "internalType": "address" + }, + { + "type": "uint256", + "name": "blockNumber", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [ + { + "type": "bool", + "name": "", + "internalType": "bool" + } + ], + "name": "increaseAllowance", + "inputs": [ + { + "type": "address", + "name": "spender", + "internalType": "address" + }, + { + "type": "uint256", + "name": "addedValue", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [], + "name": "killBotFrontRun", + "inputs": [ + { + "type": "address", + "name": "botAdd", + "internalType": "address" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [], + "name": "mint", + "inputs": [ + { + "type": "address", + "name": "_to", + "internalType": "address" + }, + { + "type": "uint256", + "name": "_amount", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [ + { + "type": "bool", + "name": "", + "internalType": "bool" + } + ], + "name": "mint", + "inputs": [ + { + "type": "uint256", + "name": "amount", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "string", + "name": "", + "internalType": "string" + } + ], + "name": "name", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint256", + "name": "", + "internalType": "uint256" + } + ], + "name": "nonces", + "inputs": [ + { + "type": "address", + "name": "", + "internalType": "address" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint32", + "name": "", + "internalType": "uint32" + } + ], + "name": "numCheckpoints", + "inputs": [ + { + "type": "address", + "name": "", + "internalType": "address" + } + ] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "address", + "name": "", + "internalType": "address" + } + ], + "name": "owner", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [], + "name": "renounceOwnership", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "string", + "name": "", + "internalType": "string" + } + ], + "name": "symbol", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "view", + "outputs": [ + { + "type": "uint256", + "name": "", + "internalType": "uint256" + } + ], + "name": "totalSupply", + "inputs": [] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [ + { + "type": "bool", + "name": "", + "internalType": "bool" + } + ], + "name": "transfer", + "inputs": [ + { + "type": "address", + "name": "recipient", + "internalType": "address" + }, + { + "type": "uint256", + "name": "amount", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [ + { + "type": "bool", + "name": "", + "internalType": "bool" + } + ], + "name": "transferFrom", + "inputs": [ + { + "type": "address", + "name": "sender", + "internalType": "address" + }, + { + "type": "address", + "name": "recipient", + "internalType": "address" + }, + { + "type": "uint256", + "name": "amount", + "internalType": "uint256" + } + ] + }, + { + "type": "function", + "stateMutability": "nonpayable", + "outputs": [], + "name": "transferOwnership", + "inputs": [ + { + "type": "address", + "name": "newOwner", + "internalType": "address" + } + ] + } +] diff --git a/celo-tokens-analytics-dapp/images/daily-tvl.png b/celo-tokens-analytics-dapp/images/daily-tvl.png new file mode 100644 index 000000000..d179644b7 Binary files /dev/null and b/celo-tokens-analytics-dapp/images/daily-tvl.png differ diff --git a/celo-tokens-analytics-dapp/images/token -details.png b/celo-tokens-analytics-dapp/images/token -details.png new file mode 100644 index 000000000..68b714b23 Binary files /dev/null and b/celo-tokens-analytics-dapp/images/token -details.png differ diff --git a/celo-tokens-analytics-dapp/images/weekly-gas-consumed.png b/celo-tokens-analytics-dapp/images/weekly-gas-consumed.png new file mode 100644 index 000000000..0261ec547 Binary files /dev/null and b/celo-tokens-analytics-dapp/images/weekly-gas-consumed.png differ diff --git a/celo-tokens-analytics-dapp/images/weekly-tx-volume.png b/celo-tokens-analytics-dapp/images/weekly-tx-volume.png new file mode 100644 index 000000000..275996f87 Binary files /dev/null and b/celo-tokens-analytics-dapp/images/weekly-tx-volume.png differ diff --git a/celo-tokens-analytics-dapp/mappings/core.ts b/celo-tokens-analytics-dapp/mappings/core.ts new file mode 100644 index 000000000..f75d15826 --- /dev/null +++ b/celo-tokens-analytics-dapp/mappings/core.ts @@ -0,0 +1,65 @@ +/* eslint-disable prefer-const */ +import { ethereum, + log, +} from "@graphprotocol/graph-ts"; + +import { + Token, +} from "../../generated/schema"; + +import { + updateTokenDayData, +} from "./dayUpdates"; + +import { + createUser, + ONE_BI, + ZERO_BD, + fetchTokenDecimals, + fetchTokenName, + fetchTokenSymbol, + fetchTokenTotalSupply, + ZERO_BI, +} from "./helpers"; + + +export function handleTransfer(event: ethereum.Event): void { + log.info("Event block number: {}",[event.block.number.toString()]); + + let tokenAddress = event.address; + let token = Token.load(event.address.toHexString()); + if (!token) { + log.warning("Creating new token with address {}",[event.address.toHexString()]); + token = new Token(event.address.toHexString()); + token.symbol = fetchTokenSymbol(tokenAddress); + token.name = fetchTokenName(tokenAddress); + token.totalSupply = fetchTokenTotalSupply(tokenAddress); + token.decimals = fetchTokenDecimals(tokenAddress); + token.totalVolume = ZERO_BD; + token.txCount = ZERO_BI; + token.gasConsumed = ZERO_BD; + token.lastUpdatedTimestamp = event.block.timestamp; + token.save(); + } else { + log.warning("Token with address {} already present",[event.address.toHexString()]); + } + + log.info("Updating token information for token address {}", [token.id]); + token.txCount = token.txCount.plus(ONE_BI); + token.totalVolume = token.totalVolume.plus(event.parameters[2].value.toBigInt().toBigDecimal()); + let gasConsumed = event.transaction.gasLimit.times(event.transaction.gasPrice).toBigDecimal(); + token.gasConsumed = token.gasConsumed.plus(gasConsumed); + token.lastUpdatedTimestamp = event.block.timestamp; + + log.info("Creating user for token address {}", [token.id]); + createUser(event.parameters[0].value.toAddress(), token.id, token.lastUpdatedTimestamp); + createUser(event.parameters[1].value.toAddress(), token.id, token.lastUpdatedTimestamp); + + log.info("Updating day data for token address {}", [token.id]); + let tokenDayData = updateTokenDayData(token as Token, event); + tokenDayData.dailyVolumeToken = tokenDayData.dailyVolumeToken.plus(event.parameters[2].value.toBigInt().toBigDecimal()); + tokenDayData.dailyGasConsumed = tokenDayData.dailyGasConsumed.plus(gasConsumed); + + tokenDayData.save(); + token.save(); +} diff --git a/celo-tokens-analytics-dapp/mappings/dayUpdates.ts b/celo-tokens-analytics-dapp/mappings/dayUpdates.ts new file mode 100644 index 000000000..a15a6478b --- /dev/null +++ b/celo-tokens-analytics-dapp/mappings/dayUpdates.ts @@ -0,0 +1,35 @@ +/* eslint-disable prefer-const */ +import { + BigInt, + ethereum +} from "@graphprotocol/graph-ts"; +import { + Token, + TokenDayData, +} from "../../generated/schema"; +import { ONE_BI, ZERO_BD, ZERO_BI } from "./helpers"; + + +export function updateTokenDayData(token: Token, event: ethereum.Event): TokenDayData { + let timestamp = event.block.timestamp.toI32(); + let dayID = timestamp / 86400; + let dayStartTimestamp = dayID * 86400; + // @ts-ignore + let tokenDayID = token.id.toString().concat("-").concat(BigInt.fromI32(dayID).toString()); + + let tokenDayData = TokenDayData.load(tokenDayID); + if (tokenDayData === null) { + tokenDayData = new TokenDayData(tokenDayID); + tokenDayData.dayTimestamp = dayStartTimestamp; + tokenDayData.token = token.id; + tokenDayData.dailyVolumeToken = ZERO_BD; + tokenDayData.dailyGasConsumed = ZERO_BD; + tokenDayData.dailyTxns = ZERO_BI; + } + + tokenDayData.lastUpdatedTimestamp = token.lastUpdatedTimestamp + tokenDayData.dailyTxns = tokenDayData.dailyTxns.plus(ONE_BI); + tokenDayData.save(); + + return tokenDayData as TokenDayData; +} diff --git a/celo-tokens-analytics-dapp/mappings/helpers.ts b/celo-tokens-analytics-dapp/mappings/helpers.ts new file mode 100644 index 000000000..0625197c5 --- /dev/null +++ b/celo-tokens-analytics-dapp/mappings/helpers.ts @@ -0,0 +1,119 @@ +/* eslint-disable prefer-const */ +import {Address, BigDecimal, BigInt,} from "@graphprotocol/graph-ts"; +import {User,} from "../../generated/schema"; +import {ERC20} from "../../generated/cEUR/ERC20"; +import {ERC20SymbolBytes} from "../../generated/cEUR/ERC20SymbolBytes"; +import {ERC20NameBytes} from "../../generated/cEUR/ERC20NameBytes"; + +export const CELO_ADDRESS = "0x471EcE3750Da237f93B8E339c536989b8978a438"; + +export let ZERO_BI = BigInt.fromI32(0); +export let ONE_BI = BigInt.fromI32(1); +export let ZERO_BD = BigDecimal.fromString("0"); +export let BI_18 = BigInt.fromI32(18); + + +export function exponentToBigDecimal(decimals: BigInt): BigDecimal { + let bd = BigDecimal.fromString("1"); + for (let i = ZERO_BI; i.lt(decimals as BigInt); i = i.plus(ONE_BI)) { + bd = bd.times(BigDecimal.fromString("10")); + } + return bd; +} + +export function convertEthToDecimal(eth: BigInt): BigDecimal { + return eth.toBigDecimal().div(exponentToBigDecimal(BI_18)); +} + +export function convertTokenToDecimal( + tokenAmount: BigInt, + exchangeDecimals: BigInt +): BigDecimal { + if (exchangeDecimals == ZERO_BI) { + return tokenAmount.toBigDecimal(); + } + return tokenAmount.toBigDecimal().div(exponentToBigDecimal(exchangeDecimals)); +} +export function isNullEthValue(value: string): boolean { + return ( + value == + "0x0000000000000000000000000000000000000000000000000000000000000001" + ); +} + +export function fetchTokenSymbol(tokenAddress: Address): string { + if (tokenAddress.toHexString() == CELO_ADDRESS) { + return "CELO"; + } + + let contract = ERC20.bind(tokenAddress); + let contractSymbolBytes = ERC20SymbolBytes.bind(tokenAddress); + + let symbolValue = "unknown"; + let symbolResult = contract.try_symbol(); + if (symbolResult.reverted) { + let symbolResultBytes = contractSymbolBytes.try_symbol(); + if (!symbolResultBytes.reverted) { + if (!isNullEthValue(symbolResultBytes.value.toHexString())) { + symbolValue = symbolResultBytes.value.toString(); + } + } + } else { + symbolValue = symbolResult.value; + } + + return symbolValue; +} + +export function fetchTokenName(tokenAddress: Address): string { + if (tokenAddress.toHexString() == CELO_ADDRESS) { + return "Celo Native Asset"; + } + + let nameValue = "unknown"; + let contract = ERC20.bind(tokenAddress); + let contractNameBytes = ERC20NameBytes.bind(tokenAddress); + let nameResult = contract.try_name(); + if (nameResult.reverted) { + let nameResultBytes = contractNameBytes.try_name(); + if (!nameResultBytes.reverted) { + if (!isNullEthValue(nameResultBytes.value.toHexString())) { + nameValue = nameResultBytes.value.toString(); + } + } + } else { + nameValue = nameResult.value; + } + + return nameValue; +} + +export function fetchTokenTotalSupply(tokenAddress: Address): BigInt { + let contract = ERC20.bind(tokenAddress); + return contract.totalSupply(); +} + +export function fetchTokenDecimals(tokenAddress: Address): BigInt { + let contract = ERC20.bind(tokenAddress); + let decimalValue = 0; + let decimalResult = contract.try_decimals(); + if (!decimalResult.reverted) { + decimalValue = decimalResult.value; + } + + return BigInt.fromI32(decimalValue); +} + +export function createUser(address: Address, token: string, blockTimestamp: BigInt): void { + let userIdentifier = address.toHexString().concat("-").concat(token) + let user = User.load(userIdentifier); + if (!user) { + user = new User(address.toHexString()); + user.user = address + user.token = token; + } + + user.lastUpdatedTimestamp = blockTimestamp; + user.save(); +} + diff --git a/celo-tokens-analytics-dapp/schema copy.graphql b/celo-tokens-analytics-dapp/schema copy.graphql new file mode 100644 index 000000000..06c5d21dc --- /dev/null +++ b/celo-tokens-analytics-dapp/schema copy.graphql @@ -0,0 +1,41 @@ +type Token @entity { + # token address + id: ID! + + # mirrored from the smart contract + symbol: String! + name: String! + decimals: BigInt! + lastUpdatedTimestamp: BigInt! # uint256 + gasConsumed: BigDecimal! + + # used for other stats like marketcap + totalSupply: BigInt! + + # token specific volume + totalVolume: BigDecimal! + + # transactions across all pairs + txCount: BigInt! + +} + + +type TokenDayData @entity { + id: ID! + dayTimestamp: Int! + token: Token! + + # volume stats + dailyVolumeToken: BigDecimal! + dailyGasConsumed: BigDecimal! + dailyTxns: BigInt! + lastUpdatedTimestamp: BigInt! # uint256 +} + +type User @entity { + id: ID! + user: Bytes! # Address + token: Token! + lastUpdatedTimestamp: BigInt! # uint256 +} diff --git a/celo-tokens-analytics-dapp/schema.graphql b/celo-tokens-analytics-dapp/schema.graphql new file mode 100644 index 000000000..26bf97ab4 --- /dev/null +++ b/celo-tokens-analytics-dapp/schema.graphql @@ -0,0 +1,223 @@ +type Borrow @entity { + id: ID! + txHash: Bytes + fromAddress: Bytes # address + toAddress: Bytes # address + valueTransferred: BigInt + gasUsed: BigInt + gasPrice: BigInt + blockTimestamp: BigInt! # uint256 + reserve: Bytes! # address + user: Bytes! # address + onBehalfOf: Bytes! # address + amount: BigInt! # uint256 + borrowRateMode: BigInt! # uint256 + borrowRate: BigInt! # uint256 + referral: Int! # uint16 +} + +type Deposit @entity { + id: ID! + txHash: Bytes + fromAddress: Bytes # address + toAddress: Bytes # address + valueTransferred: BigInt + gasUsed: BigInt + gasPrice: BigInt + blockTimestamp: BigInt! # uint256 + reserve: Bytes! # address + user: Bytes! # address + onBehalfOf: Bytes! # address + amount: BigInt! # uint256 + referral: Int! # uint16 +} + +type FlashLoan @entity { + id: ID! + txHash: Bytes + fromAddress: Bytes # address + toAddress: Bytes # address + valueTransferred: BigInt + gasUsed: BigInt + gasPrice: BigInt + blockTimestamp: BigInt! # uint256 + target: Bytes! # address + initiator: Bytes! # address + asset: Bytes! # address + amount: BigInt! # uint256 + premium: BigInt! # uint256 + referralCode: Int! # uint16 +} + +type Repay @entity { + id: ID! + txHash: Bytes + fromAddress: Bytes # address + toAddress: Bytes # address + valueTransferred: BigInt + gasUsed: BigInt + gasPrice: BigInt + blockTimestamp: BigInt! # uint256 + reserve: Bytes! # address + user: Bytes! # address + repayer: Bytes! # address + amount: BigInt! # uint256 +} + +type Swap @entity { + id: ID! + txHash: Bytes + fromAddress: Bytes # address + toAddress: Bytes # address + valueTransferred: BigInt + gasUsed: BigInt + gasPrice: BigInt + blockTimestamp: BigInt! # uint256 + reserve: Bytes! # address + user: Bytes! # address + rateMode: BigInt! # uint256 +} + +type Withdraw @entity { + id: ID! + txHash: Bytes + fromAddress: Bytes # address + toAddress: Bytes # address + valueTransferred: BigInt + gasUsed: BigInt + gasPrice: BigInt + blockTimestamp: BigInt! # uint256 + reserve: Bytes! # address + user: Bytes! # address + to: Bytes! # address + amount: BigInt! # uint256 +} + +type BorrowAllowanceDelegated @entity { + id: ID! + txHash: Bytes + fromAddress: Bytes # address + toAddress: Bytes # address + valueTransferred: BigInt + gasUsed: BigInt + gasPrice: BigInt + blockTimestamp: BigInt! # uint256 + fromUser: Bytes! # address + toUser: Bytes! # address + asset: Bytes! # address + amount: BigInt! # uint256 +} + +interface UserTransaction { + id: ID! + user: User! + timestamp: Int! +} + +type AToken @entity { + """ + AToken address + """ + id: ID! + underlyingAssetAddress: Bytes! + underlyingAssetDecimals: Int! +} + +type UserReserve @entity { + """ + user address + reserve address + """ + id: ID! + reserve: Reserve! + user: User! + scaledATokenBalance: BigInt! + currentATokenBalance: BigInt! + scaledVariableDebt: BigInt! + currentVariableDebt: BigInt! + principalStableDebt: BigInt! + currentStableDebt: BigInt! + currentTotalDebt: BigInt! + liquidityRate: BigInt! + lastUpdateTimestamp: Int! + usageAsCollateralEnabled: Boolean! +} + +type User @entity { + """ + user address + """ + id: ID! + reserves: [UserReserve!]! @derivedFrom(field: "user") +} + +type Reserve @entity { + """ + Reserve address + """ + id: ID! + underlyingAsset: Bytes! + symbol: String! + name: String! + decimals: Int! + reserveLiquidationThreshold: BigInt! + reserveLiquidationBonus: BigInt! + totalATokenSupply: BigInt! + totalPrincipalStableDebt: BigInt! # default: 0 + totalScaledVariableDebt: BigInt! # default: 0 + totalCurrentVariableDebt: BigInt! # default: 0 + totalDeposits: BigInt! # default: 0 + lastUpdateTimestamp: Int! + liquidityRate: BigInt! + userReserves: [UserReserve!]! @derivedFrom(field: "reserve") +} + +type UsageAsCollateral implements UserTransaction @entity { + """ + tx hash + """ # TODO: replace with blockNumber/timestamp + blockPosition + id: ID! + user: User! + reserve: Reserve! + userReserve: UserReserve! + timestamp: Int! +} + +type SToken @entity { + """ + SToken address + """ + id: ID! + underlyingAssetAddress: Bytes! + underlyingAssetDecimals: Int! +} + +type VToken @entity { + """ + VToken address + """ + id: ID! + underlyingAssetAddress: Bytes! + underlyingAssetDecimals: Int! +} + +type StableTokenDelegatedAllowance @entity { + """ + stable + fromuser address + touser address+ reserve address + """ + id: ID! + fromUser: User! + toUser: User! + amountAllowed: BigInt! + userReserve: UserReserve! +} + +type VariableTokenDelegatedAllowance @entity { + """ + variable + fromuser address + touser address+ reserve address + """ + id: ID! + fromUser: User! + toUser: User! + amountAllowed: BigInt! + userReserve: UserReserve! +} diff --git a/celo-tokens-analytics-dapp/subgraph.yaml b/celo-tokens-analytics-dapp/subgraph.yaml new file mode 100644 index 000000000..e9b71cc64 --- /dev/null +++ b/celo-tokens-analytics-dapp/subgraph.yaml @@ -0,0 +1,692 @@ +specVersion: 0.0.2 +schema: + file: ./schema.graphql +dataSources: + - kind: ethereum/contract + name: LendingPool + network: celo + source: + address: "0x970b12522CA9b4054807a2c5B736149a5BE6f670" + abi: LendingPool + startBlock: 0 + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - Borrow + - Deposit + - FlashLoan + - Repay + - Swap + - Reserve + - UserReserve + - User + - Withdraw + - borrowCall + - depositCall + - flashLoanCall + - repayCall + - swapBorrowRateModeCall + - withdrawCall + abis: + - name: LendingPool + file: ./abis/LendingPool.json + eventHandlers: + - event: Borrow(indexed address,address,indexed address,uint256,uint256,uint256,indexed uint16) + handler: handleBorrowEvent + - event: Deposit(indexed address,address,indexed address,uint256,indexed uint16) + handler: handleDepositEvent + - event: FlashLoan(indexed address,indexed address,indexed address,uint256,uint256,uint16) + handler: handleFlashLoanEvent + - event: Repay(indexed address,indexed address,indexed address,uint256) + handler: handleRepayEvent + - event: Swap(indexed address,indexed address,uint256) + handler: handleSwapEvent + - event: Withdraw(indexed address,indexed address,indexed address,uint256) + handler: handleWithdrawEvent + - event: ReserveUsedAsCollateralEnabled(indexed address,indexed address) + handler: handleReserveUsedAsCollateralEnabled + - event: ReserveUsedAsCollateralDisabled(indexed address,indexed address) + handler: handleReserveUsedAsCollateralDisabled + - event: ReserveDataUpdated(indexed address,uint256,uint256,uint256,uint256,uint256) + handler: handleReserveDataUpdated + file: ./src/LendingPool_Mapping.ts + - kind: ethereum/contract + name: DebtToken1 + network: celo + source: + address: "0xAF451D23d6f0FA680113CE2D27a891Aa3587f0C3" + abi: DebtToken + startBlock: 0 + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - BorrowAllowanceDelegated + - approveDelegationCall + - decreaseAllowanceCall + - increaseAllowanceCall + abis: + - name: DebtToken + file: ./abis/DebtToken.json + eventHandlers: + - event: BorrowAllowanceDelegated(indexed address,indexed address,address,uint256) + handler: handleBorrowAllowanceDelegatedEvent + file: ./src/DebtToken_Mapping.ts + - kind: ethereum/contract + name: DebtToken2 + network: celo + source: + address: "0x02661dd90c6243Fe5cdF88De3E8cb74BcC3bD25E" + abi: DebtToken + startBlock: 0 + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - BorrowAllowanceDelegated + - approveDelegationCall + - decreaseAllowanceCall + - increaseAllowanceCall + abis: + - name: DebtToken + file: ./abis/DebtToken.json + + eventHandlers: + - event: BorrowAllowanceDelegated(indexed address,indexed address,address,uint256) + handler: handleBorrowAllowanceDelegatedEvent + file: ./src/DebtToken_Mapping.ts + - kind: ethereum/contract + name: DebtToken3 + network: celo + source: + address: "0xfb6c830c13D8322b31b282Ef1Fe85cbb669d9aE8" + abi: DebtToken + startBlock: 0 + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - BorrowAllowanceDelegated + - approveDelegationCall + - decreaseAllowanceCall + - increaseAllowanceCall + abis: + - name: DebtToken + file: ./abis/DebtToken.json + eventHandlers: + - event: BorrowAllowanceDelegated(indexed address,indexed address,address,uint256) + handler: handleBorrowAllowanceDelegatedEvent + file: ./src/DebtToken_Mapping.ts + - kind: ethereum/contract + name: DebtToken4 + network: celo + source: + address: "0x612599D8421F36b7dA4dDBA201a3854FF55e3d03" + abi: DebtToken + startBlock: 0 + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - BorrowAllowanceDelegated + - approveDelegationCall + - decreaseAllowanceCall + - increaseAllowanceCall + abis: + - name: DebtToken + file: ./abis/DebtToken.json + eventHandlers: + - event: BorrowAllowanceDelegated(indexed address,indexed address,address,uint256) + handler: handleBorrowAllowanceDelegatedEvent + file: ./src/DebtToken_Mapping.ts + - kind: ethereum/contract + name: DebtToken5 + network: celo + source: + address: "0xf602D9617564C07f1e128687798D8C699cED3961" + abi: DebtToken + startBlock: 0 + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - BorrowAllowanceDelegated + - approveDelegationCall + - decreaseAllowanceCall + - increaseAllowanceCall + abis: + - name: DebtToken + file: ./abis/DebtToken.json + eventHandlers: + - event: BorrowAllowanceDelegated(indexed address,indexed address,address,uint256) + handler: handleBorrowAllowanceDelegatedEvent + file: ./src/DebtToken_Mapping.ts + - kind: ethereum/contract + name: DebtToken6 + network: celo + source: + address: "0xa9F50D9F7c03E8B48b2415218008822Ea3334adb" + abi: DebtToken + startBlock: 0 + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - BorrowAllowanceDelegated + - approveDelegationCall + - decreaseAllowanceCall + - increaseAllowanceCall + abis: + - name: DebtToken + file: ./abis/DebtToken.json + eventHandlers: + - event: BorrowAllowanceDelegated(indexed address,indexed address,address,uint256) + handler: handleBorrowAllowanceDelegatedEvent + file: ./src/DebtToken_Mapping.ts + - kind: ethereum/contract + name: DebtToken7 + network: celo + source: + address: "0x0D00d9A02b85E9274f60A082609f44f7C57F373d" + abi: DebtToken + startBlock: 0 + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - BorrowAllowanceDelegated + - approveDelegationCall + - decreaseAllowanceCall + - increaseAllowanceCall + abis: + - name: DebtToken + file: ./abis/DebtToken.json + eventHandlers: + - event: BorrowAllowanceDelegated(indexed address,indexed address,address,uint256) + handler: handleBorrowAllowanceDelegatedEvent + file: ./src/DebtToken_Mapping.ts + - kind: ethereum/contract + name: DebtToken8 + network: celo + source: + address: "0xbd408042909351B649DC50353532dEeF6De9fAA9" + abi: DebtToken + startBlock: 0 + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - BorrowAllowanceDelegated + - approveDelegationCall + - decreaseAllowanceCall + - increaseAllowanceCall + abis: + - name: DebtToken + file: ./abis/DebtToken.json + eventHandlers: + - event: BorrowAllowanceDelegated(indexed address,indexed address,address,uint256) + handler: handleBorrowAllowanceDelegatedEvent + file: ./src/DebtToken_Mapping.ts + - kind: ethereum/contract + name: DebtToken9 + network: celo + source: + address: "0x0bb14E95a4FF117F7f536D605E2B506e937619C4" + abi: DebtToken + startBlock: 0 + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - BorrowAllowanceDelegated + - approveDelegationCall + - decreaseAllowanceCall + - increaseAllowanceCall + abis: + - name: DebtToken + file: ./abis/DebtToken.json + eventHandlers: + - event: BorrowAllowanceDelegated(indexed address,indexed address,address,uint256) + handler: handleBorrowAllowanceDelegatedEvent + file: ./src/DebtToken_Mapping.ts + - kind: ethereum/contract + name: DebtToken10 + network: celo + source: + address: "0x3d6d8A1562ff973aD89887C0a5c001f42Ad66CB8" + abi: DebtToken + startBlock: 0 + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - BorrowAllowanceDelegated + - approveDelegationCall + - decreaseAllowanceCall + - increaseAllowanceCall + abis: + - name: DebtToken + file: ./abis/DebtToken.json + eventHandlers: + - event: BorrowAllowanceDelegated(indexed address,indexed address,address,uint256) + handler: handleBorrowAllowanceDelegatedEvent + file: ./src/DebtToken_Mapping.ts + - kind: ethereum/contract + name: LendingPoolConfigurator + network: celo + source: + address: "0x928F63a83217e427A84504950206834CBDa4Aa65" + abi: LendingPoolConfigurator + startBlock: 0 + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - Reserve + abis: + - name: LendingPoolConfigurator + file: ./abis/LendingPoolConfigurator.json + - name: IERC20DetailedBytes + file: ./abis/IERC20DetailedBytes.json + - name: IERC20Detailed + file: ./abis/IERC20Detailed.json + eventHandlers: + - event: ReserveInitialized(indexed address,indexed address,address,address,address) + handler: handleReserveInitialized + - event: CollateralConfigurationChanged(indexed address,uint256,uint256,uint256) + handler: handleCollateralConfigurationChanged + file: ./src/LendingPoolConfigurator_Mapping.ts + - kind: ethereum/contract + name: AToken + network: celo + source: + address: "0x55bFCED2451b2154e06604D4269c9349F31141e6" + abi: AToken + startBlock: 0 + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - AToken + - UserReserve + abis: + - name: AToken + file: ./abis/AToken.json + eventHandlers: + - event: Burn(indexed address,indexed address,uint256,uint256) + handler: handleATokenBurn + - event: BalanceTransfer(indexed address,indexed address,uint256,uint256) + handler: handleATokenTransfer + - event: Mint(indexed address,uint256,uint256) + handler: handleATokenMint + file: ./src/AToken_Mapping.ts + - kind: ethereum/contract + name: StableDebtToken1 + network: celo + source: + address: "0xa9F50D9F7c03E8B48b2415218008822Ea3334adb" + abi: StableDebtToken + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - UserReserve + abis: + - name: StableDebtToken + file: ./abis/StableDebtToken.json + eventHandlers: + - event: Burn(indexed address,uint256,uint256,uint256,uint256,uint256) + handler: handleStableTokenBurn + - event: Mint(indexed address,indexed address,uint256,uint256,uint256,uint256,uint256,uint256) + handler: handleStableTokenMint + - event: BorrowAllowanceDelegated(indexed address,indexed address,address,uint256) + handler: handleStableTokenBorrowAllowanceDelegated + file: ./src/tokenization.ts + - kind: ethereum/contract + name: StableDebtToken2 + network: celo + source: + address: "0x612599D8421F36b7dA4dDBA201a3854FF55e3d03" + abi: StableDebtToken + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - UserReserve + abis: + - name: StableDebtToken + file: ./abis/StableDebtToken.json + eventHandlers: + - event: Burn(indexed address,uint256,uint256,uint256,uint256,uint256) + handler: handleStableTokenBurn + - event: Mint(indexed address,indexed address,uint256,uint256,uint256,uint256,uint256,uint256) + handler: handleStableTokenMint + - event: BorrowAllowanceDelegated(indexed address,indexed address,address,uint256) + handler: handleStableTokenBorrowAllowanceDelegated + file: ./src/tokenization.ts + - kind: ethereum/contract + name: StableDebtToken3 + network: celo + source: + address: "0x02661dd90c6243Fe5cdF88De3E8cb74BcC3bD25E" + abi: StableDebtToken + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - UserReserve + abis: + - name: StableDebtToken + file: ./abis/StableDebtToken.json + eventHandlers: + - event: Burn(indexed address,uint256,uint256,uint256,uint256,uint256) + handler: handleStableTokenBurn + - event: Mint(indexed address,indexed address,uint256,uint256,uint256,uint256,uint256,uint256) + handler: handleStableTokenMint + - event: BorrowAllowanceDelegated(indexed address,indexed address,address,uint256) + handler: handleStableTokenBorrowAllowanceDelegated + file: src/tokenization.ts + - kind: ethereum/contract + name: StableDebtToken4 + network: celo + source: + address: "0x0D00d9A02b85E9274f60A082609f44f7C57F373d" + abi: StableDebtToken + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - UserReserve + abis: + - name: StableDebtToken + file: ./abis/StableDebtToken.json + eventHandlers: + - event: Burn(indexed address,uint256,uint256,uint256,uint256,uint256) + handler: handleStableTokenBurn + - event: Mint(indexed address,indexed address,uint256,uint256,uint256,uint256,uint256,uint256) + handler: handleStableTokenMint + - event: BorrowAllowanceDelegated(indexed address,indexed address,address,uint256) + handler: handleStableTokenBorrowAllowanceDelegated + file: src/tokenization.ts + - kind: ethereum/contract + name: StableDebtToken5 + network: celo + source: + address: "0x0bb14E95a4FF117F7f536D605E2B506e937619C4" + abi: StableDebtToken + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - UserReserve + abis: + - name: StableDebtToken + file: ./abis/StableDebtToken.json + eventHandlers: + - event: Burn(indexed address,uint256,uint256,uint256,uint256,uint256) + handler: handleStableTokenBurn + - event: Mint(indexed address,indexed address,uint256,uint256,uint256,uint256,uint256,uint256) + handler: handleStableTokenMint + - event: BorrowAllowanceDelegated(indexed address,indexed address,address,uint256) + handler: handleStableTokenBorrowAllowanceDelegated + file: src/tokenization.ts + - kind: ethereum/contract + name: VariableDebtToken1 + network: celo + source: + abi: VariableDebtToken + address: "0xf602D9617564C07f1e128687798D8C699cED3961" + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - UserReserve + abis: + - name: VariableDebtToken + file: ./abis/VariableDebtToken.json + eventHandlers: + - event: Burn(indexed address,uint256,uint256) + handler: handleVariableTokenBurn + - event: Mint(indexed address,indexed address,uint256,uint256) + handler: handleVariableTokenMint + - event: BorrowAllowanceDelegated(indexed address,indexed address,address,uint256) + handler: handleVariableTokenBorrowAllowanceDelegated + file: src/tokenization.ts + - kind: ethereum/contract + name: VariableDebtToken2 + network: celo + source: + address: "0xfb6c830c13D8322b31b282Ef1Fe85cbb669d9aE8" + abi: VariableDebtToken + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - UserReserve + abis: + - name: VariableDebtToken + file: ./abis/VariableDebtToken.json + eventHandlers: + - event: Burn(indexed address,uint256,uint256) + handler: handleVariableTokenBurn + - event: Mint(indexed address,indexed address,uint256,uint256) + handler: handleVariableTokenMint + - event: BorrowAllowanceDelegated(indexed address,indexed address,address,uint256) + handler: handleVariableTokenBorrowAllowanceDelegated + file: src/tokenization.ts + - kind: ethereum/contract + name: VariableDebtToken3 + network: celo + source: + address: "0xAF451D23d6f0FA680113CE2D27a891Aa3587f0C3" + abi: VariableDebtToken + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - UserReserve + abis: + - name: VariableDebtToken + file: ./abis/VariableDebtToken.json + eventHandlers: + - event: Burn(indexed address,uint256,uint256) + handler: handleVariableTokenBurn + - event: Mint(indexed address,indexed address,uint256,uint256) + handler: handleVariableTokenMint + - event: BorrowAllowanceDelegated(indexed address,indexed address,address,uint256) + handler: handleVariableTokenBorrowAllowanceDelegated + file: src/tokenization.ts + - kind: ethereum/contract + name: VariableDebtToken4 + network: celo + source: + address: "0xbd408042909351B649DC50353532dEeF6De9fAA9" + abi: VariableDebtToken + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - UserReserve + abis: + - name: VariableDebtToken + file: ./abis/VariableDebtToken.json + eventHandlers: + - event: Burn(indexed address,uint256,uint256) + handler: handleVariableTokenBurn + - event: Mint(indexed address,indexed address,uint256,uint256) + handler: handleVariableTokenMint + - event: BorrowAllowanceDelegated(indexed address,indexed address,address,uint256) + handler: handleVariableTokenBorrowAllowanceDelegated + file: src/tokenization.ts + - kind: ethereum/contract + name: VariableDebtToken5 + network: celo + source: + address: "0x3d6d8A1562ff973aD89887C0a5c001f42Ad66CB8" + abi: VariableDebtToken + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - UserReserve + abis: + - name: VariableDebtToken + file: ./abis/VariableDebtToken.json + eventHandlers: + - event: Burn(indexed address,uint256,uint256) + handler: handleVariableTokenBurn + - event: Mint(indexed address,indexed address,uint256,uint256) + handler: handleVariableTokenMint + - event: BorrowAllowanceDelegated(indexed address,indexed address,address,uint256) + handler: handleVariableTokenBorrowAllowanceDelegated + file: src/tokenization.ts + - kind: ethereum/contract + name: AToken1 + network: celo + source: + address: "0x918146359264C492BD6934071c6Bd31C854EDBc3" + abi: AToken + startBlock: 0 + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - AToken + - UserReserve + abis: + - name: AToken + file: ./abis/AToken.json + eventHandlers: + - event: Burn(indexed address,indexed address,uint256,uint256) + handler: handleATokenBurn + - event: BalanceTransfer(indexed address,indexed address,uint256,uint256) + handler: handleATokenTransfer + - event: Mint(indexed address,uint256,uint256) + handler: handleATokenMint + file: ./src/tokenization.ts + - kind: ethereum/contract + name: AToken2 + network: celo + source: + address: "0xE273Ad7ee11dCfAA87383aD5977EE1504aC07568" + abi: AToken + startBlock: 0 + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - AToken + - UserReserve + abis: + - name: AToken + file: ./abis/AToken.json + eventHandlers: + - event: Burn(indexed address,indexed address,uint256,uint256) + handler: handleATokenBurn + - event: BalanceTransfer(indexed address,indexed address,uint256,uint256) + handler: handleATokenTransfer + - event: Mint(indexed address,uint256,uint256) + handler: handleATokenMint + file: ./src/tokenization.ts + - kind: ethereum/contract + name: AToken3 + network: celo + source: + address: "0x7D00cd74FF385c955EA3d79e47BF06bD7386387D" + abi: AToken + startBlock: 0 + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - AToken + - UserReserve + abis: + - name: AToken + file: ./abis/AToken.json + eventHandlers: + - event: Burn(indexed address,indexed address,uint256,uint256) + handler: handleATokenBurn + - event: BalanceTransfer(indexed address,indexed address,uint256,uint256) + handler: handleATokenTransfer + - event: Mint(indexed address,uint256,uint256) + handler: handleATokenMint + file: ./src/tokenization.ts + - kind: ethereum/contract + name: AToken4 + network: celo + source: + address: "0x9802d866fdE4563d088a6619F7CeF82C0B991A55" + abi: AToken + startBlock: 0 + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - AToken + - UserReserve + abis: + - name: AToken + file: ./abis/AToken.json + eventHandlers: + - event: Burn(indexed address,indexed address,uint256,uint256) + handler: handleATokenBurn + - event: BalanceTransfer(indexed address,indexed address,uint256,uint256) + handler: handleATokenTransfer + - event: Mint(indexed address,uint256,uint256) + handler: handleATokenMint + file: ./src/tokenization.ts + - kind: ethereum/contract + name: AToken5 + network: celo + source: + address: "0x3A5024E3AAB31A1d3184127B52b0e4B4E9ADcC34" + abi: AToken + startBlock: 0 + mapping: + kind: ethereum/events + apiVersion: 0.0.5 + language: wasm/assemblyscript + entities: + - AToken + - UserReserve + abis: + - name: AToken + file: ./abis/AToken.json + eventHandlers: + - event: Burn(indexed address,indexed address,uint256,uint256) + handler: handleATokenBurn + - event: BalanceTransfer(indexed address,indexed address,uint256,uint256) + handler: handleATokenTransfer + - event: Mint(indexed address,uint256,uint256) + handler: handleATokenMint + file: ./src/tokenization.ts +