├── deploy.sh ├── src ├── mappings │ ├── stargateBridge │ │ ├── update.ts │ │ └── index.ts │ ├── wooCrossChainRouter │ │ └── update.ts │ ├── wooTokenOFT │ │ └── index.ts │ ├── wooVaultManager │ │ └── index.ts │ └── wooRouter │ │ ├── index.ts │ │ └── update.ts ├── utils.ts ├── update.ts ├── helpers.ts ├── constants.ts └── multichain │ ├── monad.ts │ ├── hyperevm.ts │ ├── berachain.ts │ ├── sonic.ts │ ├── polygon-zkevm.ts │ ├── ethereum.ts │ ├── zksync.ts │ ├── fantom.ts │ ├── linea.ts │ ├── mantle.ts │ ├── base.ts │ ├── optimism.ts │ ├── arbitrum.ts │ ├── polygon.ts │ └── avax.ts ├── README.md ├── LICENSE ├── subgraphs ├── monad.yaml ├── hyperevm.yaml ├── berachain.yaml ├── polygon-zkevm.yaml ├── sonic.yaml ├── zksync.yaml ├── ethereum.yaml └── mantle.yaml ├── .gitignore └── abis ├── WooVaultManagerV1_1.json ├── WooRouterV2_1.json ├── WooRouterV1_1.json ├── WooRouterV1_2.json ├── WooCrossChainRouterV1_1.json ├── ERC20.json ├── StargateBridgeV1_1.json ├── WooPPV2_1.json └── WooCrossChainRouterV4_1.json /deploy.sh: -------------------------------------------------------------------------------- 1 | networks="bsc avax fantom polygon arbitrum optimism ethereum"; 2 | 3 | for network in $networks; 4 | do 5 | npm run codegen_${network}; 6 | # npm run build_${network}; 7 | # npm run deploy_${network}_production; 8 | # npm run deploy_${network}_staging; 9 | npm run deploy_${network}_testing; 10 | done 11 | -------------------------------------------------------------------------------- /src/mappings/stargateBridge/update.ts: -------------------------------------------------------------------------------- 1 | import { ethereum, BigInt } from "@graphprotocol/graph-ts"; 2 | import { createStargateBridgeSendMsg } from "../../create"; 3 | 4 | export function updateStargateBridgeSendMsg(event: ethereum.Event, msgType: i32, nonce: BigInt): void { 5 | let stargateBridgeSendMsg = createStargateBridgeSendMsg(event); 6 | stargateBridgeSendMsg.msgType = msgType; 7 | stargateBridgeSendMsg.nonce = nonce; 8 | stargateBridgeSendMsg.updatedAt = event.block.timestamp; 9 | 10 | stargateBridgeSendMsg.save(); 11 | } 12 | -------------------------------------------------------------------------------- /src/mappings/stargateBridge/index.ts: -------------------------------------------------------------------------------- 1 | import { ethereum, BigInt } from "@graphprotocol/graph-ts"; 2 | import { SendMsg as StargateBridgeV1SendMsg_1 } from "../../../generated/StargateBridgeV1_1/StargateBridgeV1"; 3 | import { updateStargateBridgeSendMsg } from "./update"; 4 | 5 | export function handleStargateBridgeV1SendMsg_1(event: StargateBridgeV1SendMsg_1): void { 6 | handleSendMsg(event, event.params.msgType, event.params.nonce); 7 | } 8 | 9 | export function handleSendMsg(event: ethereum.Event, msgType: i32, nonce: BigInt): void { 10 | updateStargateBridgeSendMsg(event, msgType, nonce); 11 | } 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | WOOFi Subgraph 2 | ====================== 3 | 4 | ### Dependencies install 5 | ```shell 6 | npm install 7 | ``` 8 | 9 | ### Deploy 10 | ```shell 11 | graph auth --product hosted-service 12 | npm run codegen_ && npm run deploy__production 13 | ``` 14 | 15 | ### Endpoints 16 | - bsc : https://api.thegraph.com/subgraphs/name/woonetwork/woofi-bsc 17 | - avax: https://api.thegraph.com/subgraphs/name/woonetwork/woofi-avax 18 | - fantom: https://api.thegraph.com/subgraphs/name/woonetwork/woofi-fantom 19 | - polygon: https://api.thegraph.com/subgraphs/name/woonetwork/woofi-polygon 20 | - arbitrum: https://api.thegraph.com/subgraphs/name/woonetwork/woofi-arbitrum 21 | - optimism: https://api.thegraph.com/subgraphs/name/woonetwork/woofi-optimism 22 | - ethereum: https://api.thegraph.com/subgraphs/name/woonetwork/woofi-ethereum 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | Copyright (c) 2021 WooTrade 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. 21 | -------------------------------------------------------------------------------- /src/mappings/wooCrossChainRouter/update.ts: -------------------------------------------------------------------------------- 1 | import { ethereum } from "@graphprotocol/graph-ts"; 2 | import { 3 | createCrossChainSrcOrderHistoryVariable, 4 | createCrossChainDstOrderHistoryVariable, 5 | } from "../../create"; 6 | import { BI_1 } from "../../constants"; 7 | 8 | export function updateCrossChainSrcOrderHistoryVariable(event: ethereum.Event): void { 9 | let crossChainSrcOrderHistoryVariable = createCrossChainSrcOrderHistoryVariable(event); 10 | 11 | crossChainSrcOrderHistoryVariable.txns = crossChainSrcOrderHistoryVariable.txns.plus(BI_1); 12 | crossChainSrcOrderHistoryVariable.updatedAt = event.block.timestamp; 13 | 14 | crossChainSrcOrderHistoryVariable.save(); 15 | } 16 | 17 | export function updateCrossChainDstOrderHistoryVariable(event: ethereum.Event): void { 18 | let crossChainDstOrderHistoryVariable = createCrossChainDstOrderHistoryVariable(event); 19 | 20 | crossChainDstOrderHistoryVariable.txns = crossChainDstOrderHistoryVariable.txns.plus(BI_1); 21 | crossChainDstOrderHistoryVariable.updatedAt = event.block.timestamp; 22 | 23 | crossChainDstOrderHistoryVariable.save(); 24 | } 25 | -------------------------------------------------------------------------------- /src/utils.ts: -------------------------------------------------------------------------------- 1 | import { BigDecimal, BigInt, Bytes } from "@graphprotocol/graph-ts"; 2 | import { 3 | BI_0, 4 | BI_1, 5 | WOOFI_SOURCES, 6 | REBATE_ADDRESSES, 7 | WOOFI_ORDER_SOURCE_ID, 8 | OTHER_ORDER_SOURCE_ID, 9 | } from "./constants"; 10 | 11 | export function exponentToBigInt(decimals: BigInt): BigInt { 12 | let bi = BigInt.fromString("1"); 13 | for (let i = BI_0; i.lt(decimals as BigInt); i = i.plus(BI_1)) { 14 | bi = bi.times(BigInt.fromString("10")); 15 | } 16 | return bi; 17 | } 18 | 19 | export function exponentToBigDecimal(decimals: BigInt): BigDecimal { 20 | let bi = exponentToBigInt(decimals); 21 | 22 | return bi.toBigDecimal(); 23 | } 24 | 25 | export function getOrderSourceIDForWooPP(transactionTo: string, wooSwapFrom: Bytes, rebateTo: Bytes | null): string { 26 | if (WOOFI_SOURCES.indexOf(transactionTo) !== -1 || rebateTo === null) { 27 | return WOOFI_ORDER_SOURCE_ID; 28 | } 29 | 30 | for (let i = 0; i < REBATE_ADDRESSES.length; i++) { 31 | if (REBATE_ADDRESSES[i].indexOf(rebateTo.toHexString()) !== -1) { 32 | return i.toString(); 33 | } 34 | } 35 | 36 | return OTHER_ORDER_SOURCE_ID; 37 | } 38 | -------------------------------------------------------------------------------- /src/mappings/wooTokenOFT/index.ts: -------------------------------------------------------------------------------- 1 | import { 2 | OFTReceived as OFTReceivedEvent, 3 | OFTSent as OFTSentEvent, 4 | } from "../../../generated/WooTokenOFT/WooTokenOFT" 5 | import { 6 | OFTReceived, 7 | OFTSent, 8 | } from "../../../generated/schema" 9 | import { Bytes } from "@graphprotocol/graph-ts" 10 | 11 | export function handleOFTReceived(event: OFTReceivedEvent): void { 12 | let entityID = event.transaction.hash.toHexString().concat("-").concat(event.logIndex.toString()); 13 | let entity = new OFTReceived(entityID); 14 | entity.guid = event.params.guid.toHexString(); 15 | entity.srcEid = event.params.srcEid; 16 | entity.toAddress = event.params.toAddress.toHexString(); 17 | entity.amountReceivedLD = event.params.amountReceivedLD; 18 | 19 | entity.blockNumber = event.block.number; 20 | entity.blockTimestamp = event.block.timestamp; 21 | entity.transactionHash = event.transaction.hash.toHexString(); 22 | 23 | entity.save(); 24 | } 25 | 26 | export function handleOFTSent(event: OFTSentEvent): void { 27 | let entityID = event.transaction.hash.toHexString().concat("-").concat(event.logIndex.toString()); 28 | let entity = new OFTSent(entityID); 29 | entity.guid = event.params.guid.toHexString(); 30 | entity.dstEid = event.params.dstEid; 31 | entity.fromAddress = event.params.fromAddress.toHexString(); 32 | entity.amountSentLD = event.params.amountSentLD; 33 | entity.amountReceivedLD = event.params.amountReceivedLD; 34 | 35 | entity.blockNumber = event.block.number; 36 | entity.blockTimestamp = event.block.timestamp; 37 | entity.transactionHash = event.transaction.hash.toHexString(); 38 | 39 | entity.save(); 40 | } 41 | -------------------------------------------------------------------------------- /src/mappings/wooVaultManager/index.ts: -------------------------------------------------------------------------------- 1 | import { ethereum, BigInt } from "@graphprotocol/graph-ts"; 2 | import { RewardDistributed as WooVaultManagerV1RewardDistributed_1 } from "../../../generated/WooVaultManagerV1_1/WooVaultManagerV1"; 3 | import { RewardDistributed as WooVaultManagerV1RewardDistributed_2 } from "../../../generated/WooVaultManagerV1_2/WooVaultManagerV1"; 4 | import { RewardDistributed as WooVaultManagerV1RewardDistributed_3 } from "../../../generated/WooVaultManagerV1_3/WooVaultManagerV1"; 5 | 6 | import { createGlobalVariable, createDayData } from "../../create"; 7 | 8 | export function handleWooVaultManagerV1RewardDistributed_3(event: WooVaultManagerV1RewardDistributed_3): void { 9 | handleRewardDistributed(event, event.params.amount); 10 | } 11 | 12 | export function handleWooVaultManagerV1RewardDistributed_2(event: WooVaultManagerV1RewardDistributed_2): void { 13 | handleRewardDistributed(event, event.params.amount); 14 | } 15 | 16 | export function handleWooVaultManagerV1RewardDistributed_1(event: WooVaultManagerV1RewardDistributed_1): void { 17 | handleRewardDistributed(event, event.params.amount); 18 | } 19 | 20 | export function handleRewardDistributed(event: ethereum.Event, buybackVolume: BigInt): void { 21 | let globalVariable = createGlobalVariable(event); 22 | globalVariable.buybackVolumeWOO = globalVariable.buybackVolumeWOO.plus(buybackVolume); 23 | globalVariable.updatedAt = event.block.timestamp; 24 | 25 | globalVariable.save(); 26 | 27 | let dayData = createDayData(event); 28 | dayData.buybackVolumeWOO = dayData.buybackVolumeWOO.plus(buybackVolume); 29 | dayData.updatedAt = event.block.timestamp; 30 | 31 | dayData.save(); 32 | } 33 | -------------------------------------------------------------------------------- /subgraphs/monad.yaml: -------------------------------------------------------------------------------- 1 | specVersion: 0.0.6 2 | description: fi.woo.org 3 | repository: https://github.com/woonetwork/woofi_subgraph 4 | schema: 5 | file: ./woofi.graphql 6 | dataSources: 7 | - kind: ethereum/contract 8 | name: WooRouterV2_1 9 | network: monad 10 | source: 11 | address: "0x4c4AF8DBc524681930a27b2F1Af5bcC8062E6fB7" 12 | abi: WooRouterV2 13 | startBlock: 38343435 14 | mapping: 15 | kind: ethereum/events 16 | apiVersion: 0.0.7 17 | language: wasm/assemblyscript 18 | entities: 19 | - WooRouterSwap 20 | abis: 21 | - name: WooRouterV2 22 | file: ../abis/WooRouterV2_1.json 23 | - name: ERC20 24 | file: ../abis/ERC20.json 25 | eventHandlers: 26 | - event: WooRouterSwap(uint8,indexed address,indexed address,uint256,uint256,address,indexed address,address) 27 | handler: handleWooRouterV2WooRouterSwap_1 28 | receipt: true 29 | file: ../src/mappings/wooRouter/index.ts 30 | - kind: ethereum/contract 31 | name: WooPPV2_1 32 | network: monad 33 | source: 34 | address: "0x5520385bFcf07Ec87C4c53A7d8d65595Dff69FA4" 35 | abi: WooPPV2 36 | startBlock: 38315208 37 | mapping: 38 | kind: ethereum/events 39 | apiVersion: 0.0.7 40 | language: wasm/assemblyscript 41 | entities: 42 | - WooSwap 43 | abis: 44 | - name: WooPPV2 45 | file: ../abis/WooPPV2_1.json 46 | - name: ERC20 47 | file: ../abis/ERC20.json 48 | eventHandlers: 49 | - event: WooSwap(indexed address,indexed address,uint256,uint256,address,indexed address,address,uint256,uint256) 50 | handler: handleWooPPV2WooSwap_1 51 | receipt: true 52 | file: ../src/mappings/wooPP/index.ts -------------------------------------------------------------------------------- /subgraphs/hyperevm.yaml: -------------------------------------------------------------------------------- 1 | specVersion: 0.0.6 2 | description: fi.woo.org 3 | repository: https://github.com/woonetwork/woofi_subgraph 4 | schema: 5 | file: ./woofi.graphql 6 | dataSources: 7 | - kind: ethereum/contract 8 | name: WooRouterV2_1 9 | network: hyperevm 10 | source: 11 | address: "0x4c4AF8DBc524681930a27b2F1Af5bcC8062E6fB7" 12 | abi: WooRouterV2 13 | startBlock: 7310000 14 | mapping: 15 | kind: ethereum/events 16 | apiVersion: 0.0.7 17 | language: wasm/assemblyscript 18 | entities: 19 | - WooRouterSwap 20 | abis: 21 | - name: WooRouterV2 22 | file: ../abis/WooRouterV2_1.json 23 | - name: ERC20 24 | file: ../abis/ERC20.json 25 | eventHandlers: 26 | - event: WooRouterSwap(uint8,indexed address,indexed address,uint256,uint256,address,indexed address,address) 27 | handler: handleWooRouterV2WooRouterSwap_1 28 | receipt: true 29 | file: ../src/mappings/wooRouter/index.ts 30 | - kind: ethereum/contract 31 | name: WooPPV2_1 32 | network: hyperevm 33 | source: 34 | address: "0x5520385bFcf07Ec87C4c53A7d8d65595Dff69FA4" 35 | abi: WooPPV2 36 | startBlock: 7249062 37 | mapping: 38 | kind: ethereum/events 39 | apiVersion: 0.0.7 40 | language: wasm/assemblyscript 41 | entities: 42 | - WooSwap 43 | abis: 44 | - name: WooPPV2 45 | file: ../abis/WooPPV2_1.json 46 | - name: ERC20 47 | file: ../abis/ERC20.json 48 | eventHandlers: 49 | - event: WooSwap(indexed address,indexed address,uint256,uint256,address,indexed address,address,uint256,uint256) 50 | handler: handleWooPPV2WooSwap_1 51 | receipt: true 52 | file: ../src/mappings/wooPP/index.ts -------------------------------------------------------------------------------- /subgraphs/berachain.yaml: -------------------------------------------------------------------------------- 1 | specVersion: 0.0.6 2 | description: fi.woo.org 3 | repository: https://github.com/woonetwork/woofi_subgraph 4 | schema: 5 | file: ./woofi.graphql 6 | dataSources: 7 | - kind: ethereum/contract 8 | name: WooRouterV2_1 9 | network: berachain 10 | source: 11 | address: "0x4c4AF8DBc524681930a27b2F1Af5bcC8062E6fB7" 12 | abi: WooRouterV2 13 | startBlock: 2496347 14 | mapping: 15 | kind: ethereum/events 16 | apiVersion: 0.0.7 17 | language: wasm/assemblyscript 18 | entities: 19 | - WooRouterSwap 20 | abis: 21 | - name: WooRouterV2 22 | file: ../abis/WooRouterV2_1.json 23 | - name: ERC20 24 | file: ../abis/ERC20.json 25 | eventHandlers: 26 | - event: WooRouterSwap(uint8,indexed address,indexed address,uint256,uint256,address,indexed address,address) 27 | handler: handleWooRouterV2WooRouterSwap_1 28 | receipt: true 29 | file: ../src/mappings/wooRouter/index.ts 30 | - kind: ethereum/contract 31 | name: WooPPV2_1 32 | network: berachain 33 | source: 34 | address: "0x5520385bFcf07Ec87C4c53A7d8d65595Dff69FA4" 35 | abi: WooPPV2 36 | startBlock: 2495466 37 | mapping: 38 | kind: ethereum/events 39 | apiVersion: 0.0.7 40 | language: wasm/assemblyscript 41 | entities: 42 | - WooSwap 43 | abis: 44 | - name: WooPPV2 45 | file: ../abis/WooPPV2_1.json 46 | - name: ERC20 47 | file: ../abis/ERC20.json 48 | eventHandlers: 49 | - event: WooSwap(indexed address,indexed address,uint256,uint256,address,indexed address,address,uint256,uint256) 50 | handler: handleWooPPV2WooSwap_1 51 | receipt: true 52 | file: ../src/mappings/wooPP/index.ts -------------------------------------------------------------------------------- /subgraphs/polygon-zkevm.yaml: -------------------------------------------------------------------------------- 1 | specVersion: 0.0.6 2 | description: fi.woo.org 3 | repository: https://github.com/woonetwork/woofi_subgraph 4 | schema: 5 | file: ./woofi.graphql 6 | dataSources: 7 | - kind: ethereum/contract 8 | name: WooRouterV2_1 9 | network: polygon-zkevm 10 | source: 11 | address: "0x39d361E66798155813b907A70D6c2e3FdaFB0877" 12 | abi: WooRouterV2 13 | startBlock: 1240010 14 | mapping: 15 | kind: ethereum/events 16 | apiVersion: 0.0.7 17 | language: wasm/assemblyscript 18 | entities: 19 | - WooRouterSwap 20 | abis: 21 | - name: WooRouterV2 22 | file: ../abis/WooRouterV2_1.json 23 | - name: ERC20 24 | file: ../abis/ERC20.json 25 | eventHandlers: 26 | - event: WooRouterSwap(uint8,indexed address,indexed address,uint256,uint256,address,indexed address,address) 27 | handler: handleWooRouterV2WooRouterSwap_1 28 | receipt: true 29 | file: ../src/mappings/wooRouter/index.ts 30 | - kind: ethereum/contract 31 | name: WooPPV2_1 32 | network: polygon-zkevm 33 | source: 34 | address: "0xF5d215d9C84778F85746D15762DaF39B9E83a2d6" 35 | abi: WooPPV2 36 | startBlock: 1239964 37 | mapping: 38 | kind: ethereum/events 39 | apiVersion: 0.0.7 40 | language: wasm/assemblyscript 41 | entities: 42 | - WooSwap 43 | abis: 44 | - name: WooPPV2 45 | file: ../abis/WooPPV2_1.json 46 | - name: ERC20 47 | file: ../abis/ERC20.json 48 | eventHandlers: 49 | - event: WooSwap(indexed address,indexed address,uint256,uint256,address,indexed address,address,uint256,uint256) 50 | handler: handleWooPPV2WooSwap_1 51 | receipt: true 52 | file: ../src/mappings/wooPP/index.ts -------------------------------------------------------------------------------- /src/update.ts: -------------------------------------------------------------------------------- 1 | import { ethereum, Address, Bytes, BigInt } from "@graphprotocol/graph-ts"; 2 | import { exponentToBigInt } from "./utils"; 3 | import { createToken } from "./create"; 4 | import { 5 | BI_0, 6 | BI_2, 7 | ETHER, 8 | WRAPPED, 9 | STABLE_TOKENS, 10 | } from "./constants"; 11 | 12 | export function updateNativeTokenPrice(event: ethereum.Event, lastTradePrice: BigInt): void { 13 | let nativeToken = createToken(event, Address.fromString(ETHER)); 14 | nativeToken.lastTradePrice = lastTradePrice; 15 | nativeToken.updatedAt = event.block.timestamp; 16 | nativeToken.save(); 17 | } 18 | 19 | export function updateTokenPrice(event: ethereum.Event, fromTokenAddress: Bytes, fromAmount: BigInt, toTokenAddress: Bytes, toAmount: BigInt): void { 20 | let fromToken = createToken(event, fromTokenAddress); 21 | let toToken = createToken(event, toTokenAddress); 22 | 23 | let lastTradePrice: BigInt; 24 | if (STABLE_TOKENS.indexOf(fromTokenAddress.toHexString()) != -1) { // fromToken is Stable Coin 25 | if (toAmount == BI_0) { 26 | return; 27 | } 28 | 29 | lastTradePrice = fromAmount.times(exponentToBigInt(toToken.decimals.times(BI_2))) 30 | .div(exponentToBigInt(fromToken.decimals)).div(toAmount); 31 | toToken.lastTradePrice = lastTradePrice; 32 | toToken.updatedAt = event.block.timestamp; 33 | toToken.save(); 34 | 35 | if (toTokenAddress.toHexString() == WRAPPED) { 36 | updateNativeTokenPrice(event, lastTradePrice); 37 | } 38 | } else if (STABLE_TOKENS.indexOf(toTokenAddress.toHexString()) != -1) { // toToken is Stable Coin 39 | if (fromAmount == BI_0) { 40 | return; 41 | } 42 | 43 | lastTradePrice = toAmount.times(exponentToBigInt(fromToken.decimals.times(BI_2))) 44 | .div(exponentToBigInt(toToken.decimals)).div(fromAmount); 45 | fromToken.lastTradePrice = lastTradePrice; 46 | fromToken.updatedAt = event.block.timestamp; 47 | fromToken.save(); 48 | 49 | if (fromTokenAddress.toHexString() == WRAPPED) { 50 | updateNativeTokenPrice(event, lastTradePrice); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | 106 | # Subgraph deploy files 107 | generated/ 108 | build/ 109 | 110 | # PyCharm files 111 | .idea/ 112 | -------------------------------------------------------------------------------- /subgraphs/sonic.yaml: -------------------------------------------------------------------------------- 1 | specVersion: 0.0.6 2 | description: fi.woo.org 3 | repository: https://github.com/woonetwork/woofi_subgraph 4 | schema: 5 | file: ./woofi.graphql 6 | dataSources: 7 | - kind: ethereum/contract 8 | name: WooRouterV2_1 9 | network: sonic 10 | source: 11 | address: "0x4c4AF8DBc524681930a27b2F1Af5bcC8062E6fB7" 12 | abi: WooRouterV2 13 | startBlock: 1651127 14 | mapping: 15 | kind: ethereum/events 16 | apiVersion: 0.0.7 17 | language: wasm/assemblyscript 18 | entities: 19 | - WooRouterSwap 20 | abis: 21 | - name: WooRouterV2 22 | file: ../abis/WooRouterV2_1.json 23 | - name: ERC20 24 | file: ../abis/ERC20.json 25 | eventHandlers: 26 | - event: WooRouterSwap(uint8,indexed address,indexed address,uint256,uint256,address,indexed address,address) 27 | handler: handleWooRouterV2WooRouterSwap_1 28 | receipt: true 29 | file: ../src/mappings/wooRouter/index.ts 30 | - kind: ethereum/contract 31 | name: WooPPV2_2 32 | network: sonic 33 | source: 34 | address: "0x5520385bFcf07Ec87C4c53A7d8d65595Dff69FA4" 35 | abi: WooPPV2 36 | startBlock: 14653705 37 | mapping: 38 | kind: ethereum/events 39 | apiVersion: 0.0.7 40 | language: wasm/assemblyscript 41 | entities: 42 | - WooSwap 43 | abis: 44 | - name: WooPPV2 45 | file: ../abis/WooPPV2_1.json 46 | - name: ERC20 47 | file: ../abis/ERC20.json 48 | eventHandlers: 49 | - event: WooSwap(indexed address,indexed address,uint256,uint256,address,indexed address,address,uint256,uint256) 50 | handler: handleWooPPV2WooSwap_2 51 | receipt: true 52 | file: ../src/mappings/wooPP/index.ts 53 | - kind: ethereum/contract 54 | name: WooPPV2_1 55 | network: sonic 56 | source: 57 | address: "0xEd9e3f98bBed560e66B89AaC922E29D4596A9642" 58 | abi: WooPPV2 59 | startBlock: 545475 60 | mapping: 61 | kind: ethereum/events 62 | apiVersion: 0.0.7 63 | language: wasm/assemblyscript 64 | entities: 65 | - WooSwap 66 | abis: 67 | - name: WooPPV2 68 | file: ../abis/WooPPV2_1.json 69 | - name: ERC20 70 | file: ../abis/ERC20.json 71 | eventHandlers: 72 | - event: WooSwap(indexed address,indexed address,uint256,uint256,address,indexed address,address,uint256,uint256) 73 | handler: handleWooPPV2WooSwap_1 74 | receipt: true 75 | file: ../src/mappings/wooPP/index.ts 76 | - kind: ethereum 77 | name: WooTokenOFT 78 | network: sonic 79 | source: 80 | address: "0xf3df0a31ec5ea438150987805e841f960b9471b6" 81 | abi: WooTokenOFT 82 | startBlock: 8588442 83 | mapping: 84 | kind: ethereum/events 85 | apiVersion: 0.0.7 86 | language: wasm/assemblyscript 87 | entities: 88 | - OFTReceived 89 | - OFTSent 90 | abis: 91 | - name: WooTokenOFT 92 | file: ../abis/WooTokenOFT.json 93 | eventHandlers: 94 | - event: OFTReceived(indexed bytes32,uint32,indexed address,uint256) 95 | handler: handleOFTReceived 96 | - event: OFTSent(indexed bytes32,uint32,indexed address,uint256,uint256) 97 | handler: handleOFTSent 98 | file: ../src/mappings/wooTokenOFT/index.ts -------------------------------------------------------------------------------- /abis/WooVaultManagerV1_1.json: -------------------------------------------------------------------------------- 1 | [{"inputs":[{"internalType":"address","name":"newQuoteToken","type":"address"},{"internalType":"address","name":"newRewardToken","type":"address"},{"internalType":"address","name":"newAccessManager","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferPrepared","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vaultAddr","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardDistributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vaultAddr","type":"address"},{"indexed":false,"internalType":"uint256","name":"weight","type":"uint256"}],"name":"VaultWeightUpdated","type":"event"},{"inputs":[],"name":"_NEW_OWNER_","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_OWNER_","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"accessManager","outputs":[{"internalType":"contract IWooAccessManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"addReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"allVaults","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"distributeAllReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"initOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pendingAllReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"vaultAddr","type":"address"}],"name":"pendingReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"quoteToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newAccessManager","type":"address"}],"name":"setAccessManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vaultAddr","type":"address"},{"internalType":"uint256","name":"weight","type":"uint256"}],"name":"setVaultWeight","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newWooPP","type":"address"}],"name":"setWooPP","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalWeight","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"vaultWeight","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}] -------------------------------------------------------------------------------- /abis/WooRouterV2_1.json: -------------------------------------------------------------------------------- 1 | [{"inputs":[{"internalType":"address","name":"_weth","type":"address"},{"internalType":"address","name":"_pool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newPool","type":"address"}],"name":"WooPoolChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum IWooRouterV2.SwapType","name":"swapType","type":"uint8"},{"indexed":true,"internalType":"address","name":"fromToken","type":"address"},{"indexed":true,"internalType":"address","name":"toToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"fromAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"address","name":"rebateTo","type":"address"}],"name":"WooRouterSwap","type":"event"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"approveTarget","type":"address"},{"internalType":"address","name":"swapTarget","type":"address"},{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"},{"internalType":"uint256","name":"minToAmount","type":"uint256"},{"internalType":"address payable","name":"to","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"externalSwap","outputs":[{"internalType":"uint256","name":"realToAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"stuckToken","type":"address"}],"name":"inCaseTokenGotStuck","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"}],"name":"querySwap","outputs":[{"internalType":"uint256","name":"toAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"quoteToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newPool","type":"address"}],"name":"setPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bool","name":"whitelisted","type":"bool"}],"name":"setWhitelisted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"},{"internalType":"uint256","name":"minToAmount","type":"uint256"},{"internalType":"address payable","name":"to","type":"address"},{"internalType":"address","name":"rebateTo","type":"address"}],"name":"swap","outputs":[{"internalType":"uint256","name":"realToAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"}],"name":"tryQuerySwap","outputs":[{"internalType":"uint256","name":"toAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wooPool","outputs":[{"internalType":"contract IWooPPV2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}] -------------------------------------------------------------------------------- /src/helpers.ts: -------------------------------------------------------------------------------- 1 | import { ethereum, Address, BigInt, Bytes } from "@graphprotocol/graph-ts"; 2 | import { ERC20 } from "../generated/WooRouterV1_1/ERC20"; 3 | import { BI_0, BI_2, BI_18, ETHER, ETHER_SYMBOL, ETHER_NAME, STABLE_TOKENS, WOOFI_SWAP_TYPE } from "./constants"; 4 | import { exponentToBigInt } from "./utils"; 5 | import { createToken } from "./create"; 6 | 7 | export function fetchTokenSymbol(tokenAddress: Bytes): string { 8 | if (tokenAddress.toHexString() == ETHER) { 9 | return ETHER_SYMBOL; 10 | } 11 | 12 | let contract = ERC20.bind(Address.fromBytes(tokenAddress)); 13 | let symbolResult = contract.try_symbol(); 14 | if (symbolResult.reverted) { 15 | return "UNKNOWN"; 16 | } 17 | 18 | return symbolResult.value; 19 | } 20 | 21 | export function fetchTokenName(tokenAddress: Bytes): string { 22 | if (tokenAddress.toHexString() == ETHER) { 23 | return ETHER_NAME; 24 | } 25 | 26 | let contract = ERC20.bind(Address.fromBytes(tokenAddress)); 27 | let nameResult = contract.try_name(); 28 | if (nameResult.reverted) { 29 | return "Unknown"; 30 | } 31 | 32 | return nameResult.value; 33 | } 34 | 35 | export function fetchTokenTotalSupply(tokenAddress: Bytes): BigInt { 36 | if (tokenAddress.toHexString() == ETHER) { 37 | return BigInt.fromI32(0); 38 | } 39 | 40 | let contract = ERC20.bind(Address.fromBytes(tokenAddress)); 41 | let totalSupplyResult = contract.try_totalSupply(); 42 | if (totalSupplyResult.reverted) { 43 | return BigInt.fromI32(0); 44 | } 45 | 46 | return totalSupplyResult.value; 47 | } 48 | 49 | export function fetchTokenDecimals(tokenAddress: Bytes): BigInt { 50 | if (tokenAddress.toHexString() == ETHER) { 51 | return BigInt.fromI32(18); 52 | } 53 | 54 | let contract = ERC20.bind(Address.fromBytes(tokenAddress)); 55 | let decimalResult = contract.try_decimals(); 56 | if (decimalResult.reverted) { 57 | return BigInt.fromI32(18); 58 | } 59 | 60 | return BigInt.fromI32(decimalResult.value); 61 | } 62 | 63 | export function fetchTokenBalance(tokenAddress: Bytes, user: Bytes): BigInt { 64 | if (tokenAddress.toHexString() == ETHER) { 65 | return BigInt.fromI32(0); 66 | } 67 | 68 | let contract = ERC20.bind(Address.fromBytes(tokenAddress)); 69 | let balanceResult = contract.try_balanceOf(Address.fromBytes(user)); 70 | if (balanceResult.reverted) { 71 | return BigInt.fromI32(0); 72 | } 73 | 74 | return balanceResult.value; 75 | } 76 | 77 | export function calVolumeUSDForWooPP(event: ethereum.Event, fromTokenAddress: Bytes, fromAmount: BigInt, toTokenAddress: Bytes, toAmount: BigInt): BigInt { 78 | if (STABLE_TOKENS.indexOf(fromTokenAddress.toHexString()) != -1) { // fromToken is Stable Coin 79 | let fromToken = createToken(event, fromTokenAddress); 80 | if (fromToken.decimals != BI_18) { 81 | return fromAmount.times(exponentToBigInt(BI_18)).div(exponentToBigInt(fromToken.decimals)); 82 | } 83 | return fromAmount; 84 | } else { // toToken is Stable Coin 85 | let toToken = createToken(event, toTokenAddress); 86 | if (toToken.decimals != BI_18) { 87 | return toAmount.times(exponentToBigInt(BI_18)).div(exponentToBigInt(toToken.decimals)); 88 | } 89 | return toAmount; 90 | } 91 | } 92 | 93 | export function calVolumeUSDForWooRouter( 94 | event: ethereum.Event, 95 | swapType: i32, 96 | fromTokenAddress: Bytes, 97 | fromAmount: BigInt, 98 | toTokenAddress: Bytes, 99 | toAmount: BigInt, 100 | isV1: boolean 101 | ): BigInt { 102 | let BI_1e18 = exponentToBigInt(BI_18); 103 | let fromToken = createToken(event, fromTokenAddress); 104 | let toToken = createToken(event, toTokenAddress); 105 | 106 | let volumeUSD: BigInt; 107 | if (fromToken.lastTradePrice != BI_0) { 108 | if (fromToken.decimals != BI_18) { 109 | let BI_1eDoubleDecimals = exponentToBigInt(fromToken.decimals.times(BI_2)); 110 | volumeUSD = fromAmount.times(BI_1e18).div(BI_1eDoubleDecimals).times(fromToken.lastTradePrice); 111 | } else { 112 | volumeUSD = fromAmount.times(fromToken.lastTradePrice).div(BI_1e18); 113 | } 114 | } else { 115 | if (toToken.decimals != BI_18) { 116 | let BI_1eDoubleDecimals = exponentToBigInt(toToken.decimals.times(BI_2)); 117 | volumeUSD = toAmount.times(BI_1e18).div(BI_1eDoubleDecimals).times(toToken.lastTradePrice); 118 | } else { 119 | volumeUSD = toAmount.times(toToken.lastTradePrice).div(BI_1e18); 120 | } 121 | } 122 | 123 | if ( 124 | isV1 === true 125 | && STABLE_TOKENS.indexOf(fromTokenAddress.toHexString()) === -1 126 | && STABLE_TOKENS.indexOf(toTokenAddress.toHexString()) === -1 127 | && swapType === WOOFI_SWAP_TYPE 128 | ) { 129 | volumeUSD = volumeUSD.times(BI_2); 130 | } 131 | 132 | return volumeUSD; 133 | } 134 | -------------------------------------------------------------------------------- /src/constants.ts: -------------------------------------------------------------------------------- 1 | import { BigDecimal, BigInt, TypedMap } from "@graphprotocol/graph-ts"; 2 | 3 | export let BI_0 = BigInt.fromI32(0); 4 | export let BI_1 = BigInt.fromI32(1); 5 | export let BI_2 = BigInt.fromI32(2); 6 | export let BI_6 = BigInt.fromI32(6); 7 | export let BI_8 = BigInt.fromI32(8); 8 | export let BI_18 = BigInt.fromI32(18); 9 | 10 | export let BD_0 = BigDecimal.fromString("0"); 11 | export let BD_1 = BigDecimal.fromString("1"); 12 | 13 | // Address Must Be Lower Case!!! 14 | export const ETHER = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"; 15 | export const ETHER_SYMBOL = "S"; 16 | export const ETHER_NAME = "s"; 17 | 18 | export const WRAPPED = "0x039e2fb66102314ce7b64ce5ce3e5183bc94ad38"; 19 | 20 | export const STABLE_TOKENS: string[] = [ 21 | "0x29219dd400f2bf60e5a23d13be72b486d4038894", // USDC.e 22 | ]; 23 | 24 | // Contract Name as Variable Name 25 | export const WOO_ROUTER_SOURCES: string[] = [ 26 | "0x4c4af8dbc524681930a27b2f1af5bcc8062e6fb7", // WooRouterV2 27 | ]; 28 | 29 | export const WOO_PP_SOURCES: string[] = [ 30 | "0xed9e3f98bbed560e66b89aac922e29d4596a9642", // WooPPV2 31 | ]; 32 | 33 | export let WOO_PP_QUOTE_TOKENS = new TypedMap(); 34 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[0], STABLE_TOKENS[0]); // USDC.e 35 | 36 | export const WOO_VAULT_MANAGER_SOURCES: string[] = []; 37 | 38 | // destination swap called by Layer Zero Relayer 39 | export const LAYER_ZERO_SOURCES: string[] = []; 40 | 41 | export const WOOFI_SOURCES: string[] = WOO_ROUTER_SOURCES.concat(WOO_PP_SOURCES).concat(WOO_VAULT_MANAGER_SOURCES).concat(LAYER_ZERO_SOURCES); 42 | 43 | export const WOOFI_REBATE_ADDRESSES: string[] = []; 44 | 45 | export const ONE_INCH_REBATE_ADDRESSES: string[] = []; 46 | 47 | export const DODO_REBATE_ADDRESSES: string[] = []; 48 | 49 | export const OPEN_OCEAN_REBATE_ADDRESSES: string[] = []; 50 | 51 | export const METAMASK_REBATE_ADDRESSES: string[] = []; 52 | 53 | export const YIELD_YAK_REBATE_ADDRESSES: string[] = []; 54 | 55 | export const FIRE_BIRD_REBATE_ADDRESSES: string[] = []; 56 | 57 | export const BIT_KEEP_REBATE_ADDRESSES: string[] = []; 58 | 59 | export const PARA_SWAP_REBATE_ADDRESSES: string[] = []; 60 | 61 | export const BEETHOVEN_X_REBATE_ADDRESSES: string[] = []; 62 | 63 | export const TRANSIT_SWAP_REBATE_ADDRESSES: string[] = []; 64 | 65 | export const ZERO_X_REBATE_ADDRESSES: string[] = []; 66 | 67 | export const ODOS_REBATE_ADDRESSES: string[] = []; 68 | 69 | export const HERA_FINANCE_REBATE_ADDRESSES: string[] = []; 70 | 71 | export const THOR_SWAP_REBATE_ADDRESSES: string[] = []; 72 | 73 | export const OKX_REBATE_ADDRESSES: string[] = []; 74 | 75 | export const ONTO_REBATE_ADDRESSES: string[] = []; 76 | 77 | export const YETI_REBATE_ADDRESSES: string[] = []; 78 | 79 | export const JOY_REBATE_ADDRESSES: string[] = []; 80 | 81 | export const ZETA_FARM_REBATE_ADDRESSES: string[] = []; 82 | 83 | export const SLINGSHOT_REBATE_ADDRESSES: string[] = []; 84 | 85 | export const KALM_REBATE_ADDRESSES: string[] = []; 86 | 87 | export const UNIZEN_REBATE_ADDRESSES: string[] = []; 88 | 89 | export const KYBER_SWAP_REBATE_ADDRESSES: string[] = []; 90 | 91 | export const ONE_DELTA_REBATE_ADDRESSES: string[] = []; 92 | 93 | export const EISEN_REBATE_ADDRESSES: string[] = []; 94 | 95 | export let REBATE_ADDRESSES: string[][] = [ 96 | WOOFI_REBATE_ADDRESSES, // 0: WOOFi 97 | ONE_INCH_REBATE_ADDRESSES, // 1: 1inch 98 | DODO_REBATE_ADDRESSES, // 2: DODO 99 | OPEN_OCEAN_REBATE_ADDRESSES, // 3: OpenOcean 100 | METAMASK_REBATE_ADDRESSES, // 4: MetaMask 101 | YIELD_YAK_REBATE_ADDRESSES, // 5: YieldYak 102 | FIRE_BIRD_REBATE_ADDRESSES, // 6: FireBird 103 | BIT_KEEP_REBATE_ADDRESSES, // 7: BitKeep 104 | PARA_SWAP_REBATE_ADDRESSES, // 8: ParaSwap 105 | BEETHOVEN_X_REBATE_ADDRESSES, // 9: BeethovenX 106 | TRANSIT_SWAP_REBATE_ADDRESSES, // 10: TransitSwap 107 | ZERO_X_REBATE_ADDRESSES, // 11: 0x 108 | ODOS_REBATE_ADDRESSES, // 12: ODOS 109 | HERA_FINANCE_REBATE_ADDRESSES, // 13: HeraFinance 110 | THOR_SWAP_REBATE_ADDRESSES, // 14: THORSwap 111 | OKX_REBATE_ADDRESSES, // 15: OKX 112 | ONTO_REBATE_ADDRESSES, // 16: ONTO 113 | YETI_REBATE_ADDRESSES, // 17: Yeti 114 | JOY_REBATE_ADDRESSES, // 18: Joy 115 | ZETA_FARM_REBATE_ADDRESSES, // 19: ZetaFarm 116 | SLINGSHOT_REBATE_ADDRESSES, // 20: Slingshot 117 | KALM_REBATE_ADDRESSES, // 21: KALM 118 | UNIZEN_REBATE_ADDRESSES, // 22: unizen 119 | KYBER_SWAP_REBATE_ADDRESSES, // 23: KyberSwap 120 | ONE_DELTA_REBATE_ADDRESSES, // 24: 1delta 121 | EISEN_REBATE_ADDRESSES, // 25: Eisen 122 | ]; 123 | 124 | export const GLOBAL_VARIABLE_ID = "0"; 125 | export const ORDER_HISTORY_VARIABLE_ID = "0"; 126 | export const CROSS_CHAIN_SRC_ORDER_HISTORY_VARIABLE_ID = "1"; 127 | export const CROSS_CHAIN_DST_ORDER_HISTORY_VARIABLE_ID = "2"; 128 | 129 | export const WOOFI_ORDER_SOURCE_ID = "0"; 130 | export const OTHER_ORDER_SOURCE_ID = "99"; 131 | export const GET_ORDER_SOURCE_BY_WOO_ROUTER_SWAP_FROM_ID = "-99"; 132 | 133 | export const WOOFI_SWAP_TYPE = 0; 134 | -------------------------------------------------------------------------------- /subgraphs/zksync.yaml: -------------------------------------------------------------------------------- 1 | specVersion: 0.0.6 2 | description: fi.woo.org 3 | repository: https://github.com/woonetwork/woofi_subgraph 4 | schema: 5 | file: ./woofi.graphql 6 | dataSources: 7 | - kind: ethereum/contract 8 | name: WooRouterV2_2 9 | network: zksync-era 10 | source: 11 | address: "0x09873bfECA34F1Acd0a7e55cDA591f05d8a75369" 12 | abi: WooRouterV2 13 | startBlock: 27543421 14 | mapping: 15 | kind: ethereum/events 16 | apiVersion: 0.0.7 17 | language: wasm/assemblyscript 18 | entities: 19 | - WooRouterSwap 20 | abis: 21 | - name: WooRouterV2 22 | file: ../abis/WooRouterV2_1.json 23 | - name: ERC20 24 | file: ../abis/ERC20.json 25 | eventHandlers: 26 | - event: WooRouterSwap(uint8,indexed address,indexed address,uint256,uint256,address,indexed address,address) 27 | handler: handleWooRouterV2WooRouterSwap_2 28 | receipt: true 29 | file: ../src/mappings/wooRouter/index.ts 30 | - kind: ethereum/contract 31 | name: WooRouterV2_1 32 | network: zksync-era 33 | source: 34 | address: "0xfd505702b37Ae9b626952Eb2DD736d9045876417" 35 | abi: WooRouterV2 36 | startBlock: 1470178 37 | mapping: 38 | kind: ethereum/events 39 | apiVersion: 0.0.7 40 | language: wasm/assemblyscript 41 | entities: 42 | - WooRouterSwap 43 | abis: 44 | - name: WooRouterV2 45 | file: ../abis/WooRouterV2_1.json 46 | - name: ERC20 47 | file: ../abis/ERC20.json 48 | eventHandlers: 49 | - event: WooRouterSwap(uint8,indexed address,indexed address,uint256,uint256,address,indexed address,address) 50 | handler: handleWooRouterV2WooRouterSwap_1 51 | receipt: true 52 | file: ../src/mappings/wooRouter/index.ts 53 | - kind: ethereum/contract 54 | name: WooPPV2_3 55 | network: zksync-era 56 | source: 57 | address: "0x604dcC6434f77d611c68309f52A5FaDF81bE96eC" 58 | abi: WooPPV2 59 | startBlock: 57953262 60 | mapping: 61 | kind: ethereum/events 62 | apiVersion: 0.0.7 63 | language: wasm/assemblyscript 64 | entities: 65 | - WooSwap 66 | abis: 67 | - name: WooPPV2 68 | file: ../abis/WooPPV2_1.json 69 | - name: ERC20 70 | file: ../abis/ERC20.json 71 | eventHandlers: 72 | - event: WooSwap(indexed address,indexed address,uint256,uint256,address,indexed address,address,uint256,uint256) 73 | handler: handleWooPPV2WooSwap_3 74 | receipt: true 75 | file: ../src/mappings/wooPP/index.ts 76 | - kind: ethereum/contract 77 | name: WooPPV2_2 78 | network: zksync-era 79 | source: 80 | address: "0xE656d70bc3550e3EEE9dE7dC79367A44Fd13d975" 81 | abi: WooPPV2 82 | startBlock: 33471538 83 | mapping: 84 | kind: ethereum/events 85 | apiVersion: 0.0.7 86 | language: wasm/assemblyscript 87 | entities: 88 | - WooSwap 89 | abis: 90 | - name: WooPPV2 91 | file: ../abis/WooPPV2_1.json 92 | - name: ERC20 93 | file: ../abis/ERC20.json 94 | eventHandlers: 95 | - event: WooSwap(indexed address,indexed address,uint256,uint256,address,indexed address,address,uint256,uint256) 96 | handler: handleWooPPV2WooSwap_2 97 | receipt: true 98 | file: ../src/mappings/wooPP/index.ts 99 | - kind: ethereum/contract 100 | name: WooPPV2_1 101 | network: zksync-era 102 | source: 103 | address: "0x42ED123EB5266A5B8E2B54B2C76180CCF5e72FEe" 104 | abi: WooPPV2 105 | startBlock: 1466595 106 | mapping: 107 | kind: ethereum/events 108 | apiVersion: 0.0.7 109 | language: wasm/assemblyscript 110 | entities: 111 | - WooSwap 112 | abis: 113 | - name: WooPPV2 114 | file: ../abis/WooPPV2_1.json 115 | - name: ERC20 116 | file: ../abis/ERC20.json 117 | eventHandlers: 118 | - event: WooSwap(indexed address,indexed address,uint256,uint256,address,indexed address,address,uint256,uint256) 119 | handler: handleWooPPV2WooSwap_1 120 | receipt: true 121 | file: ../src/mappings/wooPP/index.ts 122 | - kind: ethereum 123 | name: WooTokenOFT 124 | network: zksync-era 125 | source: 126 | address: "0xF38583e662d3DC8bBE9ce791f06E1Dd46800AaaF" 127 | abi: WooTokenOFT 128 | startBlock: 50545458 129 | mapping: 130 | kind: ethereum/events 131 | apiVersion: 0.0.7 132 | language: wasm/assemblyscript 133 | entities: 134 | - OFTReceived 135 | - OFTSent 136 | abis: 137 | - name: WooTokenOFT 138 | file: ../abis/WooTokenOFT.json 139 | eventHandlers: 140 | - event: OFTReceived(indexed bytes32,uint32,indexed address,uint256) 141 | handler: handleOFTReceived 142 | - event: OFTSent(indexed bytes32,uint32,indexed address,uint256,uint256) 143 | handler: handleOFTSent 144 | file: ../src/mappings/wooTokenOFT/index.ts -------------------------------------------------------------------------------- /src/multichain/monad.ts: -------------------------------------------------------------------------------- 1 | import { BigDecimal, BigInt, TypedMap } from "@graphprotocol/graph-ts"; 2 | 3 | export let BI_0 = BigInt.fromI32(0); 4 | export let BI_1 = BigInt.fromI32(1); 5 | export let BI_2 = BigInt.fromI32(2); 6 | export let BI_6 = BigInt.fromI32(6); 7 | export let BI_8 = BigInt.fromI32(8); 8 | export let BI_18 = BigInt.fromI32(18); 9 | 10 | export let BD_0 = BigDecimal.fromString("0"); 11 | export let BD_1 = BigDecimal.fromString("1"); 12 | 13 | // Address Must Be Lower Case!!! 14 | export const ETHER = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"; 15 | export const ETHER_SYMBOL = "MON"; 16 | export const ETHER_NAME = "mon"; 17 | 18 | export const WRAPPED = "0x3bd359c1119da7da1d913d1c4d2b7c461115433a"; 19 | 20 | export const STABLE_TOKENS: string[] = [ 21 | "0x754704bc059f8c67012fed69bc8a327a5aafb603", // USDC 22 | ]; 23 | 24 | // Contract Name as Variable Name 25 | export const WOO_ROUTER_SOURCES: string[] = [ 26 | "0x4c4af8dbc524681930a27b2f1af5bcc8062e6fb7", // WooRouterV2 27 | ]; 28 | 29 | export const WOO_PP_SOURCES: string[] = [ 30 | "0x5520385bfcf07ec87c4c53a7d8d65595dff69fa4", // WooPPV2 31 | ]; 32 | 33 | export let WOO_PP_QUOTE_TOKENS = new TypedMap(); 34 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[0], STABLE_TOKENS[0]); // USDC 35 | 36 | export const WOO_VAULT_MANAGER_SOURCES: string[] = []; 37 | 38 | // destination swap called by Layer Zero Relayer 39 | export const LAYER_ZERO_SOURCES: string[] = []; 40 | 41 | export const WOOFI_SOURCES: string[] = WOO_ROUTER_SOURCES.concat(WOO_PP_SOURCES).concat(WOO_VAULT_MANAGER_SOURCES).concat(LAYER_ZERO_SOURCES); 42 | 43 | export const WOOFI_REBATE_ADDRESSES: string[] = []; 44 | 45 | export const ONE_INCH_REBATE_ADDRESSES: string[] = []; 46 | 47 | export const DODO_REBATE_ADDRESSES: string[] = []; 48 | 49 | export const OPEN_OCEAN_REBATE_ADDRESSES: string[] = []; 50 | 51 | export const METAMASK_REBATE_ADDRESSES: string[] = []; 52 | 53 | export const YIELD_YAK_REBATE_ADDRESSES: string[] = []; 54 | 55 | export const FIRE_BIRD_REBATE_ADDRESSES: string[] = []; 56 | 57 | export const BIT_KEEP_REBATE_ADDRESSES: string[] = []; 58 | 59 | export const PARA_SWAP_REBATE_ADDRESSES: string[] = []; 60 | 61 | export const BEETHOVEN_X_REBATE_ADDRESSES: string[] = []; 62 | 63 | export const TRANSIT_SWAP_REBATE_ADDRESSES: string[] = []; 64 | 65 | export const ZERO_X_REBATE_ADDRESSES: string[] = []; 66 | 67 | export const ODOS_REBATE_ADDRESSES: string[] = []; 68 | 69 | export const HERA_FINANCE_REBATE_ADDRESSES: string[] = []; 70 | 71 | export const THOR_SWAP_REBATE_ADDRESSES: string[] = []; 72 | 73 | export const OKX_REBATE_ADDRESSES: string[] = []; 74 | 75 | export const ONTO_REBATE_ADDRESSES: string[] = []; 76 | 77 | export const YETI_REBATE_ADDRESSES: string[] = []; 78 | 79 | export const JOY_REBATE_ADDRESSES: string[] = []; 80 | 81 | export const ZETA_FARM_REBATE_ADDRESSES: string[] = []; 82 | 83 | export const SLINGSHOT_REBATE_ADDRESSES: string[] = []; 84 | 85 | export const KALM_REBATE_ADDRESSES: string[] = []; 86 | 87 | export const UNIZEN_REBATE_ADDRESSES: string[] = []; 88 | 89 | export const KYBER_SWAP_REBATE_ADDRESSES: string[] = [ 90 | "0x4f82e73edb06d29ff62c91ec8f5ff06571bdeb29", 91 | ]; 92 | 93 | export const ONE_DELTA_REBATE_ADDRESSES: string[] = []; 94 | 95 | export const EISEN_REBATE_ADDRESSES: string[] = []; 96 | 97 | export const HYPERSONIC_REBATE_ADDRESSES: string[] = []; 98 | 99 | export const GLUEX_REBATE_ADDRESSES: string[] = [ 100 | "0x3cffef055725974e32a660a617fc999b67e9196e", 101 | ]; 102 | 103 | export let REBATE_ADDRESSES: string[][] = [ 104 | WOOFI_REBATE_ADDRESSES, // 0: WOOFi 105 | ONE_INCH_REBATE_ADDRESSES, // 1: 1inch 106 | DODO_REBATE_ADDRESSES, // 2: DODO 107 | OPEN_OCEAN_REBATE_ADDRESSES, // 3: OpenOcean 108 | METAMASK_REBATE_ADDRESSES, // 4: MetaMask 109 | YIELD_YAK_REBATE_ADDRESSES, // 5: YieldYak 110 | FIRE_BIRD_REBATE_ADDRESSES, // 6: FireBird 111 | BIT_KEEP_REBATE_ADDRESSES, // 7: BitKeep 112 | PARA_SWAP_REBATE_ADDRESSES, // 8: ParaSwap 113 | BEETHOVEN_X_REBATE_ADDRESSES, // 9: BeethovenX 114 | TRANSIT_SWAP_REBATE_ADDRESSES, // 10: TransitSwap 115 | ZERO_X_REBATE_ADDRESSES, // 11: 0x 116 | ODOS_REBATE_ADDRESSES, // 12: ODOS 117 | HERA_FINANCE_REBATE_ADDRESSES, // 13: HeraFinance 118 | THOR_SWAP_REBATE_ADDRESSES, // 14: THORSwap 119 | OKX_REBATE_ADDRESSES, // 15: OKX 120 | ONTO_REBATE_ADDRESSES, // 16: ONTO 121 | YETI_REBATE_ADDRESSES, // 17: Yeti 122 | JOY_REBATE_ADDRESSES, // 18: Joy 123 | ZETA_FARM_REBATE_ADDRESSES, // 19: ZetaFarm 124 | SLINGSHOT_REBATE_ADDRESSES, // 20: Slingshot 125 | KALM_REBATE_ADDRESSES, // 21: KALM 126 | UNIZEN_REBATE_ADDRESSES, // 22: unizen 127 | KYBER_SWAP_REBATE_ADDRESSES, // 23: KyberSwap 128 | ONE_DELTA_REBATE_ADDRESSES, // 24: 1delta 129 | EISEN_REBATE_ADDRESSES, // 25: Eisen 130 | HYPERSONIC_REBATE_ADDRESSES, // 26: Hypersonic 131 | GLUEX_REBATE_ADDRESSES, // 27: GlueX 132 | ]; 133 | 134 | export const GLOBAL_VARIABLE_ID = "0"; 135 | export const ORDER_HISTORY_VARIABLE_ID = "0"; 136 | export const CROSS_CHAIN_SRC_ORDER_HISTORY_VARIABLE_ID = "1"; 137 | export const CROSS_CHAIN_DST_ORDER_HISTORY_VARIABLE_ID = "2"; 138 | 139 | export const WOOFI_ORDER_SOURCE_ID = "0"; 140 | export const OTHER_ORDER_SOURCE_ID = "99"; 141 | export const GET_ORDER_SOURCE_BY_WOO_ROUTER_SWAP_FROM_ID = "-99"; 142 | 143 | export const WOOFI_SWAP_TYPE = 0; 144 | -------------------------------------------------------------------------------- /src/multichain/hyperevm.ts: -------------------------------------------------------------------------------- 1 | import { BigDecimal, BigInt, TypedMap } from "@graphprotocol/graph-ts"; 2 | 3 | export let BI_0 = BigInt.fromI32(0); 4 | export let BI_1 = BigInt.fromI32(1); 5 | export let BI_2 = BigInt.fromI32(2); 6 | export let BI_6 = BigInt.fromI32(6); 7 | export let BI_8 = BigInt.fromI32(8); 8 | export let BI_18 = BigInt.fromI32(18); 9 | 10 | export let BD_0 = BigDecimal.fromString("0"); 11 | export let BD_1 = BigDecimal.fromString("1"); 12 | 13 | // Address Must Be Lower Case!!! 14 | export const ETHER = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"; 15 | export const ETHER_SYMBOL = "HYPE"; 16 | export const ETHER_NAME = "hype"; 17 | 18 | export const WRAPPED = "0x5555555555555555555555555555555555555555"; 19 | 20 | export const STABLE_TOKENS: string[] = [ 21 | "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb", // USDT0 22 | ]; 23 | 24 | // Contract Name as Variable Name 25 | export const WOO_ROUTER_SOURCES: string[] = [ 26 | "0x4c4af8dbc524681930a27b2f1af5bcc8062e6fb7", // WooRouterV2 27 | ]; 28 | 29 | export const WOO_PP_SOURCES: string[] = [ 30 | "0x5520385bfcf07ec87c4c53a7d8d65595dff69fa4", // WooPPV2 31 | ]; 32 | 33 | export let WOO_PP_QUOTE_TOKENS = new TypedMap(); 34 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[0], STABLE_TOKENS[0]); // USDT0 35 | 36 | export const WOO_VAULT_MANAGER_SOURCES: string[] = []; 37 | 38 | // destination swap called by Layer Zero Relayer 39 | export const LAYER_ZERO_SOURCES: string[] = []; 40 | 41 | export const WOOFI_SOURCES: string[] = WOO_ROUTER_SOURCES.concat(WOO_PP_SOURCES).concat(WOO_VAULT_MANAGER_SOURCES).concat(LAYER_ZERO_SOURCES); 42 | 43 | export const WOOFI_REBATE_ADDRESSES: string[] = []; 44 | 45 | export const ONE_INCH_REBATE_ADDRESSES: string[] = []; 46 | 47 | export const DODO_REBATE_ADDRESSES: string[] = []; 48 | 49 | export const OPEN_OCEAN_REBATE_ADDRESSES: string[] = []; 50 | 51 | export const METAMASK_REBATE_ADDRESSES: string[] = []; 52 | 53 | export const YIELD_YAK_REBATE_ADDRESSES: string[] = []; 54 | 55 | export const FIRE_BIRD_REBATE_ADDRESSES: string[] = []; 56 | 57 | export const BIT_KEEP_REBATE_ADDRESSES: string[] = []; 58 | 59 | export const PARA_SWAP_REBATE_ADDRESSES: string[] = []; 60 | 61 | export const BEETHOVEN_X_REBATE_ADDRESSES: string[] = []; 62 | 63 | export const TRANSIT_SWAP_REBATE_ADDRESSES: string[] = []; 64 | 65 | export const ZERO_X_REBATE_ADDRESSES: string[] = []; 66 | 67 | export const ODOS_REBATE_ADDRESSES: string[] = []; 68 | 69 | export const HERA_FINANCE_REBATE_ADDRESSES: string[] = []; 70 | 71 | export const THOR_SWAP_REBATE_ADDRESSES: string[] = []; 72 | 73 | export const OKX_REBATE_ADDRESSES: string[] = []; 74 | 75 | export const ONTO_REBATE_ADDRESSES: string[] = []; 76 | 77 | export const YETI_REBATE_ADDRESSES: string[] = []; 78 | 79 | export const JOY_REBATE_ADDRESSES: string[] = []; 80 | 81 | export const ZETA_FARM_REBATE_ADDRESSES: string[] = []; 82 | 83 | export const SLINGSHOT_REBATE_ADDRESSES: string[] = []; 84 | 85 | export const KALM_REBATE_ADDRESSES: string[] = []; 86 | 87 | export const UNIZEN_REBATE_ADDRESSES: string[] = []; 88 | 89 | export const KYBER_SWAP_REBATE_ADDRESSES: string[] = [ 90 | "0x4f82e73edb06d29ff62c91ec8f5ff06571bdeb29", 91 | ]; 92 | 93 | export const ONE_DELTA_REBATE_ADDRESSES: string[] = []; 94 | 95 | export const EISEN_REBATE_ADDRESSES: string[] = []; 96 | 97 | export const HYPERSONIC_REBATE_ADDRESSES: string[] = []; 98 | 99 | export const GLUEX_REBATE_ADDRESSES: string[] = [ 100 | "0x3cffef055725974e32a660a617fc999b67e9196e", 101 | ]; 102 | 103 | export let REBATE_ADDRESSES: string[][] = [ 104 | WOOFI_REBATE_ADDRESSES, // 0: WOOFi 105 | ONE_INCH_REBATE_ADDRESSES, // 1: 1inch 106 | DODO_REBATE_ADDRESSES, // 2: DODO 107 | OPEN_OCEAN_REBATE_ADDRESSES, // 3: OpenOcean 108 | METAMASK_REBATE_ADDRESSES, // 4: MetaMask 109 | YIELD_YAK_REBATE_ADDRESSES, // 5: YieldYak 110 | FIRE_BIRD_REBATE_ADDRESSES, // 6: FireBird 111 | BIT_KEEP_REBATE_ADDRESSES, // 7: BitKeep 112 | PARA_SWAP_REBATE_ADDRESSES, // 8: ParaSwap 113 | BEETHOVEN_X_REBATE_ADDRESSES, // 9: BeethovenX 114 | TRANSIT_SWAP_REBATE_ADDRESSES, // 10: TransitSwap 115 | ZERO_X_REBATE_ADDRESSES, // 11: 0x 116 | ODOS_REBATE_ADDRESSES, // 12: ODOS 117 | HERA_FINANCE_REBATE_ADDRESSES, // 13: HeraFinance 118 | THOR_SWAP_REBATE_ADDRESSES, // 14: THORSwap 119 | OKX_REBATE_ADDRESSES, // 15: OKX 120 | ONTO_REBATE_ADDRESSES, // 16: ONTO 121 | YETI_REBATE_ADDRESSES, // 17: Yeti 122 | JOY_REBATE_ADDRESSES, // 18: Joy 123 | ZETA_FARM_REBATE_ADDRESSES, // 19: ZetaFarm 124 | SLINGSHOT_REBATE_ADDRESSES, // 20: Slingshot 125 | KALM_REBATE_ADDRESSES, // 21: KALM 126 | UNIZEN_REBATE_ADDRESSES, // 22: unizen 127 | KYBER_SWAP_REBATE_ADDRESSES, // 23: KyberSwap 128 | ONE_DELTA_REBATE_ADDRESSES, // 24: 1delta 129 | EISEN_REBATE_ADDRESSES, // 25: Eisen 130 | HYPERSONIC_REBATE_ADDRESSES, // 26: Hypersonic 131 | GLUEX_REBATE_ADDRESSES, // 27: GlueX 132 | ]; 133 | 134 | export const GLOBAL_VARIABLE_ID = "0"; 135 | export const ORDER_HISTORY_VARIABLE_ID = "0"; 136 | export const CROSS_CHAIN_SRC_ORDER_HISTORY_VARIABLE_ID = "1"; 137 | export const CROSS_CHAIN_DST_ORDER_HISTORY_VARIABLE_ID = "2"; 138 | 139 | export const WOOFI_ORDER_SOURCE_ID = "0"; 140 | export const OTHER_ORDER_SOURCE_ID = "99"; 141 | export const GET_ORDER_SOURCE_BY_WOO_ROUTER_SWAP_FROM_ID = "-99"; 142 | 143 | export const WOOFI_SWAP_TYPE = 0; 144 | -------------------------------------------------------------------------------- /src/multichain/berachain.ts: -------------------------------------------------------------------------------- 1 | import { BigDecimal, BigInt, TypedMap } from "@graphprotocol/graph-ts"; 2 | 3 | export let BI_0 = BigInt.fromI32(0); 4 | export let BI_1 = BigInt.fromI32(1); 5 | export let BI_2 = BigInt.fromI32(2); 6 | export let BI_6 = BigInt.fromI32(6); 7 | export let BI_8 = BigInt.fromI32(8); 8 | export let BI_18 = BigInt.fromI32(18); 9 | 10 | export let BD_0 = BigDecimal.fromString("0"); 11 | export let BD_1 = BigDecimal.fromString("1"); 12 | 13 | // Address Must Be Lower Case!!! 14 | export const ETHER = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"; 15 | export const ETHER_SYMBOL = "BERA"; 16 | export const ETHER_NAME = "bera"; 17 | 18 | export const WRAPPED = "0x6969696969696969696969696969696969696969"; 19 | 20 | export const STABLE_TOKENS: string[] = [ 21 | "0x549943e04f40284185054145c6e4e9568c1d3241", // USDC.e 22 | ]; 23 | 24 | // Contract Name as Variable Name 25 | export const WOO_ROUTER_SOURCES: string[] = [ 26 | "0x4c4af8dbc524681930a27b2f1af5bcc8062e6fb7", // WooRouterV2 27 | ]; 28 | 29 | export const WOO_PP_SOURCES: string[] = [ 30 | "0x5520385bfcf07ec87c4c53a7d8d65595dff69fa4", // WooPPV2 31 | ]; 32 | 33 | export let WOO_PP_QUOTE_TOKENS = new TypedMap(); 34 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[0], STABLE_TOKENS[0]); // USDC.e 35 | 36 | export const WOO_VAULT_MANAGER_SOURCES: string[] = []; 37 | 38 | // destination swap called by Layer Zero Relayer 39 | export const LAYER_ZERO_SOURCES: string[] = []; 40 | 41 | export const WOOFI_SOURCES: string[] = WOO_ROUTER_SOURCES.concat(WOO_PP_SOURCES).concat(WOO_VAULT_MANAGER_SOURCES).concat(LAYER_ZERO_SOURCES); 42 | 43 | export const WOOFI_REBATE_ADDRESSES: string[] = []; 44 | 45 | export const ONE_INCH_REBATE_ADDRESSES: string[] = []; 46 | 47 | export const DODO_REBATE_ADDRESSES: string[] = []; 48 | 49 | export const OPEN_OCEAN_REBATE_ADDRESSES: string[] = []; 50 | 51 | export const METAMASK_REBATE_ADDRESSES: string[] = []; 52 | 53 | export const YIELD_YAK_REBATE_ADDRESSES: string[] = []; 54 | 55 | export const FIRE_BIRD_REBATE_ADDRESSES: string[] = []; 56 | 57 | export const BIT_KEEP_REBATE_ADDRESSES: string[] = []; 58 | 59 | export const PARA_SWAP_REBATE_ADDRESSES: string[] = []; 60 | 61 | export const BEETHOVEN_X_REBATE_ADDRESSES: string[] = []; 62 | 63 | export const TRANSIT_SWAP_REBATE_ADDRESSES: string[] = []; 64 | 65 | export const ZERO_X_REBATE_ADDRESSES: string[] = []; 66 | 67 | export const ODOS_REBATE_ADDRESSES: string[] = [ 68 | "0x498292dc123f19bdbc109081f6cf1d0e849a9daf", 69 | ]; 70 | 71 | export const HERA_FINANCE_REBATE_ADDRESSES: string[] = []; 72 | 73 | export const THOR_SWAP_REBATE_ADDRESSES: string[] = []; 74 | 75 | export const OKX_REBATE_ADDRESSES: string[] = []; 76 | 77 | export const ONTO_REBATE_ADDRESSES: string[] = []; 78 | 79 | export const YETI_REBATE_ADDRESSES: string[] = []; 80 | 81 | export const JOY_REBATE_ADDRESSES: string[] = []; 82 | 83 | export const ZETA_FARM_REBATE_ADDRESSES: string[] = []; 84 | 85 | export const SLINGSHOT_REBATE_ADDRESSES: string[] = []; 86 | 87 | export const KALM_REBATE_ADDRESSES: string[] = []; 88 | 89 | export const UNIZEN_REBATE_ADDRESSES: string[] = []; 90 | 91 | export const KYBER_SWAP_REBATE_ADDRESSES: string[] = [ 92 | "0x4f82e73edb06d29ff62c91ec8f5ff06571bdeb29", 93 | ]; 94 | 95 | export const ONE_DELTA_REBATE_ADDRESSES: string[] = []; 96 | 97 | export const EISEN_REBATE_ADDRESSES: string[] = []; 98 | 99 | export const HYPERSONIC_REBATE_ADDRESSES: string[] = []; 100 | 101 | export const GLUEX_REBATE_ADDRESSES: string[] = [ 102 | "0x3cffef055725974e32a660a617fc999b67e9196e", 103 | ]; 104 | 105 | export let REBATE_ADDRESSES: string[][] = [ 106 | WOOFI_REBATE_ADDRESSES, // 0: WOOFi 107 | ONE_INCH_REBATE_ADDRESSES, // 1: 1inch 108 | DODO_REBATE_ADDRESSES, // 2: DODO 109 | OPEN_OCEAN_REBATE_ADDRESSES, // 3: OpenOcean 110 | METAMASK_REBATE_ADDRESSES, // 4: MetaMask 111 | YIELD_YAK_REBATE_ADDRESSES, // 5: YieldYak 112 | FIRE_BIRD_REBATE_ADDRESSES, // 6: FireBird 113 | BIT_KEEP_REBATE_ADDRESSES, // 7: BitKeep 114 | PARA_SWAP_REBATE_ADDRESSES, // 8: ParaSwap 115 | BEETHOVEN_X_REBATE_ADDRESSES, // 9: BeethovenX 116 | TRANSIT_SWAP_REBATE_ADDRESSES, // 10: TransitSwap 117 | ZERO_X_REBATE_ADDRESSES, // 11: 0x 118 | ODOS_REBATE_ADDRESSES, // 12: ODOS 119 | HERA_FINANCE_REBATE_ADDRESSES, // 13: HeraFinance 120 | THOR_SWAP_REBATE_ADDRESSES, // 14: THORSwap 121 | OKX_REBATE_ADDRESSES, // 15: OKX 122 | ONTO_REBATE_ADDRESSES, // 16: ONTO 123 | YETI_REBATE_ADDRESSES, // 17: Yeti 124 | JOY_REBATE_ADDRESSES, // 18: Joy 125 | ZETA_FARM_REBATE_ADDRESSES, // 19: ZetaFarm 126 | SLINGSHOT_REBATE_ADDRESSES, // 20: Slingshot 127 | KALM_REBATE_ADDRESSES, // 21: KALM 128 | UNIZEN_REBATE_ADDRESSES, // 22: unizen 129 | KYBER_SWAP_REBATE_ADDRESSES, // 23: KyberSwap 130 | ONE_DELTA_REBATE_ADDRESSES, // 24: 1delta 131 | EISEN_REBATE_ADDRESSES, // 25: Eisen 132 | HYPERSONIC_REBATE_ADDRESSES, // 26: Hypersonic 133 | GLUEX_REBATE_ADDRESSES, // 27: GlueX 134 | ]; 135 | 136 | export const GLOBAL_VARIABLE_ID = "0"; 137 | export const ORDER_HISTORY_VARIABLE_ID = "0"; 138 | export const CROSS_CHAIN_SRC_ORDER_HISTORY_VARIABLE_ID = "1"; 139 | export const CROSS_CHAIN_DST_ORDER_HISTORY_VARIABLE_ID = "2"; 140 | 141 | export const WOOFI_ORDER_SOURCE_ID = "0"; 142 | export const OTHER_ORDER_SOURCE_ID = "99"; 143 | export const GET_ORDER_SOURCE_BY_WOO_ROUTER_SWAP_FROM_ID = "-99"; 144 | 145 | export const WOOFI_SWAP_TYPE = 0; 146 | -------------------------------------------------------------------------------- /abis/WooRouterV1_1.json: -------------------------------------------------------------------------------- 1 | [{"inputs":[{"internalType":"address","name":"weth","type":"address"},{"internalType":"address","name":"newPool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newPool","type":"address"}],"name":"WooPoolChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum IWooRouter.SwapType","name":"swapType","type":"uint8"},{"indexed":false,"internalType":"address","name":"fromToken","type":"address"},{"indexed":false,"internalType":"address","name":"toToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"fromAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"WooRouterSwap","type":"event"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"approveTarget","type":"address"},{"internalType":"address","name":"swapTarget","type":"address"},{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"},{"internalType":"address payable","name":"to","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"externalSwap","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"baseToken","type":"address"},{"internalType":"uint256","name":"baseAmount","type":"uint256"}],"name":"querySellBase","outputs":[{"internalType":"uint256","name":"quoteAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"baseToken","type":"address"},{"internalType":"uint256","name":"quoteAmount","type":"uint256"}],"name":"querySellQuote","outputs":[{"internalType":"uint256","name":"baseAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"}],"name":"querySwap","outputs":[{"internalType":"uint256","name":"toAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"quoteToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"rescueFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"baseToken","type":"address"},{"internalType":"uint256","name":"baseAmount","type":"uint256"},{"internalType":"uint256","name":"minQuoteAmount","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"rebateTo","type":"address"}],"name":"sellBase","outputs":[{"internalType":"uint256","name":"realQuoteAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"baseToken","type":"address"},{"internalType":"uint256","name":"quoteAmount","type":"uint256"},{"internalType":"uint256","name":"minBaseAmount","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"rebateTo","type":"address"}],"name":"sellQuote","outputs":[{"internalType":"uint256","name":"realBaseAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newPool","type":"address"}],"name":"setPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bool","name":"whitelisted","type":"bool"}],"name":"setWhitelisted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"},{"internalType":"uint256","name":"minToAmount","type":"uint256"},{"internalType":"address payable","name":"to","type":"address"},{"internalType":"address","name":"rebateTo","type":"address"}],"name":"swap","outputs":[{"internalType":"uint256","name":"realToAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wooPool","outputs":[{"internalType":"contract IWooPP","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}] -------------------------------------------------------------------------------- /src/multichain/sonic.ts: -------------------------------------------------------------------------------- 1 | import { BigDecimal, BigInt, TypedMap } from "@graphprotocol/graph-ts"; 2 | 3 | export let BI_0 = BigInt.fromI32(0); 4 | export let BI_1 = BigInt.fromI32(1); 5 | export let BI_2 = BigInt.fromI32(2); 6 | export let BI_6 = BigInt.fromI32(6); 7 | export let BI_8 = BigInt.fromI32(8); 8 | export let BI_18 = BigInt.fromI32(18); 9 | 10 | export let BD_0 = BigDecimal.fromString("0"); 11 | export let BD_1 = BigDecimal.fromString("1"); 12 | 13 | // Address Must Be Lower Case!!! 14 | export const ETHER = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"; 15 | export const ETHER_SYMBOL = "S"; 16 | export const ETHER_NAME = "s"; 17 | 18 | export const WRAPPED = "0x039e2fb66102314ce7b64ce5ce3e5183bc94ad38"; 19 | 20 | export const STABLE_TOKENS: string[] = [ 21 | "0x29219dd400f2bf60e5a23d13be72b486d4038894", // USDC.e 22 | ]; 23 | 24 | // Contract Name as Variable Name 25 | export const WOO_ROUTER_SOURCES: string[] = [ 26 | "0x4c4af8dbc524681930a27b2f1af5bcc8062e6fb7", // WooRouterV2 27 | ]; 28 | 29 | export const WOO_PP_SOURCES: string[] = [ 30 | "0xed9e3f98bbed560e66b89aac922e29d4596a9642", // WooPPV2 31 | "0x5520385bfcf07ec87c4c53a7d8d65595dff69fa4", // WooPPV2 32 | ]; 33 | 34 | export let WOO_PP_QUOTE_TOKENS = new TypedMap(); 35 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[0], STABLE_TOKENS[0]); // USDC.e 36 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[1], STABLE_TOKENS[0]); // USDC.e 37 | 38 | export const WOO_VAULT_MANAGER_SOURCES: string[] = []; 39 | 40 | // destination swap called by Layer Zero Relayer 41 | export const LAYER_ZERO_SOURCES: string[] = []; 42 | 43 | export const WOOFI_SOURCES: string[] = WOO_ROUTER_SOURCES.concat(WOO_PP_SOURCES).concat(WOO_VAULT_MANAGER_SOURCES).concat(LAYER_ZERO_SOURCES); 44 | 45 | export const WOOFI_REBATE_ADDRESSES: string[] = []; 46 | 47 | export const ONE_INCH_REBATE_ADDRESSES: string[] = []; 48 | 49 | export const DODO_REBATE_ADDRESSES: string[] = []; 50 | 51 | export const OPEN_OCEAN_REBATE_ADDRESSES: string[] = [ 52 | "0x922164bbbd36acf9e854acbbf32facc949fcaeef", 53 | ]; 54 | 55 | export const METAMASK_REBATE_ADDRESSES: string[] = []; 56 | 57 | export const YIELD_YAK_REBATE_ADDRESSES: string[] = []; 58 | 59 | export const FIRE_BIRD_REBATE_ADDRESSES: string[] = []; 60 | 61 | export const BIT_KEEP_REBATE_ADDRESSES: string[] = []; 62 | 63 | export const PARA_SWAP_REBATE_ADDRESSES: string[] = []; 64 | 65 | export const BEETHOVEN_X_REBATE_ADDRESSES: string[] = []; 66 | 67 | export const TRANSIT_SWAP_REBATE_ADDRESSES: string[] = []; 68 | 69 | export const ZERO_X_REBATE_ADDRESSES: string[] = []; 70 | 71 | export const ODOS_REBATE_ADDRESSES: string[] = [ 72 | "0x9bcfd3910761115bf2aeb7d4019b5f48fe52ef12", 73 | "0x6cc5e417a1cd4498c4b947eeda6e91a99e9287a8", 74 | ]; 75 | 76 | export const HERA_FINANCE_REBATE_ADDRESSES: string[] = []; 77 | 78 | export const THOR_SWAP_REBATE_ADDRESSES: string[] = []; 79 | 80 | export const OKX_REBATE_ADDRESSES: string[] = []; 81 | 82 | export const ONTO_REBATE_ADDRESSES: string[] = []; 83 | 84 | export const YETI_REBATE_ADDRESSES: string[] = []; 85 | 86 | export const JOY_REBATE_ADDRESSES: string[] = []; 87 | 88 | export const ZETA_FARM_REBATE_ADDRESSES: string[] = []; 89 | 90 | export const SLINGSHOT_REBATE_ADDRESSES: string[] = []; 91 | 92 | export const KALM_REBATE_ADDRESSES: string[] = []; 93 | 94 | export const UNIZEN_REBATE_ADDRESSES: string[] = []; 95 | 96 | export const KYBER_SWAP_REBATE_ADDRESSES: string[] = [ 97 | "0x4f82e73edb06d29ff62c91ec8f5ff06571bdeb29", 98 | ]; 99 | 100 | export const ONE_DELTA_REBATE_ADDRESSES: string[] = []; 101 | 102 | export const EISEN_REBATE_ADDRESSES: string[] = []; 103 | 104 | export const HYPERSONIC_REBATE_ADDRESSES: string[] = [ 105 | "0xc0ffee3865121adca7e0b3428a5d1ce53942c005", 106 | ]; 107 | 108 | export const GLUEX_REBATE_ADDRESSES: string[] = [ 109 | "0x3cffef055725974e32a660a617fc999b67e9196e", 110 | ]; 111 | 112 | export let REBATE_ADDRESSES: string[][] = [ 113 | WOOFI_REBATE_ADDRESSES, // 0: WOOFi 114 | ONE_INCH_REBATE_ADDRESSES, // 1: 1inch 115 | DODO_REBATE_ADDRESSES, // 2: DODO 116 | OPEN_OCEAN_REBATE_ADDRESSES, // 3: OpenOcean 117 | METAMASK_REBATE_ADDRESSES, // 4: MetaMask 118 | YIELD_YAK_REBATE_ADDRESSES, // 5: YieldYak 119 | FIRE_BIRD_REBATE_ADDRESSES, // 6: FireBird 120 | BIT_KEEP_REBATE_ADDRESSES, // 7: BitKeep 121 | PARA_SWAP_REBATE_ADDRESSES, // 8: ParaSwap 122 | BEETHOVEN_X_REBATE_ADDRESSES, // 9: BeethovenX 123 | TRANSIT_SWAP_REBATE_ADDRESSES, // 10: TransitSwap 124 | ZERO_X_REBATE_ADDRESSES, // 11: 0x 125 | ODOS_REBATE_ADDRESSES, // 12: ODOS 126 | HERA_FINANCE_REBATE_ADDRESSES, // 13: HeraFinance 127 | THOR_SWAP_REBATE_ADDRESSES, // 14: THORSwap 128 | OKX_REBATE_ADDRESSES, // 15: OKX 129 | ONTO_REBATE_ADDRESSES, // 16: ONTO 130 | YETI_REBATE_ADDRESSES, // 17: Yeti 131 | JOY_REBATE_ADDRESSES, // 18: Joy 132 | ZETA_FARM_REBATE_ADDRESSES, // 19: ZetaFarm 133 | SLINGSHOT_REBATE_ADDRESSES, // 20: Slingshot 134 | KALM_REBATE_ADDRESSES, // 21: KALM 135 | UNIZEN_REBATE_ADDRESSES, // 22: unizen 136 | KYBER_SWAP_REBATE_ADDRESSES, // 23: KyberSwap 137 | ONE_DELTA_REBATE_ADDRESSES, // 24: 1delta 138 | EISEN_REBATE_ADDRESSES, // 25: Eisen 139 | HYPERSONIC_REBATE_ADDRESSES, // 26: Hypersonic 140 | GLUEX_REBATE_ADDRESSES, // 27: GlueX 141 | ]; 142 | 143 | export const GLOBAL_VARIABLE_ID = "0"; 144 | export const ORDER_HISTORY_VARIABLE_ID = "0"; 145 | export const CROSS_CHAIN_SRC_ORDER_HISTORY_VARIABLE_ID = "1"; 146 | export const CROSS_CHAIN_DST_ORDER_HISTORY_VARIABLE_ID = "2"; 147 | 148 | export const WOOFI_ORDER_SOURCE_ID = "0"; 149 | export const OTHER_ORDER_SOURCE_ID = "99"; 150 | export const GET_ORDER_SOURCE_BY_WOO_ROUTER_SWAP_FROM_ID = "-99"; 151 | 152 | export const WOOFI_SWAP_TYPE = 0; 153 | -------------------------------------------------------------------------------- /src/mappings/wooRouter/index.ts: -------------------------------------------------------------------------------- 1 | import { ethereum, BigInt, Bytes } from "@graphprotocol/graph-ts"; 2 | import { WooRouterSwap as WooRouterV1WooRouterSwap_1 } from "../../../generated/WooRouterV1_1/WooRouterV1"; 3 | import { WooRouterSwap as WooRouterV1WooRouterSwap_2 } from "../../../generated/WooRouterV1_2/WooRouterV1"; 4 | import { WooRouterSwap as WooRouterV1WooRouterSwap_3 } from "../../../generated/WooRouterV1_3/WooRouterV1"; 5 | import { WooRouterSwap as WooRouterV2WooRouterSwap_1 } from "../../../generated/WooRouterV2_1/WooRouterV2"; 6 | import { WooRouterSwap as WooRouterV2WooRouterSwap_2 } from "../../../generated/WooRouterV2_2/WooRouterV2"; 7 | import { WooRouterSwap as WooRouterV2WooRouterSwap_3 } from "../../../generated/WooRouterV2_3/WooRouterV2"; 8 | 9 | import { calVolumeUSDForWooRouter } from "../../helpers"; 10 | import { 11 | updateGlobalVariable, 12 | updateHourToken, 13 | updateToken, 14 | updateHourData, 15 | updateDayData, 16 | updateOrderHistoryVariable, 17 | updateWooRouterSwapHash, 18 | } from "./update"; 19 | import { createWooSwapHash, createWooRouterSwapHash, createOrderHistory } from "../../create"; 20 | 21 | export function handleWooRouterV2WooRouterSwap_3(event: WooRouterV2WooRouterSwap_3): void { 22 | handleWooRouterSwap( 23 | event, event.params.swapType, event.params.from, event.params.to, 24 | event.params.fromToken, event.params.fromAmount, 25 | event.params.toToken, event.params.toAmount, false 26 | ); 27 | } 28 | 29 | export function handleWooRouterV2WooRouterSwap_2(event: WooRouterV2WooRouterSwap_2): void { 30 | handleWooRouterSwap( 31 | event, event.params.swapType, event.params.from, event.params.to, 32 | event.params.fromToken, event.params.fromAmount, 33 | event.params.toToken, event.params.toAmount, false 34 | ); 35 | } 36 | 37 | export function handleWooRouterV2WooRouterSwap_1(event: WooRouterV2WooRouterSwap_1): void { 38 | handleWooRouterSwap( 39 | event, event.params.swapType, event.params.from, event.params.to, 40 | event.params.fromToken, event.params.fromAmount, 41 | event.params.toToken, event.params.toAmount, false 42 | ); 43 | } 44 | 45 | export function handleWooRouterV1WooRouterSwap_3(event: WooRouterV1WooRouterSwap_3): void { 46 | handleWooRouterSwap( 47 | event, 48 | event.params.swapType, 49 | event.params.from, 50 | event.params.to, 51 | event.params.fromToken, 52 | event.params.fromAmount, 53 | event.params.toToken, 54 | event.params.toAmount, 55 | true 56 | ); 57 | } 58 | 59 | export function handleWooRouterV1WooRouterSwap_2(event: WooRouterV1WooRouterSwap_2): void { 60 | handleWooRouterSwap( 61 | event, 62 | event.params.swapType, 63 | event.params.from, 64 | event.params.to, 65 | event.params.fromToken, 66 | event.params.fromAmount, 67 | event.params.toToken, 68 | event.params.toAmount, 69 | true 70 | ) 71 | } 72 | 73 | export function handleWooRouterV1WooRouterSwap_1(event: WooRouterV1WooRouterSwap_1): void { 74 | handleWooRouterSwap( 75 | event, 76 | event.params.swapType, 77 | event.params.from, 78 | event.params.to, 79 | event.params.fromToken, 80 | event.params.fromAmount, 81 | event.params.toToken, 82 | event.params.toAmount, 83 | true 84 | ) 85 | } 86 | 87 | export function handleWooRouterSwap( 88 | event: ethereum.Event, 89 | swapType: i32, 90 | fromAddress: Bytes, 91 | toAddress: Bytes, 92 | fromTokenAddress: Bytes, 93 | fromAmount: BigInt, 94 | toTokenAddress: Bytes, 95 | toAmount: BigInt, 96 | isV1: boolean 97 | ): void { 98 | let volumeUSD = calVolumeUSDForWooRouter( 99 | event, 100 | swapType, 101 | fromTokenAddress, 102 | fromAmount, 103 | toTokenAddress, 104 | toAmount, 105 | isV1 106 | ); 107 | 108 | // Transaction may exist two WooRouterSwap 109 | let wooSwapHash = createWooSwapHash(event); 110 | // let wooRouterSwapHash = createWooRouterSwapHash(event); 111 | // let addOrderSourceVolumeUSD = wooSwapHash.volumeUSD.minus(wooRouterSwapHash.previousVolumeUSD); 112 | 113 | updateHourStatistics(event, volumeUSD, swapType, fromTokenAddress, toTokenAddress); 114 | updateDayStatistics(event, volumeUSD, swapType); 115 | updateStatistic(event, volumeUSD, swapType, fromTokenAddress, toTokenAddress); 116 | 117 | updateWooRouterSwapHash(event, wooSwapHash.volumeUSD); 118 | 119 | createOrderHistory( 120 | event, 121 | swapType, 122 | fromAddress, 123 | toAddress, 124 | fromTokenAddress, 125 | fromAmount, 126 | toTokenAddress, 127 | toAmount 128 | ); 129 | } 130 | 131 | function updateHourStatistics( 132 | event: ethereum.Event, 133 | volumeUSD: BigInt, 134 | swapType: i32, 135 | fromTokenAddress: Bytes, 136 | toTokenAddress: Bytes 137 | ): void { 138 | updateHourData(event, volumeUSD, swapType); 139 | updateHourToken(event, volumeUSD, swapType, fromTokenAddress, toTokenAddress); 140 | } 141 | 142 | function updateDayStatistics( 143 | event: ethereum.Event, 144 | volumeUSD: BigInt, 145 | swapType: i32 146 | ): void { 147 | updateDayData(event, volumeUSD, swapType); 148 | } 149 | 150 | function updateStatistic( 151 | event: ethereum.Event, 152 | volumeUSD: BigInt, 153 | swapType: i32, 154 | fromTokenAddress: Bytes, 155 | toTokenAddress: Bytes 156 | ): void { 157 | updateGlobalVariable(event, volumeUSD, swapType); 158 | updateToken(event, volumeUSD, swapType, fromTokenAddress, toTokenAddress); 159 | updateOrderHistoryVariable(event); 160 | } 161 | -------------------------------------------------------------------------------- /abis/WooRouterV1_2.json: -------------------------------------------------------------------------------- 1 | [{"inputs":[{"internalType":"address","name":"_weth","type":"address"},{"internalType":"address","name":"_pool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newPool","type":"address"}],"name":"WooPoolChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum IWooRouterV2.SwapType","name":"swapType","type":"uint8"},{"indexed":true,"internalType":"address","name":"fromToken","type":"address"},{"indexed":true,"internalType":"address","name":"toToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"fromAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"address","name":"rebateTo","type":"address"}],"name":"WooRouterSwap","type":"event"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"approveTarget","type":"address"},{"internalType":"address","name":"swapTarget","type":"address"},{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"},{"internalType":"uint256","name":"minToAmount","type":"uint256"},{"internalType":"address payable","name":"to","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"externalSwap","outputs":[{"internalType":"uint256","name":"realToAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"baseToken","type":"address"},{"internalType":"uint256","name":"baseAmount","type":"uint256"}],"name":"querySellBase","outputs":[{"internalType":"uint256","name":"quoteAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"baseToken","type":"address"},{"internalType":"uint256","name":"quoteAmount","type":"uint256"}],"name":"querySellQuote","outputs":[{"internalType":"uint256","name":"baseAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"}],"name":"querySwap","outputs":[{"internalType":"uint256","name":"toAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"quoteToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"rescueFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rescueNativeFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"baseToken","type":"address"},{"internalType":"uint256","name":"baseAmount","type":"uint256"},{"internalType":"uint256","name":"minQuoteAmount","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"rebateTo","type":"address"}],"name":"sellBase","outputs":[{"internalType":"uint256","name":"realQuoteAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"baseToken","type":"address"},{"internalType":"uint256","name":"quoteAmount","type":"uint256"},{"internalType":"uint256","name":"minBaseAmount","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"rebateTo","type":"address"}],"name":"sellQuote","outputs":[{"internalType":"uint256","name":"realBaseAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newPool","type":"address"}],"name":"setPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bool","name":"whitelisted","type":"bool"}],"name":"setWhitelisted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"},{"internalType":"uint256","name":"minToAmount","type":"uint256"},{"internalType":"address payable","name":"to","type":"address"},{"internalType":"address","name":"rebateTo","type":"address"}],"name":"swap","outputs":[{"internalType":"uint256","name":"realToAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wooPool","outputs":[{"internalType":"contract IWooPP","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}] -------------------------------------------------------------------------------- /subgraphs/ethereum.yaml: -------------------------------------------------------------------------------- 1 | specVersion: 0.0.6 2 | description: fi.woo.org 3 | repository: https://github.com/woonetwork/woofi_subgraph 4 | schema: 5 | file: ./woofi.graphql 6 | dataSources: 7 | - kind: ethereum/contract 8 | name: WOOFiCrossRouterV5_1 9 | network: mainnet 10 | source: 11 | address: "0xB84aEfEF2DDDE628d5c7F1fba320dE63e3f4757c" 12 | abi: WOOFiCrossRouterV5 13 | startBlock: 21671251 14 | mapping: 15 | kind: ethereum/events 16 | apiVersion: 0.0.7 17 | language: wasm/assemblyscript 18 | entities: 19 | - WOOFiCrossSwapOnSrcChain 20 | - WOOFiCrossSwapOnDstChain 21 | abis: 22 | - name: WOOFiCrossRouterV5 23 | file: ../abis/WOOFiCrossRouterV5_1.json 24 | - name: ERC20 25 | file: ../abis/ERC20.json 26 | eventHandlers: 27 | - event: WOOFiCrossSwapOnSrcChain(uint32,indexed bytes32,indexed address,indexed address,address,uint256,address,uint256,uint256,uint8,uint256) 28 | handler: handleWOOFiCrossRouterV5WOOFiCrossSwapOnSrcChain_1 29 | receipt: true 30 | - event: WOOFiCrossSwapOnDstChain(uint32,indexed bytes32,indexed address,indexed address,address,uint256,uint256,address,address,uint256,uint256,uint8,uint256) 31 | handler: handleWOOFiCrossRouterV5WOOFiCrossSwapOnDstChain_1 32 | receipt: true 33 | file: ../src/mappings/wooCrossChainRouter/index.ts 34 | - kind: ethereum/contract 35 | name: WooCrossChainRouterV4_1 36 | network: mainnet 37 | source: 38 | address: "0xCa10E8825FA9F1dB0651Cd48A9097997DBf7615d" 39 | abi: WooCrossChainRouterV4 40 | startBlock: 18392506 41 | mapping: 42 | kind: ethereum/events 43 | apiVersion: 0.0.7 44 | language: wasm/assemblyscript 45 | entities: 46 | - WooCrossSwapOnSrcChain 47 | - WooCrossSwapOnDstChain 48 | abis: 49 | - name: WooCrossChainRouterV4 50 | file: ../abis/WooCrossChainRouterV4_1.json 51 | - name: ERC20 52 | file: ../abis/ERC20.json 53 | eventHandlers: 54 | - event: WooCrossSwapOnSrcChain(indexed uint256,indexed address,indexed address,address,uint256,address,uint256,uint256,uint8,uint256) 55 | handler: handleWooCCRouterV4WooCrossSwapOnSrcChain_1 56 | receipt: true 57 | - event: WooCrossSwapOnDstChain(indexed uint256,indexed address,indexed address,address,uint256,address,address,uint256,uint256,uint8,uint256) 58 | handler: handleWooCCRouterV4WooCrossSwapOnDstChain_1 59 | receipt: true 60 | file: ../src/mappings/wooCrossChainRouter/index.ts 61 | - kind: ethereum/contract 62 | name: WooCrossChainRouterV3_1 63 | network: mainnet 64 | source: 65 | address: "0xe47Fec1c72850d867a1655C4C5902de7728CA205" 66 | abi: WooCrossChainRouterV3 67 | startBlock: 18191074 68 | mapping: 69 | kind: ethereum/events 70 | apiVersion: 0.0.7 71 | language: wasm/assemblyscript 72 | entities: 73 | - WooCrossSwapOnSrcChain 74 | - WooCrossSwapOnDstChain 75 | abis: 76 | - name: WooCrossChainRouterV3 77 | file: ../abis/WooCrossChainRouterV3_1.json 78 | - name: ERC20 79 | file: ../abis/ERC20.json 80 | eventHandlers: 81 | - event: WooCrossSwapOnSrcChain(indexed uint256,indexed address,indexed address,address,uint256,address,uint256,uint256,uint8,uint256) 82 | handler: handleWooCCRouterV3WooCrossSwapOnSrcChain_1 83 | receipt: true 84 | - event: WooCrossSwapOnDstChain(indexed uint256,indexed address,indexed address,address,uint256,address,address,uint256,uint256,uint8,uint256) 85 | handler: handleWooCCRouterV3WooCrossSwapOnDstChain_1 86 | receipt: true 87 | file: ../src/mappings/wooCrossChainRouter/index.ts 88 | - kind: ethereum/contract 89 | name: WooCrossChainRouterV2_1 90 | network: mainnet 91 | source: 92 | address: "0x9D1A92e601db0901e69bd810029F2C14bCCA3128" 93 | abi: WooCrossChainRouterV2 94 | startBlock: 16781811 95 | mapping: 96 | kind: ethereum/events 97 | apiVersion: 0.0.7 98 | language: wasm/assemblyscript 99 | entities: 100 | - WooCrossSwapOnSrcChain 101 | - WooCrossSwapOnDstChain 102 | abis: 103 | - name: WooCrossChainRouterV2 104 | file: ../abis/WooCrossChainRouterV2_1.json 105 | - name: ERC20 106 | file: ../abis/ERC20.json 107 | eventHandlers: 108 | - event: WooCrossSwapOnSrcChain(indexed uint256,indexed address,indexed address,address,uint256,uint256,uint256) 109 | handler: handleWooCCRouterV2WooCrossSwapOnSrcChain_1 110 | receipt: true 111 | - event: WooCrossSwapOnDstChain(indexed uint256,indexed address,indexed address,address,uint256,address,address,uint256,uint256) 112 | handler: handleWooCCRouterV2WooCrossSwapOnDstChain_1 113 | receipt: true 114 | file: ../src/mappings/wooCrossChainRouter/index.ts 115 | - kind: ethereum 116 | name: WooTokenOFTAdapter 117 | network: mainnet 118 | source: 119 | address: "0xAd6cA80Fe4D3c54f6433fF725d744772AaE87711" 120 | abi: WooTokenOFTAdapter 121 | startBlock: 19769079 122 | mapping: 123 | kind: ethereum/events 124 | apiVersion: 0.0.7 125 | language: wasm/assemblyscript 126 | entities: 127 | - OFTReceived 128 | - OFTSent 129 | abis: 130 | - name: WooTokenOFTAdapter 131 | file: ../abis/WooTokenOFTAdapter.json 132 | eventHandlers: 133 | - event: OFTReceived(indexed bytes32,uint32,indexed address,uint256) 134 | handler: handleOFTReceived 135 | - event: OFTSent(indexed bytes32,uint32,indexed address,uint256,uint256) 136 | handler: handleOFTSent 137 | file: ../src/mappings/wooTokenOFT/index.ts -------------------------------------------------------------------------------- /src/mappings/wooRouter/update.ts: -------------------------------------------------------------------------------- 1 | import { ethereum, BigInt, Bytes } from "@graphprotocol/graph-ts"; 2 | import { BI_1, WOOFI_SWAP_TYPE } from "../../constants"; 3 | import { 4 | createGlobalVariable, 5 | createHourToken, 6 | createToken, 7 | createHourData, 8 | createDayData, 9 | createUnknownDayOrderSource, 10 | createUnknownOrderSource, 11 | createWooRouterSwapHash, 12 | createOrderHistoryVariable, 13 | } from "../../create"; 14 | 15 | export function updateGlobalVariable( 16 | event: ethereum.Event, 17 | volumeUSD: BigInt, 18 | swapType: i32 19 | ): void { 20 | let globalVariable = createGlobalVariable(event); 21 | 22 | if (swapType === WOOFI_SWAP_TYPE) { 23 | globalVariable.routerToWooPPVolumeUSD = globalVariable.routerToWooPPVolumeUSD.plus(volumeUSD); 24 | } else { 25 | globalVariable.routerToThirdPartyVolumeUSD = globalVariable.routerToThirdPartyVolumeUSD.plus(volumeUSD); 26 | } 27 | globalVariable.updatedAt = event.block.timestamp; 28 | 29 | globalVariable.save(); 30 | } 31 | 32 | export function updateHourToken( 33 | event: ethereum.Event, 34 | volumeUSD: BigInt, 35 | swapType: i32, 36 | fromTokenAddress: Bytes, 37 | toTokenAddress: Bytes 38 | ): void { 39 | let fromHourToken = createHourToken(event, fromTokenAddress); 40 | let toHourToken = createHourToken(event, toTokenAddress); 41 | 42 | if (swapType === WOOFI_SWAP_TYPE) { 43 | fromHourToken.routerToWooPPTxns = fromHourToken.routerToWooPPTxns.plus(BI_1); 44 | fromHourToken.routerToWooPPVolumeUSD = fromHourToken.routerToWooPPVolumeUSD.plus(volumeUSD); 45 | } else { 46 | fromHourToken.routerToThirdPartyTxns = fromHourToken.routerToThirdPartyTxns.plus(BI_1); 47 | fromHourToken.routerToThirdPartyVolumeUSD = fromHourToken.routerToThirdPartyVolumeUSD.plus(volumeUSD); 48 | } 49 | fromHourToken.save(); 50 | 51 | if (swapType === WOOFI_SWAP_TYPE) { 52 | toHourToken.routerToWooPPTxns = toHourToken.routerToWooPPTxns.plus(BI_1); 53 | toHourToken.routerToWooPPVolumeUSD = toHourToken.routerToWooPPVolumeUSD.plus(volumeUSD); 54 | } else { 55 | toHourToken.routerToThirdPartyTxns = toHourToken.routerToThirdPartyTxns.plus(BI_1); 56 | toHourToken.routerToThirdPartyVolumeUSD = toHourToken.routerToThirdPartyVolumeUSD.plus(volumeUSD); 57 | } 58 | toHourToken.save(); 59 | } 60 | 61 | export function updateToken( 62 | event: ethereum.Event, 63 | volumeUSD: BigInt, 64 | swapType: i32, 65 | fromTokenAddress: Bytes, 66 | toTokenAddress: Bytes 67 | ): void { 68 | let fromToken = createToken(event, fromTokenAddress); 69 | let toToken = createToken(event, toTokenAddress); 70 | 71 | if (swapType === WOOFI_SWAP_TYPE) { 72 | fromToken.routerToWooPPVolumeUSD = fromToken.routerToWooPPVolumeUSD.plus(volumeUSD); 73 | } else { 74 | fromToken.routerToThirdPartyVolumeUSD = fromToken.routerToThirdPartyVolumeUSD.plus(volumeUSD); 75 | } 76 | fromToken.save(); 77 | 78 | if (swapType === WOOFI_SWAP_TYPE) { 79 | toToken.routerToWooPPVolumeUSD = toToken.routerToWooPPVolumeUSD.plus(volumeUSD); 80 | } else { 81 | toToken.routerToThirdPartyVolumeUSD = toToken.routerToThirdPartyVolumeUSD.plus(volumeUSD); 82 | } 83 | toToken.save(); 84 | } 85 | 86 | export function updateHourData( 87 | event: ethereum.Event, 88 | volumeUSD: BigInt, 89 | swapType: i32 90 | ): void { 91 | let hourData = createHourData(event); 92 | 93 | if (swapType === WOOFI_SWAP_TYPE) { 94 | hourData.routerToWooPPTxns = hourData.routerToWooPPTxns.plus(BI_1); 95 | hourData.routerToWooPPVolumeUSD = hourData.routerToWooPPVolumeUSD.plus(volumeUSD); 96 | } else { 97 | hourData.routerToThirdPartyTxns = hourData.routerToThirdPartyTxns.plus(BI_1); 98 | hourData.routerToThirdPartyVolumeUSD = hourData.routerToThirdPartyVolumeUSD.plus(volumeUSD); 99 | } 100 | 101 | hourData.save(); 102 | } 103 | 104 | export function updateDayData( 105 | event: ethereum.Event, 106 | volumeUSD: BigInt, 107 | swapType: i32 108 | ): void { 109 | let dayData = createDayData(event); 110 | 111 | if (swapType === WOOFI_SWAP_TYPE) { 112 | dayData.routerToWooPPTxns = dayData.routerToWooPPTxns.plus(BI_1); 113 | dayData.routerToWooPPVolumeUSD = dayData.routerToWooPPVolumeUSD.plus(volumeUSD); 114 | } else { 115 | dayData.routerToThirdPartyTxns = dayData.routerToThirdPartyTxns.plus(BI_1); 116 | dayData.routerToThirdPartyVolumeUSD = dayData.routerToThirdPartyVolumeUSD.plus(volumeUSD); 117 | } 118 | 119 | dayData.save(); 120 | } 121 | 122 | export function updateUnknownDayOrderSource(event: ethereum.Event, volumeUSD: BigInt, fromAddress: Bytes): void { 123 | let unknownDayOrderSource = createUnknownDayOrderSource(event, fromAddress.toHexString()); 124 | 125 | unknownDayOrderSource.volumeUSD = unknownDayOrderSource.volumeUSD.plus(volumeUSD); 126 | unknownDayOrderSource.txns = unknownDayOrderSource.txns.plus(BI_1); 127 | unknownDayOrderSource.updatedAt = event.block.timestamp; 128 | 129 | unknownDayOrderSource.save(); 130 | } 131 | 132 | export function updateUnknownOrderSource(event: ethereum.Event, volumeUSD: BigInt, fromAddress: Bytes): void { 133 | let unknownOrderSource = createUnknownOrderSource(event, fromAddress.toHexString()); 134 | 135 | unknownOrderSource.volumeUSD = unknownOrderSource.volumeUSD.plus(volumeUSD); 136 | unknownOrderSource.txns = unknownOrderSource.txns.plus(BI_1); 137 | unknownOrderSource.updatedAt = event.block.timestamp; 138 | 139 | unknownOrderSource.save(); 140 | } 141 | 142 | export function updateOrderHistoryVariable(event: ethereum.Event): void { 143 | let orderHistoryVariable = createOrderHistoryVariable(event); 144 | 145 | orderHistoryVariable.txns = orderHistoryVariable.txns.plus(BI_1); 146 | orderHistoryVariable.updatedAt = event.block.timestamp; 147 | 148 | orderHistoryVariable.save(); 149 | } 150 | 151 | export function updateWooRouterSwapHash(event: ethereum.Event, previousVolumeUSD: BigInt): void { 152 | let wooRouterSwapHash = createWooRouterSwapHash(event); 153 | wooRouterSwapHash.previousVolumeUSD = previousVolumeUSD; 154 | wooRouterSwapHash.updatedAt = event.block.timestamp; 155 | 156 | wooRouterSwapHash.save(); 157 | } 158 | -------------------------------------------------------------------------------- /abis/WooCrossChainRouterV1_1.json: -------------------------------------------------------------------------------- 1 | [{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"refId","type":"uint256"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"address","name":"bridgedToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"bridgedAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"toToken","type":"address"},{"indexed":false,"internalType":"address","name":"realToToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"minToAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"realToAmount","type":"uint256"}],"name":"WooCrossSwapOnDstChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"refId","type":"uint256"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"address","name":"fromToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"fromAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"minQuoteAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"realQuoteAmount","type":"uint256"}],"name":"WooCrossSwapOnSrcChain","type":"event"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bridgeSlippage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"refId_","type":"uint256"},{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"},{"internalType":"uint256","name":"srcMinQuoteAmount","type":"uint256"},{"internalType":"uint256","name":"dstMinToAmount","type":"uint256"},{"internalType":"uint16","name":"srcChainId","type":"uint16"},{"internalType":"uint16","name":"dstChainId","type":"uint16"},{"internalType":"address payable","name":"to","type":"address"}],"name":"crossSwap","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"dstGasForCall","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"inCaseNativeTokensGetStuck","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"stuckToken","type":"address"}],"name":"inCaseTokensGetStuck","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_weth","type":"address"},{"internalType":"address","name":"_wooPool","type":"address"},{"internalType":"address","name":"_stargateRouter","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"dstChainId","type":"uint16"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"refId","type":"uint256"},{"internalType":"uint256","name":"dstMinToAmount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"quoteLayerZeroFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"quotePoolIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"quoteToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_bridgeSlippage","type":"uint256"}],"name":"setBridgeSlippage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_dstGasForCall","type":"uint256"}],"name":"setDstGasForCall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"uint256","name":"_quotePoolId","type":"uint256"}],"name":"setQuotePoolId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_stargateRouter","type":"address"}],"name":"setStargateRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"address","name":"_wooCrossRouter","type":"address"}],"name":"setWooCrossChainRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_wooPool","type":"address"}],"name":"setWooPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"uint256","name":"_nonce","type":"uint256"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"amountLD","type":"uint256"},{"internalType":"bytes","name":"payload","type":"bytes"}],"name":"sgReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stargateRouter","outputs":[{"internalType":"contract IStargateRouter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"wooCrossRouters","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wooPool","outputs":[{"internalType":"contract IWooPP","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}] -------------------------------------------------------------------------------- /src/multichain/polygon-zkevm.ts: -------------------------------------------------------------------------------- 1 | import { BigDecimal, BigInt, TypedMap } from "@graphprotocol/graph-ts"; 2 | 3 | export let BI_0 = BigInt.fromI32(0); 4 | export let BI_1 = BigInt.fromI32(1); 5 | export let BI_2 = BigInt.fromI32(2); 6 | export let BI_6 = BigInt.fromI32(6); 7 | export let BI_8 = BigInt.fromI32(8); 8 | export let BI_18 = BigInt.fromI32(18); 9 | 10 | export let BD_0 = BigDecimal.fromString("0"); 11 | export let BD_1 = BigDecimal.fromString("1"); 12 | 13 | // Address Must Be Lower Case!!! 14 | export const ETHER = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"; 15 | export const ETHER_SYMBOL = "ETH"; 16 | export const ETHER_NAME = "eth"; 17 | 18 | export const WRAPPED = "0x4f9a0e7fd2bf6067db6994cf12e4495df938e6e9"; 19 | 20 | export const STABLE_TOKENS: string[] = [ 21 | "0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035", // USDC 22 | ]; 23 | 24 | // Contract Name as Variable Name 25 | export const WOO_ROUTER_SOURCES: string[] = [ 26 | "0x39d361e66798155813b907a70d6c2e3fdafb0877", // WooRouterV2 27 | ]; 28 | 29 | export const WOO_PP_SOURCES: string[] = [ 30 | "0xf5d215d9c84778f85746d15762daf39b9e83a2d6", 31 | ]; 32 | 33 | export let WOO_PP_QUOTE_TOKENS = new TypedMap(); 34 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[0], STABLE_TOKENS[0]); // USDC 35 | 36 | export const WOO_VAULT_MANAGER_SOURCES: string[] = []; 37 | 38 | // destination swap called by Layer Zero Relayer 39 | export const LAYER_ZERO_SOURCES: string[] = []; 40 | 41 | export const WOOFI_SOURCES: string[] = WOO_ROUTER_SOURCES.concat(WOO_PP_SOURCES).concat(WOO_VAULT_MANAGER_SOURCES).concat(LAYER_ZERO_SOURCES); 42 | 43 | export const WOOFI_REBATE_ADDRESSES: string[] = []; 44 | 45 | export const ONE_INCH_REBATE_ADDRESSES: string[] = [ 46 | "0x703a96e7d7a6d05d2d7f3f8223fd538c23897ce8", 47 | "0x910bf2d50fa5e014fd06666f456182d4ab7c8bd2", 48 | ]; 49 | 50 | export const DODO_REBATE_ADDRESSES: string[] = [ 51 | "0xea8e147bdb3ee3dde2085acb88de826e1a6de37a", 52 | "0xce9f9716fec7b4c11c773751aa579b1908fe9f5b", 53 | ]; 54 | 55 | export const OPEN_OCEAN_REBATE_ADDRESSES: string[] = [ 56 | "0x353c1f0bc78fbbc245b3c93ef77b1dcc5b77d2a0", 57 | "0x922164bbbd36acf9e854acbbf32facc949fcaeef", 58 | ]; 59 | 60 | export const METAMASK_REBATE_ADDRESSES: string[] = []; 61 | 62 | export const YIELD_YAK_REBATE_ADDRESSES: string[] = [ 63 | "0x5925c5c6843a8f67f7ef2b55db1f5491573c85eb", 64 | ]; 65 | 66 | export const FIRE_BIRD_REBATE_ADDRESSES: string[] = [ 67 | "0xa20ca7c6705fb88847cbf50549d7a38f4e99d32c", 68 | ]; 69 | 70 | export const BIT_KEEP_REBATE_ADDRESSES: string[] = [ 71 | "0x9712394caccab28acd26d41f7e0566c1e88759aa", 72 | ]; 73 | 74 | export const PARA_SWAP_REBATE_ADDRESSES: string[] = [ 75 | "0xdef171fe48cf0115b1d80b88dc8eab59176fee57", 76 | "0xd5b927956057075377263aab7f8afc12f85100db", 77 | ]; 78 | 79 | export const BEETHOVEN_X_REBATE_ADDRESSES: string[] = []; 80 | 81 | export const TRANSIT_SWAP_REBATE_ADDRESSES: string[] = [ 82 | "0x92106728f6efe170f8de919e1bd88c04c2473d3c", 83 | ]; 84 | 85 | export const ZERO_X_REBATE_ADDRESSES: string[] = [ 86 | "0xbfdcbb4c05843163f491c24f9c0019c510786304", 87 | "0x5e01d320e95133d80dd59a2191c95728fa69036d", 88 | ]; 89 | 90 | export const ODOS_REBATE_ADDRESSES: string[] = []; 91 | 92 | export const HERA_FINANCE_REBATE_ADDRESSES: string[] = [ 93 | "0x1111110808b63f93b869a8a8ef87bc5b4dd79689", 94 | ]; 95 | 96 | export const THOR_SWAP_REBATE_ADDRESSES: string[] = [ 97 | "0x72c6d8fcc3e591253a1eb563180d317998346bec", 98 | ]; 99 | 100 | export const OKX_REBATE_ADDRESSES: string[] = []; 101 | 102 | export const ONTO_REBATE_ADDRESSES: string[] = [ 103 | "0x0ce56280bf51dc8211952c3522d4e1ce917319a6", 104 | ]; 105 | 106 | export const YETI_REBATE_ADDRESSES: string[] = [ 107 | "0x718c79e7c12f7e2c1a5d641c81d02eb7566db9a8", 108 | ]; 109 | 110 | export const JOY_REBATE_ADDRESSES: string[] = []; 111 | 112 | export const ZETA_FARM_REBATE_ADDRESSES: string[] = [ 113 | "0x04a285427eee8ade8dce32299478e4522fb7c287", 114 | ]; 115 | 116 | export const SLINGSHOT_REBATE_ADDRESSES: string[] = []; 117 | 118 | export const KALM_REBATE_ADDRESSES: string[] = []; 119 | 120 | export const UNIZEN_REBATE_ADDRESSES: string[] = [ 121 | "0xaf951f7a4aa4e2a033b034af0897273ed553e8c3", 122 | ]; 123 | 124 | export const KYBER_SWAP_REBATE_ADDRESSES: string[] = [ 125 | "0x4f82e73edb06d29ff62c91ec8f5ff06571bdeb29", 126 | ]; 127 | 128 | export const ONE_DELTA_REBATE_ADDRESSES: string[] = [ 129 | "0xc95eed7f6e8334611765f84ceb8ed6270f08907e", 130 | ]; 131 | 132 | export const EISEN_REBATE_ADDRESSES: string[] = []; 133 | 134 | export const HYPERSONIC_REBATE_ADDRESSES: string[] = []; 135 | 136 | export let REBATE_ADDRESSES: string[][] = [ 137 | WOOFI_REBATE_ADDRESSES, // 0: WOOFi 138 | ONE_INCH_REBATE_ADDRESSES, // 1: 1inch 139 | DODO_REBATE_ADDRESSES, // 2: DODO 140 | OPEN_OCEAN_REBATE_ADDRESSES, // 3: OpenOcean 141 | METAMASK_REBATE_ADDRESSES, // 4: MetaMask 142 | YIELD_YAK_REBATE_ADDRESSES, // 5: YieldYak 143 | FIRE_BIRD_REBATE_ADDRESSES, // 6: FireBird 144 | BIT_KEEP_REBATE_ADDRESSES, // 7: BitKeep 145 | PARA_SWAP_REBATE_ADDRESSES, // 8: ParaSwap 146 | BEETHOVEN_X_REBATE_ADDRESSES, // 9: BeethovenX 147 | TRANSIT_SWAP_REBATE_ADDRESSES, // 10: TransitSwap 148 | ZERO_X_REBATE_ADDRESSES, // 11: 0x 149 | ODOS_REBATE_ADDRESSES, // 12: ODOS 150 | HERA_FINANCE_REBATE_ADDRESSES, // 13: HeraFinance 151 | THOR_SWAP_REBATE_ADDRESSES, // 14: THORSwap 152 | OKX_REBATE_ADDRESSES, // 15: OKX 153 | ONTO_REBATE_ADDRESSES, // 16: ONTO 154 | YETI_REBATE_ADDRESSES, // 17: Yeti 155 | JOY_REBATE_ADDRESSES, // 18: Joy 156 | ZETA_FARM_REBATE_ADDRESSES, // 19: ZetaFarm 157 | SLINGSHOT_REBATE_ADDRESSES, // 20: Slingshot 158 | KALM_REBATE_ADDRESSES, // 21: KALM 159 | UNIZEN_REBATE_ADDRESSES, // 22: unizen 160 | KYBER_SWAP_REBATE_ADDRESSES, // 23: KyberSwap 161 | ONE_DELTA_REBATE_ADDRESSES, // 24: 1delta 162 | EISEN_REBATE_ADDRESSES, // 25: Eisen 163 | HYPERSONIC_REBATE_ADDRESSES, // 26: Hypersonic 164 | ]; 165 | 166 | export const GLOBAL_VARIABLE_ID = "0"; 167 | export const ORDER_HISTORY_VARIABLE_ID = "0"; 168 | export const CROSS_CHAIN_SRC_ORDER_HISTORY_VARIABLE_ID = "1"; 169 | export const CROSS_CHAIN_DST_ORDER_HISTORY_VARIABLE_ID = "2"; 170 | 171 | export const WOOFI_ORDER_SOURCE_ID = "0"; 172 | export const OTHER_ORDER_SOURCE_ID = "99"; 173 | export const GET_ORDER_SOURCE_BY_WOO_ROUTER_SWAP_FROM_ID = "-99"; 174 | 175 | export const WOOFI_SWAP_TYPE = 0; 176 | -------------------------------------------------------------------------------- /src/multichain/ethereum.ts: -------------------------------------------------------------------------------- 1 | import { BigDecimal, BigInt, TypedMap } from "@graphprotocol/graph-ts"; 2 | 3 | export let BI_0 = BigInt.fromI32(0); 4 | export let BI_1 = BigInt.fromI32(1); 5 | export let BI_2 = BigInt.fromI32(2); 6 | export let BI_6 = BigInt.fromI32(6); 7 | export let BI_8 = BigInt.fromI32(8); 8 | export let BI_18 = BigInt.fromI32(18); 9 | 10 | export let BD_0 = BigDecimal.fromString("0"); 11 | export let BD_1 = BigDecimal.fromString("1"); 12 | 13 | // Address Must Be Lower Case!!! 14 | export const ETHER = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"; 15 | export const ETHER_SYMBOL = "ETH"; 16 | export const ETHER_NAME = "eth"; 17 | 18 | export const WRAPPED = "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"; 19 | 20 | export const STABLE_TOKENS: string[] = [ 21 | "0xdac17f958d2ee523a2206206994597c13d831ec7", // USDT 22 | "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // USDC 23 | ]; 24 | 25 | // Contract Name as Variable Name 26 | export const WOO_ROUTER_SOURCES: string[] = [ 27 | "0x9d1a92e601db0901e69bd810029f2c14bcca3128", // WooCrossChainRouterV2 28 | "0xe47fec1c72850d867a1655c4c5902de7728ca205", // WooCrossChainRouterV3 29 | "0xca10e8825fa9f1db0651cd48a9097997dbf7615d", // WooCrossChainRouterV4 30 | ]; 31 | 32 | export const WOO_PP_SOURCES: string[] = []; 33 | 34 | export let WOO_PP_QUOTE_TOKENS = new TypedMap(); 35 | 36 | export const WOO_VAULT_MANAGER_SOURCES: string[] = []; 37 | 38 | // destination swap called by Layer Zero Relayer 39 | export const LAYER_ZERO_SOURCES: string[] = [ 40 | "0x902f09715b6303d4173037652fa7377e5b98089e", // Relayer 41 | ]; 42 | 43 | export const WOOFI_SOURCES: string[] = WOO_ROUTER_SOURCES.concat(WOO_PP_SOURCES).concat(WOO_VAULT_MANAGER_SOURCES).concat(LAYER_ZERO_SOURCES); 44 | 45 | export const WOOFI_REBATE_ADDRESSES: string[] = []; 46 | 47 | export const ONE_INCH_REBATE_ADDRESSES: string[] = [ 48 | "0x703a96e7d7a6d05d2d7f3f8223fd538c23897ce8", 49 | "0x910bf2d50fa5e014fd06666f456182d4ab7c8bd2", 50 | ]; 51 | 52 | export const DODO_REBATE_ADDRESSES: string[] = [ 53 | "0xea8e147bdb3ee3dde2085acb88de826e1a6de37a", 54 | "0xce9f9716fec7b4c11c773751aa579b1908fe9f5b", 55 | ]; 56 | 57 | export const OPEN_OCEAN_REBATE_ADDRESSES: string[] = [ 58 | "0x353c1f0bc78fbbc245b3c93ef77b1dcc5b77d2a0", 59 | "0x922164bbbd36acf9e854acbbf32facc949fcaeef", 60 | ]; 61 | 62 | export const METAMASK_REBATE_ADDRESSES: string[] = []; 63 | 64 | export const YIELD_YAK_REBATE_ADDRESSES: string[] = [ 65 | "0x5925c5c6843a8f67f7ef2b55db1f5491573c85eb", 66 | ]; 67 | 68 | export const FIRE_BIRD_REBATE_ADDRESSES: string[] = [ 69 | "0xa20ca7c6705fb88847cbf50549d7a38f4e99d32c", 70 | ]; 71 | 72 | export const BIT_KEEP_REBATE_ADDRESSES: string[] = [ 73 | "0x9712394caccab28acd26d41f7e0566c1e88759aa", 74 | ]; 75 | 76 | export const PARA_SWAP_REBATE_ADDRESSES: string[] = [ 77 | "0xdef171fe48cf0115b1d80b88dc8eab59176fee57", 78 | "0xd5b927956057075377263aab7f8afc12f85100db", 79 | ]; 80 | 81 | export const BEETHOVEN_X_REBATE_ADDRESSES: string[] = []; 82 | 83 | export const TRANSIT_SWAP_REBATE_ADDRESSES: string[] = [ 84 | "0x92106728f6efe170f8de919e1bd88c04c2473d3c", 85 | ]; 86 | 87 | export const ZERO_X_REBATE_ADDRESSES: string[] = [ 88 | "0xbfdcbb4c05843163f491c24f9c0019c510786304", 89 | "0x5e01d320e95133d80dd59a2191c95728fa69036d", 90 | ]; 91 | 92 | export const ODOS_REBATE_ADDRESSES: string[] = []; 93 | 94 | export const HERA_FINANCE_REBATE_ADDRESSES: string[] = [ 95 | "0x1111110808b63f93b869a8a8ef87bc5b4dd79689", 96 | ]; 97 | 98 | export const THOR_SWAP_REBATE_ADDRESSES: string[] = [ 99 | "0x72c6d8fcc3e591253a1eb563180d317998346bec", 100 | ]; 101 | 102 | export const OKX_REBATE_ADDRESSES: string[] = []; 103 | 104 | export const ONTO_REBATE_ADDRESSES: string[] = [ 105 | "0x0ce56280bf51dc8211952c3522d4e1ce917319a6", 106 | ]; 107 | 108 | export const YETI_REBATE_ADDRESSES: string[] = [ 109 | "0x718c79e7c12f7e2c1a5d641c81d02eb7566db9a8", 110 | ]; 111 | 112 | export const JOY_REBATE_ADDRESSES: string[] = []; 113 | 114 | export const ZETA_FARM_REBATE_ADDRESSES: string[] = [ 115 | "0x04a285427eee8ade8dce32299478e4522fb7c287", 116 | ]; 117 | 118 | export const SLINGSHOT_REBATE_ADDRESSES: string[] = []; 119 | 120 | export const KALM_REBATE_ADDRESSES: string[] = []; 121 | 122 | export const UNIZEN_REBATE_ADDRESSES: string[] = [ 123 | "0xaf951f7a4aa4e2a033b034af0897273ed553e8c3", 124 | ]; 125 | 126 | export const KYBER_SWAP_REBATE_ADDRESSES: string[] = [ 127 | "0x4f82e73edb06d29ff62c91ec8f5ff06571bdeb29", 128 | ]; 129 | 130 | export const ONE_DELTA_REBATE_ADDRESSES: string[] = [ 131 | "0xc95eed7f6e8334611765f84ceb8ed6270f08907e", 132 | ]; 133 | 134 | export const EISEN_REBATE_ADDRESSES: string[] = []; 135 | 136 | export const HYPERSONIC_REBATE_ADDRESSES: string[] = []; 137 | 138 | export let REBATE_ADDRESSES: string[][] = [ 139 | WOOFI_REBATE_ADDRESSES, // 0: WOOFi 140 | ONE_INCH_REBATE_ADDRESSES, // 1: 1inch 141 | DODO_REBATE_ADDRESSES, // 2: DODO 142 | OPEN_OCEAN_REBATE_ADDRESSES, // 3: OpenOcean 143 | METAMASK_REBATE_ADDRESSES, // 4: MetaMask 144 | YIELD_YAK_REBATE_ADDRESSES, // 5: YieldYak 145 | FIRE_BIRD_REBATE_ADDRESSES, // 6: FireBird 146 | BIT_KEEP_REBATE_ADDRESSES, // 7: BitKeep 147 | PARA_SWAP_REBATE_ADDRESSES, // 8: ParaSwap 148 | BEETHOVEN_X_REBATE_ADDRESSES, // 9: BeethovenX 149 | TRANSIT_SWAP_REBATE_ADDRESSES, // 10: TransitSwap 150 | ZERO_X_REBATE_ADDRESSES, // 11: 0x 151 | ODOS_REBATE_ADDRESSES, // 12: ODOS 152 | HERA_FINANCE_REBATE_ADDRESSES, // 13: HeraFinance 153 | THOR_SWAP_REBATE_ADDRESSES, // 14: THORSwap 154 | OKX_REBATE_ADDRESSES, // 15: OKX 155 | ONTO_REBATE_ADDRESSES, // 16: ONTO 156 | YETI_REBATE_ADDRESSES, // 17: Yeti 157 | JOY_REBATE_ADDRESSES, // 18: Joy 158 | ZETA_FARM_REBATE_ADDRESSES, // 19: ZetaFarm 159 | SLINGSHOT_REBATE_ADDRESSES, // 20: Slingshot 160 | KALM_REBATE_ADDRESSES, // 21: KALM 161 | UNIZEN_REBATE_ADDRESSES, // 22: unizen 162 | KYBER_SWAP_REBATE_ADDRESSES, // 23: KyberSwap 163 | ONE_DELTA_REBATE_ADDRESSES, // 24: 1delta 164 | EISEN_REBATE_ADDRESSES, // 25: Eisen 165 | HYPERSONIC_REBATE_ADDRESSES, // 26: Hypersonic 166 | ]; 167 | 168 | export const GLOBAL_VARIABLE_ID = "0"; 169 | export const ORDER_HISTORY_VARIABLE_ID = "0"; 170 | export const CROSS_CHAIN_SRC_ORDER_HISTORY_VARIABLE_ID = "1"; 171 | export const CROSS_CHAIN_DST_ORDER_HISTORY_VARIABLE_ID = "2"; 172 | 173 | export const WOOFI_ORDER_SOURCE_ID = "0"; 174 | export const OTHER_ORDER_SOURCE_ID = "99"; 175 | export const GET_ORDER_SOURCE_BY_WOO_ROUTER_SWAP_FROM_ID = "-99"; 176 | 177 | export const WOOFI_SWAP_TYPE = 0; 178 | -------------------------------------------------------------------------------- /abis/ERC20.json: -------------------------------------------------------------------------------- 1 | [{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"event","name":"AddSupportedChainId","inputs":[{"type":"uint256","name":"chainId","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"AddSwapToken","inputs":[{"type":"address","name":"contractAddress","internalType":"address","indexed":false},{"type":"uint256","name":"supplyIncrement","internalType":"uint256","indexed":false}],"anonymous":false},{"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":"MigrateBridgeRole","inputs":[{"type":"address","name":"newBridgeRoleAddress","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Mint","inputs":[{"type":"address","name":"to","internalType":"address","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"address","name":"feeAddress","internalType":"address","indexed":false},{"type":"uint256","name":"feeAmount","internalType":"uint256","indexed":false},{"type":"bytes32","name":"originTxId","internalType":"bytes32","indexed":false}],"anonymous":false},{"type":"event","name":"RemoveSwapToken","inputs":[{"type":"address","name":"contractAddress","internalType":"address","indexed":false},{"type":"uint256","name":"supplyDecrement","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Swap","inputs":[{"type":"address","name":"token","internalType":"address","indexed":false},{"type":"uint256","name":"amount","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":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Unwrap","inputs":[{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint256","name":"chainId","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addSupportedChainId","inputs":[{"type":"uint256","name":"chainId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addSwapToken","inputs":[{"type":"address","name":"contractAddress","internalType":"address"},{"type":"uint256","name":"supplyIncrement","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":"nonpayable","outputs":[],"name":"burn","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"burnFrom","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"chainIds","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"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":[{"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":"migrateBridgeRole","inputs":[{"type":"address","name":"newBridgeRoleAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mint","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"address","name":"feeAddress","internalType":"address"},{"type":"uint256","name":"feeAmount","internalType":"uint256"},{"type":"bytes32","name":"originTxId","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeSwapToken","inputs":[{"type":"address","name":"contractAddress","internalType":"address"},{"type":"uint256","name":"supplyDecrement","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"swap","inputs":[{"type":"address","name":"token","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"swapSupply","inputs":[{"type":"address","name":"token","internalType":"address"}]},{"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":"unwrap","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"chainId","internalType":"uint256"}]}] -------------------------------------------------------------------------------- /src/multichain/zksync.ts: -------------------------------------------------------------------------------- 1 | import { BigDecimal, BigInt, TypedMap } from "@graphprotocol/graph-ts"; 2 | 3 | export let BI_0 = BigInt.fromI32(0); 4 | export let BI_1 = BigInt.fromI32(1); 5 | export let BI_2 = BigInt.fromI32(2); 6 | export let BI_6 = BigInt.fromI32(6); 7 | export let BI_8 = BigInt.fromI32(8); 8 | export let BI_18 = BigInt.fromI32(18); 9 | 10 | export let BD_0 = BigDecimal.fromString("0"); 11 | export let BD_1 = BigDecimal.fromString("1"); 12 | 13 | // Address Must Be Lower Case!!! 14 | export const ETHER = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"; 15 | export const ETHER_SYMBOL = "ETH"; 16 | export const ETHER_NAME = "eth"; 17 | 18 | export const WRAPPED = "0x5aea5775959fbc2557cc8789bc1bf90a239d9a91"; 19 | 20 | export const STABLE_TOKENS: string[] = [ 21 | "0x3355df6d4c9c3035724fd0e3914de96a5a83aaf4", // USDC.e 22 | "0x1d17cbcf0d6d143135ae902365d2e5e2a16538d4", // USDC 23 | ]; 24 | 25 | // Contract Name as Variable Name 26 | export const WOO_ROUTER_SOURCES: string[] = [ 27 | "0xfd505702b37ae9b626952eb2dd736d9045876417", // WooRouterV2 28 | "0x09873bfeca34f1acd0a7e55cda591f05d8a75369", // WooRouterV2 29 | ]; 30 | 31 | export const WOO_PP_SOURCES: string[] = [ 32 | "0x42ed123eb5266a5b8e2b54b2c76180ccf5e72fee", // WooPPV2 33 | "0xe656d70bc3550e3eee9de7dc79367a44fd13d975", // WooPPV2 34 | "0x604dcc6434f77d611c68309f52a5fadf81be96ec", // WooPPV2 35 | ]; 36 | 37 | export let WOO_PP_QUOTE_TOKENS = new TypedMap(); 38 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[0], STABLE_TOKENS[0]); // USDC.e 39 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[1], STABLE_TOKENS[1]); // USDC 40 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[2], STABLE_TOKENS[1]); // USDC 41 | 42 | export const WOO_VAULT_MANAGER_SOURCES: string[] = []; 43 | 44 | // destination swap called by Layer Zero Relayer 45 | export const LAYER_ZERO_SOURCES: string[] = []; 46 | 47 | export const WOOFI_SOURCES: string[] = WOO_ROUTER_SOURCES.concat(WOO_PP_SOURCES).concat(WOO_VAULT_MANAGER_SOURCES).concat(LAYER_ZERO_SOURCES); 48 | 49 | export const WOOFI_REBATE_ADDRESSES: string[] = []; 50 | 51 | export const ONE_INCH_REBATE_ADDRESSES: string[] = [ 52 | "0x703a96e7d7a6d05d2d7f3f8223fd538c23897ce8", 53 | "0x910bf2d50fa5e014fd06666f456182d4ab7c8bd2", 54 | ]; 55 | 56 | export const DODO_REBATE_ADDRESSES: string[] = [ 57 | "0xea8e147bdb3ee3dde2085acb88de826e1a6de37a", 58 | "0xce9f9716fec7b4c11c773751aa579b1908fe9f5b", 59 | ]; 60 | 61 | export const OPEN_OCEAN_REBATE_ADDRESSES: string[] = [ 62 | "0x353c1f0bc78fbbc245b3c93ef77b1dcc5b77d2a0", 63 | "0x922164bbbd36acf9e854acbbf32facc949fcaeef", 64 | ]; 65 | 66 | export const METAMASK_REBATE_ADDRESSES: string[] = []; 67 | 68 | export const YIELD_YAK_REBATE_ADDRESSES: string[] = [ 69 | "0x5925c5c6843a8f67f7ef2b55db1f5491573c85eb", 70 | ]; 71 | 72 | export const FIRE_BIRD_REBATE_ADDRESSES: string[] = [ 73 | "0xa20ca7c6705fb88847cbf50549d7a38f4e99d32c", 74 | ]; 75 | 76 | export const BIT_KEEP_REBATE_ADDRESSES: string[] = [ 77 | "0x9712394caccab28acd26d41f7e0566c1e88759aa", 78 | ]; 79 | 80 | export const PARA_SWAP_REBATE_ADDRESSES: string[] = [ 81 | "0xdef171fe48cf0115b1d80b88dc8eab59176fee57", 82 | "0xd5b927956057075377263aab7f8afc12f85100db", 83 | ]; 84 | 85 | export const BEETHOVEN_X_REBATE_ADDRESSES: string[] = []; 86 | 87 | export const TRANSIT_SWAP_REBATE_ADDRESSES: string[] = [ 88 | "0x92106728f6efe170f8de919e1bd88c04c2473d3c", 89 | ]; 90 | 91 | export const ZERO_X_REBATE_ADDRESSES: string[] = [ 92 | "0xbfdcbb4c05843163f491c24f9c0019c510786304", 93 | "0x5e01d320e95133d80dd59a2191c95728fa69036d", 94 | ]; 95 | 96 | export const ODOS_REBATE_ADDRESSES: string[] = [ 97 | "0x74c0e53f5c8af5f28b2484e7c46fb859ad4cb799", 98 | "0x5e1c87a1589bcc4325db77be49874941b2297a7b", 99 | ]; 100 | 101 | export const HERA_FINANCE_REBATE_ADDRESSES: string[] = [ 102 | "0x1111110808b63f93b869a8a8ef87bc5b4dd79689", 103 | ]; 104 | 105 | export const THOR_SWAP_REBATE_ADDRESSES: string[] = [ 106 | "0x72c6d8fcc3e591253a1eb563180d317998346bec", 107 | ]; 108 | 109 | export const OKX_REBATE_ADDRESSES: string[] = []; 110 | 111 | export const ONTO_REBATE_ADDRESSES: string[] = [ 112 | "0x0ce56280bf51dc8211952c3522d4e1ce917319a6", 113 | ]; 114 | 115 | export const YETI_REBATE_ADDRESSES: string[] = [ 116 | "0x718c79e7c12f7e2c1a5d641c81d02eb7566db9a8", 117 | ]; 118 | 119 | export const JOY_REBATE_ADDRESSES: string[] = []; 120 | 121 | export const ZETA_FARM_REBATE_ADDRESSES: string[] = [ 122 | "0x04a285427eee8ade8dce32299478e4522fb7c287", 123 | ]; 124 | 125 | export const SLINGSHOT_REBATE_ADDRESSES: string[] = []; 126 | 127 | export const KALM_REBATE_ADDRESSES: string[] = []; 128 | 129 | export const UNIZEN_REBATE_ADDRESSES: string[] = [ 130 | "0xaf951f7a4aa4e2a033b034af0897273ed553e8c3", 131 | ]; 132 | 133 | export const KYBER_SWAP_REBATE_ADDRESSES: string[] = [ 134 | "0x4f82e73edb06d29ff62c91ec8f5ff06571bdeb29", 135 | ]; 136 | 137 | export const ONE_DELTA_REBATE_ADDRESSES: string[] = [ 138 | "0xc95eed7f6e8334611765f84ceb8ed6270f08907e", 139 | ]; 140 | 141 | export const EISEN_REBATE_ADDRESSES: string[] = []; 142 | 143 | export const HYPERSONIC_REBATE_ADDRESSES: string[] = []; 144 | 145 | export let REBATE_ADDRESSES: string[][] = [ 146 | WOOFI_REBATE_ADDRESSES, // 0: WOOFi 147 | ONE_INCH_REBATE_ADDRESSES, // 1: 1inch 148 | DODO_REBATE_ADDRESSES, // 2: DODO 149 | OPEN_OCEAN_REBATE_ADDRESSES, // 3: OpenOcean 150 | METAMASK_REBATE_ADDRESSES, // 4: MetaMask 151 | YIELD_YAK_REBATE_ADDRESSES, // 5: YieldYak 152 | FIRE_BIRD_REBATE_ADDRESSES, // 6: FireBird 153 | BIT_KEEP_REBATE_ADDRESSES, // 7: BitKeep 154 | PARA_SWAP_REBATE_ADDRESSES, // 8: ParaSwap 155 | BEETHOVEN_X_REBATE_ADDRESSES, // 9: BeethovenX 156 | TRANSIT_SWAP_REBATE_ADDRESSES, // 10: TransitSwap 157 | ZERO_X_REBATE_ADDRESSES, // 11: 0x 158 | ODOS_REBATE_ADDRESSES, // 12: ODOS 159 | HERA_FINANCE_REBATE_ADDRESSES, // 13: HeraFinance 160 | THOR_SWAP_REBATE_ADDRESSES, // 14: THORSwap 161 | OKX_REBATE_ADDRESSES, // 15: OKX 162 | ONTO_REBATE_ADDRESSES, // 16: ONTO 163 | YETI_REBATE_ADDRESSES, // 17: Yeti 164 | JOY_REBATE_ADDRESSES, // 18: Joy 165 | ZETA_FARM_REBATE_ADDRESSES, // 19: ZetaFarm 166 | SLINGSHOT_REBATE_ADDRESSES, // 20: Slingshot 167 | KALM_REBATE_ADDRESSES, // 21: KALM 168 | UNIZEN_REBATE_ADDRESSES, // 22: unizen 169 | KYBER_SWAP_REBATE_ADDRESSES, // 23: KyberSwap 170 | ONE_DELTA_REBATE_ADDRESSES, // 24: 1delta 171 | EISEN_REBATE_ADDRESSES, // 25: Eisen 172 | HYPERSONIC_REBATE_ADDRESSES, // 26: Hypersonic 173 | ]; 174 | 175 | export const GLOBAL_VARIABLE_ID = "0"; 176 | export const ORDER_HISTORY_VARIABLE_ID = "0"; 177 | export const CROSS_CHAIN_SRC_ORDER_HISTORY_VARIABLE_ID = "1"; 178 | export const CROSS_CHAIN_DST_ORDER_HISTORY_VARIABLE_ID = "2"; 179 | 180 | export const WOOFI_ORDER_SOURCE_ID = "0"; 181 | export const OTHER_ORDER_SOURCE_ID = "99"; 182 | export const GET_ORDER_SOURCE_BY_WOO_ROUTER_SWAP_FROM_ID = "-99"; 183 | 184 | export const WOOFI_SWAP_TYPE = 0; 185 | -------------------------------------------------------------------------------- /src/multichain/fantom.ts: -------------------------------------------------------------------------------- 1 | import { BigDecimal, BigInt, TypedMap } from "@graphprotocol/graph-ts"; 2 | 3 | export let BI_0 = BigInt.fromI32(0); 4 | export let BI_1 = BigInt.fromI32(1); 5 | export let BI_2 = BigInt.fromI32(2); 6 | export let BI_6 = BigInt.fromI32(6); 7 | export let BI_8 = BigInt.fromI32(8); 8 | export let BI_18 = BigInt.fromI32(18); 9 | 10 | export let BD_0 = BigDecimal.fromString("0"); 11 | export let BD_1 = BigDecimal.fromString("1"); 12 | 13 | // Address Must Be Lower Case!!! 14 | export const ETHER = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"; 15 | export const ETHER_SYMBOL = "FTM"; 16 | export const ETHER_NAME = "fantom"; 17 | 18 | export const WRAPPED = "0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83"; 19 | 20 | export const STABLE_TOKENS: string[] = [ 21 | "0x049d68029688eabf473097a2fc38ef61633a3c7a", // USDT 22 | "0x04068da6c83afcfa0e13ba15a6696662335d5b75", // USDC 23 | ]; 24 | 25 | // Contract Name as Variable Name 26 | export const WOO_ROUTER_SOURCES: string[] = [ 27 | "0x37b5a5a730dad670874f26cc5507bb1b9705e447", // WooRouterV1 28 | "0x382a9b0bc5d29e96c3a0b81ce9c64d6c8f150efb", // WooRouterV2 29 | "0xcf6ce5fd6bf28bb1aeac88a55251f6c840059de5", // WooCrossChainRouterV1 30 | "0x28d2b949024fe50627f1ebc5f0ca3ca721148e40", // WooCrossChainRouterV1 31 | "0x72dc7fa5eeb901a34173c874a7333c8d1b34bca9", // WooCrossChainRouterV2 32 | ]; 33 | 34 | export const WOO_PP_SOURCES: string[] = [ 35 | "0x9503e7517d3c5bc4f9e4a1c6ae4f8b33ac2546f2", // WooPPV1 36 | "0x286ab107c5e9083dbed35a2b5fb0242538f4f9bf", // WooPPV2 37 | ]; 38 | 39 | export let WOO_PP_QUOTE_TOKENS = new TypedMap(); 40 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[0], STABLE_TOKENS[1]); // USDC 41 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[1], STABLE_TOKENS[1]); // USDC 42 | 43 | export const WOO_VAULT_MANAGER_SOURCES: string[] = [ 44 | "0x58c73f7e102bc6bcdc6b092ef0399b3e06d6b3e3", 45 | "0xee7ac4d3d3a51de966078809fc7a91834f5ea3b9", 46 | ]; 47 | 48 | // destination swap called by Layer Zero Relayer 49 | export const LAYER_ZERO_SOURCES: string[] = [ 50 | "0x5b19bd330a84c049b62d5b0fc2ba120217a18c1c", // Relayer 51 | "0x52eea5c490fb89c7a0084b32feab854eeff07c82", // Relayer 52 | ]; 53 | 54 | export const WOOFI_SOURCES: string[] = WOO_ROUTER_SOURCES.concat(WOO_PP_SOURCES).concat(WOO_VAULT_MANAGER_SOURCES).concat(LAYER_ZERO_SOURCES); 55 | 56 | export const WOOFI_REBATE_ADDRESSES: string[] = []; 57 | 58 | export const ONE_INCH_REBATE_ADDRESSES: string[] = [ 59 | "0x703a96e7d7a6d05d2d7f3f8223fd538c23897ce8", 60 | "0x910bf2d50fa5e014fd06666f456182d4ab7c8bd2", 61 | ]; 62 | 63 | export const DODO_REBATE_ADDRESSES: string[] = [ 64 | "0xea8e147bdb3ee3dde2085acb88de826e1a6de37a", 65 | "0xce9f9716fec7b4c11c773751aa579b1908fe9f5b", 66 | ]; 67 | 68 | export const OPEN_OCEAN_REBATE_ADDRESSES: string[] = [ 69 | "0x353c1f0bc78fbbc245b3c93ef77b1dcc5b77d2a0", 70 | "0x922164bbbd36acf9e854acbbf32facc949fcaeef", 71 | ]; 72 | 73 | export const METAMASK_REBATE_ADDRESSES: string[] = []; 74 | 75 | export const YIELD_YAK_REBATE_ADDRESSES: string[] = [ 76 | "0x5925c5c6843a8f67f7ef2b55db1f5491573c85eb", 77 | ]; 78 | 79 | export const FIRE_BIRD_REBATE_ADDRESSES: string[] = [ 80 | "0xa20ca7c6705fb88847cbf50549d7a38f4e99d32c", 81 | ]; 82 | 83 | export const BIT_KEEP_REBATE_ADDRESSES: string[] = [ 84 | "0x9712394caccab28acd26d41f7e0566c1e88759aa", 85 | ]; 86 | 87 | export const PARA_SWAP_REBATE_ADDRESSES: string[] = [ 88 | "0xdef171fe48cf0115b1d80b88dc8eab59176fee57", 89 | "0xd5b927956057075377263aab7f8afc12f85100db", 90 | ]; 91 | 92 | export const BEETHOVEN_X_REBATE_ADDRESSES: string[] = []; 93 | 94 | export const TRANSIT_SWAP_REBATE_ADDRESSES: string[] = [ 95 | "0x92106728f6efe170f8de919e1bd88c04c2473d3c", 96 | ]; 97 | 98 | export const ZERO_X_REBATE_ADDRESSES: string[] = [ 99 | "0xbfdcbb4c05843163f491c24f9c0019c510786304", 100 | "0x5e01d320e95133d80dd59a2191c95728fa69036d", 101 | ]; 102 | 103 | export const ODOS_REBATE_ADDRESSES: string[] = []; 104 | 105 | export const HERA_FINANCE_REBATE_ADDRESSES: string[] = [ 106 | "0x1111110808b63f93b869a8a8ef87bc5b4dd79689", 107 | ]; 108 | 109 | export const THOR_SWAP_REBATE_ADDRESSES: string[] = [ 110 | "0x72c6d8fcc3e591253a1eb563180d317998346bec", 111 | ]; 112 | 113 | export const OKX_REBATE_ADDRESSES: string[] = []; 114 | 115 | export const ONTO_REBATE_ADDRESSES: string[] = [ 116 | "0x0ce56280bf51dc8211952c3522d4e1ce917319a6", 117 | ]; 118 | 119 | export const YETI_REBATE_ADDRESSES: string[] = [ 120 | "0x718c79e7c12f7e2c1a5d641c81d02eb7566db9a8", 121 | ]; 122 | 123 | export const JOY_REBATE_ADDRESSES: string[] = []; 124 | 125 | export const ZETA_FARM_REBATE_ADDRESSES: string[] = [ 126 | "0x04a285427eee8ade8dce32299478e4522fb7c287", 127 | ]; 128 | 129 | export const SLINGSHOT_REBATE_ADDRESSES: string[] = []; 130 | 131 | export const KALM_REBATE_ADDRESSES: string[] = []; 132 | 133 | export const UNIZEN_REBATE_ADDRESSES: string[] = [ 134 | "0xaf951f7a4aa4e2a033b034af0897273ed553e8c3", 135 | ]; 136 | 137 | export const KYBER_SWAP_REBATE_ADDRESSES: string[] = [ 138 | "0x4f82e73edb06d29ff62c91ec8f5ff06571bdeb29", 139 | ]; 140 | 141 | export const ONE_DELTA_REBATE_ADDRESSES: string[] = [ 142 | "0xc95eed7f6e8334611765f84ceb8ed6270f08907e", 143 | ]; 144 | 145 | export const EISEN_REBATE_ADDRESSES: string[] = []; 146 | 147 | export const HYPERSONIC_REBATE_ADDRESSES: string[] = []; 148 | 149 | export let REBATE_ADDRESSES: string[][] = [ 150 | WOOFI_REBATE_ADDRESSES, // 0: WOOFi 151 | ONE_INCH_REBATE_ADDRESSES, // 1: 1inch 152 | DODO_REBATE_ADDRESSES, // 2: DODO 153 | OPEN_OCEAN_REBATE_ADDRESSES, // 3: OpenOcean 154 | METAMASK_REBATE_ADDRESSES, // 4: MetaMask 155 | YIELD_YAK_REBATE_ADDRESSES, // 5: YieldYak 156 | FIRE_BIRD_REBATE_ADDRESSES, // 6: FireBird 157 | BIT_KEEP_REBATE_ADDRESSES, // 7: BitKeep 158 | PARA_SWAP_REBATE_ADDRESSES, // 8: ParaSwap 159 | BEETHOVEN_X_REBATE_ADDRESSES, // 9: BeethovenX 160 | TRANSIT_SWAP_REBATE_ADDRESSES, // 10: TransitSwap 161 | ZERO_X_REBATE_ADDRESSES, // 11: 0x 162 | ODOS_REBATE_ADDRESSES, // 12: ODOS 163 | HERA_FINANCE_REBATE_ADDRESSES, // 13: HeraFinance 164 | THOR_SWAP_REBATE_ADDRESSES, // 14: THORSwap 165 | OKX_REBATE_ADDRESSES, // 15: OKX 166 | ONTO_REBATE_ADDRESSES, // 16: ONTO 167 | YETI_REBATE_ADDRESSES, // 17: Yeti 168 | JOY_REBATE_ADDRESSES, // 18: Joy 169 | ZETA_FARM_REBATE_ADDRESSES, // 19: ZetaFarm 170 | SLINGSHOT_REBATE_ADDRESSES, // 20: Slingshot 171 | KALM_REBATE_ADDRESSES, // 21: KALM 172 | UNIZEN_REBATE_ADDRESSES, // 22: unizen 173 | KYBER_SWAP_REBATE_ADDRESSES, // 23: KyberSwap 174 | ONE_DELTA_REBATE_ADDRESSES, // 24: 1delta 175 | EISEN_REBATE_ADDRESSES, // 25: Eisen 176 | HYPERSONIC_REBATE_ADDRESSES, // 26: Hypersonic 177 | ]; 178 | 179 | export const GLOBAL_VARIABLE_ID = "0"; 180 | export const ORDER_HISTORY_VARIABLE_ID = "0"; 181 | export const CROSS_CHAIN_SRC_ORDER_HISTORY_VARIABLE_ID = "1"; 182 | export const CROSS_CHAIN_DST_ORDER_HISTORY_VARIABLE_ID = "2"; 183 | 184 | export const WOOFI_ORDER_SOURCE_ID = "0"; 185 | export const OTHER_ORDER_SOURCE_ID = "99"; 186 | export const GET_ORDER_SOURCE_BY_WOO_ROUTER_SWAP_FROM_ID = "-99"; 187 | 188 | export const WOOFI_SWAP_TYPE = 0; 189 | -------------------------------------------------------------------------------- /src/multichain/linea.ts: -------------------------------------------------------------------------------- 1 | import { BigDecimal, BigInt, TypedMap } from "@graphprotocol/graph-ts"; 2 | 3 | export let BI_0 = BigInt.fromI32(0); 4 | export let BI_1 = BigInt.fromI32(1); 5 | export let BI_2 = BigInt.fromI32(2); 6 | export let BI_6 = BigInt.fromI32(6); 7 | export let BI_8 = BigInt.fromI32(8); 8 | export let BI_18 = BigInt.fromI32(18); 9 | 10 | export let BD_0 = BigDecimal.fromString("0"); 11 | export let BD_1 = BigDecimal.fromString("1"); 12 | 13 | // Address Must Be Lower Case!!! 14 | export const ETHER = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"; 15 | export const ETHER_SYMBOL = "ETH"; 16 | export const ETHER_NAME = "eth"; 17 | 18 | export const WRAPPED = "0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f"; 19 | 20 | export const STABLE_TOKENS: string[] = [ 21 | "0x176211869ca2b568f2a7d4ee941e073a821ee1ff", // USDC 22 | ]; 23 | 24 | // Contract Name as Variable Name 25 | export const WOO_ROUTER_SOURCES: string[] = [ 26 | "0x39d361e66798155813b907a70d6c2e3fdafb0877", // WooRouterV2 27 | "0x4c4af8dbc524681930a27b2f1af5bcc8062e6fb7", // WooRouterV2 28 | "0x376d567c5794cfc64c74852a9db2105e0b5b482c", // WooCrossChainRouterV2 29 | "0xe47fec1c72850d867a1655c4c5902de7728ca205", // WooCrossChainRouterV3 30 | "0xca10e8825fa9f1db0651cd48a9097997dbf7615d", // WooCrossChainRouterV4 31 | ]; 32 | 33 | export const WOO_PP_SOURCES: string[] = [ 34 | "0xf5d215d9c84778f85746d15762daf39b9e83a2d6", // WooPPV2 35 | "0xed9e3f98bbed560e66b89aac922e29d4596a9642", // WooPPV2 36 | "0x5520385bfcf07ec87c4c53a7d8d65595dff69fa4", // WooPPV2 37 | ]; 38 | 39 | export let WOO_PP_QUOTE_TOKENS = new TypedMap(); 40 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[0], STABLE_TOKENS[0]); // USDC 41 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[1], STABLE_TOKENS[0]); // USDC 42 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[2], STABLE_TOKENS[0]); // USDC 43 | 44 | export const WOO_VAULT_MANAGER_SOURCES: string[] = []; 45 | 46 | // destination swap called by Layer Zero Relayer 47 | export const LAYER_ZERO_SOURCES: string[] = [ 48 | "0xa658742d33ebd2ce2f0bdff73515aa797fd161d9", 49 | ]; 50 | 51 | export const WOOFI_SOURCES: string[] = WOO_ROUTER_SOURCES.concat(WOO_PP_SOURCES).concat(WOO_VAULT_MANAGER_SOURCES).concat(LAYER_ZERO_SOURCES); 52 | 53 | export const WOOFI_REBATE_ADDRESSES: string[] = []; 54 | 55 | export const ONE_INCH_REBATE_ADDRESSES: string[] = [ 56 | "0x703a96e7d7a6d05d2d7f3f8223fd538c23897ce8", 57 | "0x910bf2d50fa5e014fd06666f456182d4ab7c8bd2", 58 | ]; 59 | 60 | export const DODO_REBATE_ADDRESSES: string[] = [ 61 | "0xea8e147bdb3ee3dde2085acb88de826e1a6de37a", 62 | "0xce9f9716fec7b4c11c773751aa579b1908fe9f5b", 63 | ]; 64 | 65 | export const OPEN_OCEAN_REBATE_ADDRESSES: string[] = [ 66 | "0x353c1f0bc78fbbc245b3c93ef77b1dcc5b77d2a0", 67 | "0x922164bbbd36acf9e854acbbf32facc949fcaeef", 68 | ]; 69 | 70 | export const METAMASK_REBATE_ADDRESSES: string[] = []; 71 | 72 | export const YIELD_YAK_REBATE_ADDRESSES: string[] = [ 73 | "0x5925c5c6843a8f67f7ef2b55db1f5491573c85eb", 74 | ]; 75 | 76 | export const FIRE_BIRD_REBATE_ADDRESSES: string[] = [ 77 | "0xa20ca7c6705fb88847cbf50549d7a38f4e99d32c", 78 | ]; 79 | 80 | export const BIT_KEEP_REBATE_ADDRESSES: string[] = [ 81 | "0x9712394caccab28acd26d41f7e0566c1e88759aa", 82 | ]; 83 | 84 | export const PARA_SWAP_REBATE_ADDRESSES: string[] = [ 85 | "0xdef171fe48cf0115b1d80b88dc8eab59176fee57", 86 | "0xd5b927956057075377263aab7f8afc12f85100db", 87 | ]; 88 | 89 | export const BEETHOVEN_X_REBATE_ADDRESSES: string[] = []; 90 | 91 | export const TRANSIT_SWAP_REBATE_ADDRESSES: string[] = [ 92 | "0x92106728f6efe170f8de919e1bd88c04c2473d3c", 93 | ]; 94 | 95 | export const ZERO_X_REBATE_ADDRESSES: string[] = [ 96 | "0xbfdcbb4c05843163f491c24f9c0019c510786304", 97 | "0x5e01d320e95133d80dd59a2191c95728fa69036d", 98 | ]; 99 | 100 | export const ODOS_REBATE_ADDRESSES: string[] = [ 101 | "0xf8c8967096a9f95e32592db29570dccc7893ed33", 102 | "0x498292dc123f19bdbc109081f6cf1d0e849a9daf", 103 | ]; 104 | 105 | export const HERA_FINANCE_REBATE_ADDRESSES: string[] = [ 106 | "0x1111110808b63f93b869a8a8ef87bc5b4dd79689", 107 | ]; 108 | 109 | export const THOR_SWAP_REBATE_ADDRESSES: string[] = [ 110 | "0x72c6d8fcc3e591253a1eb563180d317998346bec", 111 | ]; 112 | 113 | export const OKX_REBATE_ADDRESSES: string[] = []; 114 | 115 | export const ONTO_REBATE_ADDRESSES: string[] = [ 116 | "0x0ce56280bf51dc8211952c3522d4e1ce917319a6", 117 | ]; 118 | 119 | export const YETI_REBATE_ADDRESSES: string[] = [ 120 | "0x718c79e7c12f7e2c1a5d641c81d02eb7566db9a8", 121 | ]; 122 | 123 | export const JOY_REBATE_ADDRESSES: string[] = []; 124 | 125 | export const ZETA_FARM_REBATE_ADDRESSES: string[] = [ 126 | "0x04a285427eee8ade8dce32299478e4522fb7c287", 127 | ]; 128 | 129 | export const SLINGSHOT_REBATE_ADDRESSES: string[] = []; 130 | 131 | export const KALM_REBATE_ADDRESSES: string[] = []; 132 | 133 | export const UNIZEN_REBATE_ADDRESSES: string[] = [ 134 | "0xaf951f7a4aa4e2a033b034af0897273ed553e8c3", 135 | ]; 136 | 137 | export const KYBER_SWAP_REBATE_ADDRESSES: string[] = [ 138 | "0x4f82e73edb06d29ff62c91ec8f5ff06571bdeb29", 139 | ]; 140 | 141 | export const ONE_DELTA_REBATE_ADDRESSES: string[] = [ 142 | "0xc95eed7f6e8334611765f84ceb8ed6270f08907e", 143 | ]; 144 | 145 | export const EISEN_REBATE_ADDRESSES: string[] = [ 146 | "0xdaf87a186345f26d107d000fad351e79ff696d2c", 147 | ]; 148 | 149 | export const HYPERSONIC_REBATE_ADDRESSES: string[] = []; 150 | 151 | export const GLUEX_REBATE_ADDRESSES: string[] = [ 152 | "0x3cffef055725974e32a660a617fc999b67e9196e", 153 | ]; 154 | 155 | export let REBATE_ADDRESSES: string[][] = [ 156 | WOOFI_REBATE_ADDRESSES, // 0: WOOFi 157 | ONE_INCH_REBATE_ADDRESSES, // 1: 1inch 158 | DODO_REBATE_ADDRESSES, // 2: DODO 159 | OPEN_OCEAN_REBATE_ADDRESSES, // 3: OpenOcean 160 | METAMASK_REBATE_ADDRESSES, // 4: MetaMask 161 | YIELD_YAK_REBATE_ADDRESSES, // 5: YieldYak 162 | FIRE_BIRD_REBATE_ADDRESSES, // 6: FireBird 163 | BIT_KEEP_REBATE_ADDRESSES, // 7: BitKeep 164 | PARA_SWAP_REBATE_ADDRESSES, // 8: ParaSwap 165 | BEETHOVEN_X_REBATE_ADDRESSES, // 9: BeethovenX 166 | TRANSIT_SWAP_REBATE_ADDRESSES, // 10: TransitSwap 167 | ZERO_X_REBATE_ADDRESSES, // 11: 0x 168 | ODOS_REBATE_ADDRESSES, // 12: ODOS 169 | HERA_FINANCE_REBATE_ADDRESSES, // 13: HeraFinance 170 | THOR_SWAP_REBATE_ADDRESSES, // 14: THORSwap 171 | OKX_REBATE_ADDRESSES, // 15: OKX 172 | ONTO_REBATE_ADDRESSES, // 16: ONTO 173 | YETI_REBATE_ADDRESSES, // 17: Yeti 174 | JOY_REBATE_ADDRESSES, // 18: Joy 175 | ZETA_FARM_REBATE_ADDRESSES, // 19: ZetaFarm 176 | SLINGSHOT_REBATE_ADDRESSES, // 20: Slingshot 177 | KALM_REBATE_ADDRESSES, // 21: KALM 178 | UNIZEN_REBATE_ADDRESSES, // 22: unizen 179 | KYBER_SWAP_REBATE_ADDRESSES, // 23: KyberSwap 180 | ONE_DELTA_REBATE_ADDRESSES, // 24: 1delta 181 | EISEN_REBATE_ADDRESSES, // 25: Eisen 182 | HYPERSONIC_REBATE_ADDRESSES, // 26: Hypersonic 183 | GLUEX_REBATE_ADDRESSES, // 27: GlueX 184 | ]; 185 | 186 | export const GLOBAL_VARIABLE_ID = "0"; 187 | export const ORDER_HISTORY_VARIABLE_ID = "0"; 188 | export const CROSS_CHAIN_SRC_ORDER_HISTORY_VARIABLE_ID = "1"; 189 | export const CROSS_CHAIN_DST_ORDER_HISTORY_VARIABLE_ID = "2"; 190 | 191 | export const WOOFI_ORDER_SOURCE_ID = "0"; 192 | export const OTHER_ORDER_SOURCE_ID = "99"; 193 | export const GET_ORDER_SOURCE_BY_WOO_ROUTER_SWAP_FROM_ID = "-99"; 194 | 195 | export const WOOFI_SWAP_TYPE = 0; 196 | -------------------------------------------------------------------------------- /src/multichain/mantle.ts: -------------------------------------------------------------------------------- 1 | import { BigDecimal, BigInt, TypedMap } from "@graphprotocol/graph-ts"; 2 | 3 | export let BI_0 = BigInt.fromI32(0); 4 | export let BI_1 = BigInt.fromI32(1); 5 | export let BI_2 = BigInt.fromI32(2); 6 | export let BI_6 = BigInt.fromI32(6); 7 | export let BI_8 = BigInt.fromI32(8); 8 | export let BI_18 = BigInt.fromI32(18); 9 | 10 | export let BD_0 = BigDecimal.fromString("0"); 11 | export let BD_1 = BigDecimal.fromString("1"); 12 | 13 | // Address Must Be Lower Case!!! 14 | export const ETHER = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"; 15 | export const ETHER_SYMBOL = "MNT"; 16 | export const ETHER_NAME = "mnt"; 17 | 18 | export const WRAPPED = "0x78c1b0c915c4faa5fffa6cabf0219da63d7f4cb8"; 19 | 20 | export const STABLE_TOKENS: string[] = [ 21 | "0x201eba5cc46d216ce6dc03f6a759e8e766e956ae", // USDT 22 | "0x09bc4e0d864854c6afb6eb9a9cdf58ac190d0df9", // USDC 23 | ]; 24 | 25 | // Contract Name as Variable Name 26 | export const WOO_ROUTER_SOURCES: string[] = [ 27 | "0xd14a997308f9e7514a8fea835064d596cdcaa99e", // WooRouterV2 28 | "0x4c4af8dbc524681930a27b2f1af5bcc8062e6fb7", // WooRouterV2 29 | "0xca10e8825fa9f1db0651cd48a9097997dbf7615d", // WooCrossChainRouterV4 30 | ]; 31 | 32 | export const WOO_PP_SOURCES: string[] = [ 33 | "0x9d1a92e601db0901e69bd810029f2c14bcca3128", // WooPPV2 34 | "0xed9e3f98bbed560e66b89aac922e29d4596a9642", // WooPPV2 35 | "0x5520385bfcf07ec87c4c53a7d8d65595dff69fa4", // WooPPV2 36 | ]; 37 | 38 | export let WOO_PP_QUOTE_TOKENS = new TypedMap(); 39 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[0], STABLE_TOKENS[0]); // USDT 40 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[1], STABLE_TOKENS[0]); // USDT 41 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[2], STABLE_TOKENS[0]); // USDT 42 | 43 | export const WOO_VAULT_MANAGER_SOURCES: string[] = []; 44 | 45 | // destination swap called by Layer Zero Relayer 46 | export const LAYER_ZERO_SOURCES: string[] = [ 47 | "0xcb566e3b6934fa77258d68ea18e931fa75e1aaaa", 48 | ]; 49 | 50 | export const WOOFI_SOURCES: string[] = WOO_ROUTER_SOURCES.concat(WOO_PP_SOURCES).concat(WOO_VAULT_MANAGER_SOURCES).concat(LAYER_ZERO_SOURCES); 51 | 52 | export const WOOFI_REBATE_ADDRESSES: string[] = []; 53 | 54 | export const ONE_INCH_REBATE_ADDRESSES: string[] = [ 55 | "0x703a96e7d7a6d05d2d7f3f8223fd538c23897ce8", 56 | "0x910bf2d50fa5e014fd06666f456182d4ab7c8bd2", 57 | ]; 58 | 59 | export const DODO_REBATE_ADDRESSES: string[] = [ 60 | "0xea8e147bdb3ee3dde2085acb88de826e1a6de37a", 61 | "0xce9f9716fec7b4c11c773751aa579b1908fe9f5b", 62 | ]; 63 | 64 | export const OPEN_OCEAN_REBATE_ADDRESSES: string[] = [ 65 | "0x353c1f0bc78fbbc245b3c93ef77b1dcc5b77d2a0", 66 | "0x922164bbbd36acf9e854acbbf32facc949fcaeef", 67 | ]; 68 | 69 | export const METAMASK_REBATE_ADDRESSES: string[] = []; 70 | 71 | export const YIELD_YAK_REBATE_ADDRESSES: string[] = [ 72 | "0x5925c5c6843a8f67f7ef2b55db1f5491573c85eb", 73 | "0x2235d025b6455420b099cf045dc23b60ab129841", 74 | ]; 75 | 76 | export const FIRE_BIRD_REBATE_ADDRESSES: string[] = [ 77 | "0xa20ca7c6705fb88847cbf50549d7a38f4e99d32c", 78 | ]; 79 | 80 | export const BIT_KEEP_REBATE_ADDRESSES: string[] = [ 81 | "0x9712394caccab28acd26d41f7e0566c1e88759aa", 82 | ]; 83 | 84 | export const PARA_SWAP_REBATE_ADDRESSES: string[] = [ 85 | "0xdef171fe48cf0115b1d80b88dc8eab59176fee57", 86 | "0xd5b927956057075377263aab7f8afc12f85100db", 87 | "0x65136b3e4f012e4c13aff0926091e2eadcfedb42", 88 | ]; 89 | 90 | export const BEETHOVEN_X_REBATE_ADDRESSES: string[] = []; 91 | 92 | export const TRANSIT_SWAP_REBATE_ADDRESSES: string[] = [ 93 | "0x92106728f6efe170f8de919e1bd88c04c2473d3c", 94 | ]; 95 | 96 | export const ZERO_X_REBATE_ADDRESSES: string[] = [ 97 | "0xbfdcbb4c05843163f491c24f9c0019c510786304", 98 | "0x5e01d320e95133d80dd59a2191c95728fa69036d", 99 | ]; 100 | 101 | export const ODOS_REBATE_ADDRESSES: string[] = [ 102 | "0x6d0253328bc9d68068b0d7dcd4034cc6eeb85dc5", 103 | "0x498292dc123f19bdbc109081f6cf1d0e849a9daf", 104 | ]; 105 | 106 | export const HERA_FINANCE_REBATE_ADDRESSES: string[] = [ 107 | "0x1111110808b63f93b869a8a8ef87bc5b4dd79689", 108 | ]; 109 | 110 | export const THOR_SWAP_REBATE_ADDRESSES: string[] = [ 111 | "0x72c6d8fcc3e591253a1eb563180d317998346bec", 112 | ]; 113 | 114 | export const OKX_REBATE_ADDRESSES: string[] = []; 115 | 116 | export const ONTO_REBATE_ADDRESSES: string[] = [ 117 | "0x0ce56280bf51dc8211952c3522d4e1ce917319a6", 118 | ]; 119 | 120 | export const YETI_REBATE_ADDRESSES: string[] = [ 121 | "0x718c79e7c12f7e2c1a5d641c81d02eb7566db9a8", 122 | ]; 123 | 124 | export const JOY_REBATE_ADDRESSES: string[] = []; 125 | 126 | export const ZETA_FARM_REBATE_ADDRESSES: string[] = [ 127 | "0x04a285427eee8ade8dce32299478e4522fb7c287", 128 | ]; 129 | 130 | export const SLINGSHOT_REBATE_ADDRESSES: string[] = []; 131 | 132 | export const KALM_REBATE_ADDRESSES: string[] = []; 133 | 134 | export const UNIZEN_REBATE_ADDRESSES: string[] = [ 135 | "0xaf951f7a4aa4e2a033b034af0897273ed553e8c3", 136 | ]; 137 | 138 | export const KYBER_SWAP_REBATE_ADDRESSES: string[] = [ 139 | "0x4f82e73edb06d29ff62c91ec8f5ff06571bdeb29", 140 | ]; 141 | 142 | export const ONE_DELTA_REBATE_ADDRESSES: string[] = [ 143 | "0xc95eed7f6e8334611765f84ceb8ed6270f08907e", 144 | ]; 145 | 146 | export const EISEN_REBATE_ADDRESSES: string[] = [ 147 | "0xdaf87a186345f26d107d000fad351e79ff696d2c", 148 | ]; 149 | 150 | export const HYPERSONIC_REBATE_ADDRESSES: string[] = []; 151 | 152 | export const GLUEX_REBATE_ADDRESSES: string[] = [ 153 | "0x3cffef055725974e32a660a617fc999b67e9196e", 154 | ]; 155 | 156 | export let REBATE_ADDRESSES: string[][] = [ 157 | WOOFI_REBATE_ADDRESSES, // 0: WOOFi 158 | ONE_INCH_REBATE_ADDRESSES, // 1: 1inch 159 | DODO_REBATE_ADDRESSES, // 2: DODO 160 | OPEN_OCEAN_REBATE_ADDRESSES, // 3: OpenOcean 161 | METAMASK_REBATE_ADDRESSES, // 4: MetaMask 162 | YIELD_YAK_REBATE_ADDRESSES, // 5: YieldYak 163 | FIRE_BIRD_REBATE_ADDRESSES, // 6: FireBird 164 | BIT_KEEP_REBATE_ADDRESSES, // 7: BitKeep 165 | PARA_SWAP_REBATE_ADDRESSES, // 8: ParaSwap 166 | BEETHOVEN_X_REBATE_ADDRESSES, // 9: BeethovenX 167 | TRANSIT_SWAP_REBATE_ADDRESSES, // 10: TransitSwap 168 | ZERO_X_REBATE_ADDRESSES, // 11: 0x 169 | ODOS_REBATE_ADDRESSES, // 12: ODOS 170 | HERA_FINANCE_REBATE_ADDRESSES, // 13: HeraFinance 171 | THOR_SWAP_REBATE_ADDRESSES, // 14: THORSwap 172 | OKX_REBATE_ADDRESSES, // 15: OKX 173 | ONTO_REBATE_ADDRESSES, // 16: ONTO 174 | YETI_REBATE_ADDRESSES, // 17: Yeti 175 | JOY_REBATE_ADDRESSES, // 18: Joy 176 | ZETA_FARM_REBATE_ADDRESSES, // 19: ZetaFarm 177 | SLINGSHOT_REBATE_ADDRESSES, // 20: Slingshot 178 | KALM_REBATE_ADDRESSES, // 21: KALM 179 | UNIZEN_REBATE_ADDRESSES, // 22: unizen 180 | KYBER_SWAP_REBATE_ADDRESSES, // 23: KyberSwap 181 | ONE_DELTA_REBATE_ADDRESSES, // 24: 1delta 182 | EISEN_REBATE_ADDRESSES, // 25: Eisen 183 | HYPERSONIC_REBATE_ADDRESSES, // 26: Hypersonic 184 | GLUEX_REBATE_ADDRESSES, // 27: GlueX 185 | ]; 186 | 187 | export const GLOBAL_VARIABLE_ID = "0"; 188 | export const ORDER_HISTORY_VARIABLE_ID = "0"; 189 | export const CROSS_CHAIN_SRC_ORDER_HISTORY_VARIABLE_ID = "1"; 190 | export const CROSS_CHAIN_DST_ORDER_HISTORY_VARIABLE_ID = "2"; 191 | 192 | export const WOOFI_ORDER_SOURCE_ID = "0"; 193 | export const OTHER_ORDER_SOURCE_ID = "99"; 194 | export const GET_ORDER_SOURCE_BY_WOO_ROUTER_SWAP_FROM_ID = "-99"; 195 | 196 | export const WOOFI_SWAP_TYPE = 0; 197 | -------------------------------------------------------------------------------- /src/multichain/base.ts: -------------------------------------------------------------------------------- 1 | import { BigDecimal, BigInt, TypedMap } from "@graphprotocol/graph-ts"; 2 | 3 | export let BI_0 = BigInt.fromI32(0); 4 | export let BI_1 = BigInt.fromI32(1); 5 | export let BI_2 = BigInt.fromI32(2); 6 | export let BI_6 = BigInt.fromI32(6); 7 | export let BI_8 = BigInt.fromI32(8); 8 | export let BI_18 = BigInt.fromI32(18); 9 | 10 | export let BD_0 = BigDecimal.fromString("0"); 11 | export let BD_1 = BigDecimal.fromString("1"); 12 | 13 | // Address Must Be Lower Case!!! 14 | export const ETHER = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"; 15 | export const ETHER_SYMBOL = "ETH"; 16 | export const ETHER_NAME = "eth"; 17 | 18 | export const WRAPPED = "0x4200000000000000000000000000000000000006"; 19 | 20 | export const STABLE_TOKENS: string[] = [ 21 | "0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca", // USDbC 22 | "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", // USDC 23 | ]; 24 | 25 | // Contract Name as Variable Name 26 | export const WOO_ROUTER_SOURCES: string[] = [ 27 | "0x27425e9fb6a9a625e8484cfd9620851d1fa322e5", // WooRouterV2 28 | "0x4c4af8dbc524681930a27b2f1af5bcc8062e6fb7", // WooRouterV2 29 | "0xf314fa27066bdde92e6122059b103e8899d0a096", // WooCrossChainRouterV2 30 | "0xe47fec1c72850d867a1655c4c5902de7728ca205", // WooCrossChainRouterV3 31 | "0xca10e8825fa9f1db0651cd48a9097997dbf7615d", // WooCrossChainRouterV4 32 | ]; 33 | 34 | export const WOO_PP_SOURCES: string[] = [ 35 | "0xb130a49065178465931d4f887056328cea5d723f", // WooPPV2 36 | "0xed9e3f98bbed560e66b89aac922e29d4596a9642", // WooPPV2 37 | "0x5520385bfcf07ec87c4c53a7d8d65595dff69fa4", // WooPPV2 38 | ]; 39 | 40 | export let WOO_PP_QUOTE_TOKENS = new TypedMap(); 41 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[0], STABLE_TOKENS[0]); // USDbC 42 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[1], STABLE_TOKENS[1]); // USDC 43 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[2], STABLE_TOKENS[1]); // USDC 44 | 45 | export const WOO_VAULT_MANAGER_SOURCES: string[] = []; 46 | 47 | // destination swap called by Layer Zero Relayer 48 | export const LAYER_ZERO_SOURCES: string[] = [ 49 | "0xcb566e3b6934fa77258d68ea18e931fa75e1aaaa", 50 | ]; 51 | 52 | export const WOOFI_SOURCES: string[] = WOO_ROUTER_SOURCES.concat(WOO_PP_SOURCES).concat(WOO_VAULT_MANAGER_SOURCES).concat(LAYER_ZERO_SOURCES); 53 | 54 | export const WOOFI_REBATE_ADDRESSES: string[] = []; 55 | 56 | export const ONE_INCH_REBATE_ADDRESSES: string[] = [ 57 | "0x703a96e7d7a6d05d2d7f3f8223fd538c23897ce8", 58 | "0x910bf2d50fa5e014fd06666f456182d4ab7c8bd2", 59 | ]; 60 | 61 | export const DODO_REBATE_ADDRESSES: string[] = [ 62 | "0xea8e147bdb3ee3dde2085acb88de826e1a6de37a", 63 | "0xce9f9716fec7b4c11c773751aa579b1908fe9f5b", 64 | ]; 65 | 66 | export const OPEN_OCEAN_REBATE_ADDRESSES: string[] = [ 67 | "0x353c1f0bc78fbbc245b3c93ef77b1dcc5b77d2a0", 68 | "0x922164bbbd36acf9e854acbbf32facc949fcaeef", 69 | ]; 70 | 71 | export const METAMASK_REBATE_ADDRESSES: string[] = []; 72 | 73 | export const YIELD_YAK_REBATE_ADDRESSES: string[] = [ 74 | "0x5925c5c6843a8f67f7ef2b55db1f5491573c85eb", 75 | ]; 76 | 77 | export const FIRE_BIRD_REBATE_ADDRESSES: string[] = [ 78 | "0xa20ca7c6705fb88847cbf50549d7a38f4e99d32c", 79 | ]; 80 | 81 | export const BIT_KEEP_REBATE_ADDRESSES: string[] = [ 82 | "0x9712394caccab28acd26d41f7e0566c1e88759aa", 83 | ]; 84 | 85 | export const PARA_SWAP_REBATE_ADDRESSES: string[] = [ 86 | "0xdef171fe48cf0115b1d80b88dc8eab59176fee57", 87 | "0xd5b927956057075377263aab7f8afc12f85100db", 88 | "0x65136b3e4f012e4c13aff0926091e2eadcfedb42", 89 | ]; 90 | 91 | export const BEETHOVEN_X_REBATE_ADDRESSES: string[] = []; 92 | 93 | export const TRANSIT_SWAP_REBATE_ADDRESSES: string[] = [ 94 | "0x92106728f6efe170f8de919e1bd88c04c2473d3c", 95 | ]; 96 | 97 | export const ZERO_X_REBATE_ADDRESSES: string[] = [ 98 | "0xbfdcbb4c05843163f491c24f9c0019c510786304", 99 | "0x5e01d320e95133d80dd59a2191c95728fa69036d", 100 | ]; 101 | 102 | export const ODOS_REBATE_ADDRESSES: string[] = [ 103 | "0xa7471690db0c93a7f827d1894c78df7379be11c0", 104 | "0x498292dc123f19bdbc109081f6cf1d0e849a9daf", 105 | ]; 106 | 107 | export const HERA_FINANCE_REBATE_ADDRESSES: string[] = [ 108 | "0x1111110808b63f93b869a8a8ef87bc5b4dd79689", 109 | ]; 110 | 111 | export const THOR_SWAP_REBATE_ADDRESSES: string[] = [ 112 | "0x72c6d8fcc3e591253a1eb563180d317998346bec", 113 | ]; 114 | 115 | export const OKX_REBATE_ADDRESSES: string[] = []; 116 | 117 | export const ONTO_REBATE_ADDRESSES: string[] = [ 118 | "0x0ce56280bf51dc8211952c3522d4e1ce917319a6", 119 | ]; 120 | 121 | export const YETI_REBATE_ADDRESSES: string[] = [ 122 | "0x718c79e7c12f7e2c1a5d641c81d02eb7566db9a8", 123 | ]; 124 | 125 | export const JOY_REBATE_ADDRESSES: string[] = []; 126 | 127 | export const ZETA_FARM_REBATE_ADDRESSES: string[] = [ 128 | "0x04a285427eee8ade8dce32299478e4522fb7c287", 129 | ]; 130 | 131 | export const SLINGSHOT_REBATE_ADDRESSES: string[] = []; 132 | 133 | export const KALM_REBATE_ADDRESSES: string[] = []; 134 | 135 | export const UNIZEN_REBATE_ADDRESSES: string[] = [ 136 | "0xaf951f7a4aa4e2a033b034af0897273ed553e8c3", 137 | ]; 138 | 139 | export const KYBER_SWAP_REBATE_ADDRESSES: string[] = [ 140 | "0x4f82e73edb06d29ff62c91ec8f5ff06571bdeb29", 141 | ]; 142 | 143 | export const ONE_DELTA_REBATE_ADDRESSES: string[] = [ 144 | "0xc95eed7f6e8334611765f84ceb8ed6270f08907e", 145 | ]; 146 | 147 | export const EISEN_REBATE_ADDRESSES: string[] = []; 148 | 149 | export const HYPERSONIC_REBATE_ADDRESSES: string[] = []; 150 | 151 | export const GLUEX_REBATE_ADDRESSES: string[] = [ 152 | "0x3cffef055725974e32a660a617fc999b67e9196e", 153 | ]; 154 | 155 | export let REBATE_ADDRESSES: string[][] = [ 156 | WOOFI_REBATE_ADDRESSES, // 0: WOOFi 157 | ONE_INCH_REBATE_ADDRESSES, // 1: 1inch 158 | DODO_REBATE_ADDRESSES, // 2: DODO 159 | OPEN_OCEAN_REBATE_ADDRESSES, // 3: OpenOcean 160 | METAMASK_REBATE_ADDRESSES, // 4: MetaMask 161 | YIELD_YAK_REBATE_ADDRESSES, // 5: YieldYak 162 | FIRE_BIRD_REBATE_ADDRESSES, // 6: FireBird 163 | BIT_KEEP_REBATE_ADDRESSES, // 7: BitKeep 164 | PARA_SWAP_REBATE_ADDRESSES, // 8: ParaSwap 165 | BEETHOVEN_X_REBATE_ADDRESSES, // 9: BeethovenX 166 | TRANSIT_SWAP_REBATE_ADDRESSES, // 10: TransitSwap 167 | ZERO_X_REBATE_ADDRESSES, // 11: 0x 168 | ODOS_REBATE_ADDRESSES, // 12: ODOS 169 | HERA_FINANCE_REBATE_ADDRESSES, // 13: HeraFinance 170 | THOR_SWAP_REBATE_ADDRESSES, // 14: THORSwap 171 | OKX_REBATE_ADDRESSES, // 15: OKX 172 | ONTO_REBATE_ADDRESSES, // 16: ONTO 173 | YETI_REBATE_ADDRESSES, // 17: Yeti 174 | JOY_REBATE_ADDRESSES, // 18: Joy 175 | ZETA_FARM_REBATE_ADDRESSES, // 19: ZetaFarm 176 | SLINGSHOT_REBATE_ADDRESSES, // 20: Slingshot 177 | KALM_REBATE_ADDRESSES, // 21: KALM 178 | UNIZEN_REBATE_ADDRESSES, // 22: unizen 179 | KYBER_SWAP_REBATE_ADDRESSES, // 23: KyberSwap 180 | ONE_DELTA_REBATE_ADDRESSES, // 24: 1delta 181 | EISEN_REBATE_ADDRESSES, // 25: Eisen 182 | HYPERSONIC_REBATE_ADDRESSES, // 26: Hypersonic 183 | GLUEX_REBATE_ADDRESSES, // 27: GlueX 184 | ]; 185 | 186 | export const GLOBAL_VARIABLE_ID = "0"; 187 | export const ORDER_HISTORY_VARIABLE_ID = "0"; 188 | export const CROSS_CHAIN_SRC_ORDER_HISTORY_VARIABLE_ID = "1"; 189 | export const CROSS_CHAIN_DST_ORDER_HISTORY_VARIABLE_ID = "2"; 190 | 191 | export const WOOFI_ORDER_SOURCE_ID = "0"; 192 | export const OTHER_ORDER_SOURCE_ID = "99"; 193 | export const GET_ORDER_SOURCE_BY_WOO_ROUTER_SWAP_FROM_ID = "-99"; 194 | 195 | export const WOOFI_SWAP_TYPE = 0; 196 | -------------------------------------------------------------------------------- /src/multichain/optimism.ts: -------------------------------------------------------------------------------- 1 | import { BigDecimal, BigInt, TypedMap } from "@graphprotocol/graph-ts"; 2 | 3 | export let BI_0 = BigInt.fromI32(0); 4 | export let BI_1 = BigInt.fromI32(1); 5 | export let BI_2 = BigInt.fromI32(2); 6 | export let BI_6 = BigInt.fromI32(6); 7 | export let BI_8 = BigInt.fromI32(8); 8 | export let BI_18 = BigInt.fromI32(18); 9 | 10 | export let BD_0 = BigDecimal.fromString("0"); 11 | export let BD_1 = BigDecimal.fromString("1"); 12 | 13 | // Address Must Be Lower Case!!! 14 | export const ETHER = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"; 15 | export const ETHER_SYMBOL = "ETH"; 16 | export const ETHER_NAME = "eth"; 17 | 18 | export const WRAPPED = "0x4200000000000000000000000000000000000006"; 19 | 20 | export const STABLE_TOKENS: string[] = [ 21 | "0x94b008aa00579c1307b0ef2c499ad98a8ce58e58", // USDT 22 | "0x7f5c764cbc14f9669b88837ca1490cca17c31607", // USDC.e 23 | "0x0b2c639c533813f4aa9d7837caf62653d097ff85", // USDC 24 | "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1", // DAI 25 | ]; 26 | 27 | // Contract Name as Variable Name 28 | export const WOO_ROUTER_SOURCES: string[] = [ 29 | "0xeaf1ac8e89ea0ae13e0f03634a4ff23502527024", // WooRouterV2 30 | "0x4c4af8dbc524681930a27b2f1af5bcc8062e6fb7", // WooRouterV2 31 | "0x655e2fe03fe19327239b5294a556965192386a7b", // WooCrossChainRouterV1 32 | "0xbeae1b06949d033da628ba3e5af267c3e740494b", // WooCrossChainRouterV2 33 | "0xe47fec1c72850d867a1655c4c5902de7728ca205", // WooCrossChainRouterV3 34 | "0xca10e8825fa9f1db0651cd48a9097997dbf7615d", // WooCrossChainRouterV4 35 | ]; 36 | 37 | export const WOO_PP_SOURCES: string[] = [ 38 | "0xd1778f9df3eee5473a9640f13682e3846f61febc", // WooPPV2 39 | "0xed9e3f98bbed560e66b89aac922e29d4596a9642", // WooPPV2 40 | "0x5520385bfcf07ec87c4c53a7d8d65595dff69fa4", // WooPPV2 41 | ]; 42 | 43 | export let WOO_PP_QUOTE_TOKENS = new TypedMap(); 44 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[0], STABLE_TOKENS[1]); // USDC.e 45 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[1], STABLE_TOKENS[2]); // USDC 46 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[2], STABLE_TOKENS[2]); // USDC 47 | 48 | export const WOO_VAULT_MANAGER_SOURCES: string[] = []; 49 | 50 | // destination swap called by Layer Zero Relayer 51 | export const LAYER_ZERO_SOURCES: string[] = [ 52 | "0x81e792e5a9003cc1c8bf5569a00f34b65d75b017", // Relayer 53 | ]; 54 | 55 | export const WOOFI_SOURCES: string[] = WOO_ROUTER_SOURCES.concat(WOO_PP_SOURCES).concat(WOO_VAULT_MANAGER_SOURCES).concat(LAYER_ZERO_SOURCES); 56 | 57 | export const WOOFI_REBATE_ADDRESSES: string[] = []; 58 | 59 | export const ONE_INCH_REBATE_ADDRESSES: string[] = [ 60 | "0x703a96e7d7a6d05d2d7f3f8223fd538c23897ce8", 61 | "0x910bf2d50fa5e014fd06666f456182d4ab7c8bd2", 62 | ]; 63 | 64 | export const DODO_REBATE_ADDRESSES: string[] = [ 65 | "0xea8e147bdb3ee3dde2085acb88de826e1a6de37a", 66 | "0xce9f9716fec7b4c11c773751aa579b1908fe9f5b", 67 | ]; 68 | 69 | export const OPEN_OCEAN_REBATE_ADDRESSES: string[] = [ 70 | "0x353c1f0bc78fbbc245b3c93ef77b1dcc5b77d2a0", 71 | "0x922164bbbd36acf9e854acbbf32facc949fcaeef", 72 | ]; 73 | 74 | export const METAMASK_REBATE_ADDRESSES: string[] = []; 75 | 76 | export const YIELD_YAK_REBATE_ADDRESSES: string[] = [ 77 | "0x5925c5c6843a8f67f7ef2b55db1f5491573c85eb", 78 | ]; 79 | 80 | export const FIRE_BIRD_REBATE_ADDRESSES: string[] = [ 81 | "0xa20ca7c6705fb88847cbf50549d7a38f4e99d32c", 82 | ]; 83 | 84 | export const BIT_KEEP_REBATE_ADDRESSES: string[] = [ 85 | "0x9712394caccab28acd26d41f7e0566c1e88759aa", 86 | ]; 87 | 88 | export const PARA_SWAP_REBATE_ADDRESSES: string[] = [ 89 | "0xdef171fe48cf0115b1d80b88dc8eab59176fee57", 90 | "0xd5b927956057075377263aab7f8afc12f85100db", 91 | ]; 92 | 93 | export const BEETHOVEN_X_REBATE_ADDRESSES: string[] = []; 94 | 95 | export const TRANSIT_SWAP_REBATE_ADDRESSES: string[] = [ 96 | "0x92106728f6efe170f8de919e1bd88c04c2473d3c", 97 | ]; 98 | 99 | export const ZERO_X_REBATE_ADDRESSES: string[] = [ 100 | "0xbfdcbb4c05843163f491c24f9c0019c510786304", 101 | "0x5e01d320e95133d80dd59a2191c95728fa69036d", 102 | ]; 103 | 104 | export const ODOS_REBATE_ADDRESSES: string[] = [ 105 | "0x9ff6e05e9c5f4e2f5ed8fd771c98e0c07e933b85", 106 | "0x498292dc123f19bdbc109081f6cf1d0e849a9daf", 107 | ]; 108 | 109 | export const HERA_FINANCE_REBATE_ADDRESSES: string[] = [ 110 | "0x1111110808b63f93b869a8a8ef87bc5b4dd79689", 111 | ]; 112 | 113 | export const THOR_SWAP_REBATE_ADDRESSES: string[] = [ 114 | "0x72c6d8fcc3e591253a1eb563180d317998346bec", 115 | ]; 116 | 117 | export const OKX_REBATE_ADDRESSES: string[] = []; 118 | 119 | export const ONTO_REBATE_ADDRESSES: string[] = [ 120 | "0x0ce56280bf51dc8211952c3522d4e1ce917319a6", 121 | ]; 122 | 123 | export const YETI_REBATE_ADDRESSES: string[] = [ 124 | "0x718c79e7c12f7e2c1a5d641c81d02eb7566db9a8", 125 | ]; 126 | 127 | export const JOY_REBATE_ADDRESSES: string[] = []; 128 | 129 | export const ZETA_FARM_REBATE_ADDRESSES: string[] = [ 130 | "0x04a285427eee8ade8dce32299478e4522fb7c287", 131 | ]; 132 | 133 | export const SLINGSHOT_REBATE_ADDRESSES: string[] = []; 134 | 135 | export const KALM_REBATE_ADDRESSES: string[] = []; 136 | 137 | export const UNIZEN_REBATE_ADDRESSES: string[] = [ 138 | "0xaf951f7a4aa4e2a033b034af0897273ed553e8c3", 139 | ]; 140 | 141 | export const KYBER_SWAP_REBATE_ADDRESSES: string[] = [ 142 | "0x4f82e73edb06d29ff62c91ec8f5ff06571bdeb29", 143 | ]; 144 | 145 | export const ONE_DELTA_REBATE_ADDRESSES: string[] = [ 146 | "0xc95eed7f6e8334611765f84ceb8ed6270f08907e", 147 | ]; 148 | 149 | export const EISEN_REBATE_ADDRESSES: string[] = []; 150 | 151 | export const HYPERSONIC_REBATE_ADDRESSES: string[] = []; 152 | 153 | export const GLUEX_REBATE_ADDRESSES: string[] = [ 154 | "0x3cffef055725974e32a660a617fc999b67e9196e", 155 | ]; 156 | 157 | export let REBATE_ADDRESSES: string[][] = [ 158 | WOOFI_REBATE_ADDRESSES, // 0: WOOFi 159 | ONE_INCH_REBATE_ADDRESSES, // 1: 1inch 160 | DODO_REBATE_ADDRESSES, // 2: DODO 161 | OPEN_OCEAN_REBATE_ADDRESSES, // 3: OpenOcean 162 | METAMASK_REBATE_ADDRESSES, // 4: MetaMask 163 | YIELD_YAK_REBATE_ADDRESSES, // 5: YieldYak 164 | FIRE_BIRD_REBATE_ADDRESSES, // 6: FireBird 165 | BIT_KEEP_REBATE_ADDRESSES, // 7: BitKeep 166 | PARA_SWAP_REBATE_ADDRESSES, // 8: ParaSwap 167 | BEETHOVEN_X_REBATE_ADDRESSES, // 9: BeethovenX 168 | TRANSIT_SWAP_REBATE_ADDRESSES, // 10: TransitSwap 169 | ZERO_X_REBATE_ADDRESSES, // 11: 0x 170 | ODOS_REBATE_ADDRESSES, // 12: ODOS 171 | HERA_FINANCE_REBATE_ADDRESSES, // 13: HeraFinance 172 | THOR_SWAP_REBATE_ADDRESSES, // 14: THORSwap 173 | OKX_REBATE_ADDRESSES, // 15: OKX 174 | ONTO_REBATE_ADDRESSES, // 16: ONTO 175 | YETI_REBATE_ADDRESSES, // 17: Yeti 176 | JOY_REBATE_ADDRESSES, // 18: Joy 177 | ZETA_FARM_REBATE_ADDRESSES, // 19: ZetaFarm 178 | SLINGSHOT_REBATE_ADDRESSES, // 20: Slingshot 179 | KALM_REBATE_ADDRESSES, // 21: KALM 180 | UNIZEN_REBATE_ADDRESSES, // 22: unizen 181 | KYBER_SWAP_REBATE_ADDRESSES, // 23: KyberSwap 182 | ONE_DELTA_REBATE_ADDRESSES, // 24: 1delta 183 | EISEN_REBATE_ADDRESSES, // 25: Eisen 184 | HYPERSONIC_REBATE_ADDRESSES, // 26: Hypersonic 185 | GLUEX_REBATE_ADDRESSES, // 27: GlueX 186 | ]; 187 | 188 | export const GLOBAL_VARIABLE_ID = "0"; 189 | export const ORDER_HISTORY_VARIABLE_ID = "0"; 190 | export const CROSS_CHAIN_SRC_ORDER_HISTORY_VARIABLE_ID = "1"; 191 | export const CROSS_CHAIN_DST_ORDER_HISTORY_VARIABLE_ID = "2"; 192 | 193 | export const WOOFI_ORDER_SOURCE_ID = "0"; 194 | export const OTHER_ORDER_SOURCE_ID = "99"; 195 | export const GET_ORDER_SOURCE_BY_WOO_ROUTER_SWAP_FROM_ID = "-99"; 196 | 197 | export const WOOFI_SWAP_TYPE = 0; 198 | -------------------------------------------------------------------------------- /src/multichain/arbitrum.ts: -------------------------------------------------------------------------------- 1 | import { BigDecimal, BigInt, TypedMap } from "@graphprotocol/graph-ts"; 2 | 3 | export let BI_0 = BigInt.fromI32(0); 4 | export let BI_1 = BigInt.fromI32(1); 5 | export let BI_2 = BigInt.fromI32(2); 6 | export let BI_6 = BigInt.fromI32(6); 7 | export let BI_8 = BigInt.fromI32(8); 8 | export let BI_18 = BigInt.fromI32(18); 9 | 10 | export let BD_0 = BigDecimal.fromString("0"); 11 | export let BD_1 = BigDecimal.fromString("1"); 12 | 13 | // Address Must Be Lower Case!!! 14 | export const ETHER = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"; 15 | export const ETHER_SYMBOL = "ETH"; 16 | export const ETHER_NAME = "eth"; 17 | 18 | export const WRAPPED = "0x82af49447d8a07e3bd95bd0d56f35241523fbab1"; 19 | 20 | export const STABLE_TOKENS: string[] = [ 21 | "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9", // USDT 22 | "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8", // USDC.e 23 | "0xaf88d065e77c8cc2239327c5edb3a432268e5831", // USDC 24 | "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1", // DAI 25 | ]; 26 | 27 | // Contract Name as Variable Name 28 | export const WOO_ROUTER_SOURCES: string[] = [ 29 | "0x9aed3a8896a85fe9a8cac52c9b402d092b629a30", // WooRouterV2 30 | "0x4c4af8dbc524681930a27b2f1af5bcc8062e6fb7", // WooRouterV2 31 | "0x0972a0fa37984e7ff2aefa53a0bb10dce535aa73", // WooCrossChainRouterV1 32 | "0x44df096d2600c6a6db77899db3de3aecff746cb8", // WooCrossChainRouterV1 33 | "0x4ab421de52b3112d02442b040dd3dc73e8af63b5", // WooCrossChainRouterV2 34 | "0xe47fec1c72850d867a1655c4c5902de7728ca205", // WooCrossChainRouterV3 35 | "0xca10e8825fa9f1db0651cd48a9097997dbf7615d", // WooCrossChainRouterV4 36 | ]; 37 | 38 | export const WOO_PP_SOURCES: string[] = [ 39 | "0x1f79f8a65e02f8a137ce7f79c038cc44332df448", // WooPPV2 40 | "0xeff23b4be1091b53205e35f3afcd9c7182bf3062", // WooPPV2 41 | "0xed9e3f98bbed560e66b89aac922e29d4596a9642", // WooPPV2 42 | "0x5520385bfcf07ec87c4c53a7d8d65595dff69fa4", // WooPPV2 43 | ]; 44 | 45 | export let WOO_PP_QUOTE_TOKENS = new TypedMap(); 46 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[0], STABLE_TOKENS[1]); // USDC.e 47 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[1], STABLE_TOKENS[1]); // USDC.e 48 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[2], STABLE_TOKENS[2]); // USDC 49 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[3], STABLE_TOKENS[2]); // USDC 50 | 51 | export const WOO_VAULT_MANAGER_SOURCES: string[] = [ 52 | "0xf357ec5a6c82766aeb97d6da7488e2efc3dc0182", 53 | ]; 54 | 55 | // destination swap called by Layer Zero Relayer 56 | export const LAYER_ZERO_SOURCES: string[] = [ 57 | "0x177d36dbe2271a4ddb2ad8304d82628eb921d790", // Relayer 58 | ]; 59 | 60 | export const WOOFI_SOURCES: string[] = WOO_ROUTER_SOURCES.concat(WOO_PP_SOURCES).concat(WOO_VAULT_MANAGER_SOURCES).concat(LAYER_ZERO_SOURCES); 61 | 62 | export const WOOFI_REBATE_ADDRESSES: string[] = []; 63 | 64 | export const ONE_INCH_REBATE_ADDRESSES: string[] = [ 65 | "0x703a96e7d7a6d05d2d7f3f8223fd538c23897ce8", 66 | "0x910bf2d50fa5e014fd06666f456182d4ab7c8bd2", 67 | ]; 68 | 69 | export const DODO_REBATE_ADDRESSES: string[] = [ 70 | "0xea8e147bdb3ee3dde2085acb88de826e1a6de37a", 71 | "0xce9f9716fec7b4c11c773751aa579b1908fe9f5b", 72 | ]; 73 | 74 | export const OPEN_OCEAN_REBATE_ADDRESSES: string[] = [ 75 | "0x353c1f0bc78fbbc245b3c93ef77b1dcc5b77d2a0", 76 | "0x922164bbbd36acf9e854acbbf32facc949fcaeef", 77 | ]; 78 | 79 | export const METAMASK_REBATE_ADDRESSES: string[] = []; 80 | 81 | export const YIELD_YAK_REBATE_ADDRESSES: string[] = [ 82 | "0x5925c5c6843a8f67f7ef2b55db1f5491573c85eb", 83 | "0x4a6c794192831fb9f4782e61bec05d6c5cc9f3ea", 84 | "0x599850287dd42db3137ef82f70c5dcabc690d524", 85 | ]; 86 | 87 | export const FIRE_BIRD_REBATE_ADDRESSES: string[] = [ 88 | "0xa20ca7c6705fb88847cbf50549d7a38f4e99d32c", 89 | ]; 90 | 91 | export const BIT_KEEP_REBATE_ADDRESSES: string[] = [ 92 | "0x9712394caccab28acd26d41f7e0566c1e88759aa", 93 | ]; 94 | 95 | export const PARA_SWAP_REBATE_ADDRESSES: string[] = [ 96 | "0xdef171fe48cf0115b1d80b88dc8eab59176fee57", 97 | "0xd5b927956057075377263aab7f8afc12f85100db", 98 | ]; 99 | 100 | export const BEETHOVEN_X_REBATE_ADDRESSES: string[] = []; 101 | 102 | export const TRANSIT_SWAP_REBATE_ADDRESSES: string[] = [ 103 | "0x92106728f6efe170f8de919e1bd88c04c2473d3c", 104 | ]; 105 | 106 | export const ZERO_X_REBATE_ADDRESSES: string[] = [ 107 | "0xbfdcbb4c05843163f491c24f9c0019c510786304", 108 | "0x5e01d320e95133d80dd59a2191c95728fa69036d", 109 | ]; 110 | 111 | export const ODOS_REBATE_ADDRESSES: string[] = [ 112 | "0x3c440a8653d6bad527a96d0f8bff55a934a2a67f", 113 | "0x498292dc123f19bdbc109081f6cf1d0e849a9daf", 114 | ]; 115 | 116 | export const HERA_FINANCE_REBATE_ADDRESSES: string[] = [ 117 | "0x1111110808b63f93b869a8a8ef87bc5b4dd79689", 118 | ]; 119 | 120 | export const THOR_SWAP_REBATE_ADDRESSES: string[] = [ 121 | "0x72c6d8fcc3e591253a1eb563180d317998346bec", 122 | ]; 123 | 124 | export const OKX_REBATE_ADDRESSES: string[] = []; 125 | 126 | export const ONTO_REBATE_ADDRESSES: string[] = [ 127 | "0x0ce56280bf51dc8211952c3522d4e1ce917319a6", 128 | ]; 129 | 130 | export const YETI_REBATE_ADDRESSES: string[] = [ 131 | "0x718c79e7c12f7e2c1a5d641c81d02eb7566db9a8", 132 | ]; 133 | 134 | export const JOY_REBATE_ADDRESSES: string[] = []; 135 | 136 | export const ZETA_FARM_REBATE_ADDRESSES: string[] = [ 137 | "0x04a285427eee8ade8dce32299478e4522fb7c287", 138 | ]; 139 | 140 | export const SLINGSHOT_REBATE_ADDRESSES: string[] = []; 141 | 142 | export const KALM_REBATE_ADDRESSES: string[] = []; 143 | 144 | export const UNIZEN_REBATE_ADDRESSES: string[] = [ 145 | "0xaf951f7a4aa4e2a033b034af0897273ed553e8c3", 146 | ]; 147 | 148 | export const KYBER_SWAP_REBATE_ADDRESSES: string[] = [ 149 | "0x4f82e73edb06d29ff62c91ec8f5ff06571bdeb29", 150 | ]; 151 | 152 | export const ONE_DELTA_REBATE_ADDRESSES: string[] = [ 153 | "0xc95eed7f6e8334611765f84ceb8ed6270f08907e", 154 | ]; 155 | 156 | export const EISEN_REBATE_ADDRESSES: string[] = []; 157 | 158 | export const HYPERSONIC_REBATE_ADDRESSES: string[] = []; 159 | 160 | export const GLUEX_REBATE_ADDRESSES: string[] = [ 161 | "0x3cffef055725974e32a660a617fc999b67e9196e", 162 | ]; 163 | 164 | export let REBATE_ADDRESSES: string[][] = [ 165 | WOOFI_REBATE_ADDRESSES, // 0: WOOFi 166 | ONE_INCH_REBATE_ADDRESSES, // 1: 1inch 167 | DODO_REBATE_ADDRESSES, // 2: DODO 168 | OPEN_OCEAN_REBATE_ADDRESSES, // 3: OpenOcean 169 | METAMASK_REBATE_ADDRESSES, // 4: MetaMask 170 | YIELD_YAK_REBATE_ADDRESSES, // 5: YieldYak 171 | FIRE_BIRD_REBATE_ADDRESSES, // 6: FireBird 172 | BIT_KEEP_REBATE_ADDRESSES, // 7: BitKeep 173 | PARA_SWAP_REBATE_ADDRESSES, // 8: ParaSwap 174 | BEETHOVEN_X_REBATE_ADDRESSES, // 9: BeethovenX 175 | TRANSIT_SWAP_REBATE_ADDRESSES, // 10: TransitSwap 176 | ZERO_X_REBATE_ADDRESSES, // 11: 0x 177 | ODOS_REBATE_ADDRESSES, // 12: ODOS 178 | HERA_FINANCE_REBATE_ADDRESSES, // 13: HeraFinance 179 | THOR_SWAP_REBATE_ADDRESSES, // 14: THORSwap 180 | OKX_REBATE_ADDRESSES, // 15: OKX 181 | ONTO_REBATE_ADDRESSES, // 16: ONTO 182 | YETI_REBATE_ADDRESSES, // 17: Yeti 183 | JOY_REBATE_ADDRESSES, // 18: Joy 184 | ZETA_FARM_REBATE_ADDRESSES, // 19: ZetaFarm 185 | SLINGSHOT_REBATE_ADDRESSES, // 20: Slingshot 186 | KALM_REBATE_ADDRESSES, // 21: KALM 187 | UNIZEN_REBATE_ADDRESSES, // 22: unizen 188 | KYBER_SWAP_REBATE_ADDRESSES, // 23: KyberSwap 189 | ONE_DELTA_REBATE_ADDRESSES, // 24: 1delta 190 | EISEN_REBATE_ADDRESSES, // 25: Eisen 191 | HYPERSONIC_REBATE_ADDRESSES, // 26: Hypersonic 192 | GLUEX_REBATE_ADDRESSES, // 27: GlueX 193 | ]; 194 | 195 | export const GLOBAL_VARIABLE_ID = "0"; 196 | export const ORDER_HISTORY_VARIABLE_ID = "0"; 197 | export const CROSS_CHAIN_SRC_ORDER_HISTORY_VARIABLE_ID = "1"; 198 | export const CROSS_CHAIN_DST_ORDER_HISTORY_VARIABLE_ID = "2"; 199 | 200 | export const WOOFI_ORDER_SOURCE_ID = "0"; 201 | export const OTHER_ORDER_SOURCE_ID = "99"; 202 | export const GET_ORDER_SOURCE_BY_WOO_ROUTER_SWAP_FROM_ID = "-99"; 203 | 204 | export const WOOFI_SWAP_TYPE = 0; 205 | -------------------------------------------------------------------------------- /src/multichain/polygon.ts: -------------------------------------------------------------------------------- 1 | import { BigDecimal, BigInt, TypedMap } from "@graphprotocol/graph-ts"; 2 | 3 | export let BI_0 = BigInt.fromI32(0); 4 | export let BI_1 = BigInt.fromI32(1); 5 | export let BI_2 = BigInt.fromI32(2); 6 | export let BI_6 = BigInt.fromI32(6); 7 | export let BI_8 = BigInt.fromI32(8); 8 | export let BI_18 = BigInt.fromI32(18); 9 | 10 | export let BD_0 = BigDecimal.fromString("0"); 11 | export let BD_1 = BigDecimal.fromString("1"); 12 | 13 | // Address Must Be Lower Case!!! 14 | export const ETHER = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"; 15 | export const ETHER_SYMBOL = "MATIC"; 16 | export const ETHER_NAME = "matic"; 17 | 18 | export const WRAPPED = "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270"; 19 | 20 | export const STABLE_TOKENS: string[] = [ 21 | "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", // USDT 22 | "0x2791bca1f2de4661ed88a30c99a7a9449aa84174", // USDC.e 23 | "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", // USDC 24 | "0x8f3cf7ad23cd3cadbd9735aff958023239c6a063", // DAI 25 | ]; 26 | 27 | // Contract Name as Variable Name 28 | export const WOO_ROUTER_SOURCES: string[] = [ 29 | "0x9d1a92e601db0901e69bd810029f2c14bcca3128", // WooRouterV1 30 | "0x817eb46d60762442da3d931ff51a30334ca39b74", // WooRouterV2 31 | "0x4c4af8dbc524681930a27b2f1af5bcc8062e6fb7", // WooRouterV2 32 | "0x376d567c5794cfc64c74852a9db2105e0b5b482c", // WooCrossChainRouterV1 33 | "0x574b9cec19553435b360803d8b4de2a5b2c008fd", // WooCrossChainRouterV1 34 | "0xaa9c15cd603428ca8ddd45e933f8efe3afbcc173", // WooCrossChainRouterV2 35 | "0xe47fec1c72850d867a1655c4c5902de7728ca205", // WooCrossChainRouterV3 36 | "0xca10e8825fa9f1db0651cd48a9097997dbf7615d", // WooCrossChainRouterV4 37 | ]; 38 | 39 | export const WOO_PP_SOURCES: string[] = [ 40 | "0x7400b665c8f4f3a951a99f1ee9872efb8778723d", // WooPPV1 41 | "0x7081a38158bd050ae4a86e38e0225bc281887d7e", // WooPPV2 42 | "0xed9e3f98bbed560e66b89aac922e29d4596a9642", // WooPPV2 43 | "0x5520385bfcf07ec87c4c53a7d8d65595dff69fa4", // WooPPV2 44 | ]; 45 | 46 | export let WOO_PP_QUOTE_TOKENS = new TypedMap(); 47 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[0], STABLE_TOKENS[1]); // USDC.e 48 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[1], STABLE_TOKENS[1]); // USDC.e 49 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[2], STABLE_TOKENS[2]); // USDC 50 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[3], STABLE_TOKENS[2]); // USDC 51 | 52 | export const WOO_VAULT_MANAGER_SOURCES: string[] = [ 53 | "0x2e668bb88287675e34c8df82686dfd0b7f0c0383", 54 | "0x88748243de01c4f3c103f2de2833f39f6807db17", 55 | ]; 56 | 57 | // destination swap called by Layer Zero Relayer 58 | export const LAYER_ZERO_SOURCES: string[] = [ 59 | "0xfe7c30860d01e28371d40434806f4a8fcdd3a098", // Relayer 60 | "0x75dc8e5f50c8221a82ca6af64af811caa983b65f", // Relayer 61 | ]; 62 | 63 | export const WOOFI_SOURCES: string[] = WOO_ROUTER_SOURCES.concat(WOO_PP_SOURCES).concat(WOO_VAULT_MANAGER_SOURCES).concat(LAYER_ZERO_SOURCES); 64 | 65 | export const WOOFI_REBATE_ADDRESSES: string[] = []; 66 | 67 | export const ONE_INCH_REBATE_ADDRESSES: string[] = [ 68 | "0x703a96e7d7a6d05d2d7f3f8223fd538c23897ce8", 69 | "0x910bf2d50fa5e014fd06666f456182d4ab7c8bd2", 70 | ]; 71 | 72 | export const DODO_REBATE_ADDRESSES: string[] = [ 73 | "0xea8e147bdb3ee3dde2085acb88de826e1a6de37a", 74 | "0xce9f9716fec7b4c11c773751aa579b1908fe9f5b", 75 | ]; 76 | 77 | export const OPEN_OCEAN_REBATE_ADDRESSES: string[] = [ 78 | "0x353c1f0bc78fbbc245b3c93ef77b1dcc5b77d2a0", 79 | "0x922164bbbd36acf9e854acbbf32facc949fcaeef", 80 | ]; 81 | 82 | export const METAMASK_REBATE_ADDRESSES: string[] = []; 83 | 84 | export const YIELD_YAK_REBATE_ADDRESSES: string[] = [ 85 | "0x5925c5c6843a8f67f7ef2b55db1f5491573c85eb", 86 | ]; 87 | 88 | export const FIRE_BIRD_REBATE_ADDRESSES: string[] = [ 89 | "0xa20ca7c6705fb88847cbf50549d7a38f4e99d32c", 90 | ]; 91 | 92 | export const BIT_KEEP_REBATE_ADDRESSES: string[] = [ 93 | "0x9712394caccab28acd26d41f7e0566c1e88759aa", 94 | ]; 95 | 96 | export const PARA_SWAP_REBATE_ADDRESSES: string[] = [ 97 | "0xdef171fe48cf0115b1d80b88dc8eab59176fee57", 98 | "0xd5b927956057075377263aab7f8afc12f85100db", 99 | ]; 100 | 101 | export const BEETHOVEN_X_REBATE_ADDRESSES: string[] = []; 102 | 103 | export const TRANSIT_SWAP_REBATE_ADDRESSES: string[] = [ 104 | "0x92106728f6efe170f8de919e1bd88c04c2473d3c", 105 | ]; 106 | 107 | export const ZERO_X_REBATE_ADDRESSES: string[] = [ 108 | "0xbfdcbb4c05843163f491c24f9c0019c510786304", 109 | "0x5e01d320e95133d80dd59a2191c95728fa69036d", 110 | ]; 111 | 112 | export const ODOS_REBATE_ADDRESSES: string[] = [ 113 | "0x7dfbf322aa55f417a4c8a89784bc560471095240", 114 | "0x498292dc123f19bdbc109081f6cf1d0e849a9daf", 115 | ]; 116 | 117 | export const HERA_FINANCE_REBATE_ADDRESSES: string[] = [ 118 | "0x1111110808b63f93b869a8a8ef87bc5b4dd79689", 119 | ]; 120 | 121 | export const THOR_SWAP_REBATE_ADDRESSES: string[] = [ 122 | "0x72c6d8fcc3e591253a1eb563180d317998346bec", 123 | ]; 124 | 125 | export const OKX_REBATE_ADDRESSES: string[] = []; 126 | 127 | export const ONTO_REBATE_ADDRESSES: string[] = [ 128 | "0x0ce56280bf51dc8211952c3522d4e1ce917319a6", 129 | ]; 130 | 131 | export const YETI_REBATE_ADDRESSES: string[] = [ 132 | "0x718c79e7c12f7e2c1a5d641c81d02eb7566db9a8", 133 | ]; 134 | 135 | export const JOY_REBATE_ADDRESSES: string[] = []; 136 | 137 | export const ZETA_FARM_REBATE_ADDRESSES: string[] = [ 138 | "0x04a285427eee8ade8dce32299478e4522fb7c287", 139 | ]; 140 | 141 | export const SLINGSHOT_REBATE_ADDRESSES: string[] = []; 142 | 143 | export const KALM_REBATE_ADDRESSES: string[] = []; 144 | 145 | export const UNIZEN_REBATE_ADDRESSES: string[] = [ 146 | "0xaf951f7a4aa4e2a033b034af0897273ed553e8c3", 147 | ]; 148 | 149 | export const KYBER_SWAP_REBATE_ADDRESSES: string[] = [ 150 | "0x4f82e73edb06d29ff62c91ec8f5ff06571bdeb29", 151 | ]; 152 | 153 | export const ONE_DELTA_REBATE_ADDRESSES: string[] = [ 154 | "0xc95eed7f6e8334611765f84ceb8ed6270f08907e", 155 | ]; 156 | 157 | export const EISEN_REBATE_ADDRESSES: string[] = []; 158 | 159 | export const HYPERSONIC_REBATE_ADDRESSES: string[] = []; 160 | 161 | export const GLUEX_REBATE_ADDRESSES: string[] = [ 162 | "0x3cffef055725974e32a660a617fc999b67e9196e", 163 | ]; 164 | 165 | export let REBATE_ADDRESSES: string[][] = [ 166 | WOOFI_REBATE_ADDRESSES, // 0: WOOFi 167 | ONE_INCH_REBATE_ADDRESSES, // 1: 1inch 168 | DODO_REBATE_ADDRESSES, // 2: DODO 169 | OPEN_OCEAN_REBATE_ADDRESSES, // 3: OpenOcean 170 | METAMASK_REBATE_ADDRESSES, // 4: MetaMask 171 | YIELD_YAK_REBATE_ADDRESSES, // 5: YieldYak 172 | FIRE_BIRD_REBATE_ADDRESSES, // 6: FireBird 173 | BIT_KEEP_REBATE_ADDRESSES, // 7: BitKeep 174 | PARA_SWAP_REBATE_ADDRESSES, // 8: ParaSwap 175 | BEETHOVEN_X_REBATE_ADDRESSES, // 9: BeethovenX 176 | TRANSIT_SWAP_REBATE_ADDRESSES, // 10: TransitSwap 177 | ZERO_X_REBATE_ADDRESSES, // 11: 0x 178 | ODOS_REBATE_ADDRESSES, // 12: ODOS 179 | HERA_FINANCE_REBATE_ADDRESSES, // 13: HeraFinance 180 | THOR_SWAP_REBATE_ADDRESSES, // 14: THORSwap 181 | OKX_REBATE_ADDRESSES, // 15: OKX 182 | ONTO_REBATE_ADDRESSES, // 16: ONTO 183 | YETI_REBATE_ADDRESSES, // 17: Yeti 184 | JOY_REBATE_ADDRESSES, // 18: Joy 185 | ZETA_FARM_REBATE_ADDRESSES, // 19: ZetaFarm 186 | SLINGSHOT_REBATE_ADDRESSES, // 20: Slingshot 187 | KALM_REBATE_ADDRESSES, // 21: KALM 188 | UNIZEN_REBATE_ADDRESSES, // 22: unizen 189 | KYBER_SWAP_REBATE_ADDRESSES, // 23: KyberSwap 190 | ONE_DELTA_REBATE_ADDRESSES, // 24: 1delta 191 | EISEN_REBATE_ADDRESSES, // 25: Eisen 192 | HYPERSONIC_REBATE_ADDRESSES, // 26: Hypersonic 193 | GLUEX_REBATE_ADDRESSES, // 27: GlueX 194 | ]; 195 | 196 | export const GLOBAL_VARIABLE_ID = "0"; 197 | export const ORDER_HISTORY_VARIABLE_ID = "0"; 198 | export const CROSS_CHAIN_SRC_ORDER_HISTORY_VARIABLE_ID = "1"; 199 | export const CROSS_CHAIN_DST_ORDER_HISTORY_VARIABLE_ID = "2"; 200 | 201 | export const WOOFI_ORDER_SOURCE_ID = "0"; 202 | export const OTHER_ORDER_SOURCE_ID = "99"; 203 | export const GET_ORDER_SOURCE_BY_WOO_ROUTER_SWAP_FROM_ID = "-99"; 204 | 205 | export const WOOFI_SWAP_TYPE = 0; 206 | -------------------------------------------------------------------------------- /subgraphs/mantle.yaml: -------------------------------------------------------------------------------- 1 | specVersion: 0.0.6 2 | description: fi.woo.org 3 | repository: https://github.com/woonetwork/woofi_subgraph 4 | schema: 5 | file: ./woofi.graphql 6 | dataSources: 7 | - kind: ethereum/contract 8 | name: WOOFiCrossRouterV5_1 9 | network: mantle 10 | source: 11 | address: "0xB84aEfEF2DDDE628d5c7F1fba320dE63e3f4757c" 12 | abi: WOOFiCrossRouterV5 13 | startBlock: 74618346 14 | mapping: 15 | kind: ethereum/events 16 | apiVersion: 0.0.7 17 | language: wasm/assemblyscript 18 | entities: 19 | - WOOFiCrossSwapOnSrcChain 20 | - WOOFiCrossSwapOnDstChain 21 | abis: 22 | - name: WOOFiCrossRouterV5 23 | file: ../abis/WOOFiCrossRouterV5_1.json 24 | - name: ERC20 25 | file: ../abis/ERC20.json 26 | eventHandlers: 27 | - event: WOOFiCrossSwapOnSrcChain(uint32,indexed bytes32,indexed address,indexed address,address,uint256,address,uint256,uint256,uint8,uint256) 28 | handler: handleWOOFiCrossRouterV5WOOFiCrossSwapOnSrcChain_1 29 | receipt: true 30 | - event: WOOFiCrossSwapOnDstChain(uint32,indexed bytes32,indexed address,indexed address,address,uint256,uint256,address,address,uint256,uint256,uint8,uint256) 31 | handler: handleWOOFiCrossRouterV5WOOFiCrossSwapOnDstChain_1 32 | receipt: true 33 | file: ../src/mappings/wooCrossChainRouter/index.ts 34 | - kind: ethereum/contract 35 | name: StargateBridgeV1_1 36 | network: mantle 37 | source: 38 | address: "0x45f1A95A4D3f3836523F5c83673c797f4d4d263B" 39 | abi: StargateBridgeV1 40 | startBlock: 49841111 41 | mapping: 42 | kind: ethereum/events 43 | apiVersion: 0.0.7 44 | language: wasm/assemblyscript 45 | entities: 46 | - SendMsg 47 | abis: 48 | - name: StargateBridgeV1 49 | file: ../abis/StargateBridgeV1_1.json 50 | eventHandlers: 51 | - event: SendMsg(uint8,uint64) 52 | handler: handleStargateBridgeV1SendMsg_1 53 | receipt: true 54 | file: ../src/mappings/stargateBridge/index.ts 55 | - kind: ethereum/contract 56 | name: WooCrossChainRouterV4_1 57 | network: mantle 58 | source: 59 | address: "0xCa10E8825FA9F1dB0651Cd48A9097997DBf7615d" 60 | abi: WooCrossChainRouterV4 61 | startBlock: 49841111 62 | mapping: 63 | kind: ethereum/events 64 | apiVersion: 0.0.7 65 | language: wasm/assemblyscript 66 | entities: 67 | - WooCrossSwapOnSrcChain 68 | - WooCrossSwapOnDstChain 69 | abis: 70 | - name: WooCrossChainRouterV4 71 | file: ../abis/WooCrossChainRouterV4_1.json 72 | - name: ERC20 73 | file: ../abis/ERC20.json 74 | eventHandlers: 75 | - event: WooCrossSwapOnSrcChain(indexed uint256,indexed address,indexed address,address,uint256,address,uint256,uint256,uint8,uint256) 76 | handler: handleWooCCRouterV4WooCrossSwapOnSrcChain_1 77 | receipt: true 78 | - event: WooCrossSwapOnDstChain(indexed uint256,indexed address,indexed address,address,uint256,address,address,uint256,uint256,uint8,uint256) 79 | handler: handleWooCCRouterV4WooCrossSwapOnDstChain_1 80 | receipt: true 81 | file: ../src/mappings/wooCrossChainRouter/index.ts 82 | - kind: ethereum/contract 83 | name: WooRouterV2_2 84 | network: mantle 85 | source: 86 | address: "0x4c4AF8DBc524681930a27b2F1Af5bcC8062E6fB7" 87 | abi: WooRouterV2 88 | startBlock: 57968186 89 | mapping: 90 | kind: ethereum/events 91 | apiVersion: 0.0.7 92 | language: wasm/assemblyscript 93 | entities: 94 | - WooRouterSwap 95 | abis: 96 | - name: WooRouterV2 97 | file: ../abis/WooRouterV2_1.json 98 | - name: ERC20 99 | file: ../abis/ERC20.json 100 | eventHandlers: 101 | - event: WooRouterSwap(uint8,indexed address,indexed address,uint256,uint256,address,indexed address,address) 102 | handler: handleWooRouterV2WooRouterSwap_2 103 | receipt: true 104 | file: ../src/mappings/wooRouter/index.ts 105 | - kind: ethereum/contract 106 | name: WooRouterV2_1 107 | network: mantle 108 | source: 109 | address: "0xd14a997308F9e7514a8FEA835064D596CDCaa99E" 110 | abi: WooRouterV2 111 | startBlock: 49835537 112 | mapping: 113 | kind: ethereum/events 114 | apiVersion: 0.0.7 115 | language: wasm/assemblyscript 116 | entities: 117 | - WooRouterSwap 118 | abis: 119 | - name: WooRouterV2 120 | file: ../abis/WooRouterV2_1.json 121 | - name: ERC20 122 | file: ../abis/ERC20.json 123 | eventHandlers: 124 | - event: WooRouterSwap(uint8,indexed address,indexed address,uint256,uint256,address,indexed address,address) 125 | handler: handleWooRouterV2WooRouterSwap_1 126 | receipt: true 127 | file: ../src/mappings/wooRouter/index.ts 128 | - kind: ethereum/contract 129 | name: WooPPV2_3 130 | network: mantle 131 | source: 132 | address: "0x5520385bFcf07Ec87C4c53A7d8d65595Dff69FA4" 133 | abi: WooPPV2 134 | startBlock: 77158402 135 | mapping: 136 | kind: ethereum/events 137 | apiVersion: 0.0.7 138 | language: wasm/assemblyscript 139 | entities: 140 | - WooSwap 141 | abis: 142 | - name: WooPPV2 143 | file: ../abis/WooPPV2_1.json 144 | - name: ERC20 145 | file: ../abis/ERC20.json 146 | eventHandlers: 147 | - event: WooSwap(indexed address,indexed address,uint256,uint256,address,indexed address,address,uint256,uint256) 148 | handler: handleWooPPV2WooSwap_3 149 | receipt: true 150 | file: ../src/mappings/wooPP/index.ts 151 | - kind: ethereum/contract 152 | name: WooPPV2_2 153 | network: mantle 154 | source: 155 | address: "0xEd9e3f98bBed560e66B89AaC922E29D4596A9642" 156 | abi: WooPPV2 157 | startBlock: 63850131 158 | mapping: 159 | kind: ethereum/events 160 | apiVersion: 0.0.7 161 | language: wasm/assemblyscript 162 | entities: 163 | - WooSwap 164 | abis: 165 | - name: WooPPV2 166 | file: ../abis/WooPPV2_1.json 167 | - name: ERC20 168 | file: ../abis/ERC20.json 169 | eventHandlers: 170 | - event: WooSwap(indexed address,indexed address,uint256,uint256,address,indexed address,address,uint256,uint256) 171 | handler: handleWooPPV2WooSwap_2 172 | receipt: true 173 | file: ../src/mappings/wooPP/index.ts 174 | - kind: ethereum/contract 175 | name: WooPPV2_1 176 | network: mantle 177 | source: 178 | address: "0x9D1A92e601db0901e69bd810029F2C14bCCA3128" 179 | abi: WooPPV2 180 | startBlock: 49834622 181 | mapping: 182 | kind: ethereum/events 183 | apiVersion: 0.0.7 184 | language: wasm/assemblyscript 185 | entities: 186 | - WooSwap 187 | abis: 188 | - name: WooPPV2 189 | file: ../abis/WooPPV2_1.json 190 | - name: ERC20 191 | file: ../abis/ERC20.json 192 | eventHandlers: 193 | - event: WooSwap(indexed address,indexed address,uint256,uint256,address,indexed address,address,uint256,uint256) 194 | handler: handleWooPPV2WooSwap_1 195 | receipt: true 196 | file: ../src/mappings/wooPP/index.ts 197 | - kind: ethereum 198 | name: WooTokenOFT 199 | network: mantle 200 | source: 201 | address: "0xf3df0a31ec5ea438150987805e841f960b9471b6" 202 | abi: WooTokenOFT 203 | startBlock: 72634967 204 | mapping: 205 | kind: ethereum/events 206 | apiVersion: 0.0.7 207 | language: wasm/assemblyscript 208 | entities: 209 | - OFTReceived 210 | - OFTSent 211 | abis: 212 | - name: WooTokenOFT 213 | file: ../abis/WooTokenOFT.json 214 | eventHandlers: 215 | - event: OFTReceived(indexed bytes32,uint32,indexed address,uint256) 216 | handler: handleOFTReceived 217 | - event: OFTSent(indexed bytes32,uint32,indexed address,uint256,uint256) 218 | handler: handleOFTSent 219 | file: ../src/mappings/wooTokenOFT/index.ts -------------------------------------------------------------------------------- /abis/StargateBridgeV1_1.json: -------------------------------------------------------------------------------- 1 | [{"inputs":[{"internalType":"address","name":"_layerZeroEndpoint","type":"address"},{"internalType":"address","name":"_router","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"msgType","type":"uint8"},{"indexed":false,"internalType":"uint64","name":"nonce","type":"uint64"}],"name":"SendMsg","type":"event"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approveTokenSpender","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"bridgeLookup","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"}],"name":"forceResumeReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint8","name":"","type":"uint8"}],"name":"gasLookup","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"layerZeroEndpoint","outputs":[{"internalType":"contract ILayerZeroEndpoint","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"lzReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"uint8","name":"_functionType","type":"uint8"},{"internalType":"bytes","name":"_toAddress","type":"bytes"},{"internalType":"bytes","name":"_transferAndCallPayload","type":"bytes"},{"components":[{"internalType":"uint256","name":"dstGasForCall","type":"uint256"},{"internalType":"uint256","name":"dstNativeAmount","type":"uint256"},{"internalType":"bytes","name":"dstNativeAddr","type":"bytes"}],"internalType":"struct IStargateRouter.lzTxObj","name":"_lzTxParams","type":"tuple"}],"name":"quoteLayerZeroFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"uint256","name":"_srcPoolId","type":"uint256"},{"internalType":"uint256","name":"_dstPoolId","type":"uint256"},{"internalType":"address payable","name":"_refundAddress","type":"address"},{"components":[{"internalType":"uint256","name":"credits","type":"uint256"},{"internalType":"uint256","name":"idealBalance","type":"uint256"}],"internalType":"struct Pool.CreditObj","name":"_c","type":"tuple"},{"internalType":"uint256","name":"_amountSD","type":"uint256"},{"internalType":"bytes","name":"_to","type":"bytes"},{"components":[{"internalType":"uint256","name":"dstGasForCall","type":"uint256"},{"internalType":"uint256","name":"dstNativeAmount","type":"uint256"},{"internalType":"bytes","name":"dstNativeAddr","type":"bytes"}],"internalType":"struct IStargateRouter.lzTxObj","name":"_lzTxParams","type":"tuple"}],"name":"redeemLocal","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"address payable","name":"_refundAddress","type":"address"},{"components":[{"internalType":"uint256","name":"credits","type":"uint256"},{"internalType":"uint256","name":"idealBalance","type":"uint256"}],"internalType":"struct Pool.CreditObj","name":"_c","type":"tuple"},{"components":[{"internalType":"uint256","name":"dstGasForCall","type":"uint256"},{"internalType":"uint256","name":"dstNativeAmount","type":"uint256"},{"internalType":"bytes","name":"dstNativeAddr","type":"bytes"}],"internalType":"struct IStargateRouter.lzTxObj","name":"_lzTxParams","type":"tuple"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"redeemLocalCallback","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"contract Router","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"uint256","name":"_srcPoolId","type":"uint256"},{"internalType":"uint256","name":"_dstPoolId","type":"uint256"},{"internalType":"address payable","name":"_refundAddress","type":"address"},{"components":[{"internalType":"uint256","name":"credits","type":"uint256"},{"internalType":"uint256","name":"idealBalance","type":"uint256"}],"internalType":"struct Pool.CreditObj","name":"_c","type":"tuple"}],"name":"sendCredits","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"bytes","name":"_bridgeAddress","type":"bytes"}],"name":"setBridge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"},{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"uint256","name":"_configType","type":"uint256"},{"internalType":"bytes","name":"_config","type":"bytes"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"uint8","name":"_functionType","type":"uint8"},{"internalType":"uint256","name":"_gasAmount","type":"uint256"}],"name":"setGasAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"version","type":"uint16"}],"name":"setReceiveVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"version","type":"uint16"}],"name":"setSendVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"enable","type":"bool"}],"name":"setUseLayerZeroToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"uint256","name":"_srcPoolId","type":"uint256"},{"internalType":"uint256","name":"_dstPoolId","type":"uint256"},{"internalType":"address payable","name":"_refundAddress","type":"address"},{"components":[{"internalType":"uint256","name":"credits","type":"uint256"},{"internalType":"uint256","name":"idealBalance","type":"uint256"}],"internalType":"struct Pool.CreditObj","name":"_c","type":"tuple"},{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"eqFee","type":"uint256"},{"internalType":"uint256","name":"eqReward","type":"uint256"},{"internalType":"uint256","name":"lpFee","type":"uint256"},{"internalType":"uint256","name":"protocolFee","type":"uint256"},{"internalType":"uint256","name":"lkbRemove","type":"uint256"}],"internalType":"struct Pool.SwapObj","name":"_s","type":"tuple"},{"components":[{"internalType":"uint256","name":"dstGasForCall","type":"uint256"},{"internalType":"uint256","name":"dstNativeAmount","type":"uint256"},{"internalType":"bytes","name":"dstNativeAddr","type":"bytes"}],"internalType":"struct IStargateRouter.lzTxObj","name":"_lzTxParams","type":"tuple"},{"internalType":"bytes","name":"_to","type":"bytes"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"swap","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"useLayerZeroToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}] -------------------------------------------------------------------------------- /abis/WooPPV2_1.json: -------------------------------------------------------------------------------- 1 | [{"inputs":[{"internalType":"address","name":"_quoteToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addr","type":"address"},{"indexed":false,"internalType":"bool","name":"flag","type":"bool"}],"name":"AdminUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newFeeAddr","type":"address"}],"name":"FeeAddrUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Migrate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"fromToken","type":"address"},{"indexed":true,"internalType":"address","name":"toToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"fromAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"address","name":"rebateTo","type":"address"},{"indexed":false,"internalType":"uint256","name":"swapVol","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"swapFee","type":"uint256"}],"name":"WooSwap","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newWooracle","type":"address"}],"name":"WooracleUpdated","type":"event"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"balance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"depositAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeAddr","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_wooracle","type":"address"},{"internalType":"address","name":"_feeAddr","type":"address"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"newPool","type":"address"}],"name":"migrateToNewPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"poolSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"}],"name":"query","outputs":[{"internalType":"uint256","name":"toAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"quoteToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IWooLendingManager","name":"lendManager","type":"address"}],"name":"repayWeeklyLending","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"bool","name":"flag","type":"bool"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeAddr","type":"address"}],"name":"setFeeAddr","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint16","name":"rate","type":"uint16"}],"name":"setFeeRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_wooracle","type":"address"}],"name":"setWooracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"skim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"skimMulTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"},{"internalType":"uint256","name":"minToAmount","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"rebateTo","type":"address"}],"name":"swap","outputs":[{"internalType":"uint256","name":"realToAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"sync","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokenInfos","outputs":[{"internalType":"uint192","name":"reserve","type":"uint192"},{"internalType":"uint16","name":"feeRate","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"}],"name":"tryQuery","outputs":[{"internalType":"uint256","name":"toAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unclaimedFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wooracle","outputs":[{"internalType":"contract IWooracleV2","name":"","type":"address"}],"stateMutability":"view","type":"function"}] -------------------------------------------------------------------------------- /abis/WooCrossChainRouterV4_1.json: -------------------------------------------------------------------------------- 1 | [{"inputs":[{"internalType":"address","name":"_weth","type":"address"},{"internalType":"address","name":"_wooRouter","type":"address"},{"internalType":"address","name":"_sgInfo","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"refId","type":"uint256"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"address","name":"bridgedToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"bridgedAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"toToken","type":"address"},{"indexed":false,"internalType":"address","name":"realToToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"minToAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"realToAmount","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"swapType","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"WooCrossSwapOnDstChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"refId","type":"uint256"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"address","name":"fromToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"fromAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"bridgeToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"minBridgeAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"realBridgeAmount","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"swapType","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"WooCrossSwapOnSrcChain","type":"event"},{"inputs":[],"name":"ETH_PLACEHOLDER_ADDR","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_BASE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bridgeSlippage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"claimFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"refId","type":"uint256"},{"internalType":"address payable","name":"to","type":"address"},{"components":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"bridgeToken","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"},{"internalType":"uint256","name":"minBridgeAmount","type":"uint256"}],"internalType":"struct IWooCrossChainRouterV3.SrcInfos","name":"srcInfos","type":"tuple"},{"components":[{"internalType":"uint16","name":"chainId","type":"uint16"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"address","name":"bridgeToken","type":"address"},{"internalType":"uint256","name":"minToAmount","type":"uint256"},{"internalType":"uint256","name":"airdropNativeAmount","type":"uint256"},{"internalType":"uint256","name":"dstGasForCall","type":"uint256"}],"internalType":"struct IWooCrossChainRouterV3.DstInfos","name":"dstInfos","type":"tuple"},{"components":[{"internalType":"address","name":"swapRouter","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct IWooCrossChainRouterV3.Src1inch","name":"src1inch","type":"tuple"},{"components":[{"internalType":"address","name":"swapRouter","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct IWooCrossChainRouterV3.Dst1inch","name":"dst1inch","type":"tuple"}],"name":"crossSwap","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"dstExternalFeeRate","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeAddr","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"stuckToken","type":"address"}],"name":"inCaseTokenGotStuck","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"refId","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"components":[{"internalType":"uint16","name":"chainId","type":"uint16"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"address","name":"bridgeToken","type":"address"},{"internalType":"uint256","name":"minToAmount","type":"uint256"},{"internalType":"uint256","name":"airdropNativeAmount","type":"uint256"},{"internalType":"uint256","name":"dstGasForCall","type":"uint256"}],"internalType":"struct IWooCrossChainRouterV3.DstInfos","name":"dstInfos","type":"tuple"},{"components":[{"internalType":"address","name":"swapRouter","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct IWooCrossChainRouterV3.Dst1inch","name":"dst1inch","type":"tuple"}],"name":"quoteLayerZeroFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_bridgeSlippage","type":"uint256"}],"name":"setBridgeSlippage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeAddr","type":"address"}],"name":"setFeeAddr","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"address","name":"_crossRouter","type":"address"}],"name":"setWooCrossRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_wooRouter","type":"address"}],"name":"setWooRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sgInfo","outputs":[{"internalType":"contract ISgInfo","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"bridgedToken","type":"address"},{"internalType":"uint256","name":"amountLD","type":"uint256"},{"internalType":"bytes","name":"payload","type":"bytes"}],"name":"sgReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"srcExternalFeeRate","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"wooCrossRouters","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wooRouter","outputs":[{"internalType":"contract IWooRouterV2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}] -------------------------------------------------------------------------------- /src/multichain/avax.ts: -------------------------------------------------------------------------------- 1 | import { BigDecimal, BigInt, TypedMap } from "@graphprotocol/graph-ts"; 2 | 3 | export let BI_0 = BigInt.fromI32(0); 4 | export let BI_1 = BigInt.fromI32(1); 5 | export let BI_2 = BigInt.fromI32(2); 6 | export let BI_6 = BigInt.fromI32(6); 7 | export let BI_8 = BigInt.fromI32(8); 8 | export let BI_18 = BigInt.fromI32(18); 9 | 10 | export let BD_0 = BigDecimal.fromString("0"); 11 | export let BD_1 = BigDecimal.fromString("1"); 12 | 13 | // Address Must Be Lower Case!!! 14 | export const ETHER = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"; 15 | export const ETHER_SYMBOL = "AVAX"; 16 | export const ETHER_NAME = "avax"; 17 | 18 | export const WRAPPED = "0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7"; 19 | 20 | export const STABLE_TOKENS: string[] = [ 21 | "0x19860ccb0a68fd4213ab9d8266f7bbf05a8dde98", // BUSD.e 22 | "0xc7198437980c041c805a1edcba50c1ce5db95118", // USDT.e 23 | "0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664", // USDC.e 24 | "0xd586e7f844cea2f87f50152665bcbc2c279d8d70", // DAI.e 25 | "0x1c20e891bab6b1727d14da358fae2984ed9b59eb", // TUSD 26 | "0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7", // USDT 27 | "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e", // USDC 28 | ]; 29 | 30 | // Contract Name as Variable Name 31 | export const WOO_ROUTER_SOURCES: string[] = [ 32 | "0x160020b09ded3d862f7f851b5c50632bcf2062ff", // WooRouterV1 33 | "0x3e0da0a9e4139b32b37710784b8dca643c152001", // WooRouterV1 34 | "0x5aa6a4e96a9129562e2fc06660d07feddaaf7854", // WooRouterV1 35 | "0xc22fbb3133df781e6c25ea6acebe2d2bb8cea2f9", // WooRouterV2 36 | "0x4c4af8dbc524681930a27b2f1af5bcc8062e6fb7", // WooRouterV2 37 | "0xdf37f7a85d4563f39a78494568824b4df8669b7a", // WooCrossChainRouterV1 38 | "0x1e6bb552ac038c6afb6ec5db6b06fdd106e31e33", // WooCrossChainRouterV1 39 | "0x51af494f1b4d3f77835951fa827d66fc4a18dae8", // WooCrossChainRouterV2 40 | "0xe47fec1c72850d867a1655c4c5902de7728ca205", // WooCrossChainRouterV3 41 | "0xca10e8825fa9f1db0651cd48a9097997dbf7615d", // WooCrossChainRouterV4 42 | ]; 43 | 44 | export const WOO_PP_SOURCES: string[] = [ 45 | "0xf8ce0d043891b62c55380fb1efbfb4f186153d96", // WooPPV1 46 | "0x1df3009c57a8b143c6246149f00b090bce3b8f88", // WooPPV1 47 | "0x3b3e4b4741e91af52d0e9ad8660573e951c88524", // WooPPV2 48 | "0xed9e3f98bbed560e66b89aac922e29d4596a9642", // WooPPV2 49 | "0x5520385bfcf07ec87c4c53a7d8d65595dff69fa4", // WooPPV2 50 | ]; 51 | 52 | export let WOO_PP_QUOTE_TOKENS = new TypedMap(); 53 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[0], STABLE_TOKENS[1]); // USDT.e 54 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[1], STABLE_TOKENS[6]); // USDC 55 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[2], STABLE_TOKENS[6]); // USDC 56 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[3], STABLE_TOKENS[6]); // USDC 57 | WOO_PP_QUOTE_TOKENS.set(WOO_PP_SOURCES[4], STABLE_TOKENS[6]); // USDC 58 | 59 | export const WOO_VAULT_MANAGER_SOURCES: string[] = [ 60 | "0xb97851fa559c2596e26038a1d531bb846050cdf7", 61 | "0x48419c93d0d3b2428cd02bbcdeabd3aafc107f85", 62 | "0xfd7ed9d3d4fd88595af6a87f798ffdb42b4d7ccb", 63 | ]; 64 | 65 | // destination swap called by Layer Zero Relayer 66 | export const LAYER_ZERO_SOURCES: string[] = [ 67 | "0x6f475642a6e85809b1c36fa62763669b1b48dd5b", // Relayer 68 | "0xcd2e3622d483c7dc855f72e5eafadcd577ac78b4", // Relayer 69 | ]; 70 | 71 | export const WOOFI_SOURCES: string[] = WOO_ROUTER_SOURCES.concat(WOO_PP_SOURCES).concat(WOO_VAULT_MANAGER_SOURCES).concat(LAYER_ZERO_SOURCES); 72 | 73 | export const WOOFI_REBATE_ADDRESSES: string[] = []; 74 | 75 | export const ONE_INCH_REBATE_ADDRESSES: string[] = [ 76 | "0x703a96e7d7a6d05d2d7f3f8223fd538c23897ce8", 77 | "0x910bf2d50fa5e014fd06666f456182d4ab7c8bd2", 78 | ]; 79 | 80 | export const DODO_REBATE_ADDRESSES: string[] = [ 81 | "0xea8e147bdb3ee3dde2085acb88de826e1a6de37a", 82 | "0xce9f9716fec7b4c11c773751aa579b1908fe9f5b", 83 | ]; 84 | 85 | export const OPEN_OCEAN_REBATE_ADDRESSES: string[] = [ 86 | "0x353c1f0bc78fbbc245b3c93ef77b1dcc5b77d2a0", 87 | "0x922164bbbd36acf9e854acbbf32facc949fcaeef", 88 | ]; 89 | 90 | export const METAMASK_REBATE_ADDRESSES: string[] = []; 91 | 92 | export const YIELD_YAK_REBATE_ADDRESSES: string[] = [ 93 | "0x5925c5c6843a8f67f7ef2b55db1f5491573c85eb", 94 | ]; 95 | 96 | export const FIRE_BIRD_REBATE_ADDRESSES: string[] = [ 97 | "0xa20ca7c6705fb88847cbf50549d7a38f4e99d32c", 98 | ]; 99 | 100 | export const BIT_KEEP_REBATE_ADDRESSES: string[] = [ 101 | "0x9712394caccab28acd26d41f7e0566c1e88759aa", 102 | ]; 103 | 104 | export const PARA_SWAP_REBATE_ADDRESSES: string[] = [ 105 | "0xdef171fe48cf0115b1d80b88dc8eab59176fee57", 106 | "0xd5b927956057075377263aab7f8afc12f85100db", 107 | ]; 108 | 109 | export const BEETHOVEN_X_REBATE_ADDRESSES: string[] = []; 110 | 111 | export const TRANSIT_SWAP_REBATE_ADDRESSES: string[] = [ 112 | "0x92106728f6efe170f8de919e1bd88c04c2473d3c", 113 | ]; 114 | 115 | export const ZERO_X_REBATE_ADDRESSES: string[] = [ 116 | "0xbfdcbb4c05843163f491c24f9c0019c510786304", 117 | "0x5e01d320e95133d80dd59a2191c95728fa69036d", 118 | ]; 119 | 120 | export const ODOS_REBATE_ADDRESSES: string[] = [ 121 | "0xb863a381661b0ca6d5fd17b8a187fed768004592", 122 | "0x498292dc123f19bdbc109081f6cf1d0e849a9daf", 123 | ]; 124 | 125 | export const HERA_FINANCE_REBATE_ADDRESSES: string[] = [ 126 | "0x1111110808b63f93b869a8a8ef87bc5b4dd79689", 127 | ]; 128 | 129 | export const THOR_SWAP_REBATE_ADDRESSES: string[] = [ 130 | "0x72c6d8fcc3e591253a1eb563180d317998346bec", 131 | ]; 132 | 133 | export const OKX_REBATE_ADDRESSES: string[] = []; 134 | 135 | export const ONTO_REBATE_ADDRESSES: string[] = [ 136 | "0x0ce56280bf51dc8211952c3522d4e1ce917319a6", 137 | ]; 138 | 139 | export const YETI_REBATE_ADDRESSES: string[] = [ 140 | "0x718c79e7c12f7e2c1a5d641c81d02eb7566db9a8", 141 | ]; 142 | 143 | export const JOY_REBATE_ADDRESSES: string[] = []; 144 | 145 | export const ZETA_FARM_REBATE_ADDRESSES: string[] = [ 146 | "0x04a285427eee8ade8dce32299478e4522fb7c287", 147 | ]; 148 | 149 | export const SLINGSHOT_REBATE_ADDRESSES: string[] = []; 150 | 151 | export const KALM_REBATE_ADDRESSES: string[] = []; 152 | 153 | export const UNIZEN_REBATE_ADDRESSES: string[] = [ 154 | "0xaf951f7a4aa4e2a033b034af0897273ed553e8c3", 155 | ]; 156 | 157 | export const KYBER_SWAP_REBATE_ADDRESSES: string[] = [ 158 | "0x4f82e73edb06d29ff62c91ec8f5ff06571bdeb29", 159 | ]; 160 | 161 | export const ONE_DELTA_REBATE_ADDRESSES: string[] = [ 162 | "0xc95eed7f6e8334611765f84ceb8ed6270f08907e", 163 | ]; 164 | 165 | export const EISEN_REBATE_ADDRESSES: string[] = []; 166 | 167 | export const HYPERSONIC_REBATE_ADDRESSES: string[] = []; 168 | 169 | export const GLUEX_REBATE_ADDRESSES: string[] = [ 170 | "0x3cffef055725974e32a660a617fc999b67e9196e", 171 | ]; 172 | 173 | export let REBATE_ADDRESSES: string[][] = [ 174 | WOOFI_REBATE_ADDRESSES, // 0: WOOFi 175 | ONE_INCH_REBATE_ADDRESSES, // 1: 1inch 176 | DODO_REBATE_ADDRESSES, // 2: DODO 177 | OPEN_OCEAN_REBATE_ADDRESSES, // 3: OpenOcean 178 | METAMASK_REBATE_ADDRESSES, // 4: MetaMask 179 | YIELD_YAK_REBATE_ADDRESSES, // 5: YieldYak 180 | FIRE_BIRD_REBATE_ADDRESSES, // 6: FireBird 181 | BIT_KEEP_REBATE_ADDRESSES, // 7: BitKeep 182 | PARA_SWAP_REBATE_ADDRESSES, // 8: ParaSwap 183 | BEETHOVEN_X_REBATE_ADDRESSES, // 9: BeethovenX 184 | TRANSIT_SWAP_REBATE_ADDRESSES, // 10: TransitSwap 185 | ZERO_X_REBATE_ADDRESSES, // 11: 0x 186 | ODOS_REBATE_ADDRESSES, // 12: ODOS 187 | HERA_FINANCE_REBATE_ADDRESSES, // 13: HeraFinance 188 | THOR_SWAP_REBATE_ADDRESSES, // 14: THORSwap 189 | OKX_REBATE_ADDRESSES, // 15: OKX 190 | ONTO_REBATE_ADDRESSES, // 16: ONTO 191 | YETI_REBATE_ADDRESSES, // 17: Yeti 192 | JOY_REBATE_ADDRESSES, // 18: Joy 193 | ZETA_FARM_REBATE_ADDRESSES, // 19: ZetaFarm 194 | SLINGSHOT_REBATE_ADDRESSES, // 20: Slingshot 195 | KALM_REBATE_ADDRESSES, // 21: KALM 196 | UNIZEN_REBATE_ADDRESSES, // 22: unizen 197 | KYBER_SWAP_REBATE_ADDRESSES, // 23: KyberSwap 198 | ONE_DELTA_REBATE_ADDRESSES, // 24: 1delta 199 | EISEN_REBATE_ADDRESSES, // 25: Eisen 200 | HYPERSONIC_REBATE_ADDRESSES, // 26: Hypersonic 201 | GLUEX_REBATE_ADDRESSES, // 27: GlueX 202 | ]; 203 | 204 | export const GLOBAL_VARIABLE_ID = "0"; 205 | export const ORDER_HISTORY_VARIABLE_ID = "0"; 206 | export const CROSS_CHAIN_SRC_ORDER_HISTORY_VARIABLE_ID = "1"; 207 | export const CROSS_CHAIN_DST_ORDER_HISTORY_VARIABLE_ID = "2"; 208 | 209 | export const WOOFI_ORDER_SOURCE_ID = "0"; 210 | export const OTHER_ORDER_SOURCE_ID = "99"; 211 | export const GET_ORDER_SOURCE_BY_WOO_ROUTER_SWAP_FROM_ID = "-99"; 212 | 213 | export const WOOFI_SWAP_TYPE = 0; 214 | --------------------------------------------------------------------------------