├── .gitignore ├── .prettierrc ├── .tool-versions ├── LICENSE ├── README.md ├── abis ├── ChainlinkOracle.json ├── ChainlinkOracleFactory.json ├── ChaosSplit.json ├── DiversifierFactory.json ├── FullLiquidSplit.json ├── LiquidSplitFactory.json ├── PassThroughWallet.json ├── PassThroughWalletFactory.json ├── Recoup.json ├── SplitWallet.json ├── Swapper.json ├── SwapperFactory.json ├── UniV3Oracle.json ├── UniV3OracleFactory.json ├── UniV3Pool.json ├── VestingModule.json ├── VestingModuleFactory.json ├── WaterfallModule.json ├── WaterfallModuleFactory.json ├── ethereum.SplitMain.json └── polygon.SplitMain.json ├── config ├── arb-goerli.json ├── arbitrum.json ├── aurora.json ├── avalanche.json ├── base-goerli.json ├── base-sepolia.json ├── base.json ├── bsc.json ├── fantom.json ├── gnosis.json ├── goerli.json ├── holesky.json ├── mainnet.json ├── mumbai.json ├── opt-goerli.json ├── opt-sepolia.json ├── optimism.json ├── polygon.json ├── sepolia.json ├── zora-goerli.json └── zora.json ├── package.json ├── schema.template.graphql ├── src ├── chainlink-oracle.mapping.ts ├── ethereum.mapping.ts ├── helpers.ts ├── liquid-split.mapping.ts ├── oracle.mapping.ts ├── pass-through-wallet.mapping.ts ├── polygon.mapping.ts ├── swapper.mapping.ts ├── templates.mapping.ts ├── vesting.mapping.ts └── waterfall.mapping.ts ├── subgraph.template.yaml ├── tsconfig.json └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | .env* 4 | 5 | # dependencies 6 | /node_modules 7 | 8 | # misc 9 | .DS_Store 10 | 11 | # subgraph artifacts 12 | build 13 | generated 14 | 15 | # build artifacts 16 | subgraph.yaml 17 | schema.graphql 18 | src/mapping.ts 19 | abis/SplitMain.json 20 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "tabWidth": 2, 3 | "semi": false, 4 | "trailingComma": "all", 5 | "singleQuote": true, 6 | "printWidth": 80 7 | } 8 | -------------------------------------------------------------------------------- /.tool-versions: -------------------------------------------------------------------------------- 1 | nodejs 18.16.1 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 0xSplits Subgraph 2 | 3 | ## NOTE 4 | The subgraphs below will all become inactive on June 12 when The Graph sunsets the Hosted Service. For more information please refer to their [announcement](https://thegraph.com/blog/sunbeam-upgrade-window/). 5 | To access Splits subgraph data post sunset, please use the [sdk](https://github.com/0xSplits/splits-sdk). 6 | 7 | ## Ethereum 8 | 9 | - [Mainnet](https://thegraph.com/hosted-service/subgraph/0xsplits/splits-subgraph-ethereum) 10 | - [Goerli](https://thegraph.com/hosted-service/subgraph/0xsplits/splits-subgraph-goerli) 11 | - [Sepolia](https://thegraph.com/hosted-service/subgraph/0xsplits/splits-subgraph-sepolia) 12 | 13 | ## Polygon 14 | 15 | - [Polygon](https://thegraph.com/hosted-service/subgraph/0xsplits/splits-subgraph-polygon) 16 | - [Mumbai](https://thegraph.com/hosted-service/subgraph/0xsplits/splits-subgraph-mumbai) 17 | 18 | ## Other Networks 19 | 20 | - [Optimism](https://thegraph.com/hosted-service/subgraph/0xsplits/splits-subgraph-optimism) 21 | - [Optimism Goerli](https://thegraph.com/hosted-service/subgraph/0xsplits/splits-subgraph-opt-goerli) 22 | - [Optimism Sepolia](https://thegraph.com/studio/subgraph/splits-subgraph-opt-sepolia/) 23 | - [Arbitrum](https://thegraph.com/hosted-service/subgraph/0xsplits/splits-subgraph-arbitrum) 24 | - [Arbitrum Goerli](https://thegraph.com/hosted-service/subgraph/0xsplits/splits-subgraph-arb-goerli) 25 | - [Zora](https://api.goldsky.com/api/public/project_clhk16b61ay9t49vm6ntn4mkz/subgraphs/splits-zora-mainnet/1.1.0/gn) 26 | - [Zora Goerli](https://api.goldsky.com/api/public/project_clhk16b61ay9t49vm6ntn4mkz/subgraphs/splits-zora-testnet/1.0.0/gn) 27 | - [Base](https://thegraph.com/hosted-service/subgraph/0xsplits/splits-subgraph-base) 28 | - [Base Goerli](https://thegraph.com/hosted-service/subgraph/0xsplits/splits-subgraph-base-goerli) 29 | - [Base Sepolia](https://thegraph.com/studio/subgraph/splits-subgraph-base-sepolia/) 30 | - [Gnosis](https://thegraph.com/hosted-service/subgraph/0xsplits/splits-subgraph-gnosis) 31 | - [Fantom](https://thegraph.com/hosted-service/subgraph/0xsplits/splits-subgraph-fantom) 32 | - [Avalanche](https://thegraph.com/hosted-service/subgraph/0xsplits/splits-subgraph-avalanche) 33 | - [Bsc](https://thegraph.com/hosted-service/subgraph/0xsplits/splits-subgraph-bsc) 34 | - [Aurora](https://thegraph.com/hosted-service/subgraph/0xsplits/splits-subgraph-aurora) 35 | 36 | ### Install 37 | 38 | ```bash 39 | yarn install 40 | ``` 41 | 42 | ### Prepare 43 | 44 | ```bash 45 | yarn prepare:${NETWORK} (mainnet, polygon) 46 | ``` 47 | 48 | - [ handle ethereum vs polygon ABI, mappings ] 49 | - Compiles subgraph.yaml from subgraph.template.yaml 50 | - Generates types from schema.graphql 51 | 52 | ### Deploy 53 | 54 | First you will need to authenticate with the proper deploy key for the given network. Or you can create your own Subgraph and deploy key for testing: 55 | 56 | ```bash 57 | graph auth --studio ${GRAPH_API_KEY} 58 | # or 59 | graph auth ${GRAPH_API_KEY} --product hosted-service 60 | ``` 61 | 62 | If you are deploying one of the official 0xSplits subgraphs: 63 | 64 | ```bash 65 | yarn deploy:${NETWORK} 66 | ``` 67 | 68 | If you are deploying your own for testing: 69 | 70 | ```bash 71 | graph deploy --node https://api.studio.thegraph.com/deploy/${PROJECT} 72 | ``` 73 | 74 | To check health of a deployed subgraph: 75 | 76 | ``` 77 | curl -X POST -d '{ "query": "{indexingStatuses(subgraphs: [\"\"]) {synced health fatalError {message block { number } handler } subgraph chains { chainHeadBlock { number } latestBlock { number }}}}"}' https://api.thegraph.com/index-node/graphql 78 | ``` 79 | -------------------------------------------------------------------------------- /abis/ChainlinkOracle.json: -------------------------------------------------------------------------------- 1 | { 2 | "abi": [ 3 | { 4 | "type": "constructor", 5 | "inputs": [ 6 | { "name": "weth9_", "type": "address", "internalType": "address" }, 7 | { 8 | "name": "sequencerFeed_", 9 | "type": "address", 10 | "internalType": "address" 11 | } 12 | ], 13 | "stateMutability": "nonpayable" 14 | }, 15 | { 16 | "type": "function", 17 | "name": "chainlinkOracleFactory", 18 | "inputs": [], 19 | "outputs": [{ "name": "", "type": "address", "internalType": "address" }], 20 | "stateMutability": "view" 21 | }, 22 | { 23 | "type": "function", 24 | "name": "getPairDetails", 25 | "inputs": [ 26 | { 27 | "name": "quotePairs_", 28 | "type": "tuple[]", 29 | "internalType": "struct QuotePair[]", 30 | "components": [ 31 | { "name": "base", "type": "address", "internalType": "address" }, 32 | { "name": "quote", "type": "address", "internalType": "address" } 33 | ] 34 | } 35 | ], 36 | "outputs": [ 37 | { 38 | "name": "pairDetails", 39 | "type": "tuple[]", 40 | "internalType": "struct ChainlinkOracleImpl.PairDetail[]", 41 | "components": [ 42 | { "name": "path", "type": "bytes", "internalType": "bytes" }, 43 | { "name": "inverted", "type": "bool", "internalType": "bool" } 44 | ] 45 | } 46 | ], 47 | "stateMutability": "view" 48 | }, 49 | { 50 | "type": "function", 51 | "name": "getQuoteAmounts", 52 | "inputs": [ 53 | { 54 | "name": "quoteParams_", 55 | "type": "tuple[]", 56 | "internalType": "struct QuoteParams[]", 57 | "components": [ 58 | { 59 | "name": "quotePair", 60 | "type": "tuple", 61 | "internalType": "struct QuotePair", 62 | "components": [ 63 | { 64 | "name": "base", 65 | "type": "address", 66 | "internalType": "address" 67 | }, 68 | { 69 | "name": "quote", 70 | "type": "address", 71 | "internalType": "address" 72 | } 73 | ] 74 | }, 75 | { 76 | "name": "baseAmount", 77 | "type": "uint128", 78 | "internalType": "uint128" 79 | }, 80 | { "name": "data", "type": "bytes", "internalType": "bytes" } 81 | ] 82 | } 83 | ], 84 | "outputs": [ 85 | { 86 | "name": "quoteAmounts", 87 | "type": "uint256[]", 88 | "internalType": "uint256[]" 89 | } 90 | ], 91 | "stateMutability": "view" 92 | }, 93 | { 94 | "type": "function", 95 | "name": "initializer", 96 | "inputs": [ 97 | { 98 | "name": "params_", 99 | "type": "tuple", 100 | "internalType": "struct ChainlinkOracleImpl.InitParams", 101 | "components": [ 102 | { "name": "owner", "type": "address", "internalType": "address" }, 103 | { "name": "paused", "type": "bool", "internalType": "bool" }, 104 | { 105 | "name": "pairDetails", 106 | "type": "tuple[]", 107 | "internalType": "struct ChainlinkOracleImpl.SetPairDetailParams[]", 108 | "components": [ 109 | { 110 | "name": "quotePair", 111 | "type": "tuple", 112 | "internalType": "struct QuotePair", 113 | "components": [ 114 | { 115 | "name": "base", 116 | "type": "address", 117 | "internalType": "address" 118 | }, 119 | { 120 | "name": "quote", 121 | "type": "address", 122 | "internalType": "address" 123 | } 124 | ] 125 | }, 126 | { 127 | "name": "pairDetail", 128 | "type": "tuple", 129 | "internalType": "struct ChainlinkOracleImpl.PairDetail", 130 | "components": [ 131 | { 132 | "name": "path", 133 | "type": "bytes", 134 | "internalType": "bytes" 135 | }, 136 | { 137 | "name": "inverted", 138 | "type": "bool", 139 | "internalType": "bool" 140 | } 141 | ] 142 | } 143 | ] 144 | } 145 | ] 146 | } 147 | ], 148 | "outputs": [], 149 | "stateMutability": "nonpayable" 150 | }, 151 | { 152 | "type": "function", 153 | "name": "owner", 154 | "inputs": [], 155 | "outputs": [{ "name": "", "type": "address", "internalType": "address" }], 156 | "stateMutability": "view" 157 | }, 158 | { 159 | "type": "function", 160 | "name": "paused", 161 | "inputs": [], 162 | "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], 163 | "stateMutability": "view" 164 | }, 165 | { 166 | "type": "function", 167 | "name": "sequencerFeed", 168 | "inputs": [], 169 | "outputs": [ 170 | { 171 | "name": "", 172 | "type": "address", 173 | "internalType": "contract AggregatorV3Interface" 174 | } 175 | ], 176 | "stateMutability": "view" 177 | }, 178 | { 179 | "type": "function", 180 | "name": "setPairDetails", 181 | "inputs": [ 182 | { 183 | "name": "params_", 184 | "type": "tuple[]", 185 | "internalType": "struct ChainlinkOracleImpl.SetPairDetailParams[]", 186 | "components": [ 187 | { 188 | "name": "quotePair", 189 | "type": "tuple", 190 | "internalType": "struct QuotePair", 191 | "components": [ 192 | { 193 | "name": "base", 194 | "type": "address", 195 | "internalType": "address" 196 | }, 197 | { 198 | "name": "quote", 199 | "type": "address", 200 | "internalType": "address" 201 | } 202 | ] 203 | }, 204 | { 205 | "name": "pairDetail", 206 | "type": "tuple", 207 | "internalType": "struct ChainlinkOracleImpl.PairDetail", 208 | "components": [ 209 | { "name": "path", "type": "bytes", "internalType": "bytes" }, 210 | { "name": "inverted", "type": "bool", "internalType": "bool" } 211 | ] 212 | } 213 | ] 214 | } 215 | ], 216 | "outputs": [], 217 | "stateMutability": "nonpayable" 218 | }, 219 | { 220 | "type": "function", 221 | "name": "setPaused", 222 | "inputs": [{ "name": "paused_", "type": "bool", "internalType": "bool" }], 223 | "outputs": [], 224 | "stateMutability": "nonpayable" 225 | }, 226 | { 227 | "type": "function", 228 | "name": "transferOwnership", 229 | "inputs": [ 230 | { "name": "owner_", "type": "address", "internalType": "address" } 231 | ], 232 | "outputs": [], 233 | "stateMutability": "nonpayable" 234 | }, 235 | { 236 | "type": "function", 237 | "name": "weth9", 238 | "inputs": [], 239 | "outputs": [{ "name": "", "type": "address", "internalType": "address" }], 240 | "stateMutability": "view" 241 | }, 242 | { 243 | "type": "event", 244 | "name": "OwnershipTransferred", 245 | "inputs": [ 246 | { 247 | "name": "oldOwner", 248 | "type": "address", 249 | "indexed": true, 250 | "internalType": "address" 251 | }, 252 | { 253 | "name": "newOwner", 254 | "type": "address", 255 | "indexed": true, 256 | "internalType": "address" 257 | } 258 | ], 259 | "anonymous": false 260 | }, 261 | { 262 | "type": "event", 263 | "name": "SetPairDetails", 264 | "inputs": [ 265 | { 266 | "name": "params", 267 | "type": "tuple[]", 268 | "indexed": false, 269 | "internalType": "struct ChainlinkOracleImpl.SetPairDetailParams[]", 270 | "components": [ 271 | { 272 | "name": "quotePair", 273 | "type": "tuple", 274 | "internalType": "struct QuotePair", 275 | "components": [ 276 | { 277 | "name": "base", 278 | "type": "address", 279 | "internalType": "address" 280 | }, 281 | { 282 | "name": "quote", 283 | "type": "address", 284 | "internalType": "address" 285 | } 286 | ] 287 | }, 288 | { 289 | "name": "pairDetail", 290 | "type": "tuple", 291 | "internalType": "struct ChainlinkOracleImpl.PairDetail", 292 | "components": [ 293 | { "name": "path", "type": "bytes", "internalType": "bytes" }, 294 | { "name": "inverted", "type": "bool", "internalType": "bool" } 295 | ] 296 | } 297 | ] 298 | } 299 | ], 300 | "anonymous": false 301 | }, 302 | { 303 | "type": "event", 304 | "name": "SetPaused", 305 | "inputs": [ 306 | { 307 | "name": "paused", 308 | "type": "bool", 309 | "indexed": false, 310 | "internalType": "bool" 311 | } 312 | ], 313 | "anonymous": false 314 | }, 315 | { "type": "error", "name": "GracePeriodNotOver", "inputs": [] }, 316 | { "type": "error", "name": "InvalidFeed_Decimals", "inputs": [] }, 317 | { 318 | "type": "error", 319 | "name": "InvalidPair_FeedNotSet", 320 | "inputs": [ 321 | { 322 | "name": "qp", 323 | "type": "tuple", 324 | "internalType": "struct QuotePair", 325 | "components": [ 326 | { "name": "base", "type": "address", "internalType": "address" }, 327 | { "name": "quote", "type": "address", "internalType": "address" } 328 | ] 329 | } 330 | ] 331 | }, 332 | { 333 | "type": "error", 334 | "name": "NegativePrice", 335 | "inputs": [ 336 | { 337 | "name": "feed", 338 | "type": "address", 339 | "internalType": "contract AggregatorV3Interface" 340 | }, 341 | { "name": "price", "type": "int256", "internalType": "int256" } 342 | ] 343 | }, 344 | { "type": "error", "name": "Paused", "inputs": [] }, 345 | { "type": "error", "name": "SequencerDown", "inputs": [] }, 346 | { 347 | "type": "error", 348 | "name": "StalePrice", 349 | "inputs": [ 350 | { 351 | "name": "feed", 352 | "type": "address", 353 | "internalType": "contract AggregatorV3Interface" 354 | }, 355 | { "name": "timestamp", "type": "uint256", "internalType": "uint256" } 356 | ] 357 | }, 358 | { "type": "error", "name": "Unauthorized", "inputs": [] }, 359 | { "type": "error", "name": "ZeroPrice", "inputs": [] } 360 | ] 361 | } 362 | -------------------------------------------------------------------------------- /abis/ChainlinkOracleFactory.json: -------------------------------------------------------------------------------- 1 | { 2 | "abi": [ 3 | { 4 | "type": "function", 5 | "name": "createOracle", 6 | "inputs": [ 7 | { "name": "data_", "type": "bytes", "internalType": "bytes" }, 8 | { "name": "salt_", "type": "bytes32", "internalType": "bytes32" } 9 | ], 10 | "outputs": [ 11 | { "name": "oracle", "type": "address", "internalType": "address" } 12 | ], 13 | "stateMutability": "nonpayable" 14 | }, 15 | { 16 | "type": "function", 17 | "name": "isDeployed", 18 | "inputs": [ 19 | { "name": "data_", "type": "bytes", "internalType": "bytes" }, 20 | { "name": "salt_", "type": "bytes32", "internalType": "bytes32" } 21 | ], 22 | "outputs": [ 23 | { "name": "", "type": "address", "internalType": "address" }, 24 | { "name": "", "type": "bool", "internalType": "bool" } 25 | ], 26 | "stateMutability": "view" 27 | }, 28 | { 29 | "type": "function", 30 | "name": "oracleImplementation", 31 | "inputs": [], 32 | "outputs": [ 33 | { "name": "oracle_", "type": "address", "internalType": "address" } 34 | ], 35 | "stateMutability": "view" 36 | }, 37 | { 38 | "type": "function", 39 | "name": "predictDeterministicAddress", 40 | "inputs": [ 41 | { "name": "data_", "type": "bytes", "internalType": "bytes" }, 42 | { "name": "salt_", "type": "bytes32", "internalType": "bytes32" } 43 | ], 44 | "outputs": [{ "name": "", "type": "address", "internalType": "address" }], 45 | "stateMutability": "view" 46 | }, 47 | { 48 | "type": "event", 49 | "name": "CreateChainlinkOracle", 50 | "inputs": [ 51 | { 52 | "name": "oracle", 53 | "type": "address", 54 | "indexed": true, 55 | "internalType": "address" 56 | }, 57 | { 58 | "name": "params", 59 | "type": "tuple", 60 | "indexed": false, 61 | "internalType": "struct ChainlinkOracleImpl.InitParams", 62 | "components": [ 63 | { "name": "owner", "type": "address", "internalType": "address" }, 64 | { "name": "paused", "type": "bool", "internalType": "bool" }, 65 | { 66 | "name": "pairDetails", 67 | "type": "tuple[]", 68 | "internalType": "struct ChainlinkOracleImpl.SetPairDetailParams[]", 69 | "components": [ 70 | { 71 | "name": "quotePair", 72 | "type": "tuple", 73 | "internalType": "struct QuotePair", 74 | "components": [ 75 | { 76 | "name": "base", 77 | "type": "address", 78 | "internalType": "address" 79 | }, 80 | { 81 | "name": "quote", 82 | "type": "address", 83 | "internalType": "address" 84 | } 85 | ] 86 | }, 87 | { 88 | "name": "pairDetail", 89 | "type": "tuple", 90 | "internalType": "struct ChainlinkOracleImpl.PairDetail", 91 | "components": [ 92 | { 93 | "name": "path", 94 | "type": "bytes", 95 | "internalType": "bytes" 96 | }, 97 | { 98 | "name": "inverted", 99 | "type": "bool", 100 | "internalType": "bool" 101 | } 102 | ] 103 | } 104 | ] 105 | } 106 | ] 107 | } 108 | ], 109 | "anonymous": false 110 | } 111 | ] 112 | } 113 | -------------------------------------------------------------------------------- /abis/ChaosSplit.json: -------------------------------------------------------------------------------- 1 | { 2 | "abi": [{"inputs":[{"internalType":"string","name":"baseURI_","type":"string"},{"internalType":"string","name":"_contractURI","type":"string"},{"internalType":"address","name":"_splitMain","type":"address"},{"internalType":"uint256","name":"_royaltyPoints","type":"uint256"},{"internalType":"uint32","name":"_distributorFee","type":"uint32"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"BurnPackFailed","type":"error"},{"inputs":[],"name":"CallerIsNotTokenOwner","type":"error"},{"inputs":[],"name":"InvalidOffset","type":"error"},{"inputs":[],"name":"LengthMismatch","type":"error"},{"inputs":[],"name":"MaxSupplyExceeded","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"PackContractLocked","type":"error"},{"inputs":[],"name":"PacksDisabledUntilSuperchargedComplete","type":"error"},{"inputs":[],"name":"SuperchargeConfigurationNotReady","type":"error"},{"inputs":[],"name":"SuperchargedOffsetAlreadySet","type":"error"},{"inputs":[],"name":"SuperchargedOffsetNotSet","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","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":"uint256","name":"_id","type":"uint256"},{"indexed":false,"internalType":"address","name":"_opener","type":"address"}],"name":"PackOpened","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"availableCount","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"availableIds","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tos","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"batchMintSupercharged","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_packIds","type":"uint256[]"}],"name":"batchOpenPack","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"contract ERC20","name":"token","type":"address"},{"internalType":"address","name":"distributorAddress","type":"address"}],"name":"distributeERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"address","name":"distributorAddress","type":"address"}],"name":"distributeETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"distributorFee","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getShuffledTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getSongTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockPackAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mintSupercharged","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"offsets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_packId","type":"uint256"}],"name":"openPack","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"packContract","outputs":[{"internalType":"contract ChaosPacks","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"packContractLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"payoutSplit","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI_","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_contractURI","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_distributorFee","type":"uint32"}],"name":"setDistributorFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_packContract","type":"address"}],"name":"setPackContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_royaltyPoints","type":"uint256"}],"name":"setRoyaltyPoints","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setSuperchargedOffset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"splitMain","outputs":[{"internalType":"contract ISplitMain","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"superchargeBalances","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"superchargedOffset","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}] 3 | } 4 | -------------------------------------------------------------------------------- /abis/DiversifierFactory.json: -------------------------------------------------------------------------------- 1 | { 2 | "abi": [ 3 | { 4 | "inputs": [ 5 | { 6 | "internalType": "contract ISplitMain", 7 | "name": "splitMain_", 8 | "type": "address" 9 | }, 10 | { 11 | "internalType": "contract SwapperFactory", 12 | "name": "swapperFactory_", 13 | "type": "address" 14 | }, 15 | { 16 | "internalType": "contract PassThroughWalletFactory", 17 | "name": "passThroughWalletFactory_", 18 | "type": "address" 19 | } 20 | ], 21 | "stateMutability": "nonpayable", 22 | "type": "constructor" 23 | }, 24 | { 25 | "anonymous": false, 26 | "inputs": [ 27 | { 28 | "indexed": true, 29 | "internalType": "address", 30 | "name": "diversifier", 31 | "type": "address" 32 | } 33 | ], 34 | "name": "CreateDiversifier", 35 | "type": "event" 36 | }, 37 | { 38 | "inputs": [ 39 | { 40 | "components": [ 41 | { 42 | "internalType": "address", 43 | "name": "owner", 44 | "type": "address" 45 | }, 46 | { 47 | "internalType": "bool", 48 | "name": "paused", 49 | "type": "bool" 50 | }, 51 | { 52 | "components": [ 53 | { 54 | "internalType": "contract IOracle", 55 | "name": "oracle", 56 | "type": "address" 57 | }, 58 | { 59 | "components": [ 60 | { 61 | "internalType": "contract IOracleFactory", 62 | "name": "factory", 63 | "type": "address" 64 | }, 65 | { 66 | "internalType": "bytes", 67 | "name": "data", 68 | "type": "bytes" 69 | } 70 | ], 71 | "internalType": "struct CreateOracleParams", 72 | "name": "createOracleParams", 73 | "type": "tuple" 74 | } 75 | ], 76 | "internalType": "struct OracleParams", 77 | "name": "oracleParams", 78 | "type": "tuple" 79 | }, 80 | { 81 | "components": [ 82 | { 83 | "internalType": "address", 84 | "name": "account", 85 | "type": "address" 86 | }, 87 | { 88 | "components": [ 89 | { 90 | "internalType": "address", 91 | "name": "beneficiary", 92 | "type": "address" 93 | }, 94 | { 95 | "internalType": "address", 96 | "name": "tokenToBeneficiary", 97 | "type": "address" 98 | }, 99 | { 100 | "internalType": "uint32", 101 | "name": "defaultScaledOfferFactor", 102 | "type": "uint32" 103 | }, 104 | { 105 | "components": [ 106 | { 107 | "components": [ 108 | { 109 | "internalType": "address", 110 | "name": "base", 111 | "type": "address" 112 | }, 113 | { 114 | "internalType": "address", 115 | "name": "quote", 116 | "type": "address" 117 | } 118 | ], 119 | "internalType": "struct QuotePair", 120 | "name": "quotePair", 121 | "type": "tuple" 122 | }, 123 | { 124 | "internalType": "uint32", 125 | "name": "scaledOfferFactor", 126 | "type": "uint32" 127 | } 128 | ], 129 | "internalType": "struct SwapperImpl.SetPairScaledOfferFactorParams[]", 130 | "name": "pairScaledOfferFactors", 131 | "type": "tuple[]" 132 | } 133 | ], 134 | "internalType": "struct DiversifierFactory.CreateSwapperParams", 135 | "name": "createSwapperParams", 136 | "type": "tuple" 137 | }, 138 | { 139 | "internalType": "uint32", 140 | "name": "percentAllocation", 141 | "type": "uint32" 142 | } 143 | ], 144 | "internalType": "struct DiversifierFactory.RecipientParams[]", 145 | "name": "recipientParams", 146 | "type": "tuple[]" 147 | } 148 | ], 149 | "internalType": "struct DiversifierFactory.CreateDiversifierParams", 150 | "name": "params_", 151 | "type": "tuple" 152 | } 153 | ], 154 | "name": "createDiversifier", 155 | "outputs": [ 156 | { 157 | "internalType": "address", 158 | "name": "diversifier", 159 | "type": "address" 160 | } 161 | ], 162 | "stateMutability": "nonpayable", 163 | "type": "function" 164 | }, 165 | { 166 | "inputs": [], 167 | "name": "passThroughWalletFactory", 168 | "outputs": [ 169 | { 170 | "internalType": "contract PassThroughWalletFactory", 171 | "name": "", 172 | "type": "address" 173 | } 174 | ], 175 | "stateMutability": "view", 176 | "type": "function" 177 | }, 178 | { 179 | "inputs": [], 180 | "name": "splitMain", 181 | "outputs": [ 182 | { 183 | "internalType": "contract ISplitMain", 184 | "name": "", 185 | "type": "address" 186 | } 187 | ], 188 | "stateMutability": "view", 189 | "type": "function" 190 | }, 191 | { 192 | "inputs": [], 193 | "name": "swapperFactory", 194 | "outputs": [ 195 | { 196 | "internalType": "contract SwapperFactory", 197 | "name": "", 198 | "type": "address" 199 | } 200 | ], 201 | "stateMutability": "view", 202 | "type": "function" 203 | } 204 | ] 205 | } 206 | -------------------------------------------------------------------------------- /abis/FullLiquidSplit.json: -------------------------------------------------------------------------------- 1 | { 2 | "abi": [ 3 | { 4 | "inputs": [ 5 | { 6 | "internalType": "address", 7 | "name": "_splitMain", 8 | "type": "address" 9 | }, 10 | { 11 | "internalType": "address[]", 12 | "name": "accounts", 13 | "type": "address[]" 14 | }, 15 | { 16 | "internalType": "uint32[]", 17 | "name": "initAllocations", 18 | "type": "uint32[]" 19 | }, 20 | { 21 | "internalType": "uint32", 22 | "name": "_distributorFee", 23 | "type": "uint32" 24 | }, 25 | { 26 | "internalType": "address", 27 | "name": "_owner", 28 | "type": "address" 29 | } 30 | ], 31 | "stateMutability": "nonpayable", 32 | "type": "constructor" 33 | }, 34 | { 35 | "inputs": [ 36 | { 37 | "internalType": "uint256", 38 | "name": "accountsLength", 39 | "type": "uint256" 40 | }, 41 | { 42 | "internalType": "uint256", 43 | "name": "allocationsLength", 44 | "type": "uint256" 45 | } 46 | ], 47 | "name": "InvalidLiquidSplit__AccountsAndAllocationsMismatch", 48 | "type": "error" 49 | }, 50 | { 51 | "inputs": [ 52 | { 53 | "internalType": "uint32", 54 | "name": "allocationsSum", 55 | "type": "uint32" 56 | } 57 | ], 58 | "name": "InvalidLiquidSplit__InvalidAllocationsSum", 59 | "type": "error" 60 | }, 61 | { 62 | "anonymous": false, 63 | "inputs": [ 64 | { 65 | "indexed": true, 66 | "internalType": "address", 67 | "name": "owner", 68 | "type": "address" 69 | }, 70 | { 71 | "indexed": true, 72 | "internalType": "address", 73 | "name": "operator", 74 | "type": "address" 75 | }, 76 | { 77 | "indexed": false, 78 | "internalType": "bool", 79 | "name": "approved", 80 | "type": "bool" 81 | } 82 | ], 83 | "name": "ApprovalForAll", 84 | "type": "event" 85 | }, 86 | { 87 | "anonymous": false, 88 | "inputs": [ 89 | { 90 | "indexed": true, 91 | "internalType": "address", 92 | "name": "payoutSplit", 93 | "type": "address" 94 | } 95 | ], 96 | "name": "CreateLiquidSplit", 97 | "type": "event" 98 | }, 99 | { 100 | "anonymous": false, 101 | "inputs": [ 102 | { 103 | "indexed": true, 104 | "internalType": "address", 105 | "name": "user", 106 | "type": "address" 107 | }, 108 | { 109 | "indexed": true, 110 | "internalType": "address", 111 | "name": "newOwner", 112 | "type": "address" 113 | } 114 | ], 115 | "name": "OwnershipTransferred", 116 | "type": "event" 117 | }, 118 | { 119 | "anonymous": false, 120 | "inputs": [ 121 | { 122 | "indexed": false, 123 | "internalType": "uint256", 124 | "name": "amount", 125 | "type": "uint256" 126 | } 127 | ], 128 | "name": "ReceiveETH", 129 | "type": "event" 130 | }, 131 | { 132 | "anonymous": false, 133 | "inputs": [ 134 | { 135 | "indexed": true, 136 | "internalType": "address", 137 | "name": "operator", 138 | "type": "address" 139 | }, 140 | { 141 | "indexed": true, 142 | "internalType": "address", 143 | "name": "from", 144 | "type": "address" 145 | }, 146 | { 147 | "indexed": true, 148 | "internalType": "address", 149 | "name": "to", 150 | "type": "address" 151 | }, 152 | { 153 | "indexed": false, 154 | "internalType": "uint256[]", 155 | "name": "ids", 156 | "type": "uint256[]" 157 | }, 158 | { 159 | "indexed": false, 160 | "internalType": "uint256[]", 161 | "name": "amounts", 162 | "type": "uint256[]" 163 | } 164 | ], 165 | "name": "TransferBatch", 166 | "type": "event" 167 | }, 168 | { 169 | "anonymous": false, 170 | "inputs": [ 171 | { 172 | "indexed": true, 173 | "internalType": "address", 174 | "name": "operator", 175 | "type": "address" 176 | }, 177 | { 178 | "indexed": true, 179 | "internalType": "address", 180 | "name": "from", 181 | "type": "address" 182 | }, 183 | { 184 | "indexed": true, 185 | "internalType": "address", 186 | "name": "to", 187 | "type": "address" 188 | }, 189 | { 190 | "indexed": false, 191 | "internalType": "uint256", 192 | "name": "id", 193 | "type": "uint256" 194 | }, 195 | { 196 | "indexed": false, 197 | "internalType": "uint256", 198 | "name": "amount", 199 | "type": "uint256" 200 | } 201 | ], 202 | "name": "TransferSingle", 203 | "type": "event" 204 | }, 205 | { 206 | "anonymous": false, 207 | "inputs": [ 208 | { 209 | "indexed": true, 210 | "internalType": "address", 211 | "name": "from", 212 | "type": "address" 213 | }, 214 | { 215 | "indexed": true, 216 | "internalType": "address", 217 | "name": "to", 218 | "type": "address" 219 | }, 220 | { 221 | "indexed": true, 222 | "internalType": "uint256", 223 | "name": "id", 224 | "type": "uint256" 225 | } 226 | ], 227 | "name": "Transfer", 228 | "type": "event" 229 | }, 230 | { 231 | "anonymous": false, 232 | "inputs": [ 233 | { 234 | "indexed": false, 235 | "internalType": "string", 236 | "name": "value", 237 | "type": "string" 238 | }, 239 | { 240 | "indexed": true, 241 | "internalType": "uint256", 242 | "name": "id", 243 | "type": "uint256" 244 | } 245 | ], 246 | "name": "URI", 247 | "type": "event" 248 | }, 249 | { 250 | "inputs": [], 251 | "name": "PERCENTAGE_SCALE", 252 | "outputs": [ 253 | { 254 | "internalType": "uint256", 255 | "name": "", 256 | "type": "uint256" 257 | } 258 | ], 259 | "stateMutability": "view", 260 | "type": "function" 261 | }, 262 | { 263 | "inputs": [], 264 | "name": "SUPPLY_TO_PERCENTAGE", 265 | "outputs": [ 266 | { 267 | "internalType": "uint256", 268 | "name": "", 269 | "type": "uint256" 270 | } 271 | ], 272 | "stateMutability": "view", 273 | "type": "function" 274 | }, 275 | { 276 | "inputs": [], 277 | "name": "TOTAL_SUPPLY", 278 | "outputs": [ 279 | { 280 | "internalType": "uint256", 281 | "name": "", 282 | "type": "uint256" 283 | } 284 | ], 285 | "stateMutability": "view", 286 | "type": "function" 287 | }, 288 | { 289 | "inputs": [], 290 | "name": "_distributorFee", 291 | "outputs": [ 292 | { 293 | "internalType": "uint32", 294 | "name": "", 295 | "type": "uint32" 296 | } 297 | ], 298 | "stateMutability": "view", 299 | "type": "function" 300 | }, 301 | { 302 | "inputs": [ 303 | { 304 | "internalType": "address", 305 | "name": "", 306 | "type": "address" 307 | }, 308 | { 309 | "internalType": "uint256", 310 | "name": "", 311 | "type": "uint256" 312 | } 313 | ], 314 | "name": "balanceOf", 315 | "outputs": [ 316 | { 317 | "internalType": "uint256", 318 | "name": "", 319 | "type": "uint256" 320 | } 321 | ], 322 | "stateMutability": "view", 323 | "type": "function" 324 | }, 325 | { 326 | "inputs": [ 327 | { 328 | "internalType": "address[]", 329 | "name": "owners", 330 | "type": "address[]" 331 | }, 332 | { 333 | "internalType": "uint256[]", 334 | "name": "ids", 335 | "type": "uint256[]" 336 | } 337 | ], 338 | "name": "balanceOfBatch", 339 | "outputs": [ 340 | { 341 | "internalType": "uint256[]", 342 | "name": "balances", 343 | "type": "uint256[]" 344 | } 345 | ], 346 | "stateMutability": "view", 347 | "type": "function" 348 | }, 349 | { 350 | "inputs": [ 351 | { 352 | "internalType": "address", 353 | "name": "token", 354 | "type": "address" 355 | }, 356 | { 357 | "internalType": "address[]", 358 | "name": "accounts", 359 | "type": "address[]" 360 | }, 361 | { 362 | "internalType": "address", 363 | "name": "distributorAddress", 364 | "type": "address" 365 | } 366 | ], 367 | "name": "distributeFunds", 368 | "outputs": [], 369 | "stateMutability": "nonpayable", 370 | "type": "function" 371 | }, 372 | { 373 | "inputs": [], 374 | "name": "distributorFee", 375 | "outputs": [ 376 | { 377 | "internalType": "uint32", 378 | "name": "", 379 | "type": "uint32" 380 | } 381 | ], 382 | "stateMutability": "view", 383 | "type": "function" 384 | }, 385 | { 386 | "inputs": [ 387 | { 388 | "internalType": "address", 389 | "name": "", 390 | "type": "address" 391 | }, 392 | { 393 | "internalType": "address", 394 | "name": "", 395 | "type": "address" 396 | } 397 | ], 398 | "name": "isApprovedForAll", 399 | "outputs": [ 400 | { 401 | "internalType": "bool", 402 | "name": "", 403 | "type": "bool" 404 | } 405 | ], 406 | "stateMutability": "view", 407 | "type": "function" 408 | }, 409 | { 410 | "inputs": [], 411 | "name": "mintedOnTimestamp", 412 | "outputs": [ 413 | { 414 | "internalType": "uint256", 415 | "name": "", 416 | "type": "uint256" 417 | } 418 | ], 419 | "stateMutability": "view", 420 | "type": "function" 421 | }, 422 | { 423 | "inputs": [], 424 | "name": "owner", 425 | "outputs": [ 426 | { 427 | "internalType": "address", 428 | "name": "", 429 | "type": "address" 430 | } 431 | ], 432 | "stateMutability": "view", 433 | "type": "function" 434 | }, 435 | { 436 | "inputs": [], 437 | "name": "payoutSplit", 438 | "outputs": [ 439 | { 440 | "internalType": "address", 441 | "name": "", 442 | "type": "address" 443 | } 444 | ], 445 | "stateMutability": "view", 446 | "type": "function" 447 | }, 448 | { 449 | "inputs": [ 450 | { 451 | "internalType": "address", 452 | "name": "from", 453 | "type": "address" 454 | }, 455 | { 456 | "internalType": "address", 457 | "name": "to", 458 | "type": "address" 459 | }, 460 | { 461 | "internalType": "uint256[]", 462 | "name": "ids", 463 | "type": "uint256[]" 464 | }, 465 | { 466 | "internalType": "uint256[]", 467 | "name": "amounts", 468 | "type": "uint256[]" 469 | }, 470 | { 471 | "internalType": "bytes", 472 | "name": "data", 473 | "type": "bytes" 474 | } 475 | ], 476 | "name": "safeBatchTransferFrom", 477 | "outputs": [], 478 | "stateMutability": "nonpayable", 479 | "type": "function" 480 | }, 481 | { 482 | "inputs": [ 483 | { 484 | "internalType": "address", 485 | "name": "from", 486 | "type": "address" 487 | }, 488 | { 489 | "internalType": "address", 490 | "name": "to", 491 | "type": "address" 492 | }, 493 | { 494 | "internalType": "uint256", 495 | "name": "id", 496 | "type": "uint256" 497 | }, 498 | { 499 | "internalType": "uint256", 500 | "name": "amount", 501 | "type": "uint256" 502 | }, 503 | { 504 | "internalType": "bytes", 505 | "name": "data", 506 | "type": "bytes" 507 | } 508 | ], 509 | "name": "safeTransferFrom", 510 | "outputs": [], 511 | "stateMutability": "nonpayable", 512 | "type": "function" 513 | }, 514 | { 515 | "inputs": [ 516 | { 517 | "internalType": "address", 518 | "name": "account", 519 | "type": "address" 520 | } 521 | ], 522 | "name": "scaledPercentBalanceOf", 523 | "outputs": [ 524 | { 525 | "internalType": "uint32", 526 | "name": "", 527 | "type": "uint32" 528 | } 529 | ], 530 | "stateMutability": "view", 531 | "type": "function" 532 | }, 533 | { 534 | "inputs": [ 535 | { 536 | "internalType": "address", 537 | "name": "operator", 538 | "type": "address" 539 | }, 540 | { 541 | "internalType": "bool", 542 | "name": "approved", 543 | "type": "bool" 544 | } 545 | ], 546 | "name": "setApprovalForAll", 547 | "outputs": [], 548 | "stateMutability": "nonpayable", 549 | "type": "function" 550 | }, 551 | { 552 | "inputs": [], 553 | "name": "splitMain", 554 | "outputs": [ 555 | { 556 | "internalType": "contract ISplitMain", 557 | "name": "", 558 | "type": "address" 559 | } 560 | ], 561 | "stateMutability": "view", 562 | "type": "function" 563 | }, 564 | { 565 | "inputs": [ 566 | { 567 | "internalType": "bytes4", 568 | "name": "interfaceId", 569 | "type": "bytes4" 570 | } 571 | ], 572 | "name": "supportsInterface", 573 | "outputs": [ 574 | { 575 | "internalType": "bool", 576 | "name": "", 577 | "type": "bool" 578 | } 579 | ], 580 | "stateMutability": "view", 581 | "type": "function" 582 | }, 583 | { 584 | "inputs": [ 585 | { 586 | "internalType": "address", 587 | "name": "newOwner", 588 | "type": "address" 589 | } 590 | ], 591 | "name": "transferOwnership", 592 | "outputs": [], 593 | "stateMutability": "nonpayable", 594 | "type": "function" 595 | }, 596 | { 597 | "inputs": [ 598 | { 599 | "internalType": "uint256", 600 | "name": "", 601 | "type": "uint256" 602 | } 603 | ], 604 | "name": "uri", 605 | "outputs": [ 606 | { 607 | "internalType": "string", 608 | "name": "", 609 | "type": "string" 610 | } 611 | ], 612 | "stateMutability": "view", 613 | "type": "function" 614 | }, 615 | { 616 | "stateMutability": "payable", 617 | "type": "receive" 618 | } 619 | ] 620 | } 621 | -------------------------------------------------------------------------------- /abis/LiquidSplitFactory.json: -------------------------------------------------------------------------------- 1 | { 2 | "abi": [ 3 | { 4 | "inputs": [ 5 | { 6 | "internalType": "address", 7 | "name": "_splitMain", 8 | "type": "address" 9 | } 10 | ], 11 | "stateMutability": "nonpayable", 12 | "type": "constructor" 13 | }, 14 | { 15 | "inputs": [ 16 | { 17 | "internalType": "uint32", 18 | "name": "distributorFee", 19 | "type": "uint32" 20 | } 21 | ], 22 | "name": "InvalidLiquidSplit__InvalidDistributorFee", 23 | "type": "error" 24 | }, 25 | { 26 | "anonymous": false, 27 | "inputs": [ 28 | { 29 | "indexed": true, 30 | "internalType": "contract LS1155", 31 | "name": "ls", 32 | "type": "address" 33 | } 34 | ], 35 | "name": "CreateLS1155", 36 | "type": "event" 37 | }, 38 | { 39 | "anonymous": false, 40 | "inputs": [ 41 | { 42 | "indexed": true, 43 | "internalType": "contract LS1155CloneImpl", 44 | "name": "ls", 45 | "type": "address" 46 | } 47 | ], 48 | "name": "CreateLS1155Clone", 49 | "type": "event" 50 | }, 51 | { 52 | "inputs": [], 53 | "name": "MAX_DISTRIBUTOR_FEE", 54 | "outputs": [ 55 | { 56 | "internalType": "uint256", 57 | "name": "", 58 | "type": "uint256" 59 | } 60 | ], 61 | "stateMutability": "view", 62 | "type": "function" 63 | }, 64 | { 65 | "inputs": [ 66 | { 67 | "internalType": "address[]", 68 | "name": "accounts", 69 | "type": "address[]" 70 | }, 71 | { 72 | "internalType": "uint32[]", 73 | "name": "initAllocations", 74 | "type": "uint32[]" 75 | }, 76 | { 77 | "internalType": "uint32", 78 | "name": "_distributorFee", 79 | "type": "uint32" 80 | }, 81 | { 82 | "internalType": "address", 83 | "name": "owner", 84 | "type": "address" 85 | } 86 | ], 87 | "name": "createLiquidSplit", 88 | "outputs": [ 89 | { 90 | "internalType": "contract LS1155", 91 | "name": "ls", 92 | "type": "address" 93 | } 94 | ], 95 | "stateMutability": "nonpayable", 96 | "type": "function" 97 | }, 98 | { 99 | "inputs": [ 100 | { 101 | "internalType": "address[]", 102 | "name": "accounts", 103 | "type": "address[]" 104 | }, 105 | { 106 | "internalType": "uint32[]", 107 | "name": "initAllocations", 108 | "type": "uint32[]" 109 | }, 110 | { 111 | "internalType": "uint32", 112 | "name": "_distributorFee", 113 | "type": "uint32" 114 | }, 115 | { 116 | "internalType": "address", 117 | "name": "owner", 118 | "type": "address" 119 | } 120 | ], 121 | "name": "createLiquidSplitClone", 122 | "outputs": [ 123 | { 124 | "internalType": "contract LS1155CloneImpl", 125 | "name": "ls", 126 | "type": "address" 127 | } 128 | ], 129 | "stateMutability": "nonpayable", 130 | "type": "function" 131 | }, 132 | { 133 | "inputs": [], 134 | "name": "ls1155CloneImpl", 135 | "outputs": [ 136 | { 137 | "internalType": "address", 138 | "name": "", 139 | "type": "address" 140 | } 141 | ], 142 | "stateMutability": "view", 143 | "type": "function" 144 | }, 145 | { 146 | "inputs": [], 147 | "name": "splitMain", 148 | "outputs": [ 149 | { 150 | "internalType": "address", 151 | "name": "", 152 | "type": "address" 153 | } 154 | ], 155 | "stateMutability": "view", 156 | "type": "function" 157 | } 158 | ] 159 | } 160 | -------------------------------------------------------------------------------- /abis/PassThroughWallet.json: -------------------------------------------------------------------------------- 1 | { 2 | "abi": [ 3 | { 4 | "inputs": [], 5 | "stateMutability": "nonpayable", 6 | "type": "constructor" 7 | }, 8 | { 9 | "inputs": [], 10 | "name": "Paused", 11 | "type": "error" 12 | }, 13 | { 14 | "inputs": [], 15 | "name": "Unauthorized", 16 | "type": "error" 17 | }, 18 | { 19 | "anonymous": false, 20 | "inputs": [ 21 | { 22 | "components": [ 23 | { 24 | "internalType": "address", 25 | "name": "to", 26 | "type": "address" 27 | }, 28 | { 29 | "internalType": "uint256", 30 | "name": "value", 31 | "type": "uint256" 32 | }, 33 | { 34 | "internalType": "bytes", 35 | "name": "data", 36 | "type": "bytes" 37 | } 38 | ], 39 | "indexed": false, 40 | "internalType": "struct WalletImpl.Call[]", 41 | "name": "calls", 42 | "type": "tuple[]" 43 | } 44 | ], 45 | "name": "ExecCalls", 46 | "type": "event" 47 | }, 48 | { 49 | "anonymous": false, 50 | "inputs": [ 51 | { 52 | "indexed": true, 53 | "internalType": "address", 54 | "name": "oldOwner", 55 | "type": "address" 56 | }, 57 | { 58 | "indexed": true, 59 | "internalType": "address", 60 | "name": "newOwner", 61 | "type": "address" 62 | } 63 | ], 64 | "name": "OwnershipTransferred", 65 | "type": "event" 66 | }, 67 | { 68 | "anonymous": false, 69 | "inputs": [ 70 | { 71 | "indexed": true, 72 | "internalType": "address", 73 | "name": "passThrough", 74 | "type": "address" 75 | }, 76 | { 77 | "indexed": false, 78 | "internalType": "address[]", 79 | "name": "tokens", 80 | "type": "address[]" 81 | }, 82 | { 83 | "indexed": false, 84 | "internalType": "uint256[]", 85 | "name": "amounts", 86 | "type": "uint256[]" 87 | } 88 | ], 89 | "name": "PassThrough", 90 | "type": "event" 91 | }, 92 | { 93 | "anonymous": false, 94 | "inputs": [ 95 | { 96 | "indexed": false, 97 | "internalType": "uint256", 98 | "name": "amount", 99 | "type": "uint256" 100 | } 101 | ], 102 | "name": "ReceiveETH", 103 | "type": "event" 104 | }, 105 | { 106 | "anonymous": false, 107 | "inputs": [ 108 | { 109 | "indexed": false, 110 | "internalType": "address", 111 | "name": "passThrough", 112 | "type": "address" 113 | } 114 | ], 115 | "name": "SetPassThrough", 116 | "type": "event" 117 | }, 118 | { 119 | "anonymous": false, 120 | "inputs": [ 121 | { 122 | "indexed": false, 123 | "internalType": "bool", 124 | "name": "paused", 125 | "type": "bool" 126 | } 127 | ], 128 | "name": "SetPaused", 129 | "type": "event" 130 | }, 131 | { 132 | "inputs": [ 133 | { 134 | "components": [ 135 | { 136 | "internalType": "address", 137 | "name": "to", 138 | "type": "address" 139 | }, 140 | { 141 | "internalType": "uint256", 142 | "name": "value", 143 | "type": "uint256" 144 | }, 145 | { 146 | "internalType": "bytes", 147 | "name": "data", 148 | "type": "bytes" 149 | } 150 | ], 151 | "internalType": "struct WalletImpl.Call[]", 152 | "name": "calls_", 153 | "type": "tuple[]" 154 | } 155 | ], 156 | "name": "execCalls", 157 | "outputs": [ 158 | { 159 | "internalType": "uint256", 160 | "name": "blockNumber", 161 | "type": "uint256" 162 | }, 163 | { 164 | "internalType": "bytes[]", 165 | "name": "returnData", 166 | "type": "bytes[]" 167 | } 168 | ], 169 | "stateMutability": "payable", 170 | "type": "function" 171 | }, 172 | { 173 | "inputs": [ 174 | { 175 | "components": [ 176 | { 177 | "internalType": "address", 178 | "name": "owner", 179 | "type": "address" 180 | }, 181 | { 182 | "internalType": "bool", 183 | "name": "paused", 184 | "type": "bool" 185 | }, 186 | { 187 | "internalType": "address", 188 | "name": "passThrough", 189 | "type": "address" 190 | } 191 | ], 192 | "internalType": "struct PassThroughWalletImpl.InitParams", 193 | "name": "params_", 194 | "type": "tuple" 195 | } 196 | ], 197 | "name": "initializer", 198 | "outputs": [], 199 | "stateMutability": "nonpayable", 200 | "type": "function" 201 | }, 202 | { 203 | "inputs": [ 204 | { 205 | "internalType": "address", 206 | "name": "", 207 | "type": "address" 208 | }, 209 | { 210 | "internalType": "address", 211 | "name": "", 212 | "type": "address" 213 | }, 214 | { 215 | "internalType": "uint256[]", 216 | "name": "", 217 | "type": "uint256[]" 218 | }, 219 | { 220 | "internalType": "uint256[]", 221 | "name": "", 222 | "type": "uint256[]" 223 | }, 224 | { 225 | "internalType": "bytes", 226 | "name": "", 227 | "type": "bytes" 228 | } 229 | ], 230 | "name": "onERC1155BatchReceived", 231 | "outputs": [ 232 | { 233 | "internalType": "bytes4", 234 | "name": "", 235 | "type": "bytes4" 236 | } 237 | ], 238 | "stateMutability": "nonpayable", 239 | "type": "function" 240 | }, 241 | { 242 | "inputs": [ 243 | { 244 | "internalType": "address", 245 | "name": "", 246 | "type": "address" 247 | }, 248 | { 249 | "internalType": "address", 250 | "name": "", 251 | "type": "address" 252 | }, 253 | { 254 | "internalType": "uint256", 255 | "name": "", 256 | "type": "uint256" 257 | }, 258 | { 259 | "internalType": "uint256", 260 | "name": "", 261 | "type": "uint256" 262 | }, 263 | { 264 | "internalType": "bytes", 265 | "name": "", 266 | "type": "bytes" 267 | } 268 | ], 269 | "name": "onERC1155Received", 270 | "outputs": [ 271 | { 272 | "internalType": "bytes4", 273 | "name": "", 274 | "type": "bytes4" 275 | } 276 | ], 277 | "stateMutability": "nonpayable", 278 | "type": "function" 279 | }, 280 | { 281 | "inputs": [ 282 | { 283 | "internalType": "address", 284 | "name": "", 285 | "type": "address" 286 | }, 287 | { 288 | "internalType": "address", 289 | "name": "", 290 | "type": "address" 291 | }, 292 | { 293 | "internalType": "uint256", 294 | "name": "", 295 | "type": "uint256" 296 | }, 297 | { 298 | "internalType": "bytes", 299 | "name": "", 300 | "type": "bytes" 301 | } 302 | ], 303 | "name": "onERC721Received", 304 | "outputs": [ 305 | { 306 | "internalType": "bytes4", 307 | "name": "", 308 | "type": "bytes4" 309 | } 310 | ], 311 | "stateMutability": "nonpayable", 312 | "type": "function" 313 | }, 314 | { 315 | "inputs": [], 316 | "name": "owner", 317 | "outputs": [ 318 | { 319 | "internalType": "address", 320 | "name": "", 321 | "type": "address" 322 | } 323 | ], 324 | "stateMutability": "view", 325 | "type": "function" 326 | }, 327 | { 328 | "inputs": [], 329 | "name": "passThrough", 330 | "outputs": [ 331 | { 332 | "internalType": "address", 333 | "name": "", 334 | "type": "address" 335 | } 336 | ], 337 | "stateMutability": "view", 338 | "type": "function" 339 | }, 340 | { 341 | "inputs": [ 342 | { 343 | "internalType": "address[]", 344 | "name": "tokens_", 345 | "type": "address[]" 346 | } 347 | ], 348 | "name": "passThroughTokens", 349 | "outputs": [ 350 | { 351 | "internalType": "uint256[]", 352 | "name": "amounts", 353 | "type": "uint256[]" 354 | } 355 | ], 356 | "stateMutability": "nonpayable", 357 | "type": "function" 358 | }, 359 | { 360 | "inputs": [], 361 | "name": "passThroughWalletFactory", 362 | "outputs": [ 363 | { 364 | "internalType": "address", 365 | "name": "", 366 | "type": "address" 367 | } 368 | ], 369 | "stateMutability": "view", 370 | "type": "function" 371 | }, 372 | { 373 | "inputs": [], 374 | "name": "paused", 375 | "outputs": [ 376 | { 377 | "internalType": "bool", 378 | "name": "", 379 | "type": "bool" 380 | } 381 | ], 382 | "stateMutability": "view", 383 | "type": "function" 384 | }, 385 | { 386 | "inputs": [ 387 | { 388 | "internalType": "address", 389 | "name": "passThrough_", 390 | "type": "address" 391 | } 392 | ], 393 | "name": "setPassThrough", 394 | "outputs": [], 395 | "stateMutability": "nonpayable", 396 | "type": "function" 397 | }, 398 | { 399 | "inputs": [ 400 | { 401 | "internalType": "bool", 402 | "name": "paused_", 403 | "type": "bool" 404 | } 405 | ], 406 | "name": "setPaused", 407 | "outputs": [], 408 | "stateMutability": "nonpayable", 409 | "type": "function" 410 | }, 411 | { 412 | "inputs": [ 413 | { 414 | "internalType": "address", 415 | "name": "owner_", 416 | "type": "address" 417 | } 418 | ], 419 | "name": "transferOwnership", 420 | "outputs": [], 421 | "stateMutability": "nonpayable", 422 | "type": "function" 423 | } 424 | ] 425 | } 426 | -------------------------------------------------------------------------------- /abis/PassThroughWalletFactory.json: -------------------------------------------------------------------------------- 1 | { 2 | "abi": [ 3 | { 4 | "inputs": [], 5 | "stateMutability": "nonpayable", 6 | "type": "constructor" 7 | }, 8 | { 9 | "anonymous": false, 10 | "inputs": [ 11 | { 12 | "indexed": true, 13 | "internalType": "contract PassThroughWalletImpl", 14 | "name": "passThroughWallet", 15 | "type": "address" 16 | }, 17 | { 18 | "components": [ 19 | { 20 | "internalType": "address", 21 | "name": "owner", 22 | "type": "address" 23 | }, 24 | { 25 | "internalType": "bool", 26 | "name": "paused", 27 | "type": "bool" 28 | }, 29 | { 30 | "internalType": "address", 31 | "name": "passThrough", 32 | "type": "address" 33 | } 34 | ], 35 | "indexed": false, 36 | "internalType": "struct PassThroughWalletImpl.InitParams", 37 | "name": "params", 38 | "type": "tuple" 39 | } 40 | ], 41 | "name": "CreatePassThroughWallet", 42 | "type": "event" 43 | }, 44 | { 45 | "inputs": [ 46 | { 47 | "components": [ 48 | { 49 | "internalType": "address", 50 | "name": "owner", 51 | "type": "address" 52 | }, 53 | { 54 | "internalType": "bool", 55 | "name": "paused", 56 | "type": "bool" 57 | }, 58 | { 59 | "internalType": "address", 60 | "name": "passThrough", 61 | "type": "address" 62 | } 63 | ], 64 | "internalType": "struct PassThroughWalletImpl.InitParams", 65 | "name": "params_", 66 | "type": "tuple" 67 | } 68 | ], 69 | "name": "createPassThroughWallet", 70 | "outputs": [ 71 | { 72 | "internalType": "contract PassThroughWalletImpl", 73 | "name": "passThroughWallet", 74 | "type": "address" 75 | } 76 | ], 77 | "stateMutability": "nonpayable", 78 | "type": "function" 79 | }, 80 | { 81 | "inputs": [], 82 | "name": "passThroughWalletImpl", 83 | "outputs": [ 84 | { 85 | "internalType": "contract PassThroughWalletImpl", 86 | "name": "", 87 | "type": "address" 88 | } 89 | ], 90 | "stateMutability": "view", 91 | "type": "function" 92 | } 93 | ] 94 | } 95 | -------------------------------------------------------------------------------- /abis/Recoup.json: -------------------------------------------------------------------------------- 1 | { 2 | "abi": [ 3 | { 4 | "inputs": [ 5 | { 6 | "internalType": "address", 7 | "name": "_splitMain", 8 | "type": "address" 9 | }, 10 | { 11 | "internalType": "address", 12 | "name": "_waterfallModuleFactory", 13 | "type": "address" 14 | } 15 | ], 16 | "stateMutability": "nonpayable", 17 | "type": "constructor" 18 | }, 19 | { 20 | "inputs": [], 21 | "name": "InvalidRecoup__NonWaterfallRecipientSetTwice", 22 | "type": "error" 23 | }, 24 | { 25 | "inputs": [], 26 | "name": "InvalidRecoup__NonWaterfallRecipientTrancheIndexTooLarge", 27 | "type": "error" 28 | }, 29 | { 30 | "inputs": [ 31 | { 32 | "internalType": "uint256", 33 | "name": "index", 34 | "type": "uint256" 35 | }, 36 | { 37 | "internalType": "uint32", 38 | "name": "percentAllocation", 39 | "type": "uint32" 40 | } 41 | ], 42 | "name": "InvalidRecoup__SingleAddressPercentAllocation", 43 | "type": "error" 44 | }, 45 | { 46 | "inputs": [ 47 | { 48 | "internalType": "uint256", 49 | "name": "index", 50 | "type": "uint256" 51 | } 52 | ], 53 | "name": "InvalidRecoup__TooFewAccounts", 54 | "type": "error" 55 | }, 56 | { 57 | "inputs": [ 58 | { 59 | "internalType": "uint256", 60 | "name": "index", 61 | "type": "uint256" 62 | } 63 | ], 64 | "name": "InvalidRecoup__TrancheAccountsAndPercentAllocationsMismatch", 65 | "type": "error" 66 | }, 67 | { 68 | "anonymous": false, 69 | "inputs": [ 70 | { 71 | "indexed": false, 72 | "internalType": "address", 73 | "name": "waterfallModule", 74 | "type": "address" 75 | } 76 | ], 77 | "name": "CreateRecoup", 78 | "type": "event" 79 | }, 80 | { 81 | "inputs": [], 82 | "name": "PERCENTAGE_SCALE", 83 | "outputs": [ 84 | { 85 | "internalType": "uint256", 86 | "name": "", 87 | "type": "uint256" 88 | } 89 | ], 90 | "stateMutability": "view", 91 | "type": "function" 92 | }, 93 | { 94 | "inputs": [ 95 | { 96 | "internalType": "address", 97 | "name": "token", 98 | "type": "address" 99 | }, 100 | { 101 | "internalType": "address", 102 | "name": "nonWaterfallRecipientAddress", 103 | "type": "address" 104 | }, 105 | { 106 | "internalType": "uint256", 107 | "name": "nonWaterfallRecipientTrancheIndex", 108 | "type": "uint256" 109 | }, 110 | { 111 | "components": [ 112 | { 113 | "internalType": "address[]", 114 | "name": "recipients", 115 | "type": "address[]" 116 | }, 117 | { 118 | "internalType": "uint32[]", 119 | "name": "percentAllocations", 120 | "type": "uint32[]" 121 | }, 122 | { 123 | "internalType": "address", 124 | "name": "controller", 125 | "type": "address" 126 | }, 127 | { 128 | "internalType": "uint32", 129 | "name": "distributorFee", 130 | "type": "uint32" 131 | } 132 | ], 133 | "internalType": "struct Recoup.Tranche[]", 134 | "name": "tranches", 135 | "type": "tuple[]" 136 | }, 137 | { 138 | "internalType": "uint256[]", 139 | "name": "thresholds", 140 | "type": "uint256[]" 141 | } 142 | ], 143 | "name": "createRecoup", 144 | "outputs": [], 145 | "stateMutability": "nonpayable", 146 | "type": "function" 147 | }, 148 | { 149 | "inputs": [], 150 | "name": "splitMain", 151 | "outputs": [ 152 | { 153 | "internalType": "contract ISplitMain", 154 | "name": "", 155 | "type": "address" 156 | } 157 | ], 158 | "stateMutability": "view", 159 | "type": "function" 160 | }, 161 | { 162 | "inputs": [], 163 | "name": "waterfallModuleFactory", 164 | "outputs": [ 165 | { 166 | "internalType": "contract IWaterfallModuleFactory", 167 | "name": "", 168 | "type": "address" 169 | } 170 | ], 171 | "stateMutability": "view", 172 | "type": "function" 173 | } 174 | ] 175 | } -------------------------------------------------------------------------------- /abis/SplitWallet.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-artifact-1", 3 | "contractName": "SplitWallet", 4 | "sourceName": "contracts/SplitWallet.sol", 5 | "abi": [ 6 | { 7 | "inputs": [], 8 | "stateMutability": "nonpayable", 9 | "type": "constructor" 10 | }, 11 | { 12 | "inputs": [], 13 | "name": "Unauthorized", 14 | "type": "error" 15 | }, 16 | { 17 | "anonymous": false, 18 | "inputs": [ 19 | { 20 | "indexed": true, 21 | "internalType": "address", 22 | "name": "split", 23 | "type": "address" 24 | }, 25 | { 26 | "indexed": false, 27 | "internalType": "uint256", 28 | "name": "amount", 29 | "type": "uint256" 30 | } 31 | ], 32 | "name": "ReceiveETH", 33 | "type": "event" 34 | }, 35 | { 36 | "inputs": [ 37 | { 38 | "internalType": "contract ERC20", 39 | "name": "token", 40 | "type": "address" 41 | }, 42 | { 43 | "internalType": "uint256", 44 | "name": "amount", 45 | "type": "uint256" 46 | } 47 | ], 48 | "name": "sendERC20ToMain", 49 | "outputs": [], 50 | "stateMutability": "payable", 51 | "type": "function" 52 | }, 53 | { 54 | "inputs": [ 55 | { 56 | "internalType": "uint256", 57 | "name": "amount", 58 | "type": "uint256" 59 | } 60 | ], 61 | "name": "sendETHToMain", 62 | "outputs": [], 63 | "stateMutability": "payable", 64 | "type": "function" 65 | }, 66 | { 67 | "inputs": [], 68 | "name": "splitMain", 69 | "outputs": [ 70 | { 71 | "internalType": "contract ISplitMain", 72 | "name": "", 73 | "type": "address" 74 | } 75 | ], 76 | "stateMutability": "view", 77 | "type": "function" 78 | } 79 | ], 80 | "bytecode": "0x60a060405234801561001057600080fd5b5033606081901b60805261035461004c60003960008181604b0152818160bc015281816101080152818161013c015261018601526103546000f3fe6080604052600436106100345760003560e01c80630e769b2b146100395780637c1f3ffe14610089578063ab0ebff41461009e575b600080fd5b34801561004557600080fd5b5061006d7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b61009c6100973660046102d0565b6100b1565b005b61009c6100ac366004610306565b610131565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146100f9576040516282b42960e81b815260040160405180910390fd5b61012d6001600160a01b0383167f0000000000000000000000000000000000000000000000000000000000000000836101af565b5050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610179576040516282b42960e81b815260040160405180910390fd5b6101ac6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001682610233565b50565b600060405163a9059cbb60e01b81526001600160a01b03841660048201528260248201526000806044836000895af19150506101ea81610289565b61022d5760405162461bcd60e51b815260206004820152600f60248201526e1514905394d1915497d19052531151608a1b60448201526064015b60405180910390fd5b50505050565b600080600080600085875af19050806102845760405162461bcd60e51b815260206004820152601360248201527211551217d514905394d1915497d19052531151606a1b6044820152606401610224565b505050565b60003d8261029b57806000803e806000fd5b80602081146102b35780156102c457600092506102c9565b816000803e600051151592506102c9565b600192505b5050919050565b600080604083850312156102e2578182fd5b82356001600160a01b03811681146102f8578283fd5b946020939093013593505050565b600060208284031215610317578081fd5b503591905056fea2646970667358221220def78b294d6b6603231a559c8366ba0d4f86b7f8e62b7e36307ace99c6f117d064736f6c63430008040033", 81 | "deployedBytecode": "0x6080604052600436106100345760003560e01c80630e769b2b146100395780637c1f3ffe14610089578063ab0ebff41461009e575b600080fd5b34801561004557600080fd5b5061006d7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b61009c6100973660046102d0565b6100b1565b005b61009c6100ac366004610306565b610131565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146100f9576040516282b42960e81b815260040160405180910390fd5b61012d6001600160a01b0383167f0000000000000000000000000000000000000000000000000000000000000000836101af565b5050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610179576040516282b42960e81b815260040160405180910390fd5b6101ac6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001682610233565b50565b600060405163a9059cbb60e01b81526001600160a01b03841660048201528260248201526000806044836000895af19150506101ea81610289565b61022d5760405162461bcd60e51b815260206004820152600f60248201526e1514905394d1915497d19052531151608a1b60448201526064015b60405180910390fd5b50505050565b600080600080600085875af19050806102845760405162461bcd60e51b815260206004820152601360248201527211551217d514905394d1915497d19052531151606a1b6044820152606401610224565b505050565b60003d8261029b57806000803e806000fd5b80602081146102b35780156102c457600092506102c9565b816000803e600051151592506102c9565b600192505b5050919050565b600080604083850312156102e2578182fd5b82356001600160a01b03811681146102f8578283fd5b946020939093013593505050565b600060208284031215610317578081fd5b503591905056fea2646970667358221220def78b294d6b6603231a559c8366ba0d4f86b7f8e62b7e36307ace99c6f117d064736f6c63430008040033", 82 | "linkReferences": {}, 83 | "deployedLinkReferences": {} 84 | } 85 | -------------------------------------------------------------------------------- /abis/SwapperFactory.json: -------------------------------------------------------------------------------- 1 | { 2 | "abi": [ 3 | { 4 | "inputs": [], 5 | "stateMutability": "nonpayable", 6 | "type": "constructor" 7 | }, 8 | { 9 | "anonymous": false, 10 | "inputs": [ 11 | { 12 | "indexed": true, 13 | "internalType": "contract SwapperImpl", 14 | "name": "swapper", 15 | "type": "address" 16 | }, 17 | { 18 | "components": [ 19 | { 20 | "internalType": "address", 21 | "name": "owner", 22 | "type": "address" 23 | }, 24 | { 25 | "internalType": "bool", 26 | "name": "paused", 27 | "type": "bool" 28 | }, 29 | { 30 | "internalType": "address", 31 | "name": "beneficiary", 32 | "type": "address" 33 | }, 34 | { 35 | "internalType": "address", 36 | "name": "tokenToBeneficiary", 37 | "type": "address" 38 | }, 39 | { 40 | "internalType": "contract IOracle", 41 | "name": "oracle", 42 | "type": "address" 43 | }, 44 | { 45 | "internalType": "uint32", 46 | "name": "defaultScaledOfferFactor", 47 | "type": "uint32" 48 | }, 49 | { 50 | "components": [ 51 | { 52 | "components": [ 53 | { 54 | "internalType": "address", 55 | "name": "base", 56 | "type": "address" 57 | }, 58 | { 59 | "internalType": "address", 60 | "name": "quote", 61 | "type": "address" 62 | } 63 | ], 64 | "internalType": "struct QuotePair", 65 | "name": "quotePair", 66 | "type": "tuple" 67 | }, 68 | { 69 | "internalType": "uint32", 70 | "name": "scaledOfferFactor", 71 | "type": "uint32" 72 | } 73 | ], 74 | "internalType": "struct SwapperImpl.SetPairScaledOfferFactorParams[]", 75 | "name": "pairScaledOfferFactors", 76 | "type": "tuple[]" 77 | } 78 | ], 79 | "indexed": false, 80 | "internalType": "struct SwapperImpl.InitParams", 81 | "name": "params", 82 | "type": "tuple" 83 | } 84 | ], 85 | "name": "CreateSwapper", 86 | "type": "event" 87 | }, 88 | { 89 | "inputs": [ 90 | { 91 | "components": [ 92 | { 93 | "internalType": "address", 94 | "name": "owner", 95 | "type": "address" 96 | }, 97 | { 98 | "internalType": "bool", 99 | "name": "paused", 100 | "type": "bool" 101 | }, 102 | { 103 | "internalType": "address", 104 | "name": "beneficiary", 105 | "type": "address" 106 | }, 107 | { 108 | "internalType": "address", 109 | "name": "tokenToBeneficiary", 110 | "type": "address" 111 | }, 112 | { 113 | "components": [ 114 | { 115 | "internalType": "contract IOracle", 116 | "name": "oracle", 117 | "type": "address" 118 | }, 119 | { 120 | "components": [ 121 | { 122 | "internalType": "contract IOracleFactory", 123 | "name": "factory", 124 | "type": "address" 125 | }, 126 | { 127 | "internalType": "bytes", 128 | "name": "data", 129 | "type": "bytes" 130 | } 131 | ], 132 | "internalType": "struct CreateOracleParams", 133 | "name": "createOracleParams", 134 | "type": "tuple" 135 | } 136 | ], 137 | "internalType": "struct OracleParams", 138 | "name": "oracleParams", 139 | "type": "tuple" 140 | }, 141 | { 142 | "internalType": "uint32", 143 | "name": "defaultScaledOfferFactor", 144 | "type": "uint32" 145 | }, 146 | { 147 | "components": [ 148 | { 149 | "components": [ 150 | { 151 | "internalType": "address", 152 | "name": "base", 153 | "type": "address" 154 | }, 155 | { 156 | "internalType": "address", 157 | "name": "quote", 158 | "type": "address" 159 | } 160 | ], 161 | "internalType": "struct QuotePair", 162 | "name": "quotePair", 163 | "type": "tuple" 164 | }, 165 | { 166 | "internalType": "uint32", 167 | "name": "scaledOfferFactor", 168 | "type": "uint32" 169 | } 170 | ], 171 | "internalType": "struct SwapperImpl.SetPairScaledOfferFactorParams[]", 172 | "name": "pairScaledOfferFactors", 173 | "type": "tuple[]" 174 | } 175 | ], 176 | "internalType": "struct SwapperFactory.CreateSwapperParams", 177 | "name": "params_", 178 | "type": "tuple" 179 | } 180 | ], 181 | "name": "createSwapper", 182 | "outputs": [ 183 | { 184 | "internalType": "contract SwapperImpl", 185 | "name": "swapper", 186 | "type": "address" 187 | } 188 | ], 189 | "stateMutability": "nonpayable", 190 | "type": "function" 191 | }, 192 | { 193 | "inputs": [], 194 | "name": "swapperImpl", 195 | "outputs": [ 196 | { 197 | "internalType": "contract SwapperImpl", 198 | "name": "", 199 | "type": "address" 200 | } 201 | ], 202 | "stateMutability": "view", 203 | "type": "function" 204 | } 205 | ] 206 | } 207 | -------------------------------------------------------------------------------- /abis/UniV3Oracle.json: -------------------------------------------------------------------------------- 1 | { 2 | "abi": [ 3 | { 4 | "inputs": [ 5 | { 6 | "internalType": "address", 7 | "name": "weth9_", 8 | "type": "address" 9 | } 10 | ], 11 | "stateMutability": "nonpayable", 12 | "type": "constructor" 13 | }, 14 | { 15 | "inputs": [], 16 | "name": "InvalidPair_PoolNotSet", 17 | "type": "error" 18 | }, 19 | { 20 | "inputs": [], 21 | "name": "Paused", 22 | "type": "error" 23 | }, 24 | { 25 | "inputs": [], 26 | "name": "T", 27 | "type": "error" 28 | }, 29 | { 30 | "inputs": [], 31 | "name": "Unauthorized", 32 | "type": "error" 33 | }, 34 | { 35 | "anonymous": false, 36 | "inputs": [ 37 | { 38 | "indexed": true, 39 | "internalType": "address", 40 | "name": "oldOwner", 41 | "type": "address" 42 | }, 43 | { 44 | "indexed": true, 45 | "internalType": "address", 46 | "name": "newOwner", 47 | "type": "address" 48 | } 49 | ], 50 | "name": "OwnershipTransferred", 51 | "type": "event" 52 | }, 53 | { 54 | "anonymous": false, 55 | "inputs": [ 56 | { 57 | "indexed": false, 58 | "internalType": "uint32", 59 | "name": "defaultPeriod", 60 | "type": "uint32" 61 | } 62 | ], 63 | "name": "SetDefaultPeriod", 64 | "type": "event" 65 | }, 66 | { 67 | "anonymous": false, 68 | "inputs": [ 69 | { 70 | "components": [ 71 | { 72 | "components": [ 73 | { 74 | "internalType": "address", 75 | "name": "base", 76 | "type": "address" 77 | }, 78 | { 79 | "internalType": "address", 80 | "name": "quote", 81 | "type": "address" 82 | } 83 | ], 84 | "internalType": "struct QuotePair", 85 | "name": "quotePair", 86 | "type": "tuple" 87 | }, 88 | { 89 | "components": [ 90 | { 91 | "internalType": "address", 92 | "name": "pool", 93 | "type": "address" 94 | }, 95 | { 96 | "internalType": "uint32", 97 | "name": "period", 98 | "type": "uint32" 99 | } 100 | ], 101 | "internalType": "struct UniV3OracleImpl.PairDetail", 102 | "name": "pairDetail", 103 | "type": "tuple" 104 | } 105 | ], 106 | "indexed": false, 107 | "internalType": "struct UniV3OracleImpl.SetPairDetailParams[]", 108 | "name": "params", 109 | "type": "tuple[]" 110 | } 111 | ], 112 | "name": "SetPairDetails", 113 | "type": "event" 114 | }, 115 | { 116 | "anonymous": false, 117 | "inputs": [ 118 | { 119 | "indexed": false, 120 | "internalType": "bool", 121 | "name": "paused", 122 | "type": "bool" 123 | } 124 | ], 125 | "name": "SetPaused", 126 | "type": "event" 127 | }, 128 | { 129 | "inputs": [], 130 | "name": "defaultPeriod", 131 | "outputs": [ 132 | { 133 | "internalType": "uint32", 134 | "name": "", 135 | "type": "uint32" 136 | } 137 | ], 138 | "stateMutability": "view", 139 | "type": "function" 140 | }, 141 | { 142 | "inputs": [ 143 | { 144 | "components": [ 145 | { 146 | "internalType": "address", 147 | "name": "base", 148 | "type": "address" 149 | }, 150 | { 151 | "internalType": "address", 152 | "name": "quote", 153 | "type": "address" 154 | } 155 | ], 156 | "internalType": "struct QuotePair[]", 157 | "name": "quotePairs_", 158 | "type": "tuple[]" 159 | } 160 | ], 161 | "name": "getPairDetails", 162 | "outputs": [ 163 | { 164 | "components": [ 165 | { 166 | "internalType": "address", 167 | "name": "pool", 168 | "type": "address" 169 | }, 170 | { 171 | "internalType": "uint32", 172 | "name": "period", 173 | "type": "uint32" 174 | } 175 | ], 176 | "internalType": "struct UniV3OracleImpl.PairDetail[]", 177 | "name": "pairDetails", 178 | "type": "tuple[]" 179 | } 180 | ], 181 | "stateMutability": "view", 182 | "type": "function" 183 | }, 184 | { 185 | "inputs": [ 186 | { 187 | "components": [ 188 | { 189 | "components": [ 190 | { 191 | "internalType": "address", 192 | "name": "base", 193 | "type": "address" 194 | }, 195 | { 196 | "internalType": "address", 197 | "name": "quote", 198 | "type": "address" 199 | } 200 | ], 201 | "internalType": "struct QuotePair", 202 | "name": "quotePair", 203 | "type": "tuple" 204 | }, 205 | { 206 | "internalType": "uint128", 207 | "name": "baseAmount", 208 | "type": "uint128" 209 | }, 210 | { 211 | "internalType": "bytes", 212 | "name": "data", 213 | "type": "bytes" 214 | } 215 | ], 216 | "internalType": "struct QuoteParams[]", 217 | "name": "quoteParams_", 218 | "type": "tuple[]" 219 | } 220 | ], 221 | "name": "getQuoteAmounts", 222 | "outputs": [ 223 | { 224 | "internalType": "uint256[]", 225 | "name": "quoteAmounts", 226 | "type": "uint256[]" 227 | } 228 | ], 229 | "stateMutability": "view", 230 | "type": "function" 231 | }, 232 | { 233 | "inputs": [ 234 | { 235 | "components": [ 236 | { 237 | "internalType": "address", 238 | "name": "owner", 239 | "type": "address" 240 | }, 241 | { 242 | "internalType": "bool", 243 | "name": "paused", 244 | "type": "bool" 245 | }, 246 | { 247 | "internalType": "uint32", 248 | "name": "defaultPeriod", 249 | "type": "uint32" 250 | }, 251 | { 252 | "components": [ 253 | { 254 | "components": [ 255 | { 256 | "internalType": "address", 257 | "name": "base", 258 | "type": "address" 259 | }, 260 | { 261 | "internalType": "address", 262 | "name": "quote", 263 | "type": "address" 264 | } 265 | ], 266 | "internalType": "struct QuotePair", 267 | "name": "quotePair", 268 | "type": "tuple" 269 | }, 270 | { 271 | "components": [ 272 | { 273 | "internalType": "address", 274 | "name": "pool", 275 | "type": "address" 276 | }, 277 | { 278 | "internalType": "uint32", 279 | "name": "period", 280 | "type": "uint32" 281 | } 282 | ], 283 | "internalType": "struct UniV3OracleImpl.PairDetail", 284 | "name": "pairDetail", 285 | "type": "tuple" 286 | } 287 | ], 288 | "internalType": "struct UniV3OracleImpl.SetPairDetailParams[]", 289 | "name": "pairDetails", 290 | "type": "tuple[]" 291 | } 292 | ], 293 | "internalType": "struct UniV3OracleImpl.InitParams", 294 | "name": "params_", 295 | "type": "tuple" 296 | } 297 | ], 298 | "name": "initializer", 299 | "outputs": [], 300 | "stateMutability": "nonpayable", 301 | "type": "function" 302 | }, 303 | { 304 | "inputs": [], 305 | "name": "owner", 306 | "outputs": [ 307 | { 308 | "internalType": "address", 309 | "name": "", 310 | "type": "address" 311 | } 312 | ], 313 | "stateMutability": "view", 314 | "type": "function" 315 | }, 316 | { 317 | "inputs": [], 318 | "name": "paused", 319 | "outputs": [ 320 | { 321 | "internalType": "bool", 322 | "name": "", 323 | "type": "bool" 324 | } 325 | ], 326 | "stateMutability": "view", 327 | "type": "function" 328 | }, 329 | { 330 | "inputs": [ 331 | { 332 | "internalType": "uint32", 333 | "name": "defaultPeriod_", 334 | "type": "uint32" 335 | } 336 | ], 337 | "name": "setDefaultPeriod", 338 | "outputs": [], 339 | "stateMutability": "nonpayable", 340 | "type": "function" 341 | }, 342 | { 343 | "inputs": [ 344 | { 345 | "components": [ 346 | { 347 | "components": [ 348 | { 349 | "internalType": "address", 350 | "name": "base", 351 | "type": "address" 352 | }, 353 | { 354 | "internalType": "address", 355 | "name": "quote", 356 | "type": "address" 357 | } 358 | ], 359 | "internalType": "struct QuotePair", 360 | "name": "quotePair", 361 | "type": "tuple" 362 | }, 363 | { 364 | "components": [ 365 | { 366 | "internalType": "address", 367 | "name": "pool", 368 | "type": "address" 369 | }, 370 | { 371 | "internalType": "uint32", 372 | "name": "period", 373 | "type": "uint32" 374 | } 375 | ], 376 | "internalType": "struct UniV3OracleImpl.PairDetail", 377 | "name": "pairDetail", 378 | "type": "tuple" 379 | } 380 | ], 381 | "internalType": "struct UniV3OracleImpl.SetPairDetailParams[]", 382 | "name": "params_", 383 | "type": "tuple[]" 384 | } 385 | ], 386 | "name": "setPairDetails", 387 | "outputs": [], 388 | "stateMutability": "nonpayable", 389 | "type": "function" 390 | }, 391 | { 392 | "inputs": [ 393 | { 394 | "internalType": "bool", 395 | "name": "paused_", 396 | "type": "bool" 397 | } 398 | ], 399 | "name": "setPaused", 400 | "outputs": [], 401 | "stateMutability": "nonpayable", 402 | "type": "function" 403 | }, 404 | { 405 | "inputs": [ 406 | { 407 | "internalType": "address", 408 | "name": "owner_", 409 | "type": "address" 410 | } 411 | ], 412 | "name": "transferOwnership", 413 | "outputs": [], 414 | "stateMutability": "nonpayable", 415 | "type": "function" 416 | }, 417 | { 418 | "inputs": [], 419 | "name": "uniV3OracleFactory", 420 | "outputs": [ 421 | { 422 | "internalType": "address", 423 | "name": "", 424 | "type": "address" 425 | } 426 | ], 427 | "stateMutability": "view", 428 | "type": "function" 429 | }, 430 | { 431 | "inputs": [], 432 | "name": "weth9", 433 | "outputs": [ 434 | { 435 | "internalType": "address", 436 | "name": "", 437 | "type": "address" 438 | } 439 | ], 440 | "stateMutability": "view", 441 | "type": "function" 442 | } 443 | ] 444 | } 445 | -------------------------------------------------------------------------------- /abis/UniV3OracleFactory.json: -------------------------------------------------------------------------------- 1 | { 2 | "abi": [ 3 | { 4 | "inputs": [ 5 | { 6 | "internalType": "address", 7 | "name": "weth9_", 8 | "type": "address" 9 | } 10 | ], 11 | "stateMutability": "nonpayable", 12 | "type": "constructor" 13 | }, 14 | { 15 | "anonymous": false, 16 | "inputs": [ 17 | { 18 | "indexed": true, 19 | "internalType": "contract UniV3OracleImpl", 20 | "name": "oracle", 21 | "type": "address" 22 | }, 23 | { 24 | "components": [ 25 | { 26 | "internalType": "address", 27 | "name": "owner", 28 | "type": "address" 29 | }, 30 | { 31 | "internalType": "bool", 32 | "name": "paused", 33 | "type": "bool" 34 | }, 35 | { 36 | "internalType": "uint32", 37 | "name": "defaultPeriod", 38 | "type": "uint32" 39 | }, 40 | { 41 | "components": [ 42 | { 43 | "components": [ 44 | { 45 | "internalType": "address", 46 | "name": "base", 47 | "type": "address" 48 | }, 49 | { 50 | "internalType": "address", 51 | "name": "quote", 52 | "type": "address" 53 | } 54 | ], 55 | "internalType": "struct QuotePair", 56 | "name": "quotePair", 57 | "type": "tuple" 58 | }, 59 | { 60 | "components": [ 61 | { 62 | "internalType": "address", 63 | "name": "pool", 64 | "type": "address" 65 | }, 66 | { 67 | "internalType": "uint32", 68 | "name": "period", 69 | "type": "uint32" 70 | } 71 | ], 72 | "internalType": "struct UniV3OracleImpl.PairDetail", 73 | "name": "pairDetail", 74 | "type": "tuple" 75 | } 76 | ], 77 | "internalType": "struct UniV3OracleImpl.SetPairDetailParams[]", 78 | "name": "pairDetails", 79 | "type": "tuple[]" 80 | } 81 | ], 82 | "indexed": false, 83 | "internalType": "struct UniV3OracleImpl.InitParams", 84 | "name": "params", 85 | "type": "tuple" 86 | } 87 | ], 88 | "name": "CreateUniV3Oracle", 89 | "type": "event" 90 | }, 91 | { 92 | "inputs": [ 93 | { 94 | "internalType": "bytes", 95 | "name": "data_", 96 | "type": "bytes" 97 | } 98 | ], 99 | "name": "createOracle", 100 | "outputs": [ 101 | { 102 | "internalType": "contract IOracle", 103 | "name": "", 104 | "type": "address" 105 | } 106 | ], 107 | "stateMutability": "nonpayable", 108 | "type": "function" 109 | }, 110 | { 111 | "inputs": [ 112 | { 113 | "components": [ 114 | { 115 | "internalType": "address", 116 | "name": "owner", 117 | "type": "address" 118 | }, 119 | { 120 | "internalType": "bool", 121 | "name": "paused", 122 | "type": "bool" 123 | }, 124 | { 125 | "internalType": "uint32", 126 | "name": "defaultPeriod", 127 | "type": "uint32" 128 | }, 129 | { 130 | "components": [ 131 | { 132 | "components": [ 133 | { 134 | "internalType": "address", 135 | "name": "base", 136 | "type": "address" 137 | }, 138 | { 139 | "internalType": "address", 140 | "name": "quote", 141 | "type": "address" 142 | } 143 | ], 144 | "internalType": "struct QuotePair", 145 | "name": "quotePair", 146 | "type": "tuple" 147 | }, 148 | { 149 | "components": [ 150 | { 151 | "internalType": "address", 152 | "name": "pool", 153 | "type": "address" 154 | }, 155 | { 156 | "internalType": "uint32", 157 | "name": "period", 158 | "type": "uint32" 159 | } 160 | ], 161 | "internalType": "struct UniV3OracleImpl.PairDetail", 162 | "name": "pairDetail", 163 | "type": "tuple" 164 | } 165 | ], 166 | "internalType": "struct UniV3OracleImpl.SetPairDetailParams[]", 167 | "name": "pairDetails", 168 | "type": "tuple[]" 169 | } 170 | ], 171 | "internalType": "struct UniV3OracleImpl.InitParams", 172 | "name": "params_", 173 | "type": "tuple" 174 | } 175 | ], 176 | "name": "createUniV3Oracle", 177 | "outputs": [ 178 | { 179 | "internalType": "contract UniV3OracleImpl", 180 | "name": "", 181 | "type": "address" 182 | } 183 | ], 184 | "stateMutability": "nonpayable", 185 | "type": "function" 186 | }, 187 | { 188 | "inputs": [], 189 | "name": "uniV3OracleImpl", 190 | "outputs": [ 191 | { 192 | "internalType": "contract UniV3OracleImpl", 193 | "name": "", 194 | "type": "address" 195 | } 196 | ], 197 | "stateMutability": "view", 198 | "type": "function" 199 | } 200 | ] 201 | } 202 | -------------------------------------------------------------------------------- /abis/UniV3Pool.json: -------------------------------------------------------------------------------- 1 | { 2 | "abi": [{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"int24","name":"tickLower","type":"int24"},{"indexed":true,"internalType":"int24","name":"tickUpper","type":"int24"},{"indexed":false,"internalType":"uint128","name":"amount","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":true,"internalType":"int24","name":"tickLower","type":"int24"},{"indexed":true,"internalType":"int24","name":"tickUpper","type":"int24"},{"indexed":false,"internalType":"uint128","name":"amount0","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"amount1","type":"uint128"}],"name":"Collect","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint128","name":"amount0","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"amount1","type":"uint128"}],"name":"CollectProtocol","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"paid0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"paid1","type":"uint256"}],"name":"Flash","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"observationCardinalityNextOld","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"observationCardinalityNextNew","type":"uint16"}],"name":"IncreaseObservationCardinalityNext","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"},{"indexed":false,"internalType":"int24","name":"tick","type":"int24"}],"name":"Initialize","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"int24","name":"tickLower","type":"int24"},{"indexed":true,"internalType":"int24","name":"tickUpper","type":"int24"},{"indexed":false,"internalType":"uint128","name":"amount","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"feeProtocol0Old","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"feeProtocol1Old","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"feeProtocol0New","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"feeProtocol1New","type":"uint8"}],"name":"SetFeeProtocol","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"int256","name":"amount0","type":"int256"},{"indexed":false,"internalType":"int256","name":"amount1","type":"int256"},{"indexed":false,"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"},{"indexed":false,"internalType":"uint128","name":"liquidity","type":"uint128"},{"indexed":false,"internalType":"int24","name":"tick","type":"int24"}],"name":"Swap","type":"event"},{"inputs":[{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint128","name":"amount","type":"uint128"}],"name":"burn","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint128","name":"amount0Requested","type":"uint128"},{"internalType":"uint128","name":"amount1Requested","type":"uint128"}],"name":"collect","outputs":[{"internalType":"uint128","name":"amount0","type":"uint128"},{"internalType":"uint128","name":"amount1","type":"uint128"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint128","name":"amount0Requested","type":"uint128"},{"internalType":"uint128","name":"amount1Requested","type":"uint128"}],"name":"collectProtocol","outputs":[{"internalType":"uint128","name":"amount0","type":"uint128"},{"internalType":"uint128","name":"amount1","type":"uint128"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fee","outputs":[{"internalType":"uint24","name":"","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeGrowthGlobal0X128","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeGrowthGlobal1X128","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"flash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"observationCardinalityNext","type":"uint16"}],"name":"increaseObservationCardinalityNext","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"liquidity","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxLiquidityPerTick","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint128","name":"amount","type":"uint128"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mint","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"observations","outputs":[{"internalType":"uint32","name":"blockTimestamp","type":"uint32"},{"internalType":"int56","name":"tickCumulative","type":"int56"},{"internalType":"uint160","name":"secondsPerLiquidityCumulativeX128","type":"uint160"},{"internalType":"bool","name":"initialized","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"secondsAgos","type":"uint32[]"}],"name":"observe","outputs":[{"internalType":"int56[]","name":"tickCumulatives","type":"int56[]"},{"internalType":"uint160[]","name":"secondsPerLiquidityCumulativeX128s","type":"uint160[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"positions","outputs":[{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"uint256","name":"feeGrowthInside0LastX128","type":"uint256"},{"internalType":"uint256","name":"feeGrowthInside1LastX128","type":"uint256"},{"internalType":"uint128","name":"tokensOwed0","type":"uint128"},{"internalType":"uint128","name":"tokensOwed1","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFees","outputs":[{"internalType":"uint128","name":"token0","type":"uint128"},{"internalType":"uint128","name":"token1","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"feeProtocol0","type":"uint8"},{"internalType":"uint8","name":"feeProtocol1","type":"uint8"}],"name":"setFeeProtocol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"slot0","outputs":[{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"},{"internalType":"int24","name":"tick","type":"int24"},{"internalType":"uint16","name":"observationIndex","type":"uint16"},{"internalType":"uint16","name":"observationCardinality","type":"uint16"},{"internalType":"uint16","name":"observationCardinalityNext","type":"uint16"},{"internalType":"uint8","name":"feeProtocol","type":"uint8"},{"internalType":"bool","name":"unlocked","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"}],"name":"snapshotCumulativesInside","outputs":[{"internalType":"int56","name":"tickCumulativeInside","type":"int56"},{"internalType":"uint160","name":"secondsPerLiquidityInsideX128","type":"uint160"},{"internalType":"uint32","name":"secondsInside","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"bool","name":"zeroForOne","type":"bool"},{"internalType":"int256","name":"amountSpecified","type":"int256"},{"internalType":"uint160","name":"sqrtPriceLimitX96","type":"uint160"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"swap","outputs":[{"internalType":"int256","name":"amount0","type":"int256"},{"internalType":"int256","name":"amount1","type":"int256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int16","name":"","type":"int16"}],"name":"tickBitmap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tickSpacing","outputs":[{"internalType":"int24","name":"","type":"int24"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int24","name":"","type":"int24"}],"name":"ticks","outputs":[{"internalType":"uint128","name":"liquidityGross","type":"uint128"},{"internalType":"int128","name":"liquidityNet","type":"int128"},{"internalType":"uint256","name":"feeGrowthOutside0X128","type":"uint256"},{"internalType":"uint256","name":"feeGrowthOutside1X128","type":"uint256"},{"internalType":"int56","name":"tickCumulativeOutside","type":"int56"},{"internalType":"uint160","name":"secondsPerLiquidityOutsideX128","type":"uint160"},{"internalType":"uint32","name":"secondsOutside","type":"uint32"},{"internalType":"bool","name":"initialized","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token0","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token1","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}] 3 | } -------------------------------------------------------------------------------- /abis/polygon.SplitMain.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, 3 | { "inputs": [], "name": "Create2Error", "type": "error" }, 4 | { "inputs": [], "name": "CreateError", "type": "error" }, 5 | { 6 | "inputs": [ 7 | { "internalType": "address", "name": "newController", "type": "address" } 8 | ], 9 | "name": "InvalidNewController", 10 | "type": "error" 11 | }, 12 | { 13 | "inputs": [ 14 | { 15 | "internalType": "uint256", 16 | "name": "accountsLength", 17 | "type": "uint256" 18 | }, 19 | { 20 | "internalType": "uint256", 21 | "name": "allocationsLength", 22 | "type": "uint256" 23 | } 24 | ], 25 | "name": "InvalidSplit__AccountsAndAllocationsMismatch", 26 | "type": "error" 27 | }, 28 | { 29 | "inputs": [ 30 | { "internalType": "uint256", "name": "index", "type": "uint256" } 31 | ], 32 | "name": "InvalidSplit__AccountsOutOfOrder", 33 | "type": "error" 34 | }, 35 | { 36 | "inputs": [ 37 | { "internalType": "uint256", "name": "index", "type": "uint256" } 38 | ], 39 | "name": "InvalidSplit__AllocationMustBePositive", 40 | "type": "error" 41 | }, 42 | { 43 | "inputs": [ 44 | { "internalType": "uint32", "name": "allocationsSum", "type": "uint32" } 45 | ], 46 | "name": "InvalidSplit__InvalidAllocationsSum", 47 | "type": "error" 48 | }, 49 | { 50 | "inputs": [ 51 | { "internalType": "uint32", "name": "distributorFee", "type": "uint32" } 52 | ], 53 | "name": "InvalidSplit__InvalidDistributorFee", 54 | "type": "error" 55 | }, 56 | { 57 | "inputs": [ 58 | { "internalType": "bytes32", "name": "hash", "type": "bytes32" } 59 | ], 60 | "name": "InvalidSplit__InvalidHash", 61 | "type": "error" 62 | }, 63 | { 64 | "inputs": [ 65 | { "internalType": "uint256", "name": "accountsLength", "type": "uint256" } 66 | ], 67 | "name": "InvalidSplit__TooFewAccounts", 68 | "type": "error" 69 | }, 70 | { 71 | "inputs": [ 72 | { "internalType": "address", "name": "sender", "type": "address" } 73 | ], 74 | "name": "Unauthorized", 75 | "type": "error" 76 | }, 77 | { 78 | "anonymous": false, 79 | "inputs": [ 80 | { 81 | "indexed": true, 82 | "internalType": "address", 83 | "name": "split", 84 | "type": "address" 85 | } 86 | ], 87 | "name": "CancelControlTransfer", 88 | "type": "event" 89 | }, 90 | { 91 | "anonymous": false, 92 | "inputs": [ 93 | { 94 | "indexed": true, 95 | "internalType": "address", 96 | "name": "split", 97 | "type": "address" 98 | }, 99 | { 100 | "indexed": true, 101 | "internalType": "address", 102 | "name": "previousController", 103 | "type": "address" 104 | }, 105 | { 106 | "indexed": true, 107 | "internalType": "address", 108 | "name": "newController", 109 | "type": "address" 110 | } 111 | ], 112 | "name": "ControlTransfer", 113 | "type": "event" 114 | }, 115 | { 116 | "anonymous": false, 117 | "inputs": [ 118 | { 119 | "indexed": true, 120 | "internalType": "address", 121 | "name": "split", 122 | "type": "address" 123 | }, 124 | { 125 | "indexed": false, 126 | "internalType": "address[]", 127 | "name": "accounts", 128 | "type": "address[]" 129 | }, 130 | { 131 | "indexed": false, 132 | "internalType": "uint32[]", 133 | "name": "percentAllocations", 134 | "type": "uint32[]" 135 | }, 136 | { 137 | "indexed": false, 138 | "internalType": "uint32", 139 | "name": "distributorFee", 140 | "type": "uint32" 141 | }, 142 | { 143 | "indexed": false, 144 | "internalType": "address", 145 | "name": "controller", 146 | "type": "address" 147 | } 148 | ], 149 | "name": "CreateSplit", 150 | "type": "event" 151 | }, 152 | { 153 | "anonymous": false, 154 | "inputs": [ 155 | { 156 | "indexed": true, 157 | "internalType": "address", 158 | "name": "split", 159 | "type": "address" 160 | }, 161 | { 162 | "indexed": true, 163 | "internalType": "contract ERC20", 164 | "name": "token", 165 | "type": "address" 166 | }, 167 | { 168 | "indexed": false, 169 | "internalType": "uint256", 170 | "name": "amount", 171 | "type": "uint256" 172 | }, 173 | { 174 | "indexed": true, 175 | "internalType": "address", 176 | "name": "distributorAddress", 177 | "type": "address" 178 | } 179 | ], 180 | "name": "DistributeERC20", 181 | "type": "event" 182 | }, 183 | { 184 | "anonymous": false, 185 | "inputs": [ 186 | { 187 | "indexed": true, 188 | "internalType": "address", 189 | "name": "split", 190 | "type": "address" 191 | }, 192 | { 193 | "indexed": false, 194 | "internalType": "uint256", 195 | "name": "amount", 196 | "type": "uint256" 197 | }, 198 | { 199 | "indexed": true, 200 | "internalType": "address", 201 | "name": "distributorAddress", 202 | "type": "address" 203 | } 204 | ], 205 | "name": "DistributeETH", 206 | "type": "event" 207 | }, 208 | { 209 | "anonymous": false, 210 | "inputs": [ 211 | { 212 | "indexed": true, 213 | "internalType": "address", 214 | "name": "split", 215 | "type": "address" 216 | }, 217 | { 218 | "indexed": true, 219 | "internalType": "address", 220 | "name": "newPotentialController", 221 | "type": "address" 222 | } 223 | ], 224 | "name": "InitiateControlTransfer", 225 | "type": "event" 226 | }, 227 | { 228 | "anonymous": false, 229 | "inputs": [ 230 | { 231 | "indexed": true, 232 | "internalType": "address", 233 | "name": "split", 234 | "type": "address" 235 | }, 236 | { 237 | "indexed": false, 238 | "internalType": "address[]", 239 | "name": "accounts", 240 | "type": "address[]" 241 | }, 242 | { 243 | "indexed": false, 244 | "internalType": "uint32[]", 245 | "name": "percentAllocations", 246 | "type": "uint32[]" 247 | }, 248 | { 249 | "indexed": false, 250 | "internalType": "uint32", 251 | "name": "distributorFee", 252 | "type": "uint32" 253 | } 254 | ], 255 | "name": "UpdateSplit", 256 | "type": "event" 257 | }, 258 | { 259 | "anonymous": false, 260 | "inputs": [ 261 | { 262 | "indexed": true, 263 | "internalType": "address", 264 | "name": "account", 265 | "type": "address" 266 | }, 267 | { 268 | "indexed": false, 269 | "internalType": "uint256", 270 | "name": "ethAmount", 271 | "type": "uint256" 272 | }, 273 | { 274 | "indexed": false, 275 | "internalType": "contract ERC20[]", 276 | "name": "tokens", 277 | "type": "address[]" 278 | }, 279 | { 280 | "indexed": false, 281 | "internalType": "uint256[]", 282 | "name": "tokenAmounts", 283 | "type": "uint256[]" 284 | } 285 | ], 286 | "name": "Withdrawal", 287 | "type": "event" 288 | }, 289 | { 290 | "inputs": [], 291 | "name": "PERCENTAGE_SCALE", 292 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 293 | "stateMutability": "view", 294 | "type": "function" 295 | }, 296 | { 297 | "inputs": [ 298 | { "internalType": "address", "name": "split", "type": "address" } 299 | ], 300 | "name": "acceptControl", 301 | "outputs": [], 302 | "stateMutability": "nonpayable", 303 | "type": "function" 304 | }, 305 | { 306 | "inputs": [ 307 | { "internalType": "address", "name": "split", "type": "address" } 308 | ], 309 | "name": "cancelControlTransfer", 310 | "outputs": [], 311 | "stateMutability": "nonpayable", 312 | "type": "function" 313 | }, 314 | { 315 | "inputs": [ 316 | { "internalType": "address[]", "name": "accounts", "type": "address[]" }, 317 | { 318 | "internalType": "uint32[]", 319 | "name": "percentAllocations", 320 | "type": "uint32[]" 321 | }, 322 | { "internalType": "uint32", "name": "distributorFee", "type": "uint32" }, 323 | { "internalType": "address", "name": "controller", "type": "address" } 324 | ], 325 | "name": "createSplit", 326 | "outputs": [ 327 | { "internalType": "address", "name": "split", "type": "address" } 328 | ], 329 | "stateMutability": "nonpayable", 330 | "type": "function" 331 | }, 332 | { 333 | "inputs": [ 334 | { "internalType": "address", "name": "split", "type": "address" }, 335 | { "internalType": "contract ERC20", "name": "token", "type": "address" }, 336 | { "internalType": "address[]", "name": "accounts", "type": "address[]" }, 337 | { 338 | "internalType": "uint32[]", 339 | "name": "percentAllocations", 340 | "type": "uint32[]" 341 | }, 342 | { "internalType": "uint32", "name": "distributorFee", "type": "uint32" }, 343 | { 344 | "internalType": "address", 345 | "name": "distributorAddress", 346 | "type": "address" 347 | } 348 | ], 349 | "name": "distributeERC20", 350 | "outputs": [], 351 | "stateMutability": "nonpayable", 352 | "type": "function" 353 | }, 354 | { 355 | "inputs": [ 356 | { "internalType": "address", "name": "split", "type": "address" }, 357 | { "internalType": "address[]", "name": "accounts", "type": "address[]" }, 358 | { 359 | "internalType": "uint32[]", 360 | "name": "percentAllocations", 361 | "type": "uint32[]" 362 | }, 363 | { "internalType": "uint32", "name": "distributorFee", "type": "uint32" }, 364 | { 365 | "internalType": "address", 366 | "name": "distributorAddress", 367 | "type": "address" 368 | } 369 | ], 370 | "name": "distributeETH", 371 | "outputs": [], 372 | "stateMutability": "nonpayable", 373 | "type": "function" 374 | }, 375 | { 376 | "inputs": [ 377 | { "internalType": "address", "name": "split", "type": "address" } 378 | ], 379 | "name": "getController", 380 | "outputs": [{ "internalType": "address", "name": "", "type": "address" }], 381 | "stateMutability": "view", 382 | "type": "function" 383 | }, 384 | { 385 | "inputs": [ 386 | { "internalType": "address", "name": "account", "type": "address" }, 387 | { "internalType": "contract ERC20", "name": "token", "type": "address" } 388 | ], 389 | "name": "getERC20Balance", 390 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 391 | "stateMutability": "view", 392 | "type": "function" 393 | }, 394 | { 395 | "inputs": [ 396 | { "internalType": "address", "name": "account", "type": "address" } 397 | ], 398 | "name": "getETHBalance", 399 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 400 | "stateMutability": "view", 401 | "type": "function" 402 | }, 403 | { 404 | "inputs": [ 405 | { "internalType": "address", "name": "split", "type": "address" } 406 | ], 407 | "name": "getHash", 408 | "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], 409 | "stateMutability": "view", 410 | "type": "function" 411 | }, 412 | { 413 | "inputs": [ 414 | { "internalType": "address", "name": "split", "type": "address" } 415 | ], 416 | "name": "getNewPotentialController", 417 | "outputs": [{ "internalType": "address", "name": "", "type": "address" }], 418 | "stateMutability": "view", 419 | "type": "function" 420 | }, 421 | { 422 | "inputs": [ 423 | { "internalType": "address", "name": "split", "type": "address" } 424 | ], 425 | "name": "makeSplitImmutable", 426 | "outputs": [], 427 | "stateMutability": "nonpayable", 428 | "type": "function" 429 | }, 430 | { 431 | "inputs": [ 432 | { "internalType": "address[]", "name": "accounts", "type": "address[]" }, 433 | { 434 | "internalType": "uint32[]", 435 | "name": "percentAllocations", 436 | "type": "uint32[]" 437 | }, 438 | { "internalType": "uint32", "name": "distributorFee", "type": "uint32" } 439 | ], 440 | "name": "predictImmutableSplitAddress", 441 | "outputs": [ 442 | { "internalType": "address", "name": "split", "type": "address" } 443 | ], 444 | "stateMutability": "view", 445 | "type": "function" 446 | }, 447 | { 448 | "inputs": [ 449 | { "internalType": "address", "name": "split", "type": "address" }, 450 | { "internalType": "address", "name": "newController", "type": "address" } 451 | ], 452 | "name": "transferControl", 453 | "outputs": [], 454 | "stateMutability": "nonpayable", 455 | "type": "function" 456 | }, 457 | { 458 | "inputs": [ 459 | { "internalType": "address", "name": "split", "type": "address" }, 460 | { "internalType": "contract ERC20", "name": "token", "type": "address" }, 461 | { "internalType": "address[]", "name": "accounts", "type": "address[]" }, 462 | { 463 | "internalType": "uint32[]", 464 | "name": "percentAllocations", 465 | "type": "uint32[]" 466 | }, 467 | { "internalType": "uint32", "name": "distributorFee", "type": "uint32" }, 468 | { 469 | "internalType": "address", 470 | "name": "distributorAddress", 471 | "type": "address" 472 | } 473 | ], 474 | "name": "updateAndDistributeERC20", 475 | "outputs": [], 476 | "stateMutability": "nonpayable", 477 | "type": "function" 478 | }, 479 | { 480 | "inputs": [ 481 | { "internalType": "address", "name": "split", "type": "address" }, 482 | { "internalType": "address[]", "name": "accounts", "type": "address[]" }, 483 | { 484 | "internalType": "uint32[]", 485 | "name": "percentAllocations", 486 | "type": "uint32[]" 487 | }, 488 | { "internalType": "uint32", "name": "distributorFee", "type": "uint32" }, 489 | { 490 | "internalType": "address", 491 | "name": "distributorAddress", 492 | "type": "address" 493 | } 494 | ], 495 | "name": "updateAndDistributeETH", 496 | "outputs": [], 497 | "stateMutability": "nonpayable", 498 | "type": "function" 499 | }, 500 | { 501 | "inputs": [ 502 | { "internalType": "address", "name": "split", "type": "address" }, 503 | { "internalType": "address[]", "name": "accounts", "type": "address[]" }, 504 | { 505 | "internalType": "uint32[]", 506 | "name": "percentAllocations", 507 | "type": "uint32[]" 508 | }, 509 | { "internalType": "uint32", "name": "distributorFee", "type": "uint32" } 510 | ], 511 | "name": "updateSplit", 512 | "outputs": [], 513 | "stateMutability": "nonpayable", 514 | "type": "function" 515 | }, 516 | { 517 | "inputs": [], 518 | "name": "walletImplementation", 519 | "outputs": [{ "internalType": "address", "name": "", "type": "address" }], 520 | "stateMutability": "view", 521 | "type": "function" 522 | }, 523 | { 524 | "inputs": [ 525 | { "internalType": "address", "name": "account", "type": "address" }, 526 | { "internalType": "uint256", "name": "withdrawETH", "type": "uint256" }, 527 | { 528 | "internalType": "contract ERC20[]", 529 | "name": "tokens", 530 | "type": "address[]" 531 | } 532 | ], 533 | "name": "withdraw", 534 | "outputs": [], 535 | "stateMutability": "nonpayable", 536 | "type": "function" 537 | }, 538 | { "stateMutability": "payable", "type": "receive" } 539 | ] 540 | -------------------------------------------------------------------------------- /config/arb-goerli.json: -------------------------------------------------------------------------------- 1 | { 2 | "network": "arbitrum-goerli", 3 | "splitMainAddress": "'0x2ed6c4B5dA6378c7897AC67Ba9e43102Feb694EE'", 4 | "vestingFactoryAddress": "'0x0a2841630f198745a55c4dab3fe98f77271949e5'", 5 | "waterfallFactoryAddress": "'0x4Df01754eBd055498C8087b1e9a5c7a9ad19b0F6'", 6 | "liquidSplitFactoryAddress": "'0xdEcd8B99b7F763e16141450DAa5EA414B7994831'", 7 | "recoupAddress": "'0xCbB386B801Ec72A5aB02AEB723dECd12f96EdE41'", 8 | "splitStartBlock": "383218", 9 | "vestingStartBlock": "389582", 10 | "waterfallStartBlock": "529465", 11 | "liquidSplitStartBlock": "853847", 12 | "recoupStartBlock": "10644617", 13 | "polygon": true 14 | } 15 | -------------------------------------------------------------------------------- /config/arbitrum.json: -------------------------------------------------------------------------------- 1 | { 2 | "network": "arbitrum-one", 3 | "splitMainAddress": "'0x2ed6c4B5dA6378c7897AC67Ba9e43102Feb694EE'", 4 | "vestingFactoryAddress": "'0x0a2841630f198745a55c4dab3fe98f77271949e5'", 5 | "waterfallFactoryAddress": "'0x4Df01754eBd055498C8087b1e9a5c7a9ad19b0F6'", 6 | "liquidSplitFactoryAddress": "'0xdEcd8B99b7F763e16141450DAa5EA414B7994831'", 7 | "recoupAddress": "'0xCbB386B801Ec72A5aB02AEB723dECd12f96EdE41'", 8 | "uniV3OracleFactoryAddress": "'0x498f316fEB85a250fdC64B859a130515491EC888'", 9 | "chainlinkOracleFactoryAddress": "'0xD28182C2E11519ad081E7fa9da711274b7096098'", 10 | "swapperFactoryAddress": "'0xa244bbe019cf1BA177EE5A532250be2663Fb55cA'", 11 | "passThroughWalletFactoryAddress": "'0x52d6838957ec268cc5B50F17F9b490cbAb0A9E40'", 12 | "diversifierFactoryAddress": "'0x1f3f5C7342Ae19E2b35b657864106f227201eF8A'", 13 | "splitStartBlock": "26082503", 14 | "vestingStartBlock": "26112587", 15 | "waterfallStartBlock": "32752593", 16 | "liquidSplitStartBlock": "32755634", 17 | "recoupStartBlock": "68309961", 18 | "uniV3OracleStartBlock": "176960617", 19 | "chainlinkOracleStartBlock": "177762477", 20 | "swapperStartBlock": "176965123", 21 | "passThroughWalletStartBlock": "176967401", 22 | "diversifierStartBlock": "176968394", 23 | "polygon": true, 24 | "swapper": true 25 | } 26 | -------------------------------------------------------------------------------- /config/aurora.json: -------------------------------------------------------------------------------- 1 | { 2 | "network": "aurora", 3 | "splitMainAddress": "'0x2ed6c4B5dA6378c7897AC67Ba9e43102Feb694EE'", 4 | "vestingFactoryAddress": "'0x0a2841630f198745a55c4dab3fe98f77271949e5'", 5 | "waterfallFactoryAddress": "'0x4Df01754eBd055498C8087b1e9a5c7a9ad19b0F6'", 6 | "liquidSplitFactoryAddress": "'0xdEcd8B99b7F763e16141450DAa5EA414B7994831'", 7 | "recoupAddress": "'0xCbB386B801Ec72A5aB02AEB723dECd12f96EdE41'", 8 | "splitStartBlock": "83401794", 9 | "vestingStartBlock": "83402583", 10 | "waterfallStartBlock": "83403408", 11 | "liquidSplitStartBlock": "83403802", 12 | "recoupStartBlock": "86938926", 13 | "polygon": true 14 | } 15 | -------------------------------------------------------------------------------- /config/avalanche.json: -------------------------------------------------------------------------------- 1 | { 2 | "network": "avalanche", 3 | "splitMainAddress": "'0x2ed6c4B5dA6378c7897AC67Ba9e43102Feb694EE'", 4 | "vestingFactoryAddress": "'0x0a2841630f198745a55c4dab3fe98f77271949e5'", 5 | "waterfallFactoryAddress": "'0x4Df01754eBd055498C8087b1e9a5c7a9ad19b0F6'", 6 | "liquidSplitFactoryAddress": "'0xdEcd8B99b7F763e16141450DAa5EA414B7994831'", 7 | "recoupAddress": "'0xCbB386B801Ec72A5aB02AEB723dECd12f96EdE41'", 8 | "splitStartBlock": "25125818", 9 | "vestingStartBlock": "25126184", 10 | "waterfallStartBlock": "25126356", 11 | "liquidSplitStartBlock": "25126507", 12 | "recoupStartBlock": "27227712", 13 | "polygon": true 14 | } 15 | -------------------------------------------------------------------------------- /config/base-goerli.json: -------------------------------------------------------------------------------- 1 | { 2 | "network": "base-testnet", 3 | "splitMainAddress": "'0x2ed6c4B5dA6378c7897AC67Ba9e43102Feb694EE'", 4 | "vestingFactoryAddress": "'0x0a2841630f198745a55c4dab3fe98f77271949e5'", 5 | "waterfallFactoryAddress": "'0x4Df01754eBd055498C8087b1e9a5c7a9ad19b0F6'", 6 | "liquidSplitFactoryAddress": "'0xdEcd8B99b7F763e16141450DAa5EA414B7994831'", 7 | "recoupAddress": "'0xCbB386B801Ec72A5aB02AEB723dECd12f96EdE41'", 8 | "splitStartBlock": "8858512", 9 | "vestingStartBlock": "8858950", 10 | "waterfallStartBlock": "8859382", 11 | "liquidSplitStartBlock": "8859611", 12 | "recoupStartBlock": "8859860", 13 | "polygon": true 14 | } 15 | -------------------------------------------------------------------------------- /config/base-sepolia.json: -------------------------------------------------------------------------------- 1 | { 2 | "network": "base-sepolia", 3 | "splitMainAddress": "'0x2ed6c4B5dA6378c7897AC67Ba9e43102Feb694EE'", 4 | "vestingFactoryAddress": "'0x0a2841630f198745a55c4dab3fe98f77271949e5'", 5 | "waterfallFactoryAddress": "'0x4Df01754eBd055498C8087b1e9a5c7a9ad19b0F6'", 6 | "liquidSplitFactoryAddress": "'0xdEcd8B99b7F763e16141450DAa5EA414B7994831'", 7 | "recoupAddress": "'0xCbB386B801Ec72A5aB02AEB723dECd12f96EdE41'", 8 | "splitStartBlock": "3324413", 9 | "vestingStartBlock": "3324413", 10 | "waterfallStartBlock": "3324413", 11 | "liquidSplitStartBlock": "3324413", 12 | "recoupStartBlock": "3324413", 13 | "polygon": true 14 | } 15 | -------------------------------------------------------------------------------- /config/base.json: -------------------------------------------------------------------------------- 1 | { 2 | "network": "base", 3 | "splitMainAddress": "'0x2ed6c4B5dA6378c7897AC67Ba9e43102Feb694EE'", 4 | "vestingFactoryAddress": "'0x0a2841630f198745a55c4dab3fe98f77271949e5'", 5 | "waterfallFactoryAddress": "'0x4Df01754eBd055498C8087b1e9a5c7a9ad19b0F6'", 6 | "liquidSplitFactoryAddress": "'0xdEcd8B99b7F763e16141450DAa5EA414B7994831'", 7 | "recoupAddress": "'0xCbB386B801Ec72A5aB02AEB723dECd12f96EdE41'", 8 | "uniV3OracleFactoryAddress": "'0x074827E8bD77B0A66c6008a51AF9BD1F33105caf'", 9 | "chainlinkOracleFactoryAddress": "'0xD28182C2E11519ad081E7fa9da711274b7096098'", 10 | "swapperFactoryAddress": "'0xa244bbe019cf1BA177EE5A532250be2663Fb55cA'", 11 | "passThroughWalletFactoryAddress": "'0x52d6838957ec268cc5B50F17F9b490cbAb0A9E40'", 12 | "diversifierFactoryAddress": "'0x1f3f5C7342Ae19E2b35b657864106f227201eF8A'", 13 | "splitStartBlock": "2293907", 14 | "vestingStartBlock": "2294131", 15 | "waterfallStartBlock": "2294359", 16 | "liquidSplitStartBlock": "2294473", 17 | "recoupStartBlock": "2294611", 18 | "uniV3OracleStartBlock": "7777505", 19 | "chainlinkOracleStartBlock": "7784149", 20 | "swapperStartBlock": "7778070", 21 | "passThroughWalletStartBlock": "7778616", 22 | "diversifierStartBlock": "7778915", 23 | "polygon": true, 24 | "swapper": true 25 | } 26 | -------------------------------------------------------------------------------- /config/bsc.json: -------------------------------------------------------------------------------- 1 | { 2 | "network": "bsc", 3 | "splitMainAddress": "'0x5924cD81dC672151527B1E4b5Ef57B69cBD07Eda'", 4 | "vestingFactoryAddress": "'0x7205d93721837c45Be23C930D9fba842e968Ad69'", 5 | "waterfallFactoryAddress": "'0xB7CCCcCeb459F0910589556123dC5fA6DC8dE4E0'", 6 | "liquidSplitFactoryAddress": "'0xCDe071bE119024EdC970B3Da15003ee834ae40D2'", 7 | "recoupAddress": "'0x5ff0C88311F79803B43e9Dc3F2B20F49A6b680fd'", 8 | "splitStartBlock": "24962607", 9 | "vestingStartBlock": "24962810", 10 | "waterfallStartBlock": "24962939", 11 | "liquidSplitStartBlock": "24963441", 12 | "recoupStartBlock": "26327011", 13 | "polygon": true 14 | } 15 | -------------------------------------------------------------------------------- /config/fantom.json: -------------------------------------------------------------------------------- 1 | { 2 | "network": "fantom", 3 | "splitMainAddress": "'0x2ed6c4B5dA6378c7897AC67Ba9e43102Feb694EE'", 4 | "vestingFactoryAddress": "'0x0a2841630f198745a55c4dab3fe98f77271949e5'", 5 | "waterfallFactoryAddress": "'0x4Df01754eBd055498C8087b1e9a5c7a9ad19b0F6'", 6 | "liquidSplitFactoryAddress": "'0xdEcd8B99b7F763e16141450DAa5EA414B7994831'", 7 | "recoupAddress": "'0xCbB386B801Ec72A5aB02AEB723dECd12f96EdE41'", 8 | "splitStartBlock": "53993922", 9 | "vestingStartBlock": "53996048", 10 | "waterfallStartBlock": "53997776", 11 | "liquidSplitStartBlock": "53998434", 12 | "recoupStartBlock": "57270508", 13 | "polygon": true 14 | } 15 | -------------------------------------------------------------------------------- /config/gnosis.json: -------------------------------------------------------------------------------- 1 | { 2 | "network": "gnosis", 3 | "splitMainAddress": "'0x2ed6c4B5dA6378c7897AC67Ba9e43102Feb694EE'", 4 | "vestingFactoryAddress": "'0x0a2841630f198745a55c4dab3fe98f77271949e5'", 5 | "waterfallFactoryAddress": "'0x4Df01754eBd055498C8087b1e9a5c7a9ad19b0F6'", 6 | "liquidSplitFactoryAddress": "'0xdEcd8B99b7F763e16141450DAa5EA414B7994831'", 7 | "recoupAddress": "'0xCbB386B801Ec72A5aB02AEB723dECd12f96EdE41'", 8 | "splitStartBlock": "26014830", 9 | "vestingStartBlock": "26016386", 10 | "waterfallStartBlock": "26021016", 11 | "liquidSplitStartBlock": "26021283", 12 | "recoupStartBlock": "26861906", 13 | "polygon": true 14 | } 15 | -------------------------------------------------------------------------------- /config/goerli.json: -------------------------------------------------------------------------------- 1 | { 2 | "network": "goerli", 3 | "splitMainAddress": "'0x2ed6c4B5dA6378c7897AC67Ba9e43102Feb694EE'", 4 | "vestingFactoryAddress": "'0x0a2841630f198745a55c4dab3fe98f77271949e5'", 5 | "waterfallFactoryAddress": "'0x4Df01754eBd055498C8087b1e9a5c7a9ad19b0F6'", 6 | "liquidSplitFactoryAddress": "'0xdEcd8B99b7F763e16141450DAa5EA414B7994831'", 7 | "recoupAddress": "'0xCbB386B801Ec72A5aB02AEB723dECd12f96EdE41'", 8 | "uniV3OracleFactoryAddress": "'0x498f316fEB85a250fdC64B859a130515491EC888'", 9 | "swapperFactoryAddress": "'0xa244bbe019cf1BA177EE5A532250be2663Fb55cA'", 10 | "passThroughWalletFactoryAddress": "'0xF5aCC1568706Fbf9A55a77DdBe8DF907Da95dD6B'", 11 | "diversifierFactoryAddress": "'0x78791997483f25217F4C3FE2a568Fe3eFaf77884'", 12 | "chainlinkOracleFactoryAddress": "'0xD28182C2E11519ad081E7fa9da711274b7096098'", 13 | "splitStartBlock": "6374540", 14 | "vestingStartBlock": "6839434", 15 | "waterfallStartBlock": "7718183", 16 | "liquidSplitStartBlock": "7829527", 17 | "recoupStartBlock": "8626129", 18 | "uniV3OracleStartBlock": "9111052", 19 | "swapperStartBlock": "9111157", 20 | "passThroughWalletStartBlock": "9111177", 21 | "diversifierStartBlock": "9111208", 22 | "chainlinkOracleStartBlock": "9111208", 23 | "ethereum": true, 24 | "swapper": true 25 | } 26 | -------------------------------------------------------------------------------- /config/holesky.json: -------------------------------------------------------------------------------- 1 | { 2 | "network": "holesky", 3 | "splitMainAddress": "'0xfC8a305728051367797DADE6Aa0344E0987f5286'", 4 | "vestingFactoryAddress": "'0x0a2841630f198745a55c4dab3fe98f77271949e5'", 5 | "waterfallFactoryAddress": "'0x4Df01754eBd055498C8087b1e9a5c7a9ad19b0F6'", 6 | "liquidSplitFactoryAddress": "'0xAbA0E852f1EB10196b55f877903A87a2588b7aa8'", 7 | "recoupAddress": "'0xcFba37C5Ee4d80c286593342470EB881deb9799e'", 8 | "splitStartBlock": "817717", 9 | "vestingStartBlock": "148475", 10 | "waterfallStartBlock": "148599", 11 | "liquidSplitStartBlock": "817930", 12 | "recoupStartBlock": "817916", 13 | "polygon": true 14 | } 15 | -------------------------------------------------------------------------------- /config/mainnet.json: -------------------------------------------------------------------------------- 1 | { 2 | "network": "mainnet", 3 | "splitMainAddress": "'0x2ed6c4B5dA6378c7897AC67Ba9e43102Feb694EE'", 4 | "vestingFactoryAddress": "'0x0a2841630f198745a55c4dab3fe98f77271949e5'", 5 | "waterfallFactoryAddress": "'0x4Df01754eBd055498C8087b1e9a5c7a9ad19b0F6'", 6 | "liquidSplitFactoryAddress": "'0xdEcd8B99b7F763e16141450DAa5EA414B7994831'", 7 | "recoupAddress": "'0xCbB386B801Ec72A5aB02AEB723dECd12f96EdE41'", 8 | "uniV3OracleFactoryAddress": "'0x498f316fEB85a250fdC64B859a130515491EC888'", 9 | "swapperFactoryAddress": "'0xa244bbe019cf1BA177EE5A532250be2663Fb55cA'", 10 | "passThroughWalletFactoryAddress": "'0xF5aCC1568706Fbf9A55a77DdBe8DF907Da95dD6B'", 11 | "diversifierFactoryAddress": "'0x78791997483f25217F4C3FE2a568Fe3eFaf77884'", 12 | "chainlinkOracleFactoryAddress": "'0xD28182C2E11519ad081E7fa9da711274b7096098'", 13 | "splitStartBlock": "14206768", 14 | "vestingStartBlock": "14722373", 15 | "waterfallStartBlock": "15684597", 16 | "liquidSplitStartBlock": "15822543", 17 | "recoupStartBlock": "16792823", 18 | "uniV3OracleStartBlock": "17395950", 19 | "swapperStartBlock": "17395991", 20 | "passThroughWalletStartBlock": "17396007", 21 | "diversifierStartBlock": "17396020", 22 | "chainlinkOracleStartBlock": "18780762", 23 | "ethereum": true, 24 | "swapper": true 25 | } 26 | -------------------------------------------------------------------------------- /config/mumbai.json: -------------------------------------------------------------------------------- 1 | { 2 | "network": "mumbai", 3 | "splitMainAddress": "'0x2ed6c4B5dA6378c7897AC67Ba9e43102Feb694EE'", 4 | "vestingFactoryAddress": "'0x0a2841630f198745a55c4dab3fe98f77271949e5'", 5 | "waterfallFactoryAddress": "'0x4Df01754eBd055498C8087b1e9a5c7a9ad19b0F6'", 6 | "liquidSplitFactoryAddress": "'0xdEcd8B99b7F763e16141450DAa5EA414B7994831'", 7 | "recoupAddress": "'0xCbB386B801Ec72A5aB02AEB723dECd12f96EdE41'", 8 | "splitStartBlock": "25258326", 9 | "vestingStartBlock": "26224690", 10 | "waterfallStartBlock": "28465665", 11 | "liquidSplitStartBlock": "28797457", 12 | "recoupStartBlock": "32910409", 13 | "polygon": true 14 | } 15 | -------------------------------------------------------------------------------- /config/opt-goerli.json: -------------------------------------------------------------------------------- 1 | { 2 | "network": "optimism-goerli", 3 | "splitMainAddress": "'0x2ed6c4B5dA6378c7897AC67Ba9e43102Feb694EE'", 4 | "vestingFactoryAddress": "'0x0a2841630f198745a55c4dab3fe98f77271949e5'", 5 | "waterfallFactoryAddress": "'0x4Df01754eBd055498C8087b1e9a5c7a9ad19b0F6'", 6 | "liquidSplitFactoryAddress": "'0xdEcd8B99b7F763e16141450DAa5EA414B7994831'", 7 | "recoupAddress": "'0xCbB386B801Ec72A5aB02AEB723dECd12f96EdE41'", 8 | "splitStartBlock": "1324620", 9 | "vestingStartBlock": "1365068", 10 | "waterfallStartBlock": "1718090", 11 | "liquidSplitStartBlock": "2260524", 12 | "recoupStartBlock": "6481062", 13 | "polygon": true 14 | } 15 | -------------------------------------------------------------------------------- /config/opt-sepolia.json: -------------------------------------------------------------------------------- 1 | { 2 | "network": "optimism-sepolia", 3 | "splitMainAddress": "'0x2ed6c4B5dA6378c7897AC67Ba9e43102Feb694EE'", 4 | "vestingFactoryAddress": "'0x0a2841630f198745a55c4dab3fe98f77271949e5'", 5 | "waterfallFactoryAddress": "'0x4Df01754eBd055498C8087b1e9a5c7a9ad19b0F6'", 6 | "liquidSplitFactoryAddress": "'0xdEcd8B99b7F763e16141450DAa5EA414B7994831'", 7 | "recoupAddress": "'0xCbB386B801Ec72A5aB02AEB723dECd12f96EdE41'", 8 | "splitStartBlock": "5305164", 9 | "vestingStartBlock": "5305164", 10 | "waterfallStartBlock": "5305164", 11 | "liquidSplitStartBlock": "5305164", 12 | "recoupStartBlock": "5305164", 13 | "polygon": true 14 | } 15 | -------------------------------------------------------------------------------- /config/optimism.json: -------------------------------------------------------------------------------- 1 | { 2 | "network": "optimism", 3 | "splitMainAddress": "'0x2ed6c4B5dA6378c7897AC67Ba9e43102Feb694EE'", 4 | "vestingFactoryAddress": "'0x0a2841630f198745a55c4dab3fe98f77271949e5'", 5 | "waterfallFactoryAddress": "'0x4Df01754eBd055498C8087b1e9a5c7a9ad19b0F6'", 6 | "liquidSplitFactoryAddress": "'0xdEcd8B99b7F763e16141450DAa5EA414B7994831'", 7 | "recoupAddress": "'0xCbB386B801Ec72A5aB02AEB723dECd12f96EdE41'", 8 | "uniV3OracleFactoryAddress": "'0x73b3B74865eE1dc996Ac8EbD31C45CFb4f38e39F'", 9 | "chainlinkOracleFactoryAddress": "'0xD28182C2E11519ad081E7fa9da711274b7096098'", 10 | "swapperFactoryAddress": "'0xa244bbe019cf1BA177EE5A532250be2663Fb55cA'", 11 | "passThroughWalletFactoryAddress": "'0x52d6838957ec268cc5B50F17F9b490cbAb0A9E40'", 12 | "diversifierFactoryAddress": "'0x1f3f5C7342Ae19E2b35b657864106f227201eF8A'", 13 | "splitStartBlock": "24704537", 14 | "vestingStartBlock": "24756353", 15 | "waterfallStartBlock": "27641475", 16 | "liquidSplitStartBlock": "31292536", 17 | "recoupStartBlock": "79601439", 18 | "uniV3OracleStartBlock": "113418280", 19 | "chainlinkOracleStartBlock": "113420120", 20 | "swapperStartBlock": "113418545", 21 | "passThroughWalletStartBlock": "113418975", 22 | "diversifierStartBlock": "113419127", 23 | "polygon": true, 24 | "swapper": true 25 | } 26 | -------------------------------------------------------------------------------- /config/polygon.json: -------------------------------------------------------------------------------- 1 | { 2 | "network": "matic", 3 | "splitMainAddress": "'0x2ed6c4B5dA6378c7897AC67Ba9e43102Feb694EE'", 4 | "vestingFactoryAddress": "'0x0a2841630f198745a55c4dab3fe98f77271949e5'", 5 | "waterfallFactoryAddress": "'0x4Df01754eBd055498C8087b1e9a5c7a9ad19b0F6'", 6 | "liquidSplitFactoryAddress": "'0xdEcd8B99b7F763e16141450DAa5EA414B7994831'", 7 | "recoupAddress": "'0xCbB386B801Ec72A5aB02AEB723dECd12f96EdE41'", 8 | "uniV3OracleFactoryAddress": "'0x498f316fEB85a250fdC64B859a130515491EC888'", 9 | "chainlinkOracleFactoryAddress": "'0xD28182C2E11519ad081E7fa9da711274b7096098'", 10 | "swapperFactoryAddress": "'0xa244bbe019cf1BA177EE5A532250be2663Fb55cA'", 11 | "passThroughWalletFactoryAddress": "'0x52d6838957ec268cc5B50F17F9b490cbAb0A9E40'", 12 | "diversifierFactoryAddress": "'0x1f3f5C7342Ae19E2b35b657864106f227201eF8A'", 13 | "splitStartBlock": "25303316", 14 | "vestingStartBlock": "27984752", 15 | "waterfallStartBlock": "33977643", 16 | "liquidSplitStartBlock": "34767434", 17 | "recoupStartBlock": "40156210", 18 | "uniV3OracleStartBlock": "51096442", 19 | "chainlinkOracleStartBlock": "51098151", 20 | "swapperStartBlock": "51096635", 21 | "passThroughWalletStartBlock": "51097686", 22 | "diversifierStartBlock": "51097883", 23 | "polygon": true, 24 | "swapper": true 25 | } 26 | -------------------------------------------------------------------------------- /config/sepolia.json: -------------------------------------------------------------------------------- 1 | { 2 | "network": "sepolia", 3 | "splitMainAddress": "'0x54E4a6014D36c381fC43b7E24A1492F556139a6F'", 4 | "vestingFactoryAddress": "'0x0a2841630f198745a55c4dab3fe98f77271949e5'", 5 | "waterfallFactoryAddress": "'0x4Df01754eBd055498C8087b1e9a5c7a9ad19b0F6'", 6 | "liquidSplitFactoryAddress": "'0xb3Af150A5902e06373A2D3f177d85435A48c6b33'", 7 | "recoupAddress": "'0x8Cbb4e187ce8A29BACC13Fd999a107f3c4b46D3B'", 8 | "uniV3OracleFactoryAddress": "'0x074827E8bD77B0A66c6008a51AF9BD1F33105caf'", 9 | "swapperFactoryAddress": "'0xa244bbe019cf1BA177EE5A532250be2663Fb55cA'", 10 | "passThroughWalletFactoryAddress": "'0x52d6838957ec268cc5B50F17F9b490cbAb0A9E40'", 11 | "diversifierFactoryAddress": "'0x0eAeAfD1c82563B6005c7D09031462D9FF68Adab'", 12 | "chainlinkOracleFactoryAddress": "'0xD28182C2E11519ad081E7fa9da711274b7096098'", 13 | "splitStartBlock": "5395780", 14 | "vestingStartBlock": "4836125", 15 | "waterfallStartBlock": "4836309", 16 | "liquidSplitStartBlock": "5395886", 17 | "recoupStartBlock": "5395918", 18 | "uniV3OracleStartBlock": "4841540", 19 | "swapperStartBlock": "4836644", 20 | "passThroughWalletStartBlock": "4837008", 21 | "diversifierStartBlock": "5395942", 22 | "chainlinkOracleStartBlock": "4843087", 23 | "polygon": true, 24 | "swapper": true 25 | } 26 | -------------------------------------------------------------------------------- /config/zora-goerli.json: -------------------------------------------------------------------------------- 1 | { 2 | "network": "zora-goerli", 3 | "splitMainAddress": "'0x2ed6c4B5dA6378c7897AC67Ba9e43102Feb694EE'", 4 | "vestingFactoryAddress": "'0x0a2841630f198745a55c4dab3fe98f77271949e5'", 5 | "waterfallFactoryAddress": "'0x4Df01754eBd055498C8087b1e9a5c7a9ad19b0F6'", 6 | "liquidSplitFactoryAddress": "'0xdEcd8B99b7F763e16141450DAa5EA414B7994831'", 7 | "recoupAddress": "'0xCbB386B801Ec72A5aB02AEB723dECd12f96EdE41'", 8 | "splitStartBlock": "968023", 9 | "vestingStartBlock": "968110", 10 | "waterfallStartBlock": "968162", 11 | "liquidSplitStartBlock": "968209", 12 | "recoupStartBlock": "968246", 13 | "polygon": true 14 | } 15 | -------------------------------------------------------------------------------- /config/zora.json: -------------------------------------------------------------------------------- 1 | { 2 | "network": "zora", 3 | "splitMainAddress": "'0x2ed6c4B5dA6378c7897AC67Ba9e43102Feb694EE'", 4 | "vestingFactoryAddress": "'0x0a2841630f198745a55c4dab3fe98f77271949e5'", 5 | "waterfallFactoryAddress": "'0x4Df01754eBd055498C8087b1e9a5c7a9ad19b0F6'", 6 | "liquidSplitFactoryAddress": "'0xdEcd8B99b7F763e16141450DAa5EA414B7994831'", 7 | "recoupAddress": "'0xCbB386B801Ec72A5aB02AEB723dECd12f96EdE41'", 8 | "splitStartBlock": "1860322", 9 | "vestingStartBlock": "1870705", 10 | "waterfallStartBlock": "1871304", 11 | "liquidSplitStartBlock": "1871609", 12 | "recoupStartBlock": "1871849", 13 | "polygon": true 14 | } 15 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "splits-subgraph", 3 | "license": "UNLICENSED", 4 | "scripts": { 5 | "codegen": "graph codegen", 6 | "build": "graph build", 7 | "deploy:mainnet": "graph deploy --node https://api.thegraph.com/deploy/ 0xsplits/splits-subgraph-ethereum", 8 | "deploy:mainnet-testing": "graph deploy --node https://api.thegraph.com/deploy/ 0xsplits/splits-subgraph-ethereum-test", 9 | "deploy:goerli": "graph deploy --node https://api.thegraph.com/deploy/ 0xsplits/splits-subgraph-goerli", 10 | "deploy:goerli-testing": "graph deploy --node https://api.thegraph.com/deploy/ 0xsplits/splits-subgraph-goerli-testing", 11 | "deploy:holesky": "graph deploy --studio splits-subgraph-holesky", 12 | "deploy:sepolia": "graph deploy --node https://api.thegraph.com/deploy/ 0xsplits/splits-subgraph-sepolia", 13 | "deploy:polygon": "graph deploy --node https://api.thegraph.com/deploy/ 0xsplits/splits-subgraph-polygon", 14 | "deploy:mumbai": "graph deploy --node https://api.thegraph.com/deploy/ 0xsplits/splits-subgraph-mumbai", 15 | "deploy:mumbai-testing": "graph deploy --node https://api.thegraph.com/deploy/ 0xsplits/splits-subgraph-mumbai-testing", 16 | "deploy:optimism": "graph deploy --node https://api.thegraph.com/deploy/ 0xsplits/splits-subgraph-optimism", 17 | "deploy:opt-goerli": "graph deploy --node https://api.thegraph.com/deploy/ 0xsplits/splits-subgraph-opt-goerli", 18 | "deploy:opt-sepolia": "graph deploy --studio splits-subgraph-opt-sepolia", 19 | "deploy:arbitrum": "graph deploy --node https://api.thegraph.com/deploy/ 0xsplits/splits-subgraph-arbitrum", 20 | "deploy:arb-goerli": "graph deploy --node https://api.thegraph.com/deploy/ 0xsplits/splits-subgraph-arb-goerli", 21 | "deploy:gnosis": "graph deploy --node https://api.thegraph.com/deploy/ 0xsplits/splits-subgraph-gnosis", 22 | "deploy:fantom": "graph deploy --node https://api.thegraph.com/deploy/ 0xsplits/splits-subgraph-fantom", 23 | "deploy:avalanche": "graph deploy --node https://api.thegraph.com/deploy/ 0xsplits/splits-subgraph-avalanche", 24 | "deploy:bsc": "graph deploy --node https://api.thegraph.com/deploy/ 0xsplits/splits-subgraph-bsc", 25 | "deploy:aurora": "graph deploy --node https://api.thegraph.com/deploy/ 0xsplits/splits-subgraph-aurora", 26 | "deploy:base": "graph deploy --node https://api.thegraph.com/deploy/ 0xsplits/splits-subgraph-base", 27 | "deploy:base-goerli": "graph deploy --node https://api.thegraph.com/deploy/ 0xsplits/splits-subgraph-base-goerli", 28 | "deploy:base-sepolia": "graph deploy --studio splits-subgraph-base-sepolia", 29 | "create-local": "graph create --node http://localhost:8020/ 0xSplits/splits-subgraph", 30 | "remove-local": "graph remove --node http://localhost:8020/ 0xSplits/splits-subgraph", 31 | "deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 0xSplits/splits-subgraph", 32 | "prepare:mainnet": "mustache config/mainnet.json schema.template.graphql > schema.graphql && mustache config/mainnet.json subgraph.template.yaml > subgraph.yaml && cp src/ethereum.mapping.ts src/mapping.ts && cp abis/ethereum.SplitMain.json abis/SplitMain.json && graph codegen", 33 | "prepare:mainnet-testing": "mustache config/mainnet.json schema.template.graphql > schema.graphql && mustache config/mainnet.json subgraph.template.yaml > subgraph.yaml && cp src/ethereum.mapping.ts src/mapping.ts && cp abis/ethereum.SplitMain.json abis/SplitMain.json && graph codegen", 34 | "prepare:goerli": "mustache config/goerli.json schema.template.graphql > schema.graphql && mustache config/goerli.json subgraph.template.yaml > subgraph.yaml && cp src/ethereum.mapping.ts src/mapping.ts && cp abis/ethereum.SplitMain.json abis/SplitMain.json && graph codegen", 35 | "prepare:goerli-testing": "mustache config/goerli.json schema.template.graphql > schema.graphql && mustache config/goerli.json subgraph.template.yaml > subgraph.yaml && cp src/ethereum.mapping.ts src/mapping.ts && cp abis/ethereum.SplitMain.json abis/SplitMain.json && graph codegen", 36 | "prepare:holesky": "mustache config/holesky.json schema.template.graphql > schema.graphql && mustache config/holesky.json subgraph.template.yaml > subgraph.yaml && cp src/polygon.mapping.ts src/mapping.ts && cp abis/polygon.SplitMain.json abis/SplitMain.json && graph codegen", 37 | "prepare:sepolia": "mustache config/sepolia.json schema.template.graphql > schema.graphql && mustache config/sepolia.json subgraph.template.yaml > subgraph.yaml && cp src/polygon.mapping.ts src/mapping.ts && cp abis/polygon.SplitMain.json abis/SplitMain.json && graph codegen", 38 | "prepare:polygon": "mustache config/polygon.json schema.template.graphql > schema.graphql && mustache config/polygon.json subgraph.template.yaml > subgraph.yaml && cp src/polygon.mapping.ts src/mapping.ts && cp abis/polygon.SplitMain.json abis/SplitMain.json && graph codegen", 39 | "prepare:mumbai": "mustache config/mumbai.json schema.template.graphql > schema.graphql && mustache config/mumbai.json subgraph.template.yaml > subgraph.yaml && cp src/polygon.mapping.ts src/mapping.ts && cp abis/polygon.SplitMain.json abis/SplitMain.json && graph codegen", 40 | "prepare:mumbai-testing": "mustache config/mumbai.json schema.template.graphql > schema.graphql && mustache config/mumbai.json subgraph.template.yaml > subgraph.yaml && cp src/polygon.mapping.ts src/mapping.ts && cp abis/polygon.SplitMain.json abis/SplitMain.json && graph codegen", 41 | "prepare:optimism": "mustache config/optimism.json schema.template.graphql > schema.graphql && mustache config/optimism.json subgraph.template.yaml > subgraph.yaml && cp src/polygon.mapping.ts src/mapping.ts && cp abis/polygon.SplitMain.json abis/SplitMain.json && graph codegen", 42 | "prepare:opt-goerli": "mustache config/opt-goerli.json schema.template.graphql > schema.graphql && mustache config/opt-goerli.json subgraph.template.yaml > subgraph.yaml && cp src/polygon.mapping.ts src/mapping.ts && cp abis/polygon.SplitMain.json abis/SplitMain.json && graph codegen", 43 | "prepare:opt-sepolia": "mustache config/opt-sepolia.json schema.template.graphql > schema.graphql && mustache config/opt-sepolia.json subgraph.template.yaml > subgraph.yaml && cp src/polygon.mapping.ts src/mapping.ts && cp abis/polygon.SplitMain.json abis/SplitMain.json && graph codegen", 44 | "prepare:arbitrum": "mustache config/arbitrum.json schema.template.graphql > schema.graphql && mustache config/arbitrum.json subgraph.template.yaml > subgraph.yaml && cp src/polygon.mapping.ts src/mapping.ts && cp abis/polygon.SplitMain.json abis/SplitMain.json && graph codegen", 45 | "prepare:arb-goerli": "mustache config/arb-goerli.json schema.template.graphql > schema.graphql && mustache config/arb-goerli.json subgraph.template.yaml > subgraph.yaml && cp src/polygon.mapping.ts src/mapping.ts && cp abis/polygon.SplitMain.json abis/SplitMain.json && graph codegen", 46 | "prepare:gnosis": "mustache config/gnosis.json schema.template.graphql > schema.graphql && mustache config/gnosis.json subgraph.template.yaml > subgraph.yaml && cp src/polygon.mapping.ts src/mapping.ts && cp abis/polygon.SplitMain.json abis/SplitMain.json && graph codegen", 47 | "prepare:fantom": "mustache config/fantom.json schema.template.graphql > schema.graphql && mustache config/fantom.json subgraph.template.yaml > subgraph.yaml && cp src/polygon.mapping.ts src/mapping.ts && cp abis/polygon.SplitMain.json abis/SplitMain.json && graph codegen", 48 | "prepare:avalanche": "mustache config/avalanche.json schema.template.graphql > schema.graphql && mustache config/avalanche.json subgraph.template.yaml > subgraph.yaml && cp src/polygon.mapping.ts src/mapping.ts && cp abis/polygon.SplitMain.json abis/SplitMain.json && graph codegen", 49 | "prepare:bsc": "mustache config/bsc.json schema.template.graphql > schema.graphql && mustache config/bsc.json subgraph.template.yaml > subgraph.yaml && cp src/polygon.mapping.ts src/mapping.ts && cp abis/polygon.SplitMain.json abis/SplitMain.json && graph codegen", 50 | "prepare:aurora": "mustache config/aurora.json schema.template.graphql > schema.graphql && mustache config/aurora.json subgraph.template.yaml > subgraph.yaml && cp src/polygon.mapping.ts src/mapping.ts && cp abis/polygon.SplitMain.json abis/SplitMain.json && graph codegen", 51 | "prepare:zora": "mustache config/zora.json schema.template.graphql > schema.graphql && mustache config/zora.json subgraph.template.yaml > subgraph.yaml && cp src/polygon.mapping.ts src/mapping.ts && cp abis/polygon.SplitMain.json abis/SplitMain.json && graph codegen", 52 | "prepare:zora-goerli": "mustache config/zora-goerli.json schema.template.graphql > schema.graphql && mustache config/zora-goerli.json subgraph.template.yaml > subgraph.yaml && cp src/polygon.mapping.ts src/mapping.ts && cp abis/polygon.SplitMain.json abis/SplitMain.json && graph codegen", 53 | "prepare:base": "mustache config/base.json schema.template.graphql > schema.graphql && mustache config/base.json subgraph.template.yaml > subgraph.yaml && cp src/polygon.mapping.ts src/mapping.ts && cp abis/polygon.SplitMain.json abis/SplitMain.json && graph codegen", 54 | "prepare:base-goerli": "mustache config/base-goerli.json schema.template.graphql > schema.graphql && mustache config/base-goerli.json subgraph.template.yaml > subgraph.yaml && cp src/polygon.mapping.ts src/mapping.ts && cp abis/polygon.SplitMain.json abis/SplitMain.json && graph codegen", 55 | "prepare:base-sepolia": "mustache config/base-sepolia.json schema.template.graphql > schema.graphql && mustache config/base-sepolia.json subgraph.template.yaml > subgraph.yaml && cp src/polygon.mapping.ts src/mapping.ts && cp abis/polygon.SplitMain.json abis/SplitMain.json && graph codegen", 56 | "build-and-deploy-prodnets": "yarn prepare:base && yarn build && yarn deploy:base && yarn prepare:aurora && yarn build && yarn deploy:aurora && yarn prepare:bsc && yarn build && yarn deploy:bsc && yarn prepare:avalanche && yarn build && yarn deploy:avalanche && yarn prepare:fantom && yarn build && yarn deploy:fantom && yarn prepare:gnosis && yarn build && yarn deploy:gnosis && yarn prepare:arbitrum && yarn build && yarn deploy:arbitrum && yarn prepare:optimism && yarn build && yarn deploy:optimism && yarn prepare:mainnet && yarn build && yarn deploy:mainnet && yarn prepare:polygon && yarn build && yarn deploy:polygon", 57 | "build-and-deploy-testnets": "yarn prepare:sepolia && yarn build && yarn deploy:sepolia && yarn prepare:arb-goerli && yarn build && yarn deploy:arb-goerli && yarn prepare:opt-goerli && yarn build && yarn deploy:opt-goerli && yarn prepare:opt-sepolia && yarn build && yarn deploy:opt-sepolia && yarn prepare:goerli && yarn build && yarn deploy:goerli && yarn prepare:mumbai && yarn build && yarn deploy:mumbai && yarn prepare:base-goerli && yarn build && yarn deploy:base-goerli && yarn prepare:base-sepolia && yarn build && yarn deploy:base-sepolia", 58 | "build-and-deploy-mumbai-testing": "yarn prepare:mumbai-testing && yarn build && yarn deploy:mumbai-testing", 59 | "build-and-deploy-goerli-testing": "yarn prepare:goerli-testing && yarn build && yarn deploy:goerli-testing", 60 | "build-and-deploy-mainnet-testing": "yarn prepare:mainnet-testing && yarn build && yarn deploy:mainnet-testing" 61 | }, 62 | "dependencies": { 63 | "@graphprotocol/graph-cli": "^0.65.0", 64 | "@graphprotocol/graph-ts": "^0.32.0" 65 | }, 66 | "devDependencies": { 67 | "mustache": "^4.2.0" 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/chainlink-oracle.mapping.ts: -------------------------------------------------------------------------------- 1 | import { Address, BigInt, Bytes, log } from '@graphprotocol/graph-ts' 2 | import { CreateChainlinkOracle } from '../generated/ChainlinkOracleFactory/ChainlinkOracleFactory' 3 | import { ChainlinkOracle } from '../generated/ChainlinkOracleFactory/ChainlinkOracle' 4 | import { 5 | OwnershipTransferred, 6 | SetPairDetails, 7 | SetPaused, 8 | } from '../generated/templates/ChainlinkOracle/ChainlinkOracle' 9 | import { ChainlinkOracle as ChainlinkOracleTemplate } from '../generated/templates' 10 | import { 11 | Token, 12 | User, 13 | ChainlinkOracle as Oracle, 14 | ChainlinkPairDetail, 15 | ChainlinkFeed, 16 | } from '../generated/schema' 17 | import { 18 | createJointId, 19 | createUserIfMissing, 20 | getBigIntFromString, 21 | } from './helpers' 22 | 23 | export const ZERO = BigInt.fromI32(0) 24 | 25 | const FEED_SIZE = 50 26 | 27 | export function handleCreateChainlinkOracle( 28 | event: CreateChainlinkOracle, 29 | ): void { 30 | let oracleId = event.params.oracle.toHexString() 31 | log.info('oracleId: {}', [oracleId]) 32 | 33 | // If a user already exists at this id, just return for now. Cannot have two 34 | // entities with the same id if they share an interface. Will handle this situation 35 | // in subgraph v2. 36 | let oracleUser = User.load(oracleId) 37 | if (oracleUser) { 38 | log.warning('Trying to create an oracle, but a user already exists: {}', [ 39 | oracleId, 40 | ]) 41 | return 42 | } 43 | 44 | let blockNumber = event.block.number.toI32() 45 | let timestamp = event.block.timestamp 46 | let oracle = new Oracle(oracleId) 47 | 48 | let owner = event.params.params.owner.toHexString() 49 | let paused = event.params.params.paused 50 | let pairDetails = event.params.params.pairDetails 51 | 52 | createUserIfMissing(owner, blockNumber, timestamp) 53 | 54 | for (let i: i32 = 0; i < pairDetails.length; i++) { 55 | let quotePair = pairDetails[i].quotePair 56 | 57 | let base = quotePair.base.toHexString() 58 | let baseToken = new Token(base) 59 | baseToken.save() 60 | 61 | let quote = quotePair.quote.toHexString() 62 | let quoteToken = new Token(quote) 63 | quoteToken.save() 64 | 65 | let pairDetail = pairDetails[i].pairDetail 66 | let path = pairDetail.path 67 | let inverted = pairDetail.inverted 68 | 69 | // Store reverse pairing as well for easier lookup 70 | updatePairDetail(oracleId, base, quote, path, inverted) 71 | updatePairDetail(oracleId, quote, base, path, !inverted) 72 | } 73 | 74 | oracle.type = 'chainlink' 75 | oracle.owner = owner 76 | oracle.paused = paused 77 | 78 | oracle.createdBlock = blockNumber 79 | oracle.latestBlock = blockNumber 80 | oracle.latestActivity = timestamp 81 | 82 | let sequencerFeedCall = ChainlinkOracle.bind( 83 | event.params.oracle, 84 | ).try_sequencerFeed() 85 | if (!sequencerFeedCall.reverted) { 86 | oracle.sequencerFeed = sequencerFeedCall.value 87 | } 88 | 89 | oracle.save() 90 | 91 | ChainlinkOracleTemplate.create(event.params.oracle) 92 | } 93 | 94 | function updatePairDetail( 95 | oracleId: string, 96 | baseToken: string, 97 | quoteToken: string, 98 | path: Bytes, 99 | inverted: boolean, 100 | ): void { 101 | let pairDetailId = createJointId([oracleId, baseToken, quoteToken]) 102 | let pairDetail = ChainlinkPairDetail.load(pairDetailId) 103 | if (!pairDetail) { 104 | pairDetail = new ChainlinkPairDetail(pairDetailId) 105 | pairDetail.oracle = oracleId 106 | pairDetail.base = baseToken 107 | pairDetail.quote = quoteToken 108 | } 109 | pairDetail.inverted = inverted 110 | 111 | let pathAsString = path.toHex() 112 | let numberOfFeeds = pathAsString.length / FEED_SIZE 113 | 114 | for (let i = 0; i < numberOfFeeds; i++) { 115 | let feed = pathAsString.slice(FEED_SIZE * i, FEED_SIZE * (i + 1) + 2) 116 | createChainlinkFeed(feed, pairDetailId, oracleId, baseToken, quoteToken) 117 | } 118 | pairDetail.save() 119 | } 120 | 121 | function createChainlinkFeed( 122 | feed: string, 123 | pairDetailId: string, 124 | oracle: string, 125 | base: string, 126 | quote: string, 127 | ): ChainlinkFeed { 128 | /// decoding feed address from first 42 characters 129 | let feedAddress = Address.fromHexString(feed.slice(0, 42)) 130 | 131 | /// decoding feed staleAfter from next 6 characters 132 | let staleAfter = getBigIntFromString(feed, 42, 48) 133 | 134 | /// decoding feed decimals from next 2 characters 135 | let decimals = getBigIntFromString(feed, 48, 50) 136 | 137 | /// decoding feed operation from last 2 characters 138 | let mul = getBigIntFromString(feed, 50, 52) == BigInt.fromI32(1) 139 | 140 | let feedId = createJointId([oracle, base, quote, feedAddress.toHexString()]) 141 | let chainlinkFeed = ChainlinkFeed.load(feedId) 142 | if (!chainlinkFeed) { 143 | chainlinkFeed = new ChainlinkFeed(feedId) 144 | chainlinkFeed.aggregatorV3 = feedAddress 145 | chainlinkFeed.decimals = decimals 146 | chainlinkFeed.staleAfter = staleAfter 147 | chainlinkFeed.mul = mul 148 | chainlinkFeed.chainlinkPairDetail = pairDetailId 149 | } else { 150 | chainlinkFeed.aggregatorV3 = feedAddress 151 | chainlinkFeed.decimals = decimals 152 | chainlinkFeed.staleAfter = staleAfter 153 | chainlinkFeed.mul = mul 154 | } 155 | chainlinkFeed.save() 156 | 157 | return chainlinkFeed 158 | } 159 | 160 | export function handleSetPairDetails(event: SetPairDetails): void { 161 | let oracleId = event.address.toHexString() 162 | 163 | let oracle = Oracle.load(oracleId) 164 | if (!oracle) return 165 | 166 | let blockNumber = event.block.number.toI32() 167 | let timestamp = event.block.timestamp 168 | 169 | if (event.block.number.toI32() > oracle.latestBlock) { 170 | oracle.latestBlock = blockNumber 171 | oracle.latestActivity = timestamp 172 | } 173 | 174 | let pairDetails = event.params.params 175 | for (let i: i32 = 0; i < pairDetails.length; i++) { 176 | let base = pairDetails[i].quotePair.base.toHexString() 177 | let baseToken = new Token(base) 178 | baseToken.save() 179 | 180 | let quote = pairDetails[i].quotePair.quote.toHexString() 181 | let quoteToken = new Token(quote) 182 | quoteToken.save() 183 | 184 | let inverted = pairDetails[i].pairDetail.inverted 185 | let path = pairDetails[i].pairDetail.path 186 | 187 | // Store reverse pairing as well for easier lookup 188 | updatePairDetail(oracleId, base, quote, path, inverted) 189 | updatePairDetail(oracleId, quote, base, path, inverted) 190 | } 191 | 192 | oracle.save() 193 | } 194 | 195 | export function handleSetPaused(event: SetPaused): void { 196 | let oracleId = event.address.toHexString() 197 | 198 | let oracle = Oracle.load(oracleId) 199 | if (!oracle) return 200 | 201 | let blockNumber = event.block.number.toI32() 202 | let timestamp = event.block.timestamp 203 | 204 | if (event.block.number.toI32() > oracle.latestBlock) { 205 | oracle.latestBlock = blockNumber 206 | oracle.latestActivity = timestamp 207 | } 208 | 209 | oracle.paused = event.params.paused 210 | oracle.save() 211 | } 212 | 213 | export function handleOwnershipTransferred(event: OwnershipTransferred): void { 214 | let oracleId = event.address.toHexString() 215 | 216 | let oracle = Oracle.load(oracleId) 217 | if (!oracle) return 218 | 219 | let blockNumber = event.block.number.toI32() 220 | let timestamp = event.block.timestamp 221 | 222 | if (event.block.number.toI32() > oracle.latestBlock) { 223 | oracle.latestBlock = blockNumber 224 | oracle.latestActivity = timestamp 225 | } 226 | 227 | let newOwner = event.params.newOwner.toHexString() 228 | createUserIfMissing(newOwner, blockNumber, timestamp) 229 | 230 | oracle.owner = newOwner 231 | oracle.save() 232 | } 233 | -------------------------------------------------------------------------------- /src/oracle.mapping.ts: -------------------------------------------------------------------------------- 1 | import { Address, BigInt, Bytes, log } from '@graphprotocol/graph-ts' 2 | import { CreateUniV3Oracle } from '../generated/UniV3OracleFactory/UniV3OracleFactory' 3 | import { UniV3Pool as UniV3PoolContract } from '../generated/UniV3OracleFactory/UniV3Pool' 4 | import { 5 | OwnershipTransferred, 6 | SetDefaultPeriod, 7 | SetPairDetails, 8 | SetPaused, 9 | } from '../generated/templates/UniV3Oracle/UniV3Oracle' 10 | import { UniV3Oracle as UniV3OracleTemplate } from '../generated/templates' 11 | import { 12 | Token, 13 | User, 14 | UniswapV3TWAPOracle as Oracle, 15 | UniswapV3TWAPPairDetail, 16 | } from '../generated/schema' 17 | import { createJointId, createUserIfMissing } from './helpers' 18 | 19 | export const ZERO = BigInt.fromI32(0) 20 | 21 | export function handleCreateUniV3Oracle(event: CreateUniV3Oracle): void { 22 | let oracleId = event.params.oracle.toHexString() 23 | 24 | // If a user already exists at this id, just return for now. Cannot have two 25 | // entities with the same id if they share an interface. Will handle this situation 26 | // in subgraph v2. 27 | let oracleUser = User.load(oracleId) 28 | if (oracleUser) { 29 | log.warning('Trying to create an oracle, but a user already exists: {}', [ 30 | oracleId, 31 | ]) 32 | return 33 | } 34 | 35 | let blockNumber = event.block.number.toI32() 36 | let timestamp = event.block.timestamp 37 | 38 | let oracle = new Oracle(oracleId) 39 | 40 | let owner = event.params.params.owner.toHexString() 41 | let paused = event.params.params.paused 42 | let defaultPeriod = event.params.params.defaultPeriod 43 | let pairDetails = event.params.params.pairDetails 44 | 45 | createUserIfMissing(owner, blockNumber, timestamp) 46 | 47 | for (let i: i32 = 0; i < pairDetails.length; i++) { 48 | let quotePair = pairDetails[i].quotePair 49 | 50 | let base = quotePair.base.toHexString() 51 | let baseToken = new Token(base) 52 | baseToken.save() 53 | 54 | let quote = quotePair.quote.toHexString() 55 | let quoteToken = new Token(quote) 56 | quoteToken.save() 57 | 58 | let pairDetail = pairDetails[i].pairDetail 59 | let pool = pairDetail.pool 60 | let period = pairDetail.period 61 | 62 | // Store reverse pairing as well for easier lookup 63 | updatePairDetail(oracleId, base, quote, pool, period) 64 | updatePairDetail(oracleId, quote, base, pool, period) 65 | } 66 | 67 | oracle.type = 'uniswapV3TWAP' 68 | oracle.owner = owner 69 | oracle.paused = paused 70 | oracle.defaultPeriod = defaultPeriod 71 | 72 | oracle.createdBlock = blockNumber 73 | oracle.latestBlock = blockNumber 74 | oracle.latestActivity = timestamp 75 | 76 | oracle.save() 77 | UniV3OracleTemplate.create(event.params.oracle) 78 | 79 | // TODO: Save event? 80 | } 81 | 82 | function updatePairDetail( 83 | oracleId: string, 84 | baseToken: string, 85 | quoteToken: string, 86 | pool: Bytes, 87 | period: BigInt, 88 | ): void { 89 | let pairDetailId = createJointId([oracleId, baseToken, quoteToken]) 90 | let pairDetail = UniswapV3TWAPPairDetail.load(pairDetailId) 91 | if (!pairDetail) { 92 | pairDetail = new UniswapV3TWAPPairDetail(pairDetailId) 93 | pairDetail.oracle = oracleId 94 | pairDetail.base = baseToken 95 | pairDetail.quote = quoteToken 96 | } 97 | pairDetail.pool = pool 98 | pairDetail.period = period 99 | 100 | // Fetch pool fee. Need to handle the case of a non-univ3 pool 101 | let uniV3PoolContract = UniV3PoolContract.bind(Address.fromBytes(pool)) 102 | let feeCallResult = uniV3PoolContract.try_fee() 103 | let fee = 0 104 | if (!feeCallResult.reverted) { 105 | fee = feeCallResult.value 106 | } 107 | pairDetail.fee = fee 108 | 109 | pairDetail.save() 110 | } 111 | 112 | export function handleSetDefaultPeriod(event: SetDefaultPeriod): void { 113 | let oracleId = event.address.toHexString() 114 | 115 | let oracle = Oracle.load(oracleId) 116 | if (!oracle) return 117 | 118 | let blockNumber = event.block.number.toI32() 119 | let timestamp = event.block.timestamp 120 | 121 | if (event.block.number.toI32() > oracle.latestBlock) { 122 | oracle.latestBlock = blockNumber 123 | oracle.latestActivity = timestamp 124 | } 125 | 126 | oracle.defaultPeriod = event.params.defaultPeriod 127 | oracle.save() 128 | 129 | // TODO: Save event? 130 | } 131 | 132 | export function handleSetPairDetails(event: SetPairDetails): void { 133 | let oracleId = event.address.toHexString() 134 | 135 | let oracle = Oracle.load(oracleId) 136 | if (!oracle) return 137 | 138 | let blockNumber = event.block.number.toI32() 139 | let timestamp = event.block.timestamp 140 | 141 | if (event.block.number.toI32() > oracle.latestBlock) { 142 | oracle.latestBlock = blockNumber 143 | oracle.latestActivity = timestamp 144 | } 145 | 146 | let pairDetails = event.params.params 147 | for (let i: i32 = 0; i < pairDetails.length; i++) { 148 | let base = pairDetails[i].quotePair.base.toHexString() 149 | let baseToken = new Token(base) 150 | baseToken.save() 151 | 152 | let quote = pairDetails[i].quotePair.quote.toHexString() 153 | let quoteToken = new Token(quote) 154 | quoteToken.save() 155 | 156 | let pool = pairDetails[i].pairDetail.pool 157 | let period = pairDetails[i].pairDetail.period 158 | 159 | // Store reverse pairing as well for easier lookup 160 | updatePairDetail(oracleId, base, quote, pool, period) 161 | updatePairDetail(oracleId, quote, base, pool, period) 162 | } 163 | 164 | oracle.save() 165 | 166 | // TODO: Save event? 167 | } 168 | 169 | export function handleSetPaused(event: SetPaused): void { 170 | let oracleId = event.address.toHexString() 171 | 172 | let oracle = Oracle.load(oracleId) 173 | if (!oracle) return 174 | 175 | let blockNumber = event.block.number.toI32() 176 | let timestamp = event.block.timestamp 177 | 178 | if (event.block.number.toI32() > oracle.latestBlock) { 179 | oracle.latestBlock = blockNumber 180 | oracle.latestActivity = timestamp 181 | } 182 | 183 | oracle.paused = event.params.paused 184 | oracle.save() 185 | } 186 | 187 | export function handleOwnershipTransferred(event: OwnershipTransferred): void { 188 | let oracleId = event.address.toHexString() 189 | 190 | let oracle = Oracle.load(oracleId) 191 | if (!oracle) return 192 | 193 | let blockNumber = event.block.number.toI32() 194 | let timestamp = event.block.timestamp 195 | 196 | if (event.block.number.toI32() > oracle.latestBlock) { 197 | oracle.latestBlock = blockNumber 198 | oracle.latestActivity = timestamp 199 | } 200 | 201 | let newOwner = event.params.newOwner.toHexString() 202 | createUserIfMissing(newOwner, blockNumber, timestamp) 203 | 204 | oracle.owner = newOwner 205 | oracle.save() 206 | } 207 | -------------------------------------------------------------------------------- /src/polygon.mapping.ts: -------------------------------------------------------------------------------- 1 | import { Address, store, log } from '@graphprotocol/graph-ts' 2 | import { 3 | CancelControlTransfer, 4 | ControlTransfer, 5 | CreateSplit, 6 | DistributeERC20, 7 | DistributeETH, 8 | InitiateControlTransfer, 9 | UpdateSplit, 10 | Withdrawal, 11 | } from '../generated/SplitMain/SplitMain' 12 | import { LiquidSplit, Split, Recipient, User } from '../generated/schema' 13 | import { 14 | createJointId, 15 | createUserIfMissing, 16 | saveWithdrawalEvent, 17 | saveDistributeEvent, 18 | distributeSplit, 19 | handleTokenWithdrawal, 20 | saveControlTransferEvents, 21 | saveSetSplitEvent, 22 | saveSplitRecipientAddedEvent, 23 | saveSplitRecipientRemovedEvent, 24 | getSplit, 25 | getAccountIdForSplitEvents, 26 | PERCENTAGE_SCALE, 27 | ZERO_ADDRESS, 28 | TWO, 29 | ONE_ADDRESS, 30 | handleTokenWithdrawalEvent, 31 | } from './helpers' 32 | 33 | export function handleCancelControlTransfer( 34 | event: CancelControlTransfer, 35 | ): void { 36 | let splitId = event.params.split.toHexString() 37 | let split = getSplit(splitId) 38 | if (!split) return 39 | 40 | let oldPotentialController = split.newPotentialController 41 | split.newPotentialController = Address.zero() 42 | split.save() 43 | 44 | let timestamp = event.block.timestamp 45 | let txHash = event.transaction.hash.toHexString() 46 | let logIdx = event.logIndex 47 | 48 | saveControlTransferEvents( 49 | timestamp, 50 | txHash, 51 | logIdx, 52 | split.id, 53 | 'cancel', 54 | split.controller.toHexString(), 55 | oldPotentialController.toHexString(), 56 | ) 57 | } 58 | 59 | export function handleControlTransfer(event: ControlTransfer): void { 60 | let splitId = event.params.split.toHexString() 61 | let split = getSplit(splitId) 62 | if (!split) return 63 | 64 | let oldController = split.controller 65 | split.controller = event.params.newController 66 | split.newPotentialController = Address.zero() 67 | split.save() 68 | 69 | let timestamp = event.block.timestamp 70 | let txHash = event.transaction.hash.toHexString() 71 | let logIdx = event.logIndex 72 | 73 | saveControlTransferEvents( 74 | timestamp, 75 | txHash, 76 | logIdx, 77 | split.id, 78 | 'transfer', 79 | oldController.toHexString(), 80 | split.controller.toHexString(), 81 | ) 82 | } 83 | 84 | export function handleCreateSplit(event: CreateSplit): void { 85 | let timestamp = event.block.timestamp 86 | let txHash = event.transaction.hash.toHexString() 87 | let logIdx = event.logIndex 88 | let splitId = event.params.split.toHexString() 89 | let blockNumber = event.block.number.toI32() 90 | let accounts = event.params.accounts 91 | let percentAllocations = event.params.percentAllocations 92 | let controllerId = event.params.controller.toHexString() 93 | 94 | // If a user already exists at this id, just return for now. Cannot have two 95 | // entities with the same id if they share an interface. Will handle this situation 96 | // in subgraph v2. 97 | let splitUser = User.load(splitId) 98 | if (splitUser) { 99 | log.warning('Trying to create a split, but a user already exists: {}', [ 100 | splitId, 101 | ]) 102 | return 103 | } 104 | 105 | saveSetSplitEvent(timestamp, txHash, logIdx, splitId, 'create') 106 | 107 | // Create controller as user EXCEPT when it looks like this is a payout split 108 | // for a liquid split. In this case don't create the user so we don't tie up 109 | // the address. This isn't needed in the ethereum call handler since that runs after 110 | // the liquid split event handler. It also only impacts custom liquid splits, not 111 | // factory liquid splits due to the ordering of events being different for the 112 | // two. 113 | let looksLikeLiquidSplitPayout = 114 | accounts.length == 2 && 115 | accounts[0].toHexString() == ZERO_ADDRESS && 116 | accounts[1].toHexString() == ONE_ADDRESS && 117 | percentAllocations[0] == PERCENTAGE_SCALE / TWO && 118 | percentAllocations[1] == PERCENTAGE_SCALE / TWO 119 | if (!looksLikeLiquidSplitPayout) { 120 | createUserIfMissing(controllerId, blockNumber, timestamp) 121 | } 122 | 123 | let split = new Split(splitId) 124 | split.type = 'split' 125 | split.createdBlock = blockNumber 126 | split.latestBlock = blockNumber 127 | split.latestActivity = timestamp 128 | split.controller = event.params.controller 129 | split.newPotentialController = Address.zero() 130 | split.distributorFee = event.params.distributorFee 131 | 132 | let recipientIds = new Array() 133 | for (let i: i32 = 0; i < accounts.length; i++) { 134 | let accountId = accounts[i].toHexString() 135 | createUserIfMissing(accountId, blockNumber, timestamp) 136 | 137 | let recipientId = createJointId([splitId, accountId]) 138 | let recipient = new Recipient(recipientId) 139 | recipient.split = splitId 140 | recipient.account = accountId 141 | recipient.ownership = percentAllocations[i] 142 | recipient.save() 143 | recipientIds.push(recipientId) 144 | 145 | saveSplitRecipientAddedEvent( 146 | timestamp, 147 | txHash, 148 | logIdx, 149 | accountId, 150 | percentAllocations[i], 151 | ) 152 | } 153 | split.recipients = recipientIds 154 | 155 | let liquidSplitController = LiquidSplit.load(controllerId) 156 | if (liquidSplitController) { 157 | split.parentEntityType = 'liquidSplit' 158 | } 159 | 160 | split.save() 161 | } 162 | 163 | export function handleDistributeERC20(event: DistributeERC20): void { 164 | // TODO: explore cleaning this up w union type 165 | let timestamp = event.block.timestamp 166 | let blockNumber = event.block.number.toI32() 167 | let txHash = event.transaction.hash.toHexString() 168 | let logIdx = event.logIndex 169 | let splitId = event.params.split.toHexString() 170 | let tokenId = event.params.token.toHexString() 171 | let amount = event.params.amount 172 | let distributorAddress = event.params.distributorAddress 173 | saveDistributeEvent(timestamp, txHash, logIdx, splitId, tokenId, amount) 174 | distributeSplit( 175 | timestamp, 176 | txHash, 177 | logIdx, 178 | splitId, 179 | tokenId, 180 | amount, 181 | distributorAddress, 182 | blockNumber, 183 | ) 184 | } 185 | 186 | export function handleDistributeETH(event: DistributeETH): void { 187 | // TODO: explore cleaning this up w union type 188 | let timestamp = event.block.timestamp 189 | let blockNumber = event.block.number.toI32() 190 | let txHash = event.transaction.hash.toHexString() 191 | let logIdx = event.logIndex 192 | let splitId = event.params.split.toHexString() 193 | let tokenId = Address.zero().toHexString() 194 | let amount = event.params.amount 195 | let distributorAddress = event.params.distributorAddress 196 | saveDistributeEvent(timestamp, txHash, logIdx, splitId, tokenId, amount) 197 | distributeSplit( 198 | timestamp, 199 | txHash, 200 | logIdx, 201 | splitId, 202 | tokenId, 203 | amount, 204 | distributorAddress, 205 | blockNumber, 206 | ) 207 | } 208 | 209 | export function handleInitiateControlTransfer( 210 | event: InitiateControlTransfer, 211 | ): void { 212 | let splitId = event.params.split.toHexString() 213 | let split = getSplit(splitId) 214 | if (!split) return 215 | 216 | let blockNumber = event.block.number.toI32() 217 | let timestamp = event.block.timestamp 218 | 219 | createUserIfMissing( 220 | event.params.newPotentialController.toHexString(), 221 | blockNumber, 222 | timestamp, 223 | ) 224 | 225 | split.newPotentialController = event.params.newPotentialController 226 | split.save() 227 | 228 | let txHash = event.transaction.hash.toHexString() 229 | let logIdx = event.logIndex 230 | 231 | saveControlTransferEvents( 232 | timestamp, 233 | txHash, 234 | logIdx, 235 | split.id, 236 | 'initiate', 237 | split.controller.toHexString(), 238 | split.newPotentialController.toHexString(), 239 | ) 240 | } 241 | 242 | export function handleUpdateSplit(event: UpdateSplit): void { 243 | let blockNumber = event.block.number.toI32() 244 | let timestamp = event.block.timestamp 245 | let txHash = event.transaction.hash.toHexString() 246 | let logIdx = event.logIndex 247 | let splitId = event.params.split.toHexString() 248 | 249 | saveSetSplitEvent(timestamp, txHash, logIdx, splitId, 'update') 250 | 251 | // use new object for partial updates when existing values not needed 252 | let split = getSplit(splitId) 253 | if (!split) return 254 | 255 | let eventsAccountId = getAccountIdForSplitEvents(splitId) 256 | let shouldSaveRecipientEvents = eventsAccountId == splitId 257 | 258 | split.latestBlock = event.block.number.toI32() 259 | split.latestActivity = event.block.timestamp 260 | split.distributorFee = event.params.distributorFee 261 | let oldRecipientIds = split.recipients 262 | let newRecipientIds = new Array() 263 | let newRecipientIdSet = new Set() 264 | 265 | let accounts = event.params.accounts 266 | let percentAllocations = event.params.percentAllocations 267 | for (let i: i32 = 0; i < accounts.length; i++) { 268 | let accountId = accounts[i].toHexString() 269 | createUserIfMissing(accountId, blockNumber, timestamp) 270 | 271 | let recipientId = createJointId([splitId, accountId]) 272 | newRecipientIdSet.add(recipientId) 273 | let recipient = new Recipient(recipientId) 274 | recipient.account = accountId 275 | recipient.split = splitId 276 | recipient.ownership = percentAllocations[i] 277 | recipient.save() 278 | newRecipientIds.push(recipientId) 279 | 280 | if (shouldSaveRecipientEvents && !oldRecipientIds.includes(recipientId)) { 281 | saveSplitRecipientAddedEvent( 282 | timestamp, 283 | txHash, 284 | logIdx, 285 | accountId, 286 | percentAllocations[i], 287 | ) 288 | } 289 | } 290 | 291 | // delete existing recipients not in updated split 292 | for (let i: i32 = 0; i < oldRecipientIds.length; i++) { 293 | let recipientId = oldRecipientIds[i] 294 | // remove recipients no longer in split 295 | if (!newRecipientIdSet.has(recipientId)) { 296 | let removedRecipient = Recipient.load(recipientId) 297 | if (shouldSaveRecipientEvents && removedRecipient) 298 | saveSplitRecipientRemovedEvent( 299 | timestamp, 300 | txHash, 301 | logIdx, 302 | removedRecipient.account, 303 | ) 304 | store.remove('Recipient', recipientId) 305 | } 306 | } 307 | 308 | split.recipients = newRecipientIds 309 | split.save() 310 | } 311 | 312 | export function handleWithdrawal(event: Withdrawal): void { 313 | let blockNumber = event.block.number.toI32() 314 | let timestamp = event.block.timestamp 315 | let txHash = event.transaction.hash.toHexString() 316 | let logIdx = event.logIndex 317 | let account = event.params.account.toHexString() 318 | let ethAmount = event.params.ethAmount 319 | let tokens = event.params.tokens 320 | let tokenAmounts = event.params.tokenAmounts 321 | 322 | createUserIfMissing(account, blockNumber, timestamp) 323 | 324 | let withdrawalEventId = saveWithdrawalEvent( 325 | timestamp, 326 | txHash, 327 | logIdx, 328 | account, 329 | ) 330 | 331 | if (ethAmount) { 332 | handleTokenWithdrawal( 333 | account, 334 | ZERO_ADDRESS, 335 | ethAmount, 336 | blockNumber, 337 | timestamp, 338 | ) 339 | handleTokenWithdrawalEvent(withdrawalEventId, ZERO_ADDRESS, ethAmount) 340 | } 341 | 342 | for (let i: i32 = 0; i < tokens.length; i++) { 343 | handleTokenWithdrawal( 344 | account, 345 | tokens[i].toHexString(), 346 | tokenAmounts[i], 347 | blockNumber, 348 | timestamp, 349 | ) 350 | handleTokenWithdrawalEvent( 351 | withdrawalEventId, 352 | tokens[i].toHexString(), 353 | tokenAmounts[i], 354 | ) 355 | } 356 | } 357 | -------------------------------------------------------------------------------- /src/templates.mapping.ts: -------------------------------------------------------------------------------- 1 | import { CreateRecoup } from '../generated/Recoup/Recoup' 2 | import { CreateDiversifier } from '../generated/DiversifierFactory/DiversifierFactory' 3 | import { WaterfallTranche, Split } from '../generated/schema' 4 | import { 5 | createJointId, 6 | getPassThroughWallet, 7 | getWaterfallModule, 8 | } from './helpers' 9 | 10 | export function handleCreateRecoup(event: CreateRecoup): void { 11 | let waterfallModuleId = event.params.waterfallModule.toHexString() 12 | let waterfallModule = getWaterfallModule(waterfallModuleId) 13 | if (!waterfallModule) return 14 | 15 | waterfallModule.parentEntityType = 'recoup' 16 | waterfallModule.save() 17 | 18 | let i: i32 = 0 19 | let hasReachedResidual = false 20 | while (!hasReachedResidual) { 21 | let waterfallTrancheId = createJointId([waterfallModuleId, i.toString()]) 22 | let waterfallTranche = WaterfallTranche.load( 23 | waterfallTrancheId, 24 | ) as WaterfallTranche 25 | i++ 26 | 27 | if (!waterfallTranche.size) { 28 | hasReachedResidual = true 29 | } 30 | 31 | let recipientId = waterfallTranche.recipient 32 | let split = Split.load(recipientId) 33 | if (split) { 34 | split.parentEntityType = 'recoup' 35 | split.save() 36 | } 37 | } 38 | } 39 | 40 | export function handleCreateDiversifier(event: CreateDiversifier): void { 41 | let passThroughWalletId = event.params.diversifier.toHexString() 42 | let passThroughWallet = getPassThroughWallet(passThroughWalletId) 43 | if (!passThroughWallet) return 44 | 45 | passThroughWallet.parentEntityType = 'diversifier' 46 | passThroughWallet.save() 47 | 48 | // Need to update parentEntityType on split and swappers as well, but 49 | // need to handle that in SetPassThrough since the passThroughAccount 50 | // is set to address(0) on creation 51 | } 52 | -------------------------------------------------------------------------------- /src/vesting.mapping.ts: -------------------------------------------------------------------------------- 1 | import { BigInt, log } from '@graphprotocol/graph-ts' 2 | import { CreateVestingModule } from '../generated/VestingModuleFactory/VestingModuleFactory' 3 | import { 4 | CreateVestingStream, 5 | ReleaseFromVestingStream, 6 | } from '../generated/templates/VestingModule/VestingModule' 7 | import { VestingModule as VestingModuleTemplate } from '../generated/templates' 8 | import { 9 | Token, 10 | Transaction, 11 | VestingModule, 12 | VestingStream, 13 | CreateVestingModuleEvent, 14 | CreateVestingStreamEvent, 15 | ReleaseVestingFundsEvent, 16 | ReceiveVestedFundsEvent, 17 | User, 18 | } from '../generated/schema' 19 | import { 20 | createJointId, 21 | createTransactionIfMissing, 22 | createUserIfMissing, 23 | getVestingModule, 24 | RECEIVE_PREFIX, 25 | } from './helpers' 26 | 27 | export const ZERO = BigInt.fromI32(0) 28 | 29 | export const CREATE_VESTING_MODULE_EVENT_PREFIX = 'cvme' 30 | export const CREATE_VESTING_STREAM_EVENT_PREFIX = 'cvse' 31 | export const RELEASE_VESTING_FUNDS_EVENT_PREFIX = 'rvfe' 32 | 33 | export function handleCreateVestingModule(event: CreateVestingModule): void { 34 | // Save module 35 | let vestingModuleId = event.params.vestingModule.toHexString() 36 | let blockNumber = event.block.number.toI32() 37 | let timestamp = event.block.timestamp 38 | 39 | // If a user already exists at this id, just return for now. Cannot have two 40 | // entities with the same id if they share an interface. Will handle this situation 41 | // in subgraph v2. 42 | let vestingUser = User.load(vestingModuleId) 43 | if (vestingUser) { 44 | log.warning( 45 | 'Trying to create a vesting module, but a user already exists: {}', 46 | [vestingModuleId], 47 | ) 48 | return 49 | } 50 | 51 | let beneficiary = event.params.beneficiary.toHexString() 52 | createUserIfMissing(beneficiary, blockNumber, timestamp) 53 | 54 | let vestingModule = new VestingModule(vestingModuleId) 55 | vestingModule.type = 'vesting' 56 | vestingModule.vestingPeriod = event.params.vestingPeriod 57 | vestingModule.beneficiary = beneficiary 58 | vestingModule.splitBeneficiary = beneficiary // Deprecated, keeping for legacy 59 | vestingModule.createdBlock = blockNumber 60 | vestingModule.latestBlock = blockNumber 61 | vestingModule.latestActivity = timestamp 62 | vestingModule.save() 63 | VestingModuleTemplate.create(event.params.vestingModule) 64 | 65 | // Save event 66 | let txHash = event.transaction.hash.toHexString() 67 | createTransactionIfMissing(txHash) 68 | let logIdx = event.logIndex 69 | 70 | let createVestingModuleEventId = createJointId([ 71 | CREATE_VESTING_MODULE_EVENT_PREFIX, 72 | txHash, 73 | logIdx.toString(), 74 | ]) 75 | let createVestingModuleEvent = new CreateVestingModuleEvent( 76 | createVestingModuleEventId, 77 | ) 78 | createVestingModuleEvent.timestamp = timestamp 79 | createVestingModuleEvent.transaction = txHash 80 | createVestingModuleEvent.logIndex = logIdx 81 | createVestingModuleEvent.account = vestingModuleId 82 | createVestingModuleEvent.save() 83 | } 84 | 85 | export function handleCreateVestingStream(event: CreateVestingStream): void { 86 | // Save stream 87 | let vestingModuleId = event.address.toHexString() 88 | 89 | let vestingModule = getVestingModule(vestingModuleId) 90 | if (!vestingModule) return 91 | 92 | if (event.block.number.toI32() > vestingModule.latestBlock) { 93 | vestingModule.latestBlock = event.block.number.toI32() 94 | vestingModule.latestActivity = event.block.timestamp 95 | vestingModule.save() 96 | } 97 | 98 | let streamId = event.params.id 99 | let tokenId = event.params.token.toHexString() 100 | let startTime = event.block.timestamp 101 | let totalAmount = event.params.amount 102 | 103 | let token = new Token(tokenId) 104 | token.save() 105 | 106 | let vestingStreamId = createJointId([vestingModuleId, streamId.toString()]) 107 | let vestingStream = new VestingStream(vestingStreamId) 108 | vestingStream.streamId = streamId 109 | vestingStream.token = tokenId 110 | vestingStream.totalAmount = totalAmount 111 | vestingStream.startTime = startTime 112 | vestingStream.account = vestingModuleId 113 | vestingStream.claimedAmount = ZERO 114 | vestingStream.save() 115 | 116 | // Save event 117 | let timestamp = event.block.timestamp 118 | let txHash = event.transaction.hash.toHexString() 119 | createTransactionIfMissing(txHash) 120 | let logIdx = event.logIndex 121 | 122 | let createVestingStreamEventId = createJointId([ 123 | CREATE_VESTING_STREAM_EVENT_PREFIX, 124 | txHash, 125 | logIdx.toString(), 126 | ]) 127 | let createVestingStreamEvent = new CreateVestingStreamEvent( 128 | createVestingStreamEventId, 129 | ) 130 | createVestingStreamEvent.timestamp = timestamp 131 | createVestingStreamEvent.transaction = txHash 132 | createVestingStreamEvent.account = vestingModuleId 133 | createVestingStreamEvent.logIndex = logIdx 134 | createVestingStreamEvent.token = tokenId 135 | createVestingStreamEvent.amount = totalAmount 136 | createVestingStreamEvent.save() 137 | } 138 | 139 | export function handleReleaseFromVestingStream( 140 | event: ReleaseFromVestingStream, 141 | ): void { 142 | // Update stream 143 | let vestingModuleId = event.address.toHexString() 144 | 145 | let vestingModule = getVestingModule(vestingModuleId) 146 | if (!vestingModule) return 147 | 148 | if (event.block.number.toI32() > vestingModule.latestBlock) { 149 | vestingModule.latestBlock = event.block.number.toI32() 150 | vestingModule.latestActivity = event.block.timestamp 151 | vestingModule.save() 152 | } 153 | 154 | let streamId = event.params.id.toString() 155 | let transferAmount = event.params.amount 156 | 157 | let vestingStreamId = createJointId([vestingModuleId, streamId]) 158 | // must exist 159 | let vestingStream = VestingStream.load(vestingStreamId) as VestingStream 160 | vestingStream.claimedAmount += transferAmount 161 | vestingStream.save() 162 | 163 | // Save event 164 | let timestamp = event.block.timestamp 165 | let txHash = event.transaction.hash.toHexString() 166 | createTransactionIfMissing(txHash) 167 | let logIdx = event.logIndex 168 | 169 | let releaseVestingFundsEventId = createJointId([ 170 | RELEASE_VESTING_FUNDS_EVENT_PREFIX, 171 | txHash, 172 | logIdx.toString(), 173 | ]) 174 | let releaseVestingFundsEvent = new ReleaseVestingFundsEvent( 175 | releaseVestingFundsEventId, 176 | ) 177 | releaseVestingFundsEvent.timestamp = timestamp 178 | releaseVestingFundsEvent.transaction = txHash 179 | releaseVestingFundsEvent.account = vestingModuleId 180 | releaseVestingFundsEvent.logIndex = logIdx 181 | releaseVestingFundsEvent.token = vestingStream.token 182 | releaseVestingFundsEvent.amount = transferAmount 183 | releaseVestingFundsEvent.save() 184 | 185 | let receiveVestedFundsEventId = createJointId([ 186 | RECEIVE_PREFIX, 187 | releaseVestingFundsEventId, 188 | vestingModule.beneficiary, 189 | ]) 190 | let receiveVestedFundsEvent = new ReceiveVestedFundsEvent( 191 | receiveVestedFundsEventId, 192 | ) 193 | receiveVestedFundsEvent.timestamp = timestamp 194 | receiveVestedFundsEvent.account = vestingModule.beneficiary 195 | receiveVestedFundsEvent.logIndex = logIdx 196 | receiveVestedFundsEvent.releaseVestingFundsEvent = releaseVestingFundsEventId 197 | receiveVestedFundsEvent.save() 198 | } 199 | -------------------------------------------------------------------------------- /src/waterfall.mapping.ts: -------------------------------------------------------------------------------- 1 | import { BigInt, log } from '@graphprotocol/graph-ts' 2 | import { CreateWaterfallModule } from '../generated/WaterfallModuleFactory/WaterfallModuleFactory' 3 | import { 4 | WaterfallFunds, 5 | RecoverNonWaterfallFunds, 6 | } from '../generated/templates/WaterfallModule/WaterfallModule' 7 | import { WaterfallModule as WaterfallModuleTemplate } from '../generated/templates' 8 | import { 9 | Token, 10 | User, 11 | WaterfallModule, 12 | WaterfallTranche, 13 | CreateWaterfallModuleEvent, 14 | WaterfallRecipientAddedEvent, 15 | WaterfallFundsEvent, 16 | ReceiveWaterfallFundsEvent, 17 | RecoverNonWaterfallFundsEvent, 18 | ReceiveNonWaterfallFundsEvent, 19 | } from '../generated/schema' 20 | import { 21 | ADDED_PREFIX, 22 | createJointId, 23 | createTransactionIfMissing, 24 | createUserIfMissing, 25 | getWaterfallModule, 26 | RECEIVE_PREFIX, 27 | updateDistributionAmount, 28 | updateWithdrawalAmount, 29 | } from './helpers' 30 | 31 | export const ZERO = BigInt.fromI32(0) 32 | 33 | const CREATE_WATERFALL_MODULE_EVENT_PREFIX = 'cwme' 34 | const WATERFALL_FUNDS_EVENT_PREFIX = 'wfe' 35 | const RECOVER_NON_WATERFALL_FUNDS_EVENT_PREFIX = 'rnwfe' 36 | 37 | export function handleCreateWaterfallModule( 38 | event: CreateWaterfallModule, 39 | ): void { 40 | // Save module 41 | let waterfallModuleId = event.params.waterfallModule.toHexString() 42 | 43 | // If a user already exists at this id, just return for now. Cannot have two 44 | // entities with the same id if they share an interface. Will handle this situation 45 | // in subgraph v2. 46 | let waterfallUser = User.load(waterfallModuleId) 47 | if (waterfallUser) { 48 | log.warning('Trying to create a waterfall, but a user already exists: {}', [ 49 | waterfallModuleId, 50 | ]) 51 | return 52 | } 53 | 54 | let blockNumber = event.block.number.toI32() 55 | let timestamp = event.block.timestamp 56 | let txHash = event.transaction.hash.toHexString() 57 | createTransactionIfMissing(txHash) 58 | let logIdx = event.logIndex 59 | 60 | let waterfallModule = new WaterfallModule(waterfallModuleId) 61 | 62 | let tokenId = event.params.token.toHexString() 63 | let token = new Token(tokenId) 64 | token.save() 65 | 66 | let nonWaterfallRecipientAccountId = event.params.nonWaterfallRecipient.toHexString() 67 | createUserIfMissing(nonWaterfallRecipientAccountId, blockNumber, timestamp) 68 | 69 | waterfallModule.type = 'waterfall' 70 | waterfallModule.token = tokenId 71 | waterfallModule.nonWaterfallRecipient = event.params.nonWaterfallRecipient // deprecated 72 | waterfallModule.nonWaterfallRecipientAccount = nonWaterfallRecipientAccountId 73 | waterfallModule.totalClaimedAmount = ZERO 74 | waterfallModule.createdBlock = blockNumber 75 | waterfallModule.latestBlock = blockNumber 76 | waterfallModule.latestActivity = timestamp 77 | 78 | let waterfallTrancheRecipients = event.params.recipients 79 | let waterfallTrancheThresholds = event.params.thresholds 80 | 81 | let previousThreshold = ZERO 82 | let i: i32 = 0 83 | for (; i < waterfallTrancheThresholds.length; i++) { 84 | let currentTrancheAmount = waterfallTrancheThresholds[i] - previousThreshold 85 | let accountId = waterfallTrancheRecipients[i].toHexString() 86 | createWaterfallTranche( 87 | waterfallModuleId, 88 | blockNumber, 89 | timestamp, 90 | accountId, 91 | i.toString(), 92 | previousThreshold, 93 | currentTrancheAmount, 94 | ) 95 | saveWaterfallRecipientAddedEvent(timestamp, txHash, logIdx, accountId) 96 | 97 | previousThreshold = waterfallTrancheThresholds[i] 98 | } 99 | 100 | // One more create call for the residual recipient 101 | let accountId = waterfallTrancheRecipients[i].toHexString() 102 | createWaterfallTranche( 103 | waterfallModuleId, 104 | blockNumber, 105 | timestamp, 106 | accountId, 107 | i.toString(), 108 | previousThreshold, 109 | ) 110 | saveWaterfallRecipientAddedEvent(timestamp, txHash, logIdx, accountId) 111 | 112 | waterfallModule.save() 113 | WaterfallModuleTemplate.create(event.params.waterfallModule) 114 | 115 | // Save event 116 | let createWaterfallModuleEventId = createJointId([ 117 | CREATE_WATERFALL_MODULE_EVENT_PREFIX, 118 | txHash, 119 | logIdx.toString(), 120 | ]) 121 | let createWaterfallModuleEvent = new CreateWaterfallModuleEvent( 122 | createWaterfallModuleEventId, 123 | ) 124 | createWaterfallModuleEvent.timestamp = timestamp 125 | createWaterfallModuleEvent.transaction = txHash 126 | createWaterfallModuleEvent.logIndex = logIdx 127 | createWaterfallModuleEvent.account = waterfallModuleId 128 | createWaterfallModuleEvent.save() 129 | } 130 | 131 | export function handleWaterfallFunds(event: WaterfallFunds): void { 132 | let waterfallModuleId = event.address.toHexString() 133 | 134 | let waterfallModule = getWaterfallModule(waterfallModuleId) 135 | if (!waterfallModule) return 136 | 137 | let timestamp = event.block.timestamp 138 | let txHash = event.transaction.hash.toHexString() 139 | createTransactionIfMissing(txHash) 140 | let logIdx = event.logIndex 141 | 142 | if (event.block.number.toI32() > waterfallModule.latestBlock) { 143 | waterfallModule.latestBlock = event.block.number.toI32() 144 | waterfallModule.latestActivity = event.block.timestamp 145 | } 146 | 147 | let payoutAmounts = event.params.payouts 148 | let remainingPayout = ZERO 149 | for (let i: i32 = 0; i < payoutAmounts.length; i++) { 150 | remainingPayout += payoutAmounts[i] 151 | } 152 | let totalPayout = remainingPayout 153 | waterfallModule.totalClaimedAmount += remainingPayout 154 | 155 | let i: i32 = 0 156 | while (remainingPayout > ZERO) { 157 | let waterfallTrancheId = createJointId([waterfallModuleId, i.toString()]) 158 | let waterfallTranche = WaterfallTranche.load( 159 | waterfallTrancheId, 160 | ) as WaterfallTranche 161 | i++ 162 | 163 | let oldRemainingPayout = remainingPayout 164 | remainingPayout = updateWaterfallTrancheAmount( 165 | waterfallTranche, 166 | remainingPayout, 167 | ) 168 | 169 | // Nothing to save if the remaining payout didn't change, just skipped a filled tranche 170 | if (!oldRemainingPayout.equals(remainingPayout)) { 171 | let recipientPayout = oldRemainingPayout.minus(remainingPayout) 172 | saveWaterfallRecipientReceivedFunds( 173 | timestamp, 174 | txHash, 175 | logIdx, 176 | waterfallModule.token, 177 | waterfallTranche.recipient, 178 | recipientPayout, 179 | waterfallModuleId, 180 | ) 181 | waterfallTranche.save() 182 | } 183 | } 184 | 185 | waterfallModule.save() 186 | 187 | updateDistributionAmount( 188 | waterfallModuleId, 189 | waterfallModule.token, 190 | totalPayout, 191 | ) 192 | 193 | // Save event 194 | let waterfallFundsEventId = createJointId([ 195 | WATERFALL_FUNDS_EVENT_PREFIX, 196 | txHash, 197 | logIdx.toString(), 198 | ]) 199 | let waterfallFundsEvent = new WaterfallFundsEvent(waterfallFundsEventId) 200 | waterfallFundsEvent.timestamp = timestamp 201 | waterfallFundsEvent.transaction = txHash 202 | waterfallFundsEvent.account = waterfallModuleId 203 | waterfallFundsEvent.logIndex = logIdx 204 | waterfallFundsEvent.amount = totalPayout 205 | waterfallFundsEvent.save() 206 | } 207 | 208 | export function handleRecoverNonWaterfallFunds( 209 | event: RecoverNonWaterfallFunds, 210 | ): void { 211 | let waterfallModuleId = event.address.toHexString() 212 | let waterfallModule = getWaterfallModule(waterfallModuleId) 213 | if (!waterfallModule) return 214 | 215 | // Update latest block 216 | if (event.block.number.toI32() > waterfallModule.latestBlock) { 217 | waterfallModule.latestBlock = event.block.number.toI32() 218 | waterfallModule.latestActivity = event.block.timestamp 219 | waterfallModule.save() 220 | } 221 | 222 | // Save events 223 | let timestamp = event.block.timestamp 224 | let txHash = event.transaction.hash.toHexString() 225 | createTransactionIfMissing(txHash) 226 | let logIdx = event.logIndex 227 | 228 | let tokenId = event.params.nonWaterfallToken.toHexString() 229 | let token = new Token(tokenId) 230 | token.save() 231 | 232 | let amount = event.params.amount 233 | 234 | updateDistributionAmount(waterfallModuleId, tokenId, amount) 235 | 236 | // Save events 237 | let recoverNonWaterfallFundsEventId = createJointId([ 238 | RECOVER_NON_WATERFALL_FUNDS_EVENT_PREFIX, 239 | txHash, 240 | logIdx.toString(), 241 | ]) 242 | let recoverNonWaterfallFundsEvent = new RecoverNonWaterfallFundsEvent( 243 | recoverNonWaterfallFundsEventId, 244 | ) 245 | recoverNonWaterfallFundsEvent.timestamp = timestamp 246 | recoverNonWaterfallFundsEvent.transaction = txHash 247 | recoverNonWaterfallFundsEvent.account = waterfallModuleId 248 | recoverNonWaterfallFundsEvent.logIndex = logIdx 249 | recoverNonWaterfallFundsEvent.amount = amount 250 | recoverNonWaterfallFundsEvent.nonWaterfallToken = tokenId 251 | recoverNonWaterfallFundsEvent.save() 252 | 253 | let accountId = event.params.recipient.toHexString() 254 | let receiveNonWaterfallFundsEventId = createJointId([ 255 | RECEIVE_PREFIX, 256 | recoverNonWaterfallFundsEventId, 257 | accountId, 258 | ]) 259 | let receiveNonWaterfallFundsEvent = new ReceiveNonWaterfallFundsEvent( 260 | receiveNonWaterfallFundsEventId, 261 | ) 262 | receiveNonWaterfallFundsEvent.timestamp = timestamp 263 | receiveNonWaterfallFundsEvent.account = accountId 264 | receiveNonWaterfallFundsEvent.logIndex = logIdx 265 | receiveNonWaterfallFundsEvent.recoverNonWaterfallFundsEvent = recoverNonWaterfallFundsEventId 266 | receiveNonWaterfallFundsEvent.save() 267 | 268 | updateWithdrawalAmount(waterfallModuleId, accountId, tokenId, amount) 269 | } 270 | 271 | function createWaterfallTranche( 272 | waterfallModuleId: string, 273 | blockNumber: i32, 274 | timestamp: BigInt, 275 | recipientAddress: string, 276 | tranchePosition: string, 277 | trancheStart: BigInt, 278 | trancheSize: BigInt | null = null, 279 | ): void { 280 | let waterfallTrancheId = createJointId([waterfallModuleId, tranchePosition]) 281 | let waterfallTranche = new WaterfallTranche(waterfallTrancheId) 282 | 283 | waterfallTranche.account = waterfallModuleId 284 | waterfallTranche.startAmount = trancheStart 285 | if (trancheSize) { 286 | waterfallTranche.size = trancheSize 287 | } 288 | waterfallTranche.claimedAmount = ZERO 289 | 290 | createUserIfMissing(recipientAddress, blockNumber, timestamp) 291 | waterfallTranche.recipient = recipientAddress 292 | 293 | waterfallTranche.save() 294 | } 295 | 296 | // returns the new remaining payout 297 | function updateWaterfallTrancheAmount( 298 | waterfallTranche: WaterfallTranche, 299 | remainingPayout: BigInt, 300 | ): BigInt { 301 | if (!waterfallTranche.size) { 302 | // It's the residual 303 | waterfallTranche.claimedAmount += remainingPayout 304 | return ZERO 305 | } 306 | 307 | // Need to cast to avoid compilation error with graph-ts. 308 | let trancheSize = waterfallTranche.size as BigInt 309 | 310 | if (trancheSize === waterfallTranche.claimedAmount) { 311 | // Tranche is already filled 312 | return remainingPayout 313 | } 314 | 315 | let trancheFundsRemaining = trancheSize - waterfallTranche.claimedAmount 316 | if (trancheFundsRemaining >= remainingPayout) { 317 | // The current tranche can take the rest of the payout 318 | waterfallTranche.claimedAmount += remainingPayout 319 | return ZERO 320 | } 321 | 322 | // Fill the current tranche and continue to the next one 323 | waterfallTranche.claimedAmount += trancheFundsRemaining 324 | return remainingPayout - trancheFundsRemaining 325 | } 326 | 327 | function saveWaterfallRecipientAddedEvent( 328 | timestamp: BigInt, 329 | txHash: string, 330 | logIdx: BigInt, 331 | accountId: string, 332 | ): void { 333 | let createWaterfallModuleEventId = createJointId([ 334 | CREATE_WATERFALL_MODULE_EVENT_PREFIX, 335 | txHash, 336 | logIdx.toString(), 337 | ]) 338 | 339 | let recipientAddedEventId = createJointId([ 340 | ADDED_PREFIX, 341 | createWaterfallModuleEventId, 342 | accountId, 343 | ]) 344 | let recipientAddedEvent = new WaterfallRecipientAddedEvent( 345 | recipientAddedEventId, 346 | ) 347 | recipientAddedEvent.timestamp = timestamp 348 | recipientAddedEvent.account = accountId 349 | recipientAddedEvent.logIndex = logIdx 350 | recipientAddedEvent.createWaterfallEvent = createWaterfallModuleEventId 351 | recipientAddedEvent.save() 352 | } 353 | 354 | function saveWaterfallRecipientReceivedFunds( 355 | timestamp: BigInt, 356 | txHash: string, 357 | logIdx: BigInt, 358 | tokenId: string, 359 | accountId: string, 360 | amount: BigInt, 361 | waterfallModuleId: string, 362 | ): void { 363 | updateWithdrawalAmount(waterfallModuleId, accountId, tokenId, amount) 364 | 365 | // Save event 366 | let waterfallFundsEventId = createJointId([ 367 | WATERFALL_FUNDS_EVENT_PREFIX, 368 | txHash, 369 | logIdx.toString(), 370 | ]) 371 | let receiveWaterfallFundsEventId = createJointId([ 372 | RECEIVE_PREFIX, 373 | waterfallFundsEventId, 374 | accountId, 375 | ]) 376 | let receiveWaterfallFundsEvent = new ReceiveWaterfallFundsEvent( 377 | receiveWaterfallFundsEventId, 378 | ) 379 | receiveWaterfallFundsEvent.timestamp = timestamp 380 | receiveWaterfallFundsEvent.account = accountId 381 | receiveWaterfallFundsEvent.logIndex = logIdx 382 | receiveWaterfallFundsEvent.amount = amount 383 | receiveWaterfallFundsEvent.waterfallFundsEvent = waterfallFundsEventId 384 | receiveWaterfallFundsEvent.save() 385 | } 386 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@graphprotocol/graph-ts/types/tsconfig.base.json", 3 | "include": ["src"] 4 | } 5 | --------------------------------------------------------------------------------