umbra-protocol
                                
                                 umbra-protocol copied to clipboard
                                
                                    umbra-protocol copied to clipboard
                            
                            
                            
                        Query StealthKeyChanged events from subgraph
This PR will query the Umbra subgraph for StealthKeyChanged events, in the act of acquiring the block number in which the user first registered, and for getting the user's registered StealthKeys associated with their registration address.
Should the subgraph query fail .. for whatever reason.. including the subgraph URL environment variable referencing an old-style subgraph that doesn't contain StealthKeyChanged events.. the app will "fall back" to the original approach of asking the StealthKeyRegistry contract for the information.
The new-style subgraph that contains the StealthKeyChanged events is contained in this PR on the Umbra subgraph repo.
This PR is in draft, and can be tested locally by setting the subgraph URL env vars for MAINNET or SEPOLIA to reference new (temporary) subgraph deployments on Alchemy, using the following definitions:
MAINNET_SUBGRAPH_URL=https://subgraph.satsuma-prod.com/johns-personal--909150/umbra-mainnet/version/v1.1.1/api
SEPOLIA_SUBGRAPH_URL=https://subgraph.satsuma-prod.com/johns-personal--909150/umbra-sepolia/version/v1.1.1/api
The javascript console logs will indicate if matching StealthKeyChanged events were found for the registration address, and additionally indicate if older StealthKeyChanged events were found for that address, as a diagnostic.
Note: This PR makes modification to UmbraJs files, and modifies the package.json file of the front-end to make use of those files. For production, a new version of UmbraJs would need to be released.
Deploy Preview for jolly-shaw-20fe62 ready!
| Name | Link | 
|---|---|
| Latest commit | 3a23a1a5d4c2ce8c77c1acfee8d4d42573c05496 | 
| Latest deploy log | https://app.netlify.com/sites/jolly-shaw-20fe62/deploys/66918017a7f05e00088c9359 | 
| Deploy Preview | https://deploy-preview-675--jolly-shaw-20fe62.netlify.app | 
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. | 
To edit notification comments on pull requests, go to your Netlify site configuration.
Coverage after merging stealthkey-events-from-subgraph into master will be
| 80.54% | 
|---|
Coverage Report
| File | Stmts | Branches | Funcs | Lines | Uncovered Lines | 
|---|---|---|---|---|---|
| contracts-periphery/src | |||||
| UmbraBatchSend.sol | 100% | 100% | 100% | 100% | |
| UniswapWithdrawHook.sol | 81.82% | 100% | 66.67% | 83.33% | 14 | 
| umbra-js/src | |||||
| ethers.ts | 76.27% | 100% | 61.11% | 100% | |
| types.ts | 50% | 100% | 0% | 100% | |
| umbra-js/src/classes | |||||
| KeyPair.ts | 98.65% | 96.49% | 100% | 100% | 31–32 | 
| RandomNumber.ts | 100% | 100% | 100% | 100% | |
| StealthKeyRegistry.ts | 100% | 100% | 100% | 100% | |
| TxHistoryProvider.ts | 77.55% | 76.47% | 66.67% | 79.31% | 11, 11, 19–20, 31, 38, 44, 53, 57, 8 | 
| Umbra.ts | 82.51% | 75% | 85% | 86.61% | 106, 136–137, 158, 230–232, 316–319, 381, 395, 402–404, 406–407, 410–411, 434, 437, 437, 437, 439, 439, 439, 439–440, 440, 440–442, 457, 457, 457–458, 462, 465, 485, 503–505, 592, 609, 622–623, 633–634, 647, 650–651, 681–682, 751, 755, 758–759, 765–767, 774, 774, 774–777, 808, 813–814, 814–815 | 
| umbra-js/src/typechain | |||||
| index.ts | 70.59% | 100% | 37.50% | 100% | |
| umbra-js/src/typechain/factories | |||||
| index.ts | 100% | 100% | 100% | 100% | |
| umbra-js/src/typechain/factories/@openzeppelin | |||||
| index.ts | 100% | 100% | 100% | 100% | |
| umbra-js/src/typechain/factories/@openzeppelin/contracts | |||||
| index.ts | 100% | 100% | 100% | 100% | |
| umbra-js/src/typechain/factories/@openzeppelin/contracts/access | |||||
| Ownable__factory.ts | 50% | 100% | 0% | 66.67% | 70, 76 | 
| index.ts | 50% | 100% | 0% | 100% | |
| umbra-js/src/typechain/factories/@openzeppelin/contracts/token | |||||
| index.ts | 100% | 100% | 100% | 100% | |
| umbra-js/src/typechain/factories/@openzeppelin/contracts/token/ERC20 | |||||
| ERC20__factory.ts | 29.03% | 0% | 12.50% | 47.06% | 310, 314, 314, 314–315, 317, 326, 326, 326, 333, 333, 333, 336, 339, 345 | 
| IERC20__factory.ts | 50% | 100% | 0% | 66.67% | 201, 204 | 
| index.ts | 50% | 100% | 0% | 100% | |
| umbra-js/src/typechain/factories/contracts | |||||
| IUmbraHookReceiver__factory.ts | 50% | 100% | 0% | 66.67% | 61, 67 | 
| MockHook__factory.ts | 22.58% | 0% | 0% | 41.18% | 107, 111, 111, 111–112, 114, 121, 121, 121, 126, 126, 126, 129, 132, 138, 144 | 
| StealthKeyRegistry__factory.ts | 22.58% | 0% | 0% | 41.18% | 202, 206, 206, 206–207, 209, 216, 216, 216, 221, 221, 221, 224, 227, 233, 239 | 
| TestToken__factory.ts | 64.52% | 66.67% | 50% | 70.59% | 329–330, 348, 351, 354, 360, 366 | 
| Umbra__factory.ts | 70.97% | 66.67% | 62.50% | 76.47% | 495–496, 525, 529, 532, 538 | 
| index.ts | 50% | 100% | 0% | 100% | |
| umbra-js/src/utils | |||||
| cns.ts | 50% | 33.33% | 50% | 55% | 33–36, 40, 40, 40, 40, 40–41, 44–46 | 
| constants.ts | 100% | 100% | 100% | 100% | |
| ens.ts | 36.11% | 25% | 33.33% | 40% | 25–27, 35, 56–57, 57, 57–58, 63–64, 66, 70, 70, 70, 70, 70–71, 75–77 | 
| utils.ts | 71.91% | 65.76% | 80% | 75.39% | 102, 102, 118–120, 122–124, 130, 148–149, 178, 199, 254, 258, 262, 268, 271, 282, 294–299, 301–308, 308, 308, 308, 308, 308, 308–309, 311, 333–334, 334, 334–335, 339–340, 347, 347, 347–349, 351, 367–369, 397, 417, 421, 424, 424–425, 425, 425–426, 426, 428, 432–433, 443, 447, 457, 460, 460, 460–462, 492, 494–495, 504, 504, 504–505, 507, 510, 519–520, 561, 578, 578, 578, 598, 627, 629, 634, 646, 646–647, 652, 654–655, 666–670, 676, 678, 68–69, 720–721, 721, 721–723, 723, 723, 734, 94, 977–978, 990–991 | 
| umbra-js/test | |||||
| testPrivateKeys.ts | 100% | 100% | 100% | 100% | |
| utils.ts | 100% | 100% | 100% | 100% | |
Coverage after merging stealthkey-events-from-subgraph into master will be
| 80.59% | 
|---|
Coverage Report
| File | Stmts | Branches | Funcs | Lines | Uncovered Lines | 
|---|---|---|---|---|---|
| contracts-periphery/src | |||||
| UmbraBatchSend.sol | 100% | 100% | 100% | 100% | |
| UniswapWithdrawHook.sol | 81.82% | 100% | 66.67% | 83.33% | 14 | 
| umbra-js/src | |||||
| ethers.ts | 76.27% | 100% | 61.11% | 100% | |
| types.ts | 50% | 100% | 0% | 100% | |
| umbra-js/src/classes | |||||
| KeyPair.ts | 98.65% | 96.49% | 100% | 100% | 31–32 | 
| RandomNumber.ts | 100% | 100% | 100% | 100% | |
| StealthKeyRegistry.ts | 100% | 100% | 100% | 100% | |
| TxHistoryProvider.ts | 77.55% | 76.47% | 66.67% | 79.31% | 11, 11, 19–20, 31, 38, 44, 53, 57, 8 | 
| Umbra.ts | 82.51% | 75% | 85% | 86.61% | 106, 136–137, 158, 230–232, 316–319, 381, 395, 402–404, 406–407, 410–411, 434, 437, 437, 437, 439, 439, 439, 439–440, 440, 440–442, 457, 457, 457–458, 462, 465, 485, 503–505, 592, 609, 622–623, 633–634, 647, 650–651, 681–682, 751, 755, 758–759, 765–767, 774, 774, 774–777, 808, 813–814, 814–815 | 
| umbra-js/src/typechain | |||||
| index.ts | 70.59% | 100% | 37.50% | 100% | |
| umbra-js/src/typechain/factories | |||||
| index.ts | 100% | 100% | 100% | 100% | |
| umbra-js/src/typechain/factories/@openzeppelin | |||||
| index.ts | 100% | 100% | 100% | 100% | |
| umbra-js/src/typechain/factories/@openzeppelin/contracts | |||||
| index.ts | 100% | 100% | 100% | 100% | |
| umbra-js/src/typechain/factories/@openzeppelin/contracts/access | |||||
| Ownable__factory.ts | 50% | 100% | 0% | 66.67% | 70, 76 | 
| index.ts | 50% | 100% | 0% | 100% | |
| umbra-js/src/typechain/factories/@openzeppelin/contracts/token | |||||
| index.ts | 100% | 100% | 100% | 100% | |
| umbra-js/src/typechain/factories/@openzeppelin/contracts/token/ERC20 | |||||
| ERC20__factory.ts | 29.03% | 0% | 12.50% | 47.06% | 310, 314, 314, 314–315, 317, 326, 326, 326, 333, 333, 333, 336, 339, 345 | 
| IERC20__factory.ts | 50% | 100% | 0% | 66.67% | 201, 204 | 
| index.ts | 50% | 100% | 0% | 100% | |
| umbra-js/src/typechain/factories/contracts | |||||
| IUmbraHookReceiver__factory.ts | 50% | 100% | 0% | 66.67% | 61, 67 | 
| MockHook__factory.ts | 22.58% | 0% | 0% | 41.18% | 107, 111, 111, 111–112, 114, 121, 121, 121, 126, 126, 126, 129, 132, 138, 144 | 
| StealthKeyRegistry__factory.ts | 22.58% | 0% | 0% | 41.18% | 202, 206, 206, 206–207, 209, 216, 216, 216, 221, 221, 221, 224, 227, 233, 239 | 
| TestToken__factory.ts | 64.52% | 66.67% | 50% | 70.59% | 329–330, 348, 351, 354, 360, 366 | 
| Umbra__factory.ts | 70.97% | 66.67% | 62.50% | 76.47% | 495–496, 525, 529, 532, 538 | 
| index.ts | 50% | 100% | 0% | 100% | |
| umbra-js/src/utils | |||||
| cns.ts | 50% | 33.33% | 50% | 55% | 33–36, 40, 40, 40, 40, 40–41, 44–46 | 
| constants.ts | 100% | 100% | 100% | 100% | |
| ens.ts | 36.11% | 25% | 33.33% | 40% | 25–27, 35, 56–57, 57, 57–58, 63–64, 66, 70, 70, 70, 70, 70–71, 75–77 | 
| utils.ts | 72.03% | 65.76% | 80% | 75.58% | 102, 102, 118–120, 122–124, 130, 148–149, 178, 199, 256, 259, 264, 268, 272, 282, 294–299, 301–308, 308, 308, 308, 308, 308, 308–309, 311, 334–335, 335, 335–336, 340–341, 351, 351, 351–353, 355, 371–373, 401, 421, 425, 428, 428–429, 429, 429–430, 430, 432, 436–437, 447, 451, 461, 464, 464, 464–466, 496, 498–499, 508, 508, 508–509, 511, 514, 523–524, 565, 582, 582, 582, 602, 631, 633, 638, 650, 650–651, 656, 658–659, 670–674, 68, 680, 682, 69, 724–725, 725, 725–727, 727, 727, 738, 94, 981–982, 994–995 | 
| umbra-js/test | |||||
| testPrivateKeys.ts | 100% | 100% | 100% | 100% | |
| utils.ts | 100% | 100% | 100% | 100% | |