From ae04716d96c3bed749e8c8d0d542b5dd789f2b66 Mon Sep 17 00:00:00 2001 From: Shane Earley Date: Fri, 3 Nov 2023 13:21:07 -0400 Subject: [PATCH] Use deployed contract fork in dev script --- README.md | 6 +- common/env/src/index.ts | 3 +- common/env/src/mock/validators.json | 2 +- contracts/ethereum/hardhat.config.ts | 27 +- contracts/ethereum/helpers/upkeep.ts | 6 +- contracts/ethereum/package.json | 3 +- contracts/ethereum/scripts/deploy.ts | 16 +- contracts/ethereum/scripts/dev.ts | 290 ++++------- contracts/ethereum/scripts/functions.ts | 0 .../ethereum/scripts}/test.ts | 43 +- contracts/ethereum/src/v1/CasimirUpkeep.sol | 18 +- .../ethereum/src/v1/dev/CasimirFactoryDev.sol | 143 ++++++ .../ethereum/src/v1/dev/CasimirUpkeepDev.sol | 18 +- .../v1/dev/interfaces/ICasimirFactoryDev.sol | 49 ++ .../v1/dev/interfaces/ICasimirUpkeepDev.sol | 14 +- .../src/v1/interfaces/ICasimirUpkeep.sol | 12 +- contracts/ethereum/test/fixtures/shared.ts | 8 +- package-lock.json | 473 +++++++++--------- package.json | 2 - scripts/ethereum/dev.ts | 57 --- scripts/root/dev.ts | 75 +-- services/functions/API-request-source.js | 27 +- 22 files changed, 665 insertions(+), 627 deletions(-) create mode 100644 contracts/ethereum/scripts/functions.ts rename {scripts/ethereum => contracts/ethereum/scripts}/test.ts (54%) mode change 100755 => 100644 create mode 100644 contracts/ethereum/src/v1/dev/CasimirFactoryDev.sol create mode 100644 contracts/ethereum/src/v1/dev/interfaces/ICasimirFactoryDev.sol delete mode 100644 scripts/ethereum/dev.ts diff --git a/README.md b/README.md index f07532af3..5b3dc434a 100644 --- a/README.md +++ b/README.md @@ -163,14 +163,14 @@ Test the Ethereum contracts. ```zsh # From the root directory -npm run test:ethereum +npm run test --workspace @casimir/ethereum ``` -Deploy the Ethereum contracts to local network and simulate events and oracle handling. +Fork the Ethereum contracts to local network and simulate events and oracle handling. ```zsh # From the root directory -npm run dev:ethereum +npm run dev --workspace @casimir/ethereum ``` See the [@casimir/ethereum README.md](contracts/ethereum/README.md) for detailed documentation. diff --git a/common/env/src/index.ts b/common/env/src/index.ts index b5eafcf17..8198e6d1d 100644 --- a/common/env/src/index.ts +++ b/common/env/src/index.ts @@ -57,7 +57,8 @@ enum ETHEREUM_WS_URL { enum HARDHAT_NETWORK_KEY { GOERLI = 'TESTNET', - HARDHAT = 'TESTNET' + HARDHAT = 'TESTNET', + LOCALHOST = 'TESTNET' } export { diff --git a/common/env/src/mock/validators.json b/common/env/src/mock/validators.json index ed31dfb3d..8eaa3e80a 100644 --- a/common/env/src/mock/validators.json +++ b/common/env/src/mock/validators.json @@ -1 +1 @@ -{"0x728474D29c2F81eb17a669a7582A2C17f1042b57":[{"depositDataRoot":"0x7eda82a4b262bb5c3c8a9391c725ab9b8b8cfee26a35706763a7d2bd23ab0ce6","publicKey":"0x80ae6c96b561a66233914bb65bccc4a4c859c5358180d984b2acde649bf182f538a101fdaee054cb6860e41592c11799","operatorIds":[208,209,210,211],"shares":"0x983fa91d154e58c504b27ec3d3ffa4ec79dacf7be965d662265d57a403aae76acc8c5db91a98908684f8b7ac0502b73215f30a3c9e252906be3054064770559872e5df504f9fe00e249c0fe37c0c40f9a4e96e71a4e7e59e4c83b2bc6d79bdca9490c98db3d3ce73a8351f54ed0286258b4782173890cd690e92b71335aaa4ef3134e12befbf91f32c9ac295aaa6be5bb0a267660db1434517822f54ced657a426b82c4dfe2590dbb50abfbc75b86466c3bf0a6d61a837d56012dc18e4f8db38b7c42e812c11a7e8fc812da68c4a46cabbcf5c52dba522b998907b9f64f699d1e80c1dd75672a467cfccbf1bacd10273866a0aececa5138b74a4b0dccdf16f398fb34abc8b6ae1331ef69aef6eefd413e4007cf259c174497fdd2338ca4b4537bd909f2f5684b038f56191c43d0353a8195983c09a6c4c082304bb2fdc50379fba220bfcb4b26132297167715efe3bc78f2fc0e1b4d685caa1185d0e3ff3ce94d492e854ac9f3654a6e8c2a0641ab0280b79da55a6b0601cb8e2895d9e276f46a070343b78a87ce5b82475dcf1c64b7fedd512732e53ea8bc209e85a559974621a193bbe228e0219a3ef42795675694fe7dd081bd1135d684060ab80c33269425e9b19c5241121f1d332d900c08b3ecb0f50d9b03c481f816e8d056119fe18e4c6d5c4de6b18dca3b82d86208d0ed855e3ecd54ceab1a088110560c692a2a297e4ea4fdf8d22f3df38176af25a9799219774ec7d8d6f65294e0e7145095862c5712efb336991685d9d80d160a41a6fef3cb97947c23aec0cc10a5b546ec09bf21c094ccaf70c892e98ffa1db8b92ad0f3ff32028f0ad88d6f86783f9e88b9ec88dd721a28fa09b49b37966cf535b4653e3a22b91c712eb37cd44b3725847a0f1a5e96547235afe3bb794ab650446d8291f0210d2cb88957fa04bc10f21cea96fad16ed1a081c7c65defbf3d94aed83965915d8751eb698157f019674f422f535ad6d27d684993f1cd2039d1bef158502ea1bea70ed31bf0ff6c292a45e80fd5b041e75572b256c8b295bc8e1bd371f3639b156472e1072589af3fd114f32ac354000a37212ae387847ddd68e2138044491ae9f3acc761dc28f726ab86f6a8b4221a2d8b2a17c21f6ebf4468e7809b2cf85bc2015f19f32a871d5bc3299220e43ee436d900fd7cd1122666e080e5f28643b9f040bd500f5515d8e5b4a8847e643345d527101f33079b9a27ba0b8530c6001670ad494e656262bf62ba2d0a7f1f855c4b1471c6770eb96830210cbbb1a2208ba9d8f68612bf06ec81d042585e85aed4450120f0217d819fab464bcc6395898dfaabc1dc3536080c4a1c56013247251de704d632cd67a11627d4e1ee5430f34ed3865586f222a9039bad50038ab1b32f2f9f969037dc2c198e40bbade93cf198f68b4abdf759583ce1bf7633675f8a9fa6124bec3d442bc698d090ea718c1fc183513635418190a1fc276da3007068db4e55f29d3e13f7d5e2055415d6c7aa6eb1cd331504d5358a289cbb539b11767289dc482ad47646c3685b0778cfd0c4d0f664ea0b358fb66be9de0bada6d70b2d3a2b78d454d5fb2395f1b93e2d746af5cf2a5f949cb5669984573f07fe3312c229587da5425270faf031998ee74d14f58f214bdd852f810e856687484643ce1c7a89093c60c2f99825ae70d8d6c488ebee62e5b8e72423ebdeb0cce88ba6b1b19e361927f73aa143c6e1d9c66ee6f41fed7bfc0032d263a27bbd265386edfc61bd5bb25c12c56195da876887e9af53dd3e122b9d5b7e9367ad719383bac8ef3e072ac77ad3b5719196c8015391a8a51bf91803b62161d994f0d351953016e","signature":"0xb97be5354cb8b020f4340117659dbc26c5023975d95f82bbed43d131f73a2ebceececf65acafdb6bd6aa061c23b13c331223fe7241a59eca0ee12d998bce3a472e418730d169c21a844f5ccbbc9fbe7ce4366a4f4a059e2d863eb758666fafa7","withdrawalCredentials":"0x010000000000000000000000eafb16b1f2f254ac67f86e14a05a99a5f57d1e79"},{"depositDataRoot":"0x7c36de098323fe543f0292d9b3b19f763a86ffa63aa79f4b9d7c15705bb72258","publicKey":"0x82373cedb7cf3f3fcfbb577b3a14409c0111df6418228aad92b1f147b3b8cf4acfef0bd4251784108bfa64ae25e11ef9","operatorIds":[208,209,210,211],"shares":"0xa61b530c4dd624a4f1100c2c97376c2936b23231a5d23c7721a01fc449469da519b6b4e61ec86071c7944738c376f0f502fa1570247a6fcd7b6d3f8823016006ae41645ae656ad1a4b88fd1fa6054a30d6cfc7779d5068224fb590269b6baddf969a0db82238381fd6f4bdbe8174d1b1c711850c6838b727e67178a0d7453684b5d5a810ddb105f97593a94fea68b355a55fc0cc3c689e07fe8eb2e70a98258c84c9d3346bef35110acba6241a13db9f7d17f0dbb486d457f3b08e353e0c16e48ae69d0ee286bae05fccdb3cef72394ea7dac441689dd791a9b043ead2916b816985684842f1b07b15df11d6b908c779a78fa8bdc96b4da30d20d3bc1ae479280d40ae878de12d2b9f743109aa7aa75a501518ceee2760bdbef0a21b50a9a59d88c4796a23d17542e1d6d4906ffba12ecf0633ac42493c5a7bcde4a257c526f3d4c3e46fd6f0f55eb556948c032c1505e7696aecea4760de0d2c2e7684e78952c9e9d3009c14795d8e17eda14f73d2da13adff479db223e04a8f3497a3f4bd42a3fb47e410d08fa331352aaebfc5854af81a14c4a7b4f1c904105a92fb72f9df2c6046a3ae3a7ce5c4e53a1412dbe9233189cc56f5f830a174ad0315ef3b2b9e57999608d181941641993c968c939808d1bb7aff768df2a6692a5ad028913bafc2e53c7068fc5a498a7e93a8809c9d366a8ec740cc1177462fbb28d9b47367dc78f12a5ee12d865afd99d9d150a262020c46b906be15082de868024ca427a22863ec86214d5f338a45f5169d8367f193228bd131e54090ac54e4b3752619e9384af63c09806b7550623d64583cd950b1d15c922225e29a2c8363dd5232890ef9ba263dc67d88a3e952062913c1d43aef1fee54896ebfc271c599a01ee722505558a9e19cc01972bde725c3f5112cfa334b20e8a706f645de9d24f48aea4f09aef378d90cd251a6e391c965f3ac50c4ce7a0dab91fc6bc2f066c3fde1851a21bb265b3c0e91ec198222740186bac771a88a062a6bfa61ede653296c2272d92763b701f956cfd8ffbf7624ccab798f591c3091ba46f38ddbfda5a3ce814d25c452de5b003e592e13ed209fca479a45da4a2d82fdc8f702bd31559730308dfff53a3596d366497b426b08a2b7f5b6d3adfa6b2a9e867ee92f300d39402f268cc712cd9fefe8b888378408b049cc881cf2babb5698447b9a203e6ad76520dd31372382f9721f4156394f0f1be88132a28ac372d19ed86177d20953c626e4e685f744b15ef6e1c6574780687c8fc482cad19ebc13e002e1a726648584376de1c154c1fbce094dc9a6ed2a9cea59c93a2fa7377a7be630dd82e90dc86c4ce2050156bcc78eeba919d35fe240fab4adde71ea5739799c7b7b825f9e457368576a4942e2196da61727849e49d52975d49b280d2ae00a5ebcfd9152f33e42a2fcc2a808a27896bfa735470c513c86b7c76dcbfb04d3eff82a24601e7cde41ffea7cf14d58d558c848a919652dd63e21f2226af8b72df578233a4bf523e22d9056106ad93e10759092a01cc8a70eb78e938eee78b1e9e1fafb1af761b6162a74c59798e5388e58e312c9b29e619ef44d57865b20cd45029c5281cb49d006745b4bed7af470d74925479a86a4fda53fb5b30cf7e8c59ee40f369bd1d3094372fdbe69bcd63326ce667bb657cb2bf073d4eb503250f0e3449e772d40df1fd4b58d30926dc0aa80d1c6d506b4e4cd11895c5b06a41f914c0499812319fcfde89dc81769a740cc7485e70d9d90a7b34ff0b335abeb1b3a5c1d4b57335c2aa5062d1adaf51627b9e86138d675328a4d2daf27cc8a4324e6c9fb9157d3f872057977fed03ffc0f01","signature":"0x8bce252246cc604211dce68b4dffe63cda9ec74627d728e9a431e8e65daea18635fc5bc22677e5afc56820d047f62c0517c9ed69a0bdee5e6810a6700f055471ca55af6ca99eee776677adb8b1ad3b358921801211960abcc4353f43f98eb11c","withdrawalCredentials":"0x01000000000000000000000037402b44cb3cd61ea28386f90d67eb017184e7ac"},{"depositDataRoot":"0x935764f263dbc004b386acf53a161758ea9bb21d2a31cda21d5b559d47c2ead7","publicKey":"0x83c1737e5762f69b2571dc34edddf409fcaf1797fd9fe8db5d76a2a54da4606b49a7fa46b8e922a780ad7af499ef4820","operatorIds":[208,209,210,211],"shares":"0x97e08ed174f49703126910459b24843e1bd380daa28ffc20517bdd4b47f67edca24b6494786f05a130e154b5e63ee405034a8210c1ba4570bf14c7b5c180645699d38151b9d60cb159b2258d8f6ff7a057f1a5626a3df0f6cd8723bb94e2ac078ad3cdc209c4a71daf21c3e91e0fea3cba5c6003d129233686e6342c175f18acd72eef2744cab4f9cecc9cb7b69b5cf1a8d31ec022d18489029d35e55fa72e98696489b6bc3065c04b0a3740a37e7a97be79c3174c87bbfb2ad26970cd93aa8990cc523372ab279c6df2ac76e0e4cb115d0d5ec7747dbabbe06957baa08b4f65a9a9c86df2ce8f942fb87d547108c7cfb8b65b570aae39251750ec155dbba4197e268661c330421517ea955d956e1ea6566b9af9993875728a6eb9a117c48be94799dfdc46e5d2ea459ff2f87f18822e39e970a199b5b6457f17efb6365ef738f1ef157abbf8b3ea2cab1e7f236b3492bf06a34132960ba344eedd7a68a2fdd6048edf19e4793316e1bf6579bf3b8d0ff69f343ab5b29ea3faf40c93a54881de826a248e18955bbd3c189d00482a7fbf858451f6d5e431cec7d4929b6ccdcc1dffa815225271bc1819b77e65cbf91a5d7056fef1f62e8af285f7b8352fc1649ad5ce92748bd8ba1c937405944309572776f79d6955f81997d1b15b3acb7ebd3b8899a1c603cc98877e28827b69caa075313623011d1bba44e3953763b998feab9949e3a08c1b81093fb017714fe36fce7659ee50a0a61821988be24331c256a1913e0e2bd70c4cc219e99cb01f360dc5f59126674bef6bd46e404a845cc5f556f2d66b8928a1089b645d13900c7752f149ff6e043346b9641f299150c0c2fbdb7273d1f29071e0721c3870a6a77a35b6c6de2e1ce60903cf40e5684cf0eb52fdae731e07d8c861a52cb0d5f6580bc7e2452c6dfb77a7354903e6a762a10a50a75e66f35c252b195dd96355a3f2fe98411520e116fe30e7afd668e25c2054fc57750b11e8cab1a56731c589a153d71c520ae1b3bed459f6d68ebf6c5cf9af90a658e762f80d5a933f7b45b71b5cb044f3a2d14fb66418b7716e3ceff20fdb5d758d8c7917dfe0803266454eb6e263005f2f4fea9120791bad8a31555a9fc577f7a049d14d14c317049cffcfc056e54ea35e3d9d2a50f827c609a60f48867b9fb6ebf7324f48fdac072e6e4cb73b7770d44a25bf37818de3f81c302cd434b445d0a83059d78e4564b31c982d47193127537bd334ef44f1605d202a4ebf771a7b2fe65d610aad682371409fd736d645bbd2e8aab8f64686120bb016345ecc2d6ae602a07ca778b7baee7e14383130c8ccb33b077cf1fef1268134ba39ffba3712bf7ba7cf618f790feb7139420698cc94cf929186a30d1f2b851b69948cd348a73894c9e6a779fcfa59e08cc468146d1dc652e394efa99f39aef6ed39d0f2675d98a3c59881934823af7ddc3d95a85dad6dfba047315271bcd8736d83309b7e021985f1939cc368e947306d26d914fecf2556fde46ada54f74663bab17d4225ccb31b126c00c5972d4b8d4e21eea8955beea41c515439714a3865d3dc880ba9b73be80f18d5dc0672b41f1016bb5cba7ac3b8b31ee74e2d8621abe7a558a3c0466a0e5c9c0165255340bddda620248cfa7acecdc7e220de1a456a16c073002979f30a0e76751af3aff2cc9e3e2fe4cd8ee05b2f59348757be94566700c1c51b5a1cbc350d841bec9cf282824856da27d201e6ad3c7bd07ab4c09b34aa2de3581d7c38f57945ce1301d30b45547a74210c0edb3dfff8efa4d5db7c199554f924b38b7e3c9fed2ab884873b38468839e345b939766c2342b610f9b99d9228dc973a5d","signature":"0xb423cb734f5c2c68c77e3499281df5c53c3c091ad2ca38823862a8c6180ab16b50a420885598199536c8bbf3c4b0f1ab0ec495900d3938f3236d4178a9204893fb1e2549cf8d2c21657c353451f7425fdf83a8be6b1dd1f43283f32762436068","withdrawalCredentials":"0x010000000000000000000000e48026efb984fd95bcbb26824f669942d4d4b178"},{"depositDataRoot":"0x2780e25f9443daee17df1ba70a97f5cc023f8ab18b21a8eeeb893f52b2572d82","publicKey":"0x8f91c785d16c57d16f6f282bd06bcd793dc91ea0c3d97beea322eb58e00a9954862ccdf695d9f6aab99cdd0f6e5afdfd","operatorIds":[208,209,210,211],"shares":"0x819b6aa9402339265ef17f43667310016d9e8a0cfd60bd4b271b227733de6d2e98bdb576a4d32295fc643af255e5e064081172b5b18186c795eb4dfde9fffc2cbbbc2029cafdb30976aa3bf3c87003a7771f9f08c5244243e8e0b90efc87ae25a9251049242744c040ff0b61d338649b800291dbdcaebc9ef617aee4a97ce3078a633d997d7d3575f5599c2f724e9f198563e082a98d1a972e98e8785beabe7615dc3442541270dd7d21f1ff46fd4c429a788698af4ccc862758aa44912d68458b71461145bc782ee3bca289608347b67132f5e3a5d5aca465fe5244f120aaaddacc744eab39efcaaa2655cbea1b3d8f81fae2dd8ec7f088b700d4cdb68ff18ab13d58a245309c34db29ad5038a6d46d89fdb2b9c9e496f76bef2a9e14e20f26731479a02ba5f09c18c0cda8af907e25846fdc1133c4932b8f994cf8d244754c3485ca43572307486f8cfc2ad167e12c704673ec8989c0fed6c94e1333774a0dc37c015f27e30153f9110488c9b57d2a5a0f103059b0ec70c5150fe3fe3ab5583795b5b5a4ec2148e9a0e67f50ad9c5bedfe1ea5757d144504bb391e891f6d78b6d6e28578c2a67a0daf5d63042773ce6923d1a085ad5e4e30dccca13745181bfd9c31b0c41a8086b5f9c699259c0e8c3b0af61f64d2dbe34bb3fd55384dfa470c6edcc89e48fff2f16267eee136f9730591e0a5e59ba6c3bb059eba05797161e9753dd95acc13d20def1acb0b62d0728880c13c14c8f7b81114cc538914c59e3476043f1e8cc1aabee8131a607abc8386928e7e3a5cab2d634252de8ef239a6a185f624e678d276571e190816fd86fd09fd35b646432109aa4f795735abf461eaedaa8e45c74573637bb50f69218aa633b68e71a1a9122bb7a956e85fd7cefc74b55c79ff493440e3a4967743c035fc4bcd58a47566966e5753754a426751cd746b1d796d32a051270160ecc09623b135eb27de40b5093b4ea81568597241e962849e60a3e69ca744fbbccd59b16cd6ee98a08ff189c20b7265cf4afb1bb6aef9dbbde41ac8cbd6eb911c4a64c457995d8344b3fb883f2a9c789afb8f854ba608e9836d05cdd2085d07d28ec6dfcbb1c3264661be4be5d37550d643a47e1e469e8e8fa70b9103c4715e5aa457846b626474620f6d1b2dcd3ce06e91080e27972a2b93027086ce2cd84cdd62cf56294eb3b33619537108d1646d9debb0e59fc51d6ee1bbf5718fc1af650d5d0f23315bf53517c70cf6d8c715e32828f3227e5d4928accf23450277197edbebd42697204a224f5a68fce6d5b284012c96052aa2768e2874a662f2b456a1279e2f3f27bc9c250bc09a0013305a62e2dda0e65353de0cccfa5f5d693e59cae7117bd9e1d9a8669afaa25bf03f88bd90e1331e9e55ab4ceed4fe82a3ab3187a07a5e8cdf2d48e0ce00fa9fea5f2a3283f4c69d4965896db8c5b865e472136e9d15025fa3fa5a796658832a3b394720384a09e4062ba2f9243550cac161c23374f7384d5a74d95e5e1b07df027fafe0ce6f23899f29821a505602886365ebf9a7116e5205d7fd8da235da9cd2fca7ad6c15f4c52dd2e4945efd0a11bb037812dd5957ab7ff7bb0d43272f2bcdda1eecc3958439dcede2aa8d2e94beca55c753251ccbdb059f414a564be95c9142656116fb00a6575fb18ffe37d8854b2410a51bc28be41e955de92c784d71fa4c614b443958ff8166f9079c84d792c4f044a006a346f9f763b37cc786574bada7eb923a00db93d008bcb8ed721c328cf386624dbd09be6b966cc9995e864d8e0b4446867eb4174ea01cb52b77fe5b2690deea5fab842ad6cfcc0f6c869f9241d35b061c6743b693d7","signature":"0xab1cd4e979dabc65cd299a77078d4573b3bc12f7d8b735d9af2bbb6a443cbe709d1bb6bd3098d416b92d986821cd596507a8da394131b43e13f1862f0fff3567879160ec2ae341b47a37c0f2e3f52e0ff7144afddb97058ca8c2a6c5145d64b4","withdrawalCredentials":"0x0100000000000000000000009fd19b9cc28104ece4a2db593601ff95afec160e"}]} \ No newline at end of file +{"0x728474D29c2F81eb17a669a7582A2C17f1042b57":[{"depositDataRoot":"0xfde8f933f30035970f82a822b3dcea3e35d2258603a74dc0ea688b779e3315dd","publicKey":"0xa983956ba0220cd93b1a0786add8407fd772fb8a317b69f1a8863364db9379b9a1eabd0b3eb80170b25c35b348bf645b","operatorIds":[208,209,210,211],"shares":"0x83ee3fa81ab826b782f7644e564c1f36582c7e80855926e390f3be9fcb55adbdf2e4573824f84850438e6e5c308a9be606b629df68cbb849b4ca329b6994626327af00a804af4ca4897215ba41e948a455b92feceeb327ad8e35f5d23ca7c647b727f1d866de8e3cabd9091cc0d645dd80b371f41062dc43ca09daa9f4921995eaf502add9f9e1fafd5489799acbf33da03f326e61dc707019e44f54c199cb08a40810be6da6a89360065433c0ea6d631d0ac95fa92b4dea2c68757e3bebf72bac797b1f567e488a715487a865b481c4c2295267f57cba84f117ac85fc15576d1c136e49c6bb9bba92bb0c18f5eb69fab9491fdc0929d0f82ae99cc4b2b712056098f468901cf26915750ef164ab4c5b78f6006d33b7d0b34ee9b725f743594ea321b514bc30b66690c755bda6fd74717b6ae1568f1e16fb3f4482f1699facb093a92839e8aeaf61c58dbd51024757c8f8e379bc96efca2bd466b5a679ba1a259c11836684b6ab96f9fb1dae236563032e5ef142c31e2151d0c5f3d4266622b3db7145762403db842e80de63164f979f7aa9c219441883eb2f504c57750937931d2568f7407eac080a91372ed279ce2777f06ad6e2192ea9714b7261de0347d5eb31f53cc243ddde1a8e8e941ee8221204a940ac4de4cb950ead5e2f10a85b4bbf43992c86e5f2b0ec0353b4bb9d000fba25d54680affa39afd238213faa1d5879163b2995d654638715ffdc63730fc197b5cee4dbef3f24f2d70e5446587da44a5200747b5c129d45ec0536ebd6bc5df884e5427ac93827c877909bac480b44b511761c23d1f0377d5dd21f1473a06d84f6b2729421efa7da4edd4149f81a1adfc6009726c8d3c328795dde3c038a2b2b4b26266f52a82c44eba677e10bebe3898e070bf759fc8026cb3f060c92ec70c8de7ac6db0b82a9e3850240f3eee19a3d2a6f55c583c589325d5f9f328fa08853dfcb6ec87f6e5d599df3b936a3f40b979c2b69f8410660b44914a6e04a5e2876116d63e5d6d971b287536762b1380cd3718ab9a49ffe03773e6f789d7302d3803eaf5f309af7fe902448d89b4a6d03a71a9c8bd1ebfe1185be1850a2a13ab6aaccc6bf6fe8f403bab6f338a53d453b720019590022c7bbd085bf08321b3d05130f65f536c95a29851c4f538dc40a3f0b46061783bccaae5beda61fbad576b9f52a906220d25c97a32f1e092b569256520519badb6825673c88501cd1394b0ae4a83a8521eb8617d307cd8f9008e36c364d5fe44ccd3676793b9ce1b1277a55ead908aeae67099c2f258cd49b70456b896c3ed95c9978527935d775d89f37c2e44d1e752026469a27c1d4a0033f8d19b1a7e01bebd319f00f03ec13c43ea5deef687aa22edd1c306e9a785b364d33fa6c5c20f39b4ab556f29e64ab568a83a8f967aafccd46f0adffc24c22d4c1591b3ba4567c251d93c386948656b68526e0cfd729411eb1da68b205958c5ef6904d886dd80bd5764b621a9840566dad150a63dcf5178634f6e97fb394d1889284758d365870baa206535f52813524508d617b49e2fc967fa5ef359fc50c5fb593a1fa91a9bd63eea3c269217c19ec459be4f61caa5d7eb99c386bb87cdb9e422085bcea50999b09ac6d18f302a41725c2519ed35101beda3dc01d35a4ca4e4feac7a32d43e94e78696df8299f767021150e6e7f882cc135a11e537ac8eb926a2b88e6f30e9bffde7decd853f56389d4dff33c0849ef9065a84b0c69a71677cf2438321a44c2e356115c18ed7ffc1b9c3a35dcbf1515983973d99c61174cf7ac639e743fbaeafc9be258566f50b10fa9c6351868c2999f414a868582bfec29ab25f3","signature":"0x8e18b9489cd59cdd9745763c00ed23bd557d298e70588040a8c67789642be1c20de10cd04a77d58f1e0df1c036a16191169b3aecc601d61ddf6329b0766ed3d02d46005f7a5760932929d3dc9807c0628d97911888cd019e449410ac79c39be4","withdrawalCredentials":"0x01000000000000000000000095591055f06a1b7a2186482118cebca5b24bc5cf"},{"depositDataRoot":"0x7771af0578a9b05eb2b2b9fbae27e39d0c4cf6ca96b26b5e1742cf450bd4d218","publicKey":"0xa8ce0a783d5a7f72ce5cebe6e5381b7c4159c13c85a8c93e030175181364a29d7d007ba4d8d6a07ef6c308488ee1b9f6","operatorIds":[208,209,210,211],"shares":"0x9310a42a72a6e822c30f2bc963526e82dbc6db82385aff0a8a5f99566fdf1fb21bcee293a29b1ce9a5d2ee4b7b6480b0012af34f1a11cef5a834cd7ee5b9012d9a80de0900adb9e3844379b45e0932cf5d9c06fe1eee0ed348d13bfb2fe86270a0c9e6165624e6d8831c627273f8aee2fbd1d5d911f0e0eb12b136c4d92b78d84e32c536503e6a236b2d9ae7ffad149d85d9e5f51529935e6fdb8d921672da78448d29a801cd33c42a208d5607a7f64abc3813d1deb57160a1f2d3ddca0dc5b7b1ca3664ce08f013686cdc212affeebf821a383952e5fff1ff1e1fb204bcf39197f8305eb685203258f6834a1919ef8dacd0f123b2f753f48afe296aa5f3c0e77b437af8e7d64ce1a2c871eb43a85e781634f1ae2d5311e4bd960df7b83f60cead25a6d0796b7a5bf0a239741163ca3a327fe62335201731c46ea5799aa8505c3217a1eb0720c0bd2a6a4a7e1423d1fa7b52e037d905ac59fe1104d09d4801cf2b4cb4628c5008003fd981de10b4bed2e3ec0f5d7e609147195237e5dcd4d6cbe0a277e8de2c6dbb3a373f97c3445e8f6c648a07c36dc82dfc10da9e0e26703672a1b7ca0169eb396a62014ad2543a868941eac12786810d072f0612f89a9cb4f6c392fd6542e144ac8ef4ea2364d51e5ef940de2806aeddf8ee53766ef4c1f6160594a63b301179541522abb31f0079375bdc34a244c8657a3955cce5748c494949c9c8dab996b002be97024057c214aed5708ee2bae41aca29fd4c9de7edb50e77e7ee75697d7436c6b5f8e78bac6f5e2466f3e4d774222769bfa14de50aa382b9f6b4e3ce78a2545883f3c996939c2ec9613d9c16c9e99711d3dd52893810dcd414af6ae640c3caaed9793f87323afead2f11d8c0450ca472610d7e07af19f5ce720f576c53f46feed63829e22e4720befdbba8da6641aa40484778569c49f0349675a42dcd188c7f50c353224070c57085218cba64e224a78aaab45f92e3c026ede5b4cea047027d3d26aadf5016f775d5797a3017098525a5b7b9aeabda80e0660bfc4db904ee5ff114f7e4710245bf75e3d14bca8f208075eec4b969f799b046d9bd74d05ed711f4684d8939ad0433d4db1f822fae40c285f6c5b82ba4062f98117069f29d89cc498dc5e2f4478be90670e0b077ab7e366681790e62bc05d1ebcd0061c0d41f0f59c0164c074ea93b3f8405854e6bdc3cbd7f09b595e2df4efb46dba367c916cdb39b5aec2bccf7891d91d29ff9034e08d07f19a56fc37d291f850bfc26c8ed9cbf02a652455b62012cc7d1b909d7c78dbe3419caac146a309afbb2f5b36fb1f5614ee83edeb2dc2d2ad75b5c857d3fabe06e6e31676b1002f22eae52d2f4c8b3171f99f1c12c48def43159d96dc3073efe6f4cbdaed2ccab2917468fbc80efe1ba0a873892ac06f94583850ba0d020d534264c40f5082b0738629f081cadb15b53b08db908031d48029187b3c1cf644e2a340ff58ff79177f291e01e179642b3c9dd4ea56c4ad58cb23fa0f9178e9ed68b2fcda06641b2c4ab6d7c10adf03d0a43750a50376feb57599444f1d7a2ca3820b5af4643b883a9bd507f1c26387ba41e932d9d8d600b1ef6c14f5ffd4ca291329e867dec7316a7f66c2536b6065d96d942094754ef9b6fca46d0fcdd93bf2ee4ac4e2eb6efe0001f51fac1dd1db7e7257114ef0c68979ec50ed05f692caa783007fe848550a86014a8f1324c1cc312011fa14dc12456c4d5018e36be89fd1f9c3a5db425e35f470b1d641b3f5ec477c7b3955a1417af9328ec6773a9df9259c9e110329bf1d71c616516e6dc63f45b33a20ffc62e414201cba45fa0f286eaec7d752bb2935","signature":"0x93be2ca6f455ddab1b77a3f22ded1dfdf05c7b819159f46d7721f5109c2fb311123e74673f339349e31cdafd306a9db503cd698c3c3f9969343d0371f0c9941aa9e378a7277b8a4199a66315e86be0f4829e85c21c1a858aa0bae98dddef3b66","withdrawalCredentials":"0x0100000000000000000000000363c74c5c8feb4e716389b5d213c39508a7dde5"},{"depositDataRoot":"0x794bbbd87ea6d4f13b0ed703f4e6bc948c772b0a1c045b0c9d9034a17b27f88f","publicKey":"0xa23b9086eede27f60db3801a8a00ea3ddd1eeebb00e9e8a4d97b15e629d69c6ba1ceb2cb8426d4f4bb238b6ab1cccc10","operatorIds":[208,209,210,211],"shares":"0x93a870990c8d251b237018bc56dc0d17067b2a51d7eaeccf8f90588aaf5be3b60c928bdbfafe7ce32e6915097a57f00e01384e25ca527cf2164eaaa81851367c0d86a8c9aac7bc2dc75ba8622e79889a0a88d14e58698bb08f3909cd6d732c34ac1ea7e850f0efc25c8c1cafbafd8524f91eb2626bf6bf40c154764505180082972c29ecacae2a4688bfd18aba97322e88a3852735acdbb529bf5b47ff8c53fdb9aeeb34e6cc4af4f966a621ee806abddfa43a54925592ae7525393abc2b61c8a641c838d99e201b5a5b2b2833febad8d8c70cf19fd5eeee38f4869386a3f273456af00826fbbeb51c7012fd7a1c9e69825a25e32d4e3f19bcfc2badf3aeaa79137ed633aaf7deb2e8e1abb01d992f599e1004396a7f2bdf34c4750fc6e0602f561e7a522e4ef8021e143cd83c00bcb2ca119e6f94aa02189cc5cc231543cbc92e63d8785e4292976e079c4cc3bbdb1998ff0b9565bd9f934855da48c398a210a8e7cf5675048a5f1c7cde283f5199f690a3e3e375b08ab3cbacbe63e0240a2f856af531e78368d1331ef32344653c9185a4a7e2d1575c18083b6699f879f86f98bc2a066387e601d6507647e3ca8fd527b73fb605386f30ea9d156983646a21f7f0cafdd302e5ee976daed7bde089622f3057e70ae4450f62af51c1c1aa1919ccf296a221105518abc9a25c369c8372cd63a2570130e257e68efcdff3777589aa1cec35be2490176601f2443a42344663736dbe46e07b742d0c163155cde8f641c9893a4d28f1e7223d251d5a75a2254b40cc28660cc8e2c953b20c47590ea022c4abcdfe4f4a981d474e1bcca640e239144bd9c5fe641c71fcf8c2594f5944feff0b0b1aaf28f7f79be23850ca837f0ab084c046a39814549de4fbf4b4eb97a27dc4fffee14f56af8074002be6813145a42403504d77815836fed2a8c6920197cedecd8d9d6446c97f973c7bbe80d9e0f85d98f549158cfc49b8c11a0e4c2344141b9a78ed570ba35dea0efe6529b19c2f948dee0395aa1f114c3b87b4c8da318256d158a4aeb853157827d13a21fde87a284034a08e55e3ce1a714cb7ebee14f5fa86f020c36c8d1b3e34cf3daf6caffc8176f3e18a27c68345ce79105e008a910478c54015dd7e6e6c814f58b27bc7b29b73781f2f79b549b53ad4094044fe99b3c11efc979461643e71185729bd586443a5e630d8157de46450c957c2f2b21f4e331a76c51fcdb46181860f5715b5c569d60dc188a5998329ad2dbef2e828cfdd0a4e1fc7dff1a72474dc3654706cfc3798dc1ff881f09dd9741995d51b57f31912405c67e8e74f98196e03e687b23fe2fe4adecd208bb34a76cd7eed1acf3d0a9667df307447b317196586e412f558f24906b8adef468cef00c8eb6b39e3e432ddb82da4330e7ba37fc0885125e9c5c78302e7f973b52cdb69b74f62b4b42913eca89affb71918248ce9f74ba0f1f87c11c4c5b8bddb89203c6514b0a912df247408a6094dc21b4143e099eeefda7d922279175aa585b2057d1fa948166a57608044437c5ea64e4c3ae3baba9c513a345fffbfcebcc47ef1053f7e90c1d46d64fbe8655e35c54364e4ca6bdab358bcb8dd5da3e8379e1cff7ae9c4e1bdb9ef3bd28f120e1b8e3f28563d7fa79494be7de51086390da37c1b72517fc2de0d865b25d47fe7b36a0314a1579ea09fc1e755a5eb6e5fee5ceea79e96cf83abb1212db5e22ec3a0afb9fcbcb2e7e3663ce3367d6f8de4190d109f32d6c3e902af20c315ab3dddac50da73861c4a3af80f97ed823e51d38dfffca3653035960ae9719db98c8aa3e01cd4a5fa3aa477833ef1d0f438286f4d95a6b2445f277006","signature":"0x86492c4a9f599e89eba1e7c11127d71513939044527ab11d366021b3858cca8ba8c4a36866b985f30ac259a407b91d931776b8540d9503af86fe68d5e55601f9e2114f5b64ede36bcb9d0854a09d09eb91dac2868c34c655610ca2f20f1108db","withdrawalCredentials":"0x010000000000000000000000fc3a50f089f9fbe77528c7a183878de4392d869c"},{"depositDataRoot":"0xe2dfa4d889021338471c82e795459987fcbedeb7692a46f10ea4f751a5b17040","publicKey":"0x8687ff9d5c22e616d250bc7a1439c74129596d1b2bc4978623bf5a183b1fe7a95dd03ad56f33a6ff42ddb70d730580ad","operatorIds":[208,209,210,211],"shares":"0xaade4e0502a4d8d8a88afccc3edd2548e3bf79b2d28a23711f17956ef6407d221bd0545c0cb402b1248fb4d9ff790d70191c10bdbc12f360bd28521950e7219e9a1c4161040bbae6da3faa58849d179a4c5ac758a4618fb720268b309859709297e31cc615368919601fa5bd9a5410b34cc86a57accee2080bfb1f361a912ae3dfea81f430cba23ebfcd95bc028057d08a871de3b9b6346b7ac997321e3c02b1cb5ed1bf9d726c813f1c1370a8651912e559b9e8b228f18ab3b9bc7bbb42f5e983895e7b101bfd9f5c636bee76260c8d9add1cc29a51bb6f7fdd6d31ce298a06a29473ca558b3dcaeb37fc0d84617ac18f085e5ae62bee31a08aad086a63fc05d78531a799bfee88c90d65742e7373d7956bfa53272c8fc5e068ba337544d92f3e05a14c0d6d9407e783b3daba8890398a73a94b3b5045297e021e37239e7a24134226315b5fc6ed83536962eedc333caa993491d98d80a0dd0f2b78c27250d53650be4bc7e2ab36b425b4d1d122f69fb09efe0f95584b00b5eb717aea08a4b71999e239c3e5505091e09fb9ef175e550c1698d89161d411e04e3c2a17caac3f2719244d1f4d953b17e829d46d93f3f368b245911df6f13998e770a1062fb805e55ddea971a0229b8a884b9c2cc8b46216c9d558517190a89e1e78c1bbe8e9517099314b87ca9f0814e02cc5218ed13d14c231db1c8352538b92fa119706bedb16b01eb46a028efa5ad63342ce3d826f092fc54fe6d4ee73a688c834d402ace972041022bfe4bfaa814846721b49ae3bc3054d0b03f108691961d4cc125adf5e000dac0a1d9c4c95ff71a90a3428c43699ae6ee567db881c3b0bda0c07804b5f82be247e6435036c00f253d7e091a9c4ed8679bfbe69e6db1fcf75b00171d8f801b5571bdedf5fecbeec1a6c37b5ea233975f16f4daffdf2eece6d5fdef48f3918fc9a1b772cf704abc22cffb1026ee1dd71a8a6a12172d52f7aa37ffe664b6d88db2e1c25cb911d1c22623805f776b06fc0455d8e4ea6fd46602a54ee67dece5c9f2a4df85ca88eedc63c7a544607cdd59c3d7314a2aa54bf3beb7c2b9c206eed94338d92a15302fc0f4d6962fbea6015a92765dc42ef62250b4596e855bd6341afd686636dc2f5249b721dd946869e00b6d11716f175668d20702a01141d79edd890ceb167f1b5e4d0f19fe1b37bbdebfe6e597e97a8c5f914a0befc95940fa9b601133a41a87da81e6a5a93612d881151e92b8da739d89d3fc1aa654546fa0efa492a7c664b52a625a1f9ae6a7cb6386c95bcd3a2c0d285800566f786936c1ba0754b1b5dd8aca90907f52dfe1611b987d121a3dc73981ab0299eff7a8158157e9651c2212ecf584728192b78467ea332de954d0fae20ffdaa7ca51f12617cfcc6b1635ded32260ac873f076a5b56f01df19519696d97d495a72ec215382282716cde80ec73269a2d385bfa79f6811b9ad999a0585a2396f27ee4d7f110f79fac5caa85259273bd854333bac93fa18aef67bf08904c0b5c2ce78d7f609945d094dea87be22ae50d4e1eb1fd5ba50e8008892a7e7468d422f7d5112d19ee00867aa9deb42549e45a83bc211e417ea2d28bd136d5c546f2bc0f971ce8354c116797f1cd75dec5de559a7a37b26507cb1e07a3e219f1fbcd4b9ecbce2615f12be302886060d0ac3e8232398e42a9ccc703523a7ab5c135d5007a500e611d069f1cfa664cec0d2fc9254c995a569aedb51bd945a1eca8110a5fb748c45a0addae704e19ab6ac42ae91bd4828eca8cab2716ab31fc2ee39ec00399d11c7789975e1b7457c51b0abb14388051d15c9006b4b4489cd0cc34bc279f569d4b43d1eb0d","signature":"0x8c9b0820d2f5d4b3fa428f8b08523e317f5c9958fa3f1b134cad1cb2380bff8fd01b0a7cf36082070bcea9941beb104207de9a5588df1587bc13c005c865f0d8c9126eb14fbd745a97dfa545100577c2761584aae7964b85535407c5867cb5a5","withdrawalCredentials":"0x010000000000000000000000eb70dd2728aa1af365380cb496afdcabed077752"}]} \ No newline at end of file diff --git a/contracts/ethereum/hardhat.config.ts b/contracts/ethereum/hardhat.config.ts index 2473d1982..88c3b25c2 100644 --- a/contracts/ethereum/hardhat.config.ts +++ b/contracts/ethereum/hardhat.config.ts @@ -9,7 +9,7 @@ import 'hardhat-abi-exporter' import 'hardhat-contract-sizer' import 'solidity-docgen' // import '@tenderly/hardhat-tenderly' -import { ETHEREUM_CONTRACTS, ETHEREUM_RPC_URL, ETHEREUM_SIGNERS, HARDHAT_NETWORK_KEY } from '@casimir/env' +import { ETHEREUM_CONTRACTS, ETHEREUM_RPC_URL, HARDHAT_NETWORK_KEY } from '@casimir/env' // Seed is provided const mnemonic = process.env.BIP39_SEED as string @@ -30,6 +30,16 @@ const forkConfig = { url: forkUrl, blockNumber: parseInt(process.env.ETHEREUM_FO const hardhatKey = hardhatNetwork?.toUpperCase() as keyof typeof HARDHAT_NETWORK_KEY const networkKey = HARDHAT_NETWORK_KEY[hardhatKey] || 'TESTNET' +process.env.ETHEREUM_RPC_URL = process.env.ETHEREUM_RPC_URL || ETHEREUM_RPC_URL[networkKey] +process.env.FACTORY_ADDRESS = ETHEREUM_CONTRACTS[networkKey].FACTORY_ADDRESS +process.env.BEACON_LIBRARY_ADDRESS = ETHEREUM_CONTRACTS[networkKey].BEACON_LIBRARY_ADDRESS +process.env.MANAGER_BEACON_ADDRESS = ETHEREUM_CONTRACTS[networkKey].MANAGER_BEACON_ADDRESS +process.env.POOL_BEACON_ADDRESS = ETHEREUM_CONTRACTS[networkKey].POOL_BEACON_ADDRESS +process.env.REGISTRY_BEACON_ADDRESS = ETHEREUM_CONTRACTS[networkKey].REGISTRY_BEACON_ADDRESS +process.env.UPKEEP_BEACON_ADDRESS = ETHEREUM_CONTRACTS[networkKey].UPKEEP_BEACON_ADDRESS +process.env.VIEWS_BEACON_ADDRESS = ETHEREUM_CONTRACTS[networkKey].VIEWS_BEACON_ADDRESS +process.env.FUNCTIONS_BILLING_REGISTRY_ADDRESS = ETHEREUM_CONTRACTS[networkKey].FUNCTIONS_BILLING_REGISTRY_ADDRESS +process.env.FUNCTIONS_ORACLE_ADDRESS = ETHEREUM_CONTRACTS[networkKey].FUNCTIONS_ORACLE_ADDRESS process.env.DEPOSIT_CONTRACT_ADDRESS = ETHEREUM_CONTRACTS[networkKey].DEPOSIT_CONTRACT_ADDRESS process.env.KEEPER_REGISTRAR_ADDRESS = ETHEREUM_CONTRACTS[networkKey].KEEPER_REGISTRAR_ADDRESS process.env.KEEPER_REGISTRY_ADDRESS = ETHEREUM_CONTRACTS[networkKey].KEEPER_REGISTRY_ADDRESS @@ -42,21 +52,6 @@ process.env.SWAP_FACTORY_ADDRESS = ETHEREUM_CONTRACTS[networkKey].SWAP_FACTORY_A process.env.SWAP_ROUTER_ADDRESS = ETHEREUM_CONTRACTS[networkKey].SWAP_ROUTER_ADDRESS process.env.WETH_TOKEN_ADDRESS = ETHEREUM_CONTRACTS[networkKey].WETH_TOKEN_ADDRESS -if (hardhatNetwork !== 'localhost') { - process.env.ETHEREUM_RPC_URL = process.env.ETHEREUM_RPC_URL || ETHEREUM_RPC_URL[networkKey] - process.env.OWNER_ADDRESS = ETHEREUM_SIGNERS[networkKey].OWNER_ADDRESS - process.env.DAO_ORACLE_ADDRESS = ETHEREUM_SIGNERS[networkKey].DAO_ORACLE_ADDRESS - process.env.BEACON_LIBRARY_ADDRESS = ETHEREUM_CONTRACTS[networkKey].BEACON_LIBRARY_ADDRESS - process.env.MANAGER_BEACON_ADDRESS = ETHEREUM_CONTRACTS[networkKey].MANAGER_BEACON_ADDRESS - process.env.POOL_BEACON_ADDRESS = ETHEREUM_CONTRACTS[networkKey].POOL_BEACON_ADDRESS - process.env.REGISTRY_BEACON_ADDRESS = ETHEREUM_CONTRACTS[networkKey].REGISTRY_BEACON_ADDRESS - process.env.UPKEEP_BEACON_ADDRESS = ETHEREUM_CONTRACTS[networkKey].UPKEEP_BEACON_ADDRESS - process.env.VIEWS_BEACON_ADDRESS = ETHEREUM_CONTRACTS[networkKey].VIEWS_BEACON_ADDRESS - process.env.FACTORY_ADDRESS = ETHEREUM_CONTRACTS[networkKey].FACTORY_ADDRESS - process.env.FUNCTIONS_BILLING_REGISTRY_ADDRESS = ETHEREUM_CONTRACTS[networkKey].FUNCTIONS_BILLING_REGISTRY_ADDRESS - process.env.FUNCTIONS_ORACLE_ADDRESS = ETHEREUM_CONTRACTS[networkKey].FUNCTIONS_ORACLE_ADDRESS -} - const compilerSettings = { viaIR: true, optimizer: { diff --git a/contracts/ethereum/helpers/upkeep.ts b/contracts/ethereum/helpers/upkeep.ts index 3ac76ff69..61e2d89d7 100644 --- a/contracts/ethereum/helpers/upkeep.ts +++ b/contracts/ethereum/helpers/upkeep.ts @@ -9,11 +9,11 @@ export async function runUpkeep({ upkeep: CasimirUpkeep, }) { let ranUpkeep = false - const checkData = ethers.utils.toUtf8Bytes('') + const checkData = ethers.utils.toUtf8Bytes('0x') const { ...check } = await upkeep.connect(donTransmitter).checkUpkeep(checkData) const { upkeepNeeded } = check if (upkeepNeeded) { - const performData = ethers.utils.toUtf8Bytes('') + const performData = ethers.utils.toUtf8Bytes('0x') const performUpkeep = await upkeep.connect(donTransmitter).performUpkeep(performData) await performUpkeep.wait() ranUpkeep = true @@ -43,7 +43,7 @@ export async function fulfillReport({ }) { const { beaconBalance, sweptBalance, activatedDeposits, forcedExits, completedExits, compoundablePoolIds } = values - const requestIds = (await upkeep.queryFilter(upkeep.filters.RequestSent())).slice(-2).map((event) => event.args.id) + const requestIds = (await upkeep.queryFilter(upkeep.filters.ReportRequestSent(), -2)).map((event) => event.args.requestId) const balancesRequestId = requestIds[0] diff --git a/contracts/ethereum/package.json b/contracts/ethereum/package.json index 746bf61bc..b59b1c6af 100644 --- a/contracts/ethereum/package.json +++ b/contracts/ethereum/package.json @@ -10,8 +10,7 @@ "node": "npx hardhat node", "report": "npx hardhat run scripts/report.ts", "size": "npx hardhat size-contracts", - "test": "npx hardhat test", - "test:debug": "npx hardhat test test/debug.ts", + "test": "npx esno -r dotenv/config -r scripts/test.ts", "upgrade:all": "npx hardhat run scripts/upgrade-all.ts", "upgrade:proxies": "npx hardhat run scripts/upgrade-proxies.ts", "verify": "npx hardhat verify" diff --git a/contracts/ethereum/scripts/deploy.ts b/contracts/ethereum/scripts/deploy.ts index 2b681dd47..8604fa545 100644 --- a/contracts/ethereum/scripts/deploy.ts +++ b/contracts/ethereum/scripts/deploy.ts @@ -136,7 +136,7 @@ void async function () { await factory.deployed() console.log(`CasimirFactory contract deployed at ${factory.address}`) - const baseStrategy = { + const simpleStrategy = { minCollateral: ethers.utils.parseEther('1.0'), lockPeriod: 0, userFee: 5, @@ -146,18 +146,18 @@ void async function () { privateOperators: false, verifiedOperators: false } - const deployBaseManager = await factory.deployManager( + const deploySimpleManager = await factory.deployManager( daoOracle.address, functionsOracle.address, - baseStrategy + simpleStrategy ) - await deployBaseManager.wait() + await deploySimpleManager.wait() const [managerId] = await factory.getManagerIds() const managerConfig = await factory.getManagerConfig(managerId) - console.log(`Base CasimirManager contract deployed to ${managerConfig.managerAddress}`) - console.log(`Base CasimirRegistry contract deployed to ${managerConfig.registryAddress}`) - console.log(`Base CasimirUpkeep contract deployed to ${managerConfig.upkeepAddress}`) - console.log(`Base CasimirViews contract deployed to ${managerConfig.viewsAddress}`) + console.log(`Simple CasimirManager contract deployed to ${managerConfig.managerAddress}`) + console.log(`Simple CasimirRegistry contract deployed to ${managerConfig.registryAddress}`) + console.log(`Simple CasimirUpkeep contract deployed to ${managerConfig.upkeepAddress}`) + console.log(`Simple CasimirViews contract deployed to ${managerConfig.viewsAddress}`) const upkeep = await ethers.getContractAt('CasimirUpkeep', managerConfig.upkeepAddress) as CasimirUpkeep requestConfig.args[1] = managerConfig.viewsAddress diff --git a/contracts/ethereum/scripts/dev.ts b/contracts/ethereum/scripts/dev.ts index 7e3f32b9b..7e9e92ffd 100644 --- a/contracts/ethereum/scripts/dev.ts +++ b/contracts/ethereum/scripts/dev.ts @@ -1,20 +1,35 @@ -import { CasimirManager, CasimirRegistry, ISSVViews, CasimirViews, CasimirUpkeep, FunctionsOracleFactory, FunctionsBillingRegistry, CasimirFactory } from '../build/@types' -import { ethers, network, upgrades } from 'hardhat' +import { CasimirFactoryDev, CasimirManagerDev, CasimirRegistry, CasimirUpkeepDev, CasimirViews, FunctionsOracle, FunctionsBillingRegistry } from '../build/@types' +import ICasimirManagerDevAbi from '../build/abi/ICasimirManagerDev.json' +import ICasimirRegistryAbi from '../build/abi/ICasimirRegistry.json' +import ICasimirUpkeepDevAbi from '../build/abi/ICasimirUpkeepDev.json' +import ICasimirViewsAbi from '../build/abi/ICasimirViews.json' +import FunctionsBillingRegistryAbi from '../build/abi/FunctionsBillingRegistry.json' +import FunctionsOracleAbi from '../build/abi/FunctionsOracle.json' +import { ethers, upgrades } from 'hardhat' import { fulfillReport, runUpkeep } from '@casimir/ethereum/helpers/upkeep' import { round } from '@casimir/ethereum/helpers/math' import { time, setBalance } from '@nomicfoundation/hardhat-network-helpers' -import ISSVViewsAbi from '../build/abi/ISSVViews.json' -import { run } from '@casimir/shell' import { PoolStatus } from '@casimir/types' import requestConfig from '@casimir/functions/Functions-request-config' import { activatePoolsHandler } from '../helpers/oracle' +import { run } from '@casimir/shell' upgrades.silenceWarnings() /** - * Deploy contracts to local network and run local events and oracle handling + * Fork contracts to local network and run local events and oracle handling */ -void async function () { +async function dev() { + if (!process.env.ETHEREUM_RPC_URL) throw new Error('No ethereum rpc url provided') + if (!process.env.FACTORY_ADDRESS) throw new Error('No factory address provided') + if (!process.env.MANAGER_BEACON_ADDRESS) throw new Error('No manager beacon address provided') + if (!process.env.POOL_BEACON_ADDRESS) throw new Error('No pool beacon address provided') + if (!process.env.REGISTRY_BEACON_ADDRESS) throw new Error('No registry beacon address provided') + if (!process.env.UPKEEP_BEACON_ADDRESS) throw new Error('No upkeep beacon address provided') + if (!process.env.VIEWS_BEACON_ADDRESS) throw new Error('No views beacon address provided') + if (!process.env.BEACON_LIBRARY_ADDRESS) throw new Error('No beacon library address provided') + if (!process.env.FUNCTIONS_BILLING_REGISTRY_ADDRESS) throw new Error('No functions billing registry address provided') + if (!process.env.FUNCTIONS_ORACLE_ADDRESS) throw new Error('No functions oracle address provided') if (!process.env.DEPOSIT_CONTRACT_ADDRESS) throw new Error('No deposit contract address provided') if (!process.env.KEEPER_REGISTRAR_ADDRESS) throw new Error('No keeper registrar address provided') if (!process.env.KEEPER_REGISTRY_ADDRESS) throw new Error('No keeper registry address provided') @@ -26,217 +41,106 @@ void async function () { if (!process.env.SWAP_ROUTER_ADDRESS) throw new Error('No swap router address provided') if (!process.env.WETH_TOKEN_ADDRESS) throw new Error('No weth token address provided') - const [, daoOracle, donTransmitter, firstUser] = await ethers.getSigners() - - const functionsOracleFactoryFactory = await ethers.getContractFactory('FunctionsOracleFactory') - const functionsOracleFactory = await functionsOracleFactoryFactory.deploy() as FunctionsOracleFactory - await functionsOracleFactory.deployed() - console.log(`FunctionsOracleFactory contract deployed to ${functionsOracleFactory.address}`) - - const deployNewOracle = await functionsOracleFactory.deployNewOracle() - const deployNewOracleReceipt = await deployNewOracle.wait() - if (!deployNewOracleReceipt.events) throw new Error('Functions oracle deployment failed') - const functionsOracleAddress = deployNewOracleReceipt.events[1].args?.don as string - const functionsOracle = await ethers.getContractAt('FunctionsOracle', functionsOracleAddress) - const acceptOwnership = await functionsOracle.acceptOwnership() - await acceptOwnership.wait() - console.log(`FunctionsOracle contract deployed to ${functionsOracle.address}`) - - const functionsBillingRegistryArgs = { - linkTokenAddress: process.env.LINK_TOKEN_ADDRESS, - linkEthFeedAddress: process.env.LINK_ETH_FEED_ADDRESS, - functionsOracleAddress: functionsOracle.address - } - const functionsBillingRegistryFactory = await ethers.getContractFactory('FunctionsBillingRegistry') - const functionsBillingRegistry = await functionsBillingRegistryFactory.deploy(...Object.values(functionsBillingRegistryArgs)) as FunctionsBillingRegistry - await functionsBillingRegistry.deployed() - console.log(`FunctionsBillingRegistry contract deployed to ${functionsBillingRegistry.address}`) + const [owner, daoOracle, donTransmitter] = await ethers.getSigners() - const functionsBillingRegistryConfig = { - maxGasLimit: 400_000, - stalenessSeconds: 86_400, - gasAfterPaymentCalculation: - 21_000 + 5_000 + 2_100 + 20_000 + 2 * 2_100 - 15_000 + 7_315, - weiPerUnitLink: ethers.BigNumber.from('5000000000000000'), - gasOverhead: 100_000, - requestTimeoutSeconds: 300, - } + const functionsOracle = new ethers.Contract(process.env.FUNCTIONS_ORACLE_ADDRESS, FunctionsOracleAbi, ethers.provider) as FunctionsOracle + const functionsBillingRegistry = new ethers.Contract(process.env.FUNCTIONS_BILLING_REGISTRY_ADDRESS, FunctionsBillingRegistryAbi, ethers.provider) as FunctionsBillingRegistry - await functionsBillingRegistry.setConfig( - functionsBillingRegistryConfig.maxGasLimit, - functionsBillingRegistryConfig.stalenessSeconds, - functionsBillingRegistryConfig.gasAfterPaymentCalculation, - functionsBillingRegistryConfig.weiPerUnitLink, - functionsBillingRegistryConfig.gasOverhead, - functionsBillingRegistryConfig.requestTimeoutSeconds - ) - - const beaconLibraryFactory = await ethers.getContractFactory('CasimirBeacon') - const beaconLibrary = await beaconLibraryFactory.deploy() - console.log(`CasimirBeacon library deployed to ${beaconLibrary.address}`) - - const managerBeaconFactory = await ethers.getContractFactory('CasimirManager', { + const factoryDevFactory = await ethers.getContractFactory('CasimirFactoryDev', { libraries: { - CasimirBeacon: beaconLibrary.address + CasimirBeacon: process.env.BEACON_LIBRARY_ADDRESS } }) - const managerBeacon = await upgrades.deployBeacon(managerBeaconFactory, { + const factory = await upgrades.upgradeProxy(process.env.FACTORY_ADDRESS, factoryDevFactory, { constructorArgs: [ - functionsBillingRegistry.address, - process.env.KEEPER_REGISTRAR_ADDRESS as string, - process.env.KEEPER_REGISTRY_ADDRESS as string, - process.env.LINK_TOKEN_ADDRESS as string, - process.env.SSV_NETWORK_ADDRESS as string, - process.env.SSV_TOKEN_ADDRESS as string, - process.env.SWAP_FACTORY_ADDRESS as string, - process.env.SWAP_ROUTER_ADDRESS as string, - process.env.WETH_TOKEN_ADDRESS as string + process.env.MANAGER_BEACON_ADDRESS, + process.env.POOL_BEACON_ADDRESS, + process.env.REGISTRY_BEACON_ADDRESS, + process.env.UPKEEP_BEACON_ADDRESS, + process.env.VIEWS_BEACON_ADDRESS ], unsafeAllow: ['external-library-linking'] - }) - await managerBeacon.deployed() - console.log(`CasimirManager beacon deployed at ${managerBeacon.address}`) - - const poolBeaconFactory = await ethers.getContractFactory('CasimirPool') - const poolBeacon = await upgrades.deployBeacon(poolBeaconFactory, { - constructorArgs: [ - process.env.DEPOSIT_CONTRACT_ADDRESS as string - ] - }) - await poolBeacon.deployed() - console.log(`CasimirPool beacon deployed at ${poolBeacon.address}`) - - const registryBeaconFactory = await ethers.getContractFactory('CasimirRegistry') - const registryBeacon = await upgrades.deployBeacon(registryBeaconFactory, { - constructorArgs: [ - process.env.SSV_VIEWS_ADDRESS as string - ] - }) - await registryBeacon.deployed() - console.log(`CasimirRegistry beacon deployed at ${registryBeacon.address}`) - - const upkeepBeaconFactory = await ethers.getContractFactory('CasimirUpkeep') - const upkeepBeacon = await upgrades.deployBeacon(upkeepBeaconFactory) - await upkeepBeacon.deployed() - console.log(`CasimirUpkeep beacon deployed at ${upkeepBeacon.address}`) - - const viewsBeaconFactory = await ethers.getContractFactory('CasimirViews') - const viewsBeacon = await upgrades.deployBeacon(viewsBeaconFactory) - await viewsBeacon.deployed() - console.log(`CasimirViews beacon deployed at ${viewsBeacon.address}`) + }) as CasimirFactoryDev + await factory.deployed() + console.log(`Casimir factory ${factory.address}`) - const factoryFactory = await ethers.getContractFactory('CasimirFactory', { + const [managerId] = await factory.getManagerIds() + const managerConfig = await factory.getManagerConfig(managerId) + const managerDevFactory = await ethers.getContractFactory('CasimirManagerDev', { libraries: { - CasimirBeacon: beaconLibrary.address + CasimirBeacon: process.env.BEACON_LIBRARY_ADDRESS } }) - const factory = await upgrades.deployProxy(factoryFactory, undefined, { + const managerBeacon = await upgrades.upgradeBeacon(process.env.MANAGER_BEACON_ADDRESS, managerDevFactory, { constructorArgs: [ - managerBeacon.address, - poolBeacon.address, - registryBeacon.address, - upkeepBeacon.address, - viewsBeacon.address + process.env.FUNCTIONS_BILLING_REGISTRY_ADDRESS, + process.env.KEEPER_REGISTRAR_ADDRESS, + process.env.KEEPER_REGISTRY_ADDRESS, + process.env.LINK_TOKEN_ADDRESS, + process.env.SSV_NETWORK_ADDRESS, + process.env.SSV_TOKEN_ADDRESS, + process.env.SWAP_FACTORY_ADDRESS, + process.env.SWAP_ROUTER_ADDRESS, + process.env.WETH_TOKEN_ADDRESS ], - unsafeAllow: ['external-library-linking'] - }) as CasimirFactory - await factory.deployed() - console.log(`CasimirFactory contract deployed at ${factory.address}`) + unsafeAllow: ['external-library-linking'] + }) + await managerBeacon.deployed() - const defaultStrategy = { - minCollateral: ethers.utils.parseEther('1.0'), - lockPeriod: 0, - userFee: 5, - compoundStake: true, - eigenStake: false, - liquidStake: false, - privateOperators: false, - verifiedOperators: false - } - const deployBaseManager = await factory.deployManager( - daoOracle.address, - functionsOracle.address, - defaultStrategy - ) - await deployBaseManager.wait() - const [baseManagerId] = await factory.getManagerIds() - const baseManagerConfig = await factory.getManagerConfig(baseManagerId) - const manager = await ethers.getContractAt('CasimirManager', baseManagerConfig.managerAddress) as CasimirManager - const registry = await ethers.getContractAt('CasimirRegistry', baseManagerConfig.registryAddress) as CasimirRegistry - const upkeep = await ethers.getContractAt('CasimirUpkeep', baseManagerConfig.upkeepAddress) as CasimirUpkeep - const views = await ethers.getContractAt('CasimirViews', baseManagerConfig.viewsAddress) as CasimirViews - console.log(`Base manager contract deployed to ${manager.address}`) - console.log(`Base registry contract deployed to ${registry.address}`) - console.log(`Base upkeep contract deployed to ${upkeep.address}`) - console.log(`Base views contract deployed to ${views.address}`) + const manager = new ethers.Contract(managerConfig.managerAddress, ICasimirManagerDevAbi, ethers.provider) as CasimirManagerDev + console.log(`Casimir simple manager ${manager.address}`) - requestConfig.args[1] = views.address - await (await upkeep.setFunctionsRequest( - requestConfig.source, requestConfig.args, 300000 - )).wait() + const registry = new ethers.Contract(managerConfig.registryAddress, ICasimirRegistryAbi, ethers.provider) as CasimirRegistry + console.log(`Casimir simple registry ${registry.address}`) - await functionsBillingRegistry.setAuthorizedSenders([donTransmitter.address, functionsOracle.address]) - await functionsOracle.setRegistry(functionsBillingRegistry.address) - await functionsOracle.addAuthorizedSenders([donTransmitter.address, manager.address]) + const upkeepDevFactory = await ethers.getContractFactory('CasimirUpkeepDev') + const upkeepBeacon = await upgrades.upgradeBeacon(process.env.UPKEEP_BEACON_ADDRESS, upkeepDevFactory) + await upkeepBeacon.deployed() - const ssvViews = await ethers.getContractAt(ISSVViewsAbi, process.env.SSV_VIEWS_ADDRESS as string) as ISSVViews - const preregisteredOperatorIds = process.env.PREREGISTERED_OPERATOR_IDS?.split(',').map(id => parseInt(id)) || [208, 209, 210, 211/*, 212, 213, 214, 215*/] - if (preregisteredOperatorIds.length < 4) throw new Error('Not enough operator ids provided') - const preregisteredBalance = ethers.utils.parseEther('10') - for (const operatorId of preregisteredOperatorIds) { - const [operatorOwnerAddress] = await ssvViews.getOperatorById(operatorId) - const currentBalance = await ethers.provider.getBalance(operatorOwnerAddress) - const nextBalance = currentBalance.add(preregisteredBalance) - await setBalance(operatorOwnerAddress, nextBalance) - await network.provider.request({ - method: 'hardhat_impersonateAccount', - params: [operatorOwnerAddress] - }) - const operatorSigner = ethers.provider.getSigner(operatorOwnerAddress) - const result = await registry.connect(operatorSigner).registerOperator(operatorId, { value: preregisteredBalance }) - await result.wait() - } + const upkeep = new ethers.Contract(managerConfig.upkeepAddress, ICasimirUpkeepDevAbi, ethers.provider) as CasimirUpkeepDev + console.log(`Casimir simple upkeep ${upkeep.address}`) + const views = new ethers.Contract(managerConfig.viewsAddress, ICasimirViewsAbi, ethers.provider) as CasimirViews + console.log(`Casimir simple views ${views.address}`) /** - * Deploy a second manager with Eigen stake enabled - * Note, this manager is not functional - * It is only deployed to test a list of multiple managers + * Deploy a second operator groups with Casimir Eigen stake enabled + * Note, this operator group is not functional it only deployed for testing purposes */ - const eigenStrategy = { - minCollateral: ethers.utils.parseEther('1.0'), - lockPeriod: 0, - userFee: 5, - compoundStake: true, - eigenStake: true, - liquidStake: false, - privateOperators: false, - verifiedOperators: false - } - const deployEigenManager = await factory.deployManager( + const deployEigenManager = await factory.connect(owner).deployManager( daoOracle.address, functionsOracle.address, - eigenStrategy + { + minCollateral: ethers.utils.parseEther('1.0'), + lockPeriod: ethers.BigNumber.from('0'), + userFee: ethers.BigNumber.from('5'), + compoundStake: true, + eigenStake: true, + liquidStake: false, + privateOperators: false, + verifiedOperators: false + } ) await deployEigenManager.wait() const [, eigenManagerId] = await factory.getManagerIds() const eigenManagerConfig = await factory.getManagerConfig(eigenManagerId) - const eigenManager = await ethers.getContractAt('CasimirManager', eigenManagerConfig.managerAddress) as CasimirManager - const eigenRegistry = await ethers.getContractAt('CasimirRegistry', eigenManagerConfig.registryAddress) as CasimirRegistry - const eigenUpkeep = await ethers.getContractAt('CasimirUpkeep', eigenManagerConfig.upkeepAddress) as CasimirUpkeep - const eigenViews = await ethers.getContractAt('CasimirViews', eigenManagerConfig.viewsAddress) as CasimirViews - console.log(`Eigen manager contract deployed to ${eigenManager.address}`) - console.log(`Eigen registry contract deployed to ${eigenRegistry.address}`) - console.log(`Eigen upkeep contract deployed to ${eigenUpkeep.address}`) - console.log(`Eigen views contract deployed to ${eigenViews.address}`) + + const eigenManager = new ethers.Contract(eigenManagerConfig.managerAddress, ICasimirManagerDevAbi, ethers.provider) as CasimirManagerDev + console.log(`Casimir Eigen manager ${eigenManager.address}`) + const eigenRegistry = new ethers.Contract(eigenManagerConfig.registryAddress, ICasimirRegistryAbi, ethers.provider) as CasimirRegistry + console.log(`Casimir Eigen registry ${eigenRegistry.address}`) + const eigenUpkeep = new ethers.Contract(eigenManagerConfig.upkeepAddress, ICasimirUpkeepDevAbi, ethers.provider) as CasimirUpkeepDev + console.log(`Casimir Eigen upkeep ${eigenUpkeep.address}`) + const eigenViews = new ethers.Contract(eigenManagerConfig.viewsAddress, ICasimirViewsAbi, ethers.provider) as CasimirViews + console.log(`Casimir Eigen views ${eigenViews.address}`) requestConfig.args[1] = eigenViews.address - await (await eigenUpkeep.setFunctionsRequest( + await (await eigenUpkeep.connect(owner).setFunctionsRequest( requestConfig.source, requestConfig.args, 300000 )).wait() - await functionsBillingRegistry.setAuthorizedSenders([donTransmitter.address, functionsOracle.address]) - await functionsOracle.setRegistry(functionsBillingRegistry.address) - await functionsOracle.addAuthorizedSenders([donTransmitter.address, eigenManager.address]) + const functionsOracleSenders = await functionsOracle.getAuthorizedSenders() + const newFunctionsOracleSenders = [...functionsOracleSenders, eigenManager.address, eigenUpkeep.address] + await functionsOracle.connect(owner).setAuthorizedSenders(newFunctionsOracleSenders) /** * We are simulating the oracle reporting on a more frequent basis @@ -320,14 +224,10 @@ void async function () { }) }() - setTimeout(async () => { - const depositAmount = 32 * ((100 + await manager.userFee()) / 100) - const depositStake = await manager.connect(firstUser).depositStake({ value: ethers.utils.parseEther(depositAmount.toString()) }) - await depositStake.wait() - }, 2500) - - process.env.FACTORY_ADDRESS = factory.address - process.env.FUNCTIONS_BILLING_REGISTRY_ADDRESS = functionsBillingRegistry.address - process.env.FUNCTIONS_ORACLE_ADDRESS = functionsOracle.address run('npm run dev --workspace @casimir/oracle') -}() +} + +dev().catch(error => { + console.error(error) + process.exit(1) +}) diff --git a/contracts/ethereum/scripts/functions.ts b/contracts/ethereum/scripts/functions.ts new file mode 100644 index 000000000..e69de29bb diff --git a/scripts/ethereum/test.ts b/contracts/ethereum/scripts/test.ts old mode 100755 new mode 100644 similarity index 54% rename from scripts/ethereum/test.ts rename to contracts/ethereum/scripts/test.ts index e023b4d90..924fb05de --- a/scripts/ethereum/test.ts +++ b/contracts/ethereum/scripts/test.ts @@ -6,7 +6,7 @@ import { run } from '@casimir/shell' /** * Test ethereum contracts and services */ -void async function () { +async function test() { if (process.env.USE_SECRETS !== 'false') { await loadCredentials() process.env.BIP39_SEED = process.env.BIP39_SEED || await getSecret('consensus-networks-bip39-seed') as string @@ -17,13 +17,10 @@ void async function () { process.env.FORK = process.env.FORK || 'testnet' - process.env.ETHEREUM_FORK_RPC_URL = ETHEREUM_RPC_URL[process.env.FORK.toUpperCase()] - if (!process.env.ETHEREUM_FORK_RPC_URL) { - throw new Error(`Ethereum ${process.env.FORK} is not supported`) - } - - const networkName = ETHEREUM_NETWORK_NAME[process.env.FORK.toUpperCase()] - + const networkKey = process.env.FORK.toUpperCase() as keyof typeof ETHEREUM_RPC_URL + process.env.ETHEREUM_FORK_RPC_URL = ETHEREUM_RPC_URL[networkKey] + + const networkName = ETHEREUM_NETWORK_NAME[networkKey] console.log(`Using ${networkName} fork from ${process.env.ETHEREUM_FORK_RPC_URL}`) const provider = new ethers.providers.JsonRpcProvider(process.env.ETHEREUM_FORK_RPC_URL) @@ -31,21 +28,23 @@ void async function () { const wallet = ethers.Wallet.fromMnemonic(process.env.BIP39_SEED) // Account for the mock, beacon, and library deployments - const walletNonce = await provider.getTransactionCount(wallet.address) + 13 + const walletNonce = await provider.getTransactionCount(wallet.address) + 14 - if (!process.env.FACTORY_ADDRESS) { - process.env.FACTORY_ADDRESS = ethers.utils.getContractAddress({ - from: wallet.address, - nonce: walletNonce - }) - } - - console.log(`Using factory address ${process.env.FACTORY_ADDRESS}`) + process.env.FACTORY_ADDRESS = ethers.utils.getContractAddress({ + from: wallet.address, + nonce: walletNonce + }) + console.log(`Expecting factory at ${process.env.FACTORY_ADDRESS}`) - process.env.SSV_NETWORK_ADDRESS = ETHEREUM_CONTRACTS[process.env.FORK.toUpperCase()]?.SSV_NETWORK_ADDRESS - process.env.SSV_VIEWS_ADDRESS = ETHEREUM_CONTRACTS[process.env.FORK.toUpperCase()]?.SSV_VIEWS_ADDRESS - process.env.SWAP_FACTORY_ADDRESS = ETHEREUM_CONTRACTS[process.env.FORK.toUpperCase()]?.SWAP_FACTORY_ADDRESS + process.env.SSV_NETWORK_ADDRESS = ETHEREUM_CONTRACTS[networkKey]?.SSV_NETWORK_ADDRESS + process.env.SSV_VIEWS_ADDRESS = ETHEREUM_CONTRACTS[networkKey]?.SSV_VIEWS_ADDRESS + process.env.SWAP_FACTORY_ADDRESS = ETHEREUM_CONTRACTS[networkKey]?.SWAP_FACTORY_ADDRESS await run('npm run generate --workspace @casimir/oracle') - run('npm run test --workspace @casimir/ethereum') -}() + run('npm hardhat test') +} + +test().catch(error => { + console.error(error) + process.exit(1) +}) \ No newline at end of file diff --git a/contracts/ethereum/src/v1/CasimirUpkeep.sol b/contracts/ethereum/src/v1/CasimirUpkeep.sol index 90dfe09a9..a9110f76e 100644 --- a/contracts/ethereum/src/v1/CasimirUpkeep.sol +++ b/contracts/ethereum/src/v1/CasimirUpkeep.sol @@ -121,13 +121,6 @@ contract CasimirUpkeep is requestArgs[9] = StringsUpgradeable.toString(reportRequestBlock); sendFunctionsRequest(request, requestArgs, RequestType.BALANCES); sendFunctionsRequest(request, requestArgs, RequestType.DETAILS); - emit ReportRequestsSent( - reportPeriod, - reportRequestBlock, - reportTimestamp, - previousReportBlock, - previousReportTimestamp - ); } else { if ( manager.requestedWithdrawalBalance() > 0 && @@ -162,7 +155,7 @@ contract CasimirUpkeep is function requestReport() external { onlyFactoryOwner(); reportRequested = true; - emit ReportRequested(); + emit NewReportRequested(); } /// @inheritdoc ICasimirUpkeep @@ -297,6 +290,15 @@ contract CasimirUpkeep is bytes32 requestId = sendRequest(request, manager.functionsId(), fulfillGasLimit); reportRequests[requestId] = requestType; reportRemainingRequests++; + emit ReportRequestSent( + requestId, + requestArgs, + reportPeriod, + reportRequestBlock, + reportTimestamp, + previousReportBlock, + previousReportTimestamp + ); } /// @dev Validate the caller is the factory owner diff --git a/contracts/ethereum/src/v1/dev/CasimirFactoryDev.sol b/contracts/ethereum/src/v1/dev/CasimirFactoryDev.sol new file mode 100644 index 000000000..703b01da2 --- /dev/null +++ b/contracts/ethereum/src/v1/dev/CasimirFactoryDev.sol @@ -0,0 +1,143 @@ +// SPDX-License-Identifier: Apache +pragma solidity 0.8.18; + +import "../CasimirCore.sol"; +import "./interfaces/ICasimirFactoryDev.sol"; +import "../interfaces/ICasimirManager.sol"; +import "../interfaces/ICasimirRegistry.sol"; +import "../interfaces/ICasimirUpkeep.sol"; +import "../libraries/CasimirBeacon.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; + +/// @title Factory that deploys and configures managers +contract CasimirFactoryDev is ICasimirFactoryDev, CasimirCore, Initializable, OwnableUpgradeable, ReentrancyGuardUpgradeable { + /** + * @inheritdoc ICasimirFactoryDev + * @custom:oz-upgrades-unsafe-allow state-variable-immutable + */ + address public immutable managerBeaconAddress; + /** + * @inheritdoc ICasimirFactoryDev + * @custom:oz-upgrades-unsafe-allow state-variable-immutable + */ + address public immutable poolBeaconAddress; + /** + * @inheritdoc ICasimirFactoryDev + * @custom:oz-upgrades-unsafe-allow state-variable-immutable + */ + address public immutable registryBeaconAddress; + /** + * @inheritdoc ICasimirFactoryDev + * @custom:oz-upgrades-unsafe-allow state-variable-immutable + */ + address public immutable upkeepBeaconAddress; + /** + * @inheritdoc ICasimirFactoryDev + * @custom:oz-upgrades-unsafe-allow state-variable-immutable + */ + address public immutable viewsBeaconAddress; + /// @dev Deployed manager addresses + mapping(uint32 => address) private managerAddresses; + /// @dev Deployed views addresses + mapping(uint32 => address) private viewsAddresses; + /// @dev Last manager ID + uint32 private lastManagerId; + /// @dev Storage gap + uint256[50] private __gap; + + /** + * @dev Constructor + * @param managerBeaconAddress_ Manager beacon address + * @param poolBeaconAddress_ Pool beacon address + * @param registryBeaconAddress_ Registry beacon address + * @param upkeepBeaconAddress_ Upkeep beacon address + * @param viewsBeaconAddress_ Views beacon address + * @custom:oz-upgrades-unsafe-allow constructor + */ + constructor( + address managerBeaconAddress_, + address poolBeaconAddress_, + address registryBeaconAddress_, + address upkeepBeaconAddress_, + address viewsBeaconAddress_ + ) { + onlyAddress(managerBeaconAddress_); + onlyAddress(poolBeaconAddress_); + onlyAddress(registryBeaconAddress_); + onlyAddress(upkeepBeaconAddress_); + onlyAddress(viewsBeaconAddress_); + managerBeaconAddress = managerBeaconAddress_; + poolBeaconAddress = poolBeaconAddress_; + registryBeaconAddress = registryBeaconAddress_; + upkeepBeaconAddress = upkeepBeaconAddress_; + viewsBeaconAddress = viewsBeaconAddress_; + _disableInitializers(); + } + + /** + * @notice Initialize the contract + */ + function initialize() public initializer { + __Ownable_init(); + __ReentrancyGuard_init(); + } + + /// @inheritdoc ICasimirFactoryDev + function deployManager( + address daoOracleAddress, + address functionsOracleAddress, + Strategy memory strategy + ) external onlyOwner { + onlyAddress(daoOracleAddress); + onlyAddress(functionsOracleAddress); + managerAddresses[++lastManagerId] = CasimirBeacon.createManager( + managerBeaconAddress, + daoOracleAddress, + functionsOracleAddress, + strategy + ); + ICasimirManager manager = ICasimirManager(managerAddresses[lastManagerId]); + viewsAddresses[lastManagerId] = CasimirBeacon.createViews(viewsBeaconAddress, address(manager)); + emit ManagerDeployed(lastManagerId); + } + + /// @inheritdoc ICasimirFactoryDev + function getManagerConfig(uint32 managerId) external view returns (ManagerConfig memory) { + ICasimirManager manager = ICasimirManager(managerAddresses[managerId]); + ICasimirRegistry registry = ICasimirRegistry(manager.getRegistryAddress()); + ICasimirUpkeep upkeep = ICasimirUpkeep(manager.getUpkeepAddress()); + return + ManagerConfig({ + managerAddress: managerAddresses[managerId], + registryAddress: address(registry), + upkeepAddress: address(upkeep), + viewsAddress: viewsAddresses[managerId], + strategy: Strategy({ + minCollateral: registry.minCollateral(), + lockPeriod: manager.lockPeriod(), + userFee: manager.userFee(), + compoundStake: upkeep.compoundStake(), + eigenStake: manager.eigenStake(), + liquidStake: manager.liquidStake(), + privateOperators: registry.privateOperators(), + verifiedOperators: registry.verifiedOperators() + }) + }); + } + + /// @inheritdoc ICasimirFactoryDev + function getManagerIds() external view returns (uint32[] memory) { + uint32[] memory managerIds = new uint32[](lastManagerId); + for (uint32 i; i < lastManagerId; i++) { + managerIds[i] = i + 1; + } + return managerIds; + } + + /// @inheritdoc ICasimirFactoryDev + function getOwner() external view returns (address) { + return owner(); + } +} diff --git a/contracts/ethereum/src/v1/dev/CasimirUpkeepDev.sol b/contracts/ethereum/src/v1/dev/CasimirUpkeepDev.sol index f5284b177..e5b8d49d4 100644 --- a/contracts/ethereum/src/v1/dev/CasimirUpkeepDev.sol +++ b/contracts/ethereum/src/v1/dev/CasimirUpkeepDev.sol @@ -121,13 +121,6 @@ contract CasimirUpkeepDev is requestArgs[9] = StringsUpgradeable.toString(reportRequestBlock); sendFunctionsRequest(request, requestArgs, RequestType.BALANCES); sendFunctionsRequest(request, requestArgs, RequestType.DETAILS); - emit ReportRequestsSent( - reportPeriod, - reportRequestBlock, - reportTimestamp, - previousReportBlock, - previousReportTimestamp - ); } else { if ( manager.requestedWithdrawalBalance() > 0 && @@ -162,7 +155,7 @@ contract CasimirUpkeepDev is function requestReport() external { onlyFactoryOwner(); reportRequested = true; - emit ReportRequested(); + emit NewReportRequested(); } /// @inheritdoc ICasimirUpkeepDev @@ -307,6 +300,15 @@ contract CasimirUpkeepDev is bytes32 requestId = sendRequest(request, manager.functionsId(), fulfillGasLimit); reportRequests[requestId] = requestType; reportRemainingRequests++; + emit ReportRequestSent( + requestId, + requestArgs, + reportPeriod, + reportRequestBlock, + reportTimestamp, + previousReportBlock, + previousReportTimestamp + ); } /// @dev Validate the caller is the factory owner diff --git a/contracts/ethereum/src/v1/dev/interfaces/ICasimirFactoryDev.sol b/contracts/ethereum/src/v1/dev/interfaces/ICasimirFactoryDev.sol new file mode 100644 index 000000000..016b62800 --- /dev/null +++ b/contracts/ethereum/src/v1/dev/interfaces/ICasimirFactoryDev.sol @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: Apache +pragma solidity 0.8.18; + +import "../../interfaces/ICasimirCore.sol"; + +/// @title Factory interface +interface ICasimirFactoryDev is ICasimirCore { + event FunctionsRequestSet( + uint32 indexed managerId, + string newRequestSource, + string[] newRequestArgs, + uint32 newFulfillGasLimit + ); + event FunctionsOracleSet(uint32 indexed managerId, address newFunctionsOracleAddress); + event ManagerDeployed(uint32 managerId); + event ReservedFeesWithdrawn(uint32 indexed managerId, uint256 amount); + + /** + * @notice Deploy a new manager + * @param daoOracleAddress DAO oracle address + * @param functionsOracleAddress Chainlink functions oracle address + * @param strategy Staking strategy configuration + */ + function deployManager(address daoOracleAddress, address functionsOracleAddress, Strategy memory strategy) external; + + /// @notice Manager beacon address + function managerBeaconAddress() external view returns (address); + + /// @notice Pool beacon address + function poolBeaconAddress() external view returns (address); + + /// @notice Registry beacon address + function registryBeaconAddress() external view returns (address); + + /// @notice Upkeep beacon address + function upkeepBeaconAddress() external view returns (address); + + /// @notice Views beacon address + function viewsBeaconAddress() external view returns (address); + + /// @notice Get manager config + function getManagerConfig(uint32 managerId) external view returns (ManagerConfig memory); + + /// @notice Get the manager IDs + function getManagerIds() external view returns (uint32[] memory); + + /// @notice Get the owner address + function getOwner() external view returns (address); +} diff --git a/contracts/ethereum/src/v1/dev/interfaces/ICasimirUpkeepDev.sol b/contracts/ethereum/src/v1/dev/interfaces/ICasimirUpkeepDev.sol index fbb74ea15..270a82fe5 100644 --- a/contracts/ethereum/src/v1/dev/interfaces/ICasimirUpkeepDev.sol +++ b/contracts/ethereum/src/v1/dev/interfaces/ICasimirUpkeepDev.sol @@ -25,8 +25,16 @@ interface ICasimirUpkeepDev is ICasimirCore, AutomationCompatibleInterface { event FunctionsOracleAddressSet(address newFunctionsOracleAddress); event FunctionsRequestSet(string newRequestSource, string[] newRequestArgs, uint32 newFulfillGasLimit); event OCRResponse(bytes32 indexed requestId, bytes result, bytes err); - event ReportRequested(); - event ReportRequestsSent(uint32, uint256, uint256, uint256, uint256); + event NewReportRequested(); + event ReportRequestSent( + bytes32 requestId, + string[] requestArgs, + uint32 reportPeriod, + uint256 reportRequestBlock, + uint256 reportTimestamp, + uint256 previousReportBlock, + uint256 previousReportTimestamp + ); event UpkeepPerformed(ReportStatus indexed status); error InvalidRequest(); @@ -41,7 +49,7 @@ interface ICasimirUpkeepDev is ICasimirCore, AutomationCompatibleInterface { /** * @notice Reset the report * @param resetReportPeriod Reset report period - * @param resetReportBlock Reset report block + * @param resetReportBlock Reset report block * @param resetReportTimestamp Reset report timestamp * @param resetPreviousReportBlock Reset previous report block * @param resetPreviousReportTimestamp Reset previous report timestamp diff --git a/contracts/ethereum/src/v1/interfaces/ICasimirUpkeep.sol b/contracts/ethereum/src/v1/interfaces/ICasimirUpkeep.sol index 79ea44d59..bfae2315b 100644 --- a/contracts/ethereum/src/v1/interfaces/ICasimirUpkeep.sol +++ b/contracts/ethereum/src/v1/interfaces/ICasimirUpkeep.sol @@ -25,8 +25,16 @@ interface ICasimirUpkeep is ICasimirCore, AutomationCompatibleInterface { event FunctionsOracleAddressSet(address newFunctionsOracleAddress); event FunctionsRequestSet(string newRequestSource, string[] newRequestArgs, uint32 newFulfillGasLimit); event OCRResponse(bytes32 indexed requestId, bytes result, bytes err); - event ReportRequested(); - event ReportRequestsSent(uint32, uint256, uint256, uint256, uint256); + event NewReportRequested(); + event ReportRequestSent( + bytes32 requestId, + string[] requestArgs, + uint32 reportPeriod, + uint256 reportRequestBlock, + uint256 reportTimestamp, + uint256 previousReportBlock, + uint256 previousReportTimestamp + ); event UpkeepPerformed(ReportStatus indexed status); error InvalidRequest(); diff --git a/contracts/ethereum/test/fixtures/shared.ts b/contracts/ethereum/test/fixtures/shared.ts index a853c018d..8193fcad9 100644 --- a/contracts/ethereum/test/fixtures/shared.ts +++ b/contracts/ethereum/test/fixtures/shared.ts @@ -129,7 +129,7 @@ export async function deploymentFixture() { }) as CasimirFactory await factory.deployed() - const defaultStrategy = { + const simpleStrategy = { minCollateral: ethers.utils.parseEther('1.0'), lockPeriod: 0, userFee: 5, @@ -139,12 +139,12 @@ export async function deploymentFixture() { privateOperators: false, verifiedOperators: false } - const deployBaseManager = await factory.deployManager( + const deploySimpleManager = await factory.deployManager( daoOracle.address, functionsOracle.address, - defaultStrategy + simpleStrategy ) - await deployBaseManager.wait() + await deploySimpleManager.wait() const [managerId] = await factory.getManagerIds() const [managerAddress, registryAddress, upkeepAddress, viewsAddress] = await factory.getManagerConfig(managerId) const manager = await ethers.getContractAt('CasimirManager', managerAddress) as CasimirManager diff --git a/package-lock.json b/package-lock.json index ae20cbf6a..65a094038 100644 --- a/package-lock.json +++ b/package-lock.json @@ -687,24 +687,24 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" }, "node_modules/@aws-sdk/client-athena": { - "version": "3.437.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-athena/-/client-athena-3.437.0.tgz", - "integrity": "sha512-eFk8eh17LmvvoAF4id09/k3+N1+zQ80UWA8elZwImyHfwMXhwicPbxCdK6ugJ41nlA0y5mGPrFRLsfSazVhlkw==", + "version": "3.441.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-athena/-/client-athena-3.441.0.tgz", + "integrity": "sha512-QmMAKVV4Yrz+bX7oOOjsELpxYDA00kGp6vb53s6CkQ3ZQLYFqHyENQ/bWtdsv+O/9qeRn6GTn2G86avJdMur3Q==", "peer": true, "dependencies": { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/client-sts": "3.437.0", - "@aws-sdk/core": "3.436.0", - "@aws-sdk/credential-provider-node": "3.437.0", + "@aws-sdk/client-sts": "3.441.0", + "@aws-sdk/core": "3.441.0", + "@aws-sdk/credential-provider-node": "3.441.0", "@aws-sdk/middleware-host-header": "3.433.0", "@aws-sdk/middleware-logger": "3.433.0", "@aws-sdk/middleware-recursion-detection": "3.433.0", "@aws-sdk/middleware-signing": "3.433.0", - "@aws-sdk/middleware-user-agent": "3.433.0", + "@aws-sdk/middleware-user-agent": "3.438.0", "@aws-sdk/region-config-resolver": "3.433.0", "@aws-sdk/types": "3.433.0", - "@aws-sdk/util-endpoints": "3.433.0", + "@aws-sdk/util-endpoints": "3.438.0", "@aws-sdk/util-user-agent-browser": "3.433.0", "@aws-sdk/util-user-agent-node": "3.437.0", "@smithy/config-resolver": "^2.0.16", @@ -727,6 +727,7 @@ "@smithy/util-body-length-node": "^2.1.0", "@smithy/util-defaults-mode-browser": "^2.0.16", "@smithy/util-defaults-mode-node": "^2.0.21", + "@smithy/util-endpoints": "^1.0.2", "@smithy/util-retry": "^2.0.5", "@smithy/util-utf8": "^2.0.0", "tslib": "^2.5.0", @@ -737,23 +738,23 @@ } }, "node_modules/@aws-sdk/client-cognito-identity": { - "version": "3.437.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.437.0.tgz", - "integrity": "sha512-7mI0WT21ru2H6T13J5xNHMIE/dXj1tEeObvwAvUcwQl1J1ZKzFFM/fth3AHX+KACJJ/B5WD+xiTuv62/SXE7AA==", + "version": "3.441.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.441.0.tgz", + "integrity": "sha512-0BYe2YAoAIF2GdonU6IcrUb/r2pYJHICzqOCi85ixAiGKYokBSl53P7x17DkA7J2mjLWTv+S9nvuVa2RG/L7bA==", "dependencies": { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/client-sts": "3.437.0", - "@aws-sdk/core": "3.436.0", - "@aws-sdk/credential-provider-node": "3.437.0", + "@aws-sdk/client-sts": "3.441.0", + "@aws-sdk/core": "3.441.0", + "@aws-sdk/credential-provider-node": "3.441.0", "@aws-sdk/middleware-host-header": "3.433.0", "@aws-sdk/middleware-logger": "3.433.0", "@aws-sdk/middleware-recursion-detection": "3.433.0", "@aws-sdk/middleware-signing": "3.433.0", - "@aws-sdk/middleware-user-agent": "3.433.0", + "@aws-sdk/middleware-user-agent": "3.438.0", "@aws-sdk/region-config-resolver": "3.433.0", "@aws-sdk/types": "3.433.0", - "@aws-sdk/util-endpoints": "3.433.0", + "@aws-sdk/util-endpoints": "3.438.0", "@aws-sdk/util-user-agent-browser": "3.433.0", "@aws-sdk/util-user-agent-node": "3.437.0", "@smithy/config-resolver": "^2.0.16", @@ -776,6 +777,7 @@ "@smithy/util-body-length-node": "^2.1.0", "@smithy/util-defaults-mode-browser": "^2.0.16", "@smithy/util-defaults-mode-node": "^2.0.21", + "@smithy/util-endpoints": "^1.0.2", "@smithy/util-retry": "^2.0.5", "@smithy/util-utf8": "^2.0.0", "tslib": "^2.5.0" @@ -785,23 +787,23 @@ } }, "node_modules/@aws-sdk/client-secrets-manager": { - "version": "3.437.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-secrets-manager/-/client-secrets-manager-3.437.0.tgz", - "integrity": "sha512-ZRNdI3yHeAjVA67PpjLSYm0w47fbzy2H5mVT+xfyp/NWGw2HmpA6PP1Ns4p0tU5lMU6AcAUMGABo+MbKae1iDQ==", + "version": "3.441.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-secrets-manager/-/client-secrets-manager-3.441.0.tgz", + "integrity": "sha512-XKXO2qGWA9lRz1jykIfl5Lz5g3IRoa+NBnQDXFnTSzw52oOUAoyYOcpN0JL9/5ga1q9UxJtq2Mk3yKlIeRbxHQ==", "dependencies": { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/client-sts": "3.437.0", - "@aws-sdk/core": "3.436.0", - "@aws-sdk/credential-provider-node": "3.437.0", + "@aws-sdk/client-sts": "3.441.0", + "@aws-sdk/core": "3.441.0", + "@aws-sdk/credential-provider-node": "3.441.0", "@aws-sdk/middleware-host-header": "3.433.0", "@aws-sdk/middleware-logger": "3.433.0", "@aws-sdk/middleware-recursion-detection": "3.433.0", "@aws-sdk/middleware-signing": "3.433.0", - "@aws-sdk/middleware-user-agent": "3.433.0", + "@aws-sdk/middleware-user-agent": "3.438.0", "@aws-sdk/region-config-resolver": "3.433.0", "@aws-sdk/types": "3.433.0", - "@aws-sdk/util-endpoints": "3.433.0", + "@aws-sdk/util-endpoints": "3.438.0", "@aws-sdk/util-user-agent-browser": "3.433.0", "@aws-sdk/util-user-agent-node": "3.437.0", "@smithy/config-resolver": "^2.0.16", @@ -824,6 +826,7 @@ "@smithy/util-body-length-node": "^2.1.0", "@smithy/util-defaults-mode-browser": "^2.0.16", "@smithy/util-defaults-mode-node": "^2.0.21", + "@smithy/util-endpoints": "^1.0.2", "@smithy/util-retry": "^2.0.5", "@smithy/util-utf8": "^2.0.0", "tslib": "^2.5.0", @@ -834,20 +837,20 @@ } }, "node_modules/@aws-sdk/client-sso": { - "version": "3.437.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.437.0.tgz", - "integrity": "sha512-AxlLWz9ec3b8Bt+RqRb2Q1ucGQtKrLdKDna+UTjz7AouB/jpoMiegV9NHXVX64N6YFnQnvB0UEGigXiOQE+y/g==", + "version": "3.441.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.441.0.tgz", + "integrity": "sha512-gndGymu4cEIN7WWhQ67RO0JMda09EGBlay2L8IKCHBK/65Y34FHUX1tCNbO2qezEzsi6BPW5o2n53Rd9QqpHUw==", "dependencies": { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/core": "3.436.0", + "@aws-sdk/core": "3.441.0", "@aws-sdk/middleware-host-header": "3.433.0", "@aws-sdk/middleware-logger": "3.433.0", "@aws-sdk/middleware-recursion-detection": "3.433.0", - "@aws-sdk/middleware-user-agent": "3.433.0", + "@aws-sdk/middleware-user-agent": "3.438.0", "@aws-sdk/region-config-resolver": "3.433.0", "@aws-sdk/types": "3.433.0", - "@aws-sdk/util-endpoints": "3.433.0", + "@aws-sdk/util-endpoints": "3.438.0", "@aws-sdk/util-user-agent-browser": "3.433.0", "@aws-sdk/util-user-agent-node": "3.437.0", "@smithy/config-resolver": "^2.0.16", @@ -870,6 +873,7 @@ "@smithy/util-body-length-node": "^2.1.0", "@smithy/util-defaults-mode-browser": "^2.0.16", "@smithy/util-defaults-mode-node": "^2.0.21", + "@smithy/util-endpoints": "^1.0.2", "@smithy/util-retry": "^2.0.5", "@smithy/util-utf8": "^2.0.0", "tslib": "^2.5.0" @@ -879,23 +883,23 @@ } }, "node_modules/@aws-sdk/client-sts": { - "version": "3.437.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.437.0.tgz", - "integrity": "sha512-ilLcrCVwH81UbKNpB9Vax1Fw/mNx2d/bWXkCNXPvrExO+K39VFGS/VijOuSrru2iBq844NlG3uQV8DL/nbiKdA==", + "version": "3.441.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.441.0.tgz", + "integrity": "sha512-GL0Cw2v7XL1cn0T+Sk5VHLlgBJoUdMsysXsHa1mFdk0l6XHMAAnwXVXiNnjmoDSPrG0psz7dL2AKzPVRXbIUjA==", "dependencies": { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/core": "3.436.0", - "@aws-sdk/credential-provider-node": "3.437.0", + "@aws-sdk/core": "3.441.0", + "@aws-sdk/credential-provider-node": "3.441.0", "@aws-sdk/middleware-host-header": "3.433.0", "@aws-sdk/middleware-logger": "3.433.0", "@aws-sdk/middleware-recursion-detection": "3.433.0", "@aws-sdk/middleware-sdk-sts": "3.433.0", "@aws-sdk/middleware-signing": "3.433.0", - "@aws-sdk/middleware-user-agent": "3.433.0", + "@aws-sdk/middleware-user-agent": "3.438.0", "@aws-sdk/region-config-resolver": "3.433.0", "@aws-sdk/types": "3.433.0", - "@aws-sdk/util-endpoints": "3.433.0", + "@aws-sdk/util-endpoints": "3.438.0", "@aws-sdk/util-user-agent-browser": "3.433.0", "@aws-sdk/util-user-agent-node": "3.437.0", "@smithy/config-resolver": "^2.0.16", @@ -918,6 +922,7 @@ "@smithy/util-body-length-node": "^2.1.0", "@smithy/util-defaults-mode-browser": "^2.0.16", "@smithy/util-defaults-mode-node": "^2.0.21", + "@smithy/util-endpoints": "^1.0.2", "@smithy/util-retry": "^2.0.5", "@smithy/util-utf8": "^2.0.0", "fast-xml-parser": "4.2.5", @@ -928,9 +933,9 @@ } }, "node_modules/@aws-sdk/core": { - "version": "3.436.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.436.0.tgz", - "integrity": "sha512-vX5/LjXvCejC2XUY6TSg1oozjqK6BvkE75t0ys9dgqyr5PlZyZksMoeAFHUlj0sCjhT3ziWCujP1oiSpPWY9hg==", + "version": "3.441.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.441.0.tgz", + "integrity": "sha512-gV0eQwR0VnSPUYAbgDkbBtfXbSpZgl/K6UB13DP1IFFjQYbF/BxYwvcQe4jHoPOBifSgjEbl8MfOOeIyI7k9vg==", "dependencies": { "@smithy/smithy-client": "^2.1.12" }, @@ -939,11 +944,11 @@ } }, "node_modules/@aws-sdk/credential-provider-cognito-identity": { - "version": "3.437.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.437.0.tgz", - "integrity": "sha512-XCIb6yfX9YlEc7Hn4dfSkLny31OMpekA7usFsXEnoOn3geCKC1xFvrpa9LhHbxkMqLTVzWPGji2DGlJAb2xxpw==", + "version": "3.441.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.441.0.tgz", + "integrity": "sha512-mIs5vI3zcN/iVyUwpVdEhmFsUFX0x95aGErVh1ratX7fHdtENdSt0X5Bn3yQowze1DRUJBahqsPZuxe35gUt8w==", "dependencies": { - "@aws-sdk/client-cognito-identity": "3.437.0", + "@aws-sdk/client-cognito-identity": "3.441.0", "@aws-sdk/types": "3.433.0", "@smithy/property-provider": "^2.0.0", "@smithy/types": "^2.4.0", @@ -987,13 +992,13 @@ } }, "node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.437.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.437.0.tgz", - "integrity": "sha512-UybiJxYPvdwok5OcI9LakaHmaWZBdkX0gY8yU2n7TomYgWOwDJ88MpQgjXUJJ249PH+9/+How5H3vnFp0xJ0uQ==", + "version": "3.441.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.441.0.tgz", + "integrity": "sha512-SQipQYxYqDUuSOfIhDmaTdwPTcndGQotGZXWJl56mMWqAhU8MkwjK+oMf3VgRt/umJC0QwUCF5HUHIj7gSB1JA==", "dependencies": { "@aws-sdk/credential-provider-env": "3.433.0", "@aws-sdk/credential-provider-process": "3.433.0", - "@aws-sdk/credential-provider-sso": "3.437.0", + "@aws-sdk/credential-provider-sso": "3.441.0", "@aws-sdk/credential-provider-web-identity": "3.433.0", "@aws-sdk/types": "3.433.0", "@smithy/credential-provider-imds": "^2.0.0", @@ -1007,14 +1012,14 @@ } }, "node_modules/@aws-sdk/credential-provider-node": { - "version": "3.437.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.437.0.tgz", - "integrity": "sha512-FMtgEe/me68xZQsymEpMcw7OuuiHaHx/Tp5EqZP5FC0Yv1yX3qr/ncIWU2zY3a9K0iLERmzQI1g3CMd8r4sy8A==", + "version": "3.441.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.441.0.tgz", + "integrity": "sha512-WB9p37yHq6fGJt6Vll29ijHbkh9VDbPM/n5ns73bTAgFD7R0ht5kPmdmHGQA6m3RKjcHLPbymQ3lXykkMwWf/Q==", "dependencies": { "@aws-sdk/credential-provider-env": "3.433.0", - "@aws-sdk/credential-provider-ini": "3.437.0", + "@aws-sdk/credential-provider-ini": "3.441.0", "@aws-sdk/credential-provider-process": "3.433.0", - "@aws-sdk/credential-provider-sso": "3.437.0", + "@aws-sdk/credential-provider-sso": "3.441.0", "@aws-sdk/credential-provider-web-identity": "3.433.0", "@aws-sdk/types": "3.433.0", "@smithy/credential-provider-imds": "^2.0.0", @@ -1043,12 +1048,12 @@ } }, "node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.437.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.437.0.tgz", - "integrity": "sha512-kijtnyyA6/+ipOef4KACsLDUTFWDZ97DSWKU0hJFyGEfelaon6o7NNVufuVOWrBNyklNWZqvPLuwWWQCxb6fuQ==", + "version": "3.441.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.441.0.tgz", + "integrity": "sha512-pTg16G+62mWCE8yGKuQnEBqPdpG5g71remf2jUqXaI1c7GCzbnkQDV9eD4DaAGOvzIs0wo9zAQnS2kVDPFlCYA==", "dependencies": { - "@aws-sdk/client-sso": "3.437.0", - "@aws-sdk/token-providers": "3.437.0", + "@aws-sdk/client-sso": "3.441.0", + "@aws-sdk/token-providers": "3.438.0", "@aws-sdk/types": "3.433.0", "@smithy/property-provider": "^2.0.0", "@smithy/shared-ini-file-loader": "^2.0.6", @@ -1074,20 +1079,20 @@ } }, "node_modules/@aws-sdk/credential-providers": { - "version": "3.437.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.437.0.tgz", - "integrity": "sha512-aLgwo45dTDxAO2Gtx+9y4CfiEhvvGfWz2M+IMS48dQ2gmp1z+GXMiJv1zBhoidL2AvQMOpkgO0bl+qFlC4Cmmw==", - "dependencies": { - "@aws-sdk/client-cognito-identity": "3.437.0", - "@aws-sdk/client-sso": "3.437.0", - "@aws-sdk/client-sts": "3.437.0", - "@aws-sdk/credential-provider-cognito-identity": "3.437.0", + "version": "3.441.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.441.0.tgz", + "integrity": "sha512-DLx7s9/YR1CwWSjVmDMKLhyWrBXOFY3RtDLXh7AD4CAEGjhNr9mYWILMk4E6RtXl1ZhRKTMlkrUQnxNTwmct1w==", + "dependencies": { + "@aws-sdk/client-cognito-identity": "3.441.0", + "@aws-sdk/client-sso": "3.441.0", + "@aws-sdk/client-sts": "3.441.0", + "@aws-sdk/credential-provider-cognito-identity": "3.441.0", "@aws-sdk/credential-provider-env": "3.433.0", "@aws-sdk/credential-provider-http": "3.435.0", - "@aws-sdk/credential-provider-ini": "3.437.0", - "@aws-sdk/credential-provider-node": "3.437.0", + "@aws-sdk/credential-provider-ini": "3.441.0", + "@aws-sdk/credential-provider-node": "3.441.0", "@aws-sdk/credential-provider-process": "3.433.0", - "@aws-sdk/credential-provider-sso": "3.437.0", + "@aws-sdk/credential-provider-sso": "3.441.0", "@aws-sdk/credential-provider-web-identity": "3.433.0", "@aws-sdk/types": "3.433.0", "@smithy/credential-provider-imds": "^2.0.0", @@ -1172,12 +1177,12 @@ } }, "node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.433.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.433.0.tgz", - "integrity": "sha512-jMgA1jHfisBK4oSjMKrtKEZf0sl2vzADivkFmyZFzORpSZxBnF6hC21RjaI+70LJLcc9rSCzLgcoz5lHb9LLDg==", + "version": "3.438.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.438.0.tgz", + "integrity": "sha512-a+xHT1wOxT6EA6YyLmrfaroKWOkwwyiktUfXKM0FsUutGzNi4fKhb5NZ2al58NsXzHgHFrasSDp+Lqbd/X2cEw==", "dependencies": { "@aws-sdk/types": "3.433.0", - "@aws-sdk/util-endpoints": "3.433.0", + "@aws-sdk/util-endpoints": "3.438.0", "@smithy/protocol-http": "^3.0.8", "@smithy/types": "^2.4.0", "tslib": "^2.5.0" @@ -1202,19 +1207,19 @@ } }, "node_modules/@aws-sdk/token-providers": { - "version": "3.437.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.437.0.tgz", - "integrity": "sha512-nV9qIuG0+6XJb7hWpCC+/K7RoY3PZUWndP8BRQv7PQhhpd8tG/I5Kxb0V83h2XFBXyyjnv0aOHO8ehz3Kfcv2Q==", + "version": "3.438.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.438.0.tgz", + "integrity": "sha512-G2fUfTtU6/1ayYRMu0Pd9Ln4qYSvwJOWCqJMdkDgvXSwdgcOSOLsnAIk1AHGJDAvgLikdCzuyOsdJiexr9Vnww==", "dependencies": { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", "@aws-sdk/middleware-host-header": "3.433.0", "@aws-sdk/middleware-logger": "3.433.0", "@aws-sdk/middleware-recursion-detection": "3.433.0", - "@aws-sdk/middleware-user-agent": "3.433.0", + "@aws-sdk/middleware-user-agent": "3.438.0", "@aws-sdk/region-config-resolver": "3.433.0", "@aws-sdk/types": "3.433.0", - "@aws-sdk/util-endpoints": "3.433.0", + "@aws-sdk/util-endpoints": "3.438.0", "@aws-sdk/util-user-agent-browser": "3.433.0", "@aws-sdk/util-user-agent-node": "3.437.0", "@smithy/config-resolver": "^2.0.16", @@ -1239,6 +1244,7 @@ "@smithy/util-body-length-node": "^2.1.0", "@smithy/util-defaults-mode-browser": "^2.0.16", "@smithy/util-defaults-mode-node": "^2.0.21", + "@smithy/util-endpoints": "^1.0.2", "@smithy/util-retry": "^2.0.5", "@smithy/util-utf8": "^2.0.0", "tslib": "^2.5.0" @@ -1260,11 +1266,12 @@ } }, "node_modules/@aws-sdk/util-endpoints": { - "version": "3.433.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.433.0.tgz", - "integrity": "sha512-LFNUh9FH7RMtYjSjPGz9lAJQMzmJ3RcXISzc5X5k2R/9mNwMK7y1k2VAfvx+RbuDbll6xwsXlgv6QHcxVdF2zw==", + "version": "3.438.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.438.0.tgz", + "integrity": "sha512-6VyPTq1kN3GWxwFt5DdZfOsr6cJZPLjWh0troY/0uUv3hK74C9o3Y0Xf/z8UAUvQFkVqZse12O0/BgPVMImvfA==", "dependencies": { "@aws-sdk/types": "3.433.0", + "@smithy/util-endpoints": "^1.0.2", "tslib": "^2.5.0" }, "engines": { @@ -5107,9 +5114,9 @@ } }, "node_modules/@openzeppelin/upgrades-core": { - "version": "1.31.0", - "resolved": "https://registry.npmjs.org/@openzeppelin/upgrades-core/-/upgrades-core-1.31.0.tgz", - "integrity": "sha512-E1Cz8lVpo2mnBeFWxiGDLWtuTYMFNTEWwbnhle4dZ+5UHX6xTRO+Q/CaWBHm33HHhuuiUbRwgGNnAR9zOu+fyQ==", + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/@openzeppelin/upgrades-core/-/upgrades-core-1.31.1.tgz", + "integrity": "sha512-BdkTZwvBxgZ9BYYfhOhuivmqZLOZ/bm6mK5eEDZ36I3Fy64a9BDL/NusaDV5XAoGn4La/j9dZSbTtgP/6d8jAQ==", "dev": true, "dependencies": { "cbor": "^9.0.0", @@ -5936,6 +5943,19 @@ "node": ">= 10.0.0" } }, + "node_modules/@smithy/util-endpoints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-1.0.2.tgz", + "integrity": "sha512-QEdq+sP68IJHAMVB2ugKVVZEWeKQtZLuf+akHzc8eTVElsZ2ZdVLWC6Cp+uKjJ/t4yOj1qu6ZzyxJQEQ8jdEjg==", + "dependencies": { + "@smithy/node-config-provider": "^2.1.3", + "@smithy/types": "^2.4.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">= 14.0.0" + } + }, "node_modules/@smithy/util-hex-encoding": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-2.0.0.tgz", @@ -6181,23 +6201,23 @@ } }, "node_modules/@trezor/analytics": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@trezor/analytics/-/analytics-1.0.8.tgz", - "integrity": "sha512-MUCn0ka9PJqG9Sv5QvUr4ZhjPa4PNLjq5bigvzMy7CcWi5WFBF1VzbHAcJcibzsNQfihtQKUXLFKB5PnDKD8Xg==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@trezor/analytics/-/analytics-1.0.9.tgz", + "integrity": "sha512-ezssF0dNAF6cyyG8WCpW5lEeIMMe5BmP+CDLhRGXKvL8kWudFYqJm8w1vI4Dh4yzmymWnFT5qrgdtRgDe/INxQ==", "dependencies": { - "@trezor/env-utils": "1.0.7", - "@trezor/utils": "9.0.13" + "@trezor/env-utils": "1.0.8", + "@trezor/utils": "9.0.14" } }, "node_modules/@trezor/blockchain-link": { - "version": "2.1.17", - "resolved": "https://registry.npmjs.org/@trezor/blockchain-link/-/blockchain-link-2.1.17.tgz", - "integrity": "sha512-5HPf+aLpu+wh5H2bXPet5HXKPo7CUcugKIqtcYgPVShUiVGH7PYmHtc575VxFkOIbw0xT+s8sTAyK2bdbPhCOA==", - "dependencies": { - "@trezor/blockchain-link-types": "1.0.6", - "@trezor/blockchain-link-utils": "1.0.7", - "@trezor/utils": "9.0.13", - "@trezor/utxo-lib": "1.0.11", + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/@trezor/blockchain-link/-/blockchain-link-2.1.18.tgz", + "integrity": "sha512-seqRx7PbPAd8E3cbNfGeNUqvinNfAHx03XxfD+obyYUkKRkVtaSJIXzIxXKt+ZKxLd4Mf1F+PTIsBdFEjlny9A==", + "dependencies": { + "@trezor/blockchain-link-types": "1.0.7", + "@trezor/blockchain-link-utils": "1.0.8", + "@trezor/utils": "9.0.14", + "@trezor/utxo-lib": "1.0.12", "@types/web": "^0.0.100", "bignumber.js": "^9.1.1", "events": "^3.3.0", @@ -6207,16 +6227,16 @@ } }, "node_modules/@trezor/blockchain-link-types": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@trezor/blockchain-link-types/-/blockchain-link-types-1.0.6.tgz", - "integrity": "sha512-1mlBoIRACqVehZ4DAv4AkbTkbcQ+vJ9IzV4uTdPpbHvfHYhbLc+7EloyIwGMRZ1ol7hxDJVIyGlH04ajStSMFQ==" + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@trezor/blockchain-link-types/-/blockchain-link-types-1.0.7.tgz", + "integrity": "sha512-/zhNsMatUlTeXhh3qJZysYd2GZLUtFffS5aVRybES4IDoXI+W8I1l5cXKEEIoQu1TbyYqXPjBPJKAO9Gtnpm+w==" }, "node_modules/@trezor/blockchain-link-utils": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/@trezor/blockchain-link-utils/-/blockchain-link-utils-1.0.7.tgz", - "integrity": "sha512-3b2W1QIZBYbn2qHZhVDCr9zhURX9vK+FnounYmfCF3Vzi/ltgV1jJsE4M2K51oSOwBAESUx2Gm5ae9drYKqUww==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@trezor/blockchain-link-utils/-/blockchain-link-utils-1.0.8.tgz", + "integrity": "sha512-Mi9QmvUeLQufGgI6VIZFEYVjp8JxsaYn2y6NvagobN+MmAwKi46PwS8c2n+g7qIWwC6AF8TFW3RFp+wzLmZeaw==", "dependencies": { - "@trezor/utils": "9.0.13", + "@trezor/utils": "9.0.14", "bignumber.js": "^9.1.1" } }, @@ -6254,50 +6274,53 @@ } }, "node_modules/@trezor/connect": { - "version": "9.1.4", - "resolved": "https://registry.npmjs.org/@trezor/connect/-/connect-9.1.4.tgz", - "integrity": "sha512-bJIJxOaoVKNLAWS+/0HBPFx56hd5C7Tg7FxqWAWI9EDeXKvLSwzHOJagpOJ8zsr4UmU6ur3yBLBMVR/ykXlVhw==", - "dependencies": { - "@trezor/blockchain-link": "2.1.17", - "@trezor/blockchain-link-types": "1.0.6", - "@trezor/connect-analytics": "1.0.7", - "@trezor/connect-common": "0.0.21", - "@trezor/protobuf": "1.0.1", - "@trezor/protocol": "1.0.1", - "@trezor/transport": "1.1.16", - "@trezor/utils": "9.0.13", - "@trezor/utxo-lib": "1.0.11", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/@trezor/connect/-/connect-9.1.5.tgz", + "integrity": "sha512-elDxUoR7B2gNZzYHsc2QCendmF641afnRFo0s6dO/u/Q8HACqL4MVZoPD4U+P0Rjp8IRY00q4YFX3GcYnBTUPA==", + "dependencies": { + "@trezor/blockchain-link": "2.1.18", + "@trezor/blockchain-link-types": "1.0.7", + "@trezor/connect-analytics": "1.0.8", + "@trezor/connect-common": "0.0.22", + "@trezor/protobuf": "1.0.2", + "@trezor/protocol": "1.0.2", + "@trezor/transport": "1.1.17", + "@trezor/utils": "9.0.14", + "@trezor/utxo-lib": "1.0.12", "bignumber.js": "^9.1.1", "blakejs": "^1.2.1", "bs58": "^5.0.0", "bs58check": "^3.0.1", "cross-fetch": "^3.1.6", "events": "^3.3.0" + }, + "peerDependencies": { + "tslib": "^2.6.2" } }, "node_modules/@trezor/connect-analytics": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/@trezor/connect-analytics/-/connect-analytics-1.0.7.tgz", - "integrity": "sha512-QZGdpB+S5+rn38g3y5UIb8VIrb7f8lL5dQ5ORM/XOAomypixQ3YYjMCL2foP01t4GalfbZgfB5i9n3MhOwiILA==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@trezor/connect-analytics/-/connect-analytics-1.0.8.tgz", + "integrity": "sha512-b0zXr4/6ekNgJYzDb/mydgLY00U4DoM53jYkj7Ar5k+Q3QwwUN8dL0ewufoBQdtXWdJTlJ34eMO/x9zaSlTdVg==", "dependencies": { - "@trezor/analytics": "1.0.8" + "@trezor/analytics": "1.0.9" } }, "node_modules/@trezor/connect-common": { - "version": "0.0.21", - "resolved": "https://registry.npmjs.org/@trezor/connect-common/-/connect-common-0.0.21.tgz", - "integrity": "sha512-rfbWOAcTIvifwl4R+sgs9Ap8h9e6+KI8D3QaF23fIQxmGmb2hPP63NGq1QSa81S+8OYsde2LMEOdMPzuUCEZkA==", + "version": "0.0.22", + "resolved": "https://registry.npmjs.org/@trezor/connect-common/-/connect-common-0.0.22.tgz", + "integrity": "sha512-L44P8dWs0stNAE1q97EoVuVfhNoaC3DS+xDNpR+VouRQUj96XdJhBNKxCM0uvwl87BAdCJtfHV7SFHmjw0KvuA==", "dependencies": { - "@trezor/env-utils": "1.0.7" + "@trezor/env-utils": "1.0.8" } }, "node_modules/@trezor/connect-web": { - "version": "9.1.4", - "resolved": "https://registry.npmjs.org/@trezor/connect-web/-/connect-web-9.1.4.tgz", - "integrity": "sha512-DAhjZiwqE+ckIdLQ/vtFWbFBCTCCJLC1kGaIGRiJwPZfEEq0k/ZPkkOxpiznu6Ol7RQDbgM5CLutLalIC4f4lA==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/@trezor/connect-web/-/connect-web-9.1.5.tgz", + "integrity": "sha512-HThzoK9Ya7cR2ckSWL52K85rDrfJwUU5asN7CfKyLJ3wlt3iPwxLkncbn0sOO/W8oKSiz999l0P8kXRUpOXWqg==", "dependencies": { - "@trezor/connect": "9.1.4", - "@trezor/utils": "9.0.13", + "@trezor/connect": "9.1.5", + "@trezor/utils": "9.0.14", "events": "^3.3.0" } }, @@ -6324,9 +6347,9 @@ } }, "node_modules/@trezor/env-utils": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/@trezor/env-utils/-/env-utils-1.0.7.tgz", - "integrity": "sha512-pJHmIyClho42exY8wBfl1nbs1//1IgW06lhM5V/jrjg+aDprUm5BFKsM2hKOtqVyFf2aqEKwLdLg+uQLkn3f8A==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@trezor/env-utils/-/env-utils-1.0.8.tgz", + "integrity": "sha512-t24rgDx6UDv+ncg7VsWwYwBJv1O9WAQyWg1ZNUjQUTIvR5oglEVZBgyv6CEDasWfvB6A6pshQ5PIYcBBkt5AIg==", "dependencies": { "ua-parser-js": "^1.0.35" }, @@ -6348,9 +6371,9 @@ } }, "node_modules/@trezor/protobuf": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@trezor/protobuf/-/protobuf-1.0.1.tgz", - "integrity": "sha512-/72MrbxB+QM5aCdj9ml6upmJIcNfCi1n6Z+5ue2yQaQEQFdWIyUm77i7IU9SRzT4bZgrFFxRaP16tT1vdzfjTw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@trezor/protobuf/-/protobuf-1.0.2.tgz", + "integrity": "sha512-hYU8Kykd2BzxHAtB9OPLzgVjDPxRHhDVJG9nU3l2aKeWGLSjrXBy39PXwzfYd/9+AMnudDB3XsGpte9q2iPxVQ==", "dependencies": { "bytebuffer": "^5.0.1", "long": "^4.0.0", @@ -6358,21 +6381,21 @@ } }, "node_modules/@trezor/protocol": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@trezor/protocol/-/protocol-1.0.1.tgz", - "integrity": "sha512-jzTrHpE/1AJ3LwNQZ6p++iXJ1DG7YkOU4A/nASy6bI6eRpg/mQIjsj1dkqDwhlfp1rFBbD7xKvDWG4UoMJhlOA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@trezor/protocol/-/protocol-1.0.2.tgz", + "integrity": "sha512-WeUDbiwG/85J4vvzVT6CXYYDzVspivYYhmaiH08IChF5BybD1B/ycrvhJKtq7gKrCoGUk35Z7RKT8oMvWIkHIQ==", "dependencies": { "bytebuffer": "^5.0.1" } }, "node_modules/@trezor/transport": { - "version": "1.1.16", - "resolved": "https://registry.npmjs.org/@trezor/transport/-/transport-1.1.16.tgz", - "integrity": "sha512-uSy29VEbcQ6VolGr8mFjYiL6+YTJJ37etsq44vLE/giaI09fCFzP8Dt6iA1xH+cL6fcgGAS3W8ivrbP69lqCOA==", + "version": "1.1.17", + "resolved": "https://registry.npmjs.org/@trezor/transport/-/transport-1.1.17.tgz", + "integrity": "sha512-5FnS3/6qRO8KK1OWQyKTkMt9dWKjp2WuQXAQgS/LYPRPF53Gkd3MoWS1wKKofbqH+LY1CbLyEpdhwBY1Tz5Yow==", "dependencies": { - "@trezor/protobuf": "1.0.1", - "@trezor/protocol": "1.0.1", - "@trezor/utils": "9.0.13", + "@trezor/protobuf": "1.0.2", + "@trezor/protocol": "1.0.2", + "@trezor/utils": "9.0.14", "bytebuffer": "^5.0.1", "cross-fetch": "^3.1.6", "json-stable-stringify": "^1.0.2", @@ -6382,16 +6405,16 @@ } }, "node_modules/@trezor/utils": { - "version": "9.0.13", - "resolved": "https://registry.npmjs.org/@trezor/utils/-/utils-9.0.13.tgz", - "integrity": "sha512-DvUKEC/Pc5/xOJT6UmQgc29AXakB1tftNo1XMMaDlRKnbDsofuSBiGnxK4pf/Emp5eem4D+9bdnrhHMmLBTQTQ==" + "version": "9.0.14", + "resolved": "https://registry.npmjs.org/@trezor/utils/-/utils-9.0.14.tgz", + "integrity": "sha512-9Q1LtxgAKpNDvvtQttTc/ufYHonnSJ3wmWnxPZsc1H0gn9MLV8WwRMH5+Yl3gJsUKZvcTJ5xwippVWDxPwP8Uw==" }, "node_modules/@trezor/utxo-lib": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@trezor/utxo-lib/-/utxo-lib-1.0.11.tgz", - "integrity": "sha512-21UpKcwLyGGLfACNrg1vrGAmZ8ZSk+h2jtjzCVAOAktSu9fmsLXVBAK9cXfBwWTWjbLacykOvwW/V259vKLGaw==", + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@trezor/utxo-lib/-/utxo-lib-1.0.12.tgz", + "integrity": "sha512-Mtg3bE+Z+8oVfiME2CPZycbpbEyMymF4+YH2eD4aa4adysTimRxwI9+bjrUwMLwUsG1OrrNOVpeail9FrNB+hA==", "dependencies": { - "@trezor/utils": "9.0.13", + "@trezor/utils": "9.0.14", "bchaddrjs": "^0.5.2", "bech32": "^2.0.0", "bip66": "^1.1.5", @@ -6528,9 +6551,9 @@ } }, "node_modules/@typechain/hardhat/node_modules/universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, "engines": { "node": ">= 10.0.0" @@ -6542,12 +6565,6 @@ "integrity": "sha512-XSEUB7zqWXTvNb8oWIcyX8CG5bmCR8YuBJucbi5MfVbJOzADqGfI3kEsGcEee/dwOKe60pQrVPjT+r8SQgcniQ==", "dev": true }, - "node_modules/@types/aws-lambda": { - "version": "8.10.125", - "resolved": "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.125.tgz", - "integrity": "sha512-Vqw/WMlV4O1fJT6capim01v7VLDZkcX1n6Yhb52E7IfnMqYbNfwHfyDV8rRN42NLBtdDvfaqcCqs2K0fr5ljZw==", - "dev": true - }, "node_modules/@types/babel__core": { "version": "7.20.3", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.3.tgz", @@ -6700,9 +6717,9 @@ } }, "node_modules/@types/estree": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.3.tgz", - "integrity": "sha512-CS2rOaoQ/eAgAfcTfq6amKG7bsN+EMcgGY4FAFQdvSj2y1ixvOZTUA9mOtCai7E1SYu283XNw7urKK30nP3wkQ==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.4.tgz", + "integrity": "sha512-2JwWnHK9H+wUZNorf2Zr6ves96WHoWDJIftkcxPKsS7Djta6Zu519LarhRNljPXkpsZR2ZMwNCPeW7omW07BJw==", "dev": true }, "node_modules/@types/express": { @@ -6811,9 +6828,9 @@ } }, "node_modules/@types/jest": { - "version": "29.5.6", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.6.tgz", - "integrity": "sha512-/t9NnzkOpXb4Nfvg17ieHE6EeSjDS2SGSpNYfoLbUAeL/EOueU/RSdOWFpfQTXBEM7BguYW1XQ0EbM+6RlIh6w==", + "version": "29.5.7", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.7.tgz", + "integrity": "sha512-HLyetab6KVPSiF+7pFcUyMeLsx25LDNDemw9mGsJBkai/oouwrjTycocSDYopMEwFhN2Y4s9oPyOCZNofgSt2g==", "dev": true, "dependencies": { "expect": "^29.0.0", @@ -6933,9 +6950,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.8.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.9.tgz", - "integrity": "sha512-UzykFsT3FhHb1h7yD4CA4YhBHq545JC0YnEz41xkipN88eKQtL6rSgocL5tbAP6Ola9Izm/Aw4Ora8He4x0BHg==", + "version": "20.8.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.10.tgz", + "integrity": "sha512-TlgT8JntpcbmKUFzjhsyhGfP2fsiz1Mv56im6enJ905xG1DAYesxJaeSbGqQmAw8OWPdhyJGhGSQGKRNJ45u9w==", "dependencies": { "undici-types": "~5.26.4" } @@ -7367,30 +7384,30 @@ } }, "node_modules/@volar/language-core": { - "version": "1.10.7", - "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-1.10.7.tgz", - "integrity": "sha512-6+WI7HGqWCsKJ/bms4V45WP7eDeoGxDtLjYPrHB7QkIWVkRLIeGPzzBoonZz9kERM+Kld3W89Y+IlICejVAKhA==", + "version": "1.10.10", + "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-1.10.10.tgz", + "integrity": "sha512-nsV1o3AZ5n5jaEAObrS3MWLBWaGwUj/vAsc15FVNIv+DbpizQRISg9wzygsHBr56ELRH8r4K75vkYNMtsSNNWw==", "dev": true, "dependencies": { - "@volar/source-map": "1.10.7" + "@volar/source-map": "1.10.10" } }, "node_modules/@volar/source-map": { - "version": "1.10.7", - "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-1.10.7.tgz", - "integrity": "sha512-anA254XO0lmmeu0p/kvgPOCkrVpqNIHWMvEkPX70PSk4ntg0iBzN/f0Kip6deXvibl6v14Q3Z8RihWrZwdZEEQ==", + "version": "1.10.10", + "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-1.10.10.tgz", + "integrity": "sha512-GVKjLnifV4voJ9F0vhP56p4+F3WGf+gXlRtjFZsv6v3WxBTWU3ZVeaRaEHJmWrcv5LXmoYYpk/SC25BKemPRkg==", "dev": true, "dependencies": { "muggle-string": "^0.3.1" } }, "node_modules/@volar/typescript": { - "version": "1.10.7", - "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-1.10.7.tgz", - "integrity": "sha512-2hvA3vjXVUn1vOpsP/nWLnE5DUmY6YKQhvDRoZVfBrnWwIo0ySxdTUP4XieXGGgSk43xJaeU1zqQS/3Wfm7QgA==", + "version": "1.10.10", + "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-1.10.10.tgz", + "integrity": "sha512-4a2r5bdUub2m+mYVnLu2wt59fuoYWe7nf0uXtGHU8QQ5LDNfzAR0wK7NgDiQ9rcl2WT3fxT2AA9AylAwFtj50A==", "dev": true, "dependencies": { - "@volar/language-core": "1.10.7", + "@volar/language-core": "1.10.10", "path-browserify": "^1.0.1" } }, @@ -8719,8 +8736,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, - "peer": true, "engines": { "node": ">=8" } @@ -8826,9 +8841,9 @@ } }, "node_modules/aws-cdk": { - "version": "2.103.1", - "resolved": "https://registry.npmjs.org/aws-cdk/-/aws-cdk-2.103.1.tgz", - "integrity": "sha512-5DXPlMi8Gf/a6fMqwY6uVwuR21PDDNGkAGkMVTTuaiulc4RsMjQUGq8I4xaPIYQRvR+VHFU+JQ5j5PnI5/gBrA==", + "version": "2.104.0", + "resolved": "https://registry.npmjs.org/aws-cdk/-/aws-cdk-2.104.0.tgz", + "integrity": "sha512-JuCafR5D1lnMKA88JUYhvRYeguozAWneC/n6kR1FUG+kXtXxpEqOxP91118dfJZYRw7FMIkHW8ewddvLwaCy5g==", "dev": true, "bin": { "cdk": "bin/cdk" @@ -9322,8 +9337,7 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "node_modules/base-x": { "version": "3.0.9", @@ -9800,7 +9814,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -10184,9 +10197,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001555", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001555.tgz", - "integrity": "sha512-NzbUFKUnJ3DTcq6YyZB6+qqhfD112uR3uoEnkmfzm2wVzUNsFkU7AwBjKQ654Sp5cau0JxhFyRSn/tQZ+XfygA==", + "version": "1.0.30001559", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001559.tgz", + "integrity": "sha512-cPiMKZgqgkg5LY3/ntGeLFUpi6tzddBNS58A4tnTgQw1zON7u2sZMU7SzOeVH4tj20++9ggL+V6FDOFMTaFFYA==", "dev": true, "funding": [ { @@ -10216,7 +10229,6 @@ "version": "1.6.3", "resolved": "https://registry.npmjs.org/case/-/case-1.6.3.tgz", "integrity": "sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ==", - "dev": true, "engines": { "node": ">= 0.8.0" } @@ -10974,8 +10986,7 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, "node_modules/concat-stream": { "version": "1.6.2", @@ -11124,9 +11135,9 @@ "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, "node_modules/core-js": { - "version": "3.33.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.33.1.tgz", - "integrity": "sha512-qVSq3s+d4+GsqN0teRCJtM6tdEEXyWxjzbhVrCHmBS5ZTM0FS2MOS0D13dUXAWDUN6a+lHI/N1hF9Ytz6iLl9Q==", + "version": "3.33.2", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.33.2.tgz", + "integrity": "sha512-XeBzWI6QL3nJQiHmdzbAOiMYqjrb7hwU7A39Qhvd/POSa/t9E1AeZyEZx3fNvp/vtM8zXwhoL0FsiS0hD0pruQ==", "hasInstallScript": true, "funding": { "type": "opencollective", @@ -11357,9 +11368,9 @@ "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" }, "node_modules/cytoscape": { - "version": "3.26.0", - "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.26.0.tgz", - "integrity": "sha512-IV+crL+KBcrCnVVUCZW+zRRRFUZQcrtdOPXki+o4CFUWLdAEYvuZLcBSJC9EBK++suamERKzeY7roq2hdovV3w==", + "version": "3.27.0", + "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.27.0.tgz", + "integrity": "sha512-pPZJilfX9BxESwujODz5pydeGi+FBrXq1rcaB1mfhFXXFJ9GjE6CNndAk+8jPzoXGD+16LtSS4xlYEIUiW4Abg==", "dev": true, "dependencies": { "heap": "^0.2.6", @@ -12611,9 +12622,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/electron-to-chromium": { - "version": "1.4.569", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.569.tgz", - "integrity": "sha512-LsrJjZ0IbVy12ApW3gpYpcmHS3iRxH4bkKOW98y1/D+3cvDUWGcbzbsFinfUS8knpcZk/PG/2p/RnkMCYN7PVg==", + "version": "1.4.575", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.575.tgz", + "integrity": "sha512-kY2BGyvgAHiX899oF6xLXSIf99bAvvdPhDoJwG77nxCSyWYuRH6e9a9a3gpXBvCs6lj4dQZJkfnW2hdKWHEISg==", "dev": true }, "node_modules/elkjs": { @@ -14650,7 +14661,6 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "dev": true, "dependencies": { "graceful-fs": "^4.1.2", "jsonfile": "^4.0.0", @@ -15287,9 +15297,9 @@ } }, "node_modules/hardhat": { - "version": "2.18.3", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.18.3.tgz", - "integrity": "sha512-JuYaTG+4ZHVjEHCW5Hn6jCHH3LpO75dtgznZpM/dLv12RcSlw/xHbeQh3FAsGahQr1epKryZcZEMHvztVZHe0g==", + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.19.0.tgz", + "integrity": "sha512-kMpwovOEfrFRQXEopCP+JTcKVwSYVj8rnXE0LynxDqnh06yvyKCQknmXL6IVYTHQL6Csysc/yNbCHQbjSeJGpA==", "dev": true, "dependencies": { "@ethersproject/abi": "^5.1.2", @@ -16023,7 +16033,6 @@ "version": "5.2.4", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true, "engines": { "node": ">= 4" } @@ -17613,9 +17622,9 @@ } }, "node_modules/jiti": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.20.0.tgz", - "integrity": "sha512-3TV69ZbrvV6U5DfQimop50jE9Dl6J8O1ja1dvBbMba/sZ3YBEQqJ2VZRoQPVnhlzjNtU1vaXRZVrVjU4qtm8yA==", + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz", + "integrity": "sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==", "dev": true, "bin": { "jiti": "bin/jiti.js" @@ -17771,8 +17780,6 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.1.tgz", "integrity": "sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ==", - "dev": true, - "peer": true, "engines": { "node": "*" } @@ -18506,9 +18513,7 @@ "node_modules/lodash.truncate": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", - "dev": true, - "peer": true + "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==" }, "node_modules/lodash.uniqby": { "version": "4.7.0", @@ -19510,7 +19515,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -21523,9 +21527,9 @@ } }, "node_modules/punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "engines": { "node": ">=6" } @@ -22459,7 +22463,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -24743,8 +24746,6 @@ "version": "6.8.1", "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", - "dev": true, - "peer": true, "dependencies": { "ajv": "^8.0.1", "lodash.truncate": "^4.4.2", @@ -24793,8 +24794,6 @@ "version": "8.12.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", @@ -24810,8 +24809,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "peer": true, "engines": { "node": ">=8" } @@ -24819,16 +24816,12 @@ "node_modules/table/node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true, - "peer": true + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, "node_modules/table/node_modules/slice-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "peer": true, "dependencies": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", @@ -27771,7 +27764,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.1.tgz", "integrity": "sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==", - "dev": true, "engines": { "node": ">= 14" } @@ -27898,9 +27890,9 @@ } }, "node_modules/zx/node_modules/@types/node": { - "version": "18.18.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.7.tgz", - "integrity": "sha512-bw+lEsxis6eqJYW8Ql6+yTqkE6RuFtsQPSe5JxXbqYRFQEER5aJA9a5UH9igqDWm3X4iLHIKOHlnAXLM4mi7uQ==", + "version": "18.18.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.8.tgz", + "integrity": "sha512-OLGBaaK5V3VRBS1bAkMVP2/W9B+H8meUfl866OrMNQqt7wDgdpWPp5o6gmIc9pB+lIQHSq4ZL8ypeH1vPxcPaQ==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -28003,9 +27995,9 @@ } }, "node_modules/zx/node_modules/universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, "engines": { "node": ">= 10.0.0" @@ -28099,7 +28091,6 @@ "name": "@casimir/redirect", "devDependencies": { "@types/aws-cloudfront-function": "^1.0.3", - "@types/aws-lambda": "^8.10.125", "@types/node": "^17.0.38", "esbuild": "^0.15.9" } diff --git a/package.json b/package.json index 65c6ef850..91fa09d86 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,6 @@ "deploy:cdk": "npx esno -r dotenv/config scripts/cdk/deploy.ts", "deploy:ethereum": "npx esno -r dotenv/config scripts/ethereum/deploy.ts", "dev": "npx esno -r dotenv/config scripts/root/dev.ts", - "dev:ethereum": "npx esno -r dotenv/config scripts/ethereum/dev.ts", "dev:landing": "APP=landing npm run dev", "docgen": "npm run docgen --workspace @casimir/ethereum", "lint": "eslint --ext .vue,.ts ./ --fix", @@ -28,7 +27,6 @@ "test": "echo \"Error: no test specified\" && exit 1", "test:actions": "npx esno -r dotenv/config scripts/actions/test.ts", "test:cdk": "npx esno -r dotenv/config scripts/cdk/test.ts", - "test:ethereum": "npx esno -r dotenv/config scripts/ethereum/test.ts", "upgrade:ethereum": "npx esno -r dotenv/config scripts/ethereum/upgrade.ts" }, "repository": { diff --git a/scripts/ethereum/dev.ts b/scripts/ethereum/dev.ts deleted file mode 100644 index 2685b505a..000000000 --- a/scripts/ethereum/dev.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { ethers } from 'ethers' -import { loadCredentials, getSecret } from '@casimir/aws' -import { ETHEREUM_CONTRACTS, ETHEREUM_NETWORK_NAME, ETHEREUM_RPC_URL } from '@casimir/env' -import { run } from '@casimir/shell' - -/** - * Run an ethereum development environment - */ -void async function () { - if (process.env.USE_SECRETS !== 'false') { - await loadCredentials() - process.env.BIP39_SEED = process.env.BIP39_SEED || await getSecret('consensus-networks-bip39-seed') as string - } else { - process.env.BIP39_SEED = process.env.BIP39_SEED || 'inflict ball claim confirm cereal cost note dad mix donate traffic patient' - } - console.log(`Your mnemonic seed is ${process.env.BIP39_SEED}`) - - process.env.FORK = process.env.FORK || 'testnet' - process.env.TUNNEL = process.env.TUNNEL || 'false' - process.env.MINING_INTERVAL = '12' - process.env.ETHEREUM_RPC_URL = 'http://127.0.0.1:8545' - - process.env.ETHEREUM_FORK_RPC_URL = ETHEREUM_RPC_URL[process.env.FORK.toUpperCase()] - if (!process.env.ETHEREUM_FORK_RPC_URL) { - throw new Error(`Ethereum ${process.env.FORK} is not supported`) - } - - const networkName = ETHEREUM_NETWORK_NAME[process.env.FORK.toUpperCase()] - - console.log(`Using ${networkName} fork from ${process.env.ETHEREUM_FORK_RPC_URL}`) - console.log(`Serving local fork at ${process.env.ETHEREUM_RPC_URL}`) - - const provider = new ethers.providers.JsonRpcProvider(process.env.ETHEREUM_FORK_RPC_URL) - process.env.ETHEREUM_FORK_BLOCK = process.env.ETHEREUM_FORK_BLOCK || `${await provider.getBlockNumber() - 10}` - console.log(`📍 Forking started at ${process.env.ETHEREUM_FORK_BLOCK}`) - - const wallet = ethers.Wallet.fromMnemonic(process.env.BIP39_SEED) - - // Account for the mock, beacon, and library deployments - const walletNonce = await provider.getTransactionCount(wallet.address) + 13 - - if (!process.env.FACTORY_ADDRESS) { - process.env.FACTORY_ADDRESS = ethers.utils.getContractAddress({ - from: wallet.address, - nonce: walletNonce - }) - } - - process.env.SSV_NETWORK_ADDRESS = ETHEREUM_CONTRACTS[process.env.FORK.toUpperCase()]?.SSV_NETWORK_ADDRESS - process.env.SSV_VIEWS_ADDRESS = ETHEREUM_CONTRACTS[process.env.FORK.toUpperCase()]?.SSV_VIEWS_ADDRESS - process.env.SWAP_FACTORY_ADDRESS = ETHEREUM_CONTRACTS[process.env.FORK.toUpperCase()]?.SWAP_FACTORY_ADDRESS - - run('npm run node --workspace @casimir/ethereum') - const hardhatWaitTime = 2500 - await new Promise(resolve => setTimeout(resolve, hardhatWaitTime)) - run('npm run dev --workspace @casimir/ethereum -- --network localhost') -}() diff --git a/scripts/root/dev.ts b/scripts/root/dev.ts index 0f2a2ccf7..58e988108 100644 --- a/scripts/root/dev.ts +++ b/scripts/root/dev.ts @@ -3,12 +3,26 @@ import { loadCredentials, getSecret } from '@casimir/aws' import { ETHEREUM_CONTRACTS, ETHEREUM_NETWORK_NAME, ETHEREUM_RPC_URL } from '@casimir/env' import { run, runSync } from '@casimir/shell' -console.log(ETHEREUM_CONTRACTS['TESTNET'].FUNCTIONS_BILLING_REGISTRY_ADDRESS, ETHEREUM_CONTRACTS['TESTNET'].KEEPER_REGISTRAR_ADDRESS, ETHEREUM_CONTRACTS['TESTNET'].KEEPER_REGISTRY_ADDRESS, ETHEREUM_CONTRACTS['TESTNET'].LINK_TOKEN_ADDRESS, ETHEREUM_CONTRACTS['TESTNET'].SSV_NETWORK_ADDRESS, ETHEREUM_CONTRACTS['TESTNET'].SSV_TOKEN_ADDRESS, ETHEREUM_CONTRACTS['TESTNET'].SWAP_FACTORY_ADDRESS, ETHEREUM_CONTRACTS['TESTNET'].SWAP_ROUTER_ADDRESS, ETHEREUM_CONTRACTS['TESTNET'].WETH_TOKEN_ADDRESS) - /** - * Run an integrated development environment + * Root script used to run an integrated development environment + * You can override the following configuration environment variables: + * - PROJECT: casimir + * - STAGE: local | dev | sandbox | prod + * - APP: web | landing + * - NETWORK: mainnet | testnet + * - FORK: mainnet | testnet + * - USE_SECRETS: true | false + * - BUILD_PREVIEW: true | false + * - MOCK_SERVICES: true | false + * - BIP39_SEED: string + * - CRYPTO_COMPARE_API_KEY: string + * - HACKMD_TOKEN: string + * - WALLET_CONNECT_PROJECT_ID: string + * - ETHEREUM_RPC_URL: string + * - ETHEREUM_FORK_RPC_URL: string + * - ETHEREUM_FORK_BLOCK: string */ -void async function () { +async function root() { const apps = { landing: { contracts: false, @@ -76,48 +90,32 @@ void async function () { } const networkKey = process.env.NETWORK?.toUpperCase() || process.env.FORK?.toUpperCase() || 'TESTNET' + process.env.FACTORY_ADDRESS = ETHEREUM_CONTRACTS[networkKey]?.FACTORY_ADDRESS process.env.SSV_NETWORK_ADDRESS = ETHEREUM_CONTRACTS[networkKey]?.SSV_NETWORK_ADDRESS process.env.SSV_VIEWS_ADDRESS = ETHEREUM_CONTRACTS[networkKey]?.SSV_VIEWS_ADDRESS process.env.SWAP_FACTORY_ADDRESS = ETHEREUM_CONTRACTS[networkKey]?.SWAP_FACTORY_ADDRESS if (apps[app].contracts) { if (process.env.NETWORK) { - process.env.ETHEREUM_RPC_URL = ETHEREUM_RPC_URL[networkKey] const networkName = ETHEREUM_NETWORK_NAME[networkKey] - - console.log(`Using ${networkName} network from ${process.env.ETHEREUM_RPC_URL}`) - - if (!process.env.ETHEREUM_RPC_URL) { - throw new Error(`Ethereum ${process.env.NETWORK} is not supported`) - } - - process.env.FACTORY_ADDRESS = ETHEREUM_CONTRACTS[networkKey]?.FACTORY_ADDRESS - if (!process.env.FACTORY_ADDRESS) { - throw new Error(`No factory address provided for ${process.env.NETWORK} ethereum network.`) - } + process.env.ETHEREUM_RPC_URL = ETHEREUM_RPC_URL[networkKey] + console.log(`Connecting to ${networkName} network at ${process.env.ETHEREUM_RPC_URL}`) } else { + const networkName = ETHEREUM_NETWORK_NAME[networkKey] process.env.ETHEREUM_FORK_RPC_URL = ETHEREUM_RPC_URL[networkKey] - if (!process.env.ETHEREUM_FORK_RPC_URL) { - throw new Error(`Ethereum ${process.env.FORK} is not supported`) - } - process.env.ETHEREUM_RPC_URL = 'http://127.0.0.1:8545' - + console.log(`Connecting to ${networkName} network fork at ${process.env.ETHEREUM_RPC_URL}`) + const provider = new ethers.providers.JsonRpcProvider(process.env.ETHEREUM_FORK_RPC_URL) process.env.ETHEREUM_FORK_BLOCK = process.env.ETHEREUM_FORK_BLOCK || `${await provider.getBlockNumber() - 10}` - - const wallet = ethers.Wallet.fromMnemonic(process.env.BIP39_SEED) - - // Account for the mock, beacon, and library deployments - const walletNonce = await provider.getTransactionCount(wallet.address) + 13 - - if (!process.env.FACTORY_ADDRESS) { - process.env.FACTORY_ADDRESS = ethers.utils.getContractAddress({ - from: wallet.address, - nonce: walletNonce - }) - } - - run('npm run dev:ethereum') + console.log(`📍 Forking started at ${process.env.ETHEREUM_FORK_BLOCK}`) + + process.env.TUNNEL = process.env.TUNNEL || 'false' + process.env.MINING_INTERVAL = '12' + run('npm run node --workspace @casimir/ethereum') + await new Promise(resolve => setTimeout(resolve, 2500)) + + console.log(`Serving local fork at ${process.env.ETHEREUM_RPC_URL}`) + run('npm run dev --workspace @casimir/ethereum -- --network localhost') } } @@ -147,4 +145,9 @@ void async function () { process.exit() }) } -}() +} + +root().catch(error => { + console.error(error) + process.exit(1) +}) diff --git a/services/functions/API-request-source.js b/services/functions/API-request-source.js index 9c513438e..8f1b974eb 100644 --- a/services/functions/API-request-source.js +++ b/services/functions/API-request-source.js @@ -179,21 +179,18 @@ async function getDepositedPoolPublicKeys(startIndex, endIndex) { } }) if (request.error) throw new Error('Failed to get validator public keys') - const rawPublicKeys = request.data.result.slice(2) - const numKeys = parseInt(rawPublicKeys.slice(64, 128), 16) - const publicKeys = [] - for (let i = 0; i < numKeys; i++) { - let offset = 64 * 3 + i * 96 - let length = parseInt(rawPublicKeys.slice(offset, offset + 64), 16) * 2 - let publicKeyStart = offset + 64 - let publicKeyEnd = publicKeyStart + length - let publicKey = '0x' + rawPublicKeys.slice(publicKeyStart, publicKeyEnd) - publicKeys.push(publicKey) - } - return [ - '0x853b4caf348bccddbf7e1c25e68676c3b3f857958c93b290a2bf84974ea33c4f793f1bbf7e9e9923f16e2237038e7b69', - '0x8889a628f263c414e256a1295c3f49ac1780e0b9cac8493dd1bd2f17b3b257660a12fb88f65333fa00c9a735c0f8d0e8' - ] + const rawPublicKeys = request.data.result.slice(2) + const dataOffset = parseInt(rawPublicKeys.slice(0, 64), 16) + const numKeys = parseInt(rawPublicKeys.slice(dataOffset * 2, dataOffset * 2 + 64), 16) + const publicKeys = [] + let keysStartPosition = dataOffset * 2 + 64 + for (let i = 0; i < numKeys; i++) { + let keyStart = keysStartPosition + i * 128 + let keyEnd = keyStart + 128 + let key = '0x' + rawPublicKeys.slice(keyStart, keyEnd) + publicKeys.push(key) + } + return publicKeys } async function getDepositedPoolStatuses(startIndex, endIndex) {