diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..d487ac9 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,103 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +### [0.1.5](///compare/v0.1.4...v0.1.5) (2024-06-02) + + +### Features + +* **nextjs:** πŸ‘» Sepolia | Network 243f245 + + +### Bug Fixes + +* **hardhat:** πŸ‘» Base & Avax | Secrets Endpoints 9ba439d +* **hardhat:** πŸ‘» Registered Subscriptions | Gateway 1d1039f +* **hardhat:** πŸ‘» Secrets 18d38a4 + +### [0.1.4](///compare/v0.1.3...v0.1.4) (2024-06-01) + + +### Features + +* **hardhat:** πŸ‘» Base | Main & Sepolia 1bd453b +* **hardhat:** πŸ‘» Functions eb7799b +* **hardhat:** πŸ‘» Gateway 33d01c8 +* **nextjs:** πŸ‘» Networks 7b4c5d9 + +### [0.1.3](///compare/v0.1.2...v0.1.3) (2024-06-01) + + +### Features + +* Store selected values in local storage for SignUp pages 2955848 + +### [0.1.2](///compare/v0.1.1...v0.1.2) (2024-05-30) + + +### Features + +* **nextjs:** πŸ‘» App Providers | Wagmi & Rainbow 4627808 +* **nextjs:** πŸ‘» Eth ID | SignUp 54e4c35 +* **nextjs:** πŸ‘» Submit 658f8b4 + + +### Bug Fixes + +* **nextjs:** πŸ‘» Steps handler 9a7d55e + +### [0.1.1](///compare/v0.1.0...v0.1.1) (2024-05-30) + + +### Features + +* add "In Discord" step to sign up process 4372472 +* add back button reusable component e5a90c2 +* add font milonga and oswald 6898e7b +* add new comonent input, selection, circular affb8d5 +* add sign up form page 13689f5 +* add typograpy component 902377d +* new component email, name, role page 0c042f0 +* **nextjs:** πŸ‘» Analytics 99f9904 +* **nextjs:** πŸ‘» CMS deba31f +* **nextjs:** πŸ‘» CMS 89af61c +* reusable button 5c12e11 + + +### Bug Fixes + +* **nextjs:** πŸ‘» Users DB Connection 4a00b32 + +## 0.1.0 (2024-05-24) + + +### Features + +* **hardhat:** πŸ‘» Chainlink Contracts f94a6b6 +* **hardhat:** πŸ‘» Chainlink Functions 2eaba29 +* **hardhat:** πŸ‘» Functions c6c6fac +* **hardhat:** πŸ‘» Functions Gateway 0dcce9b +* **hardhat:** πŸ‘» Gateway Clients 7e869c0 +* **hardhat:** πŸ‘» Gateway Interfaces 4672e64 +* **hardhat:** πŸ‘» Networks | Chainlink Config 7515d76 +* **hardhat:** πŸ‘» Register Request | Gateway e536690 +* **hardhat:** πŸ‘» Subscriptions | Chainlink Functions 968dff9 +* **hardhat:** πŸ‘» Task(subscriptions) | Create & Fund 59cafcd +* **hardhat:** πŸ‘» Tasks | Chainlink 18e31e4 + + +### Bug Fixes + +* **hardhat:** πŸ‘» Chainlink Functions Manager d586791 + +### 0.0.2 (2024-05-22) + + +### Features + +* **hardhat:** πŸ‘» Chainlink Contracts f94a6b6 +* **hardhat:** πŸ‘» Chainlink Functions 2eaba29 +* **hardhat:** πŸ‘» Functions Gateway 0dcce9b +* **hardhat:** πŸ‘» Gateway Clients 7e869c0 +* **hardhat:** πŸ‘» Gateway Interfaces 4672e64 diff --git a/Group 9.png b/Group 9.png new file mode 100644 index 0000000..430e176 Binary files /dev/null and b/Group 9.png differ diff --git a/README.md b/README.md index 9109e28..8d566fe 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,48 @@
- Optimism + Ceptor Club

-# πŸ—πŸ”΄ Scaffold-OP +# πŸ—πŸ”΄ Ceptor-Games-Scaffold

Documentation | Website

-Scaffold-OP is a fork of Scaffold-ETH2 with minimal differences, providing additional dApp examples, native support for Superchain testnets, and more low-level instructions. We highly recommend the Scaffold-ETH2 docs as the primary guideline. +## Games Team + +**Gaozong:** Our UX / PM, superstar + +**Tippi:** Smart Contracts and GM + +**Verinta:** The Qwizzler, frontend and even a smart contract too! + +Ceptor-Scaffold-OP is a fork of Scaffold-ETH2 with fantastic differences, providing additional dApp examples, native support for Superchain testnets, and more low-level instructions. We highly recommend the Scaffold-ETH2 docs as the primary guideline. + +# Games Contracts + +### [Game World Generator](BuyMeACeptor.sol) +Step into the realms of creativity with our Game World Generator. This contract spawns a unique game world, sculpted by your chosen vibe and number of players. Picture a planet alive with scenarios, locations, descriptions, maps, denizens, secrets, goals, and players. Each world, distinct and thriving on its own blockchain, is birthed for 10 gameTokens. Craft your world, or join the adventure: 5 gT as a GM, 2 gT as a player. + +**Inside worlds:** +- Games: Rich with adventure. +- Schedules: Timed meticulously. +- Sessions: Verified attendance. + +### [Character Generator](packages/hardhat/contracts/CeptorCharacterGenerator.sol) +Unleash your avatar in the game world. This contract creates characters with abilities, class, name, alignment, and background. Each character boasts unique attributes. Note: Currently restricted to contract owner, slated for VRF2.5 upgrade. + +### [World and Game Management](packages/hardhat/contracts/WorldFactory.sol) +The World Generator deploys a World contract. Each World tracks its games, ensuring verifiable truth within sessions. + +### [NPC Generator] +Forge the world’s inhabitants. The NPC Generator creates non-player characters, each with unique abilities, class, name, alignment, hometown, and background. This, too, is destined for the VRF2.5 upgrade. + +--- + +Crafted with the prowess of a Level 5 Barbarian, the ingenuity of an Artificer 2, and the cosmic insight of a Druid of the Stars 2, by Tippi Fifestarr. πŸ§ͺ An open-source, up-to-date toolkit for building decentralized applications (dapps) on the Ethereum blockchain. It's designed to make it easier for developers to create and deploy smart contracts and build user interfaces that interact with those contracts. diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..d4a2d4e --- /dev/null +++ b/package-lock.json @@ -0,0 +1,20272 @@ +{ + "name": "se-2", + "version": "0.1.5", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "se-2", + "version": "0.1.5", + "hasInstallScript": true, + "devDependencies": { + "husky": "^8.0.1", + "lint-staged": "^13.0.3" + }, + "workspaces": { + "packages": [ + "packages/hardhat", + "packages/nextjs" + ] + } + }, + "node_modules/@babel/code-frame": { + "version": "7.24.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.2.tgz", + "integrity": "sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==", + "dependencies": { + "@babel/highlight": "^7.24.2", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.24.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.5.tgz", + "integrity": "sha512-3q93SSKX2TWCG30M2G2kwaKeTYgEUp5Snjuj8qm729SObL6nbtUldAi37qbxkD5gg3xnBio+f9nqpSepGZMvxA==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.24.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.5.tgz", + "integrity": "sha512-8lLmua6AVh/8SLJRRVD6V8p73Hir9w5mJrhE+IPpILG31KKlI9iz5zmBYKcWPS59qSfgP9RaSBQSHHE81WKuEw==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.24.5", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.24.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.5.tgz", + "integrity": "sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@chainlink/contracts": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@chainlink/contracts/-/contracts-1.1.0.tgz", + "integrity": "sha512-J+gDUCnEOJ2ofCvy5L2VLrQ7DVs0NXK31w8MQrW6U1GpjzU1j+it7FOJHZMxZKGg7wDdWI06aWmCgFeiD1H+bA==", + "dependencies": { + "@changesets/changelog-github": "^0.4.8", + "@changesets/cli": "~2.26.2", + "@eth-optimism/contracts": "0.6.0", + "@openzeppelin/contracts": "4.9.3", + "@openzeppelin/contracts-upgradeable": "4.9.3", + "@scroll-tech/contracts": "0.1.0", + "semver": "^7.6.0" + } + }, + "node_modules/@changesets/apply-release-plan": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-6.1.4.tgz", + "integrity": "sha512-FMpKF1fRlJyCZVYHr3CbinpZZ+6MwvOtWUuO8uo+svcATEoc1zRDcj23pAurJ2TZ/uVz1wFHH6K3NlACy0PLew==", + "dependencies": { + "@babel/runtime": "^7.20.1", + "@changesets/config": "^2.3.1", + "@changesets/get-version-range-type": "^0.3.2", + "@changesets/git": "^2.0.0", + "@changesets/types": "^5.2.1", + "@manypkg/get-packages": "^1.1.3", + "detect-indent": "^6.0.0", + "fs-extra": "^7.0.1", + "lodash.startcase": "^4.4.0", + "outdent": "^0.5.0", + "prettier": "^2.7.1", + "resolve-from": "^5.0.0", + "semver": "^7.5.3" + } + }, + "node_modules/@changesets/assemble-release-plan": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/@changesets/assemble-release-plan/-/assemble-release-plan-5.2.4.tgz", + "integrity": "sha512-xJkWX+1/CUaOUWTguXEbCDTyWJFECEhmdtbkjhn5GVBGxdP/JwaHBIU9sW3FR6gD07UwZ7ovpiPclQZs+j+mvg==", + "dependencies": { + "@babel/runtime": "^7.20.1", + "@changesets/errors": "^0.1.4", + "@changesets/get-dependents-graph": "^1.3.6", + "@changesets/types": "^5.2.1", + "@manypkg/get-packages": "^1.1.3", + "semver": "^7.5.3" + } + }, + "node_modules/@changesets/changelog-git": { + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@changesets/changelog-git/-/changelog-git-0.1.14.tgz", + "integrity": "sha512-+vRfnKtXVWsDDxGctOfzJsPhaCdXRYoe+KyWYoq5X/GqoISREiat0l3L8B0a453B2B4dfHGcZaGyowHbp9BSaA==", + "dependencies": { + "@changesets/types": "^5.2.1" + } + }, + "node_modules/@changesets/changelog-github": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/@changesets/changelog-github/-/changelog-github-0.4.8.tgz", + "integrity": "sha512-jR1DHibkMAb5v/8ym77E4AMNWZKB5NPzw5a5Wtqm1JepAuIF+hrKp2u04NKM14oBZhHglkCfrla9uq8ORnK/dw==", + "dependencies": { + "@changesets/get-github-info": "^0.5.2", + "@changesets/types": "^5.2.1", + "dotenv": "^8.1.0" + } + }, + "node_modules/@changesets/cli": { + "version": "2.26.2", + "resolved": "https://registry.npmjs.org/@changesets/cli/-/cli-2.26.2.tgz", + "integrity": "sha512-dnWrJTmRR8bCHikJHl9b9HW3gXACCehz4OasrXpMp7sx97ECuBGGNjJhjPhdZNCvMy9mn4BWdplI323IbqsRig==", + "dependencies": { + "@babel/runtime": "^7.20.1", + "@changesets/apply-release-plan": "^6.1.4", + "@changesets/assemble-release-plan": "^5.2.4", + "@changesets/changelog-git": "^0.1.14", + "@changesets/config": "^2.3.1", + "@changesets/errors": "^0.1.4", + "@changesets/get-dependents-graph": "^1.3.6", + "@changesets/get-release-plan": "^3.0.17", + "@changesets/git": "^2.0.0", + "@changesets/logger": "^0.0.5", + "@changesets/pre": "^1.0.14", + "@changesets/read": "^0.5.9", + "@changesets/types": "^5.2.1", + "@changesets/write": "^0.2.3", + "@manypkg/get-packages": "^1.1.3", + "@types/is-ci": "^3.0.0", + "@types/semver": "^7.5.0", + "ansi-colors": "^4.1.3", + "chalk": "^2.1.0", + "enquirer": "^2.3.0", + "external-editor": "^3.1.0", + "fs-extra": "^7.0.1", + "human-id": "^1.0.2", + "is-ci": "^3.0.1", + "meow": "^6.0.0", + "outdent": "^0.5.0", + "p-limit": "^2.2.0", + "preferred-pm": "^3.0.0", + "resolve-from": "^5.0.0", + "semver": "^7.5.3", + "spawndamnit": "^2.0.0", + "term-size": "^2.1.0", + "tty-table": "^4.1.5" + }, + "bin": { + "changeset": "bin.js" + } + }, + "node_modules/@changesets/cli/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/cli/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/cli/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@changesets/config": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@changesets/config/-/config-2.3.1.tgz", + "integrity": "sha512-PQXaJl82CfIXddUOppj4zWu+987GCw2M+eQcOepxN5s+kvnsZOwjEJO3DH9eVy+OP6Pg/KFEWdsECFEYTtbg6w==", + "dependencies": { + "@changesets/errors": "^0.1.4", + "@changesets/get-dependents-graph": "^1.3.6", + "@changesets/logger": "^0.0.5", + "@changesets/types": "^5.2.1", + "@manypkg/get-packages": "^1.1.3", + "fs-extra": "^7.0.1", + "micromatch": "^4.0.2" + } + }, + "node_modules/@changesets/errors": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@changesets/errors/-/errors-0.1.4.tgz", + "integrity": "sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q==", + "dependencies": { + "extendable-error": "^0.1.5" + } + }, + "node_modules/@changesets/get-dependents-graph": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/@changesets/get-dependents-graph/-/get-dependents-graph-1.3.6.tgz", + "integrity": "sha512-Q/sLgBANmkvUm09GgRsAvEtY3p1/5OCzgBE5vX3vgb5CvW0j7CEljocx5oPXeQSNph6FXulJlXV3Re/v3K3P3Q==", + "dependencies": { + "@changesets/types": "^5.2.1", + "@manypkg/get-packages": "^1.1.3", + "chalk": "^2.1.0", + "fs-extra": "^7.0.1", + "semver": "^7.5.3" + } + }, + "node_modules/@changesets/get-dependents-graph/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/get-dependents-graph/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/get-dependents-graph/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@changesets/get-github-info": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@changesets/get-github-info/-/get-github-info-0.5.2.tgz", + "integrity": "sha512-JppheLu7S114aEs157fOZDjFqUDpm7eHdq5E8SSR0gUBTEK0cNSHsrSR5a66xs0z3RWuo46QvA3vawp8BxDHvg==", + "dependencies": { + "dataloader": "^1.4.0", + "node-fetch": "^2.5.0" + } + }, + "node_modules/@changesets/get-release-plan": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/@changesets/get-release-plan/-/get-release-plan-3.0.17.tgz", + "integrity": "sha512-6IwKTubNEgoOZwDontYc2x2cWXfr6IKxP3IhKeK+WjyD6y3M4Gl/jdQvBw+m/5zWILSOCAaGLu2ZF6Q+WiPniw==", + "dependencies": { + "@babel/runtime": "^7.20.1", + "@changesets/assemble-release-plan": "^5.2.4", + "@changesets/config": "^2.3.1", + "@changesets/pre": "^1.0.14", + "@changesets/read": "^0.5.9", + "@changesets/types": "^5.2.1", + "@manypkg/get-packages": "^1.1.3" + } + }, + "node_modules/@changesets/get-version-range-type": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@changesets/get-version-range-type/-/get-version-range-type-0.3.2.tgz", + "integrity": "sha512-SVqwYs5pULYjYT4op21F2pVbcrca4qA/bAA3FmFXKMN7Y+HcO8sbZUTx3TAy2VXulP2FACd1aC7f2nTuqSPbqg==" + }, + "node_modules/@changesets/git": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@changesets/git/-/git-2.0.0.tgz", + "integrity": "sha512-enUVEWbiqUTxqSnmesyJGWfzd51PY4H7mH9yUw0hPVpZBJ6tQZFMU3F3mT/t9OJ/GjyiM4770i+sehAn6ymx6A==", + "dependencies": { + "@babel/runtime": "^7.20.1", + "@changesets/errors": "^0.1.4", + "@changesets/types": "^5.2.1", + "@manypkg/get-packages": "^1.1.3", + "is-subdir": "^1.1.1", + "micromatch": "^4.0.2", + "spawndamnit": "^2.0.0" + } + }, + "node_modules/@changesets/logger": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@changesets/logger/-/logger-0.0.5.tgz", + "integrity": "sha512-gJyZHomu8nASHpaANzc6bkQMO9gU/ib20lqew1rVx753FOxffnCrJlGIeQVxNWCqM+o6OOleCo/ivL8UAO5iFw==", + "dependencies": { + "chalk": "^2.1.0" + } + }, + "node_modules/@changesets/logger/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/logger/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/logger/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@changesets/parse": { + "version": "0.3.16", + "resolved": "https://registry.npmjs.org/@changesets/parse/-/parse-0.3.16.tgz", + "integrity": "sha512-127JKNd167ayAuBjUggZBkmDS5fIKsthnr9jr6bdnuUljroiERW7FBTDNnNVyJ4l69PzR57pk6mXQdtJyBCJKg==", + "dependencies": { + "@changesets/types": "^5.2.1", + "js-yaml": "^3.13.1" + } + }, + "node_modules/@changesets/pre": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-1.0.14.tgz", + "integrity": "sha512-dTsHmxQWEQekHYHbg+M1mDVYFvegDh9j/kySNuDKdylwfMEevTeDouR7IfHNyVodxZXu17sXoJuf2D0vi55FHQ==", + "dependencies": { + "@babel/runtime": "^7.20.1", + "@changesets/errors": "^0.1.4", + "@changesets/types": "^5.2.1", + "@manypkg/get-packages": "^1.1.3", + "fs-extra": "^7.0.1" + } + }, + "node_modules/@changesets/read": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/@changesets/read/-/read-0.5.9.tgz", + "integrity": "sha512-T8BJ6JS6j1gfO1HFq50kU3qawYxa4NTbI/ASNVVCBTsKquy2HYwM9r7ZnzkiMe8IEObAJtUVGSrePCOxAK2haQ==", + "dependencies": { + "@babel/runtime": "^7.20.1", + "@changesets/git": "^2.0.0", + "@changesets/logger": "^0.0.5", + "@changesets/parse": "^0.3.16", + "@changesets/types": "^5.2.1", + "chalk": "^2.1.0", + "fs-extra": "^7.0.1", + "p-filter": "^2.1.0" + } + }, + "node_modules/@changesets/read/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/read/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@changesets/read/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@changesets/types": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@changesets/types/-/types-5.2.1.tgz", + "integrity": "sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==" + }, + "node_modules/@changesets/write": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@changesets/write/-/write-0.2.3.tgz", + "integrity": "sha512-Dbamr7AIMvslKnNYsLFafaVORx4H0pvCA2MHqgtNCySMe1blImEyAEOzDmcgKAkgz4+uwoLz7demIrX+JBr/Xw==", + "dependencies": { + "@babel/runtime": "^7.20.1", + "@changesets/types": "^5.2.1", + "fs-extra": "^7.0.1", + "human-id": "^1.0.2", + "prettier": "^2.7.1" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "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" + } + }, + "node_modules/@eslint/eslintrc/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "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" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@eth-optimism/contracts": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@eth-optimism/contracts/-/contracts-0.6.0.tgz", + "integrity": "sha512-vQ04wfG9kMf1Fwy3FEMqH2QZbgS0gldKhcBeBUPfO8zu68L61VI97UDXmsMQXzTsEAxK8HnokW3/gosl4/NW3w==", + "dependencies": { + "@eth-optimism/core-utils": "0.12.0", + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0" + }, + "peerDependencies": { + "ethers": "^5" + } + }, + "node_modules/@eth-optimism/core-utils": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@eth-optimism/core-utils/-/core-utils-0.12.0.tgz", + "integrity": "sha512-qW+7LZYCz7i8dRa7SRlUKIo1VBU8lvN0HeXCxJR+z+xtMzMQpPds20XJNCMclszxYQHkXY00fOT6GvFw9ZL6nw==", + "dependencies": { + "@ethersproject/abi": "^5.7.0", + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/contracts": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/providers": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0", + "bufio": "^1.0.7", + "chai": "^4.3.4" + } + }, + "node_modules/@ethersproject/abi": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", + "integrity": "sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/abstract-provider": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz", + "integrity": "sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0" + } + }, + "node_modules/@ethersproject/abstract-signer": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz", + "integrity": "sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0" + } + }, + "node_modules/@ethersproject/address": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.7.0.tgz", + "integrity": "sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/rlp": "^5.7.0" + } + }, + "node_modules/@ethersproject/base64": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.7.0.tgz", + "integrity": "sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0" + } + }, + "node_modules/@ethersproject/basex": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.7.0.tgz", + "integrity": "sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/properties": "^5.7.0" + } + }, + "node_modules/@ethersproject/bignumber": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.7.0.tgz", + "integrity": "sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "bn.js": "^5.2.1" + } + }, + "node_modules/@ethersproject/bytes": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.7.0.tgz", + "integrity": "sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/constants": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.7.0.tgz", + "integrity": "sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.7.0" + } + }, + "node_modules/@ethersproject/contracts": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.7.0.tgz", + "integrity": "sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abi": "^5.7.0", + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0" + } + }, + "node_modules/@ethersproject/hash": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz", + "integrity": "sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/hdnode": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.7.0.tgz", + "integrity": "sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/pbkdf2": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wordlists": "^5.7.0" + } + }, + "node_modules/@ethersproject/json-wallets": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz", + "integrity": "sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hdnode": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/pbkdf2": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "aes-js": "3.0.0", + "scrypt-js": "3.0.1" + } + }, + "node_modules/@ethersproject/keccak256": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.7.0.tgz", + "integrity": "sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "js-sha3": "0.8.0" + } + }, + "node_modules/@ethersproject/logger": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.7.0.tgz", + "integrity": "sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ] + }, + "node_modules/@ethersproject/networks": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.7.1.tgz", + "integrity": "sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/pbkdf2": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz", + "integrity": "sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/sha2": "^5.7.0" + } + }, + "node_modules/@ethersproject/properties": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.7.0.tgz", + "integrity": "sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/providers": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.7.2.tgz", + "integrity": "sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0", + "bech32": "1.1.4", + "ws": "7.4.6" + } + }, + "node_modules/@ethersproject/random": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.7.0.tgz", + "integrity": "sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/rlp": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz", + "integrity": "sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/sha2": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.7.0.tgz", + "integrity": "sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "hash.js": "1.1.7" + } + }, + "node_modules/@ethersproject/signing-key": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.7.0.tgz", + "integrity": "sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "bn.js": "^5.2.1", + "elliptic": "6.5.4", + "hash.js": "1.1.7" + } + }, + "node_modules/@ethersproject/solidity": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.7.0.tgz", + "integrity": "sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/strings": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.7.0.tgz", + "integrity": "sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/transactions": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.7.0.tgz", + "integrity": "sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0" + } + }, + "node_modules/@ethersproject/units": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.7.0.tgz", + "integrity": "sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/wallet": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.7.0.tgz", + "integrity": "sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/hdnode": "^5.7.0", + "@ethersproject/json-wallets": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wordlists": "^5.7.0" + } + }, + "node_modules/@ethersproject/web": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.7.1.tgz", + "integrity": "sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/wordlists": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.7.0.tgz", + "integrity": "sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "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" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "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" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "dev": true + }, + "node_modules/@manypkg/find-root": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@manypkg/find-root/-/find-root-1.1.0.tgz", + "integrity": "sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==", + "dependencies": { + "@babel/runtime": "^7.5.5", + "@types/node": "^12.7.1", + "find-up": "^4.1.0", + "fs-extra": "^8.1.0" + } + }, + "node_modules/@manypkg/find-root/node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/@manypkg/get-packages": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@manypkg/get-packages/-/get-packages-1.1.3.tgz", + "integrity": "sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==", + "dependencies": { + "@babel/runtime": "^7.5.5", + "@changesets/types": "^4.0.1", + "@manypkg/find-root": "^1.1.0", + "fs-extra": "^8.1.0", + "globby": "^11.0.0", + "read-yaml-file": "^1.1.0" + } + }, + "node_modules/@manypkg/get-packages/node_modules/@changesets/types": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@changesets/types/-/types-4.1.0.tgz", + "integrity": "sha512-LDQvVDv5Kb50ny2s25Fhm3d9QSZimsoUGBsUioj6MC3qbMUCuC8GPIvk/M6IvXx3lYhAs0lwWUQLb+VIEUCECw==" + }, + "node_modules/@manypkg/get-packages/node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@openzeppelin/contracts": { + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.9.3.tgz", + "integrity": "sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg==" + }, + "node_modules/@openzeppelin/contracts-upgradeable": { + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.9.3.tgz", + "integrity": "sha512-jjaHAVRMrE4UuZNfDwjlLGDxTHWIOwTJS2ldnc278a0gevfXfPr8hxKEVBGFBE96kl2G3VHDZhUimw/+G3TG2A==" + }, + "node_modules/@scroll-tech/contracts": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@scroll-tech/contracts/-/contracts-0.1.0.tgz", + "integrity": "sha512-aBbDOc3WB/WveZdpJYcrfvMYMz7ZTEiW8M9XMJLba8p9FAR5KGYB/cV+8+EUsq3MKt7C1BfR+WnXoTVdvwIY6w==" + }, + "node_modules/@se-2/hardhat": { + "resolved": "packages/hardhat", + "link": true + }, + "node_modules/@se-2/nextjs": { + "resolved": "packages/nextjs", + "link": true + }, + "node_modules/@types/is-ci": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/is-ci/-/is-ci-3.0.4.tgz", + "integrity": "sha512-AkCYCmwlXeuH89DagDCzvCAyltI2v9lh3U3DqSg/GrBYoReAaWwxfXCqMx9UV5MajLZ4ZFwZzV4cABGIxk2XRw==", + "dependencies": { + "ci-info": "^3.1.0" + } + }, + "node_modules/@types/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==" + }, + "node_modules/@types/node": { + "version": "12.20.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", + "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==" + }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", + "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==" + }, + "node_modules/@types/semver": { + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==" + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.9.0.tgz", + "integrity": "sha512-6e+X0X3sFe/G/54aC3jt0txuMTURqLyekmEHViqyA2VnxhLMpvA6nqmcjIy+Cr9tLDHPssA74BP5Mx9HQIxBEA==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "7.9.0", + "@typescript-eslint/type-utils": "7.9.0", + "@typescript-eslint/utils": "7.9.0", + "@typescript-eslint/visitor-keys": "7.9.0", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.9.0.tgz", + "integrity": "sha512-qHMJfkL5qvgQB2aLvhUSXxbK7OLnDkwPzFalg458pxQgfxKDfT1ZDbHQM/I6mDIf/svlMkj21kzKuQ2ixJlatQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "7.9.0", + "@typescript-eslint/types": "7.9.0", + "@typescript-eslint/typescript-estree": "7.9.0", + "@typescript-eslint/visitor-keys": "7.9.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.9.0.tgz", + "integrity": "sha512-ZwPK4DeCDxr3GJltRz5iZejPFAAr4Wk3+2WIBaj1L5PYK5RgxExu/Y68FFVclN0y6GGwH8q+KgKRCvaTmFBbgQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.9.0", + "@typescript-eslint/visitor-keys": "7.9.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.9.0.tgz", + "integrity": "sha512-6Qy8dfut0PFrFRAZsGzuLoM4hre4gjzWJB6sUvdunCYZsYemTkzZNwF1rnGea326PHPT3zn5Lmg32M/xfJfByA==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "7.9.0", + "@typescript-eslint/utils": "7.9.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.9.0.tgz", + "integrity": "sha512-oZQD9HEWQanl9UfsbGVcZ2cGaR0YT5476xfWE0oE5kQa2sNK2frxOlkeacLOTh9po4AlUT5rtkGyYM5kew0z5w==", + "dev": true, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.9.0.tgz", + "integrity": "sha512-zBCMCkrb2YjpKV3LA0ZJubtKCDxLttxfdGmwZvTqqWevUPN0FZvSI26FalGFFUZU/9YQK/A4xcQF9o/VVaCKAg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.9.0", + "@typescript-eslint/visitor-keys": "7.9.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.9.0.tgz", + "integrity": "sha512-5KVRQCzZajmT4Ep+NEgjXCvjuypVvYHUW7RHlXzNPuak2oWpVoD1jf5xCP0dPAuNIchjC7uQyvbdaSTFaLqSdA==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "7.9.0", + "@typescript-eslint/types": "7.9.0", + "@typescript-eslint/typescript-estree": "7.9.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.9.0.tgz", + "integrity": "sha512-iESPx2TNLDNGQLyjKhUvIKprlP49XNEK+MvIf9nIO7ZZaZdbnfWKHnXAgufpxqfA0YryH8XToi4+CjBgVnFTSQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.9.0", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, + "node_modules/acorn": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/aes-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", + "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==" + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-escapes": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^1.0.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "6.2.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "dependencies": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", + "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "engines": { + "node": "*" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "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==" + }, + "node_modules/bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==" + }, + "node_modules/better-path-resolve": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/better-path-resolve/-/better-path-resolve-1.0.0.tgz", + "integrity": "sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==", + "dependencies": { + "is-windows": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "license": "MIT", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/breakword": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/breakword/-/breakword-1.0.6.tgz", + "integrity": "sha512-yjxDAYyK/pBvws9H4xKYpLDpYKEH6CzrBPAuXq3x18I+c/2MkVtT3qAr7Oloi6Dss9qNhPVueAAVU1CSeNDIXw==", + "dependencies": { + "wcwidth": "^1.0.1" + } + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" + }, + "node_modules/bufio": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/bufio/-/bufio-1.2.1.tgz", + "integrity": "sha512-9oR3zNdupcg/Ge2sSHQF3GX+kmvL/fTPvD0nd5AGLq8SjUYnTz+SlFjK/GXidndbZtIj+pVKXiWeR9w6e9wKCA==", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "dependencies": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/chai": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", + "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", + "pathval": "^1.1.1", + "type-detect": "^4.0.8" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk": { + "version": "5.3.0", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" + }, + "node_modules/check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "dependencies": { + "get-func-name": "^2.0.2" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-cursor": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "slice-ansi": "^5.0.0", + "string-width": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/cliui/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/cliui/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/cliui/node_modules/is-fullwidth-code-point": { + "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==", + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/colorette": { + "version": "2.0.20", + "dev": true, + "license": "MIT" + }, + "node_modules/commander": { + "version": "11.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/csv": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/csv/-/csv-5.5.3.tgz", + "integrity": "sha512-QTaY0XjjhTQOdguARF0lGKm5/mEq9PD9/VhZZegHDIBq2tQwgNpHc3dneD4mGo2iJs+fTKv5Bp0fZ+BRuY3Z0g==", + "dependencies": { + "csv-generate": "^3.4.3", + "csv-parse": "^4.16.3", + "csv-stringify": "^5.6.5", + "stream-transform": "^2.1.3" + }, + "engines": { + "node": ">= 0.1.90" + } + }, + "node_modules/csv-generate": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/csv-generate/-/csv-generate-3.4.3.tgz", + "integrity": "sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw==" + }, + "node_modules/csv-parse": { + "version": "4.16.3", + "resolved": "https://registry.npmjs.org/csv-parse/-/csv-parse-4.16.3.tgz", + "integrity": "sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg==" + }, + "node_modules/csv-stringify": { + "version": "5.6.5", + "resolved": "https://registry.npmjs.org/csv-stringify/-/csv-stringify-5.6.5.tgz", + "integrity": "sha512-PjiQ659aQ+fUTQqSrd1XEDnOr52jh30RBurfzkscaE2tPaFsDH5wOAHJiw8XAHphRknCwMUE9KRayc4K/NbO8A==" + }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/dataloader": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/dataloader/-/dataloader-1.4.0.tgz", + "integrity": "sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==" + }, + "node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decamelize-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", + "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", + "dependencies": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decamelize-keys/node_modules/map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/deep-eql": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/detect-indent": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz", + "integrity": "sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==", + "engines": { + "node": ">=8" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/dotenv": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.6.0.tgz", + "integrity": "sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==", + "engines": { + "node": ">=10" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "dev": true, + "license": "MIT" + }, + "node_modules/elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "dev": true, + "license": "MIT" + }, + "node_modules/enquirer": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", + "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", + "dependencies": { + "ansi-colors": "^4.1.1", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/enquirer/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/enquirer/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-abstract": { + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.3", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.15" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "dependencies": { + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", + "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", + "dependencies": { + "hasown": "^2.0.0" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/eslint/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/eslint/node_modules/brace-expansion": { + "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" + } + }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/eslint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/eslint/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/eslint/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/eslint/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "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" + }, + "engines": { + "node": "*" + } + }, + "node_modules/eslint/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ethers": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", + "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/abi": "5.7.0", + "@ethersproject/abstract-provider": "5.7.0", + "@ethersproject/abstract-signer": "5.7.0", + "@ethersproject/address": "5.7.0", + "@ethersproject/base64": "5.7.0", + "@ethersproject/basex": "5.7.0", + "@ethersproject/bignumber": "5.7.0", + "@ethersproject/bytes": "5.7.0", + "@ethersproject/constants": "5.7.0", + "@ethersproject/contracts": "5.7.0", + "@ethersproject/hash": "5.7.0", + "@ethersproject/hdnode": "5.7.0", + "@ethersproject/json-wallets": "5.7.0", + "@ethersproject/keccak256": "5.7.0", + "@ethersproject/logger": "5.7.0", + "@ethersproject/networks": "5.7.1", + "@ethersproject/pbkdf2": "5.7.0", + "@ethersproject/properties": "5.7.0", + "@ethersproject/providers": "5.7.2", + "@ethersproject/random": "5.7.0", + "@ethersproject/rlp": "5.7.0", + "@ethersproject/sha2": "5.7.0", + "@ethersproject/signing-key": "5.7.0", + "@ethersproject/solidity": "5.7.0", + "@ethersproject/strings": "5.7.0", + "@ethersproject/transactions": "5.7.0", + "@ethersproject/units": "5.7.0", + "@ethersproject/wallet": "5.7.0", + "@ethersproject/web": "5.7.1", + "@ethersproject/wordlists": "5.7.0" + } + }, + "node_modules/eventemitter3": { + "version": "5.0.1", + "dev": true, + "license": "MIT" + }, + "node_modules/execa": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^4.3.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": "^14.18.0 || ^16.14.0 || >=18.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/execa/node_modules/onetime": { + "version": "6.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/extendable-error": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/extendable-error/-/extendable-error-0.1.7.tgz", + "integrity": "sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==" + }, + "node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-yarn-workspace-root2": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root2/-/find-yarn-workspace-root2-1.2.16.tgz", + "integrity": "sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA==", + "dependencies": { + "micromatch": "^4.0.2", + "pkg-dir": "^4.2.0" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "engines": { + "node": "*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "dependencies": { + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/glob/node_modules/brace-expansion": { + "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" + } + }, + "node_modules/glob/node_modules/minimatch": { + "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" + }, + "engines": { + "node": "*" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globals/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==" + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "node_modules/hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" + }, + "node_modules/human-id": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/human-id/-/human-id-1.0.2.tgz", + "integrity": "sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==" + }, + "node_modules/human-signals": { + "version": "4.3.1", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=14.18.0" + } + }, + "node_modules/husky": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", + "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", + "dev": true, + "bin": { + "husky": "lib/bin.js" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/internal-slot": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-ci": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", + "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", + "dependencies": { + "ci-info": "^3.2.0" + }, + "bin": { + "is-ci": "bin.js" + } + }, + "node_modules/is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dependencies": { + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dependencies": { + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "dependencies": { + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-stream": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-subdir": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-subdir/-/is-subdir-1.2.0.tgz", + "integrity": "sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw==", + "dependencies": { + "better-path-resolve": "1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dependencies": { + "which-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" + }, + "node_modules/isexe": { + "version": "2.0.0", + "license": "ISC" + }, + "node_modules/js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/kleur": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", + "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lilconfig": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" + }, + "node_modules/lint-staged": { + "version": "13.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "5.3.0", + "commander": "11.0.0", + "debug": "4.3.4", + "execa": "7.2.0", + "lilconfig": "2.1.0", + "listr2": "6.6.1", + "micromatch": "4.0.5", + "pidtree": "0.6.0", + "string-argv": "0.3.2", + "yaml": "2.3.1" + }, + "bin": { + "lint-staged": "bin/lint-staged.js" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + }, + "funding": { + "url": "https://opencollective.com/lint-staged" + } + }, + "node_modules/listr2": { + "version": "6.6.1", + "dev": true, + "license": "MIT", + "dependencies": { + "cli-truncate": "^3.1.0", + "colorette": "^2.0.20", + "eventemitter3": "^5.0.1", + "log-update": "^5.0.1", + "rfdc": "^1.3.0", + "wrap-ansi": "^8.1.0" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "enquirer": ">= 2.3.0 < 3" + }, + "peerDependenciesMeta": { + "enquirer": { + "optional": true + } + } + }, + "node_modules/load-yaml-file": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/load-yaml-file/-/load-yaml-file-0.2.0.tgz", + "integrity": "sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==", + "dependencies": { + "graceful-fs": "^4.1.5", + "js-yaml": "^3.13.0", + "pify": "^4.0.1", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/lodash.startcase": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.startcase/-/lodash.startcase-4.4.0.tgz", + "integrity": "sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==" + }, + "node_modules/log-update": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^5.0.0", + "cli-cursor": "^4.0.0", + "slice-ansi": "^5.0.0", + "strip-ansi": "^7.0.1", + "wrap-ansi": "^8.0.1" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "dependencies": { + "get-func-name": "^2.0.1" + } + }, + "node_modules/lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dependencies": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "node_modules/map-obj": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", + "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-6.1.1.tgz", + "integrity": "sha512-3YffViIt2QWgTy6Pale5QpopX/IvU3LPL03jOTqp6pGj3VjesdO/U8CuHMKpnQr4shCNCM5fd5XFFvIIl6JBHg==", + "dependencies": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "^4.0.2", + "normalize-package-data": "^2.5.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.13.1", + "yargs-parser": "^18.1.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow/node_modules/type-fest": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "license": "MIT", + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mimic-fn": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "engines": { + "node": ">=4" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" + }, + "node_modules/minimatch": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dependencies": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/mixme": { + "version": "0.5.10", + "resolved": "https://registry.npmjs.org/mixme/-/mixme-0.5.10.tgz", + "integrity": "sha512-5H76ANWinB1H3twpJ6JY8uvAtpmFvHNArpilJAjXRKXSDDLPIMoZArw5SH0q9z+lLs8IrMw7Q2VWpWimFKFT1Q==", + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/normalize-package-data/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/npm-run-path": { + "version": "5.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/onetime/node_modules/mimic-fn": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/outdent": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/outdent/-/outdent-0.5.0.tgz", + "integrity": "sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==" + }, + "node_modules/p-filter": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-2.1.0.tgz", + "integrity": "sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==", + "dependencies": { + "p-map": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "engines": { + "node": ">=6" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "engines": { + "node": "*" + } + }, + "node_modules/picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pidtree": { + "version": "0.6.0", + "dev": true, + "license": "MIT", + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/preferred-pm": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/preferred-pm/-/preferred-pm-3.1.3.tgz", + "integrity": "sha512-MkXsENfftWSRpzCzImcp4FRsCc3y1opwB73CfCNWyzMqArju2CrlMHlqB7VexKiPEOjGMbttv1r9fSCn5S610w==", + "dependencies": { + "find-up": "^5.0.0", + "find-yarn-workspace-root2": "1.2.16", + "path-exists": "^4.0.0", + "which-pm": "2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/preferred-pm/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/preferred-pm/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/preferred-pm/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/preferred-pm/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==" + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dependencies": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dependencies": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg/node_modules/type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/read-yaml-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-yaml-file/-/read-yaml-file-1.1.0.tgz", + "integrity": "sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==", + "dependencies": { + "graceful-fs": "^4.1.5", + "js-yaml": "^3.6.1", + "pify": "^4.0.1", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dependencies": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", + "dependencies": { + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/restore-cursor": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rfdc": { + "version": "1.3.0", + "dev": true, + "license": "MIT" + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "dependencies": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-regex-test": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" + }, + "node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "license": "ISC" + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "engines": { + "node": ">=8" + } + }, + "node_modules/slice-ansi": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.0.0", + "is-fullwidth-code-point": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/smartwrap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/smartwrap/-/smartwrap-2.0.2.tgz", + "integrity": "sha512-vCsKNQxb7PnCNd2wY1WClWifAc2lwqsG8OaswpJkVJsvMGcnEntdTCDajZCkk93Ay1U3t/9puJmb525Rg5MZBA==", + "dependencies": { + "array.prototype.flat": "^1.2.3", + "breakword": "^1.0.5", + "grapheme-splitter": "^1.0.4", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1", + "yargs": "^15.1.0" + }, + "bin": { + "smartwrap": "src/terminal-adapter.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/smartwrap/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/smartwrap/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/smartwrap/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/smartwrap/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/smartwrap/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/smartwrap/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/smartwrap/node_modules/is-fullwidth-code-point": { + "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==", + "engines": { + "node": ">=8" + } + }, + "node_modules/smartwrap/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/smartwrap/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/smartwrap/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/smartwrap/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" + }, + "node_modules/smartwrap/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/spawndamnit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawndamnit/-/spawndamnit-2.0.0.tgz", + "integrity": "sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==", + "dependencies": { + "cross-spawn": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "node_modules/spawndamnit/node_modules/cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==", + "dependencies": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "node_modules/spawndamnit/node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/spawndamnit/node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/spawndamnit/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==" + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.17.tgz", + "integrity": "sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==" + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" + }, + "node_modules/stream-transform": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/stream-transform/-/stream-transform-2.1.3.tgz", + "integrity": "sha512-9GHUiM5hMiCi6Y03jD2ARC1ettBXkQBoQAe7nJsPknnI0ow10aXjTnew8QtYQmLjzn974BnmWEAJgCY6ZP1DeQ==", + "dependencies": { + "mixme": "^0.5.1" + } + }, + "node_modules/string-argv": { + "version": "0.3.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.6.19" + } + }, + "node_modules/string-width": { + "version": "5.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "7.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-final-newline": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/term-size": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz", + "integrity": "sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/trim-newlines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", + "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ts-api-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "dev": true, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, + "node_modules/tty-table": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/tty-table/-/tty-table-4.2.3.tgz", + "integrity": "sha512-Fs15mu0vGzCrj8fmJNP7Ynxt5J7praPXqFN0leZeZBXJwkMxv9cb2D454k1ltrtUSJbZ4yH4e0CynsHLxmUfFA==", + "dependencies": { + "chalk": "^4.1.2", + "csv": "^5.5.3", + "kleur": "^4.1.5", + "smartwrap": "^2.0.2", + "strip-ansi": "^6.0.1", + "wcwidth": "^1.0.1", + "yargs": "^17.7.1" + }, + "bin": { + "tty-table": "adapters/terminal-adapter.js" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/tty-table/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/tty-table/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/tty-table/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/tty-table/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/tty-table/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/tty-table/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/tty-table/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tty-table/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "1.4.0", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typescript": { + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "dependencies": { + "defaults": "^1.0.3" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==" + }, + "node_modules/which-pm": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-pm/-/which-pm-2.0.0.tgz", + "integrity": "sha512-Lhs9Pmyph0p5n5Z3mVnN0yWcbQYUAD7rbQUiMsQxOJ3T57k7RFe35SUwWMf7dsbDZks1uOmw4AecB/JMDj3v/w==", + "dependencies": { + "load-yaml-file": "^0.2.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8.15" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "node_modules/ws": { + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==" + }, + "node_modules/yaml": { + "version": "2.3.1", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 14" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/yargs/node_modules/is-fullwidth-code-point": { + "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==", + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "engines": { + "node": ">=12" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/hardhat": { + "name": "@se-2/hardhat", + "version": "0.0.1", + "dependencies": { + "@chainlink/contracts": "^1.1.0", + "@openzeppelin/contracts": "^4.8.1", + "@typechain/ethers-v6": "^0.5.1", + "dotenv": "^16.0.3", + "envfile": "^6.18.0", + "qrcode": "^1.5.1" + }, + "devDependencies": { + "@ethersproject/abi": "^5.7.0", + "@ethersproject/providers": "^5.7.1", + "@nomicfoundation/hardhat-chai-matchers": "^2.0.3", + "@nomicfoundation/hardhat-ethers": "^3.0.5", + "@nomicfoundation/hardhat-network-helpers": "^1.0.6", + "@nomicfoundation/hardhat-verify": "^2.0.3", + "@typechain/ethers-v5": "^10.1.0", + "@typechain/hardhat": "^9.1.0", + "@types/eslint": "^8", + "@types/inquirer": "^9", + "@types/mocha": "^9.1.1", + "@types/prettier": "^2", + "@types/qrcode": "^1", + "@typescript-eslint/eslint-plugin": "latest", + "@typescript-eslint/parser": "latest", + "chai": "^4.3.6", + "eslint": "^8.26.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-prettier": "^4.2.1", + "ethers": "^6.10.0", + "execa": "^8.0.1", + "hardhat": "^2.19.4", + "hardhat-deploy": "^0.11.45", + "hardhat-deploy-ethers": "^0.4.1", + "hardhat-gas-reporter": "^1.0.9", + "inquirer": "^9.2.14", + "prettier": "^2.8.4", + "solidity-coverage": "^0.8.5", + "ts-node": "^10.9.1", + "typechain": "^8.1.0", + "typescript": "^5.1.6" + } + }, + "packages/hardhat/node_modules/@adraffy/ens-normalize": { + "version": "1.10.0", + "license": "MIT" + }, + "packages/hardhat/node_modules/@chainsafe/as-sha256": { + "version": "0.3.1", + "dev": true, + "license": "Apache-2.0" + }, + "packages/hardhat/node_modules/@chainsafe/persistent-merkle-tree": { + "version": "0.5.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@chainsafe/as-sha256": "^0.3.1" + } + }, + "packages/hardhat/node_modules/@chainsafe/ssz": { + "version": "0.10.2", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@chainsafe/as-sha256": "^0.3.1", + "@chainsafe/persistent-merkle-tree": "^0.5.0" + } + }, + "packages/hardhat/node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "packages/hardhat/node_modules/@ethereumjs/rlp": { + "version": "4.0.1", + "dev": true, + "license": "MPL-2.0", + "bin": { + "rlp": "bin/rlp" + }, + "engines": { + "node": ">=14" + } + }, + "packages/hardhat/node_modules/@ethereumjs/util": { + "version": "8.1.0", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "@ethereumjs/rlp": "^4.0.1", + "ethereum-cryptography": "^2.0.0", + "micro-ftch": "^0.3.1" + }, + "engines": { + "node": ">=14" + } + }, + "packages/hardhat/node_modules/@ethereumjs/util/node_modules/@scure/bip32": { + "version": "1.3.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@noble/curves": "~1.1.0", + "@noble/hashes": "~1.3.1", + "@scure/base": "~1.1.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "packages/hardhat/node_modules/@ethereumjs/util/node_modules/@scure/bip39": { + "version": "1.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@noble/hashes": "~1.3.0", + "@scure/base": "~1.1.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "packages/hardhat/node_modules/@ethereumjs/util/node_modules/ethereum-cryptography": { + "version": "2.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@noble/curves": "1.1.0", + "@noble/hashes": "1.3.1", + "@scure/bip32": "1.3.1", + "@scure/bip39": "1.2.1" + } + }, + "packages/hardhat/node_modules/@ethereumjs/util/node_modules/ethereum-cryptography/node_modules/@noble/hashes": { + "version": "1.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "packages/hardhat/node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "packages/hardhat/node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "packages/hardhat/node_modules/@ljharb/through": { + "version": "2.3.12", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.5" + }, + "engines": { + "node": ">= 0.4" + } + }, + "packages/hardhat/node_modules/@metamask/eth-sig-util": { + "version": "4.0.1", + "dev": true, + "license": "ISC", + "dependencies": { + "ethereumjs-abi": "^0.6.8", + "ethereumjs-util": "^6.2.1", + "ethjs-util": "^0.1.6", + "tweetnacl": "^1.0.3", + "tweetnacl-util": "^0.15.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "packages/hardhat/node_modules/@metamask/eth-sig-util/node_modules/tweetnacl": { + "version": "1.0.3", + "dev": true, + "license": "Unlicense" + }, + "packages/hardhat/node_modules/@noble/curves": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.3.1" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "packages/hardhat/node_modules/@noble/curves/node_modules/@noble/hashes": { + "version": "1.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "packages/hardhat/node_modules/@noble/hashes": { + "version": "1.3.2", + "license": "MIT", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "packages/hardhat/node_modules/@noble/secp256k1": { + "version": "1.7.1", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "license": "MIT" + }, + "packages/hardhat/node_modules/@nomicfoundation/ethereumjs-block": { + "version": "5.0.2", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-trie": "6.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", + "ethereum-cryptography": "0.1.3", + "ethers": "^5.7.1" + }, + "engines": { + "node": ">=14" + } + }, + "packages/hardhat/node_modules/@nomicfoundation/ethereumjs-block/node_modules/ethers": { + "version": "5.7.2", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/abi": "5.7.0", + "@ethersproject/abstract-provider": "5.7.0", + "@ethersproject/abstract-signer": "5.7.0", + "@ethersproject/address": "5.7.0", + "@ethersproject/base64": "5.7.0", + "@ethersproject/basex": "5.7.0", + "@ethersproject/bignumber": "5.7.0", + "@ethersproject/bytes": "5.7.0", + "@ethersproject/constants": "5.7.0", + "@ethersproject/contracts": "5.7.0", + "@ethersproject/hash": "5.7.0", + "@ethersproject/hdnode": "5.7.0", + "@ethersproject/json-wallets": "5.7.0", + "@ethersproject/keccak256": "5.7.0", + "@ethersproject/logger": "5.7.0", + "@ethersproject/networks": "5.7.1", + "@ethersproject/pbkdf2": "5.7.0", + "@ethersproject/properties": "5.7.0", + "@ethersproject/providers": "5.7.2", + "@ethersproject/random": "5.7.0", + "@ethersproject/rlp": "5.7.0", + "@ethersproject/sha2": "5.7.0", + "@ethersproject/signing-key": "5.7.0", + "@ethersproject/solidity": "5.7.0", + "@ethersproject/strings": "5.7.0", + "@ethersproject/transactions": "5.7.0", + "@ethersproject/units": "5.7.0", + "@ethersproject/wallet": "5.7.0", + "@ethersproject/web": "5.7.1", + "@ethersproject/wordlists": "5.7.0" + } + }, + "packages/hardhat/node_modules/@nomicfoundation/ethereumjs-blockchain": { + "version": "7.0.2", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "@nomicfoundation/ethereumjs-block": "5.0.2", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-ethash": "3.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-trie": "6.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", + "abstract-level": "^1.0.3", + "debug": "^4.3.3", + "ethereum-cryptography": "0.1.3", + "level": "^8.0.0", + "lru-cache": "^5.1.1", + "memory-level": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "packages/hardhat/node_modules/@nomicfoundation/ethereumjs-blockchain/node_modules/lru-cache": { + "version": "5.1.1", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "packages/hardhat/node_modules/@nomicfoundation/ethereumjs-blockchain/node_modules/yallist": { + "version": "3.1.1", + "dev": true, + "license": "ISC" + }, + "packages/hardhat/node_modules/@nomicfoundation/ethereumjs-common": { + "version": "4.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@nomicfoundation/ethereumjs-util": "9.0.2", + "crc-32": "^1.2.0" + } + }, + "packages/hardhat/node_modules/@nomicfoundation/ethereumjs-ethash": { + "version": "3.0.2", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "@nomicfoundation/ethereumjs-block": "5.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", + "abstract-level": "^1.0.3", + "bigint-crypto-utils": "^3.0.23", + "ethereum-cryptography": "0.1.3" + }, + "engines": { + "node": ">=14" + } + }, + "packages/hardhat/node_modules/@nomicfoundation/ethereumjs-evm": { + "version": "2.0.2", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "@ethersproject/providers": "^5.7.1", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", + "debug": "^4.3.3", + "ethereum-cryptography": "0.1.3", + "mcl-wasm": "^0.7.1", + "rustbn.js": "~0.2.0" + }, + "engines": { + "node": ">=14" + } + }, + "packages/hardhat/node_modules/@nomicfoundation/ethereumjs-rlp": { + "version": "5.0.2", + "dev": true, + "license": "MPL-2.0", + "bin": { + "rlp": "bin/rlp" + }, + "engines": { + "node": ">=14" + } + }, + "packages/hardhat/node_modules/@nomicfoundation/ethereumjs-statemanager": { + "version": "2.0.2", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "debug": "^4.3.3", + "ethereum-cryptography": "0.1.3", + "ethers": "^5.7.1", + "js-sdsl": "^4.1.4" + } + }, + "packages/hardhat/node_modules/@nomicfoundation/ethereumjs-statemanager/node_modules/ethers": { + "version": "5.7.2", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/abi": "5.7.0", + "@ethersproject/abstract-provider": "5.7.0", + "@ethersproject/abstract-signer": "5.7.0", + "@ethersproject/address": "5.7.0", + "@ethersproject/base64": "5.7.0", + "@ethersproject/basex": "5.7.0", + "@ethersproject/bignumber": "5.7.0", + "@ethersproject/bytes": "5.7.0", + "@ethersproject/constants": "5.7.0", + "@ethersproject/contracts": "5.7.0", + "@ethersproject/hash": "5.7.0", + "@ethersproject/hdnode": "5.7.0", + "@ethersproject/json-wallets": "5.7.0", + "@ethersproject/keccak256": "5.7.0", + "@ethersproject/logger": "5.7.0", + "@ethersproject/networks": "5.7.1", + "@ethersproject/pbkdf2": "5.7.0", + "@ethersproject/properties": "5.7.0", + "@ethersproject/providers": "5.7.2", + "@ethersproject/random": "5.7.0", + "@ethersproject/rlp": "5.7.0", + "@ethersproject/sha2": "5.7.0", + "@ethersproject/signing-key": "5.7.0", + "@ethersproject/solidity": "5.7.0", + "@ethersproject/strings": "5.7.0", + "@ethersproject/transactions": "5.7.0", + "@ethersproject/units": "5.7.0", + "@ethersproject/wallet": "5.7.0", + "@ethersproject/web": "5.7.1", + "@ethersproject/wordlists": "5.7.0" + } + }, + "packages/hardhat/node_modules/@nomicfoundation/ethereumjs-trie": { + "version": "6.0.2", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", + "@types/readable-stream": "^2.3.13", + "ethereum-cryptography": "0.1.3", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=14" + } + }, + "packages/hardhat/node_modules/@nomicfoundation/ethereumjs-tx": { + "version": "5.0.2", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "@chainsafe/ssz": "^0.9.2", + "@ethersproject/providers": "^5.7.2", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", + "ethereum-cryptography": "0.1.3" + }, + "engines": { + "node": ">=14" + } + }, + "packages/hardhat/node_modules/@nomicfoundation/ethereumjs-tx/node_modules/@chainsafe/persistent-merkle-tree": { + "version": "0.4.2", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@chainsafe/as-sha256": "^0.3.1" + } + }, + "packages/hardhat/node_modules/@nomicfoundation/ethereumjs-tx/node_modules/@chainsafe/ssz": { + "version": "0.9.4", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@chainsafe/as-sha256": "^0.3.1", + "@chainsafe/persistent-merkle-tree": "^0.4.2", + "case": "^1.6.3" + } + }, + "packages/hardhat/node_modules/@nomicfoundation/ethereumjs-util": { + "version": "9.0.2", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "@chainsafe/ssz": "^0.10.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "ethereum-cryptography": "0.1.3" + }, + "engines": { + "node": ">=14" + } + }, + "packages/hardhat/node_modules/@nomicfoundation/ethereumjs-vm": { + "version": "7.0.2", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "@nomicfoundation/ethereumjs-block": "5.0.2", + "@nomicfoundation/ethereumjs-blockchain": "7.0.2", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-evm": "2.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-statemanager": "2.0.2", + "@nomicfoundation/ethereumjs-trie": "6.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", + "debug": "^4.3.3", + "ethereum-cryptography": "0.1.3", + "mcl-wasm": "^0.7.1", + "rustbn.js": "~0.2.0" + }, + "engines": { + "node": ">=14" + } + }, + "packages/hardhat/node_modules/@nomicfoundation/hardhat-chai-matchers": { + "version": "2.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai-as-promised": "^7.1.3", + "chai-as-promised": "^7.1.1", + "deep-eql": "^4.0.1", + "ordinal": "^1.0.3" + }, + "peerDependencies": { + "@nomicfoundation/hardhat-ethers": "^3.0.0", + "chai": "^4.2.0", + "ethers": "^6.1.0", + "hardhat": "^2.9.4" + } + }, + "packages/hardhat/node_modules/@nomicfoundation/hardhat-ethers": { + "version": "3.0.5", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.1.1", + "lodash.isequal": "^4.5.0" + }, + "peerDependencies": { + "ethers": "^6.1.0", + "hardhat": "^2.0.0" + } + }, + "packages/hardhat/node_modules/@nomicfoundation/hardhat-network-helpers": { + "version": "1.0.9", + "dev": true, + "license": "MIT", + "dependencies": { + "ethereumjs-util": "^7.1.4" + }, + "peerDependencies": { + "hardhat": "^2.9.5" + } + }, + "packages/hardhat/node_modules/@nomicfoundation/hardhat-network-helpers/node_modules/ethereumjs-util": { + "version": "7.1.5", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "@types/bn.js": "^5.1.0", + "bn.js": "^5.1.2", + "create-hash": "^1.1.2", + "ethereum-cryptography": "^0.1.3", + "rlp": "^2.2.4" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "packages/hardhat/node_modules/@nomicfoundation/hardhat-verify": { + "version": "2.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@ethersproject/abi": "^5.1.2", + "@ethersproject/address": "^5.0.2", + "cbor": "^8.1.0", + "chalk": "^2.4.2", + "debug": "^4.1.1", + "lodash.clonedeep": "^4.5.0", + "semver": "^6.3.0", + "table": "^6.8.0", + "undici": "^5.14.0" + }, + "peerDependencies": { + "hardhat": "^2.0.4" + } + }, + "packages/hardhat/node_modules/@nomicfoundation/hardhat-verify/node_modules/semver": { + "version": "6.3.1", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "packages/hardhat/node_modules/@nomicfoundation/solidity-analyzer": { + "version": "0.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12" + }, + "optionalDependencies": { + "@nomicfoundation/solidity-analyzer-darwin-arm64": "0.1.1", + "@nomicfoundation/solidity-analyzer-darwin-x64": "0.1.1", + "@nomicfoundation/solidity-analyzer-freebsd-x64": "0.1.1", + "@nomicfoundation/solidity-analyzer-linux-arm64-gnu": "0.1.1", + "@nomicfoundation/solidity-analyzer-linux-arm64-musl": "0.1.1", + "@nomicfoundation/solidity-analyzer-linux-x64-gnu": "0.1.1", + "@nomicfoundation/solidity-analyzer-linux-x64-musl": "0.1.1", + "@nomicfoundation/solidity-analyzer-win32-arm64-msvc": "0.1.1", + "@nomicfoundation/solidity-analyzer-win32-ia32-msvc": "0.1.1", + "@nomicfoundation/solidity-analyzer-win32-x64-msvc": "0.1.1" + } + }, + "packages/hardhat/node_modules/@nomicfoundation/solidity-analyzer-win32-x64-msvc": { + "version": "0.1.1", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/hardhat/node_modules/@scure/base": { + "version": "1.1.3", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "packages/hardhat/node_modules/@scure/bip32": { + "version": "1.1.5", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "license": "MIT", + "dependencies": { + "@noble/hashes": "~1.2.0", + "@noble/secp256k1": "~1.7.0", + "@scure/base": "~1.1.0" + } + }, + "packages/hardhat/node_modules/@scure/bip32/node_modules/@noble/hashes": { + "version": "1.2.0", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "license": "MIT" + }, + "packages/hardhat/node_modules/@scure/bip39": { + "version": "1.1.1", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "license": "MIT", + "dependencies": { + "@noble/hashes": "~1.2.0", + "@scure/base": "~1.1.0" + } + }, + "packages/hardhat/node_modules/@scure/bip39/node_modules/@noble/hashes": { + "version": "1.2.0", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "license": "MIT" + }, + "packages/hardhat/node_modules/@sentry/core": { + "version": "5.30.0", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sentry/hub": "5.30.0", + "@sentry/minimal": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/@sentry/hub": { + "version": "5.30.0", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/@sentry/minimal": { + "version": "5.30.0", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sentry/hub": "5.30.0", + "@sentry/types": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/@sentry/node": { + "version": "5.30.0", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sentry/core": "5.30.0", + "@sentry/hub": "5.30.0", + "@sentry/tracing": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "cookie": "^0.4.1", + "https-proxy-agent": "^5.0.0", + "lru_map": "^0.3.3", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/@sentry/tracing": { + "version": "5.30.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@sentry/hub": "5.30.0", + "@sentry/minimal": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/@sentry/types": { + "version": "5.30.0", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/@sentry/utils": { + "version": "5.30.0", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sentry/types": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/@solidity-parser/parser": { + "version": "0.14.5", + "dev": true, + "license": "MIT", + "dependencies": { + "antlr4ts": "^0.5.0-alpha.4" + } + }, + "packages/hardhat/node_modules/@tsconfig/node10": { + "version": "1.0.9", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/@tsconfig/node12": { + "version": "1.0.11", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/@tsconfig/node14": { + "version": "1.0.3", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/@tsconfig/node16": { + "version": "1.0.4", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/@typechain/ethers-v5": { + "version": "10.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "lodash": "^4.17.15", + "ts-essentials": "^7.0.1" + }, + "peerDependencies": { + "@ethersproject/abi": "^5.0.0", + "@ethersproject/providers": "^5.0.0", + "ethers": "^5.1.3", + "typechain": "^8.1.1", + "typescript": ">=4.3.0" + } + }, + "packages/hardhat/node_modules/@typechain/ethers-v6": { + "version": "0.5.1", + "license": "MIT", + "dependencies": { + "lodash": "^4.17.15", + "ts-essentials": "^7.0.1" + }, + "peerDependencies": { + "ethers": "6.x", + "typechain": "^8.3.2", + "typescript": ">=4.7.0" + } + }, + "packages/hardhat/node_modules/@typechain/hardhat": { + "version": "9.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "fs-extra": "^9.1.0" + }, + "peerDependencies": { + "@typechain/ethers-v6": "^0.5.1", + "ethers": "^6.1.0", + "hardhat": "^2.9.9", + "typechain": "^8.3.2" + } + }, + "packages/hardhat/node_modules/@typechain/hardhat/node_modules/fs-extra": { + "version": "9.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "packages/hardhat/node_modules/@types/bn.js": { + "version": "5.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "packages/hardhat/node_modules/@types/chai": { + "version": "4.3.6", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/@types/chai-as-promised": { + "version": "7.1.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "*" + } + }, + "packages/hardhat/node_modules/@types/concat-stream": { + "version": "1.6.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "packages/hardhat/node_modules/@types/eslint": { + "version": "8.44.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "packages/hardhat/node_modules/@types/estree": { + "version": "1.0.2", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/@types/form-data": { + "version": "0.0.33", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "packages/hardhat/node_modules/@types/glob": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "packages/hardhat/node_modules/@types/inquirer": { + "version": "9.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/through": "*", + "rxjs": "^7.2.0" + } + }, + "packages/hardhat/node_modules/@types/json-schema": { + "version": "7.0.13", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/@types/lru-cache": { + "version": "5.1.1", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/@types/minimatch": { + "version": "5.1.2", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/@types/mocha": { + "version": "9.1.1", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/@types/node": { + "version": "20.7.0", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/@types/pbkdf2": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "packages/hardhat/node_modules/@types/prettier": { + "version": "2.7.3", + "license": "MIT" + }, + "packages/hardhat/node_modules/@types/qrcode": { + "version": "1.5.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "packages/hardhat/node_modules/@types/qs": { + "version": "6.9.8", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/@types/readable-stream": { + "version": "2.3.15", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "safe-buffer": "~5.1.1" + } + }, + "packages/hardhat/node_modules/@types/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/@types/secp256k1": { + "version": "4.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "packages/hardhat/node_modules/@types/through": { + "version": "0.0.33", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "packages/hardhat/node_modules/abstract-level": { + "version": "1.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer": "^6.0.3", + "catering": "^2.1.0", + "is-buffer": "^2.0.5", + "level-supports": "^4.0.0", + "level-transcoder": "^1.0.1", + "module-error": "^1.0.1", + "queue-microtask": "^1.2.3" + }, + "engines": { + "node": ">=12" + } + }, + "packages/hardhat/node_modules/acorn-walk": { + "version": "8.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "packages/hardhat/node_modules/address": { + "version": "1.2.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "packages/hardhat/node_modules/adm-zip": { + "version": "0.4.16", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.3.0" + } + }, + "packages/hardhat/node_modules/agent-base": { + "version": "6.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "packages/hardhat/node_modules/aggregate-error": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/amdefine": { + "version": "1.0.1", + "dev": true, + "license": "BSD-3-Clause OR MIT", + "optional": true, + "engines": { + "node": ">=0.4.2" + } + }, + "packages/hardhat/node_modules/ansi-escapes": { + "version": "4.3.2", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/hardhat/node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/hardhat/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "packages/hardhat/node_modules/antlr4ts": { + "version": "0.5.0-dev", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "source-map-support": "^0.5.16" + } + }, + "packages/hardhat/node_modules/anymatch": { + "version": "3.1.3", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "packages/hardhat/node_modules/arg": { + "version": "4.1.3", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/array-back": { + "version": "3.1.0", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/array-uniq": { + "version": "1.0.3", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "packages/hardhat/node_modules/array.prototype.reduce": { + "version": "1.0.6", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-array-method-boxes-properly": "^1.0.0", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/hardhat/node_modules/asap": { + "version": "2.0.6", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/asn1": { + "version": "0.2.6", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": "~2.1.0" + } + }, + "packages/hardhat/node_modules/assert-plus": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, + "packages/hardhat/node_modules/astral-regex": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/async": { + "version": "1.5.2", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/asynckit": { + "version": "0.4.0", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/at-least-node": { + "version": "1.0.0", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 4.0.0" + } + }, + "packages/hardhat/node_modules/aws-sign2": { + "version": "0.7.0", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "*" + } + }, + "packages/hardhat/node_modules/aws4": { + "version": "1.12.0", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/axios": { + "version": "0.21.4", + "dev": true, + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.14.0" + } + }, + "packages/hardhat/node_modules/base-x": { + "version": "3.0.9", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "packages/hardhat/node_modules/base64-js": { + "version": "1.5.1", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "packages/hardhat/node_modules/bcrypt-pbkdf": { + "version": "1.0.2", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "tweetnacl": "^0.14.3" + } + }, + "packages/hardhat/node_modules/bigint-crypto-utils": { + "version": "3.3.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "packages/hardhat/node_modules/binary-extensions": { + "version": "2.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/bl": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "packages/hardhat/node_modules/bl/node_modules/buffer": { + "version": "5.7.1", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "packages/hardhat/node_modules/blakejs": { + "version": "1.2.1", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "packages/hardhat/node_modules/braces": { + "version": "3.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/browser-level": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "abstract-level": "^1.0.2", + "catering": "^2.1.1", + "module-error": "^1.0.2", + "run-parallel-limit": "^1.1.0" + } + }, + "packages/hardhat/node_modules/browser-stdout": { + "version": "1.3.1", + "dev": true, + "license": "ISC" + }, + "packages/hardhat/node_modules/browserify-aes": { + "version": "1.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "packages/hardhat/node_modules/bs58": { + "version": "4.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "base-x": "^3.0.2" + } + }, + "packages/hardhat/node_modules/bs58check": { + "version": "2.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "bs58": "^4.0.0", + "create-hash": "^1.1.0", + "safe-buffer": "^5.1.2" + } + }, + "packages/hardhat/node_modules/buffer": { + "version": "6.0.3", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "packages/hardhat/node_modules/buffer-from": { + "version": "1.1.2", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/buffer-xor": { + "version": "1.0.3", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/busboy": { + "version": "1.6.0", + "dev": true, + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, + "packages/hardhat/node_modules/bytes": { + "version": "3.1.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "packages/hardhat/node_modules/case": { + "version": "1.6.3", + "dev": true, + "license": "(MIT OR GPL-3.0-or-later)", + "engines": { + "node": ">= 0.8.0" + } + }, + "packages/hardhat/node_modules/caseless": { + "version": "0.12.0", + "dev": true, + "license": "Apache-2.0" + }, + "packages/hardhat/node_modules/catering": { + "version": "2.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/cbor": { + "version": "8.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "nofilter": "^3.1.0" + }, + "engines": { + "node": ">=12.19" + } + }, + "packages/hardhat/node_modules/chai-as-promised": { + "version": "7.1.1", + "dev": true, + "license": "WTFPL", + "dependencies": { + "check-error": "^1.0.2" + }, + "peerDependencies": { + "chai": ">= 2.1.2 < 5" + } + }, + "packages/hardhat/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/chalk/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/chalk/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "packages/hardhat/node_modules/chalk/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "license": "MIT" + }, + "packages/hardhat/node_modules/chalk/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/chalk/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/charenc": { + "version": "0.0.2", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": "*" + } + }, + "packages/hardhat/node_modules/chokidar": { + "version": "3.5.3", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "packages/hardhat/node_modules/ci-info": { + "version": "2.0.0", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/cipher-base": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "packages/hardhat/node_modules/classic-level": { + "version": "1.3.0", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "abstract-level": "^1.0.2", + "catering": "^2.1.0", + "module-error": "^1.0.1", + "napi-macros": "^2.2.2", + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=12" + } + }, + "packages/hardhat/node_modules/clean-stack": { + "version": "2.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/cli-cursor": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/cli-spinners": { + "version": "2.9.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/hardhat/node_modules/cli-table3": { + "version": "0.5.1", + "dev": true, + "license": "MIT", + "dependencies": { + "object-assign": "^4.1.0", + "string-width": "^2.1.1" + }, + "engines": { + "node": ">=6" + }, + "optionalDependencies": { + "colors": "^1.1.2" + } + }, + "packages/hardhat/node_modules/cli-table3/node_modules/ansi-regex": { + "version": "3.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/cli-table3/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/cli-table3/node_modules/string-width": { + "version": "2.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/cli-table3/node_modules/strip-ansi": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/cli-width": { + "version": "4.1.0", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 12" + } + }, + "packages/hardhat/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "packages/hardhat/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "packages/hardhat/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "packages/hardhat/node_modules/colors": { + "version": "1.4.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.1.90" + } + }, + "packages/hardhat/node_modules/combined-stream": { + "version": "1.0.8", + "dev": true, + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "packages/hardhat/node_modules/command-exists": { + "version": "1.2.9", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/command-line-args": { + "version": "5.2.1", + "license": "MIT", + "dependencies": { + "array-back": "^3.1.0", + "find-replace": "^3.0.0", + "lodash.camelcase": "^4.3.0", + "typical": "^4.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "packages/hardhat/node_modules/command-line-args/node_modules/typical": { + "version": "4.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/command-line-usage": { + "version": "6.1.3", + "license": "MIT", + "dependencies": { + "array-back": "^4.0.2", + "chalk": "^2.4.2", + "table-layout": "^1.0.2", + "typical": "^5.2.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "packages/hardhat/node_modules/command-line-usage/node_modules/array-back": { + "version": "4.0.2", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/commander": { + "version": "3.0.2", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/concat-stream": { + "version": "1.6.2", + "dev": true, + "engines": [ + "node >= 0.8" + ], + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "packages/hardhat/node_modules/concat-stream/node_modules/core-util-is": { + "version": "1.0.3", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/concat-stream/node_modules/isarray": { + "version": "1.0.0", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/concat-stream/node_modules/readable-stream": { + "version": "2.3.8", + "dev": true, + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "packages/hardhat/node_modules/concat-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/concat-stream/node_modules/string_decoder": { + "version": "1.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "packages/hardhat/node_modules/cookie": { + "version": "0.4.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "packages/hardhat/node_modules/core-util-is": { + "version": "1.0.2", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/crc-32": { + "version": "1.2.2", + "dev": true, + "license": "Apache-2.0", + "bin": { + "crc32": "bin/crc32.njs" + }, + "engines": { + "node": ">=0.8" + } + }, + "packages/hardhat/node_modules/create-hash": { + "version": "1.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "packages/hardhat/node_modules/create-hmac": { + "version": "1.1.7", + "dev": true, + "license": "MIT", + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "packages/hardhat/node_modules/create-require": { + "version": "1.1.1", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/cross-spawn": { + "version": "7.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "packages/hardhat/node_modules/cross-spawn/node_modules/which": { + "version": "2.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "packages/hardhat/node_modules/crypt": { + "version": "0.0.2", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": "*" + } + }, + "packages/hardhat/node_modules/dashdash": { + "version": "1.14.1", + "dev": true, + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "packages/hardhat/node_modules/death": { + "version": "1.1.0", + "dev": true + }, + "packages/hardhat/node_modules/debug": { + "version": "4.3.4", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "packages/hardhat/node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "license": "MIT" + }, + "packages/hardhat/node_modules/deep-extend": { + "version": "0.6.0", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "packages/hardhat/node_modules/delayed-stream": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "packages/hardhat/node_modules/depd": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "packages/hardhat/node_modules/detect-port": { + "version": "1.5.1", + "dev": true, + "license": "MIT", + "dependencies": { + "address": "^1.0.1", + "debug": "4" + }, + "bin": { + "detect": "bin/detect-port.js", + "detect-port": "bin/detect-port.js" + } + }, + "packages/hardhat/node_modules/diff": { + "version": "3.5.0", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "packages/hardhat/node_modules/difflib": { + "version": "0.2.4", + "dev": true, + "dependencies": { + "heap": ">= 0.2.0" + } + }, + "packages/hardhat/node_modules/dijkstrajs": { + "version": "1.0.3", + "license": "MIT" + }, + "packages/hardhat/node_modules/dotenv": { + "version": "16.3.1", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/motdotla/dotenv?sponsor=1" + } + }, + "packages/hardhat/node_modules/ecc-jsbn": { + "version": "0.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "packages/hardhat/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "packages/hardhat/node_modules/encode-utf8": { + "version": "1.0.3", + "license": "MIT" + }, + "packages/hardhat/node_modules/env-paths": { + "version": "2.2.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/envfile": { + "version": "6.18.0", + "license": "MIT", + "bin": { + "envfile": "bin.cjs" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://bevry.me/fund" + } + }, + "packages/hardhat/node_modules/es-array-method-boxes-properly": { + "version": "1.0.0", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "packages/hardhat/node_modules/escodegen": { + "version": "1.8.1", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esprima": "^2.7.1", + "estraverse": "^1.9.1", + "esutils": "^2.0.2", + "optionator": "^0.8.1" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=0.12.0" + }, + "optionalDependencies": { + "source-map": "~0.2.0" + } + }, + "packages/hardhat/node_modules/escodegen/node_modules/esprima": { + "version": "2.7.3", + "dev": true, + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "packages/hardhat/node_modules/escodegen/node_modules/estraverse": { + "version": "1.9.3", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "packages/hardhat/node_modules/escodegen/node_modules/levn": { + "version": "0.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "packages/hardhat/node_modules/escodegen/node_modules/optionator": { + "version": "0.8.3", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "packages/hardhat/node_modules/escodegen/node_modules/prelude-ls": { + "version": "1.1.2", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "packages/hardhat/node_modules/escodegen/node_modules/source-map": { + "version": "0.2.0", + "dev": true, + "optional": true, + "dependencies": { + "amdefine": ">=0.0.4" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "packages/hardhat/node_modules/escodegen/node_modules/type-check": { + "version": "0.3.2", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "packages/hardhat/node_modules/eslint-config-prettier": { + "version": "8.10.0", + "dev": true, + "license": "MIT", + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "packages/hardhat/node_modules/eslint-plugin-prettier": { + "version": "4.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "prettier-linter-helpers": "^1.0.0" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "eslint": ">=7.28.0", + "prettier": ">=2.0.0" + }, + "peerDependenciesMeta": { + "eslint-config-prettier": { + "optional": true + } + } + }, + "packages/hardhat/node_modules/eth-gas-reporter": { + "version": "0.2.25", + "dev": true, + "license": "MIT", + "dependencies": { + "@ethersproject/abi": "^5.0.0-beta.146", + "@solidity-parser/parser": "^0.14.0", + "cli-table3": "^0.5.0", + "colors": "1.4.0", + "ethereum-cryptography": "^1.0.3", + "ethers": "^4.0.40", + "fs-readdir-recursive": "^1.1.0", + "lodash": "^4.17.14", + "markdown-table": "^1.1.3", + "mocha": "^7.1.1", + "req-cwd": "^2.0.0", + "request": "^2.88.0", + "request-promise-native": "^1.0.5", + "sha1": "^1.1.1", + "sync-request": "^6.0.0" + }, + "peerDependencies": { + "@codechecks/client": "^0.1.0" + }, + "peerDependenciesMeta": { + "@codechecks/client": { + "optional": true + } + } + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/@noble/hashes": { + "version": "1.2.0", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "license": "MIT" + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/ansi-colors": { + "version": "3.2.3", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/ansi-regex": { + "version": "3.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/chokidar": { + "version": "3.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.2.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.1.1" + } + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/debug": { + "version": "3.2.6", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/debug/node_modules/ms": { + "version": "2.1.3", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/ethereum-cryptography": { + "version": "1.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.2.0", + "@noble/secp256k1": "1.7.1", + "@scure/bip32": "1.1.5", + "@scure/bip39": "1.1.1" + } + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/ethers": { + "version": "4.0.49", + "dev": true, + "license": "MIT", + "dependencies": { + "aes-js": "3.0.0", + "bn.js": "^4.11.9", + "elliptic": "6.5.4", + "hash.js": "1.1.3", + "js-sha3": "0.5.7", + "scrypt-js": "2.0.4", + "setimmediate": "1.0.4", + "uuid": "2.0.1", + "xmlhttprequest": "1.8.0" + } + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/find-up": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/glob": { + "version": "7.1.3", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/hash.js": { + "version": "1.1.3", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" + } + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/js-sha3": { + "version": "0.5.7", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/js-yaml": { + "version": "3.13.1", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/locate-path": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/log-symbols": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^2.4.2" + }, + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/mkdirp": { + "version": "0.5.5", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/mocha": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-colors": "3.2.3", + "browser-stdout": "1.3.1", + "chokidar": "3.3.0", + "debug": "3.2.6", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "find-up": "3.0.0", + "glob": "7.1.3", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "3.13.1", + "log-symbols": "3.0.0", + "minimatch": "3.0.4", + "mkdirp": "0.5.5", + "ms": "2.1.1", + "node-environment-flags": "1.0.6", + "object.assign": "4.1.0", + "strip-json-comments": "2.0.1", + "supports-color": "6.0.0", + "which": "1.3.1", + "wide-align": "1.1.3", + "yargs": "13.3.2", + "yargs-parser": "13.1.2", + "yargs-unparser": "1.6.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" + } + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/mocha/node_modules/minimatch": { + "version": "3.0.4", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/ms": { + "version": "2.1.1", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/object.assign": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + }, + "engines": { + "node": ">= 0.4" + } + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/p-locate": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/path-exists": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/readdirp": { + "version": "3.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/scrypt-js": { + "version": "2.0.4", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/setimmediate": { + "version": "1.0.4", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/string-width": { + "version": "2.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/strip-ansi": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/strip-json-comments": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "packages/hardhat/node_modules/eth-gas-reporter/node_modules/wide-align": { + "version": "1.1.3", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^1.0.2 || 2" + } + }, + "packages/hardhat/node_modules/ethereum-bloom-filters": { + "version": "1.0.10", + "dev": true, + "license": "MIT", + "dependencies": { + "js-sha3": "^0.8.0" + } + }, + "packages/hardhat/node_modules/ethereum-cryptography": { + "version": "0.1.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "packages/hardhat/node_modules/ethereumjs-abi": { + "version": "0.6.8", + "dev": true, + "license": "MIT", + "dependencies": { + "bn.js": "^4.11.8", + "ethereumjs-util": "^6.0.0" + } + }, + "packages/hardhat/node_modules/ethereumjs-abi/node_modules/bn.js": { + "version": "4.12.0", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/ethereumjs-util": { + "version": "6.2.1", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + }, + "packages/hardhat/node_modules/ethereumjs-util/node_modules/@types/bn.js": { + "version": "4.11.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "packages/hardhat/node_modules/ethereumjs-util/node_modules/bn.js": { + "version": "4.12.0", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/ethers": { + "version": "6.10.0", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/ethers-io/" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@adraffy/ens-normalize": "1.10.0", + "@noble/curves": "1.2.0", + "@noble/hashes": "1.3.2", + "@types/node": "18.15.13", + "aes-js": "4.0.0-beta.5", + "tslib": "2.4.0", + "ws": "8.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "packages/hardhat/node_modules/ethers/node_modules/@noble/curves": { + "version": "1.2.0", + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.3.2" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "packages/hardhat/node_modules/ethers/node_modules/@types/node": { + "version": "18.15.13", + "license": "MIT" + }, + "packages/hardhat/node_modules/ethers/node_modules/aes-js": { + "version": "4.0.0-beta.5", + "license": "MIT" + }, + "packages/hardhat/node_modules/ethers/node_modules/tslib": { + "version": "2.4.0", + "license": "0BSD" + }, + "packages/hardhat/node_modules/ethers/node_modules/ws": { + "version": "8.5.0", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "packages/hardhat/node_modules/ethjs-unit": { + "version": "0.1.6", + "dev": true, + "license": "MIT", + "dependencies": { + "bn.js": "4.11.6", + "number-to-bn": "1.7.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "packages/hardhat/node_modules/ethjs-unit/node_modules/bn.js": { + "version": "4.11.6", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/ethjs-util": { + "version": "0.1.6", + "dev": true, + "license": "MIT", + "dependencies": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "packages/hardhat/node_modules/evp_bytestokey": { + "version": "1.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "packages/hardhat/node_modules/execa": { + "version": "8.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "packages/hardhat/node_modules/extend": { + "version": "3.0.2", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/extsprintf": { + "version": "1.3.0", + "dev": true, + "engines": [ + "node >=0.6.0" + ], + "license": "MIT" + }, + "packages/hardhat/node_modules/fast-diff": { + "version": "1.3.0", + "dev": true, + "license": "Apache-2.0" + }, + "packages/hardhat/node_modules/figures": { + "version": "3.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/hardhat/node_modules/fill-range": { + "version": "7.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/find-replace": { + "version": "3.0.0", + "license": "MIT", + "dependencies": { + "array-back": "^3.0.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "packages/hardhat/node_modules/find-up": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/hardhat/node_modules/flat": { + "version": "4.1.1", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "is-buffer": "~2.0.3" + }, + "bin": { + "flat": "cli.js" + } + }, + "packages/hardhat/node_modules/fmix": { + "version": "0.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "imul": "^1.0.0" + } + }, + "packages/hardhat/node_modules/follow-redirects": { + "version": "1.15.3", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "packages/hardhat/node_modules/forever-agent": { + "version": "0.6.1", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "*" + } + }, + "packages/hardhat/node_modules/form-data": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "packages/hardhat/node_modules/fp-ts": { + "version": "1.19.3", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/fs-readdir-recursive": { + "version": "1.1.0", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/functional-red-black-tree": { + "version": "1.0.1", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/get-port": { + "version": "3.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/get-stream": { + "version": "8.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/hardhat/node_modules/getpass": { + "version": "0.1.7", + "dev": true, + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0" + } + }, + "packages/hardhat/node_modules/ghost-testrpc": { + "version": "0.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "chalk": "^2.4.2", + "node-emoji": "^1.10.0" + }, + "bin": { + "testrpc-sc": "index.js" + } + }, + "packages/hardhat/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "packages/hardhat/node_modules/global-modules": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "global-prefix": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/global-prefix": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ini": "^1.3.5", + "kind-of": "^6.0.2", + "which": "^1.3.1" + }, + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/growl": { + "version": "1.10.5", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4.x" + } + }, + "packages/hardhat/node_modules/handlebars": { + "version": "4.7.8", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.2", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, + "packages/hardhat/node_modules/har-schema": { + "version": "2.0.0", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/har-validator": { + "version": "5.1.5", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/hardhat": { + "version": "2.19.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@ethersproject/abi": "^5.1.2", + "@metamask/eth-sig-util": "^4.0.0", + "@nomicfoundation/ethereumjs-block": "5.0.2", + "@nomicfoundation/ethereumjs-blockchain": "7.0.2", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-evm": "2.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-statemanager": "2.0.2", + "@nomicfoundation/ethereumjs-trie": "6.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", + "@nomicfoundation/ethereumjs-vm": "7.0.2", + "@nomicfoundation/solidity-analyzer": "^0.1.0", + "@sentry/node": "^5.18.1", + "@types/bn.js": "^5.1.0", + "@types/lru-cache": "^5.1.0", + "adm-zip": "^0.4.16", + "aggregate-error": "^3.0.0", + "ansi-escapes": "^4.3.0", + "chalk": "^2.4.2", + "chokidar": "^3.4.0", + "ci-info": "^2.0.0", + "debug": "^4.1.1", + "enquirer": "^2.3.0", + "env-paths": "^2.2.0", + "ethereum-cryptography": "^1.0.3", + "ethereumjs-abi": "^0.6.8", + "find-up": "^2.1.0", + "fp-ts": "1.19.3", + "fs-extra": "^7.0.1", + "glob": "7.2.0", + "immutable": "^4.0.0-rc.12", + "io-ts": "1.10.4", + "keccak": "^3.0.2", + "lodash": "^4.17.11", + "mnemonist": "^0.38.0", + "mocha": "^10.0.0", + "p-map": "^4.0.0", + "raw-body": "^2.4.1", + "resolve": "1.17.0", + "semver": "^6.3.0", + "solc": "0.7.3", + "source-map-support": "^0.5.13", + "stacktrace-parser": "^0.1.10", + "tsort": "0.0.1", + "undici": "^5.14.0", + "uuid": "^8.3.2", + "ws": "^7.4.6" + }, + "bin": { + "hardhat": "internal/cli/bootstrap.js" + }, + "peerDependencies": { + "ts-node": "*", + "typescript": "*" + }, + "peerDependenciesMeta": { + "ts-node": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "packages/hardhat/node_modules/hardhat-deploy": { + "version": "0.11.45", + "dev": true, + "license": "MIT", + "dependencies": { + "@ethersproject/abi": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/contracts": "^5.7.0", + "@ethersproject/providers": "^5.7.2", + "@ethersproject/solidity": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wallet": "^5.7.0", + "@types/qs": "^6.9.7", + "axios": "^0.21.1", + "chalk": "^4.1.2", + "chokidar": "^3.5.2", + "debug": "^4.3.2", + "enquirer": "^2.3.6", + "ethers": "^5.7.0", + "form-data": "^4.0.0", + "fs-extra": "^10.0.0", + "match-all": "^1.2.6", + "murmur-128": "^0.2.1", + "qs": "^6.9.4", + "zksync-web3": "^0.14.3" + } + }, + "packages/hardhat/node_modules/hardhat-deploy-ethers": { + "version": "0.4.1", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@nomicfoundation/hardhat-ethers": "^3.0.2", + "hardhat": "^2.16.0", + "hardhat-deploy": "^0.11.34" + } + }, + "packages/hardhat/node_modules/hardhat-deploy/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "packages/hardhat/node_modules/hardhat-deploy/node_modules/ethers": { + "version": "5.7.2", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/abi": "5.7.0", + "@ethersproject/abstract-provider": "5.7.0", + "@ethersproject/abstract-signer": "5.7.0", + "@ethersproject/address": "5.7.0", + "@ethersproject/base64": "5.7.0", + "@ethersproject/basex": "5.7.0", + "@ethersproject/bignumber": "5.7.0", + "@ethersproject/bytes": "5.7.0", + "@ethersproject/constants": "5.7.0", + "@ethersproject/contracts": "5.7.0", + "@ethersproject/hash": "5.7.0", + "@ethersproject/hdnode": "5.7.0", + "@ethersproject/json-wallets": "5.7.0", + "@ethersproject/keccak256": "5.7.0", + "@ethersproject/logger": "5.7.0", + "@ethersproject/networks": "5.7.1", + "@ethersproject/pbkdf2": "5.7.0", + "@ethersproject/properties": "5.7.0", + "@ethersproject/providers": "5.7.2", + "@ethersproject/random": "5.7.0", + "@ethersproject/rlp": "5.7.0", + "@ethersproject/sha2": "5.7.0", + "@ethersproject/signing-key": "5.7.0", + "@ethersproject/solidity": "5.7.0", + "@ethersproject/strings": "5.7.0", + "@ethersproject/transactions": "5.7.0", + "@ethersproject/units": "5.7.0", + "@ethersproject/wallet": "5.7.0", + "@ethersproject/web": "5.7.1", + "@ethersproject/wordlists": "5.7.0" + } + }, + "packages/hardhat/node_modules/hardhat-deploy/node_modules/fs-extra": { + "version": "10.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "packages/hardhat/node_modules/hardhat-deploy/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/hardhat-deploy/node_modules/zksync-web3": { + "version": "0.14.4", + "dev": true, + "license": "MIT", + "peerDependencies": { + "ethers": "^5.7.0" + } + }, + "packages/hardhat/node_modules/hardhat-gas-reporter": { + "version": "1.0.9", + "dev": true, + "license": "MIT", + "dependencies": { + "array-uniq": "1.0.3", + "eth-gas-reporter": "^0.2.25", + "sha1": "^1.1.1" + }, + "peerDependencies": { + "hardhat": "^2.0.2" + } + }, + "packages/hardhat/node_modules/hardhat/node_modules/@noble/hashes": { + "version": "1.2.0", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "license": "MIT" + }, + "packages/hardhat/node_modules/hardhat/node_modules/ethereum-cryptography": { + "version": "1.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.2.0", + "@noble/secp256k1": "1.7.1", + "@scure/bip32": "1.1.5", + "@scure/bip39": "1.1.1" + } + }, + "packages/hardhat/node_modules/hardhat/node_modules/find-up": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/hardhat/node_modules/glob": { + "version": "7.2.0", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "packages/hardhat/node_modules/hardhat/node_modules/locate-path": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/hardhat/node_modules/p-limit": { + "version": "1.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/hardhat/node_modules/p-locate": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/hardhat/node_modules/p-try": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/hardhat/node_modules/path-exists": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/hardhat/node_modules/semver": { + "version": "6.3.1", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "packages/hardhat/node_modules/hardhat/node_modules/uuid": { + "version": "8.3.2", + "dev": true, + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "packages/hardhat/node_modules/hardhat/node_modules/ws": { + "version": "7.5.9", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "packages/hardhat/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/hash-base": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/he": { + "version": "1.2.0", + "dev": true, + "license": "MIT", + "bin": { + "he": "bin/he" + } + }, + "packages/hardhat/node_modules/heap": { + "version": "0.2.7", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/http-basic": { + "version": "8.1.3", + "dev": true, + "license": "MIT", + "dependencies": { + "caseless": "^0.12.0", + "concat-stream": "^1.6.2", + "http-response-object": "^3.0.1", + "parse-cache-control": "^1.0.1" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "packages/hardhat/node_modules/http-errors": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "packages/hardhat/node_modules/http-response-object": { + "version": "3.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "^10.0.3" + } + }, + "packages/hardhat/node_modules/http-response-object/node_modules/@types/node": { + "version": "10.17.60", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/http-signature": { + "version": "1.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + }, + "engines": { + "node": ">=0.8", + "npm": ">=1.3.7" + } + }, + "packages/hardhat/node_modules/https-proxy-agent": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "packages/hardhat/node_modules/human-signals": { + "version": "5.0.0", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=16.17.0" + } + }, + "packages/hardhat/node_modules/ieee754": { + "version": "1.2.1", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "packages/hardhat/node_modules/immutable": { + "version": "4.3.4", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/imul": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "packages/hardhat/node_modules/ini": { + "version": "1.3.8", + "dev": true, + "license": "ISC" + }, + "packages/hardhat/node_modules/inquirer": { + "version": "9.2.14", + "dev": true, + "license": "MIT", + "dependencies": { + "@ljharb/through": "^2.3.12", + "ansi-escapes": "^4.3.2", + "chalk": "^5.3.0", + "cli-cursor": "^3.1.0", + "cli-width": "^4.1.0", + "external-editor": "^3.1.0", + "figures": "^3.2.0", + "lodash": "^4.17.21", + "mute-stream": "1.0.0", + "ora": "^5.4.1", + "run-async": "^3.0.0", + "rxjs": "^7.8.1", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^6.2.0" + }, + "engines": { + "node": ">=18" + } + }, + "packages/hardhat/node_modules/inquirer/node_modules/chalk": { + "version": "5.3.0", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "packages/hardhat/node_modules/interpret": { + "version": "1.4.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "packages/hardhat/node_modules/io-ts": { + "version": "1.10.4", + "dev": true, + "license": "MIT", + "dependencies": { + "fp-ts": "^1.0.0" + } + }, + "packages/hardhat/node_modules/io-ts/node_modules/fp-ts": { + "version": "1.19.5", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/is-binary-path": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/is-buffer": { + "version": "2.0.5", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/is-fullwidth-code-point": { + "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==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/is-hex-prefixed": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "packages/hardhat/node_modules/is-interactive": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/is-number": { + "version": "7.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "packages/hardhat/node_modules/is-plain-obj": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/is-stream": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/hardhat/node_modules/is-typedarray": { + "version": "1.0.0", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/is-unicode-supported": { + "version": "0.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/hardhat/node_modules/isexe": { + "version": "2.0.0", + "dev": true, + "license": "ISC" + }, + "packages/hardhat/node_modules/isstream": { + "version": "0.1.2", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/js-sdsl": { + "version": "4.4.2", + "dev": true, + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, + "packages/hardhat/node_modules/js-yaml": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "packages/hardhat/node_modules/js-yaml/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "packages/hardhat/node_modules/jsbn": { + "version": "0.1.1", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/json-schema": { + "version": "0.4.0", + "dev": true, + "license": "(AFL-2.1 OR BSD-3-Clause)" + }, + "packages/hardhat/node_modules/json-stringify-safe": { + "version": "5.0.1", + "dev": true, + "license": "ISC" + }, + "packages/hardhat/node_modules/jsonfile": { + "version": "6.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "packages/hardhat/node_modules/jsonschema": { + "version": "1.4.1", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "packages/hardhat/node_modules/jsprim": { + "version": "1.4.2", + "dev": true, + "license": "MIT", + "dependencies": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.4.0", + "verror": "1.10.0" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "packages/hardhat/node_modules/keccak": { + "version": "3.0.4", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "packages/hardhat/node_modules/klaw": { + "version": "1.3.1", + "dev": true, + "license": "MIT", + "optionalDependencies": { + "graceful-fs": "^4.1.9" + } + }, + "packages/hardhat/node_modules/level": { + "version": "8.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "browser-level": "^1.0.1", + "classic-level": "^1.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/level" + } + }, + "packages/hardhat/node_modules/level-supports": { + "version": "4.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "packages/hardhat/node_modules/level-transcoder": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer": "^6.0.3", + "module-error": "^1.0.1" + }, + "engines": { + "node": ">=12" + } + }, + "packages/hardhat/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/hardhat/node_modules/lodash": { + "version": "4.17.21", + "license": "MIT" + }, + "packages/hardhat/node_modules/lodash.camelcase": { + "version": "4.3.0", + "license": "MIT" + }, + "packages/hardhat/node_modules/lodash.clonedeep": { + "version": "4.5.0", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/lodash.isequal": { + "version": "4.5.0", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/lodash.truncate": { + "version": "4.4.2", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/log-symbols": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/hardhat/node_modules/log-symbols/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "packages/hardhat/node_modules/log-symbols/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/lru_map": { + "version": "0.3.3", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/make-error": { + "version": "1.3.6", + "dev": true, + "license": "ISC" + }, + "packages/hardhat/node_modules/markdown-table": { + "version": "1.1.3", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/match-all": { + "version": "1.2.6", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/mcl-wasm": { + "version": "0.7.9", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=8.9.0" + } + }, + "packages/hardhat/node_modules/md5.js": { + "version": "1.3.5", + "dev": true, + "license": "MIT", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "packages/hardhat/node_modules/memory-level": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "abstract-level": "^1.0.0", + "functional-red-black-tree": "^1.0.1", + "module-error": "^1.0.1" + }, + "engines": { + "node": ">=12" + } + }, + "packages/hardhat/node_modules/memorystream": { + "version": "0.3.1", + "dev": true, + "engines": { + "node": ">= 0.10.0" + } + }, + "packages/hardhat/node_modules/merge-stream": { + "version": "2.0.0", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/micro-ftch": { + "version": "0.3.1", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/mime-db": { + "version": "1.52.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "packages/hardhat/node_modules/mime-types": { + "version": "2.1.35", + "dev": true, + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "packages/hardhat/node_modules/mimic-fn": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/hardhat/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "packages/hardhat/node_modules/minimist": { + "version": "1.2.8", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/hardhat/node_modules/mkdirp": { + "version": "1.0.4", + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "packages/hardhat/node_modules/mnemonist": { + "version": "0.38.5", + "dev": true, + "license": "MIT", + "dependencies": { + "obliterator": "^2.0.0" + } + }, + "packages/hardhat/node_modules/mocha": { + "version": "10.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.3", + "debug": "4.3.4", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.2.0", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "5.0.1", + "ms": "2.1.3", + "nanoid": "3.3.3", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "workerpool": "6.2.1", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": ">= 14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" + } + }, + "packages/hardhat/node_modules/mocha/node_modules/ansi-colors": { + "version": "4.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/mocha/node_modules/camelcase": { + "version": "6.3.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/hardhat/node_modules/mocha/node_modules/cliui": { + "version": "7.0.4", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "packages/hardhat/node_modules/mocha/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "packages/hardhat/node_modules/mocha/node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/mocha/node_modules/decamelize": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/hardhat/node_modules/mocha/node_modules/diff": { + "version": "5.0.0", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "packages/hardhat/node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/hardhat/node_modules/mocha/node_modules/flat": { + "version": "5.0.2", + "dev": true, + "license": "BSD-3-Clause", + "bin": { + "flat": "cli.js" + } + }, + "packages/hardhat/node_modules/mocha/node_modules/glob": { + "version": "7.2.0", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "packages/hardhat/node_modules/mocha/node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "packages/hardhat/node_modules/mocha/node_modules/minimatch": { + "version": "5.0.1", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "packages/hardhat/node_modules/mocha/node_modules/minimatch/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "packages/hardhat/node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "packages/hardhat/node_modules/mocha/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "packages/hardhat/node_modules/mocha/node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "packages/hardhat/node_modules/mocha/node_modules/yargs": { + "version": "16.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "packages/hardhat/node_modules/mocha/node_modules/yargs-parser": { + "version": "20.2.4", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "packages/hardhat/node_modules/mocha/node_modules/yargs-unparser": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "packages/hardhat/node_modules/mocha/node_modules/yargs/node_modules/yargs-parser": { + "version": "20.2.9", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "packages/hardhat/node_modules/module-error": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "packages/hardhat/node_modules/ms": { + "version": "2.1.3", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/murmur-128": { + "version": "0.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "encode-utf8": "^1.0.2", + "fmix": "^0.1.0", + "imul": "^1.0.0" + } + }, + "packages/hardhat/node_modules/mute-stream": { + "version": "1.0.0", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "packages/hardhat/node_modules/nanoid": { + "version": "3.3.3", + "dev": true, + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "packages/hardhat/node_modules/napi-macros": { + "version": "2.2.2", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/neo-async": { + "version": "2.6.2", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/node-addon-api": { + "version": "2.0.2", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/node-emoji": { + "version": "1.11.0", + "dev": true, + "license": "MIT", + "dependencies": { + "lodash": "^4.17.21" + } + }, + "packages/hardhat/node_modules/node-environment-flags": { + "version": "1.0.6", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "object.getownpropertydescriptors": "^2.0.3", + "semver": "^5.7.0" + } + }, + "packages/hardhat/node_modules/node-environment-flags/node_modules/semver": { + "version": "5.7.2", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "packages/hardhat/node_modules/node-gyp-build": { + "version": "4.6.1", + "dev": true, + "license": "MIT", + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "packages/hardhat/node_modules/nofilter": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.19" + } + }, + "packages/hardhat/node_modules/normalize-path": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "packages/hardhat/node_modules/npm-run-path": { + "version": "5.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/hardhat/node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/hardhat/node_modules/number-to-bn": { + "version": "1.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "bn.js": "4.11.6", + "strip-hex-prefix": "1.0.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "packages/hardhat/node_modules/number-to-bn/node_modules/bn.js": { + "version": "4.11.6", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/oauth-sign": { + "version": "0.9.0", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "*" + } + }, + "packages/hardhat/node_modules/object-assign": { + "version": "4.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "packages/hardhat/node_modules/object.getownpropertydescriptors": { + "version": "2.1.7", + "dev": true, + "license": "MIT", + "dependencies": { + "array.prototype.reduce": "^1.0.6", + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "safe-array-concat": "^1.0.0" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/hardhat/node_modules/obliterator": { + "version": "2.0.4", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/onetime": { + "version": "6.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/hardhat/node_modules/ora": { + "version": "5.4.1", + "dev": true, + "license": "MIT", + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/hardhat/node_modules/ora/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "packages/hardhat/node_modules/ora/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/ordinal": { + "version": "1.0.3", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/hardhat/node_modules/p-locate/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/hardhat/node_modules/p-map": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/hardhat/node_modules/parse-cache-control": { + "version": "1.0.1", + "dev": true + }, + "packages/hardhat/node_modules/path-key": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/pbkdf2": { + "version": "3.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + }, + "engines": { + "node": ">=0.12" + } + }, + "packages/hardhat/node_modules/performance-now": { + "version": "2.1.0", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/picomatch": { + "version": "2.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "packages/hardhat/node_modules/pngjs": { + "version": "5.0.0", + "license": "MIT", + "engines": { + "node": ">=10.13.0" + } + }, + "packages/hardhat/node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "packages/hardhat/node_modules/process-nextick-args": { + "version": "2.0.1", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/promise": { + "version": "8.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "asap": "~2.0.6" + } + }, + "packages/hardhat/node_modules/psl": { + "version": "1.9.0", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/qrcode": { + "version": "1.5.3", + "license": "MIT", + "dependencies": { + "dijkstrajs": "^1.0.1", + "encode-utf8": "^1.0.3", + "pngjs": "^5.0.0", + "yargs": "^15.3.1" + }, + "bin": { + "qrcode": "bin/qrcode" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "packages/hardhat/node_modules/qrcode/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/qrcode/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/qrcode/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/qrcode/node_modules/yargs": { + "version": "15.4.1", + "license": "MIT", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/qrcode/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "license": "ISC", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/qs": { + "version": "6.11.2", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/hardhat/node_modules/randombytes": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "packages/hardhat/node_modules/raw-body": { + "version": "2.5.2", + "dev": true, + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "packages/hardhat/node_modules/readable-stream": { + "version": "3.6.2", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "packages/hardhat/node_modules/readdirp": { + "version": "3.6.0", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "packages/hardhat/node_modules/rechoir": { + "version": "0.6.2", + "dev": true, + "dependencies": { + "resolve": "^1.1.6" + }, + "engines": { + "node": ">= 0.10" + } + }, + "packages/hardhat/node_modules/rechoir/node_modules/resolve": { + "version": "1.22.6", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/hardhat/node_modules/recursive-readdir": { + "version": "2.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "packages/hardhat/node_modules/reduce-flatten": { + "version": "2.0.0", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/req-cwd": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "req-from": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/req-from": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-from": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/req-from/node_modules/resolve-from": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/request": { + "version": "2.88.2", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "engines": { + "node": ">= 6" + } + }, + "packages/hardhat/node_modules/request-promise-core": { + "version": "1.1.4", + "dev": true, + "license": "ISC", + "dependencies": { + "lodash": "^4.17.19" + }, + "engines": { + "node": ">=0.10.0" + }, + "peerDependencies": { + "request": "^2.34" + } + }, + "packages/hardhat/node_modules/request-promise-native": { + "version": "1.0.9", + "dev": true, + "license": "ISC", + "dependencies": { + "request-promise-core": "1.1.4", + "stealthy-require": "^1.1.1", + "tough-cookie": "^2.3.3" + }, + "engines": { + "node": ">=0.12.0" + }, + "peerDependencies": { + "request": "^2.34" + } + }, + "packages/hardhat/node_modules/request/node_modules/form-data": { + "version": "2.3.3", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, + "packages/hardhat/node_modules/request/node_modules/qs": { + "version": "6.5.3", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.6" + } + }, + "packages/hardhat/node_modules/request/node_modules/uuid": { + "version": "3.4.0", + "dev": true, + "license": "MIT", + "bin": { + "uuid": "bin/uuid" + } + }, + "packages/hardhat/node_modules/require-from-string": { + "version": "2.0.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "packages/hardhat/node_modules/resolve": { + "version": "1.17.0", + "dev": true, + "license": "MIT", + "dependencies": { + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/hardhat/node_modules/restore-cursor": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/restore-cursor/node_modules/mimic-fn": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/restore-cursor/node_modules/onetime": { + "version": "5.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/hardhat/node_modules/restore-cursor/node_modules/signal-exit": { + "version": "3.0.7", + "dev": true, + "license": "ISC" + }, + "packages/hardhat/node_modules/ripemd160": { + "version": "2.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "packages/hardhat/node_modules/rlp": { + "version": "2.2.7", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "bn.js": "^5.2.0" + }, + "bin": { + "rlp": "bin/rlp" + } + }, + "packages/hardhat/node_modules/run-async": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "packages/hardhat/node_modules/run-parallel-limit": { + "version": "1.1.0", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "packages/hardhat/node_modules/rustbn.js": { + "version": "0.2.0", + "dev": true, + "license": "(MIT OR Apache-2.0)" + }, + "packages/hardhat/node_modules/rxjs": { + "version": "7.8.1", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "packages/hardhat/node_modules/rxjs/node_modules/tslib": { + "version": "2.6.2", + "dev": true, + "license": "0BSD" + }, + "packages/hardhat/node_modules/safe-buffer": { + "version": "5.2.1", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "packages/hardhat/node_modules/sc-istanbul": { + "version": "0.4.6", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "abbrev": "1.0.x", + "async": "1.x", + "escodegen": "1.8.x", + "esprima": "2.7.x", + "glob": "^5.0.15", + "handlebars": "^4.0.1", + "js-yaml": "3.x", + "mkdirp": "0.5.x", + "nopt": "3.x", + "once": "1.x", + "resolve": "1.1.x", + "supports-color": "^3.1.0", + "which": "^1.1.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "istanbul": "lib/cli.js" + } + }, + "packages/hardhat/node_modules/sc-istanbul/node_modules/abbrev": { + "version": "1.0.9", + "dev": true, + "license": "ISC" + }, + "packages/hardhat/node_modules/sc-istanbul/node_modules/esprima": { + "version": "2.7.3", + "dev": true, + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "packages/hardhat/node_modules/sc-istanbul/node_modules/glob": { + "version": "5.0.15", + "dev": true, + "license": "ISC", + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "packages/hardhat/node_modules/sc-istanbul/node_modules/has-flag": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "packages/hardhat/node_modules/sc-istanbul/node_modules/js-yaml": { + "version": "3.14.1", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "packages/hardhat/node_modules/sc-istanbul/node_modules/js-yaml/node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/sc-istanbul/node_modules/mkdirp": { + "version": "0.5.6", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "packages/hardhat/node_modules/sc-istanbul/node_modules/nopt": { + "version": "3.0.6", + "dev": true, + "license": "ISC", + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + } + }, + "packages/hardhat/node_modules/sc-istanbul/node_modules/nopt/node_modules/abbrev": { + "version": "1.1.1", + "dev": true, + "license": "ISC" + }, + "packages/hardhat/node_modules/sc-istanbul/node_modules/resolve": { + "version": "1.1.7", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/sc-istanbul/node_modules/supports-color": { + "version": "3.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^1.0.0" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "packages/hardhat/node_modules/secp256k1": { + "version": "4.0.3", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "elliptic": "^6.5.4", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "packages/hardhat/node_modules/serialize-javascript": { + "version": "6.0.0", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "packages/hardhat/node_modules/setimmediate": { + "version": "1.0.5", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/setprototypeof": { + "version": "1.2.0", + "dev": true, + "license": "ISC" + }, + "packages/hardhat/node_modules/sha.js": { + "version": "2.4.11", + "dev": true, + "license": "(MIT AND BSD-3-Clause)", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, + "packages/hardhat/node_modules/sha1": { + "version": "1.1.1", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "charenc": ">= 0.0.1", + "crypt": ">= 0.0.1" + }, + "engines": { + "node": "*" + } + }, + "packages/hardhat/node_modules/shebang-command": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/shebang-regex": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/shelljs": { + "version": "0.8.5", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + }, + "bin": { + "shjs": "bin/shjs" + }, + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/signal-exit": { + "version": "4.1.0", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "packages/hardhat/node_modules/slice-ansi": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "packages/hardhat/node_modules/solc": { + "version": "0.7.3", + "dev": true, + "license": "MIT", + "dependencies": { + "command-exists": "^1.2.8", + "commander": "3.0.2", + "follow-redirects": "^1.12.1", + "fs-extra": "^0.30.0", + "js-sha3": "0.8.0", + "memorystream": "^0.3.1", + "require-from-string": "^2.0.0", + "semver": "^5.5.0", + "tmp": "0.0.33" + }, + "bin": { + "solcjs": "solcjs" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "packages/hardhat/node_modules/solc/node_modules/fs-extra": { + "version": "0.30.0", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + } + }, + "packages/hardhat/node_modules/solc/node_modules/jsonfile": { + "version": "2.4.0", + "dev": true, + "license": "MIT", + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "packages/hardhat/node_modules/solc/node_modules/rimraf": { + "version": "2.7.1", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "packages/hardhat/node_modules/solc/node_modules/semver": { + "version": "5.7.2", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "packages/hardhat/node_modules/solidity-coverage": { + "version": "0.8.5", + "dev": true, + "license": "ISC", + "dependencies": { + "@ethersproject/abi": "^5.0.9", + "@solidity-parser/parser": "^0.16.0", + "chalk": "^2.4.2", + "death": "^1.1.0", + "detect-port": "^1.3.0", + "difflib": "^0.2.4", + "fs-extra": "^8.1.0", + "ghost-testrpc": "^0.0.2", + "global-modules": "^2.0.0", + "globby": "^10.0.1", + "jsonschema": "^1.2.4", + "lodash": "^4.17.15", + "mocha": "10.2.0", + "node-emoji": "^1.10.0", + "pify": "^4.0.1", + "recursive-readdir": "^2.2.2", + "sc-istanbul": "^0.4.5", + "semver": "^7.3.4", + "shelljs": "^0.8.3", + "web3-utils": "^1.3.6" + }, + "bin": { + "solidity-coverage": "plugins/bin.js" + }, + "peerDependencies": { + "hardhat": "^2.11.0" + } + }, + "packages/hardhat/node_modules/solidity-coverage/node_modules/@solidity-parser/parser": { + "version": "0.16.1", + "dev": true, + "license": "MIT", + "dependencies": { + "antlr4ts": "^0.5.0-alpha.4" + } + }, + "packages/hardhat/node_modules/solidity-coverage/node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "packages/hardhat/node_modules/solidity-coverage/node_modules/globby": { + "version": "10.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/glob": "^7.1.1", + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.0.3", + "glob": "^7.1.3", + "ignore": "^5.1.1", + "merge2": "^1.2.3", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/solidity-coverage/node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "license": "MIT", + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "packages/hardhat/node_modules/solidity-coverage/node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4.0.0" + } + }, + "packages/hardhat/node_modules/source-map": { + "version": "0.6.1", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "packages/hardhat/node_modules/source-map-support": { + "version": "0.5.21", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "packages/hardhat/node_modules/sshpk": { + "version": "1.17.0", + "dev": true, + "license": "MIT", + "dependencies": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "packages/hardhat/node_modules/stacktrace-parser": { + "version": "0.1.10", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.7.1" + }, + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/stacktrace-parser/node_modules/type-fest": { + "version": "0.7.1", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/statuses": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "packages/hardhat/node_modules/stealthy-require": { + "version": "1.1.1", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=0.10.0" + } + }, + "packages/hardhat/node_modules/streamsearch": { + "version": "1.1.0", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, + "packages/hardhat/node_modules/string_decoder": { + "version": "1.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "packages/hardhat/node_modules/string-format": { + "version": "2.0.0", + "license": "WTFPL OR MIT" + }, + "packages/hardhat/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/strip-final-newline": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/hardhat/node_modules/strip-hex-prefix": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "is-hex-prefixed": "1.0.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "packages/hardhat/node_modules/supports-color": { + "version": "6.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/supports-color/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/sync-request": { + "version": "6.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "http-response-object": "^3.0.1", + "sync-rpc": "^1.2.1", + "then-request": "^6.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "packages/hardhat/node_modules/sync-rpc": { + "version": "1.3.6", + "dev": true, + "license": "MIT", + "dependencies": { + "get-port": "^3.1.0" + } + }, + "packages/hardhat/node_modules/table": { + "version": "6.8.1", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "ajv": "^8.0.1", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "packages/hardhat/node_modules/table-layout": { + "version": "1.0.2", + "license": "MIT", + "dependencies": { + "array-back": "^4.0.1", + "deep-extend": "~0.6.0", + "typical": "^5.2.0", + "wordwrapjs": "^4.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "packages/hardhat/node_modules/table-layout/node_modules/array-back": { + "version": "4.0.2", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/table/node_modules/ajv": { + "version": "8.12.0", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "packages/hardhat/node_modules/table/node_modules/json-schema-traverse": { + "version": "1.0.0", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/then-request": { + "version": "6.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/concat-stream": "^1.6.0", + "@types/form-data": "0.0.33", + "@types/node": "^8.0.0", + "@types/qs": "^6.2.31", + "caseless": "~0.12.0", + "concat-stream": "^1.6.0", + "form-data": "^2.2.0", + "http-basic": "^8.1.1", + "http-response-object": "^3.0.1", + "promise": "^8.0.0", + "qs": "^6.4.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "packages/hardhat/node_modules/then-request/node_modules/@types/node": { + "version": "8.10.66", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/then-request/node_modules/form-data": { + "version": "2.5.1", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, + "packages/hardhat/node_modules/to-regex-range": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "packages/hardhat/node_modules/toidentifier": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "packages/hardhat/node_modules/tough-cookie": { + "version": "2.5.0", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=0.8" + } + }, + "packages/hardhat/node_modules/ts-command-line-args": { + "version": "2.5.1", + "license": "ISC", + "dependencies": { + "chalk": "^4.1.0", + "command-line-args": "^5.1.1", + "command-line-usage": "^6.1.0", + "string-format": "^2.0.0" + }, + "bin": { + "write-markdown": "dist/write-markdown.js" + } + }, + "packages/hardhat/node_modules/ts-command-line-args/node_modules/chalk": { + "version": "4.1.2", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "packages/hardhat/node_modules/ts-command-line-args/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/ts-essentials": { + "version": "7.0.3", + "license": "MIT", + "peerDependencies": { + "typescript": ">=3.7.0" + } + }, + "packages/hardhat/node_modules/ts-node": { + "version": "10.9.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "packages/hardhat/node_modules/ts-node/node_modules/diff": { + "version": "4.0.2", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "packages/hardhat/node_modules/tslib": { + "version": "1.14.1", + "dev": true, + "license": "0BSD" + }, + "packages/hardhat/node_modules/tsort": { + "version": "0.0.1", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/tunnel-agent": { + "version": "0.6.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "packages/hardhat/node_modules/tweetnacl": { + "version": "0.14.5", + "dev": true, + "license": "Unlicense" + }, + "packages/hardhat/node_modules/tweetnacl-util": { + "version": "0.15.1", + "dev": true, + "license": "Unlicense" + }, + "packages/hardhat/node_modules/typechain": { + "version": "8.3.1", + "license": "MIT", + "dependencies": { + "@types/prettier": "^2.1.1", + "debug": "^4.3.1", + "fs-extra": "^7.0.0", + "glob": "7.1.7", + "js-sha3": "^0.8.0", + "lodash": "^4.17.15", + "mkdirp": "^1.0.4", + "prettier": "^2.3.1", + "ts-command-line-args": "^2.2.0", + "ts-essentials": "^7.0.1" + }, + "bin": { + "typechain": "dist/cli/cli.js" + }, + "peerDependencies": { + "typescript": ">=4.3.0" + } + }, + "packages/hardhat/node_modules/typechain/node_modules/glob": { + "version": "7.1.7", + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "packages/hardhat/node_modules/typedarray": { + "version": "0.0.6", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/typical": { + "version": "5.2.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/uglify-js": { + "version": "3.17.4", + "dev": true, + "license": "BSD-2-Clause", + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "packages/hardhat/node_modules/undici": { + "version": "5.25.2", + "dev": true, + "license": "MIT", + "dependencies": { + "busboy": "^1.6.0" + }, + "engines": { + "node": ">=14.0" + } + }, + "packages/hardhat/node_modules/universalify": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "packages/hardhat/node_modules/unpipe": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "packages/hardhat/node_modules/utf8": { + "version": "3.0.0", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/util-deprecate": { + "version": "1.0.2", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/uuid": { + "version": "2.0.1", + "dev": true + }, + "packages/hardhat/node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/verror": { + "version": "1.10.0", + "dev": true, + "engines": [ + "node >=0.6.0" + ], + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "packages/hardhat/node_modules/verror/node_modules/extsprintf": { + "version": "1.4.1", + "dev": true, + "engines": [ + "node >=0.6.0" + ], + "license": "MIT" + }, + "packages/hardhat/node_modules/web3-utils": { + "version": "1.10.2", + "dev": true, + "license": "LGPL-3.0", + "dependencies": { + "@ethereumjs/util": "^8.1.0", + "bn.js": "^5.2.1", + "ethereum-bloom-filters": "^1.0.6", + "ethereum-cryptography": "^2.1.2", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "utf8": "3.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "packages/hardhat/node_modules/web3-utils/node_modules/@scure/bip32": { + "version": "1.3.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@noble/curves": "~1.1.0", + "@noble/hashes": "~1.3.1", + "@scure/base": "~1.1.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "packages/hardhat/node_modules/web3-utils/node_modules/@scure/bip39": { + "version": "1.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@noble/hashes": "~1.3.0", + "@scure/base": "~1.1.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "packages/hardhat/node_modules/web3-utils/node_modules/ethereum-cryptography": { + "version": "2.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@noble/curves": "1.1.0", + "@noble/hashes": "1.3.1", + "@scure/bip32": "1.3.1", + "@scure/bip39": "1.2.1" + } + }, + "packages/hardhat/node_modules/web3-utils/node_modules/ethereum-cryptography/node_modules/@noble/hashes": { + "version": "1.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "packages/hardhat/node_modules/which": { + "version": "1.3.1", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "packages/hardhat/node_modules/wordwrap": { + "version": "1.0.0", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/wordwrapjs": { + "version": "4.0.1", + "license": "MIT", + "dependencies": { + "reduce-flatten": "^2.0.0", + "typical": "^5.2.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "packages/hardhat/node_modules/workerpool": { + "version": "6.2.1", + "dev": true, + "license": "Apache-2.0" + }, + "packages/hardhat/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/hardhat/node_modules/xmlhttprequest": { + "version": "1.8.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "packages/hardhat/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "license": "ISC" + }, + "packages/hardhat/node_modules/yargs": { + "version": "13.3.2", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } + }, + "packages/hardhat/node_modules/yargs-parser": { + "version": "13.1.2", + "dev": true, + "license": "ISC", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + }, + "packages/hardhat/node_modules/yargs-unparser": { + "version": "1.6.0", + "dev": true, + "license": "MIT", + "dependencies": { + "flat": "^4.1.0", + "lodash": "^4.17.15", + "yargs": "^13.3.0" + }, + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/yargs/node_modules/ansi-regex": { + "version": "4.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/yargs/node_modules/ansi-styles": { + "version": "3.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/yargs/node_modules/cliui": { + "version": "5.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "packages/hardhat/node_modules/yargs/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "packages/hardhat/node_modules/yargs/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/yargs/node_modules/emoji-regex": { + "version": "7.0.3", + "dev": true, + "license": "MIT" + }, + "packages/hardhat/node_modules/yargs/node_modules/find-up": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/yargs/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/yargs/node_modules/locate-path": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/yargs/node_modules/p-locate": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/yargs/node_modules/path-exists": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "packages/hardhat/node_modules/yargs/node_modules/string-width": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/yargs/node_modules/strip-ansi": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/yargs/node_modules/wrap-ansi": { + "version": "5.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "packages/hardhat/node_modules/yn": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "packages/nextjs": { + "name": "@se-2/nextjs", + "version": "0.1.0", + "dependencies": { + "@ethersproject/providers": "^5.7.2", + "@heroicons/react": "^2.0.11", + "@rainbow-me/rainbowkit": "1.3.5", + "@uniswap/sdk-core": "^4.0.1", + "@uniswap/v2-sdk": "^3.0.1", + "blo": "^1.0.1", + "daisyui": "4.5.0", + "next": "^14.0.4", + "next-themes": "^0.2.1", + "nprogress": "^0.2.0", + "qrcode.react": "^3.1.0", + "react": "^18.2.0", + "react-copy-to-clipboard": "^5.1.0", + "react-dom": "^18.2.0", + "react-hot-toast": "^2.4.0", + "use-debounce": "^8.0.4", + "usehooks-ts": "^2.13.0", + "viem": "1.19.9", + "wagmi": "1.4.12", + "zustand": "^4.1.2" + }, + "devDependencies": { + "@trivago/prettier-plugin-sort-imports": "^4.1.1", + "@types/node": "^17.0.35", + "@types/nprogress": "^0", + "@types/react": "^18.0.9", + "@types/react-copy-to-clipboard": "^5.0.4", + "@typescript-eslint/eslint-plugin": "^5.39.0", + "autoprefixer": "^10.4.12", + "eslint": "^8.15.0", + "eslint-config-next": "^14.0.4", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-prettier": "^4.2.1", + "postcss": "^8.4.16", + "prettier": "^2.8.4", + "tailwindcss": "^3.3.3", + "type-fest": "^4.6.0", + "typescript": "^5.1.6", + "vercel": "^32.4.1" + } + }, + "packages/nextjs/node_modules/@adraffy/ens-normalize": { + "version": "1.10.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/@alloc/quick-lru": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/nextjs/node_modules/@babel/generator": { + "version": "7.17.7", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.17.0", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "packages/nextjs/node_modules/@babel/helper-environment-visitor": { + "version": "7.22.20", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "packages/nextjs/node_modules/@babel/helper-function-name": { + "version": "7.23.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "packages/nextjs/node_modules/@babel/helper-hoist-variables": { + "version": "7.22.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "packages/nextjs/node_modules/@babel/helper-split-export-declaration": { + "version": "7.22.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "packages/nextjs/node_modules/@babel/helper-string-parser": { + "version": "7.22.5", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "packages/nextjs/node_modules/@babel/parser": { + "version": "7.23.0", + "dev": true, + "license": "MIT", + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "packages/nextjs/node_modules/@babel/template": { + "version": "7.22.15", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "packages/nextjs/node_modules/@babel/traverse": { + "version": "7.17.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.17.3", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.17.3", + "@babel/types": "^7.17.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "packages/nextjs/node_modules/@babel/traverse/node_modules/@babel/generator": { + "version": "7.23.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.23.0", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "packages/nextjs/node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "packages/nextjs/node_modules/@babel/types": { + "version": "7.23.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "packages/nextjs/node_modules/@coinbase/wallet-sdk": { + "version": "3.7.2", + "license": "Apache-2.0", + "dependencies": { + "@metamask/safe-event-emitter": "2.0.0", + "@solana/web3.js": "^1.70.1", + "bind-decorator": "^1.0.11", + "bn.js": "^5.1.1", + "buffer": "^6.0.3", + "clsx": "^1.1.0", + "eth-block-tracker": "6.1.0", + "eth-json-rpc-filters": "5.1.0", + "eth-rpc-errors": "4.0.2", + "json-rpc-engine": "6.1.0", + "keccak": "^3.0.1", + "preact": "^10.5.9", + "qs": "^6.10.3", + "rxjs": "^6.6.3", + "sha.js": "^2.4.11", + "stream-browserify": "^3.0.0", + "util": "^0.12.4" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "packages/nextjs/node_modules/@coinbase/wallet-sdk/node_modules/clsx": { + "version": "1.2.1", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "packages/nextjs/node_modules/@coinbase/wallet-sdk/node_modules/eth-rpc-errors": { + "version": "4.0.2", + "license": "MIT", + "dependencies": { + "fast-safe-stringify": "^2.0.6" + } + }, + "packages/nextjs/node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "packages/nextjs/node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "packages/nextjs/node_modules/@edge-runtime/cookies": { + "version": "3.4.1", + "dev": true, + "license": "MPL-2.0", + "engines": { + "node": ">=16" + } + }, + "packages/nextjs/node_modules/@edge-runtime/format": { + "version": "2.2.0", + "dev": true, + "license": "MPL-2.0", + "engines": { + "node": ">=16" + } + }, + "packages/nextjs/node_modules/@edge-runtime/node-utils": { + "version": "2.2.1", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "@edge-runtime/cookies": "3.4.1" + }, + "engines": { + "node": ">=16" + } + }, + "packages/nextjs/node_modules/@edge-runtime/primitives": { + "version": "3.1.1", + "dev": true, + "license": "MPL-2.0", + "engines": { + "node": ">=16" + } + }, + "packages/nextjs/node_modules/@edge-runtime/vm": { + "version": "3.1.1", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "@edge-runtime/primitives": "3.1.1" + }, + "engines": { + "node": ">=16" + } + }, + "packages/nextjs/node_modules/@emotion/hash": { + "version": "0.9.1", + "license": "MIT" + }, + "packages/nextjs/node_modules/@heroicons/react": { + "version": "2.0.18", + "license": "MIT", + "peerDependencies": { + "react": ">= 16" + } + }, + "packages/nextjs/node_modules/@ioredis/commands": { + "version": "1.2.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "packages/nextjs/node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "packages/nextjs/node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "packages/nextjs/node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.19", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "packages/nextjs/node_modules/@lit-labs/ssr-dom-shim": { + "version": "1.1.1", + "license": "BSD-3-Clause" + }, + "packages/nextjs/node_modules/@lit/reactive-element": { + "version": "1.6.3", + "license": "BSD-3-Clause", + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.0.0" + } + }, + "packages/nextjs/node_modules/@mapbox/node-pre-gyp": { + "version": "1.0.11", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, + "packages/nextjs/node_modules/@metamask/safe-event-emitter": { + "version": "2.0.0", + "license": "ISC" + }, + "packages/nextjs/node_modules/@metamask/utils": { + "version": "3.6.0", + "license": "ISC", + "dependencies": { + "@types/debug": "^4.1.7", + "debug": "^4.3.4", + "semver": "^7.3.8", + "superstruct": "^1.0.3" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "packages/nextjs/node_modules/@metamask/utils/node_modules/superstruct": { + "version": "1.0.3", + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "packages/nextjs/node_modules/@motionone/animation": { + "version": "10.16.3", + "license": "MIT", + "dependencies": { + "@motionone/easing": "^10.16.3", + "@motionone/types": "^10.16.3", + "@motionone/utils": "^10.16.3", + "tslib": "^2.3.1" + } + }, + "packages/nextjs/node_modules/@motionone/animation/node_modules/tslib": { + "version": "2.6.2", + "license": "0BSD" + }, + "packages/nextjs/node_modules/@motionone/dom": { + "version": "10.16.4", + "license": "MIT", + "dependencies": { + "@motionone/animation": "^10.16.3", + "@motionone/generators": "^10.16.4", + "@motionone/types": "^10.16.3", + "@motionone/utils": "^10.16.3", + "hey-listen": "^1.0.8", + "tslib": "^2.3.1" + } + }, + "packages/nextjs/node_modules/@motionone/dom/node_modules/tslib": { + "version": "2.6.2", + "license": "0BSD" + }, + "packages/nextjs/node_modules/@motionone/easing": { + "version": "10.16.3", + "license": "MIT", + "dependencies": { + "@motionone/utils": "^10.16.3", + "tslib": "^2.3.1" + } + }, + "packages/nextjs/node_modules/@motionone/easing/node_modules/tslib": { + "version": "2.6.2", + "license": "0BSD" + }, + "packages/nextjs/node_modules/@motionone/generators": { + "version": "10.16.4", + "license": "MIT", + "dependencies": { + "@motionone/types": "^10.16.3", + "@motionone/utils": "^10.16.3", + "tslib": "^2.3.1" + } + }, + "packages/nextjs/node_modules/@motionone/generators/node_modules/tslib": { + "version": "2.6.2", + "license": "0BSD" + }, + "packages/nextjs/node_modules/@motionone/svelte": { + "version": "10.16.4", + "license": "MIT", + "dependencies": { + "@motionone/dom": "^10.16.4", + "tslib": "^2.3.1" + } + }, + "packages/nextjs/node_modules/@motionone/svelte/node_modules/tslib": { + "version": "2.6.2", + "license": "0BSD" + }, + "packages/nextjs/node_modules/@motionone/types": { + "version": "10.16.3", + "license": "MIT" + }, + "packages/nextjs/node_modules/@motionone/utils": { + "version": "10.16.3", + "license": "MIT", + "dependencies": { + "@motionone/types": "^10.16.3", + "hey-listen": "^1.0.8", + "tslib": "^2.3.1" + } + }, + "packages/nextjs/node_modules/@motionone/utils/node_modules/tslib": { + "version": "2.6.2", + "license": "0BSD" + }, + "packages/nextjs/node_modules/@motionone/vue": { + "version": "10.16.4", + "license": "MIT", + "dependencies": { + "@motionone/dom": "^10.16.4", + "tslib": "^2.3.1" + } + }, + "packages/nextjs/node_modules/@motionone/vue/node_modules/tslib": { + "version": "2.6.2", + "license": "0BSD" + }, + "packages/nextjs/node_modules/@next/env": { + "version": "14.0.4", + "license": "MIT" + }, + "packages/nextjs/node_modules/@next/eslint-plugin-next": { + "version": "14.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "glob": "7.1.7" + } + }, + "packages/nextjs/node_modules/@next/eslint-plugin-next/node_modules/glob": { + "version": "7.1.7", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "packages/nextjs/node_modules/@next/swc-darwin-arm64": { + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.0.4.tgz", + "integrity": "sha512-mF05E/5uPthWzyYDyptcwHptucf/jj09i2SXBPwNzbgBNc+XnwzrL0U6BmPjQeOL+FiB+iG1gwBeq7mlDjSRPg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/nextjs/node_modules/@next/swc-darwin-x64": { + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.0.4.tgz", + "integrity": "sha512-IZQ3C7Bx0k2rYtrZZxKKiusMTM9WWcK5ajyhOZkYYTCc8xytmwSzR1skU7qLgVT/EY9xtXDG0WhY6fyujnI3rw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/nextjs/node_modules/@next/swc-linux-arm64-gnu": { + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.0.4.tgz", + "integrity": "sha512-VwwZKrBQo/MGb1VOrxJ6LrKvbpo7UbROuyMRvQKTFKhNaXjUmKTu7wxVkIuCARAfiI8JpaWAnKR+D6tzpCcM4w==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/nextjs/node_modules/@next/swc-linux-arm64-musl": { + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.0.4.tgz", + "integrity": "sha512-8QftwPEW37XxXoAwsn+nXlodKWHfpMaSvt81W43Wh8dv0gkheD+30ezWMcFGHLI71KiWmHK5PSQbTQGUiidvLQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/nextjs/node_modules/@next/swc-linux-x64-gnu": { + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.0.4.tgz", + "integrity": "sha512-/s/Pme3VKfZAfISlYVq2hzFS8AcAIOTnoKupc/j4WlvF6GQ0VouS2Q2KEgPuO1eMBwakWPB1aYFIA4VNVh667A==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/nextjs/node_modules/@next/swc-linux-x64-musl": { + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.0.4.tgz", + "integrity": "sha512-m8z/6Fyal4L9Bnlxde5g2Mfa1Z7dasMQyhEhskDATpqr+Y0mjOBZcXQ7G5U+vgL22cI4T7MfvgtrM2jdopqWaw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/nextjs/node_modules/@next/swc-win32-arm64-msvc": { + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.0.4.tgz", + "integrity": "sha512-7Wv4PRiWIAWbm5XrGz3D8HUkCVDMMz9igffZG4NB1p4u1KoItwx9qjATHz88kwCEal/HXmbShucaslXCQXUM5w==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/nextjs/node_modules/@next/swc-win32-ia32-msvc": { + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.0.4.tgz", + "integrity": "sha512-zLeNEAPULsl0phfGb4kdzF/cAVIfaC7hY+kt0/d+y9mzcZHsMS3hAS829WbJ31DkSlVKQeHEjZHIdhN+Pg7Gyg==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/nextjs/node_modules/@next/swc-win32-x64-msvc": { + "version": "14.0.4", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "packages/nextjs/node_modules/@noble/curves": { + "version": "1.2.0", + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.3.2" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "packages/nextjs/node_modules/@noble/hashes": { + "version": "1.3.2", + "license": "MIT", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "packages/nextjs/node_modules/@parcel/watcher": { + "version": "2.3.0", + "license": "MIT", + "dependencies": { + "detect-libc": "^1.0.3", + "is-glob": "^4.0.3", + "micromatch": "^4.0.5", + "node-addon-api": "^7.0.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "@parcel/watcher-android-arm64": "2.3.0", + "@parcel/watcher-darwin-arm64": "2.3.0", + "@parcel/watcher-darwin-x64": "2.3.0", + "@parcel/watcher-freebsd-x64": "2.3.0", + "@parcel/watcher-linux-arm-glibc": "2.3.0", + "@parcel/watcher-linux-arm64-glibc": "2.3.0", + "@parcel/watcher-linux-arm64-musl": "2.3.0", + "@parcel/watcher-linux-x64-glibc": "2.3.0", + "@parcel/watcher-linux-x64-musl": "2.3.0", + "@parcel/watcher-win32-arm64": "2.3.0", + "@parcel/watcher-win32-ia32": "2.3.0", + "@parcel/watcher-win32-x64": "2.3.0" + } + }, + "packages/nextjs/node_modules/@parcel/watcher-wasm": { + "version": "2.3.0", + "bundleDependencies": [ + "napi-wasm" + ], + "license": "MIT", + "dependencies": { + "is-glob": "^4.0.3", + "micromatch": "^4.0.5", + "napi-wasm": "^1.1.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "packages/nextjs/node_modules/@parcel/watcher-win32-x64": { + "version": "2.3.0", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "packages/nextjs/node_modules/@parcel/watcher/node_modules/detect-libc": { + "version": "1.0.3", + "license": "Apache-2.0", + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "packages/nextjs/node_modules/@parcel/watcher/node_modules/node-addon-api": { + "version": "7.0.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/@rainbow-me/rainbowkit": { + "version": "1.3.5", + "license": "MIT", + "dependencies": { + "@vanilla-extract/css": "1.14.0", + "@vanilla-extract/dynamic": "2.1.0", + "@vanilla-extract/sprinkles": "1.6.1", + "clsx": "2.1.0", + "qrcode": "1.5.3", + "react-remove-scroll": "2.5.7", + "ua-parser-js": "^1.0.37" + }, + "engines": { + "node": ">=12.4" + }, + "peerDependencies": { + "react": ">=17", + "react-dom": ">=17", + "viem": "~0.3.19 || ^1.0.0", + "wagmi": "~1.0.1 || ~1.1.0 || ~1.2.0 || ~1.3.0 || ~1.4.0" + } + }, + "packages/nextjs/node_modules/@rollup/pluginutils": { + "version": "4.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "estree-walker": "^2.0.1", + "picomatch": "^2.2.2" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "packages/nextjs/node_modules/@rushstack/eslint-patch": { + "version": "1.5.0", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/@safe-global/safe-apps-provider": { + "version": "0.18.1", + "license": "MIT", + "dependencies": { + "@safe-global/safe-apps-sdk": "^8.1.0", + "events": "^3.3.0" + } + }, + "packages/nextjs/node_modules/@safe-global/safe-apps-sdk": { + "version": "8.1.0", + "license": "MIT", + "dependencies": { + "@safe-global/safe-gateway-typescript-sdk": "^3.5.3", + "viem": "^1.0.0" + } + }, + "packages/nextjs/node_modules/@safe-global/safe-apps-sdk/node_modules/@adraffy/ens-normalize": { + "version": "1.9.4", + "license": "MIT" + }, + "packages/nextjs/node_modules/@safe-global/safe-apps-sdk/node_modules/@types/node": { + "version": "20.7.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/@safe-global/safe-apps-sdk/node_modules/@types/ws": { + "version": "8.5.6", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "packages/nextjs/node_modules/@safe-global/safe-apps-sdk/node_modules/abitype": { + "version": "0.9.8", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/wagmi-dev" + } + ], + "license": "MIT", + "peerDependencies": { + "typescript": ">=5.0.4", + "zod": "^3 >=3.19.1" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + }, + "zod": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/@safe-global/safe-apps-sdk/node_modules/isomorphic-ws": { + "version": "5.0.0", + "license": "MIT", + "peerDependencies": { + "ws": "*" + } + }, + "packages/nextjs/node_modules/@safe-global/safe-apps-sdk/node_modules/viem": { + "version": "1.12.2", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/wagmi-dev" + } + ], + "license": "MIT", + "dependencies": { + "@adraffy/ens-normalize": "1.9.4", + "@noble/curves": "1.2.0", + "@noble/hashes": "1.3.2", + "@scure/bip32": "1.3.2", + "@scure/bip39": "1.2.1", + "@types/ws": "^8.5.5", + "abitype": "0.9.8", + "isomorphic-ws": "5.0.0", + "ws": "8.13.0" + }, + "peerDependencies": { + "typescript": ">=5.0.4" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/@safe-global/safe-gateway-typescript-sdk": { + "version": "3.12.0", + "license": "MIT", + "engines": { + "node": ">=16" + } + }, + "packages/nextjs/node_modules/@scure/base": { + "version": "1.1.3", + "license": "MIT", + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "packages/nextjs/node_modules/@scure/bip32": { + "version": "1.3.2", + "license": "MIT", + "dependencies": { + "@noble/curves": "~1.2.0", + "@noble/hashes": "~1.3.2", + "@scure/base": "~1.1.2" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "packages/nextjs/node_modules/@scure/bip39": { + "version": "1.2.1", + "license": "MIT", + "dependencies": { + "@noble/hashes": "~1.3.0", + "@scure/base": "~1.1.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "packages/nextjs/node_modules/@sinclair/typebox": { + "version": "0.25.24", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/@solana/buffer-layout": { + "version": "4.0.1", + "license": "MIT", + "dependencies": { + "buffer": "~6.0.3" + }, + "engines": { + "node": ">=5.10" + } + }, + "packages/nextjs/node_modules/@solana/web3.js": { + "version": "1.78.5", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.22.6", + "@noble/curves": "^1.0.0", + "@noble/hashes": "^1.3.1", + "@solana/buffer-layout": "^4.0.0", + "agentkeepalive": "^4.3.0", + "bigint-buffer": "^1.1.5", + "bn.js": "^5.2.1", + "borsh": "^0.7.0", + "bs58": "^4.0.1", + "buffer": "6.0.3", + "fast-stable-stringify": "^1.0.0", + "jayson": "^4.1.0", + "node-fetch": "^2.6.12", + "rpc-websockets": "^7.5.1", + "superstruct": "^0.14.2" + } + }, + "packages/nextjs/node_modules/@stablelib/aead": { + "version": "1.0.1", + "license": "MIT" + }, + "packages/nextjs/node_modules/@stablelib/binary": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "@stablelib/int": "^1.0.1" + } + }, + "packages/nextjs/node_modules/@stablelib/bytes": { + "version": "1.0.1", + "license": "MIT" + }, + "packages/nextjs/node_modules/@stablelib/chacha": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "@stablelib/binary": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "packages/nextjs/node_modules/@stablelib/chacha20poly1305": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "@stablelib/aead": "^1.0.1", + "@stablelib/binary": "^1.0.1", + "@stablelib/chacha": "^1.0.1", + "@stablelib/constant-time": "^1.0.1", + "@stablelib/poly1305": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "packages/nextjs/node_modules/@stablelib/constant-time": { + "version": "1.0.1", + "license": "MIT" + }, + "packages/nextjs/node_modules/@stablelib/ed25519": { + "version": "1.0.3", + "license": "MIT", + "dependencies": { + "@stablelib/random": "^1.0.2", + "@stablelib/sha512": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "packages/nextjs/node_modules/@stablelib/hash": { + "version": "1.0.1", + "license": "MIT" + }, + "packages/nextjs/node_modules/@stablelib/hkdf": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "@stablelib/hash": "^1.0.1", + "@stablelib/hmac": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "packages/nextjs/node_modules/@stablelib/hmac": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "@stablelib/constant-time": "^1.0.1", + "@stablelib/hash": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "packages/nextjs/node_modules/@stablelib/int": { + "version": "1.0.1", + "license": "MIT" + }, + "packages/nextjs/node_modules/@stablelib/keyagreement": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "@stablelib/bytes": "^1.0.1" + } + }, + "packages/nextjs/node_modules/@stablelib/poly1305": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "@stablelib/constant-time": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "packages/nextjs/node_modules/@stablelib/random": { + "version": "1.0.2", + "license": "MIT", + "dependencies": { + "@stablelib/binary": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "packages/nextjs/node_modules/@stablelib/sha256": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "@stablelib/binary": "^1.0.1", + "@stablelib/hash": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "packages/nextjs/node_modules/@stablelib/sha512": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "@stablelib/binary": "^1.0.1", + "@stablelib/hash": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "packages/nextjs/node_modules/@stablelib/wipe": { + "version": "1.0.1", + "license": "MIT" + }, + "packages/nextjs/node_modules/@stablelib/x25519": { + "version": "1.0.3", + "license": "MIT", + "dependencies": { + "@stablelib/keyagreement": "^1.0.1", + "@stablelib/random": "^1.0.2", + "@stablelib/wipe": "^1.0.1" + } + }, + "packages/nextjs/node_modules/@swc/helpers": { + "version": "0.5.2", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.4.0" + } + }, + "packages/nextjs/node_modules/@swc/helpers/node_modules/tslib": { + "version": "2.6.2", + "license": "0BSD" + }, + "packages/nextjs/node_modules/@tanstack/query-core": { + "version": "4.35.3", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "packages/nextjs/node_modules/@tanstack/query-persist-client-core": { + "version": "4.35.3", + "license": "MIT", + "dependencies": { + "@tanstack/query-core": "4.35.3" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "packages/nextjs/node_modules/@tanstack/query-sync-storage-persister": { + "version": "4.35.3", + "license": "MIT", + "dependencies": { + "@tanstack/query-persist-client-core": "4.35.3" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "packages/nextjs/node_modules/@tanstack/react-query": { + "version": "4.35.3", + "license": "MIT", + "dependencies": { + "@tanstack/query-core": "4.35.3", + "use-sync-external-store": "^1.2.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-native": "*" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + }, + "react-native": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/@tanstack/react-query-persist-client": { + "version": "4.35.5", + "license": "MIT", + "dependencies": { + "@tanstack/query-persist-client-core": "4.35.3" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "@tanstack/react-query": "^4.35.3" + } + }, + "packages/nextjs/node_modules/@tootallnate/once": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10" + } + }, + "packages/nextjs/node_modules/@trivago/prettier-plugin-sort-imports": { + "version": "4.2.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@babel/generator": "7.17.7", + "@babel/parser": "^7.20.5", + "@babel/traverse": "7.17.3", + "@babel/types": "7.17.0", + "javascript-natural-sort": "0.7.1", + "lodash": "^4.17.21" + }, + "peerDependencies": { + "@vue/compiler-sfc": "3.x", + "prettier": "2.x - 3.x" + }, + "peerDependenciesMeta": { + "@vue/compiler-sfc": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/types": { + "version": "7.17.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "packages/nextjs/node_modules/@ts-morph/common": { + "version": "0.11.1", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-glob": "^3.2.7", + "minimatch": "^3.0.4", + "mkdirp": "^1.0.4", + "path-browserify": "^1.0.1" + } + }, + "packages/nextjs/node_modules/@tsconfig/node10": { + "version": "1.0.9", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/@tsconfig/node12": { + "version": "1.0.11", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/@tsconfig/node14": { + "version": "1.0.3", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/@tsconfig/node16": { + "version": "1.0.4", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/@types/connect": { + "version": "3.4.36", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "packages/nextjs/node_modules/@types/connect/node_modules/@types/node": { + "version": "20.7.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/@types/debug": { + "version": "4.1.9", + "license": "MIT", + "dependencies": { + "@types/ms": "*" + } + }, + "packages/nextjs/node_modules/@types/json-schema": { + "version": "7.0.13", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/@types/json5": { + "version": "0.0.29", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/@types/ms": { + "version": "0.7.32", + "license": "MIT" + }, + "packages/nextjs/node_modules/@types/node": { + "version": "17.0.45", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/@types/nprogress": { + "version": "0.2.1", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/@types/prop-types": { + "version": "15.7.7", + "devOptional": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/@types/react": { + "version": "18.2.23", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + } + }, + "packages/nextjs/node_modules/@types/react-copy-to-clipboard": { + "version": "5.0.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/react": "*" + } + }, + "packages/nextjs/node_modules/@types/scheduler": { + "version": "0.16.4", + "devOptional": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/@types/trusted-types": { + "version": "2.0.4", + "license": "MIT" + }, + "packages/nextjs/node_modules/@types/ws": { + "version": "7.4.7", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "packages/nextjs/node_modules/@types/ws/node_modules/@types/node": { + "version": "20.7.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/@typescript-eslint/eslint-plugin": { + "version": "5.62.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.4.0", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/type-utils": "5.62.0", + "@typescript-eslint/utils": "5.62.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/@typescript-eslint/parser": { + "version": "6.7.3", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/scope-manager": "6.7.3", + "@typescript-eslint/types": "6.7.3", + "@typescript-eslint/typescript-estree": "6.7.3", + "@typescript-eslint/visitor-keys": "6.7.3", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { + "version": "6.7.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "6.7.3", + "@typescript-eslint/visitor-keys": "6.7.3" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "packages/nextjs/node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { + "version": "6.7.3", + "dev": true, + "license": "MIT", + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "packages/nextjs/node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { + "version": "6.7.3", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/types": "6.7.3", + "@typescript-eslint/visitor-keys": "6.7.3", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/@typescript-eslint/scope-manager": { + "version": "5.62.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "packages/nextjs/node_modules/@typescript-eslint/scope-manager/node_modules/@typescript-eslint/visitor-keys": { + "version": "5.62.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "5.62.0", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "packages/nextjs/node_modules/@typescript-eslint/type-utils": { + "version": "5.62.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/typescript-estree": "5.62.0", + "@typescript-eslint/utils": "5.62.0", + "debug": "^4.3.4", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/@typescript-eslint/types": { + "version": "5.62.0", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "packages/nextjs/node_modules/@typescript-eslint/typescript-estree": { + "version": "5.62.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/visitor-keys": { + "version": "5.62.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "5.62.0", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "packages/nextjs/node_modules/@typescript-eslint/utils": { + "version": "5.62.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@types/json-schema": "^7.0.9", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/typescript-estree": "5.62.0", + "eslint-scope": "^5.1.1", + "semver": "^7.3.7" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "packages/nextjs/node_modules/@typescript-eslint/utils/node_modules/eslint-scope": { + "version": "5.1.1", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "packages/nextjs/node_modules/@typescript-eslint/utils/node_modules/estraverse": { + "version": "4.3.0", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "packages/nextjs/node_modules/@typescript-eslint/visitor-keys": { + "version": "6.7.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "6.7.3", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "packages/nextjs/node_modules/@typescript-eslint/visitor-keys/node_modules/@typescript-eslint/types": { + "version": "6.7.3", + "dev": true, + "license": "MIT", + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "packages/nextjs/node_modules/@uniswap/sdk-core": { + "version": "4.0.7", + "license": "MIT", + "dependencies": { + "@ethersproject/address": "^5.0.2", + "big.js": "^5.2.2", + "decimal.js-light": "^2.5.0", + "jsbi": "^3.1.4", + "tiny-invariant": "^1.1.0", + "toformat": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "packages/nextjs/node_modules/@uniswap/v2-sdk": { + "version": "3.2.1", + "license": "MIT", + "dependencies": { + "@ethersproject/address": "^5.0.0", + "@ethersproject/solidity": "^5.0.0", + "@uniswap/sdk-core": "^4.0.7", + "tiny-invariant": "^1.1.0", + "tiny-warning": "^1.0.3" + }, + "engines": { + "node": ">=10" + } + }, + "packages/nextjs/node_modules/@vanilla-extract/css": { + "version": "1.14.0", + "license": "MIT", + "dependencies": { + "@emotion/hash": "^0.9.0", + "@vanilla-extract/private": "^1.0.3", + "chalk": "^4.1.1", + "css-what": "^6.1.0", + "cssesc": "^3.0.0", + "csstype": "^3.0.7", + "deep-object-diff": "^1.1.9", + "deepmerge": "^4.2.2", + "media-query-parser": "^2.0.2", + "modern-ahocorasick": "^1.0.0", + "outdent": "^0.8.0" + } + }, + "packages/nextjs/node_modules/@vanilla-extract/dynamic": { + "version": "2.1.0", + "license": "MIT", + "dependencies": { + "@vanilla-extract/private": "^1.0.3" + } + }, + "packages/nextjs/node_modules/@vanilla-extract/private": { + "version": "1.0.3", + "license": "MIT" + }, + "packages/nextjs/node_modules/@vanilla-extract/sprinkles": { + "version": "1.6.1", + "license": "MIT", + "peerDependencies": { + "@vanilla-extract/css": "^1.0.0" + } + }, + "packages/nextjs/node_modules/@vercel/build-utils": { + "version": "7.2.2", + "dev": true, + "license": "Apache-2.0" + }, + "packages/nextjs/node_modules/@vercel/error-utils": { + "version": "2.0.1", + "dev": true, + "license": "Apache-2.0" + }, + "packages/nextjs/node_modules/@vercel/fun": { + "version": "1.1.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@tootallnate/once": "2.0.0", + "async-listen": "1.2.0", + "debug": "4.1.1", + "execa": "3.2.0", + "fs-extra": "8.1.0", + "generic-pool": "3.4.2", + "micro": "9.3.5-canary.3", + "ms": "2.1.1", + "node-fetch": "2.6.7", + "path-match": "1.2.4", + "promisepipe": "3.0.0", + "semver": "7.3.5", + "stat-mode": "0.3.0", + "stream-to-promise": "2.2.0", + "tar": "4.4.18", + "tree-kill": "1.2.2", + "uid-promise": "1.0.0", + "uuid": "3.3.2", + "xdg-app-paths": "5.1.0", + "yauzl-promise": "2.1.3" + }, + "engines": { + "node": ">= 10" + } + }, + "packages/nextjs/node_modules/@vercel/fun/node_modules/debug": { + "version": "4.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "packages/nextjs/node_modules/@vercel/fun/node_modules/debug/node_modules/ms": { + "version": "2.1.3", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/@vercel/fun/node_modules/minipass": { + "version": "2.9.0", + "dev": true, + "license": "ISC", + "dependencies": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "packages/nextjs/node_modules/@vercel/fun/node_modules/minizlib": { + "version": "1.3.3", + "dev": true, + "license": "MIT", + "dependencies": { + "minipass": "^2.9.0" + } + }, + "packages/nextjs/node_modules/@vercel/fun/node_modules/mkdirp": { + "version": "0.5.6", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "packages/nextjs/node_modules/@vercel/fun/node_modules/ms": { + "version": "2.1.1", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/@vercel/fun/node_modules/node-fetch": { + "version": "2.6.7", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/@vercel/fun/node_modules/semver": { + "version": "7.3.5", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "packages/nextjs/node_modules/@vercel/fun/node_modules/tar": { + "version": "4.4.18", + "dev": true, + "license": "ISC", + "dependencies": { + "chownr": "^1.1.4", + "fs-minipass": "^1.2.7", + "minipass": "^2.9.0", + "minizlib": "^1.3.3", + "mkdirp": "^0.5.5", + "safe-buffer": "^5.2.1", + "yallist": "^3.1.1" + }, + "engines": { + "node": ">=4.5" + } + }, + "packages/nextjs/node_modules/@vercel/fun/node_modules/uuid": { + "version": "3.3.2", + "dev": true, + "license": "MIT", + "bin": { + "uuid": "bin/uuid" + } + }, + "packages/nextjs/node_modules/@vercel/fun/node_modules/yallist": { + "version": "3.1.1", + "dev": true, + "license": "ISC" + }, + "packages/nextjs/node_modules/@vercel/gatsby-plugin-vercel-analytics": { + "version": "1.0.11", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "web-vitals": "0.2.4" + } + }, + "packages/nextjs/node_modules/@vercel/gatsby-plugin-vercel-builder": { + "version": "2.0.7", + "dev": true, + "dependencies": { + "@sinclair/typebox": "0.25.24", + "@vercel/build-utils": "7.2.2", + "@vercel/routing-utils": "3.0.0", + "esbuild": "0.14.47", + "etag": "1.8.1", + "fs-extra": "11.1.0" + } + }, + "packages/nextjs/node_modules/@vercel/gatsby-plugin-vercel-builder/node_modules/fs-extra": { + "version": "11.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "packages/nextjs/node_modules/@vercel/gatsby-plugin-vercel-builder/node_modules/jsonfile": { + "version": "6.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "packages/nextjs/node_modules/@vercel/go": { + "version": "3.0.3", + "dev": true, + "license": "Apache-2.0" + }, + "packages/nextjs/node_modules/@vercel/hydrogen": { + "version": "1.0.1", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@vercel/static-config": "3.0.0", + "ts-morph": "12.0.0" + } + }, + "packages/nextjs/node_modules/@vercel/next": { + "version": "4.0.10", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@vercel/nft": "0.24.2" + } + }, + "packages/nextjs/node_modules/@vercel/nft": { + "version": "0.24.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.5", + "@rollup/pluginutils": "^4.0.0", + "acorn": "^8.6.0", + "async-sema": "^3.1.1", + "bindings": "^1.4.0", + "estree-walker": "2.0.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.2", + "node-gyp-build": "^4.2.2", + "resolve-from": "^5.0.0" + }, + "bin": { + "nft": "out/cli.js" + }, + "engines": { + "node": ">=16" + } + }, + "packages/nextjs/node_modules/@vercel/node": { + "version": "3.0.7", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@edge-runtime/node-utils": "2.2.1", + "@edge-runtime/primitives": "3.1.1", + "@edge-runtime/vm": "3.1.1", + "@types/node": "14.18.33", + "@vercel/build-utils": "7.2.2", + "@vercel/error-utils": "2.0.1", + "@vercel/nft": "0.24.2", + "@vercel/static-config": "3.0.0", + "async-listen": "3.0.0", + "edge-runtime": "2.5.1", + "esbuild": "0.14.47", + "etag": "1.8.1", + "exit-hook": "2.2.1", + "node-fetch": "2.6.9", + "path-to-regexp": "6.2.1", + "ts-morph": "12.0.0", + "ts-node": "10.9.1", + "typescript": "4.9.5", + "undici": "5.23.0" + } + }, + "packages/nextjs/node_modules/@vercel/node/node_modules/@types/node": { + "version": "14.18.33", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/@vercel/node/node_modules/arg": { + "version": "4.1.3", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/@vercel/node/node_modules/async-listen": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "packages/nextjs/node_modules/@vercel/node/node_modules/node-fetch": { + "version": "2.6.9", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/@vercel/node/node_modules/path-to-regexp": { + "version": "6.2.1", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/@vercel/node/node_modules/ts-node": { + "version": "10.9.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/@vercel/node/node_modules/typescript": { + "version": "4.9.5", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "packages/nextjs/node_modules/@vercel/python": { + "version": "4.0.2", + "dev": true, + "license": "Apache-2.0" + }, + "packages/nextjs/node_modules/@vercel/redwood": { + "version": "2.0.4", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@vercel/nft": "0.24.2", + "@vercel/routing-utils": "3.0.0", + "semver": "6.3.1" + } + }, + "packages/nextjs/node_modules/@vercel/redwood/node_modules/semver": { + "version": "6.3.1", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "packages/nextjs/node_modules/@vercel/remix-builder": { + "version": "2.0.9", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@vercel/nft": "0.24.2", + "@vercel/static-config": "3.0.0", + "ts-morph": "12.0.0" + } + }, + "packages/nextjs/node_modules/@vercel/routing-utils": { + "version": "3.0.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "path-to-regexp": "6.1.0" + }, + "optionalDependencies": { + "ajv": "^6.0.0" + } + }, + "packages/nextjs/node_modules/@vercel/routing-utils/node_modules/path-to-regexp": { + "version": "6.1.0", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/@vercel/ruby": { + "version": "2.0.2", + "dev": true, + "license": "Apache-2.0" + }, + "packages/nextjs/node_modules/@vercel/static-build": { + "version": "2.0.8", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@vercel/gatsby-plugin-vercel-analytics": "1.0.11", + "@vercel/gatsby-plugin-vercel-builder": "2.0.7", + "@vercel/static-config": "3.0.0", + "ts-morph": "12.0.0" + } + }, + "packages/nextjs/node_modules/@vercel/static-config": { + "version": "3.0.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "ajv": "8.6.3", + "json-schema-to-ts": "1.6.4", + "ts-morph": "12.0.0" + } + }, + "packages/nextjs/node_modules/@vercel/static-config/node_modules/ajv": { + "version": "8.6.3", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "packages/nextjs/node_modules/@vercel/static-config/node_modules/json-schema-traverse": { + "version": "1.0.0", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/@wagmi/connectors": { + "version": "3.1.10", + "funding": [ + { + "type": "gitcoin", + "url": "https://wagmi.sh/gitcoin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/wagmi-dev" + } + ], + "license": "MIT", + "dependencies": { + "@coinbase/wallet-sdk": "^3.6.6", + "@safe-global/safe-apps-provider": "^0.18.1", + "@safe-global/safe-apps-sdk": "^8.1.0", + "@walletconnect/ethereum-provider": "2.10.6", + "@walletconnect/legacy-provider": "^2.0.0", + "@walletconnect/modal": "2.6.2", + "@walletconnect/utils": "2.10.2", + "abitype": "0.8.7", + "eventemitter3": "^4.0.7" + }, + "peerDependencies": { + "typescript": ">=5.0.4", + "viem": ">=0.3.35" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/@wagmi/connectors/node_modules/@walletconnect/keyvaluestorage": { + "version": "1.0.2", + "license": "MIT", + "dependencies": { + "safe-json-utils": "^1.1.1", + "tslib": "1.14.1" + }, + "peerDependencies": { + "@react-native-async-storage/async-storage": "1.x", + "lokijs": "1.x" + }, + "peerDependenciesMeta": { + "@react-native-async-storage/async-storage": { + "optional": true + }, + "lokijs": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/@wagmi/connectors/node_modules/@walletconnect/types": { + "version": "2.10.2", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/events": "^1.0.1", + "@walletconnect/heartbeat": "1.2.1", + "@walletconnect/jsonrpc-types": "1.0.3", + "@walletconnect/keyvaluestorage": "^1.0.2", + "@walletconnect/logger": "^2.0.1", + "events": "^3.3.0" + } + }, + "packages/nextjs/node_modules/@wagmi/connectors/node_modules/@walletconnect/utils": { + "version": "2.10.2", + "license": "Apache-2.0", + "dependencies": { + "@stablelib/chacha20poly1305": "1.0.1", + "@stablelib/hkdf": "1.0.1", + "@stablelib/random": "^1.0.2", + "@stablelib/sha256": "1.0.1", + "@stablelib/x25519": "^1.0.3", + "@walletconnect/relay-api": "^1.0.9", + "@walletconnect/safe-json": "^1.0.2", + "@walletconnect/time": "^1.0.2", + "@walletconnect/types": "2.10.2", + "@walletconnect/window-getters": "^1.0.1", + "@walletconnect/window-metadata": "^1.0.1", + "detect-browser": "5.3.0", + "query-string": "7.1.3", + "uint8arrays": "^3.1.0" + } + }, + "packages/nextjs/node_modules/@wagmi/core": { + "version": "1.4.12", + "funding": [ + { + "type": "gitcoin", + "url": "https://wagmi.sh/gitcoin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/wagmi-dev" + } + ], + "license": "MIT", + "dependencies": { + "@wagmi/connectors": "3.1.10", + "abitype": "0.8.7", + "eventemitter3": "^4.0.7", + "zustand": "^4.3.1" + }, + "peerDependencies": { + "typescript": ">=5.0.4", + "viem": ">=0.3.35" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/@walletconnect/core": { + "version": "2.10.6", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/heartbeat": "1.2.1", + "@walletconnect/jsonrpc-provider": "1.0.13", + "@walletconnect/jsonrpc-types": "1.0.3", + "@walletconnect/jsonrpc-utils": "1.0.8", + "@walletconnect/jsonrpc-ws-connection": "1.0.14", + "@walletconnect/keyvaluestorage": "^1.1.1", + "@walletconnect/logger": "^2.0.1", + "@walletconnect/relay-api": "^1.0.9", + "@walletconnect/relay-auth": "^1.0.4", + "@walletconnect/safe-json": "^1.0.2", + "@walletconnect/time": "^1.0.2", + "@walletconnect/types": "2.10.6", + "@walletconnect/utils": "2.10.6", + "events": "^3.3.0", + "lodash.isequal": "4.5.0", + "uint8arrays": "^3.1.0" + } + }, + "packages/nextjs/node_modules/@walletconnect/crypto": { + "version": "1.0.3", + "license": "MIT", + "dependencies": { + "@walletconnect/encoding": "^1.0.2", + "@walletconnect/environment": "^1.0.1", + "@walletconnect/randombytes": "^1.0.3", + "aes-js": "^3.1.2", + "hash.js": "^1.1.7", + "tslib": "1.14.1" + } + }, + "packages/nextjs/node_modules/@walletconnect/encoding": { + "version": "1.0.2", + "license": "MIT", + "dependencies": { + "is-typedarray": "1.0.0", + "tslib": "1.14.1", + "typedarray-to-buffer": "3.1.5" + } + }, + "packages/nextjs/node_modules/@walletconnect/environment": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "tslib": "1.14.1" + } + }, + "packages/nextjs/node_modules/@walletconnect/ethereum-provider": { + "version": "2.10.6", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/jsonrpc-http-connection": "^1.0.7", + "@walletconnect/jsonrpc-provider": "^1.0.13", + "@walletconnect/jsonrpc-types": "^1.0.3", + "@walletconnect/jsonrpc-utils": "^1.0.8", + "@walletconnect/modal": "^2.4.3", + "@walletconnect/sign-client": "2.10.6", + "@walletconnect/types": "2.10.6", + "@walletconnect/universal-provider": "2.10.6", + "@walletconnect/utils": "2.10.6", + "events": "^3.3.0" + } + }, + "packages/nextjs/node_modules/@walletconnect/events": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "keyvaluestorage-interface": "^1.0.0", + "tslib": "1.14.1" + } + }, + "packages/nextjs/node_modules/@walletconnect/heartbeat": { + "version": "1.2.1", + "license": "MIT", + "dependencies": { + "@walletconnect/events": "^1.0.1", + "@walletconnect/time": "^1.0.2", + "tslib": "1.14.1" + } + }, + "packages/nextjs/node_modules/@walletconnect/jsonrpc-http-connection": { + "version": "1.0.7", + "license": "MIT", + "dependencies": { + "@walletconnect/jsonrpc-utils": "^1.0.6", + "@walletconnect/safe-json": "^1.0.1", + "cross-fetch": "^3.1.4", + "tslib": "1.14.1" + } + }, + "packages/nextjs/node_modules/@walletconnect/jsonrpc-provider": { + "version": "1.0.13", + "license": "MIT", + "dependencies": { + "@walletconnect/jsonrpc-utils": "^1.0.8", + "@walletconnect/safe-json": "^1.0.2", + "tslib": "1.14.1" + } + }, + "packages/nextjs/node_modules/@walletconnect/jsonrpc-types": { + "version": "1.0.3", + "license": "MIT", + "dependencies": { + "keyvaluestorage-interface": "^1.0.0", + "tslib": "1.14.1" + } + }, + "packages/nextjs/node_modules/@walletconnect/jsonrpc-utils": { + "version": "1.0.8", + "license": "MIT", + "dependencies": { + "@walletconnect/environment": "^1.0.1", + "@walletconnect/jsonrpc-types": "^1.0.3", + "tslib": "1.14.1" + } + }, + "packages/nextjs/node_modules/@walletconnect/jsonrpc-ws-connection": { + "version": "1.0.14", + "license": "MIT", + "dependencies": { + "@walletconnect/jsonrpc-utils": "^1.0.6", + "@walletconnect/safe-json": "^1.0.2", + "events": "^3.3.0", + "ws": "^7.5.1" + } + }, + "packages/nextjs/node_modules/@walletconnect/jsonrpc-ws-connection/node_modules/ws": { + "version": "7.5.9", + "license": "MIT", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/@walletconnect/keyvaluestorage": { + "version": "1.1.1", + "license": "MIT", + "dependencies": { + "@walletconnect/safe-json": "^1.0.1", + "idb-keyval": "^6.2.1", + "unstorage": "^1.9.0" + }, + "peerDependencies": { + "@react-native-async-storage/async-storage": "1.x" + }, + "peerDependenciesMeta": { + "@react-native-async-storage/async-storage": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/@walletconnect/legacy-client": { + "version": "2.0.0", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/crypto": "^1.0.3", + "@walletconnect/encoding": "^1.0.2", + "@walletconnect/jsonrpc-utils": "^1.0.4", + "@walletconnect/legacy-types": "^2.0.0", + "@walletconnect/legacy-utils": "^2.0.0", + "@walletconnect/safe-json": "^1.0.1", + "@walletconnect/window-getters": "^1.0.1", + "@walletconnect/window-metadata": "^1.0.1", + "detect-browser": "^5.3.0", + "query-string": "^6.13.5" + } + }, + "packages/nextjs/node_modules/@walletconnect/legacy-client/node_modules/query-string": { + "version": "6.14.1", + "license": "MIT", + "dependencies": { + "decode-uri-component": "^0.2.0", + "filter-obj": "^1.1.0", + "split-on-first": "^1.0.0", + "strict-uri-encode": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/nextjs/node_modules/@walletconnect/legacy-modal": { + "version": "2.0.0", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/legacy-types": "^2.0.0", + "@walletconnect/legacy-utils": "^2.0.0", + "copy-to-clipboard": "^3.3.3", + "preact": "^10.12.0", + "qrcode": "^1.5.1" + } + }, + "packages/nextjs/node_modules/@walletconnect/legacy-provider": { + "version": "2.0.0", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/jsonrpc-http-connection": "^1.0.4", + "@walletconnect/jsonrpc-provider": "^1.0.6", + "@walletconnect/legacy-client": "^2.0.0", + "@walletconnect/legacy-modal": "^2.0.0", + "@walletconnect/legacy-types": "^2.0.0", + "@walletconnect/legacy-utils": "^2.0.0" + } + }, + "packages/nextjs/node_modules/@walletconnect/legacy-types": { + "version": "2.0.0", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/jsonrpc-types": "^1.0.2" + } + }, + "packages/nextjs/node_modules/@walletconnect/legacy-utils": { + "version": "2.0.0", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/encoding": "^1.0.2", + "@walletconnect/jsonrpc-utils": "^1.0.4", + "@walletconnect/legacy-types": "^2.0.0", + "@walletconnect/safe-json": "^1.0.1", + "@walletconnect/window-getters": "^1.0.1", + "@walletconnect/window-metadata": "^1.0.1", + "detect-browser": "^5.3.0", + "query-string": "^6.13.5" + } + }, + "packages/nextjs/node_modules/@walletconnect/legacy-utils/node_modules/query-string": { + "version": "6.14.1", + "license": "MIT", + "dependencies": { + "decode-uri-component": "^0.2.0", + "filter-obj": "^1.1.0", + "split-on-first": "^1.0.0", + "strict-uri-encode": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/nextjs/node_modules/@walletconnect/logger": { + "version": "2.0.1", + "license": "MIT", + "dependencies": { + "pino": "7.11.0", + "tslib": "1.14.1" + } + }, + "packages/nextjs/node_modules/@walletconnect/modal": { + "version": "2.6.2", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/modal-core": "2.6.2", + "@walletconnect/modal-ui": "2.6.2" + } + }, + "packages/nextjs/node_modules/@walletconnect/modal-core": { + "version": "2.6.2", + "license": "Apache-2.0", + "dependencies": { + "valtio": "1.11.2" + } + }, + "packages/nextjs/node_modules/@walletconnect/modal-ui": { + "version": "2.6.2", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/modal-core": "2.6.2", + "lit": "2.8.0", + "motion": "10.16.2", + "qrcode": "1.5.3" + } + }, + "packages/nextjs/node_modules/@walletconnect/randombytes": { + "version": "1.0.3", + "license": "MIT", + "dependencies": { + "@walletconnect/encoding": "^1.0.2", + "@walletconnect/environment": "^1.0.1", + "randombytes": "^2.1.0", + "tslib": "1.14.1" + } + }, + "packages/nextjs/node_modules/@walletconnect/relay-api": { + "version": "1.0.9", + "license": "MIT", + "dependencies": { + "@walletconnect/jsonrpc-types": "^1.0.2", + "tslib": "1.14.1" + } + }, + "packages/nextjs/node_modules/@walletconnect/relay-auth": { + "version": "1.0.4", + "license": "MIT", + "dependencies": { + "@stablelib/ed25519": "^1.0.2", + "@stablelib/random": "^1.0.1", + "@walletconnect/safe-json": "^1.0.1", + "@walletconnect/time": "^1.0.2", + "tslib": "1.14.1", + "uint8arrays": "^3.0.0" + } + }, + "packages/nextjs/node_modules/@walletconnect/safe-json": { + "version": "1.0.2", + "license": "MIT", + "dependencies": { + "tslib": "1.14.1" + } + }, + "packages/nextjs/node_modules/@walletconnect/sign-client": { + "version": "2.10.6", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/core": "2.10.6", + "@walletconnect/events": "^1.0.1", + "@walletconnect/heartbeat": "1.2.1", + "@walletconnect/jsonrpc-utils": "1.0.8", + "@walletconnect/logger": "^2.0.1", + "@walletconnect/time": "^1.0.2", + "@walletconnect/types": "2.10.6", + "@walletconnect/utils": "2.10.6", + "events": "^3.3.0" + } + }, + "packages/nextjs/node_modules/@walletconnect/time": { + "version": "1.0.2", + "license": "MIT", + "dependencies": { + "tslib": "1.14.1" + } + }, + "packages/nextjs/node_modules/@walletconnect/types": { + "version": "2.10.6", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/events": "^1.0.1", + "@walletconnect/heartbeat": "1.2.1", + "@walletconnect/jsonrpc-types": "1.0.3", + "@walletconnect/keyvaluestorage": "^1.1.1", + "@walletconnect/logger": "^2.0.1", + "events": "^3.3.0" + } + }, + "packages/nextjs/node_modules/@walletconnect/universal-provider": { + "version": "2.10.6", + "license": "Apache-2.0", + "dependencies": { + "@walletconnect/jsonrpc-http-connection": "^1.0.7", + "@walletconnect/jsonrpc-provider": "1.0.13", + "@walletconnect/jsonrpc-types": "^1.0.2", + "@walletconnect/jsonrpc-utils": "^1.0.7", + "@walletconnect/logger": "^2.0.1", + "@walletconnect/sign-client": "2.10.6", + "@walletconnect/types": "2.10.6", + "@walletconnect/utils": "2.10.6", + "events": "^3.3.0" + } + }, + "packages/nextjs/node_modules/@walletconnect/utils": { + "version": "2.10.6", + "license": "Apache-2.0", + "dependencies": { + "@stablelib/chacha20poly1305": "1.0.1", + "@stablelib/hkdf": "1.0.1", + "@stablelib/random": "^1.0.2", + "@stablelib/sha256": "1.0.1", + "@stablelib/x25519": "^1.0.3", + "@walletconnect/relay-api": "^1.0.9", + "@walletconnect/safe-json": "^1.0.2", + "@walletconnect/time": "^1.0.2", + "@walletconnect/types": "2.10.6", + "@walletconnect/window-getters": "^1.0.1", + "@walletconnect/window-metadata": "^1.0.1", + "detect-browser": "5.3.0", + "query-string": "7.1.3", + "uint8arrays": "^3.1.0" + } + }, + "packages/nextjs/node_modules/@walletconnect/window-getters": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "tslib": "1.14.1" + } + }, + "packages/nextjs/node_modules/@walletconnect/window-metadata": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "@walletconnect/window-getters": "^1.0.1", + "tslib": "1.14.1" + } + }, + "packages/nextjs/node_modules/abbrev": { + "version": "1.1.1", + "dev": true, + "license": "ISC" + }, + "packages/nextjs/node_modules/abitype": { + "version": "0.8.7", + "license": "MIT", + "peerDependencies": { + "typescript": ">=5.0.4", + "zod": "^3 >=3.19.1" + }, + "peerDependenciesMeta": { + "zod": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/acorn-walk": { + "version": "8.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "packages/nextjs/node_modules/aes-js": { + "version": "3.1.2", + "license": "MIT" + }, + "packages/nextjs/node_modules/agent-base": { + "version": "6.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "packages/nextjs/node_modules/agentkeepalive": { + "version": "4.5.0", + "license": "MIT", + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "packages/nextjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "packages/nextjs/node_modules/any-promise": { + "version": "1.3.0", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/anymatch": { + "version": "3.1.3", + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "packages/nextjs/node_modules/aproba": { + "version": "2.0.0", + "dev": true, + "license": "ISC" + }, + "packages/nextjs/node_modules/arch": { + "version": "2.2.0", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "packages/nextjs/node_modules/are-we-there-yet": { + "version": "2.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" + } + }, + "packages/nextjs/node_modules/arg": { + "version": "5.0.2", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/aria-query": { + "version": "5.3.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "dequal": "^2.0.3" + } + }, + "packages/nextjs/node_modules/array-includes": { + "version": "3.1.7", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/nextjs/node_modules/array.prototype.findlastindex": { + "version": "1.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/nextjs/node_modules/array.prototype.flatmap": { + "version": "1.3.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/nextjs/node_modules/array.prototype.tosorted": { + "version": "1.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0", + "get-intrinsic": "^1.2.1" + } + }, + "packages/nextjs/node_modules/ast-types-flow": { + "version": "0.0.7", + "dev": true, + "license": "ISC" + }, + "packages/nextjs/node_modules/async-listen": { + "version": "1.2.0", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/async-mutex": { + "version": "0.2.6", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.0" + } + }, + "packages/nextjs/node_modules/async-mutex/node_modules/tslib": { + "version": "2.6.2", + "license": "0BSD" + }, + "packages/nextjs/node_modules/async-sema": { + "version": "3.1.1", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/asynciterator.prototype": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + } + }, + "packages/nextjs/node_modules/atomic-sleep": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "packages/nextjs/node_modules/autoprefixer": { + "version": "10.4.16", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/autoprefixer" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "browserslist": "^4.21.10", + "caniuse-lite": "^1.0.30001538", + "fraction.js": "^4.3.6", + "normalize-range": "^0.1.2", + "picocolors": "^1.0.0", + "postcss-value-parser": "^4.2.0" + }, + "bin": { + "autoprefixer": "bin/autoprefixer" + }, + "engines": { + "node": "^10 || ^12 || >=14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "packages/nextjs/node_modules/axe-core": { + "version": "4.8.2", + "dev": true, + "license": "MPL-2.0", + "engines": { + "node": ">=4" + } + }, + "packages/nextjs/node_modules/axobject-query": { + "version": "3.2.1", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "dequal": "^2.0.3" + } + }, + "packages/nextjs/node_modules/base-x": { + "version": "3.0.9", + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "packages/nextjs/node_modules/base64-js": { + "version": "1.5.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "packages/nextjs/node_modules/big.js": { + "version": "5.2.2", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "packages/nextjs/node_modules/bigint-buffer": { + "version": "1.1.5", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "bindings": "^1.3.0" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "packages/nextjs/node_modules/binary-extensions": { + "version": "2.2.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/bind-decorator": { + "version": "1.0.11", + "license": "MIT" + }, + "packages/nextjs/node_modules/bindings": { + "version": "1.5.0", + "license": "MIT", + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, + "packages/nextjs/node_modules/blo": { + "version": "1.1.1", + "license": "MIT", + "engines": { + "node": ">=16" + } + }, + "packages/nextjs/node_modules/borsh": { + "version": "0.7.0", + "license": "Apache-2.0", + "dependencies": { + "bn.js": "^5.2.0", + "bs58": "^4.0.0", + "text-encoding-utf-8": "^1.0.2" + } + }, + "packages/nextjs/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "packages/nextjs/node_modules/braces": { + "version": "3.0.2", + "license": "MIT", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/browserslist": { + "version": "4.22.0", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "caniuse-lite": "^1.0.30001539", + "electron-to-chromium": "^1.4.530", + "node-releases": "^2.0.13", + "update-browserslist-db": "^1.0.13" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "packages/nextjs/node_modules/bs58": { + "version": "4.0.1", + "license": "MIT", + "dependencies": { + "base-x": "^3.0.2" + } + }, + "packages/nextjs/node_modules/buffer": { + "version": "6.0.3", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "packages/nextjs/node_modules/buffer-crc32": { + "version": "0.2.13", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "packages/nextjs/node_modules/bufferutil": { + "version": "4.0.7", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "dependencies": { + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, + "packages/nextjs/node_modules/busboy": { + "version": "1.6.0", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, + "packages/nextjs/node_modules/bytes": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "packages/nextjs/node_modules/camelcase-css": { + "version": "2.0.1", + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "packages/nextjs/node_modules/caniuse-lite": { + "version": "1.0.30001540", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "packages/nextjs/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "packages/nextjs/node_modules/chokidar": { + "version": "3.5.3", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "packages/nextjs/node_modules/chownr": { + "version": "1.1.4", + "dev": true, + "license": "ISC" + }, + "packages/nextjs/node_modules/citty": { + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "consola": "^3.2.3" + } + }, + "packages/nextjs/node_modules/client-only": { + "version": "0.0.1", + "license": "MIT" + }, + "packages/nextjs/node_modules/clipboardy": { + "version": "3.0.0", + "license": "MIT", + "dependencies": { + "arch": "^2.2.0", + "execa": "^5.1.1", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/nextjs/node_modules/clipboardy/node_modules/execa": { + "version": "5.1.1", + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "packages/nextjs/node_modules/clipboardy/node_modules/get-stream": { + "version": "6.0.1", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/nextjs/node_modules/clipboardy/node_modules/human-signals": { + "version": "2.1.0", + "license": "Apache-2.0", + "engines": { + "node": ">=10.17.0" + } + }, + "packages/nextjs/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "packages/nextjs/node_modules/clsx": { + "version": "2.1.0", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "packages/nextjs/node_modules/cluster-key-slot": { + "version": "1.1.2", + "license": "Apache-2.0", + "engines": { + "node": ">=0.10.0" + } + }, + "packages/nextjs/node_modules/code-block-writer": { + "version": "10.1.1", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "packages/nextjs/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "packages/nextjs/node_modules/color-support": { + "version": "1.1.3", + "dev": true, + "license": "ISC", + "bin": { + "color-support": "bin.js" + } + }, + "packages/nextjs/node_modules/commander": { + "version": "4.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "packages/nextjs/node_modules/consola": { + "version": "3.2.3", + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.10.0" + } + }, + "packages/nextjs/node_modules/console-control-strings": { + "version": "1.1.0", + "dev": true, + "license": "ISC" + }, + "packages/nextjs/node_modules/content-type": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "packages/nextjs/node_modules/convert-hrtime": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/cookie-es": { + "version": "1.0.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/copy-to-clipboard": { + "version": "3.3.3", + "license": "MIT", + "dependencies": { + "toggle-selection": "^1.0.6" + } + }, + "packages/nextjs/node_modules/create-require": { + "version": "1.1.1", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/cross-fetch": { + "version": "3.1.8", + "license": "MIT", + "dependencies": { + "node-fetch": "^2.6.12" + } + }, + "packages/nextjs/node_modules/cross-spawn": { + "version": "7.0.3", + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "packages/nextjs/node_modules/css-selector-tokenizer": { + "version": "0.8.0", + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "fastparse": "^1.1.2" + } + }, + "packages/nextjs/node_modules/css-what": { + "version": "6.1.0", + "license": "BSD-2-Clause", + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "packages/nextjs/node_modules/cssesc": { + "version": "3.0.0", + "license": "MIT", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "packages/nextjs/node_modules/csstype": { + "version": "3.1.2", + "license": "MIT" + }, + "packages/nextjs/node_modules/culori": { + "version": "3.3.0", + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "packages/nextjs/node_modules/daisyui": { + "version": "4.5.0", + "license": "MIT", + "dependencies": { + "css-selector-tokenizer": "^0.8", + "culori": "^3", + "picocolors": "^1", + "postcss-js": "^4" + }, + "engines": { + "node": ">=16.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/daisyui" + } + }, + "packages/nextjs/node_modules/damerau-levenshtein": { + "version": "1.0.8", + "dev": true, + "license": "BSD-2-Clause" + }, + "packages/nextjs/node_modules/debug": { + "version": "4.3.4", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "license": "MIT" + }, + "packages/nextjs/node_modules/decimal.js-light": { + "version": "2.5.1", + "license": "MIT" + }, + "packages/nextjs/node_modules/decode-uri-component": { + "version": "0.2.2", + "license": "MIT", + "engines": { + "node": ">=0.10" + } + }, + "packages/nextjs/node_modules/deep-object-diff": { + "version": "1.1.9", + "license": "MIT" + }, + "packages/nextjs/node_modules/deepmerge": { + "version": "4.3.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "packages/nextjs/node_modules/defu": { + "version": "6.1.4", + "license": "MIT" + }, + "packages/nextjs/node_modules/delay": { + "version": "5.0.0", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/nextjs/node_modules/delegates": { + "version": "1.0.0", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/denque": { + "version": "2.1.0", + "license": "Apache-2.0", + "engines": { + "node": ">=0.10" + } + }, + "packages/nextjs/node_modules/depd": { + "version": "1.1.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "packages/nextjs/node_modules/dequal": { + "version": "2.0.3", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "packages/nextjs/node_modules/destr": { + "version": "2.0.2", + "license": "MIT" + }, + "packages/nextjs/node_modules/detect-browser": { + "version": "5.3.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/detect-libc": { + "version": "2.0.2", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/detect-node-es": { + "version": "1.1.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/didyoumean": { + "version": "1.2.2", + "dev": true, + "license": "Apache-2.0" + }, + "packages/nextjs/node_modules/diff": { + "version": "4.0.2", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "packages/nextjs/node_modules/dijkstrajs": { + "version": "1.0.3", + "license": "MIT" + }, + "packages/nextjs/node_modules/dlv": { + "version": "1.1.3", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/doctrine": { + "version": "2.1.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "packages/nextjs/node_modules/duplexify": { + "version": "4.1.2", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.4.1", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1", + "stream-shift": "^1.0.0" + } + }, + "packages/nextjs/node_modules/edge-runtime": { + "version": "2.5.1", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "@edge-runtime/format": "2.2.0", + "@edge-runtime/vm": "3.1.1", + "async-listen": "3.0.1", + "mri": "1.2.0", + "picocolors": "1.0.0", + "pretty-bytes": "5.6.0", + "pretty-ms": "7.0.1", + "signal-exit": "4.0.2", + "time-span": "4.0.0" + }, + "bin": { + "edge-runtime": "dist/cli/index.js" + }, + "engines": { + "node": ">=16" + } + }, + "packages/nextjs/node_modules/edge-runtime/node_modules/async-listen": { + "version": "3.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "packages/nextjs/node_modules/edge-runtime/node_modules/signal-exit": { + "version": "4.0.2", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "packages/nextjs/node_modules/electron-to-chromium": { + "version": "1.4.531", + "dev": true, + "license": "ISC" + }, + "packages/nextjs/node_modules/emoji-regex": { + "version": "9.2.2", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/encode-utf8": { + "version": "1.0.3", + "license": "MIT" + }, + "packages/nextjs/node_modules/encoding": { + "version": "0.1.13", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "iconv-lite": "^0.6.2" + } + }, + "packages/nextjs/node_modules/encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "packages/nextjs/node_modules/end-of-stream": { + "version": "1.4.4", + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "packages/nextjs/node_modules/enhanced-resolve": { + "version": "5.15.0", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "packages/nextjs/node_modules/es-iterator-helpers": { + "version": "1.0.15", + "dev": true, + "license": "MIT", + "dependencies": { + "asynciterator.prototype": "^1.0.0", + "call-bind": "^1.0.2", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.1", + "es-set-tostringtag": "^2.0.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.2.1", + "globalthis": "^1.0.3", + "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.5", + "iterator.prototype": "^1.1.2", + "safe-array-concat": "^1.0.1" + } + }, + "packages/nextjs/node_modules/es6-promise": { + "version": "4.2.8", + "license": "MIT" + }, + "packages/nextjs/node_modules/es6-promisify": { + "version": "5.0.0", + "license": "MIT", + "dependencies": { + "es6-promise": "^4.0.3" + } + }, + "packages/nextjs/node_modules/esbuild": { + "version": "0.14.47", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "esbuild-android-64": "0.14.47", + "esbuild-android-arm64": "0.14.47", + "esbuild-darwin-64": "0.14.47", + "esbuild-darwin-arm64": "0.14.47", + "esbuild-freebsd-64": "0.14.47", + "esbuild-freebsd-arm64": "0.14.47", + "esbuild-linux-32": "0.14.47", + "esbuild-linux-64": "0.14.47", + "esbuild-linux-arm": "0.14.47", + "esbuild-linux-arm64": "0.14.47", + "esbuild-linux-mips64le": "0.14.47", + "esbuild-linux-ppc64le": "0.14.47", + "esbuild-linux-riscv64": "0.14.47", + "esbuild-linux-s390x": "0.14.47", + "esbuild-netbsd-64": "0.14.47", + "esbuild-openbsd-64": "0.14.47", + "esbuild-sunos-64": "0.14.47", + "esbuild-windows-32": "0.14.47", + "esbuild-windows-64": "0.14.47", + "esbuild-windows-arm64": "0.14.47" + } + }, + "packages/nextjs/node_modules/esbuild-windows-64": { + "version": "0.14.47", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "packages/nextjs/node_modules/eslint-config-next": { + "version": "14.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@next/eslint-plugin-next": "14.0.4", + "@rushstack/eslint-patch": "^1.3.3", + "@typescript-eslint/parser": "^5.4.2 || ^6.0.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-import-resolver-typescript": "^3.5.2", + "eslint-plugin-import": "^2.28.1", + "eslint-plugin-jsx-a11y": "^6.7.1", + "eslint-plugin-react": "^7.33.2", + "eslint-plugin-react-hooks": "^4.5.0 || 5.0.0-canary-7118f5dd7-20230705" + }, + "peerDependencies": { + "eslint": "^7.23.0 || ^8.0.0", + "typescript": ">=3.3.1" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/eslint-config-prettier": { + "version": "8.10.0", + "dev": true, + "license": "MIT", + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "packages/nextjs/node_modules/eslint-import-resolver-node": { + "version": "0.3.9", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + } + }, + "packages/nextjs/node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "packages/nextjs/node_modules/eslint-import-resolver-typescript": { + "version": "3.6.1", + "dev": true, + "license": "ISC", + "dependencies": { + "debug": "^4.3.4", + "enhanced-resolve": "^5.12.0", + "eslint-module-utils": "^2.7.4", + "fast-glob": "^3.3.1", + "get-tsconfig": "^4.5.0", + "is-core-module": "^2.11.0", + "is-glob": "^4.0.3" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts/projects/eslint-import-resolver-ts" + }, + "peerDependencies": { + "eslint": "*", + "eslint-plugin-import": "*" + } + }, + "packages/nextjs/node_modules/eslint-module-utils": { + "version": "2.8.0", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^3.2.7" + }, + "engines": { + "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "packages/nextjs/node_modules/eslint-plugin-import": { + "version": "2.28.1", + "dev": true, + "license": "MIT", + "dependencies": { + "array-includes": "^3.1.6", + "array.prototype.findlastindex": "^1.2.2", + "array.prototype.flat": "^1.3.1", + "array.prototype.flatmap": "^1.3.1", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.7", + "eslint-module-utils": "^2.8.0", + "has": "^1.0.3", + "is-core-module": "^2.13.0", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.6", + "object.groupby": "^1.0.0", + "object.values": "^1.1.6", + "semver": "^6.3.1", + "tsconfig-paths": "^3.14.2" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + } + }, + "packages/nextjs/node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "packages/nextjs/node_modules/eslint-plugin-import/node_modules/semver": { + "version": "6.3.1", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "packages/nextjs/node_modules/eslint-plugin-jsx-a11y": { + "version": "6.7.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.20.7", + "aria-query": "^5.1.3", + "array-includes": "^3.1.6", + "array.prototype.flatmap": "^1.3.1", + "ast-types-flow": "^0.0.7", + "axe-core": "^4.6.2", + "axobject-query": "^3.1.1", + "damerau-levenshtein": "^1.0.8", + "emoji-regex": "^9.2.2", + "has": "^1.0.3", + "jsx-ast-utils": "^3.3.3", + "language-tags": "=1.0.5", + "minimatch": "^3.1.2", + "object.entries": "^1.1.6", + "object.fromentries": "^2.0.6", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=4.0" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8" + } + }, + "packages/nextjs/node_modules/eslint-plugin-jsx-a11y/node_modules/semver": { + "version": "6.3.1", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "packages/nextjs/node_modules/eslint-plugin-prettier": { + "version": "4.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "prettier-linter-helpers": "^1.0.0" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "eslint": ">=7.28.0", + "prettier": ">=2.0.0" + }, + "peerDependenciesMeta": { + "eslint-config-prettier": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/eslint-plugin-react": { + "version": "7.33.2", + "dev": true, + "license": "MIT", + "dependencies": { + "array-includes": "^3.1.6", + "array.prototype.flatmap": "^1.3.1", + "array.prototype.tosorted": "^1.1.1", + "doctrine": "^2.1.0", + "es-iterator-helpers": "^1.0.12", + "estraverse": "^5.3.0", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.1.2", + "object.entries": "^1.1.6", + "object.fromentries": "^2.0.6", + "object.hasown": "^1.1.2", + "object.values": "^1.1.6", + "prop-types": "^15.8.1", + "resolve": "^2.0.0-next.4", + "semver": "^6.3.1", + "string.prototype.matchall": "^4.0.8" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8" + } + }, + "packages/nextjs/node_modules/eslint-plugin-react-hooks": { + "version": "5.0.0-canary-7118f5dd7-20230705", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0" + } + }, + "packages/nextjs/node_modules/eslint-plugin-react/node_modules/resolve": { + "version": "2.0.0-next.4", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/nextjs/node_modules/eslint-plugin-react/node_modules/semver": { + "version": "6.3.1", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "packages/nextjs/node_modules/estree-walker": { + "version": "2.0.2", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/etag": { + "version": "1.8.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "packages/nextjs/node_modules/eth-block-tracker": { + "version": "6.1.0", + "license": "MIT", + "dependencies": { + "@metamask/safe-event-emitter": "^2.0.0", + "@metamask/utils": "^3.0.1", + "json-rpc-random-id": "^1.0.1", + "pify": "^3.0.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "packages/nextjs/node_modules/eth-block-tracker/node_modules/pify": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "packages/nextjs/node_modules/eth-json-rpc-filters": { + "version": "5.1.0", + "license": "ISC", + "dependencies": { + "@metamask/safe-event-emitter": "^2.0.0", + "async-mutex": "^0.2.6", + "eth-query": "^2.1.2", + "json-rpc-engine": "^6.1.0", + "pify": "^5.0.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "packages/nextjs/node_modules/eth-json-rpc-filters/node_modules/pify": { + "version": "5.0.0", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/nextjs/node_modules/eth-query": { + "version": "2.1.2", + "license": "ISC", + "dependencies": { + "json-rpc-random-id": "^1.0.0", + "xtend": "^4.0.1" + } + }, + "packages/nextjs/node_modules/eth-rpc-errors": { + "version": "4.0.3", + "license": "MIT", + "dependencies": { + "fast-safe-stringify": "^2.0.6" + } + }, + "packages/nextjs/node_modules/eventemitter3": { + "version": "4.0.7", + "license": "MIT" + }, + "packages/nextjs/node_modules/events": { + "version": "3.3.0", + "license": "MIT", + "engines": { + "node": ">=0.8.x" + } + }, + "packages/nextjs/node_modules/events-intercept": { + "version": "2.0.0", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/execa": { + "version": "3.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "p-finally": "^2.0.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": "^8.12.0 || >=9.7.0" + } + }, + "packages/nextjs/node_modules/exit-hook": { + "version": "2.2.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/nextjs/node_modules/eyes": { + "version": "0.1.8", + "engines": { + "node": "> 0.1.90" + } + }, + "packages/nextjs/node_modules/fast-diff": { + "version": "1.3.0", + "dev": true, + "license": "Apache-2.0" + }, + "packages/nextjs/node_modules/fast-redact": { + "version": "3.3.0", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "packages/nextjs/node_modules/fast-safe-stringify": { + "version": "2.1.1", + "license": "MIT" + }, + "packages/nextjs/node_modules/fast-stable-stringify": { + "version": "1.0.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/fastparse": { + "version": "1.1.2", + "license": "MIT" + }, + "packages/nextjs/node_modules/fd-slicer": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "pend": "~1.2.0" + } + }, + "packages/nextjs/node_modules/file-uri-to-path": { + "version": "1.0.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/fill-range": { + "version": "7.0.1", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/filter-obj": { + "version": "1.1.0", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "packages/nextjs/node_modules/fraction.js": { + "version": "4.3.6", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + }, + "funding": { + "type": "patreon", + "url": "https://github.com/sponsors/rawify" + } + }, + "packages/nextjs/node_modules/fs-extra": { + "version": "8.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "packages/nextjs/node_modules/fs-extra/node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4.0.0" + } + }, + "packages/nextjs/node_modules/fs-minipass": { + "version": "1.2.7", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^2.6.0" + } + }, + "packages/nextjs/node_modules/fs-minipass/node_modules/minipass": { + "version": "2.9.0", + "dev": true, + "license": "ISC", + "dependencies": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "packages/nextjs/node_modules/fs-minipass/node_modules/yallist": { + "version": "3.1.1", + "dev": true, + "license": "ISC" + }, + "packages/nextjs/node_modules/gauge": { + "version": "3.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "engines": { + "node": ">=10" + } + }, + "packages/nextjs/node_modules/generic-pool": { + "version": "3.4.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "packages/nextjs/node_modules/get-nonce": { + "version": "1.0.1", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "packages/nextjs/node_modules/get-port-please": { + "version": "3.1.1", + "license": "MIT" + }, + "packages/nextjs/node_modules/get-stream": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/nextjs/node_modules/get-tsconfig": { + "version": "4.7.2", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "packages/nextjs/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "packages/nextjs/node_modules/glob-to-regexp": { + "version": "0.4.1", + "license": "BSD-2-Clause" + }, + "packages/nextjs/node_modules/goober": { + "version": "2.1.13", + "license": "MIT", + "peerDependencies": { + "csstype": "^3.0.10" + } + }, + "packages/nextjs/node_modules/h3": { + "version": "1.10.0", + "license": "MIT", + "dependencies": { + "cookie-es": "^1.0.0", + "defu": "^6.1.3", + "destr": "^2.0.2", + "iron-webcrypto": "^1.0.0", + "radix3": "^1.1.0", + "ufo": "^1.3.2", + "uncrypto": "^0.1.3", + "unenv": "^1.8.0" + } + }, + "packages/nextjs/node_modules/has": { + "version": "1.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "packages/nextjs/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/has-unicode": { + "version": "2.0.1", + "dev": true, + "license": "ISC" + }, + "packages/nextjs/node_modules/hey-listen": { + "version": "1.0.8", + "license": "MIT" + }, + "packages/nextjs/node_modules/http-errors": { + "version": "1.7.3", + "dev": true, + "license": "MIT", + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "packages/nextjs/node_modules/http-shutdown": { + "version": "1.2.2", + "license": "MIT", + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "packages/nextjs/node_modules/https-proxy-agent": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "packages/nextjs/node_modules/human-signals": { + "version": "1.1.1", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8.12.0" + } + }, + "packages/nextjs/node_modules/humanize-ms": { + "version": "1.2.1", + "license": "MIT", + "dependencies": { + "ms": "^2.0.0" + } + }, + "packages/nextjs/node_modules/idb-keyval": { + "version": "6.2.1", + "license": "Apache-2.0" + }, + "packages/nextjs/node_modules/ieee754": { + "version": "1.2.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "packages/nextjs/node_modules/invariant": { + "version": "2.2.4", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.0.0" + } + }, + "packages/nextjs/node_modules/ioredis": { + "version": "5.3.2", + "license": "MIT", + "dependencies": { + "@ioredis/commands": "^1.1.1", + "cluster-key-slot": "^1.1.0", + "debug": "^4.3.4", + "denque": "^2.1.0", + "lodash.defaults": "^4.2.0", + "lodash.isarguments": "^3.1.0", + "redis-errors": "^1.2.0", + "redis-parser": "^3.0.0", + "standard-as-callback": "^2.1.0" + }, + "engines": { + "node": ">=12.22.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/ioredis" + } + }, + "packages/nextjs/node_modules/iron-webcrypto": { + "version": "1.0.0", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/brc-dd" + } + }, + "packages/nextjs/node_modules/is-arguments": { + "version": "1.1.1", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/nextjs/node_modules/is-async-function": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/nextjs/node_modules/is-binary-path": { + "version": "2.1.0", + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/is-docker": { + "version": "2.2.1", + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/nextjs/node_modules/is-finalizationregistry": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/nextjs/node_modules/is-fullwidth-code-point": { + "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==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/is-generator-function": { + "version": "1.0.10", + "license": "MIT", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/nextjs/node_modules/is-map": { + "version": "2.0.2", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/nextjs/node_modules/is-number": { + "version": "7.0.0", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "packages/nextjs/node_modules/is-set": { + "version": "2.0.2", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/nextjs/node_modules/is-stream": { + "version": "2.0.1", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/nextjs/node_modules/is-typedarray": { + "version": "1.0.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/is-weakmap": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/nextjs/node_modules/is-weakset": { + "version": "2.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/nextjs/node_modules/is-wsl": { + "version": "2.2.0", + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/isexe": { + "version": "2.0.0", + "license": "ISC" + }, + "packages/nextjs/node_modules/isows": { + "version": "1.0.3", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/wagmi-dev" + } + ], + "license": "MIT", + "peerDependencies": { + "ws": "*" + } + }, + "packages/nextjs/node_modules/iterator.prototype": { + "version": "1.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.2.1", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "reflect.getprototypeof": "^1.0.4", + "set-function-name": "^2.0.1" + } + }, + "packages/nextjs/node_modules/javascript-natural-sort": { + "version": "0.7.1", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/jayson": { + "version": "4.1.0", + "license": "MIT", + "dependencies": { + "@types/connect": "^3.4.33", + "@types/node": "^12.12.54", + "@types/ws": "^7.4.4", + "commander": "^2.20.3", + "delay": "^5.0.0", + "es6-promisify": "^5.0.0", + "eyes": "^0.1.8", + "isomorphic-ws": "^4.0.1", + "json-stringify-safe": "^5.0.1", + "JSONStream": "^1.3.5", + "uuid": "^8.3.2", + "ws": "^7.4.5" + }, + "bin": { + "jayson": "bin/jayson.js" + }, + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/jayson/node_modules/@types/node": { + "version": "12.20.55", + "license": "MIT" + }, + "packages/nextjs/node_modules/jayson/node_modules/commander": { + "version": "2.20.3", + "license": "MIT" + }, + "packages/nextjs/node_modules/jayson/node_modules/isomorphic-ws": { + "version": "4.0.1", + "license": "MIT", + "peerDependencies": { + "ws": "*" + } + }, + "packages/nextjs/node_modules/jayson/node_modules/ws": { + "version": "7.5.9", + "license": "MIT", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/jiti": { + "version": "1.20.0", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "bin/jiti.js" + } + }, + "packages/nextjs/node_modules/jsbi": { + "version": "3.2.5", + "license": "Apache-2.0" + }, + "packages/nextjs/node_modules/jsesc": { + "version": "2.5.2", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "packages/nextjs/node_modules/json-rpc-engine": { + "version": "6.1.0", + "license": "ISC", + "dependencies": { + "@metamask/safe-event-emitter": "^2.0.0", + "eth-rpc-errors": "^4.0.2" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "packages/nextjs/node_modules/json-rpc-random-id": { + "version": "1.0.1", + "license": "ISC" + }, + "packages/nextjs/node_modules/json-schema-to-ts": { + "version": "1.6.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json-schema": "^7.0.6", + "ts-toolbelt": "^6.15.5" + } + }, + "packages/nextjs/node_modules/json-stringify-safe": { + "version": "5.0.1", + "license": "ISC" + }, + "packages/nextjs/node_modules/json5": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "packages/nextjs/node_modules/jsonc-parser": { + "version": "3.2.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/jsonparse": { + "version": "1.3.1", + "engines": [ + "node >= 0.2.0" + ], + "license": "MIT" + }, + "packages/nextjs/node_modules/JSONStream": { + "version": "1.3.5", + "license": "(MIT OR Apache-2.0)", + "dependencies": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + }, + "bin": { + "JSONStream": "bin.js" + }, + "engines": { + "node": "*" + } + }, + "packages/nextjs/node_modules/jsx-ast-utils": { + "version": "3.3.5", + "dev": true, + "license": "MIT", + "dependencies": { + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "object.assign": "^4.1.4", + "object.values": "^1.1.6" + }, + "engines": { + "node": ">=4.0" + } + }, + "packages/nextjs/node_modules/keccak": { + "version": "3.0.4", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "packages/nextjs/node_modules/keyvaluestorage-interface": { + "version": "1.0.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/language-subtag-registry": { + "version": "0.3.22", + "dev": true, + "license": "CC0-1.0" + }, + "packages/nextjs/node_modules/language-tags": { + "version": "1.0.5", + "dev": true, + "license": "MIT", + "dependencies": { + "language-subtag-registry": "~0.3.2" + } + }, + "packages/nextjs/node_modules/lilconfig": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "packages/nextjs/node_modules/listhen": { + "version": "1.5.5", + "license": "MIT", + "dependencies": { + "@parcel/watcher": "^2.3.0", + "@parcel/watcher-wasm": "2.3.0", + "citty": "^0.1.4", + "clipboardy": "^3.0.0", + "consola": "^3.2.3", + "defu": "^6.1.2", + "get-port-please": "^3.1.1", + "h3": "^1.8.1", + "http-shutdown": "^1.2.2", + "jiti": "^1.20.0", + "mlly": "^1.4.2", + "node-forge": "^1.3.1", + "pathe": "^1.1.1", + "std-env": "^3.4.3", + "ufo": "^1.3.0", + "untun": "^0.1.2", + "uqr": "^0.1.2" + }, + "bin": { + "listen": "bin/listhen.mjs", + "listhen": "bin/listhen.mjs" + } + }, + "packages/nextjs/node_modules/listhen/node_modules/jiti": { + "version": "1.21.0", + "license": "MIT", + "bin": { + "jiti": "bin/jiti.js" + } + }, + "packages/nextjs/node_modules/lit": { + "version": "2.8.0", + "license": "BSD-3-Clause", + "dependencies": { + "@lit/reactive-element": "^1.6.0", + "lit-element": "^3.3.0", + "lit-html": "^2.8.0" + } + }, + "packages/nextjs/node_modules/lit-element": { + "version": "3.3.3", + "license": "BSD-3-Clause", + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.1.0", + "@lit/reactive-element": "^1.3.0", + "lit-html": "^2.8.0" + } + }, + "packages/nextjs/node_modules/lit-html": { + "version": "2.8.0", + "license": "BSD-3-Clause", + "dependencies": { + "@types/trusted-types": "^2.0.2" + } + }, + "packages/nextjs/node_modules/lodash": { + "version": "4.17.21", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/lodash.debounce": { + "version": "4.0.8", + "license": "MIT" + }, + "packages/nextjs/node_modules/lodash.defaults": { + "version": "4.2.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/lodash.isarguments": { + "version": "3.1.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/lodash.isequal": { + "version": "4.5.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/loose-envify": { + "version": "1.4.0", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "packages/nextjs/node_modules/lru-cache": { + "version": "6.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "packages/nextjs/node_modules/make-dir": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/nextjs/node_modules/make-dir/node_modules/semver": { + "version": "6.3.1", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "packages/nextjs/node_modules/make-error": { + "version": "1.3.6", + "dev": true, + "license": "ISC" + }, + "packages/nextjs/node_modules/media-query-parser": { + "version": "2.0.2", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.12.5" + } + }, + "packages/nextjs/node_modules/merge-stream": { + "version": "2.0.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/micro": { + "version": "9.3.5-canary.3", + "dev": true, + "license": "MIT", + "dependencies": { + "arg": "4.1.0", + "content-type": "1.0.4", + "raw-body": "2.4.1" + }, + "bin": { + "micro": "bin/micro.js" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "packages/nextjs/node_modules/micro/node_modules/arg": { + "version": "4.1.0", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/micromatch": { + "version": "4.0.5", + "license": "MIT", + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "packages/nextjs/node_modules/mime": { + "version": "3.0.0", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "packages/nextjs/node_modules/mimic-fn": { + "version": "2.1.0", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "packages/nextjs/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "packages/nextjs/node_modules/minimist": { + "version": "1.2.8", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/nextjs/node_modules/minipass": { + "version": "3.3.6", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/minizlib": { + "version": "2.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "packages/nextjs/node_modules/mkdirp": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "packages/nextjs/node_modules/mlly": { + "version": "1.4.2", + "license": "MIT", + "dependencies": { + "acorn": "^8.10.0", + "pathe": "^1.1.1", + "pkg-types": "^1.0.3", + "ufo": "^1.3.0" + } + }, + "packages/nextjs/node_modules/modern-ahocorasick": { + "version": "1.0.1", + "license": "MIT" + }, + "packages/nextjs/node_modules/motion": { + "version": "10.16.2", + "license": "MIT", + "dependencies": { + "@motionone/animation": "^10.15.1", + "@motionone/dom": "^10.16.2", + "@motionone/svelte": "^10.16.2", + "@motionone/types": "^10.15.1", + "@motionone/utils": "^10.15.1", + "@motionone/vue": "^10.16.2" + } + }, + "packages/nextjs/node_modules/mri": { + "version": "1.2.0", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "packages/nextjs/node_modules/ms": { + "version": "2.1.3", + "license": "MIT" + }, + "packages/nextjs/node_modules/multiformats": { + "version": "9.9.0", + "license": "(Apache-2.0 AND MIT)" + }, + "packages/nextjs/node_modules/mz": { + "version": "2.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "packages/nextjs/node_modules/nanoid": { + "version": "3.3.6", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "packages/nextjs/node_modules/napi-wasm": { + "version": "1.1.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/natural-compare-lite": { + "version": "1.4.0", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/next": { + "version": "14.0.4", + "license": "MIT", + "dependencies": { + "@next/env": "14.0.4", + "@swc/helpers": "0.5.2", + "busboy": "1.6.0", + "caniuse-lite": "^1.0.30001406", + "graceful-fs": "^4.2.11", + "postcss": "8.4.31", + "styled-jsx": "5.1.1", + "watchpack": "2.4.0" + }, + "bin": { + "next": "dist/bin/next" + }, + "engines": { + "node": ">=18.17.0" + }, + "optionalDependencies": { + "@next/swc-darwin-arm64": "14.0.4", + "@next/swc-darwin-x64": "14.0.4", + "@next/swc-linux-arm64-gnu": "14.0.4", + "@next/swc-linux-arm64-musl": "14.0.4", + "@next/swc-linux-x64-gnu": "14.0.4", + "@next/swc-linux-x64-musl": "14.0.4", + "@next/swc-win32-arm64-msvc": "14.0.4", + "@next/swc-win32-ia32-msvc": "14.0.4", + "@next/swc-win32-x64-msvc": "14.0.4" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.1.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "sass": "^1.3.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + }, + "sass": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/next-themes": { + "version": "0.2.1", + "license": "MIT", + "peerDependencies": { + "next": "*", + "react": "*", + "react-dom": "*" + } + }, + "packages/nextjs/node_modules/next/node_modules/postcss": { + "version": "8.4.31", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "packages/nextjs/node_modules/node-addon-api": { + "version": "2.0.2", + "license": "MIT" + }, + "packages/nextjs/node_modules/node-fetch-native": { + "version": "1.6.1", + "license": "MIT" + }, + "packages/nextjs/node_modules/node-forge": { + "version": "1.3.1", + "license": "(BSD-3-Clause OR GPL-2.0)", + "engines": { + "node": ">= 6.13.0" + } + }, + "packages/nextjs/node_modules/node-gyp-build": { + "version": "4.6.1", + "license": "MIT", + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "packages/nextjs/node_modules/node-releases": { + "version": "2.0.13", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/nopt": { + "version": "5.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, + "packages/nextjs/node_modules/normalize-path": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "packages/nextjs/node_modules/normalize-range": { + "version": "0.1.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "packages/nextjs/node_modules/npm-run-path": { + "version": "4.0.1", + "license": "MIT", + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/npmlog": { + "version": "5.0.1", + "dev": true, + "license": "ISC", + "dependencies": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, + "packages/nextjs/node_modules/nprogress": { + "version": "0.2.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/object-assign": { + "version": "4.1.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "packages/nextjs/node_modules/object-hash": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "packages/nextjs/node_modules/object.entries": { + "version": "1.1.7", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "packages/nextjs/node_modules/object.fromentries": { + "version": "2.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/nextjs/node_modules/object.groupby": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1" + } + }, + "packages/nextjs/node_modules/object.hasown": { + "version": "1.1.3", + "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/nextjs/node_modules/object.values": { + "version": "1.1.7", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/nextjs/node_modules/ofetch": { + "version": "1.3.3", + "license": "MIT", + "dependencies": { + "destr": "^2.0.1", + "node-fetch-native": "^1.4.0", + "ufo": "^1.3.0" + } + }, + "packages/nextjs/node_modules/on-exit-leak-free": { + "version": "0.2.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/onetime": { + "version": "5.1.2", + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/nextjs/node_modules/os-paths": { + "version": "4.4.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6.0" + } + }, + "packages/nextjs/node_modules/outdent": { + "version": "0.8.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/p-finally": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/parse-ms": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "packages/nextjs/node_modules/path-browserify": { + "version": "1.0.1", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/path-key": { + "version": "3.1.1", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/path-match": { + "version": "1.2.4", + "dev": true, + "license": "MIT", + "dependencies": { + "http-errors": "~1.4.0", + "path-to-regexp": "^1.0.0" + } + }, + "packages/nextjs/node_modules/path-match/node_modules/http-errors": { + "version": "1.4.0", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "2.0.1", + "statuses": ">= 1.2.1 < 2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "packages/nextjs/node_modules/path-match/node_modules/inherits": { + "version": "2.0.1", + "dev": true, + "license": "ISC" + }, + "packages/nextjs/node_modules/path-to-regexp": { + "version": "1.8.0", + "dev": true, + "license": "MIT", + "dependencies": { + "isarray": "0.0.1" + } + }, + "packages/nextjs/node_modules/path-to-regexp/node_modules/isarray": { + "version": "0.0.1", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/pathe": { + "version": "1.1.1", + "license": "MIT" + }, + "packages/nextjs/node_modules/pend": { + "version": "1.2.0", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/picocolors": { + "version": "1.0.0", + "license": "ISC" + }, + "packages/nextjs/node_modules/picomatch": { + "version": "2.3.1", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "packages/nextjs/node_modules/pify": { + "version": "2.3.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "packages/nextjs/node_modules/pino": { + "version": "7.11.0", + "license": "MIT", + "dependencies": { + "atomic-sleep": "^1.0.0", + "fast-redact": "^3.0.0", + "on-exit-leak-free": "^0.2.0", + "pino-abstract-transport": "v0.5.0", + "pino-std-serializers": "^4.0.0", + "process-warning": "^1.0.0", + "quick-format-unescaped": "^4.0.3", + "real-require": "^0.1.0", + "safe-stable-stringify": "^2.1.0", + "sonic-boom": "^2.2.1", + "thread-stream": "^0.15.1" + }, + "bin": { + "pino": "bin.js" + } + }, + "packages/nextjs/node_modules/pino-abstract-transport": { + "version": "0.5.0", + "license": "MIT", + "dependencies": { + "duplexify": "^4.1.2", + "split2": "^4.0.0" + } + }, + "packages/nextjs/node_modules/pino-std-serializers": { + "version": "4.0.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/pirates": { + "version": "4.0.6", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "packages/nextjs/node_modules/pkg-types": { + "version": "1.0.3", + "license": "MIT", + "dependencies": { + "jsonc-parser": "^3.2.0", + "mlly": "^1.2.0", + "pathe": "^1.1.0" + } + }, + "packages/nextjs/node_modules/pngjs": { + "version": "5.0.0", + "license": "MIT", + "engines": { + "node": ">=10.13.0" + } + }, + "packages/nextjs/node_modules/postcss": { + "version": "8.4.30", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "packages/nextjs/node_modules/postcss-import": { + "version": "15.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss-value-parser": "^4.0.0", + "read-cache": "^1.0.0", + "resolve": "^1.1.7" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "postcss": "^8.0.0" + } + }, + "packages/nextjs/node_modules/postcss-js": { + "version": "4.0.1", + "license": "MIT", + "dependencies": { + "camelcase-css": "^2.0.1" + }, + "engines": { + "node": "^12 || ^14 || >= 16" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": "^8.4.21" + } + }, + "packages/nextjs/node_modules/postcss-load-config": { + "version": "4.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "lilconfig": "^2.0.5", + "yaml": "^2.1.1" + }, + "engines": { + "node": ">= 14" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": ">=8.0.9", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/postcss-nested": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss-selector-parser": "^6.0.11" + }, + "engines": { + "node": ">=12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": "^8.2.14" + } + }, + "packages/nextjs/node_modules/postcss-selector-parser": { + "version": "6.0.13", + "dev": true, + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "packages/nextjs/node_modules/postcss-value-parser": { + "version": "4.2.0", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/preact": { + "version": "10.17.1", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/preact" + } + }, + "packages/nextjs/node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "packages/nextjs/node_modules/pretty-bytes": { + "version": "5.6.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/nextjs/node_modules/pretty-ms": { + "version": "7.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "parse-ms": "^2.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/nextjs/node_modules/process-warning": { + "version": "1.0.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/promisepipe": { + "version": "3.0.0", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/prop-types": { + "version": "15.8.1", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "packages/nextjs/node_modules/proxy-compare": { + "version": "2.5.1", + "license": "MIT" + }, + "packages/nextjs/node_modules/pump": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "packages/nextjs/node_modules/qrcode": { + "version": "1.5.3", + "license": "MIT", + "dependencies": { + "dijkstrajs": "^1.0.1", + "encode-utf8": "^1.0.3", + "pngjs": "^5.0.0", + "yargs": "^15.3.1" + }, + "bin": { + "qrcode": "bin/qrcode" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "packages/nextjs/node_modules/qrcode.react": { + "version": "3.1.0", + "license": "ISC", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "packages/nextjs/node_modules/qs": { + "version": "6.11.2", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/nextjs/node_modules/query-string": { + "version": "7.1.3", + "license": "MIT", + "dependencies": { + "decode-uri-component": "^0.2.2", + "filter-obj": "^1.1.0", + "split-on-first": "^1.0.0", + "strict-uri-encode": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/nextjs/node_modules/quick-format-unescaped": { + "version": "4.0.4", + "license": "MIT" + }, + "packages/nextjs/node_modules/radix3": { + "version": "1.1.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/randombytes": { + "version": "2.1.0", + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "packages/nextjs/node_modules/raw-body": { + "version": "2.4.1", + "dev": true, + "license": "MIT", + "dependencies": { + "bytes": "3.1.0", + "http-errors": "1.7.3", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "packages/nextjs/node_modules/react": { + "version": "18.2.0", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "packages/nextjs/node_modules/react-copy-to-clipboard": { + "version": "5.1.0", + "license": "MIT", + "dependencies": { + "copy-to-clipboard": "^3.3.1", + "prop-types": "^15.8.1" + }, + "peerDependencies": { + "react": "^15.3.0 || 16 || 17 || 18" + } + }, + "packages/nextjs/node_modules/react-dom": { + "version": "18.2.0", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.0" + }, + "peerDependencies": { + "react": "^18.2.0" + } + }, + "packages/nextjs/node_modules/react-hot-toast": { + "version": "2.4.1", + "license": "MIT", + "dependencies": { + "goober": "^2.1.10" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "react": ">=16", + "react-dom": ">=16" + } + }, + "packages/nextjs/node_modules/react-is": { + "version": "16.13.1", + "license": "MIT" + }, + "packages/nextjs/node_modules/react-remove-scroll": { + "version": "2.5.7", + "license": "MIT", + "dependencies": { + "react-remove-scroll-bar": "^2.3.4", + "react-style-singleton": "^2.2.1", + "tslib": "^2.1.0", + "use-callback-ref": "^1.3.0", + "use-sidecar": "^1.1.2" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/react-remove-scroll-bar": { + "version": "2.3.4", + "license": "MIT", + "dependencies": { + "react-style-singleton": "^2.2.1", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/react-remove-scroll-bar/node_modules/tslib": { + "version": "2.6.2", + "license": "0BSD" + }, + "packages/nextjs/node_modules/react-remove-scroll/node_modules/tslib": { + "version": "2.6.2", + "license": "0BSD" + }, + "packages/nextjs/node_modules/react-style-singleton": { + "version": "2.2.1", + "license": "MIT", + "dependencies": { + "get-nonce": "^1.0.0", + "invariant": "^2.2.4", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/react-style-singleton/node_modules/tslib": { + "version": "2.6.2", + "license": "0BSD" + }, + "packages/nextjs/node_modules/read-cache": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "pify": "^2.3.0" + } + }, + "packages/nextjs/node_modules/readable-stream": { + "version": "3.6.2", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "packages/nextjs/node_modules/readdirp": { + "version": "3.6.0", + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "packages/nextjs/node_modules/real-require": { + "version": "0.1.0", + "license": "MIT", + "engines": { + "node": ">= 12.13.0" + } + }, + "packages/nextjs/node_modules/redis-errors": { + "version": "1.2.0", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "packages/nextjs/node_modules/redis-parser": { + "version": "3.0.0", + "license": "MIT", + "dependencies": { + "redis-errors": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "packages/nextjs/node_modules/reflect.getprototypeof": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "globalthis": "^1.0.3", + "which-builtin-type": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/nextjs/node_modules/require-from-string": { + "version": "2.0.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "packages/nextjs/node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "packages/nextjs/node_modules/rpc-websockets": { + "version": "7.6.0", + "license": "LGPL-3.0-only", + "dependencies": { + "@babel/runtime": "^7.17.2", + "eventemitter3": "^4.0.7", + "uuid": "^8.3.2", + "ws": "^8.5.0" + }, + "funding": { + "type": "paypal", + "url": "https://paypal.me/kozjak" + }, + "optionalDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + } + }, + "packages/nextjs/node_modules/rpc-websockets/node_modules/ws": { + "version": "8.14.2", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/rxjs": { + "version": "6.6.7", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^1.9.0" + }, + "engines": { + "npm": ">=2.0.0" + } + }, + "packages/nextjs/node_modules/safe-buffer": { + "version": "5.2.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "packages/nextjs/node_modules/safe-json-utils": { + "version": "1.1.1", + "license": "MIT" + }, + "packages/nextjs/node_modules/safe-stable-stringify": { + "version": "2.4.3", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "packages/nextjs/node_modules/scheduler": { + "version": "0.23.0", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "packages/nextjs/node_modules/setprototypeof": { + "version": "1.1.1", + "dev": true, + "license": "ISC" + }, + "packages/nextjs/node_modules/sha.js": { + "version": "2.4.11", + "license": "(MIT AND BSD-3-Clause)", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, + "packages/nextjs/node_modules/shebang-command": { + "version": "2.0.0", + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/shebang-regex": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/signal-exit": { + "version": "3.0.7", + "license": "ISC" + }, + "packages/nextjs/node_modules/sonic-boom": { + "version": "2.8.0", + "license": "MIT", + "dependencies": { + "atomic-sleep": "^1.0.0" + } + }, + "packages/nextjs/node_modules/source-map": { + "version": "0.5.7", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "packages/nextjs/node_modules/source-map-js": { + "version": "1.0.2", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "packages/nextjs/node_modules/split-on-first": { + "version": "1.1.0", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "packages/nextjs/node_modules/split2": { + "version": "4.2.0", + "license": "ISC", + "engines": { + "node": ">= 10.x" + } + }, + "packages/nextjs/node_modules/standard-as-callback": { + "version": "2.1.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/stat-mode": { + "version": "0.3.0", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/statuses": { + "version": "1.5.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "packages/nextjs/node_modules/std-env": { + "version": "3.7.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/stream-browserify": { + "version": "3.0.0", + "license": "MIT", + "dependencies": { + "inherits": "~2.0.4", + "readable-stream": "^3.5.0" + } + }, + "packages/nextjs/node_modules/stream-shift": { + "version": "1.0.1", + "license": "MIT" + }, + "packages/nextjs/node_modules/stream-to-array": { + "version": "2.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.1.0" + } + }, + "packages/nextjs/node_modules/stream-to-promise": { + "version": "2.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "~1.3.0", + "end-of-stream": "~1.1.0", + "stream-to-array": "~2.3.0" + } + }, + "packages/nextjs/node_modules/stream-to-promise/node_modules/end-of-stream": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "once": "~1.3.0" + } + }, + "packages/nextjs/node_modules/stream-to-promise/node_modules/once": { + "version": "1.3.3", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "packages/nextjs/node_modules/streamsearch": { + "version": "1.1.0", + "engines": { + "node": ">=10.0.0" + } + }, + "packages/nextjs/node_modules/strict-uri-encode": { + "version": "2.0.0", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "packages/nextjs/node_modules/string_decoder": { + "version": "1.3.0", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "packages/nextjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/string-width/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "packages/nextjs/node_modules/string.prototype.matchall": { + "version": "4.0.10", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.5", + "regexp.prototype.flags": "^1.5.0", + "set-function-name": "^2.0.0", + "side-channel": "^1.0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/nextjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/strip-final-newline": { + "version": "2.0.0", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "packages/nextjs/node_modules/styled-jsx": { + "version": "5.1.1", + "license": "MIT", + "dependencies": { + "client-only": "0.0.1" + }, + "engines": { + "node": ">= 12.0.0" + }, + "peerDependencies": { + "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "babel-plugin-macros": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/sucrase": { + "version": "3.34.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "glob": "7.1.6", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/sucrase/node_modules/glob": { + "version": "7.1.6", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "packages/nextjs/node_modules/superstruct": { + "version": "0.14.2", + "license": "MIT" + }, + "packages/nextjs/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/tailwindcss": { + "version": "3.3.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@alloc/quick-lru": "^5.2.0", + "arg": "^5.0.2", + "chokidar": "^3.5.3", + "didyoumean": "^1.2.2", + "dlv": "^1.1.3", + "fast-glob": "^3.2.12", + "glob-parent": "^6.0.2", + "is-glob": "^4.0.3", + "jiti": "^1.18.2", + "lilconfig": "^2.1.0", + "micromatch": "^4.0.5", + "normalize-path": "^3.0.0", + "object-hash": "^3.0.0", + "picocolors": "^1.0.0", + "postcss": "^8.4.23", + "postcss-import": "^15.1.0", + "postcss-js": "^4.0.1", + "postcss-load-config": "^4.0.1", + "postcss-nested": "^6.0.1", + "postcss-selector-parser": "^6.0.11", + "resolve": "^1.22.2", + "sucrase": "^3.32.0" + }, + "bin": { + "tailwind": "lib/cli.js", + "tailwindcss": "lib/cli.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "packages/nextjs/node_modules/tailwindcss/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "packages/nextjs/node_modules/tapable": { + "version": "2.2.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "packages/nextjs/node_modules/tar": { + "version": "6.2.0", + "dev": true, + "license": "ISC", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "packages/nextjs/node_modules/tar/node_modules/chownr": { + "version": "2.0.0", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "packages/nextjs/node_modules/tar/node_modules/fs-minipass": { + "version": "2.1.0", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "packages/nextjs/node_modules/tar/node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/tar/node_modules/minipass": { + "version": "5.0.0", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/text-encoding-utf-8": { + "version": "1.0.2" + }, + "packages/nextjs/node_modules/thenify": { + "version": "3.3.1", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "packages/nextjs/node_modules/thenify-all": { + "version": "1.6.0", + "dev": true, + "license": "MIT", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "packages/nextjs/node_modules/thread-stream": { + "version": "0.15.2", + "license": "MIT", + "dependencies": { + "real-require": "^0.1.0" + } + }, + "packages/nextjs/node_modules/through": { + "version": "2.3.8", + "license": "MIT" + }, + "packages/nextjs/node_modules/time-span": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "convert-hrtime": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/nextjs/node_modules/tiny-invariant": { + "version": "1.3.1", + "license": "MIT" + }, + "packages/nextjs/node_modules/tiny-warning": { + "version": "1.0.3", + "license": "MIT" + }, + "packages/nextjs/node_modules/to-fast-properties": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "packages/nextjs/node_modules/to-regex-range": { + "version": "5.0.1", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "packages/nextjs/node_modules/toformat": { + "version": "2.0.0", + "license": "MIT" + }, + "packages/nextjs/node_modules/toggle-selection": { + "version": "1.0.6", + "license": "MIT" + }, + "packages/nextjs/node_modules/toidentifier": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "packages/nextjs/node_modules/tree-kill": { + "version": "1.2.2", + "dev": true, + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, + "packages/nextjs/node_modules/ts-interface-checker": { + "version": "0.1.13", + "dev": true, + "license": "Apache-2.0" + }, + "packages/nextjs/node_modules/ts-morph": { + "version": "12.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@ts-morph/common": "~0.11.0", + "code-block-writer": "^10.1.1" + } + }, + "packages/nextjs/node_modules/ts-toolbelt": { + "version": "6.15.5", + "dev": true, + "license": "Apache-2.0" + }, + "packages/nextjs/node_modules/tsconfig-paths": { + "version": "3.14.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "packages/nextjs/node_modules/tslib": { + "version": "1.14.1", + "license": "0BSD" + }, + "packages/nextjs/node_modules/tsutils": { + "version": "3.21.0", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "packages/nextjs/node_modules/type-fest": { + "version": "4.9.0", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/nextjs/node_modules/typedarray-to-buffer": { + "version": "3.1.5", + "license": "MIT", + "dependencies": { + "is-typedarray": "^1.0.0" + } + }, + "packages/nextjs/node_modules/ua-parser-js": { + "version": "1.0.37", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/ua-parser-js" + }, + { + "type": "paypal", + "url": "https://paypal.me/faisalman" + }, + { + "type": "github", + "url": "https://github.com/sponsors/faisalman" + } + ], + "license": "MIT", + "engines": { + "node": "*" + } + }, + "packages/nextjs/node_modules/ufo": { + "version": "1.3.2", + "license": "MIT" + }, + "packages/nextjs/node_modules/uid-promise": { + "version": "1.0.0", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/uint8arrays": { + "version": "3.1.1", + "license": "MIT", + "dependencies": { + "multiformats": "^9.4.2" + } + }, + "packages/nextjs/node_modules/uncrypto": { + "version": "0.1.3", + "license": "MIT" + }, + "packages/nextjs/node_modules/undici": { + "version": "5.23.0", + "dev": true, + "license": "MIT", + "dependencies": { + "busboy": "^1.6.0" + }, + "engines": { + "node": ">=14.0" + } + }, + "packages/nextjs/node_modules/unenv": { + "version": "1.9.0", + "license": "MIT", + "dependencies": { + "consola": "^3.2.3", + "defu": "^6.1.3", + "mime": "^3.0.0", + "node-fetch-native": "^1.6.1", + "pathe": "^1.1.1" + } + }, + "packages/nextjs/node_modules/universalify": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "packages/nextjs/node_modules/unpipe": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "packages/nextjs/node_modules/unstorage": { + "version": "1.10.1", + "license": "MIT", + "dependencies": { + "anymatch": "^3.1.3", + "chokidar": "^3.5.3", + "destr": "^2.0.2", + "h3": "^1.8.2", + "ioredis": "^5.3.2", + "listhen": "^1.5.5", + "lru-cache": "^10.0.2", + "mri": "^1.2.0", + "node-fetch-native": "^1.4.1", + "ofetch": "^1.3.3", + "ufo": "^1.3.1" + }, + "peerDependencies": { + "@azure/app-configuration": "^1.4.1", + "@azure/cosmos": "^4.0.0", + "@azure/data-tables": "^13.2.2", + "@azure/identity": "^3.3.2", + "@azure/keyvault-secrets": "^4.7.0", + "@azure/storage-blob": "^12.16.0", + "@capacitor/preferences": "^5.0.6", + "@netlify/blobs": "^6.2.0", + "@planetscale/database": "^1.11.0", + "@upstash/redis": "^1.23.4", + "@vercel/kv": "^0.2.3", + "idb-keyval": "^6.2.1" + }, + "peerDependenciesMeta": { + "@azure/app-configuration": { + "optional": true + }, + "@azure/cosmos": { + "optional": true + }, + "@azure/data-tables": { + "optional": true + }, + "@azure/identity": { + "optional": true + }, + "@azure/keyvault-secrets": { + "optional": true + }, + "@azure/storage-blob": { + "optional": true + }, + "@capacitor/preferences": { + "optional": true + }, + "@netlify/blobs": { + "optional": true + }, + "@planetscale/database": { + "optional": true + }, + "@upstash/redis": { + "optional": true + }, + "@vercel/kv": { + "optional": true + }, + "idb-keyval": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/unstorage/node_modules/lru-cache": { + "version": "10.1.0", + "license": "ISC", + "engines": { + "node": "14 || >=16.14" + } + }, + "packages/nextjs/node_modules/untun": { + "version": "0.1.3", + "license": "MIT", + "dependencies": { + "citty": "^0.1.5", + "consola": "^3.2.3", + "pathe": "^1.1.1" + }, + "bin": { + "untun": "bin/untun.mjs" + } + }, + "packages/nextjs/node_modules/update-browserslist-db": { + "version": "1.0.13", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "packages/nextjs/node_modules/uqr": { + "version": "0.1.2", + "license": "MIT" + }, + "packages/nextjs/node_modules/use-callback-ref": { + "version": "1.3.0", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/use-callback-ref/node_modules/tslib": { + "version": "2.6.2", + "license": "0BSD" + }, + "packages/nextjs/node_modules/use-debounce": { + "version": "8.0.4", + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + }, + "peerDependencies": { + "react": ">=16.8.0" + } + }, + "packages/nextjs/node_modules/use-sidecar": { + "version": "1.1.2", + "license": "MIT", + "dependencies": { + "detect-node-es": "^1.1.0", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.9.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/use-sidecar/node_modules/tslib": { + "version": "2.6.2", + "license": "0BSD" + }, + "packages/nextjs/node_modules/use-sync-external-store": { + "version": "1.2.0", + "license": "MIT", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "packages/nextjs/node_modules/usehooks-ts": { + "version": "2.13.0", + "license": "MIT", + "dependencies": { + "lodash.debounce": "^4.0.8" + }, + "engines": { + "node": ">=16.15.0" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17 || ^18" + } + }, + "packages/nextjs/node_modules/utf-8-validate": { + "version": "5.0.10", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "dependencies": { + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, + "packages/nextjs/node_modules/util": { + "version": "0.12.5", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" + } + }, + "packages/nextjs/node_modules/util-deprecate": { + "version": "1.0.2", + "license": "MIT" + }, + "packages/nextjs/node_modules/uuid": { + "version": "8.3.2", + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "packages/nextjs/node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "dev": true, + "license": "MIT" + }, + "packages/nextjs/node_modules/valtio": { + "version": "1.11.2", + "license": "MIT", + "dependencies": { + "proxy-compare": "2.5.1", + "use-sync-external-store": "1.2.0" + }, + "engines": { + "node": ">=12.20.0" + }, + "peerDependencies": { + "@types/react": ">=16.8", + "react": ">=16.8" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "react": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/vercel": { + "version": "32.4.1", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@vercel/build-utils": "7.2.2", + "@vercel/fun": "1.1.0", + "@vercel/go": "3.0.3", + "@vercel/hydrogen": "1.0.1", + "@vercel/next": "4.0.10", + "@vercel/node": "3.0.7", + "@vercel/python": "4.0.2", + "@vercel/redwood": "2.0.4", + "@vercel/remix-builder": "2.0.9", + "@vercel/ruby": "2.0.2", + "@vercel/static-build": "2.0.8", + "chokidar": "3.3.1" + }, + "bin": { + "vc": "dist/index.js", + "vercel": "dist/index.js" + }, + "engines": { + "node": ">= 16" + } + }, + "packages/nextjs/node_modules/vercel/node_modules/chokidar": { + "version": "3.3.1", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.3.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.1.2" + } + }, + "packages/nextjs/node_modules/vercel/node_modules/readdirp": { + "version": "3.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.0.7" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "packages/nextjs/node_modules/viem": { + "version": "1.19.9", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/wagmi-dev" + } + ], + "license": "MIT", + "dependencies": { + "@adraffy/ens-normalize": "1.10.0", + "@noble/curves": "1.2.0", + "@noble/hashes": "1.3.2", + "@scure/bip32": "1.3.2", + "@scure/bip39": "1.2.1", + "abitype": "0.9.8", + "isows": "1.0.3", + "ws": "8.13.0" + }, + "peerDependencies": { + "typescript": ">=5.0.4" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/viem/node_modules/abitype": { + "version": "0.9.8", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/wagmi-dev" + } + ], + "license": "MIT", + "peerDependencies": { + "typescript": ">=5.0.4", + "zod": "^3 >=3.19.1" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + }, + "zod": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/wagmi": { + "version": "1.4.12", + "funding": [ + { + "type": "gitcoin", + "url": "https://wagmi.sh/gitcoin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/wagmi-dev" + } + ], + "license": "MIT", + "dependencies": { + "@tanstack/query-sync-storage-persister": "^4.27.1", + "@tanstack/react-query": "^4.28.0", + "@tanstack/react-query-persist-client": "^4.28.0", + "@wagmi/core": "1.4.12", + "abitype": "0.8.7", + "use-sync-external-store": "^1.2.0" + }, + "peerDependencies": { + "react": ">=17.0.0", + "typescript": ">=5.0.4", + "viem": ">=0.3.35" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/watchpack": { + "version": "2.4.0", + "license": "MIT", + "dependencies": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "packages/nextjs/node_modules/web-vitals": { + "version": "0.2.4", + "dev": true, + "license": "Apache-2.0" + }, + "packages/nextjs/node_modules/which": { + "version": "2.0.2", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "packages/nextjs/node_modules/which-builtin-type": { + "version": "1.1.3", + "dev": true, + "license": "MIT", + "dependencies": { + "function.prototype.name": "^1.1.5", + "has-tostringtag": "^1.0.0", + "is-async-function": "^2.0.0", + "is-date-object": "^1.0.5", + "is-finalizationregistry": "^1.0.2", + "is-generator-function": "^1.0.10", + "is-regex": "^1.1.4", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.0.2", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.9" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/nextjs/node_modules/which-collection": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "is-map": "^2.0.1", + "is-set": "^2.0.1", + "is-weakmap": "^2.0.1", + "is-weakset": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/nextjs/node_modules/wide-align": { + "version": "1.1.5", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, + "packages/nextjs/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/ws": { + "version": "8.13.0", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "packages/nextjs/node_modules/xdg-app-paths": { + "version": "5.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "xdg-portable": "^7.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "packages/nextjs/node_modules/xdg-portable": { + "version": "7.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "os-paths": "^4.0.1" + }, + "engines": { + "node": ">= 6.0" + } + }, + "packages/nextjs/node_modules/xtend": { + "version": "4.0.2", + "license": "MIT", + "engines": { + "node": ">=0.4" + } + }, + "packages/nextjs/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "license": "ISC" + }, + "packages/nextjs/node_modules/yallist": { + "version": "4.0.0", + "dev": true, + "license": "ISC" + }, + "packages/nextjs/node_modules/yaml": { + "version": "2.3.2", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 14" + } + }, + "packages/nextjs/node_modules/yargs": { + "version": "15.4.1", + "license": "MIT", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "packages/nextjs/node_modules/yauzl": { + "version": "2.10.0", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, + "packages/nextjs/node_modules/yauzl-clone": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "events-intercept": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "packages/nextjs/node_modules/yauzl-promise": { + "version": "2.1.3", + "dev": true, + "license": "MIT", + "dependencies": { + "yauzl": "^2.9.1", + "yauzl-clone": "^1.0.4" + }, + "engines": { + "node": ">=6" + } + }, + "packages/nextjs/node_modules/yn": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "packages/nextjs/node_modules/zustand": { + "version": "4.4.1", + "license": "MIT", + "dependencies": { + "use-sync-external-store": "1.2.0" + }, + "engines": { + "node": ">=12.7.0" + }, + "peerDependencies": { + "@types/react": ">=16.8", + "immer": ">=9.0", + "react": ">=16.8" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "immer": { + "optional": true + }, + "react": { + "optional": true + } + } + } + } +} diff --git a/package.json b/package.json index 3e026f1..4fbc45b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "se-2", - "version": "0.0.1", + "version": "0.1.5", "private": true, "workspaces": { "packages": [ @@ -22,9 +22,13 @@ "hardhat:lint-staged": "yarn workspace @se-2/hardhat lint-staged", "hardhat:format": "yarn workspace @se-2/hardhat format", "hardhat:test": "yarn workspace @se-2/hardhat test", + "hardhat:link:gw:upsert": "yarn workspace @se-2/hardhat link:gw:upsert", + "hardhat:link:gw:update-secrets": "yarn workspace @se-2/hardhat link:gw:update-secrets", + "hardhat:link:gw:update-subscription": "yarn workspace @se-2/hardhat link:gw:update-subscription", "test": "yarn hardhat:test", "format": "yarn next:format && yarn hardhat:format", "start": "yarn workspace @se-2/nextjs dev", + "next:fast": "yarn workspace @se-2/nextjs fast", "next:lint": "yarn workspace @se-2/nextjs lint", "next:format": "yarn workspace @se-2/nextjs format", "next:check-types": "yarn workspace @se-2/nextjs check-types", @@ -32,11 +36,13 @@ "postinstall": "husky install", "precommit": "lint-staged", "vercel": "yarn workspace @se-2/nextjs vercel", - "vercel:yolo": "yarn workspace @se-2/nextjs vercel:yolo" + "vercel:yolo": "yarn workspace @se-2/nextjs vercel:yolo", + "release": "standard-version" }, "packageManager": "yarn@3.2.3", "devDependencies": { "husky": "^8.0.1", - "lint-staged": "^13.0.3" + "lint-staged": "^13.0.3", + "standard-version": "^9.5.0" } } diff --git a/packages/hardhat/.env.example b/packages/hardhat/.env.example index 8242fd0..758df7d 100644 --- a/packages/hardhat/.env.example +++ b/packages/hardhat/.env.example @@ -9,3 +9,9 @@ ALCHEMY_API_KEY="" DEPLOYER_PRIVATE_KEY="" ETHERSCAN_API_KEY="" + +# Required for onboarding process +RABBITMQ_AUTH= + +# OpenAI API Key +OPENAI_API_KEY= \ No newline at end of file diff --git a/packages/hardhat/Drafts/CeptorCS.txt b/packages/hardhat/Drafts/CeptorCS.txt new file mode 100644 index 0000000..01ea2ed --- /dev/null +++ b/packages/hardhat/Drafts/CeptorCS.txt @@ -0,0 +1,90 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import "@openzeppelin/contracts/access/Ownable.sol"; +import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; +import "@chainlink/contracts/src/v0.8/vrf/VRFConsumerBaseV2.sol"; + +contract CeptorCharacterSheets is ERC721URIStorage, VRFConsumerBaseV2, Ownable { + struct Stats { + uint8 strength; + uint8 dexterity; + uint8 constitution; + uint8 intelligence; + uint8 wisdom; + uint8 charisma; + uint8 luck; + } + + struct Character { + Stats stats; + string name; + uint swapsLeft; + } + + mapping(address => uint256) public ownerToTokenId; + mapping(uint256 => Character) public tokenIdToCharacter; + + uint256 public tokenIdCounter; + bytes32 public keyHash; + uint256 public fee; + uint64 public subscriptionId; + + event CharacterCreated(uint256 indexed tokenId, address owner); + event StatsSwapped(uint256 indexed tokenId, address owner); + + constructor( + address vrfCoordinator, + address linkToken, + bytes32 _keyHash, + uint64 _subscriptionId + ) + VRFConsumerBaseV2(vrfCoordinator) + ERC721("CeptorCharacterSheets", "CCS") + { + keyHash = _keyHash; + fee = 0.1 * 10**18; // Chainlink VRF fee + subscriptionId = _subscriptionId; + tokenIdCounter = 1; + } + + function createCharacter(string memory name) external { + require(ownerToTokenId[msg.sender] == 0, "Owner already has a character"); + uint256 tokenId = tokenIdCounter++; + ownerToTokenId[msg.sender] = tokenId; + tokenIdToCharacter[tokenId] = Character({ + name: name, + stats: Stats(0, 0, 0, 0, 0, 0, 0), + swapsLeft: 3 + }); + _safeMint(msg.sender, tokenId); + emit CharacterCreated(tokenId, msg.sender); + requestStats(tokenId); + } + + function requestStats(uint256 tokenId) internal { + require(LINK.balanceOf(address(this)) >= fee, "Not enough LINK"); + requestRandomWords(keyHash, subscriptionId, 3, fee, 1); + } + + function fulfillRandomWords(uint256, uint256[] memory randomWords) internal override { + uint256 tokenId = ownerToTokenId[msg.sender]; + Character storage character = tokenIdToCharacter[tokenId]; + character.stats.strength = uint8(randomWords[0] % 16 + 3); + character.stats.dexterity = uint8(randomWords[1] % 16 + 3); + character.stats.constitution = uint8(randomWords[2] % 16 + 3); + character.stats.intelligence = uint8(randomWords[3] % 16 + 3); + character.stats.wisdom = uint8(randomWords[4] % 16 + 3); + character.stats.charisma = uint8(randomWords[5] % 16 + 3); + character.stats.luck = uint8(randomWords[6] % 16 + 3); + } + + function swapStats(uint256 tokenId) external { + require(ownerOf(tokenId) == msg.sender, "Not the owner"); + Character storage character = tokenIdToCharacter[tokenId]; + require(character.swapsLeft > 0, "No swaps left"); + character.swapsLeft--; + requestStats(tokenId); + emit StatsSwapped(tokenId, msg.sender); + } +} diff --git a/packages/hardhat/Drafts/CharacterSheets.txt b/packages/hardhat/Drafts/CharacterSheets.txt new file mode 100644 index 0000000..0eb0de6 --- /dev/null +++ b/packages/hardhat/Drafts/CharacterSheets.txt @@ -0,0 +1,125 @@ +// SPDX-License-Identifier: MIT +// An example of a consumer contract that relies on a subscription for funding. +pragma solidity ^0.8.7; + +// Useful for debugging. Remove when deploying to a live network. +import "hardhat/console.sol"; + +// Use openzeppelin to inherit battle-tested implementations (ERC20, ERC721, etc) +import "@openzeppelin/contracts/access/Ownable.sol"; +import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; +import {VRFCoordinatorV2Interface} from "@chainlink/contracts/src/v0.8/vrf/interfaces/VRFCoordinatorV2Interface.sol"; +import {VRFConsumerBaseV2} from "@chainlink/contracts/src/v0.8/vrf/VRFConsumerBaseV2.sol"; +import {ConfirmedOwner} from "@chainlink/contracts/src/v0.8/shared/access/ConfirmedOwner.sol"; + +/** + * Request testnet LINK and ETH here: https://faucets.chain.link/ + * Find information on LINK Token Contracts and get the latest ETH and LINK faucets here: https://docs.chain.link/docs/link-token-contracts/ + */ + +/** + * THIS IS AN EXAMPLE CONTRACT THAT USES HARDCODED VALUES FOR CLARITY. + * THIS IS AN EXAMPLE CONTRACT THAT USES UN-AUDITED CODE. + * DO NOT USE THIS CODE IN PRODUCTION. + */ + +contract VRFv2Consumer is VRFConsumerBaseV2, ConfirmedOwner { + event RequestSent(uint256 requestId, uint32 numWords); + event RequestFulfilled(uint256 requestId, uint256[] randomWords); + + struct RequestStatus { + bool fulfilled; // whether the request has been successfully fulfilled + bool exists; // whether a requestId exists + uint256[] randomWords; + } + mapping(uint256 => RequestStatus) + public s_requests; /* requestId --> requestStatus */ + VRFCoordinatorV2Interface COORDINATOR; + + // Your subscription ID. + uint64 s_subscriptionId; + + // past requests Id. + uint256[] public requestIds; + uint256 public lastRequestId; + + // The gas lane to use, which specifies the maximum gas price to bump to. + // For a list of available gas lanes on each network, + // see https://docs.chain.link/docs/vrf/v2/subscription/supported-networks/#configurations + bytes32 keyHash = + 0x474e34a077df58807dbe9c96d3c009b23b3c6d0cce433e59bbf5b34f823bc56c; + + // Depends on the number of requested values that you want sent to the + // fulfillRandomWords() function. Storing each word costs about 20,000 gas, + // so 100,000 is a safe default for this example contract. Test and adjust + // this limit based on the network that you select, the size of the request, + // and the processing of the callback request in the fulfillRandomWords() + // function. + uint32 callbackGasLimit = 100000; + + // The default is 3, but you can set this higher. + uint16 requestConfirmations = 3; + + // For this example, retrieve 2 random values in one request. + // Cannot exceed VRFCoordinatorV2.MAX_NUM_WORDS. + uint32 numWords = 2; + + /** + * HARDCODED FOR SEPOLIA + * COORDINATOR: 0x8103B0A8A00be2DDC778e6e7eaa21791Cd364625 + */ + constructor( + uint64 subscriptionId + ) + VRFConsumerBaseV2(0x8103B0A8A00be2DDC778e6e7eaa21791Cd364625) + ConfirmedOwner(msg.sender) + { + COORDINATOR = VRFCoordinatorV2Interface( + 0x8103B0A8A00be2DDC778e6e7eaa21791Cd364625 + ); + s_subscriptionId = subscriptionId; + } + + // Assumes the subscription is funded sufficiently. + function requestRandomWords() + external + onlyOwner + returns (uint256 requestId) + { + // Will revert if subscription is not set and funded. + requestId = COORDINATOR.requestRandomWords( + keyHash, + s_subscriptionId, + requestConfirmations, + callbackGasLimit, + numWords + ); + s_requests[requestId] = RequestStatus({ + randomWords: new uint256[](0), + exists: true, + fulfilled: false + }); + requestIds.push(requestId); + lastRequestId = requestId; + emit RequestSent(requestId, numWords); + return requestId; + } + + function fulfillRandomWords( + uint256 _requestId, + uint256[] memory _randomWords + ) internal override { + require(s_requests[_requestId].exists, "request not found"); + s_requests[_requestId].fulfilled = true; + s_requests[_requestId].randomWords = _randomWords; + emit RequestFulfilled(_requestId, _randomWords); + } + + function getRequestStatus( + uint256 _requestId + ) external view returns (bool fulfilled, uint256[] memory randomWords) { + require(s_requests[_requestId].exists, "request not found"); + RequestStatus memory request = s_requests[_requestId]; + return (request.fulfilled, request.randomWords); + } +} diff --git a/packages/hardhat/Drafts/GamesDAO.sol b/packages/hardhat/Drafts/GamesDAO.sol new file mode 100644 index 0000000..18c6bd3 --- /dev/null +++ b/packages/hardhat/Drafts/GamesDAO.sol @@ -0,0 +1,150 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +// Chainlink Bootcamp's TokenShop as scaffold, GamesDAO manages the minting and pricing of GamesToken based on Chainlink price feeds. +// It allows for gamemaster proposals on token pricing, which can be voted on by allowed players and gamemasters. +// Written in the Chainlink BlockMagic Hackathon for Ceptor Games Team by Tippi Fifestarr. We will progressively decentralize. +// Initially deploying on Polygon Amoy Testnet, I plan to deploy these on Scroll, ZkSync, Optimism, and Metis +// Since only Polygon and Avax and Ethereum are currently supported by CCIP, the next version will CCIPGamesDAO on Polygon first. + +import "@chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol"; +// for CCIP, see CCIPGamesDAO.sol (not written yet at this time) + +interface TokenInterface { + function mint(address account, uint256 amount) external; +} + +contract GamesDAO { + AggregatorV3Interface internal priceFeed; + TokenInterface public minter; + uint256 public gamesTokenPriceInCents = 2; // 1 token = 0.02 USD + address public owner; + + mapping(address => bool) public allowedPlayers; + mapping(address => bool) public gamemasters; + + struct Proposal { + uint256 newPrice; + uint256 votesFor; + uint256 votesAgainst; + uint256 deadline; + bool executed; + mapping(address => bool) voters; + } + + Proposal public proposal; + + event PlayerAllowed(address indexed player); + event GamemasterAdded(address indexed gamemaster); + event ProposalCreated(uint256 newPrice, uint256 deadline); + event Voted(address indexed voter, bool voteFor); + event ProposalExecuted(uint256 newPrice); + + constructor() { + // Initialize the price feed for MATIC/USD on Polygon + priceFeed = AggregatorV3Interface(0x001382149eBa3441043c1c66972b4772963f5D43); + owner = msg.sender; + allowedPlayers[owner] = true; + gamemasters[owner] = true; + } + + modifier onlyOwner() { + require(msg.sender == owner, "Only owner can call this function"); + _; + } + + modifier onlyAllowed() { + require(allowedPlayers[msg.sender] || gamemasters[msg.sender], "Not allowed"); + _; + } + + // Set the token contract address for minting + function setTokenAddress(address tokenAddress) external onlyOwner { + minter = TokenInterface(tokenAddress); + } + + // Retrieve the latest price of MATIC in USD + function getChainlinkDataFeedLatestAnswer() public view returns (int) { + (, int price,,,) = priceFeed.latestRoundData(); + return price; + } + + // Calculate the amount of MATIC required to buy one GamesToken + function getMATICForOneGT() public view returns (uint256) { + uint256 maticPriceInUSD = uint256(getChainlinkDataFeedLatestAnswer()); + return (10 ** 10 / maticPriceInUSD) * gamesTokenPriceInCents; + } + + // Calculate the total MATIC required for a given number of GamesTokens + function getMATICForGTs(uint256 numberOfGTs) public view returns (uint256) { + return getMATICForOneGT() * numberOfGTs; + } + + // Allow players to buy a specified number of GamesTokens + function buyAmountTokens(uint256 numberOfGTs) public payable onlyAllowed { + uint256 requiredMATIC = getMATICForGTs(numberOfGTs); + require(msg.value >= requiredMATIC, "Insufficient MATIC sent"); + minter.mint(msg.sender, numberOfGTs * 10 ** 18); + } + + // Allow players to buy GamesTokens based on the MATIC sent + function buyTokens() public payable onlyAllowed { + uint256 numberOfGTs = msg.value / getMATICForOneGT(); + require(numberOfGTs > 0, "Insufficient MATIC sent"); + minter.mint(msg.sender, numberOfGTs * 10 ** 18); + } + + // Allow the owner to withdraw contract balance + function withdraw() external onlyOwner { + payable(owner).transfer(address(this).balance); + } + + // Allow the owner to permit a player to participate + function allowPlayer(address player) external onlyOwner { + allowedPlayers[player] = true; + emit PlayerAllowed(player); + } + + // Allow the owner to designate a gamemaster + function addGamemaster(address gamemaster) external onlyOwner { + gamemasters[gamemaster] = true; + emit GamemasterAdded(gamemaster); + } + + // Create a proposal for changing the token price + function createProposal(uint256 newPrice) external onlyAllowed { + require(proposal.deadline == 0 || block.timestamp > proposal.deadline, "Previous proposal still active"); + + proposal.newPrice = newPrice; + proposal.votesFor = 0; + proposal.votesAgainst = 0; + proposal.deadline = block.timestamp + 1 weeks; + proposal.executed = false; + + emit ProposalCreated(newPrice, proposal.deadline); + } + + // Allow allowed users to vote on the active proposal + function vote(bool voteFor) external onlyAllowed { + require(block.timestamp <= proposal.deadline, "Voting period has ended"); + require(!proposal.voters[msg.sender], "Already voted"); + proposal.voters[msg.sender] = true; + if (voteFor) { + proposal.votesFor += 1; + } else { + proposal.votesAgainst += 1; + } + emit Voted(msg.sender, voteFor); + } + + // Execute the proposal if voting is complete and conditions are met + function executeProposal() external onlyAllowed { + require(block.timestamp > proposal.deadline, "Voting period not ended yet"); + require(!proposal.executed, "Proposal already executed"); + if (proposal.votesFor > proposal.votesAgainst) { + gamesTokenPriceInCents = proposal.newPrice; + emit ProposalExecuted(proposal.newPrice); + } + proposal.executed = true; + } +} \ No newline at end of file diff --git a/packages/hardhat/Drafts/GamesDAOV2.sol b/packages/hardhat/Drafts/GamesDAOV2.sol new file mode 100644 index 0000000..3fa982d --- /dev/null +++ b/packages/hardhat/Drafts/GamesDAOV2.sol @@ -0,0 +1,192 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +// Games Token deployed on Polygon Amoy + +import "@chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol"; + +/** + * @title GamesDAO + * @dev Manages the minting and pricing of GamesToken based on Chainlink price feeds. Allows for gamemaster proposals on token pricing, which can be voted on by allowed players and gamemasters. + * Written for the Chainlink BlockMagic Hackathon for Ceptor Games Team by Tippi Fifestarr. + */ +interface TokenInterface { + function mint(address account, uint256 amount) external; +} + +contract GamesDAOv2 { + AggregatorV3Interface internal priceFeed; + TokenInterface public minter; + uint256 public gamesTokenPriceInCents = 2; // 1 token = 0.02 USD + address public owner; + + mapping(address => bool) public allowedPlayers; + mapping(address => bool) public gamemasters; + + struct Proposal { + uint256 newPrice; + uint256 votesFor; + uint256 votesAgainst; + uint256 deadline; + bool executed; + mapping(address => bool) voters; + } + + Proposal public proposal; + + event PlayerAllowed(address indexed player); + event GamemasterAdded(address indexed gamemaster); + event ProposalCreated(uint256 newPrice, uint256 deadline); + event Voted(address indexed voter, bool voteFor); + event ProposalExecuted(uint256 newPrice); + + /** + * @dev Sets the owner and initializes the MATIC/USD price feed on the Polygon Amoy Testnet. + */ + constructor() { + priceFeed = AggregatorV3Interface(0x001382149eBa3441043c1c66972b4772963f5D43); + owner = msg.sender; + allowedPlayers[owner] = true; + gamemasters[owner] = true; + } + + /** + * @dev Ensures only the owner can call the modified function. + */ + modifier onlyOwner() { + require(msg.sender == owner, "Only owner can call this function"); + _; + } + + /** + * @dev Ensures only allowed players or gamemasters can call the modified function. + */ + modifier onlyAllowed() { + require(allowedPlayers[msg.sender] || gamemasters[msg.sender], "Not allowed"); + _; + } + + /** + * @notice Sets the token contract address for minting. + * @param tokenAddress The address of the token contract. + */ + function setTokenAddress(address tokenAddress) external onlyOwner { + minter = TokenInterface(tokenAddress); + } + + /** + * @notice Retrieves the latest price of MATIC in USD from the Chainlink data feed. + * @return The latest MATIC price in USD. + */ + function getChainlinkDataFeedLatestAnswer() public view returns (int) { + (, int price,,,) = priceFeed.latestRoundData(); + return price; + } + + /** + * @notice Calculates the amount of MATIC required to buy one GamesToken. + * @return The amount of MATIC needed for one GamesToken. + */ + function getMATICForOneGT() public view returns (uint256) { + uint256 maticPriceInUSD = uint256(getChainlinkDataFeedLatestAnswer()); + return (10 ** 10 / maticPriceInUSD) * gamesTokenPriceInCents; + } + + /** + * @notice Calculates the total MATIC required for a given number of GamesTokens. + * @param numberOfGTs The number of GamesTokens to buy. + * @return The total amount of MATIC needed for the specified number of GamesTokens. + */ + function getMATICForGTs(uint256 numberOfGTs) public view returns (uint256) { + return getMATICForOneGT() * numberOfGTs; + } + + /** + * @notice Allows players to buy a specified number of GamesTokens. + * @param numberOfGTs The number of GamesTokens to buy. + */ + function buyAmountTokens(uint256 numberOfGTs) public payable onlyAllowed { + uint256 requiredMATIC = getMATICForGTs(numberOfGTs); + require(msg.value >= requiredMATIC, "Insufficient MATIC sent"); + minter.mint(msg.sender, numberOfGTs * 10 ** 18); + } + + /** + * @notice Allows players to buy GamesTokens based on the amount of MATIC sent. + */ + function buyTokens() public payable onlyAllowed { + uint256 numberOfGTs = msg.value / getMATICForOneGT(); + require(numberOfGTs > 0, "Insufficient MATIC sent"); + minter.mint(msg.sender, numberOfGTs * 10 ** 18); + } + + /** + * @notice Allows the owner to withdraw the contract balance. + */ + function withdraw() external onlyOwner { + payable(owner).transfer(address(this).balance); + } + + /** + * @notice Allows the owner to permit a player to participate. + * @param player The address of the player to be allowed. + */ + function allowPlayer(address player) external onlyOwner { + allowedPlayers[player] = true; + emit PlayerAllowed(player); + } + + /** + * @notice Allows the owner to designate a gamemaster. + * @param gamemaster The address of the gamemaster to be added. + */ + function addGamemaster(address gamemaster) external onlyOwner { + gamemasters[gamemaster] = true; + emit GamemasterAdded(gamemaster); + } + + /** + * @notice Creates a proposal for changing the token price. + * @param newPrice The new price for the token in cents. + */ + function createProposal(uint256 newPrice) external onlyAllowed { + require(proposal.deadline == 0 || block.timestamp > proposal.deadline, "Previous proposal still active"); + + proposal.newPrice = newPrice; + proposal.votesFor = 0; + proposal.votesAgainst = 0; + proposal.deadline = block.timestamp + 1 weeks; + proposal.executed = false; + + emit ProposalCreated(newPrice, proposal.deadline); + } + + /** + * @notice Allows allowed users to vote on the active proposal. + * @param voteFor True to vote in favor, false to vote against. + */ + function vote(bool voteFor) external onlyAllowed { + require(block.timestamp <= proposal.deadline, "Voting period has ended"); + require(!proposal.voters[msg.sender], "Already voted"); + proposal.voters[msg.sender] = true; + if (voteFor) { + proposal.votesFor += 1; + } else { + proposal.votesAgainst += 1; + } + emit Voted(msg.sender, voteFor); + } + + /** + * @notice Executes the proposal if voting is complete and conditions are met. + */ + function executeProposal() external onlyAllowed { + require(block.timestamp > proposal.deadline, "Voting period not ended yet"); + require(!proposal.executed, "Proposal already executed"); + if (proposal.votesFor > proposal.votesAgainst) { + gamesTokenPriceInCents = proposal.newPrice; + emit ProposalExecuted(proposal.newPrice); + } + proposal.executed = true; + } +} \ No newline at end of file diff --git a/packages/hardhat/Drafts/Unsafe_CCG.sol b/packages/hardhat/Drafts/Unsafe_CCG.sol new file mode 100644 index 0000000..6729c4c --- /dev/null +++ b/packages/hardhat/Drafts/Unsafe_CCG.sol @@ -0,0 +1,141 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.7; + +import {IVRFCoordinatorV2Plus} from "@chainlink/contracts/src/v0.8/vrf/dev/interfaces/IVRFCoordinatorV2Plus.sol"; +import {VRFConsumerBaseV2Plus} from "@chainlink/contracts/src/v0.8/vrf/dev/VRFConsumerBaseV2Plus.sol"; +import {VRFV2PlusClient} from "@chainlink/contracts/src/v0.8/vrf/dev/libraries/VRFV2PlusClient.sol"; +import {OpenSourceRandomNames} from "./OSRN.sol"; +import {OpenSourceRandomBackstory} from "./OSRB.sol"; + +contract CCG is VRFConsumerBaseV2Plus { + IVRFCoordinatorV2Plus COORDINATOR; + OpenSourceRandomNames public randomNamesContract; + OpenSourceRandomBackstory public randomBackstoryContract; + + uint256 s_subscriptionId = 21065254117722076320750141452575268873113382931160444158709360180731175497445; + bytes32 keyHash = 0x787d74caea10b2b357790d5b5247c2f63d1d91572a9846f780606e4d953677ae; + // refactor code or use https://github.com/cgewecke/hardhat-gas-reporter + uint32 callbackGasLimit = 135000; + uint16 requestConfirmations = 3; + uint32 numWords = 2; // 1 into 6 ability scores + 1 for class + + struct Character { + uint256 randomWord; + uint256[6] abilities; + string class; + string playerName; + string name; + string alignment; + string background; + uint8 swaps; + } + + mapping(uint256 => address) requestToSender; + mapping(address => Character) public characters; + + event CharacterCreated(address owner, uint256 requestId); + event CharacterUpdated(address owner, string alignment, string background); + event ScoresSwapped(address owner); + event RequestFulfilled(uint256 requestId, uint256[] randomWords); + event RandomWordSaved(address owner); + event RandomNamesContractSet(address randomNamesContract); + + constructor() VRFConsumerBaseV2Plus(0x9DdfaCa8183c41ad55329BdeeD9F6A8d53168B1B) + { + COORDINATOR = IVRFCoordinatorV2Plus( + 0x9DdfaCa8183c41ad55329BdeeD9F6A8d53168B1B + ); + } + + // function to set both contracts at once + function setRandomContracts(address _randomNamesContract, address _randomBackstoryContract) external { + randomNamesContract = OpenSourceRandomNames(_randomNamesContract); + randomBackstoryContract = OpenSourceRandomBackstory(_randomBackstoryContract); + emit RandomNamesContractSet(_randomNamesContract); + } + + function createCharacter(string calldata playerName) external { + require(characters[msg.sender].randomWord == 0, "Character already created, use finalizeCharacterDetails"); + uint256 requestId = COORDINATOR.requestRandomWords( + VRFV2PlusClient.RandomWordsRequest({ + keyHash: keyHash, + subId: s_subscriptionId, + requestConfirmations: requestConfirmations, + callbackGasLimit: callbackGasLimit, + numWords: numWords, + extraArgs: VRFV2PlusClient._argsToBytes( + VRFV2PlusClient.ExtraArgsV1({nativePayment: false}) + ) + }) + ); + characters[msg.sender].playerName = playerName; + requestToSender[requestId] = msg.sender; + emit CharacterCreated(msg.sender, requestId); + } + + function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override { + address owner = requestToSender[requestId]; + require(characters[owner].randomWord == 0, "Random words already fulfilled"); + + characters[owner].randomWord = randomWords[0]; + characters[owner].class = getClass(randomWords[1]); + + emit RequestFulfilled(requestId, randomWords); + emit RandomWordSaved(owner); + } + + function finalizeCharacterDetails(string calldata alignment) external { + require(characters[msg.sender].randomWord != 0, "Random words not fulfilled"); + + uint256 randomWord = characters[msg.sender].randomWord; + for (uint i = 0; i < 6; ++i) { + uint256 chunk = (randomWord >> (i * 32)) & 0xFFFFFFFF; // Extract 32-bit chunks + characters[msg.sender].abilities[i] = (chunk % 16) + 3; // Score range: 3-18 + } + + // mod a value between 0-19 from the random word + uint256 randomNumber = randomWord % 20; + characters[msg.sender].name = randomNamesContract.names(randomNumber); + characters[msg.sender].alignment = alignment; + randomNumber = (randomWord >> 32) % 15; + characters[msg.sender].background = randomBackstoryContract.backstories(randomNumber); + + emit CharacterUpdated(msg.sender, alignment, characters[msg.sender].background); + } + + function updateCharacterDetails(string calldata name, string calldata alignment, string calldata background) external { + require(characters[msg.sender].randomWord != 0, "Random words not fulfilled"); + + if (bytes(name).length > 0) { + characters[msg.sender].name = name; + } + if (bytes(alignment).length > 0) { + characters[msg.sender].alignment = alignment; + } + if (bytes(background).length > 0) { + characters[msg.sender].background = background; + } + emit CharacterUpdated(msg.sender, alignment, background); + } + + function swapScores(uint8 index1, uint8 index2) external { + require(characters[msg.sender].swaps < 3, "Max swaps reached"); + require(index1 < 6 && index2 < 6, "Invalid index"); + + (characters[msg.sender].abilities[index1], characters[msg.sender].abilities[index2]) = + (characters[msg.sender].abilities[index2], characters[msg.sender].abilities[index1]); + characters[msg.sender].swaps++; + emit ScoresSwapped(msg.sender); + } + + function getClass(uint256 randomNumber) private pure returns (string memory) { + string[13] memory classes = ["Barbarian", "Bard", "Cleric", "Druid", "Fighter", "Monk", "Paladin", "Ranger", "Rogue", "Sorcerer", "Warlock", "Wizard", "Ceptor"]; + return classes[randomNumber % classes.length]; + } + + // because the ability scores are stored as an array, they aren't easily readable + // this function allows us to get the ability scores of a character + function getCharacterAbilities(address owner) external view returns (uint256[6] memory) { + return characters[owner].abilities; + } +} diff --git a/packages/hardhat/Drafts/Unsafe_CeptorCharacterGenerator.sol b/packages/hardhat/Drafts/Unsafe_CeptorCharacterGenerator.sol new file mode 100644 index 0000000..0922e25 --- /dev/null +++ b/packages/hardhat/Drafts/Unsafe_CeptorCharacterGenerator.sol @@ -0,0 +1,102 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.7; + +import {IVRFCoordinatorV2Plus} from "@chainlink/contracts/src/v0.8/vrf/dev/interfaces/IVRFCoordinatorV2Plus.sol"; +import {VRFConsumerBaseV2Plus} from "@chainlink/contracts/src/v0.8/vrf/dev/VRFConsumerBaseV2Plus.sol"; +import {VRFV2PlusClient} from "@chainlink/contracts/src/v0.8/vrf/dev/libraries/VRFV2PlusClient.sol"; + +contract CeptorCharacterGenerator is VRFConsumerBaseV2Plus { + IVRFCoordinatorV2Plus COORDINATOR; + uint256 s_subscriptionId; + bytes32 keyHash = 0x787d74caea10b2b357790d5b5247c2f63d1d91572a9846f780606e4d953677ae; + // forge-test gas report & gas limit plugin on hardhat + uint32 callbackGasLimit = 100000; + uint16 requestConfirmations = 3; + uint32 numWords = 7; // 6 ability scores + 1 for class + + struct Character { + uint256[6] abilities; + string class; + string name; + string alignment; + string background; + uint8 swaps; + } + + mapping(uint256 => address) requestToSender; + mapping(address => Character) public characters; + + event CharacterCreated(address owner, uint256 requestId); + event CharacterUpdated(address owner, string name, string alignment, string background); + event ScoresSwapped(address owner); + event RequestFulfilled(uint256 requestId, uint256[] randomWords); + + constructor(uint256 subscriptionId) VRFConsumerBaseV2Plus(0x9DdfaCa8183c41ad55329BdeeD9F6A8d53168B1B) + { + COORDINATOR = IVRFCoordinatorV2Plus( + 0x9DdfaCa8183c41ad55329BdeeD9F6A8d53168B1B + ); + s_subscriptionId = subscriptionId; + } + + // allow any address to call createCharacter, + // require each address can create one character + // (after a character is created, + // characters[msg.sender].abilities[0] will no longer be 0). + function createCharacter() external { + require(characters[msg.sender].abilities[0] == 0, "Character already created"); + uint256 requestId = COORDINATOR.requestRandomWords( + VRFV2PlusClient.RandomWordsRequest({ + keyHash: keyHash, + subId: s_subscriptionId, + requestConfirmations: requestConfirmations, + callbackGasLimit: callbackGasLimit, + numWords: numWords, + extraArgs: VRFV2PlusClient._argsToBytes( + VRFV2PlusClient.ExtraArgsV1({nativePayment: false}) + ) + }) + ); + requestToSender[requestId] = msg.sender; + emit CharacterCreated(msg.sender, requestId); +} + function fulfillRandomWords(uint256 requestId, uint256[] calldata randomWords) internal override { + address owner = requestToSender[requestId]; + uint256[6] memory abilities; + for (uint i = 0; i < 6; ++i) { // ++i saves 2 gas + abilities[i] = (randomWords[i] % 16) + 3; // Score range: 3-18 + } + characters[owner] = Character({ + abilities: abilities, + class: getClass(randomWords[6]), + name: "", + alignment: "", + background: "", + swaps: 0 + }); + emit RequestFulfilled(requestId, randomWords); + } + + function updateCharacterDetails(string calldata name, string calldata alignment, string calldata background) external { + require(characters[msg.sender].abilities[0] != 0, "Character not created"); + characters[msg.sender].name = name; + characters[msg.sender].alignment = alignment; + characters[msg.sender].background = background; + emit CharacterUpdated(msg.sender, name, alignment, background); + } + + function swapScores(uint8 index1, uint8 index2) external { + require(characters[msg.sender].swaps < 3, "Max swaps reached"); + require(index1 < 6 && index2 < 6, "Invalid index"); + + (characters[msg.sender].abilities[index1], characters[msg.sender].abilities[index2]) = + (characters[msg.sender].abilities[index2], characters[msg.sender].abilities[index1]); + characters[msg.sender].swaps++; + emit ScoresSwapped(msg.sender); + } + + function getClass(uint256 randomNumber) private pure returns (string memory) { + string[13] memory classes = ["Barbarian", "Bard", "Cleric", "Druid", "Fighter", "Monk", "Paladin", "Ranger", "Rogue", "Sorcerer", "Warlock", "Wizard", "Ceptor"]; + return classes[randomNumber % classes.length]; + } +} diff --git a/packages/hardhat/Drafts/WorldFactory2.sol b/packages/hardhat/Drafts/WorldFactory2.sol new file mode 100644 index 0000000..8906efd --- /dev/null +++ b/packages/hardhat/Drafts/WorldFactory2.sol @@ -0,0 +1,69 @@ +// inspired by Josh "W" Comeau's open house lessson on useState and react dom magic +// https://courses.joshwcomeau.com/joy-of-react/open-house/01-why-the-dance + +// SPDX-License-Identifier: MIT +// Why do we always use this one? - Tippi +// what does a world look like, that's up to it's Creator. +// what does a world factory look like? it all starts at the gift shop. +pragma solidity ^0.8.0; +// "public variables automatically generate getter functions" - Andrej +// what does the world factory need to make public? +// number of worlds +// number of gifts remaining in the gift shop +// number of games +// uri of each worlds' Creator (owner provided unique 8-bit wizard character) .gif file +// each worlds "vibe", "scenarios", "locations", "descriptions", "maps", "denizens", "secrets", "goals", "ruleset" and "players" +// if a game is currently happening and what world it's in +// what else? +/* A contract that generates a game world based on a user's vibe and number of players. The world is generated with a visual of the planet, scenarios, locations, descriptions, maps, denizens, secrets, goals, and players. Each world has its own blockchain. Creating a World costs 10 gameTokens. when creating a game, i want to have my own world or play with others. each world should be locked to a blockchain. 10 gT to make a world. 5 gT to join one as a GM, 2 gT to join as player. +*/ +// to gain access to world factory, you must buy a gift from the gift shop. +// for 10 dollars of eth, you get 1 gameToken. +// guess how much a gift costs? half gameToken. +// 10 gameTokens = Create 1 world +// what are the functions that the world factory needs? +// createWorld +// joinWorld +// leaveWorld +// getWorld +// moneyIn +// do we want to allow each game owner (Creator) to have a vote on how money is spent? +// i vote yes - tippi. add your vote - name above if you agree. +// what else? +// what are the functions that a world needs? +// setSchedule +// scheduleGame +// startGame +// joinGame +// leaveGame +// reviewGame +// what else? +// what are the events that the world factory needs? +// worldCreated +// worldJoined +// worldLeft +// gameScheduled +// gameStarted +// gameJoined +// gameLeft +// gameReviewed +// what else? +// what are the modifiers that the world factory needs? +// onlyWorldOwner +// onlyWorldGameMaster +// onlyWorldPlayer +// what else? +// what are the structs that the world factory needs? +// World +// Game +// Player +// what else? + +contract WorldFactory2 { + address public owner; + + constructor() { + owner = msg.sender; + } + +} \ No newline at end of file diff --git a/packages/hardhat/ceptor.config.ts b/packages/hardhat/ceptor.config.ts new file mode 100644 index 0000000..0702bfb --- /dev/null +++ b/packages/hardhat/ceptor.config.ts @@ -0,0 +1,6 @@ +import { HardhatRuntimeEnvironment } from "hardhat/types"; + +export const targetNetworks = (hre: HardhatRuntimeEnvironment) => { + const chains = hre.config.networks; + return [chains.optimismSepolia, chains.baseSepolia, chains.polygonAmoy, chains.sepolia, chains.hardhat]; +}; diff --git a/packages/hardhat/contracts/2cents.png b/packages/hardhat/contracts/2cents.png new file mode 100644 index 0000000..40b08c1 Binary files /dev/null and b/packages/hardhat/contracts/2cents.png differ diff --git a/packages/hardhat/contracts/BackstoryFunctionClient.sol b/packages/hardhat/contracts/BackstoryFunctionClient.sol new file mode 100644 index 0000000..166ecef --- /dev/null +++ b/packages/hardhat/contracts/BackstoryFunctionClient.sol @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.0; + +import {ICCGatewayClient} from "./interfaces/ICCGatewayClient.sol"; +import {ICCGateway} from "./interfaces/ICCGateway.sol"; +import {Backgrounds} from "./Characters/Backgrounds.sol"; + +contract BackstoryFunctionClient is ICCGatewayClient { + ICCGateway private immutable gateway; + + uint64 public subscriptionId = 0; + bytes private encryptedSecretsReference = ""; + mapping(address => string) public backstory; + + event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response); + event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error); + + constructor(address gatewayAddress) { + gateway = ICCGateway(gatewayAddress); + } + + function updateSubscriptionId(uint64 _subscriptionId) external { + subscriptionId = _subscriptionId; + } + + function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external { + encryptedSecretsReference = _encryptedSecretsReference; + } + + function request(string calldata characterClass, string calldata characterRace, string calldata characterName, string calldata background) external { + require(subscriptionId != 0, "Subscription ID not set"); + + string[] memory args = new string[](4); + args[0] = characterClass; + args[1] = characterRace; + args[2] = characterName; + args[3] = background; + + bytes[] memory bytesArgs = new bytes[](0); // No bytes arguments for this function + + gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference); + } + + function callback(bytes32 requestId) external override { + ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true); + + if (response.state == ICCGatewayClient.CCGResponseState.Success) { + backstory[msg.sender] = string(response.data); + emit ResponseReceived(response.subscriptionId, requestId, string(response.data)); + } else { + emit ErrorReceived(response.subscriptionId, requestId, string(response.error)); + } + } +} diff --git a/packages/hardhat/contracts/BuyMeACeptor.sol b/packages/hardhat/contracts/BuyMeACeptor.sol new file mode 100644 index 0000000..ba684c6 --- /dev/null +++ b/packages/hardhat/contracts/BuyMeACeptor.sol @@ -0,0 +1,144 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.0 <0.9.0; + +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import "./GamesToken.sol"; + + +/** + * @title World + * @dev World struct + */ +struct World { + string vibe; + string gameMasterName; + string gameMasterTwitterHandle; + string description; + uint256 time; + address gameMasterAddress; +} + +/** + * @title BuyMeACeptorWorld + * @dev BuyMeACeptorWorld contract to accept donations and for our users to create a world for us + */ +contract BuyMeACeptor{ + address payable public owner; + uint256 public price; + World[] public worlds; + + GamesToken public gamesToken; + + error InsufficientFunds(); + error InvalidArguments(string message); + error OnlyOwner(); + + event BuyMeACeptorWorldEvent(address indexed buyer, uint256 price); + event NewWorld(address indexed gameMasterAddress, uint256 time, string vibe, string gameMasterName, string gameMasterTwitterHandle, string description); + + constructor(address _gamesToken) { + owner = payable(msg.sender); + price = 10 * 10**18; // 10 gamesTokens + gamesToken = GamesToken(_gamesToken); + } + + /** + * WRITE FUNCTIONS ************* + */ + + /** + * @dev Function to buy a world + * @param gameMasterName The name of the game master + * @param gameMasterTwitterHandle The Twitter handle of the game master + * @param description The description of the world + * (Note: Using calldata for gas efficiency) + */ + function buyWorld(string calldata vibe, string calldata gameMasterName, string calldata gameMasterTwitterHandle, string calldata description) public payable { + if (msg.value < price) { + revert InsufficientFunds(); + } + + emit BuyMeACeptorWorldEvent(msg.sender, msg.value); + + if (bytes(gameMasterName).length == 0 && bytes(description).length == 0) { + revert InvalidArguments("Invalid gameMasterName or description"); + } + + worlds.push(World(vibe, gameMasterName, gameMasterTwitterHandle, description, block.timestamp, msg.sender)); + + emit NewWorld(msg.sender, block.timestamp, vibe, gameMasterName, gameMasterTwitterHandle, description); + } + + /** + * @dev Function to remove a world + * @param index The index of the world + */ + function removeWorld(uint256 index) public { + if (index >= worlds.length) { + revert InvalidArguments("Invalid index"); + } + + World memory world = worlds[index]; + + // if operation isnt sent from the same game master or the owner, then not allowed + if (world.gameMasterAddress != msg.sender && msg.sender != owner) { + revert InvalidArguments("Operation not allowed"); + } + + World memory indexWorld = worlds[index]; + worlds[index] = worlds[worlds.length - 1]; + worlds[worlds.length - 1] = indexWorld; + worlds.pop(); + } + + /** + * @dev Function to modify a world description + * @param index The index of the world + * @param description The description of the world + */ + function modifyWorldDescription(uint256 index, string memory description) public { + if (index >= worlds.length) { + revert InvalidArguments("Invalid index"); + } + + World memory world = worlds[index]; + + if (world.gameMasterAddress != msg.sender || msg.sender != owner) { + revert InvalidArguments("Operation not allowed"); + } + + worlds[index].description = description; + } + + /** + * @dev Function to withdraw the balance + */ + function withdrawTips() public { + if (msg.sender != owner) { + revert OnlyOwner(); + } + + if (address(this).balance == 0) { + revert InsufficientFunds(); + } + + (bool sent,) = owner.call{value: address(this).balance}(""); + require(sent, "Failed to send Ether"); + } + + /** + * READ FUNCTIONS ************* + */ + + /** + * @dev Function to get the worlds + */ + function getWorlds() public view returns (World[] memory) { + return worlds; + } + + /** + * @dev Recieve function to accept ether + */ + receive() external payable {} +} diff --git a/packages/hardhat/contracts/BuyMeACoffee.sol b/packages/hardhat/contracts/BuyMeACoffee.sol deleted file mode 100644 index 2e09998..0000000 --- a/packages/hardhat/contracts/BuyMeACoffee.sol +++ /dev/null @@ -1,156 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >=0.8.0 <0.9.0; -/** - * ---------------------------------------------------------------------------------------------------------------- - * ---------β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—----- - * ---------β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘----- - * ---------β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘----- - * ---------β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β•šβ•β•β•β•β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘----- - * ---------β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘----- - * ---------β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β• β•šβ•β•β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β• β•šβ•β• β•šβ•β•β•β• β•šβ•β•β•β•β•β•β•šβ•β• β•šβ•β•β•šβ•β• β•šβ•β•β•šβ•β•β•šβ•β• β•šβ•β•β•β•----- - * ---------------------------------------------------------------------------------------------------------------- - * https://github.com/coinbase/build-onchain-apps - * - * Disclaimer: The provided Solidity contracts are intended solely for educational purposes and are - * not warranted for any specific use. They have not been audited and may contain vulnerabilities, hence should - * not be deployed in production environments. Users are advised to seek professional review and conduct a - * comprehensive security audit before any real-world application to mitigate risks of financial loss or other - * consequences. The author(s) disclaim all liability for any damages arising from the use of these contracts. - * Use at your own risk, acknowledging the inherent risks of smart contract technology on the blockchain. - * - */ - -/** - * @title Memos - * @dev Memo struct - */ -struct Memo { - uint numCoffees; - string userName; - string twitterHandle; - string message; - uint256 time; - address userAddress; -} - -/** - * @title BuyMeACoffee - * @dev BuyMeACoffee contract to accept donations and for our users to leave a memo for us - */ -contract BuyMeACoffee { - address payable public owner; - uint256 public price; - Memo[] public memos; - - error InsufficientFunds(); - error InvalidArguments(string message); - error OnlyOwner(); - - event BuyMeACoffeeEvent(address indexed buyer, uint256 price); - event NewMemo(address indexed userAddress, uint256 time, uint numCoffees, string userName, string twitterHandle, string message); - - constructor() { - owner = payable(msg.sender); - price = 0.0001 ether; - } - - /** - * WRITE FUNCTIONS ************* - */ - - /** - * @dev Function to buy a coffee - * @param userName The name of the user - * @param twitterHandle The Twitter handle of the user - * @param message The message of the user - * (Note: Using calldata for gas efficiency) - */ - function buyCoffee(uint numCoffees, string calldata userName, string calldata twitterHandle, string calldata message) public payable { - if (msg.value < price*numCoffees) { - revert InsufficientFunds(); - } - - emit BuyMeACoffeeEvent(msg.sender, msg.value); - - if (bytes(userName).length == 0 && bytes(message).length == 0) { - revert InvalidArguments("Invalid userName or message"); - } - - memos.push(Memo(numCoffees, userName, twitterHandle, message, block.timestamp, msg.sender)); - - emit NewMemo(msg.sender, block.timestamp, numCoffees, userName, twitterHandle, message); - } - - /** - * @dev Function to remove a memo - * @param index The index of the memo - */ - function removeMemo(uint256 index) public { - if (index >= memos.length) { - revert InvalidArguments("Invalid index"); - } - - Memo memory memo = memos[index]; - - // if operation isnt sent from the same user or the owner, then not allowed - if (memo.userAddress != msg.sender && msg.sender != owner) { - revert InvalidArguments("Operation not allowed"); - } - - Memo memory indexMemo = memos[index]; - memos[index] = memos[memos.length - 1]; - memos[memos.length - 1] = indexMemo; - memos.pop(); - } - - /** - * @dev Function to modify a memo - * @param index The index of the memo - * @param message The message of the memo - */ - function modifyMemoMessage(uint256 index, string memory message) public { - if (index >= memos.length) { - revert InvalidArguments("Invalid index"); - } - - Memo memory memo = memos[index]; - - if (memo.userAddress != msg.sender || msg.sender != owner) { - revert InvalidArguments("Operation not allowed"); - } - - memos[index].message = message; - } - - /** - * @dev Function to withdraw the balance - */ - function withdrawTips() public { - if (msg.sender != owner) { - revert OnlyOwner(); - } - - if (address(this).balance == 0) { - revert InsufficientFunds(); - } - - (bool sent,) = owner.call{value: address(this).balance}(""); - require(sent, "Failed to send Ether"); - } - - /** - * READ FUNCTIONS ************* - */ - - /** - * @dev Function to get the memos - */ - function getMemos() public view returns (Memo[] memory) { - return memos; - } - - /** - * @dev Recieve function to accept ether - */ - receive() external payable {} -} diff --git a/packages/hardhat/contracts/CCGateway.sol b/packages/hardhat/contracts/CCGateway.sol new file mode 100644 index 0000000..cfa11e6 --- /dev/null +++ b/packages/hardhat/contracts/CCGateway.sol @@ -0,0 +1,161 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import './interfaces/ICCGateway.sol'; +import {ICCGatewayClient} from './interfaces/ICCGatewayClient.sol'; + +import {FunctionsClient} from "@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol"; +import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol"; +import {FunctionsRequest} from "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol"; + +contract CCGateway is ICCGateway, FunctionsClient, AccessControl { + using FunctionsRequest for FunctionsRequest.Request; + + bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE"); + bytes32 public constant CLIENT_ROLE = keccak256("CLIENT_ROLE"); + bytes32 private _donId; // DON ID for the Functions DON to which the requests are sent + + mapping(uint64 subscriptionId => CCGRequest) private _requests; // Each subscription can only handle one kind of request + mapping(bytes32 requestId => ICCGatewayClient.CCGResponse) private unprocessed_responses; // Responses that have not been processed yet + + // array of registered subscriptions + uint64[] public subscriptions; + + constructor(address router, bytes32 initialDonId, address initialOwner) FunctionsClient(router) { + _donId = initialDonId; + + address to = address(0) == initialOwner ? _msgSender() : initialOwner; + _grantRole(DEFAULT_ADMIN_ROLE, to); + _grantRole(MANAGER_ROLE, to); + } + + /** + * @dev Set the DON ID + * @param newDonId New DON ID + */ + function setDonId(bytes32 newDonId) external onlyRole(getRoleAdmin(MANAGER_ROLE)) { + _donId = newDonId; + } + + /** + * @dev Get the DON ID + * @return DON ID + */ + function donId() external view returns (bytes32) { + return _donId; + } + + function registerRequest( + uint64 subscriptionId, + FunctionsRequest.Location codeLocation, + string calldata source, + FunctionsRequest.Location secretsLocation, + bytes calldata encryptedSecretsReference, + uint32 callbackGasLimit, + string calldata name + ) external onlyManager { + if (bytes(name).length == 0) {revert CCGRequestNameEmpty();} + + CCGRequest storage req = _requests[subscriptionId]; + if(bytes(req.name).length == 0) {subscriptions.push(subscriptionId);} + + req.name = name; + req.callbackGasLimit = callbackGasLimit; + + // Only JavaScript is supported for now + req.config.language = FunctionsRequest.CodeLanguage.JavaScript; + req.config.codeLocation = codeLocation; + req.config.source = source; + req.config.secretsLocation = secretsLocation; + req.config.encryptedSecretsReference = encryptedSecretsReference; + } + + function removeRequest(uint64 subscriptionId) external onlyManager { + if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);} + delete _requests[subscriptionId]; + + // Find the index of the subscriptionId in the subscriptions array + uint256 index = subscriptions.length; + for (uint256 i = 0; i < subscriptions.length; i++) { + if (index == subscriptions.length && subscriptions[i] == subscriptionId) index = i; + if (index != subscriptions.length && i + 1 < subscriptions.length) subscriptions[i] = subscriptions[i + 1]; + } + + subscriptions.pop(); + } + + function getRequest(uint64 subscriptionId) external view returns (CCGRequest memory) { + if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);} + return _requests[subscriptionId]; + } +// --------------------------------------------------------------------------------------------------------------------- + modifier onlySource(bytes32 requestId) { + if (unprocessed_responses[requestId].source != _msgSender()) {revert CCGOnlySameSourceAllowed(requestId);} + _; + } + + modifier onlyManager() { + if (!hasRole(MANAGER_ROLE, tx.origin)) {revert CCGOnlyManagerAllowed();} + _; + } +// --------------------------------------------------------------------------------------------------------------------- + /** + * @notice Triggers an on-demand Functions request using remote encrypted secrets + * @param subscriptionId Subscription ID used to pay for request (FunctionsConsumer contract address must first be added to the subscription) + * @param args String arguments passed into the source code and accessible via the global variable `args` + * @param bytesArgs Bytes arguments passed into the source code and accessible via the global variable `bytesArgs` as hex strings + * @param encryptedSecretsReference Reference pointing to encrypted secrets + */ + function sendRequest( + uint64 subscriptionId, + string[] calldata args, + bytes[] calldata bytesArgs, + bytes calldata encryptedSecretsReference + ) external onlyRole(CLIENT_ROLE) returns (bytes32 requestId) { + CCGRequest storage request = _requests[subscriptionId]; + if (bytes(request.name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);} + + FunctionsRequest.Request memory req = request.config; + req.initializeRequest(req.codeLocation, FunctionsRequest.CodeLanguage.JavaScript, req.source); + if (encryptedSecretsReference.length > 0) {req.encryptedSecretsReference = encryptedSecretsReference;} + + if (args.length > 0) { + req.setArgs(args); + } + if (bytesArgs.length > 0) { + req.setBytesArgs(bytesArgs); + } + + requestId = _sendRequest(req.encodeCBOR(), subscriptionId, request.callbackGasLimit, _donId); + unprocessed_responses[requestId].state = ICCGatewayClient.CCGResponseState.Sent; + unprocessed_responses[requestId].source = _msgSender(); + } + + /** + * @notice Store latest result/error + * @param requestId The request ID, returned by sendRequest() + * @param response Aggregated response from the user code + * @param err Aggregated error from the user code or from the execution pipeline + * Either response or error parameter will be set, but never both + */ + function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal override { + ICCGatewayClient.CCGResponse storage resp = unprocessed_responses[requestId]; + if (resp.state != ICCGatewayClient.CCGResponseState.Sent) {revert CCGRequestAlreadyFulfilled(requestId);} + + unprocessed_responses[requestId].state = err.length > 0 ? ICCGatewayClient.CCGResponseState.Error : ICCGatewayClient.CCGResponseState.Success; + unprocessed_responses[requestId].data = response; + unprocessed_responses[requestId].error = err; + + ICCGatewayClient(resp.source).callback(requestId); + } + + /** + * @dev Get the response data + * @param requestId The request ID, returned by sendRequest() + * @return response CCGResponse + */ + function getResponse(bytes32 requestId, bool remove) external onlySource(requestId) returns (ICCGatewayClient.CCGResponse memory response) { + response = unprocessed_responses[requestId]; + if (remove) {delete unprocessed_responses[requestId];} + } +} \ No newline at end of file diff --git a/packages/hardhat/contracts/CCNotificationClient.sol b/packages/hardhat/contracts/CCNotificationClient.sol new file mode 100644 index 0000000..1fc3e5c --- /dev/null +++ b/packages/hardhat/contracts/CCNotificationClient.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.0; + +import {CCExampleClient} from "./CCExampleClient.sol"; + +contract CCNotificationClient is CCExampleClient { + constructor(address gatewayAddress) CCExampleClient(gatewayAddress) {} +} diff --git a/packages/hardhat/contracts/Characters/Backgrounds.sol b/packages/hardhat/contracts/Characters/Backgrounds.sol new file mode 100644 index 0000000..2582793 --- /dev/null +++ b/packages/hardhat/contracts/Characters/Backgrounds.sol @@ -0,0 +1,42 @@ +/* experimental smart contract by Tippi Fifestarr for Ceptor Games +/ simply provide an on-chain querable array of public domain random backstory +/ other smart contracts can import this or an interface of it to get a backstory +/ if that contract has a source verifiable of randomness, thats very cool +/ Ideally, this can be upgraded to request a functions call from the Gateway +*/ + +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +contract Backgrounds { + mapping(address => string) public backstory; + + // note: backstory are as random as you make them + // the alphabetical list of d&d 5e srd backgrounds + string[15] public backgrounds = [ + "Acolyte", + "Ceptor", + "Charlatan", + "Criminal", + "Entertainer", + "Folk Hero", + "Guild Artisan", + "Hermit", + "Noble", + "Outlander", + "Sage", + "Sailor", + "Soldier", + "Urchin", + "Vampire" + ]; + + function backgroundsLength() public view returns (uint256) { + return backgrounds.length; + } + + function setBackstory(string memory _backstory) public { + backstory[msg.sender] = _backstory; + } + +} diff --git a/packages/hardhat/contracts/Characters/CharacterGen.sol b/packages/hardhat/contracts/Characters/CharacterGen.sol new file mode 100644 index 0000000..8fde00f --- /dev/null +++ b/packages/hardhat/contracts/Characters/CharacterGen.sol @@ -0,0 +1,244 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; +// In the game of D&D, creating a new character can be a lot of fun, or take ages and prevent you from playing +// This contract is a simple example of how you can use Chainlink VRF to generate a random character +// A character has 6 ability scores, a class, a name, an alignment, and a background +// Also, there are Traits, Ideals, Bonds, and Flaws, but we'll keep it simple for now +// The character's name, class and background are chosen from on-chain arrays of strings in other contracts +// The ability scores are generated from a single random number using a bitshift and modulo +// Rule Zero in D&D allows the GM to modify rules to enhance gameplay. +// Gamemasters can change the default amount of rerolls using the more forgiving 4d6 reroll function +import {IVRFCoordinatorV2Plus} from "@chainlink/contracts/src/v0.8/vrf/dev/interfaces/IVRFCoordinatorV2Plus.sol"; +import {VRFConsumerBaseV2Plus} from "@chainlink/contracts/src/v0.8/vrf/dev/VRFConsumerBaseV2Plus.sol"; +import {VRFV2PlusClient} from "@chainlink/contracts/src/v0.8/vrf/dev/libraries/VRFV2PlusClient.sol"; +import {Names} from "./Names.sol"; +import {Backgrounds} from "./Backgrounds.sol"; +import {Classes} from "./Classes.sol"; +// import {BackstoryGenerator} from "./BackstoryGenerator.sol"; +import {BackstoryFunctionClient} from "../BackstoryFunctionClient.sol"; + +/* +In TTRPGs, Rule Zero grants the Game Master (GM) the authority to modify rules to enhance gameplay and maintain balance, ensuring that all players have an enjoyable experience. This principle can be applied to smart contracts in decentralized gaming, where flexibility is key to adapting to unforeseen scenarios and maintaining fairness. Just as a GM might adjust the difficulty of encounters or allow rerolls to prevent a total party kill, a smart contract can include mechanisms for modifying certain parameters, such as reroll limits, to keep the game balanced and engaging. This flexibility ensures that the gaming experience remains fun and fair, adhering to the spirit of Rule Zero. +*/ +contract CharacterGen is VRFConsumerBaseV2Plus { + IVRFCoordinatorV2Plus COORDINATOR; + BackstoryFunctionClient public backstoryFunctionClient; + Names public namesContract; + Backgrounds public backgroundsContract; + Classes public classesContract; + address public gameMaster; // Address of the game master (contract deployer) + + // Modifier to restrict function access to only the game master (aka deployer) + modifier onlyGameMaster() { + require(msg.sender == gameMaster, "Only the game master can perform this action"); + _; + } + + uint256 s_subscriptionId = 21065254117722076320750141452575268873113382931160444158709360180731175497445; + bytes32 keyHash = 0x787d74caea10b2b357790d5b5247c2f63d1d91572a9846f780606e4d953677ae; + uint32 callbackGasLimit = 135000; + uint16 requestConfirmations = 3; + uint32 numWords = 2; // Number of random words requested from VRF + + // On deployment, set the reroll limit to 1 by default + uint8 public rerollLimit = 1; + + // Define the structure for a Character + struct Character { + uint256 randomWord; // Randomness generated by VRF + uint256 randomWord2; // Randomness generated by VRF + uint256[6] abilities; // Array to hold ability scores + string class; // Class of the character + string playerName; // Name of the player + string name; // Name of the character + string alignment; // Alignment of the character + string background; // Background story of the character + uint8 swaps; // Number of times the player has swapped ability scores + uint8 rerolls; // Number of rerolls available for ability scores + bool isAlive; // Whether the character is alive or not + } + + // Mappings to store character and request data + mapping(uint256 => address) public requestToSender; // Maps requestId to the sender's address + mapping(address => Character) public characters; // Maps player's address to their character + + // Define events to log significant actions + event CharacterCreated(address indexed owner, uint256 requestId); + event CharacterUpdated(address indexed owner, string alignment, string background, string _class, string name); + event ScoresSwapped(address indexed owner); + event RequestFulfilled(uint256 requestId, uint256[] randomWords); + event RandomWordsSaved(address indexed owner); + event infoContractsSet(address namesContract, address backgroundsContract, address classesContract); + + // Constructor to initialize the contract with VRF coordinator address + constructor() VRFConsumerBaseV2Plus(0x9DdfaCa8183c41ad55329BdeeD9F6A8d53168B1B) { + COORDINATOR = IVRFCoordinatorV2Plus(0x9DdfaCa8183c41ad55329BdeeD9F6A8d53168B1B); + gameMaster = msg.sender; + } + + function setBackstoryFunctionClient(address _backstoryFunctionClient) external onlyOwner() { + backstoryFunctionClient = BackstoryFunctionClient(_backstoryFunctionClient); + } + // Function to set the addresses of the info contracts + function setRandomContracts(address _namesContract, address _backgroundsContract, address _classesContract) external { + namesContract = Names(_namesContract); + backgroundsContract = Backgrounds(_backgroundsContract); + classesContract = Classes(_classesContract); + emit infoContractsSet(_namesContract, _backgroundsContract, _classesContract); + } + + // Function to create a character by requesting random words from the VRF + function createCharacter(string calldata playerName) external { + require(characters[msg.sender].randomWord == 0, "Character already created, use finalizeCharacterDetails"); + + // Request random words from the VRF coordinator + uint256 requestId = COORDINATOR.requestRandomWords( + VRFV2PlusClient.RandomWordsRequest({ + keyHash: keyHash, + subId: s_subscriptionId, + requestConfirmations: requestConfirmations, + callbackGasLimit: callbackGasLimit, + numWords: numWords, + extraArgs: VRFV2PlusClient._argsToBytes( + VRFV2PlusClient.ExtraArgsV1({nativePayment: false}) + ) + }) + ); + + // Store the player's name and map the requestId to the sender + characters[msg.sender].playerName = playerName; + characters[msg.sender].isAlive = true; + characters[msg.sender].rerolls = rerollLimit; + requestToSender[requestId] = msg.sender; + + emit CharacterCreated(msg.sender, requestId); + } + + // Callback function to handle the VRF response and save the random words + function fulfillRandomWords(uint256 requestId, uint256[] calldata randomWords) internal override { + address owner = requestToSender[requestId]; + require(characters[owner].randomWord == 0, "Random words already fulfilled"); + + // Save the random words in the character struct + characters[owner].randomWord = randomWords[0]; + characters[owner].randomWord2 = randomWords[1]; + + emit RequestFulfilled(requestId, randomWords); + emit RandomWordsSaved(owner); + } + + // Function to finalize the character details using the saved random words + function finalizeCharacterDetails(string calldata alignment) external { + require(characters[msg.sender].randomWord != 0, "Random words not fulfilled"); + + uint256 randomWord = characters[msg.sender].randomWord; + uint256 randomWord2 = characters[msg.sender].randomWord2; + + // Generate ability scores from the random word + for (uint i = 0; i < 6; ++i) { + uint256 chunk = (randomWord >> (i * 32)) & 0xFFFFFFFF; // Extract 32-bit chunks + characters[msg.sender].abilities[i] = (chunk % 16) + 3; // Score range: 3-18 + } + + // Use random words to generate character name and background + + uint256 randomNumber = randomWord % 20; + characters[msg.sender].name = namesContract.names(randomNumber); + characters[msg.sender].alignment = alignment; + randomNumber = randomWord2 % 15; + characters[msg.sender].background = getBackground(randomNumber); + + randomNumber = (randomWord2 >> 32) % 13; + characters[msg.sender].class = getClass(randomNumber); + // fetch with class, race, name, background + string memory characterClass = characters[msg.sender].class; + string memory characterName = characters[msg.sender].name; + string memory characterBackground = characters[msg.sender].background; + fetchBackstory(characterClass, "Dragonborn", characterName, characterBackground); + emit CharacterUpdated(msg.sender, alignment, characters[msg.sender].background, characters[msg.sender].class, characters[msg.sender].name); + + } + + // Function to allow the game master to update character details + function gameMasterUpdateCharacter(address player, string calldata name, string calldata alignment, string calldata background, string calldata _class) external onlyGameMaster { + require(characters[player].randomWord != 0, "Random words not fulfilled, that player needs to be created first"); + + // Update character name, alignment, class, and background if provided + if (bytes(name).length > 0) { + characters[player].name = name; + } + if (bytes(alignment).length > 0) { + characters[player].alignment = alignment; + } + if (bytes(background).length > 0) { + characters[player].background = background; + } + if (bytes(_class).length > 0) { + characters[player].class = _class; + } + + emit CharacterUpdated(player, alignment, background, _class, name); + } + + + // Function to allow players to swap ability scores + function swapScores(uint8 index1, uint8 index2) external { + + require(characters[msg.sender].swaps < 2, "Max swaps reached"); + require(index1 < 6 && index2 < 6, "Invalid index"); + require(index1 != index2, "Cannot swap with the same index"); + require(characters[msg.sender].abilities[index1] != 0 && characters[msg.sender].abilities[index2] != 0, "invalid character, try creating one"); + // Swap the ability scores at the specified indices + (characters[msg.sender].abilities[index1], characters[msg.sender].abilities[index2]) = + (characters[msg.sender].abilities[index2], characters[msg.sender].abilities[index1]); + + characters[msg.sender].swaps++; + emit ScoresSwapped(msg.sender); + } + + // Function to get the class of the character based on a random number + function getClass(uint256 randomNumber) private view returns (string memory) { + return classesContract.classes(randomNumber % classesContract.classesLength()); + + } + + function getBackground(uint256 randomNumber) private view returns (string memory) { + return backgroundsContract.backgrounds(randomNumber % backgroundsContract.backgroundsLength()); + } + + function getName(uint256 randomNumber) private view returns (string memory) { + return namesContract.names(randomNumber % namesContract.namesLength()); + } + + function setRerollLimit(uint8 limit) external onlyGameMaster { + rerollLimit = limit; + } + + // Function to simulate rolling 4d6 and dropping the lowest die, using Chainlink VRF for randomness +function roll4d6(uint256 randomValue) internal pure returns (uint256) { + uint256[] memory rolls = new uint256[](4); + for (uint256 i = 0; i < 4; i++) { + // Each d6 roll + rolls[i] = (randomValue % 6) + 1; + randomValue >>= 3; // Shift right to get new bits for next roll + } + // Sort the rolls to find the smallest + for (uint256 i = 1; i < 4; i++) { + for (uint256 j = 0; j < i; j++) { + if (rolls[i] < rolls[j]) { + (rolls[i], rolls[j]) = (rolls[j], rolls[i]); + } + } + } + // Sum the highest three rolls + return rolls[1] + rolls[2] + rolls[3]; +} + + function fetchBackstory(string memory characterClass, string memory characterRace, string memory characterName, string memory background) internal { + backstoryFunctionClient.request(characterClass, characterRace, characterName, background); + } + // Function to retrieve the ability scores of a character + function getCharacterAbilities(address owner) external view returns (uint256[6] memory) { + return characters[owner].abilities; + } +} \ No newline at end of file diff --git a/packages/hardhat/contracts/Characters/Classes.sol b/packages/hardhat/contracts/Characters/Classes.sol new file mode 100644 index 0000000..52ea3a9 --- /dev/null +++ b/packages/hardhat/contracts/Characters/Classes.sol @@ -0,0 +1,34 @@ +/* Experimental smart contract by Tippi Fifestarr for Ceptor Games +/ This contract provides an on-chain queryable array of D&D character classes +/ Other smart contracts can import this or an interface of it to get a class +/ If that contract has a source verifiable of randomness, that's even better +*/ + +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +contract Classes { + + // Note: Classes are as random as you make them + // The list of D&D 5e SRD classes + string[13] public classes = [ + "Barbarian", + "Bard", + "Cleric", + "Druid", + "Fighter", + "Monk", + "Paladin", + "Ranger", + "Rogue", + "Sorcerer", + "Warlock", + "Wizard", + "Ceptor" + ]; + + function classesLength() public view returns (uint256) { + return classes.length; + } + +} \ No newline at end of file diff --git a/packages/hardhat/contracts/Characters/Names.sol b/packages/hardhat/contracts/Characters/Names.sol new file mode 100644 index 0000000..302655a --- /dev/null +++ b/packages/hardhat/contracts/Characters/Names.sol @@ -0,0 +1,40 @@ +/* experimental smart contract by Tippi Fifestarr for Ceptor Games +/ simply provide an on-chain querable array of public domain character names +/ other smart contracts can import this or an interface of it to get a name +/ if that contract has a source verifiable of randomness, thats cool +*/ + +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +contract Names { + + // note: names are as random as you make them + // the alphabetical list + string[20] public names = [ + "Aladdin", + "Alice", + "Arthur", + "Davy", + "Dracula", + "Felix", + "Frankie", + "Hercules", + "Jack", + "James", + "Kong", + "Lupin", + "Merlin", + "Nyarlathotep", + "Nemo", + "Oswald", + "Red", + "Sandman", + "Sherlock", + "Winnie" + ]; + + function namesLength() public view returns (uint256) { + return names.length; + } +} diff --git a/packages/hardhat/contracts/Characters/random character auction.png b/packages/hardhat/contracts/Characters/random character auction.png new file mode 100644 index 0000000..9855d5f Binary files /dev/null and b/packages/hardhat/contracts/Characters/random character auction.png differ diff --git a/packages/hardhat/contracts/GamesDAOv3.sol b/packages/hardhat/contracts/GamesDAOv3.sol new file mode 100644 index 0000000..f132546 --- /dev/null +++ b/packages/hardhat/contracts/GamesDAOv3.sol @@ -0,0 +1,273 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +// Games Token deployed on Polygon Amoy + +import "@chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol"; +import "@openzeppelin/contracts/access/AccessControl.sol"; + +/** + * @title GamesDAO + * @dev Manages the minting and pricing of GamesToken based on Chainlink price feeds. + * Allows for gamemaster proposals on token pricing, updating a catchphrase, decentralized withdrawl, players and gamemasters voting. + * Chainlink Block Magic Hackathon for Ceptor Games Team by Tippi Fifestarr. + */ +interface TokenInterface { + function mint(address account, uint256 amount) external; +} + +contract GamesDAOv3 is AccessControl { + AggregatorV3Interface internal priceFeed; + TokenInterface public minter; + uint256 public gamesTokenPriceInCents = 2; // 1 token = 0.02 USD + address public immutable owner; + string public greeting = "Hooty, world!"; + + bytes32 public constant GAMEMASTER_ROLE = keccak256("GAMEMASTER_ROLE"); + bytes32 public constant PLAYER_ROLE = keccak256("PLAYER_ROLE"); + uint256 public constant TOKEN_DECIMAL_MULTIPLIER = 10 ** 18; + // mapping(address => bool) public allowedPlayers; // using the oz access control roles instead + + enum ProposalType {CHANGE_PRICE, SEND_FUNDS, UPDATE_CATCHPHRASE} + +struct Proposal { + ProposalType proposalType; + string catchphrase; + uint256 newPrice; + uint256 amount; + address to; + uint256 votesFor; + uint256 votesAgainst; + uint256 deadline; + bool executed; + mapping(address => bool) voters; +} + + struct Player { + string catchphrase; + } + + struct Gamemaster { + string catchphrase; + string stylePrompt; + } + + mapping(address => Player) public players; + mapping(address => Gamemaster) public gamemasters; + Proposal public proposal; + + event PlayerAllowed(address indexed player); + event GamemasterAdded(address indexed gamemaster); + event ProposalCreated(uint256 newPrice, uint256 amount, address to, string catchphrase, uint256 deadline, ProposalType proposalType); + event Voted(address indexed voter, bool voteFor); + event ProposalExecuted(uint256 newPrice, uint256 amount, address to, string catchphrase, ProposalType proposalType); + event PlayerCatchphraseUpdated(address indexed player, string catchphrase); + event GamemasterCatchphraseUpdated(address indexed gamemaster, string catchphrase); + event GamemasterStylePromptUpdated(address indexed gamemaster, string stylePrompt); + + /** + * @dev Sets the owner, roles and initializes the MATIC/USD price feed on the Polygon Amoy Testnet. + */ + constructor() { + priceFeed = AggregatorV3Interface(0x001382149eBa3441043c1c66972b4772963f5D43); + owner = msg.sender; + _grantRole(DEFAULT_ADMIN_ROLE, owner); + _grantRole(GAMEMASTER_ROLE, owner); + _grantRole(PLAYER_ROLE, owner); + } + + /** + * @dev Ensures only the owner can call the modified function. + */ + modifier onlyOwner() { + require(msg.sender == owner, "Only owner can call this function"); + _; + } + + /** + * @dev Ensures only allowed players or gamemasters can call the modified function. + */ + modifier onlyAllowed() { + require( + hasRole(PLAYER_ROLE, msg.sender) || hasRole(GAMEMASTER_ROLE, msg.sender), + "Not allowed" + ); + _; + } + + /** + * @notice Sets the token contract address for minting. + * @param tokenAddress The address of the token contract. + */ + function setTokenAddress(address tokenAddress) external onlyOwner { + minter = TokenInterface(tokenAddress); + } + + /** + * @notice Retrieves the latest price of MATIC in USD from the Chainlink data feed. + * @return price The latest MATIC price in USD. + */ + function getChainlinkDataFeedLatestAnswer() public view returns (int) { + (, int price,,,) = priceFeed.latestRoundData(); + return price; // example returned amount 69050000 = $0.69 USD for 1 Matic + } + + /** + * @notice Calculates the amount of MATIC required to buy one GamesToken. + * @return gamesTokenPriceInWei The amount of MATIC (18 decimals) needed for one GamesToken. + */ + function getMATICForOneGT() public view returns (uint256) { + int price = getChainlinkDataFeedLatestAnswer(); // value of 1 MATIC (1 ) is 0.69 USD (8 decimals) = 69050000 + + // Convert the price to uint256 + uint256 priceInCents = uint256(price) / 10**6; // Convert from 8 decimals to cents (e.g., 69050000 -> 69) + + // Calculate the amount of MATIC needed for one GamesToken in wei + uint256 gamesTokenPriceWei = (gamesTokenPriceInCents * 10**18) / priceInCents; + + return gamesTokenPriceWei; +} + + /** + * @notice Calculates the total MATIC required for a given number of GamesTokens. + * @param numberOfGTs The number of GamesTokens to buy. + * @return howMuchMatic The total amount of MATIC needed for the specified number of GamesTokens. + */ + function getMATICForGTs(uint256 numberOfGTs) public view returns (uint256) { + return getMATICForOneGT() * numberOfGTs; + } + + /** + * @notice Allows players to buy a specified number of GamesTokens. + * @param numberOfGTs The number of GamesTokens to buy. + */ + function buyAmountTokens(uint256 numberOfGTs) public payable onlyAllowed { + uint256 requiredMATIC = getMATICForGTs(numberOfGTs); + require(msg.value >= requiredMATIC, "Insufficient MATIC sent"); + minter.mint(msg.sender, numberOfGTs * TOKEN_DECIMAL_MULTIPLIER); + } + + /** + * @notice Allows players to buy GamesTokens based on the amount of MATIC sent. + */ + function buyTokens() public payable onlyAllowed { + require(msg.value > 0, "No MATIC sent"); + uint256 numberOfGTs = (msg.value) / getMATICForOneGT(); + minter.mint(msg.sender, numberOfGTs * TOKEN_DECIMAL_MULTIPLIER); + } + + /** + * @notice Allows the owner to withdraw the contract balance. + */ + function withdraw() external onlyOwner { + payable(owner).transfer(address(this).balance); + } + + /** + * @notice Allows the owner to permit a player to participate. + * @param player The address of the player to be allowed. + */ +function allowPlayer(address player) external onlyOwner { + grantRole(PLAYER_ROLE, player); + emit PlayerAllowed(player); +} + + /** + * @notice Allows the owner to designate a gamemaster. + * @param gamemaster The address of the gamemaster to be added. + */ + function addGamemaster(address gamemaster) external onlyOwner { + grantRole(GAMEMASTER_ROLE, gamemaster); + emit GamemasterAdded(gamemaster); + } + + /** + * @notice Creates a proposal for various actions like changing token price, updating catchphrase, or sending funds. + * @param proposalType The type of proposal. + * @param newPrice The new price for the token in cents (for CHANGE_PRICE). + * @param amount The amount of funds to send (for SEND_FUNDS). + * @param catchphrase The new catchphrase (for UPDATE_CATCHPHRASE). + */ +function createProposal(ProposalType proposalType, uint256 newPrice, uint256 amount, address to, string calldata catchphrase) external onlyAllowed { + require(proposal.deadline == 0 || block.timestamp > proposal.deadline, "Previous proposal still active"); + + proposal.proposalType = proposalType; + proposal.newPrice = newPrice; + proposal.amount = amount; + proposal.to = to; + proposal.catchphrase = catchphrase; + proposal.votesFor = 0; + proposal.votesAgainst = 0; + proposal.deadline = block.timestamp + 1 hours; + proposal.executed = false; + + emit ProposalCreated(newPrice, amount, to, catchphrase, proposal.deadline, proposalType); + +} + + /** + * @notice Allows allowed users to vote on the active proposal. + * @param voteFor True to vote in favor, false to vote against. + */ + function vote(bool voteFor) external onlyAllowed { + require(block.timestamp <= proposal.deadline, "Voting period has ended"); + require(!proposal.voters[msg.sender], "Already voted"); + proposal.voters[msg.sender] = true; + if (voteFor) { + proposal.votesFor += 1; + } else { + proposal.votesAgainst += 1; + } + emit Voted(msg.sender, voteFor); + } + + /** + * @notice Executes the proposal if voting is complete and conditions are met. + */ +function executeProposal() external onlyAllowed { + require(block.timestamp > proposal.deadline, "Voting period not ended yet"); + require(!proposal.executed, "Proposal already executed"); + require(proposal.votesFor > proposal.votesAgainst, "Proposal not approved"); + + if (proposal.proposalType == ProposalType.CHANGE_PRICE) { + gamesTokenPriceInCents = proposal.newPrice; + } else if (proposal.proposalType == ProposalType.SEND_FUNDS) { + require(address(this).balance >= proposal.amount, "Insufficient balance"); + payable(proposal.to).transfer(proposal.amount); + } else if (proposal.proposalType == ProposalType.UPDATE_CATCHPHRASE) { + greeting = proposal.catchphrase; + } + + proposal.executed = true; + proposal.deadline = 0; + + emit ProposalExecuted(proposal.newPrice, proposal.amount, proposal.to, proposal.catchphrase, proposal.proposalType); +} + +/** + * @notice Allows a player to update their catchphrase. + * @param catchphrase The new catchphrase for the player. + */ + function updatePlayerCatchphrase(string calldata catchphrase) external onlyRole(PLAYER_ROLE) { + players[msg.sender].catchphrase = catchphrase; + emit PlayerCatchphraseUpdated(msg.sender, catchphrase); + } + +/** + * @notice Allows a gamemaster to update their catchphrase. + * @param catchphrase The new catchphrase for the gamemaster. + */ + function updateGamemasterCatchphrase(string calldata catchphrase) external onlyRole(GAMEMASTER_ROLE) { + gamemasters[msg.sender].catchphrase = catchphrase; + emit GamemasterCatchphraseUpdated(msg.sender, catchphrase); + } + +/** + * @notice Allows a gamemaster to update their style prompt. + * @param stylePrompt The new style prompt for the gamemaster. + */ + function updateGamemasterStylePrompt(string calldata stylePrompt) external onlyRole(GAMEMASTER_ROLE) { + gamemasters[msg.sender].stylePrompt = stylePrompt; + emit GamemasterStylePromptUpdated(msg.sender, stylePrompt); + } +} \ No newline at end of file diff --git a/packages/hardhat/contracts/GamesToken.sol b/packages/hardhat/contracts/GamesToken.sol new file mode 100644 index 0000000..ef6283a --- /dev/null +++ b/packages/hardhat/contracts/GamesToken.sol @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import "@openzeppelin/contracts/access/AccessControl.sol"; + +contract GamesToken is ERC20, AccessControl { + bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); + + constructor() ERC20("GamesToken", "GT") { + _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); + _grantRole(MINTER_ROLE, msg.sender); + } + + function mint(address to, uint256 amount) public onlyRole(MINTER_ROLE) { + _mint(to, amount); + } + + function addMinter(address minter) public onlyRole(DEFAULT_ADMIN_ROLE) { + _grantRole(MINTER_ROLE, minter); + } + + function removeMinter(address minter) public onlyRole(DEFAULT_ADMIN_ROLE) { + _revokeRole(MINTER_ROLE, minter); + } + + function decimals() public pure override returns (uint8) { + return 18; + } +} \ No newline at end of file diff --git a/packages/hardhat/contracts/TokenShop.sol b/packages/hardhat/contracts/TokenShop.sol new file mode 100644 index 0000000..76f57c1 --- /dev/null +++ b/packages/hardhat/contracts/TokenShop.sol @@ -0,0 +1,165 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +// Games Token deployed on Polygon Amoy + +import "@chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol"; + +interface TokenInterface { + function mint(address account, uint256 amount) external; +} + +contract TokenShop { + + AggregatorV3Interface internal priceFeed; + // gamesToken is 18 decimal places, and we want to sell 1 token for 0.02 usd + TokenInterface public minter; + uint256 public gamesTokenPriceInCents = 2; // for testing 1 token = 0.02 usd, in the chainlink 8 decimal place return format + address public owner; + + mapping(address => bool) public allowedPlayers; + mapping(address => bool) public gamemasters; + + struct Proposal { + uint256 newPrice; + uint256 votesFor; + uint256 votesAgainst; + uint256 deadline; + bool executed; + mapping(address => bool) voters; + } + + Proposal public proposal; + + event PlayerAllowed(address indexed player); + event GamemasterAdded(address indexed gamemaster); + event ProposalCreated(uint256 newPrice, uint256 deadline); + event Voted(address indexed voter, bool voteFor); + event ProposalExecuted(uint256 newPrice); + + constructor() { + /** + * Network: Polygon Amoy + * Aggregator: MATIC/USD + * Address: 0x001382149eBa3441043c1c66972b4772963f5D43 + */ + priceFeed = AggregatorV3Interface(0x001382149eBa3441043c1c66972b4772963f5D43); + owner = msg.sender; + allowedPlayers[owner] = true; + gamemasters[owner] = true; + } + + /** + * Allow the admin to change the token address + */ + function setTokenAddress(address tokenAddress) external onlyOwner { + minter = TokenInterface(tokenAddress); + } + + /** + * Returns the latest answer + */ + function getChainlinkDataFeedLatestAnswer() public view returns (int) { + ( + /*uint80 roundID*/, + int price, + /*uint startedAt*/, + /*uint timeStamp*/, + /*uint80 answeredInRound*/ + ) = priceFeed.latestRoundData(); + return price; + } + + function getMATICForOneGT() public view returns (uint256) { + uint256 maticPriceInUSD = uint256(getChainlinkDataFeedLatestAnswer()); // MATIC price in USD with 8 decimal places + uint256 maticForOneCent = 10**10 / maticPriceInUSD; // Calculate MATIC amount for one cent + uint256 maticForOneGT = maticForOneCent * gamesTokenPriceInCents; // tokenPrice is in cents + return maticForOneGT; +} + + function getMATICForGTs(uint256 numberOfGTs) public view returns (uint256) { + uint256 maticForOneGT = getMATICForOneGT(); + uint256 totalMATICForGTs = maticForOneGT * numberOfGTs; + return totalMATICForGTs; +} + + function buyAmountTokens(uint256 numberOfGTs) public payable onlyAllowed { + uint256 requiredMATIC = getMATICForGTs(numberOfGTs); + require(msg.value >= requiredMATIC, "Insufficient MATIC sent"); + + minter.mint(msg.sender, numberOfGTs * 10**18); // Minting tokens with proper decimal adjustment +} + + // based on the amount sent in, give the number of tokens as long as its over the price of one token + function buyTokens() public payable onlyAllowed { + require(msg.value >= getMATICForOneGT(), "Insufficient MATIC sent"); + uint256 numberOfGTs = msg.value / getMATICForOneGT(); + minter.mint(msg.sender, numberOfGTs * 10**18); // Minting tokens with proper decimal adjustment + } + + modifier onlyOwner() { + require(msg.sender == owner); + _; + } + + function withdraw() external onlyOwner { + payable(owner).transfer(address(this).balance); + } + + function allowPlayer(address player) external onlyOwner { + allowedPlayers[player] = true; + emit PlayerAllowed(player); + } + + function addGamemaster(address gamemaster) external onlyOwner { + gamemasters[gamemaster] = true; + emit GamemasterAdded(gamemaster); + } + + modifier onlyAllowed() { + require(allowedPlayers[msg.sender] || gamemasters[msg.sender], "Not allowed"); + _; + } + + function createProposal(uint256 newPrice) external onlyAllowed { + require(proposal.deadline == 0 || block.timestamp > proposal.deadline, "Previous proposal still active"); + + proposal.newPrice = newPrice; + proposal.votesFor = 0; + proposal.votesAgainst = 0; + proposal.deadline = block.timestamp + 1 weeks; + proposal.executed = false; + + emit ProposalCreated(newPrice, proposal.deadline); + } + + function vote(bool voteFor) external onlyAllowed { + require(block.timestamp <= proposal.deadline, "Voting period has ended"); + require(!proposal.voters[msg.sender], "Already voted"); + + proposal.voters[msg.sender] = true; + + if (voteFor) { + proposal.votesFor += 1; + } else { + proposal.votesAgainst += 1; + } + + emit Voted(msg.sender, voteFor); + } + + function executeProposal() external onlyAllowed { + require(block.timestamp > proposal.deadline, "Voting period not ended yet"); + require(!proposal.executed, "Proposal already executed"); + + uint256 totalVotes = proposal.votesFor + proposal.votesAgainst; + uint256 requiredVotes = totalVotes / 2; + + if (proposal.votesFor >= requiredVotes) { + gamesTokenPriceInCents = proposal.newPrice; + emit ProposalExecuted(proposal.newPrice); + } + + proposal.executed = true; + } +} diff --git a/packages/hardhat/contracts/World.sol b/packages/hardhat/contracts/World.sol new file mode 100644 index 0000000..07d9d5d --- /dev/null +++ b/packages/hardhat/contracts/World.sol @@ -0,0 +1,81 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.0 <0.9.0; + +contract World { + struct Game { + address gameMaster; + uint256 startTime; + uint256 endTime; + address[] players; + mapping(address => bool) isPlayer; + } + + string public vibe; + string public gameMasterName; + string public gameMasterTwitterHandle; + string public description; + uint256 public creationTime; + address public worldCreator; + uint256 public treasuryBalance; + + uint256 public gameCount; + mapping(uint256 => Game) public games; + + event WorldUpdated(string vibe, string gameMasterName, string gameMasterTwitterHandle, string description); + event GameCreated(uint256 gameId, address gameMaster, uint256 startTime, uint256 endTime); + event PlayerJoined(uint256 gameId, address player); + event PlayerApproved(uint256 gameId, address player); + + constructor( + string memory _vibe, + string memory _gameMasterName, + string memory _gameMasterTwitterHandle, + string memory _description, + address _worldCreator + ) { + vibe = _vibe; + gameMasterName = _gameMasterName; + gameMasterTwitterHandle = _gameMasterTwitterHandle; + description = _description; + creationTime = block.timestamp; + worldCreator = _worldCreator; + } + + modifier onlyGameMaster(uint256 gameId) { + require(msg.sender == games[gameId].gameMaster, "Not the game master"); + _; + } + + function createGame(uint256 startTime, uint256 endTime) public { + games[gameCount].gameMaster = msg.sender; + games[gameCount].startTime = startTime; + games[gameCount].endTime = endTime; + gameCount++; + + emit GameCreated(gameCount - 1, msg.sender, startTime, endTime); + } + + function joinGame(uint256 gameId) public payable { + require(gameId < gameCount, "Game does not exist"); + require(msg.value >= 1 ether, "Insufficient stake"); + + games[gameId].players.push(msg.sender); + games[gameId].isPlayer[msg.sender] = true; + treasuryBalance += msg.value; + + emit PlayerJoined(gameId, msg.sender); + } + + function approvePlayer(uint256 gameId, address player) public onlyGameMaster(gameId) { + require(games[gameId].isPlayer[player], "Player not in the game"); + + // Additional logic to approve player if needed + emit PlayerApproved(gameId, player); + } + + function updateDescription(string memory _description) public { + require(msg.sender == worldCreator, "Operation not allowed"); + description = _description; + emit WorldUpdated(vibe, gameMasterName, gameMasterTwitterHandle, description); + } +} diff --git a/packages/hardhat/contracts/WorldFactory.sol b/packages/hardhat/contracts/WorldFactory.sol new file mode 100644 index 0000000..69f6373 --- /dev/null +++ b/packages/hardhat/contracts/WorldFactory.sol @@ -0,0 +1,119 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.0 <0.9.0; +import "./World.sol"; + +contract WorldFactory { + address public owner; + uint256 public priceToCreate; + uint256 public priceToJoinGM; + uint256 public priceToJoinPlayer; + World[] public worlds; + + error InsufficientFunds(); + error InvalidArguments(string message); + error OnlyOwner(); + + event WorldCreated(address indexed worldCreator, address worldContract, uint256 time, string vibe, string gameMasterName, string gameMasterTwitterHandle, string description); + event PlayerJoinedWorld(address indexed worldContract, address player); + event GameScheduled(address indexed worldContract, uint256 gameId, address gameMaster, uint256 startTime, uint256 endTime); + event GameStarted(address indexed worldContract, uint256 gameId); + event GameJoined(address indexed worldContract, uint256 gameId, address player); + event GameLeft(address indexed worldContract, uint256 gameId, address player); + event GameReviewed(address indexed worldContract, uint256 gameId, address reviewer); + + constructor() { + owner = msg.sender; + priceToCreate = .1 ether; // Example price to create a world + priceToJoinGM = .05 ether; // Example price for GM to join a world + priceToJoinPlayer = .02 ether; // Example price for player to join a world + } + + /** + * @dev Function to create a world + * @param vibe The vibe of the world + * @param gameMasterName The name of the game master + * @param gameMasterTwitterHandle The Twitter handle of the game master + * @param description The description of the world + */ + function createWorld( + string calldata vibe, + string calldata gameMasterName, + string calldata gameMasterTwitterHandle, + string calldata description + ) public payable { + if (msg.value < priceToCreate) { + revert InsufficientFunds(); + } + + World world = new World(vibe, gameMasterName, gameMasterTwitterHandle, description, msg.sender); + worlds.push(world); + + emit WorldCreated(msg.sender, address(world), block.timestamp, vibe, gameMasterName, gameMasterTwitterHandle, description); + } + + /** + * @dev Function for a GM to join a world + * @param worldIndex The index of the world to join + */ + function joinWorldAsGM(uint256 worldIndex) public payable { + if (worldIndex >= worlds.length) { + revert InvalidArguments("World does not exist"); + } + if (msg.value < priceToJoinGM) { + revert InsufficientFunds(); + } + + World world = worlds[worldIndex]; + payable(world.worldCreator()).transfer(priceToJoinGM / 2); + payable(address(world)).transfer(priceToJoinGM / 2); + + emit PlayerJoinedWorld(address(world), msg.sender); + } + + /** + * @dev Function for a player to join a world + * @param worldIndex The index of the world to join + */ + function joinWorldAsPlayer(uint256 worldIndex) public payable { + if (worldIndex >= worlds.length) { + revert InvalidArguments("World does not exist"); + } + if (msg.value < priceToJoinPlayer) { + revert InsufficientFunds(); + } + + World world = worlds[worldIndex]; + payable(world.worldCreator()).transfer(priceToJoinPlayer / 2); + payable(address(world)).transfer(priceToJoinPlayer / 2); + + emit PlayerJoinedWorld(address(world), msg.sender); + } + + /** + * @dev Function to withdraw the balance + */ + function withdrawFunds() public { + if (msg.sender != owner) { + revert OnlyOwner(); + } + + if (address(this).balance == 0) { + revert InsufficientFunds(); + } + + (bool sent,) = owner.call{value: address(this).balance}(""); + require(sent, "Failed to send Ether"); + } + + /** + * @dev Function to get the worlds + */ + function getWorlds() public view returns (World[] memory) { + return worlds; + } + + /** + * @dev Receive function to accept ether + */ + receive() external payable {} +} diff --git a/packages/hardhat/contracts/YourContract.sol b/packages/hardhat/contracts/YourContract.sol deleted file mode 100644 index 3d364a0..0000000 --- a/packages/hardhat/contracts/YourContract.sol +++ /dev/null @@ -1,87 +0,0 @@ -//SPDX-License-Identifier: MIT -pragma solidity >=0.8.0 <0.9.0; - -// Useful for debugging. Remove when deploying to a live network. -import "hardhat/console.sol"; - -// Use openzeppelin to inherit battle-tested implementations (ERC20, ERC721, etc) -// import "@openzeppelin/contracts/access/Ownable.sol"; - -/** - * A smart contract that allows changing a state variable of the contract and tracking the changes - * It also allows the owner to withdraw the Ether in the contract - * @author BuidlGuidl - */ -contract YourContract { - // State Variables - address public immutable owner; - string public greeting = "Building Unstoppable Apps!!!"; - bool public premium = false; - uint256 public totalCounter = 0; - mapping(address => uint) public userGreetingCounter; - - // Events: a way to emit log statements from smart contract that can be listened to by external parties - event GreetingChange( - address indexed greetingSetter, - string newGreeting, - bool premium, - uint256 value - ); - - // Constructor: Called once on contract deployment - // Check packages/hardhat/deploy/00_deploy_your_contract.ts - constructor(address _owner) { - owner = _owner; - } - - // Modifier: used to define a set of rules that must be met before or after a function is executed - // Check the withdraw() function - modifier isOwner() { - // msg.sender: predefined variable that represents address of the account that called the current function - require(msg.sender == owner, "Not the Owner"); - _; - } - - /** - * Function that allows anyone to change the state variable "greeting" of the contract and increase the counters - * - * @param _newGreeting (string memory) - new greeting to save on the contract - */ - function setGreeting(string memory _newGreeting) public payable { - // Print data to the hardhat chain console. Remove when deploying to a live network. - console.log( - "Setting new greeting '%s' from %s", - _newGreeting, - msg.sender - ); - - // Change state variables - greeting = _newGreeting; - totalCounter += 1; - userGreetingCounter[msg.sender] += 1; - - // msg.value: built-in global variable that represents the amount of ether sent with the transaction - if (msg.value > 0) { - premium = true; - } else { - premium = false; - } - - // emit: keyword used to trigger an event - emit GreetingChange(msg.sender, _newGreeting, msg.value > 0, msg.value); - } - - /** - * Function that allows the owner to withdraw all the Ether in the contract - * The function can only be called by the owner of the contract as defined by the isOwner modifier - */ - function withdraw() public isOwner { - (bool success, ) = owner.call{ value: address(this).balance }(""); - require(success, "Failed to send Ether"); - } - - /** - * Function that allows the contract to receive ETH - */ - receive() external payable {} -} diff --git a/packages/hardhat/contracts/ZKSecretCharacter.sol b/packages/hardhat/contracts/ZKSecretCharacter.sol new file mode 100644 index 0000000..e9ef6b2 --- /dev/null +++ b/packages/hardhat/contracts/ZKSecretCharacter.sol @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.7; +// Deployed on zkSync Sepolia Testnet: https://sepolia.explorer.zksync.io/address/0xA6bA847c70cB1eea5811f8C79632C09CF0478FCA#contract + +import { AggregatorV3Interface } from "@chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol"; + +/** + * @title ZKSecrets + * @dev This contract allows users to store secrets on-chain. + * Each user has their own mapping of secrets. + * The contract uses Chainlink price feeds to check for a payment of 0.1 USD for each secret stored. + */ +contract ZKSecrets { + AggregatorV3Interface internal dataFeed; + mapping(address => bytes32[5]) private secrets; + + /** + * @dev Constructor sets the address for the Chainlink price feed. + * The address is for the ETH/USD price feed on the zkSync Sepolia Testnet. + */ + constructor() { + dataFeed = AggregatorV3Interface( + 0xfEefF7c3fB57d18C5C6Cdd71e45D2D0b4F9377bF + ); + } + + /** + * @dev Stores secrets for the sender. Requires a payment of 0.1 USD. + * @param _secrets An array of secrets to be stored. + */ + function storeSecrets(bytes32[5] memory _secrets) public payable { + require(msg.value >= (uint(getLatestPrice()) / 10000), "Payment of 0.3 USD required"); + secrets[msg.sender] = _secrets; + } + + /** + * @dev Returns the latest price from the Chainlink price feed. + * @return The latest price. + */ + function getLatestPrice() public view returns (int) { + ( + /* uint80 roundID */, + int price, + /*uint startedAt*/, + /*uint timeStamp*/, + /*uint80 answeredInRound*/ + ) = dataFeed.latestRoundData(); + return price; // example answer: 377586779077 + } +} diff --git a/packages/hardhat/contracts/deployed on polygon.png b/packages/hardhat/contracts/deployed on polygon.png new file mode 100644 index 0000000..c6c6143 Binary files /dev/null and b/packages/hardhat/contracts/deployed on polygon.png differ diff --git a/packages/hardhat/contracts/interfaces/ICCGateway.sol b/packages/hardhat/contracts/interfaces/ICCGateway.sol new file mode 100644 index 0000000..6e6af42 --- /dev/null +++ b/packages/hardhat/contracts/interfaces/ICCGateway.sol @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.0; + +import {ICCGatewayClient} from './ICCGatewayClient.sol'; +import {FunctionsRequest} from "@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol"; + +interface ICCGateway { + struct CCGRequest { + string name; + uint32 callbackGasLimit; + FunctionsRequest.Request config; + } + + /** + * @dev Can't register a request with an empty name + */ + error CCGRequestNameEmpty(); + + /** + * @dev Only the same source of the requestId is allowed to call the function + */ + error CCGOnlySameSourceAllowed(bytes32 requestId); + + /** + * @dev Only a registered subscriptionId is allowed to call the function + */ + error CCGRequestNotRegistered(uint64 subscriptionId); + + /** + * @dev Can't fulfill a request that has already been fulfilled + */ + error CCGRequestAlreadyFulfilled(bytes32 requestId); + + /** + * @dev Only A manager can call the function + */ + error CCGOnlyManagerAllowed(); + + /** + * @dev Send a request to the Functions DON + */ + function sendRequest( + uint64 subscriptionId, + string[] calldata args, + bytes[] calldata bytesArgs, + bytes calldata encryptedSecretsReference + ) external returns (bytes32 requestId); + + function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp); +} diff --git a/packages/hardhat/contracts/interfaces/ICCGatewayClient.sol b/packages/hardhat/contracts/interfaces/ICCGatewayClient.sol new file mode 100644 index 0000000..82ab5ee --- /dev/null +++ b/packages/hardhat/contracts/interfaces/ICCGatewayClient.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.0; + +interface ICCGatewayClient { + enum CCGResponseState {Sent, Success, Error} + + struct CCGResponse { + uint64 subscriptionId; + address source; + CCGResponseState state; + bytes data; + bytes error; + } + + function callback(bytes32 requestId) external; +} diff --git a/packages/hardhat/contracts/readme.md b/packages/hardhat/contracts/readme.md new file mode 100644 index 0000000..686c1b5 --- /dev/null +++ b/packages/hardhat/contracts/readme.md @@ -0,0 +1,87 @@ +# Chainlink's Block Magic Games Team + +> A Magic Spellbook of many Smart Contracts, and more to come! + +1. Data Feeds leverage Chainlink's DON to get manipulation-resistant data (in our case, price of tokens in USD) from external providers. Games Team used Price Feeds in multiple contracts across different chains ([ZkSync](https://sepolia.explorer.zksync.io/address/0xA6bA847c70cB1eea5811f8C79632C09CF0478FCA#contract), Ethereum, Polygon). +1. VRF 2.5 Subscriptions to create a 1-click Random Character, at first 2-clicks because of callback limits. +1. Chainlink Functions twice! First to take the on-chain character information and give it to GPT to generate unique traits, flaws, bonds, and ideals for our random characters. Save it onchain, and then pass all that to GPT again, and get a prompt "alt-text" to generate a character art via human or ai artist. +1. Automation to upkeep the daily random character spawning in each World to generate income for Gamemaster and World Owners. This way there's always a character available to buy for quick starting. + +# Games Contracts +1. [ZKSecrets](ZKSecretCharacter.sol) - Blockchains aren't good at saving secrets, until we unlock that with Zero Knowledge Technology of next generation chains, like zkSync! Deployed and verified on https://sepolia.explorer.zksync.io/address/0xA6bA847c70cB1eea5811f8C79632C09CF0478FCA#contract :D Uses **Chainlink Price Feeds** to let users save 5 bytes32 proofs in there for a fixed USD amount! Next steps would be having public values, and when VRF comes to zkSync, use that for randomness! + +2. [Game World Generator](BuyMeACeptor.sol) - A contract that generates a game world based on a user's vibe and number of players. The world is generated with a visual of the planet, scenarios, locations, descriptions, maps, denizens, secrets, goals, and players. Each world has its own blockchain. Creating a World costs 10 gameTokens. when creating a game, i want to have my own world or play with others. each world should be locked to a blockchain. 10 gT to make a world. 5 gT to join one as a GM, 2 gT to join as player. + +Inside worlds, there are games +inside games there are schedules +inside schedules there are sessions +(and we verify who shows up) + +3. [Character Generator](Characters/CharacterGen.sol) - A contract that generates a character for a user in the game world. The character is generated with abilities, class, name, alignment, and background. Each character has its own unique attributes. Currently it uses VRF2.5, and provides a reroll (4d4 drop lowest) as well as a swap scores. It refers to the classes, backgrounds, and names contracts. These contracts will eventually have their own Chainlink Functions call to GPT if the user rolls a length+1, it calls that function and triggers the Chainlink Functions call through the gateway, the prompt being to take the existing information about the character and the D&D 5e open source rules for homebrewing a name, class, or background. That's after the Auction House (see the flow chart below). + +- Polygon Amoy: 0x3A5a60bc87170AeC94e5DbFA1E7FC1395CE78bB0 + +4. [GamesToken ERC20](GamesToken.sol) - A contract that is an ERC20 token that is used to pay for the creation of a world, and to pay for the creation of a game. Also can be spent to buy a random character from the portal. The OZ Access Control and Chainlink Price Feeds in the GamesDAOv3 is what lets us control who buys this token and for how much. + +- Polygon Amoy 0xB8E927a25b2ab5d85ff79698cE11F2872d6Faf6b +- Ethereum Sepolia +- Scroll +- zkSync + +2 cents thanks chainlink! + +5. [GamesDAOv3](GamesDAOv3.sol) - Inspired by TokenShop from the Bootcamp. A contract that has a ledger of allowed players, gamemasters, and tracks + mints the ERC20 Games Token for Chainlink Price Feeds = $20 USD (or two cents, $0.02, for testing). It also allows a gamemaster to propose a new price for the token, and all allowed players and gamemasters to vote on the price. if you are a player and gamemaster, you get 2 votes, i hope! + +- Polygon Amoy 0x2aad5711Dfb60B8d8e4A5F6AF882a3275e814af6 +- Ethereum Sepolia +- Scroll +- zkSync + +### Random notes + +1. Is this finished? No, tons left to do including connecting all the contracts together and adding the Ceptor Auction with automation. + +1. Is the World Generator deploying a World contract? Yes. Is the World contract tracking all its games, or deploying each game as its own contract which tracks the sessions. Verifiable Truth. + +1. NPC Generator - Unlike the PCG which is usable by any Verified Credential having hooty in their hey hey. The NPCG is a contract that generates a non-player character for a user in the game world. The character is generated with abilities, class, name, alignment, hometown, and background. Each character has its own unique attributes. Creating a Character is only allowed by the owner of the contract. VRF2.5 because reusable code choices. + +1. Auction Price Machine -- Like a Dutch Auction, but with a price multiplier based on the rarity tier (total sum of the 6 ability scores in 5 tiers: minimum being 3*6 and maximum being 18*6) + +Links for Auction & NFT references: +https://github.com/smartcontractkit/chainlink-automation-templates/tree/main/batch-nft-reveal +https://github.com/solangegueiros/chainlink-bootcamp-2024/tree/main + +## Flowcharts + +![Flowchart of Random Character Auction](./square.png) + +## Improvements +In our voting mechanism, I track both votesFor and votesAgainst. Consider using a single integer where a positive value increases for a β€œfor” vote and decreases for an β€œagainst”. This reduces the storage operations: + +```solidity +mapping(address => bool) public hasVoted; + +function vote(bool voteFor) external onlyAllowed { + require(!hasVoted[msg.sender], "Already voted"); + hasVoted[msg.sender] = true; + + proposal.voteCount += voteFor ? 1 : -1; + emit Voted(msg.sender, voteFor); +} +``` + +Consider if I can use smaller type sizes and pack the struct better... + +```solidity +struct Proposal { + ProposalType proposalType; + string catchphrase; + uint32 newPrice; // could these be uint64? + uint32 amount; // could these be uint64? + uint32 votesFor; // could these be uint64? + uint32 votesAgainst; // could these be uint64? + uint256 deadline; + bool executed; + mapping(address => bool) voters; + } + ``` \ No newline at end of file diff --git a/packages/hardhat/contracts/square.png b/packages/hardhat/contracts/square.png new file mode 100644 index 0000000..b51bd78 Binary files /dev/null and b/packages/hardhat/contracts/square.png differ diff --git a/packages/hardhat/deploy/00_deploy_gateway.ts b/packages/hardhat/deploy/00_deploy_gateway.ts new file mode 100644 index 0000000..e380549 --- /dev/null +++ b/packages/hardhat/deploy/00_deploy_gateway.ts @@ -0,0 +1,41 @@ +import { HardhatRuntimeEnvironment } from "hardhat/types"; +import { DeployFunction } from "hardhat-deploy/types"; + +import { getNetworkConfig } from "@/scripts/LINK/utils"; + +/** + * Deploys a contract named "CCGateway" using the deployer account and + * constructor arguments set to the deployer address + * + * @param hre HardhatRuntimeEnvironment object. + */ +export const contractName = "CCGateway"; + +const deployCCGateway: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { + functions: { + router, + donId: { onChain: donId }, + }, + } = await getNetworkConfig(hre); + + const { deployer } = await hre.getNamedAccounts(); + const { deploy } = hre.deployments; + + console.log(`network: ${hre.network.name} | router:${router} | donId:${donId}`); + await deploy(contractName, { + from: deployer, + // Contract constructor arguments + args: [router, donId, deployer], + log: true, + // autoMine: can be passed to the deploy function to make the deployment process faster on local networks by + // automatically mining the contract deployment transaction. There is no effect on live networks. + autoMine: true, + }); +}; + +export default deployCCGateway; + +// Tags are useful if you have multiple deploy files and only want to run one of them. +// e.g. yarn deploy --tags CCGateway +deployCCGateway.tags = [contractName]; diff --git a/packages/hardhat/deploy/01_deploy_games_token.txt b/packages/hardhat/deploy/01_deploy_games_token.txt new file mode 100644 index 0000000..aef7345 --- /dev/null +++ b/packages/hardhat/deploy/01_deploy_games_token.txt @@ -0,0 +1,41 @@ +import { HardhatRuntimeEnvironment } from "hardhat/types"; +import { DeployFunction } from "hardhat-deploy/types"; +import { Contract } from "ethers"; + +/** + * Deploys the GamesToken and GamesDAOv3 contracts using the deployer account. + * + * @param hre HardhatRuntimeEnvironment object. + */ +const deployGamesContracts: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployer } = await hre.getNamedAccounts(); + const { deploy } = hre.deployments; + + // Deploy GamesToken contract + const gamesToken = await deploy("GamesToken", { + from: deployer, + log: true, + autoMine: true, + }); + + // Deploy GamesDAOv3 contract with the address of the deployed GamesToken contract as a constructor argument + const gamesDAOv3 = await deploy("GamesDAOv3", { + from: deployer, + args: [], + log: true, + autoMine: true, + }); + + // Get the deployed contracts to interact with them after deploying. + const gamesTokenContract = await hre.ethers.getContract("GamesToken", deployer); + const gamesDAOv3Contract = await hre.ethers.getContract("GamesDAOv3", deployer); + + console.log("πŸ‘‹ GamesToken deployed at: ", gamesTokenContract.address); + console.log("πŸ‘‹ GamesDAOv3 deployed at: ", gamesDAOv3Contract.address); +}; + +export default deployGamesContracts; + +// Tags are useful if you have multiple deploy files and only want to run one of them. +// e.g. yarn deploy --tags GamesContracts +deployGamesContracts.tags = ["GamesContracts"]; diff --git a/packages/hardhat/deploy/00_deploy_your_contract.ts b/packages/hardhat/deploy/02_deploy_buy_me_a_ceptor.txt similarity index 60% rename from packages/hardhat/deploy/00_deploy_your_contract.ts rename to packages/hardhat/deploy/02_deploy_buy_me_a_ceptor.txt index 716fec7..11300d6 100644 --- a/packages/hardhat/deploy/00_deploy_your_contract.ts +++ b/packages/hardhat/deploy/02_deploy_buy_me_a_ceptor.txt @@ -3,16 +3,16 @@ import { DeployFunction } from "hardhat-deploy/types"; import { Contract } from "ethers"; /** - * Deploys a contract named "YourContract" using the deployer account and + * Deploys a contract named "BuyMeACeptor" using the deployer account and * constructor arguments set to the deployer address * * @param hre HardhatRuntimeEnvironment object. */ -const deployYourContract: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { +const deployBuyMeACeptor: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { /* On localhost, the deployer account is the one that comes with Hardhat, which is already funded. - When deploying to live networks (e.g `yarn deploy --network sepolia`), the deployer account + When deploying to live networks (e.g `yarn deploy --network goerli`), the deployer account should have sufficient balance to pay for the gas fees for contract creation. You can generate a random account with `yarn generate` which will fill DEPLOYER_PRIVATE_KEY @@ -22,23 +22,20 @@ const deployYourContract: DeployFunction = async function (hre: HardhatRuntimeEn const { deployer } = await hre.getNamedAccounts(); const { deploy } = hre.deployments; - await deploy("YourContract", { + await deploy("BuyMeACeptor", { from: deployer, - // Contract constructor arguments - args: [deployer], + args: ["0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"], log: true, - // autoMine: can be passed to the deploy function to make the deployment process faster on local networks by - // automatically mining the contract deployment transaction. There is no effect on live networks. autoMine: true, }); // Get the deployed contract to interact with it after deploying. - const yourContract = await hre.ethers.getContract("YourContract", deployer); - console.log("πŸ‘‹ Initial greeting:", await yourContract.greeting()); + const buyMeACeptorContract = await hre.ethers.getContract("BuyMeACeptor", deployer); + console.log("πŸ‘‹ Buy this person a Ceptor!", await buyMeACeptorContract.owner()); }; -export default deployYourContract; +export default deployBuyMeACeptor; // Tags are useful if you have multiple deploy files and only want to run one of them. -// e.g. yarn deploy --tags YourContract -deployYourContract.tags = ["YourContract"]; +// e.g. yarn deploy --tags BuyMeACeptor +deployBuyMeACeptor.tags = ["BuyMeACeptor"]; diff --git a/packages/hardhat/deploy/01_deploy_buy_me_a_coffee.ts b/packages/hardhat/deploy/03_deploy_world_factory.ts similarity index 75% rename from packages/hardhat/deploy/01_deploy_buy_me_a_coffee.ts rename to packages/hardhat/deploy/03_deploy_world_factory.ts index 474d826..8f4650f 100644 --- a/packages/hardhat/deploy/01_deploy_buy_me_a_coffee.ts +++ b/packages/hardhat/deploy/03_deploy_world_factory.ts @@ -3,12 +3,12 @@ import { DeployFunction } from "hardhat-deploy/types"; import { Contract } from "ethers"; /** - * Deploys a contract named "BuyMeACoffee" using the deployer account and + * Deploys a contract named "BuyMeACeptor" using the deployer account and * constructor arguments set to the deployer address * * @param hre HardhatRuntimeEnvironment object. */ -const deployBuyMeACoffee: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { +const deployWorldFactory: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { /* On localhost, the deployer account is the one that comes with Hardhat, which is already funded. @@ -22,7 +22,7 @@ const deployBuyMeACoffee: DeployFunction = async function (hre: HardhatRuntimeEn const { deployer } = await hre.getNamedAccounts(); const { deploy } = hre.deployments; - await deploy("BuyMeACoffee", { + await deploy("WorldFactory", { from: deployer, // Contract constructor arguments log: true, @@ -32,12 +32,12 @@ const deployBuyMeACoffee: DeployFunction = async function (hre: HardhatRuntimeEn }); // Get the deployed contract to interact with it after deploying. - const buyMeACoffeeContract = await hre.ethers.getContract("BuyMeACoffee", deployer); - console.log("πŸ‘‹ Buy this person a coffee!", await buyMeACoffeeContract.owner()); + const worldFactoryContract = await hre.ethers.getContract("WorldFactory", deployer); + console.log("WorldFactory deployed by:", await worldFactoryContract.owner()); }; -export default deployBuyMeACoffee; +export default deployWorldFactory; // Tags are useful if you have multiple deploy files and only want to run one of them. -// e.g. yarn deploy --tags BuyMeACoffee -deployBuyMeACoffee.tags = ["BuyMeACoffee"]; +// e.g. yarn deploy --tags BuyMeACeptor +deployWorldFactory.tags = ["WorldFactory"]; diff --git a/packages/hardhat/deploy/96_deploy_notification_client.ts b/packages/hardhat/deploy/96_deploy_notification_client.ts new file mode 100644 index 0000000..dcb1093 --- /dev/null +++ b/packages/hardhat/deploy/96_deploy_notification_client.ts @@ -0,0 +1,37 @@ +import { HardhatRuntimeEnvironment } from "hardhat/types"; +import { DeployFunction } from "hardhat-deploy/types"; +import { Contract } from "ethers"; + +import { contractName as GatewayName } from "./00_deploy_gateway"; + +/** + * Deploys a contract named "CCExampleClient" using the deployer account and + * constructor arguments set to the deployer address + * + * @param hre HardhatRuntimeEnvironment object. + */ +const contractName = "CCNotificationClient"; + +const deployCCNotificationClient: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployer } = await hre.getNamedAccounts(); + const { deploy } = hre.deployments; + + const Gateway = await hre.ethers.getContract(GatewayName, deployer); + const gwAddress = await Gateway.getAddress(); + + await deploy(contractName, { + from: deployer, + // Contract constructor arguments + args: [gwAddress], + log: true, + // autoMine: can be passed to the deploy function to make the deployment process faster on local networks by + // automatically mining the contract deployment transaction. There is no effect on live networks. + autoMine: true, + }); +}; + +export default deployCCNotificationClient; + +// Tags are useful if you have multiple deploy files and only want to run one of them. +// e.g. yarn deploy --tags CCExampleClient +deployCCNotificationClient.tags = [contractName]; diff --git a/packages/hardhat/deploy/97_deploy_example_client.ts b/packages/hardhat/deploy/97_deploy_example_client.ts new file mode 100644 index 0000000..f5ef939 --- /dev/null +++ b/packages/hardhat/deploy/97_deploy_example_client.ts @@ -0,0 +1,37 @@ +import { HardhatRuntimeEnvironment } from "hardhat/types"; +import { DeployFunction } from "hardhat-deploy/types"; +import { Contract } from "ethers"; + +import { contractName as GatewayName } from "./00_deploy_gateway"; + +/** + * Deploys a contract named "CCExampleClient" using the deployer account and + * constructor arguments set to the deployer address + * + * @param hre HardhatRuntimeEnvironment object. + */ +export const contractName = "CCExampleClient"; + +const deployCCExampleClient: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployer } = await hre.getNamedAccounts(); + const { deploy } = hre.deployments; + + const Gateway = await hre.ethers.getContract(GatewayName, deployer); + const gwAddress = await Gateway.getAddress(); + + await deploy(contractName, { + from: deployer, + // Contract constructor arguments + args: [gwAddress], + log: true, + // autoMine: can be passed to the deploy function to make the deployment process faster on local networks by + // automatically mining the contract deployment transaction. There is no effect on live networks. + autoMine: true, + }); +}; + +export default deployCCExampleClient; + +// Tags are useful if you have multiple deploy files and only want to run one of them. +// e.g. yarn deploy --tags CCExampleClient +deployCCExampleClient.tags = [contractName]; diff --git a/packages/hardhat/deploy/98_assign_clients.ts b/packages/hardhat/deploy/98_assign_clients.ts new file mode 100644 index 0000000..b041b27 --- /dev/null +++ b/packages/hardhat/deploy/98_assign_clients.ts @@ -0,0 +1,44 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types"; +import type { DeployFunction } from "hardhat-deploy/types"; +import { Contract } from "ethers"; + +import { contractName } from "./00_deploy_gateway"; + +/** + * Deploys a contract named "CCGateway" using the deployer account and + * constructor arguments set to the deployer address + * + * @param hre HardhatRuntimeEnvironment object. + */ + +const CLIENTS = ["CCExampleClient", "CCNotificationClient"]; // List of contract names to be registered in the gateway as clients. + +const grantClientsRole: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployer } = await hre.getNamedAccounts(); + const Gateway = await hre.ethers.getContract(contractName, deployer); + const clientRole = await Gateway.CLIENT_ROLE(); + + console.log(`Granting "CLIENT_ROLE" to clients...`); + + for (const client of CLIENTS) { + const contract = await hre.ethers.getContract(client); + if (!contract) throw new Error(`Contract ${client} not found`); + + const address = await contract.getAddress(); + const hasRole = await Gateway.hasRole(clientRole, address); + if (hasRole) { + console.log(`Contract ${client} already registered in the gateway`); + continue; + } + + console.log(`Granting "CLIENT_ROLE" to ${client}...`); + await Gateway.grantRole(clientRole, address); + console.log(`Contract ${client} registered in the gateway`); + } +}; + +export default grantClientsRole; + +// Tags are useful if you have multiple deploy files and only want to run one of them. +// e.g. yarn deploy --tags CCGateway +grantClientsRole.tags = [contractName]; diff --git a/packages/hardhat/deployments/baseSepolia/.chainId b/packages/hardhat/deployments/baseSepolia/.chainId new file mode 100644 index 0000000..667f99d --- /dev/null +++ b/packages/hardhat/deployments/baseSepolia/.chainId @@ -0,0 +1 @@ +84532 \ No newline at end of file diff --git a/packages/hardhat/deployments/baseSepolia/CCExampleClient.json b/packages/hardhat/deployments/baseSepolia/CCExampleClient.json new file mode 100644 index 0000000..c401047 --- /dev/null +++ b/packages/hardhat/deployments/baseSepolia/CCExampleClient.json @@ -0,0 +1,215 @@ +{ + "address": "0x5Cd8d5f37288cb16De0010d02Fe739571bcDe585", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "gatewayAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "error", + "type": "string" + } + ], + "name": "ErrorReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "response", + "type": "string" + } + ], + "name": "ResponseReceived", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + } + ], + "name": "callback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "encryptedSecretsReference", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "args", + "type": "string[]" + }, + { + "internalType": "bytes[]", + "name": "bytesArgs", + "type": "bytes[]" + } + ], + "name": "request", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "subscriptionId", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_encryptedSecretsReference", + "type": "bytes" + } + ], + "name": "updateEncryptedSecretsReference", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "_subscriptionId", + "type": "uint64" + } + ], + "name": "updateSubscriptionId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x8fbd0041af9a71196730570621e6d4dfba40f21e5f4440be0b8447807e596824", + "receipt": { + "to": null, + "from": "0xD10F43A0aa00D244DAcFBE3C49b9B918B717Ff2c", + "contractAddress": "0x5Cd8d5f37288cb16De0010d02Fe739571bcDe585", + "transactionIndex": 2, + "gasUsed": "686011", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x64ebebfb71716b578b28aba76d1a4e4d314d89488df600d4eeb3b28ffaa20ea9", + "transactionHash": "0x8fbd0041af9a71196730570621e6d4dfba40f21e5f4440be0b8447807e596824", + "logs": [], + "blockNumber": 10770581, + "cumulativeGasUsed": "847086", + "status": 1, + "byzantium": true + }, + "args": [ + "0x52bfF133bc6A891828baB02fB7338fB943E8D078" + ], + "numDeployments": 2, + "solcInputHash": "fc0de00091a2e0264aed2d3e71476d4f", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"gatewayAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"error\",\"type\":\"string\"}],\"name\":\"ErrorReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"response\",\"type\":\"string\"}],\"name\":\"ResponseReceived\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"callback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"encryptedSecretsReference\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"args\",\"type\":\"string[]\"},{\"internalType\":\"bytes[]\",\"name\":\"bytesArgs\",\"type\":\"bytes[]\"}],\"name\":\"request\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"subscriptionId\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_encryptedSecretsReference\",\"type\":\"bytes\"}],\"name\":\"updateEncryptedSecretsReference\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_subscriptionId\",\"type\":\"uint64\"}],\"name\":\"updateSubscriptionId\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/CCExampleClient.sol\":\"CCExampleClient\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\n/// @title Chainlink Functions client interface.\\ninterface IFunctionsClient {\\n /// @notice Chainlink Functions response handler called by the Functions Router\\n /// during fullilment from the designated transmitter node in an OCR round.\\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\\n /// @param response Aggregated response from the request's source code.\\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\\n /// @dev Either response or error parameter will be set, but never both.\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\\n}\\n\",\"keccak256\":\"0x6117b82e7c4eec44ce557b0fc8bc1ac5f49e5d160ac6d4485452d6aafdd762ff\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {FunctionsResponse} from \\\"../libraries/FunctionsResponse.sol\\\";\\n\\n/// @title Chainlink Functions Router interface.\\ninterface IFunctionsRouter {\\n /// @notice The identifier of the route to retrieve the address of the access control contract\\n /// The access control contract controls which accounts can manage subscriptions\\n /// @return id - bytes32 id that can be passed to the \\\"getContractById\\\" of the Router\\n function getAllowListId() external view returns (bytes32);\\n\\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\\n /// The access control contract controls which accounts can manage subscriptions\\n function setAllowListId(bytes32 allowListId) external;\\n\\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\\n /// @return adminFee\\n function getAdminFee() external view returns (uint72 adminFee);\\n\\n /// @notice Sends a request using the provided subscriptionId\\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\\n /// a client can make requests from different contracts referencing the same subscription\\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\\n /// @param dataVersion - Gas limit for the fulfillment callback\\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\\n /// @param donId - An identifier used to determine which route to send the request along\\n /// @return requestId - A unique request identifier\\n function sendRequest(\\n uint64 subscriptionId,\\n bytes calldata data,\\n uint16 dataVersion,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) external returns (bytes32);\\n\\n /// @notice Sends a request to the proposed contracts\\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\\n /// a client can make requests from different contracts referencing the same subscription\\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\\n /// @param dataVersion - Gas limit for the fulfillment callback\\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\\n /// @param donId - An identifier used to determine which route to send the request along\\n /// @return requestId - A unique request identifier\\n function sendRequestToProposed(\\n uint64 subscriptionId,\\n bytes calldata data,\\n uint16 dataVersion,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) external returns (bytes32);\\n\\n /// @notice Fulfill the request by:\\n /// - calling back the data that the Oracle returned to the client contract\\n /// - pay the DON for processing the request\\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\\n /// @param response response data from DON consensus\\n /// @param err error from DON consensus\\n /// @param juelsPerGas - current rate of juels/gas\\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\\n /// @param transmitter - The Node that transmitted the OCR report\\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\\n /// @return fulfillResult -\\n /// @return callbackGasCostJuels -\\n function fulfill(\\n bytes memory response,\\n bytes memory err,\\n uint96 juelsPerGas,\\n uint96 costWithoutFulfillment,\\n address transmitter,\\n FunctionsResponse.Commitment memory commitment\\n ) external returns (FunctionsResponse.FulfillResult, uint96);\\n\\n /// @notice Validate requested gas limit is below the subscription max.\\n /// @param subscriptionId subscription ID\\n /// @param callbackGasLimit desired callback gas limit\\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\\n\\n /// @notice Get the current contract given an ID\\n /// @param id A bytes32 identifier for the route\\n /// @return contract The current contract address\\n function getContractById(bytes32 id) external view returns (address);\\n\\n /// @notice Get the proposed next contract given an ID\\n /// @param id A bytes32 identifier for the route\\n /// @return contract The current or proposed contract address\\n function getProposedContractById(bytes32 id) external view returns (address);\\n\\n /// @notice Return the latest proprosal set\\n /// @return ids The identifiers of the contracts to update\\n /// @return to The addresses of the contracts that will be updated to\\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\\n\\n /// @notice Proposes one or more updates to the contract routes\\n /// @dev Only callable by owner\\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\\n\\n /// @notice Updates the current contract routes to the proposed contracts\\n /// @dev Only callable by owner\\n function updateContracts() external;\\n\\n /// @dev Puts the system into an emergency stopped state.\\n /// @dev Only callable by owner\\n function pause() external;\\n\\n /// @dev Takes the system out of an emergency stopped state.\\n /// @dev Only callable by owner\\n function unpause() external;\\n}\\n\",\"keccak256\":\"0x44db41e8ff90c2828ca0ada125abc4b411921a86514a4a047fd9fd43ba9d7e08\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {CBOR} from \\\"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\\\";\\n\\n/// @title Library for encoding the input data of a Functions request into CBOR\\nlibrary FunctionsRequest {\\n using CBOR for CBOR.CBORBuffer;\\n\\n uint16 public constant REQUEST_DATA_VERSION = 1;\\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\\n\\n enum Location {\\n Inline, // Provided within the Request\\n Remote, // Hosted through remote location that can be accessed through a provided URL\\n DONHosted // Hosted on the DON's storage\\n }\\n\\n enum CodeLanguage {\\n JavaScript\\n // In future version we may add other languages\\n }\\n\\n struct Request {\\n Location codeLocation; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The location of the source code that will be executed on each node in the DON\\n Location secretsLocation; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The location of secrets that will be passed into the source code. *Only Remote secrets are supported\\n CodeLanguage language; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The coding language that the source code is written in\\n string source; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\\n bytes encryptedSecretsReference; // \\u2550\\u2550\\u2578 Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\\n string[] args; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 String arguments that will be passed into the source code\\n bytes[] bytesArgs; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Bytes arguments that will be passed into the source code\\n }\\n\\n error EmptySource();\\n error EmptySecrets();\\n error EmptyArgs();\\n error NoInlineSecrets();\\n\\n /// @notice Encodes a Request to CBOR encoded bytes\\n /// @param self The request to encode\\n /// @return CBOR encoded bytes\\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\\n\\n buffer.writeString(\\\"codeLocation\\\");\\n buffer.writeUInt256(uint256(self.codeLocation));\\n\\n buffer.writeString(\\\"language\\\");\\n buffer.writeUInt256(uint256(self.language));\\n\\n buffer.writeString(\\\"source\\\");\\n buffer.writeString(self.source);\\n\\n if (self.args.length > 0) {\\n buffer.writeString(\\\"args\\\");\\n buffer.startArray();\\n for (uint256 i = 0; i < self.args.length; ++i) {\\n buffer.writeString(self.args[i]);\\n }\\n buffer.endSequence();\\n }\\n\\n if (self.encryptedSecretsReference.length > 0) {\\n if (self.secretsLocation == Location.Inline) {\\n revert NoInlineSecrets();\\n }\\n buffer.writeString(\\\"secretsLocation\\\");\\n buffer.writeUInt256(uint256(self.secretsLocation));\\n buffer.writeString(\\\"secrets\\\");\\n buffer.writeBytes(self.encryptedSecretsReference);\\n }\\n\\n if (self.bytesArgs.length > 0) {\\n buffer.writeString(\\\"bytesArgs\\\");\\n buffer.startArray();\\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\\n buffer.writeBytes(self.bytesArgs[i]);\\n }\\n buffer.endSequence();\\n }\\n\\n return buffer.buf.buf;\\n }\\n\\n /// @notice Initializes a Chainlink Functions Request\\n /// @dev Sets the codeLocation and code on the request\\n /// @param self The uninitialized request\\n /// @param codeLocation The user provided source code location\\n /// @param language The programming language of the user code\\n /// @param source The user provided source code or a url\\n function initializeRequest(\\n Request memory self,\\n Location codeLocation,\\n CodeLanguage language,\\n string memory source\\n ) internal pure {\\n if (bytes(source).length == 0) revert EmptySource();\\n\\n self.codeLocation = codeLocation;\\n self.language = language;\\n self.source = source;\\n }\\n\\n /// @notice Initializes a Chainlink Functions Request\\n /// @dev Simplified version of initializeRequest for PoC\\n /// @param self The uninitialized request\\n /// @param javaScriptSource The user provided JS code (must not be empty)\\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\\n }\\n\\n /// @notice Adds Remote user encrypted secrets to a Request\\n /// @param self The initialized request\\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\\n\\n self.secretsLocation = Location.Remote;\\n self.encryptedSecretsReference = encryptedSecretsReference;\\n }\\n\\n /// @notice Adds DON-hosted secrets reference to a Request\\n /// @param self The initialized request\\n /// @param slotID Slot ID of the user's secrets hosted on DON\\n /// @param version User data version (for the slotID)\\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\\n\\n buffer.writeString(\\\"slotID\\\");\\n buffer.writeUInt64(slotID);\\n buffer.writeString(\\\"version\\\");\\n buffer.writeUInt64(version);\\n\\n self.secretsLocation = Location.DONHosted;\\n self.encryptedSecretsReference = buffer.buf.buf;\\n }\\n\\n /// @notice Sets args for the user run function\\n /// @param self The initialized request\\n /// @param args The array of string args (must not be empty)\\n function setArgs(Request memory self, string[] memory args) internal pure {\\n if (args.length == 0) revert EmptyArgs();\\n\\n self.args = args;\\n }\\n\\n /// @notice Sets bytes args for the user run function\\n /// @param self The initialized request\\n /// @param args The array of bytes args (must not be empty)\\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\\n if (args.length == 0) revert EmptyArgs();\\n\\n self.bytesArgs = args;\\n }\\n}\\n\",\"keccak256\":\"0xed75be0eaba358d468f1fe18adc377d5044f57eff0070081f884a1f212d0adc2\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\n/// @title Library of types that are used for fulfillment of a Functions request\\nlibrary FunctionsResponse {\\n // Used to send request information from the Router to the Coordinator\\n struct RequestMeta {\\n bytes data; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\\n bytes32 flags; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Per-subscription flags\\n address requestingContract; // \\u2550\\u2550\\u2557 The client contract that is sending the request\\n uint96 availableBalance; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u255d Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\\n uint72 adminFee; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\\n uint64 subscriptionId; // \\u2551 Identifier of the billing subscription that will be charged for the request\\n uint64 initiatedRequests; // \\u2551 The number of requests that have been started\\n uint32 callbackGasLimit; // \\u2551 The amount of gas that the callback to the consuming contract will be given\\n uint16 dataVersion; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The version of the structure of the CBOR encoded request data\\n uint64 completedRequests; // \\u2550\\u2550\\u2550\\u2550\\u2557 The number of requests that have successfully completed or timed out\\n address subscriptionOwner; // \\u2550\\u2550\\u2550\\u255d The owner of the billing subscription\\n }\\n\\n enum FulfillResult {\\n FULFILLED, // 0\\n USER_CALLBACK_ERROR, // 1\\n INVALID_REQUEST_ID, // 2\\n COST_EXCEEDS_COMMITMENT, // 3\\n INSUFFICIENT_GAS_PROVIDED, // 4\\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\\n INVALID_COMMITMENT // 6\\n }\\n\\n struct Commitment {\\n bytes32 requestId; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 A unique identifier for a Chainlink Functions request\\n address coordinator; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 The Coordinator contract that manages the DON that is servicing a request\\n uint96 estimatedTotalCostJuels; // \\u2550\\u2550\\u2550\\u2550\\u255d The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\\n address client; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 The client contract that sent the request\\n uint64 subscriptionId; // \\u2551 Identifier of the billing subscription that will be charged for the request\\n uint32 callbackGasLimit; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The amount of gas that the callback to the consuming contract will be given\\n uint72 adminFee; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\\n uint72 donFee; // \\u2551 Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\\n uint40 gasOverheadBeforeCallback; // \\u2551 Represents the average gas execution cost before the fulfillment callback.\\n uint40 gasOverheadAfterCallback; // \\u2551 Represents the average gas execution cost after the fulfillment callback.\\n uint32 timeoutTimestamp; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The timestamp at which a request will be eligible to be timed out\\n }\\n}\\n\",\"keccak256\":\"0xc72eb037effef32146f7cd4086af00f44f28c8649d891e5e404fec5fda7e802b\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {IFunctionsRouter} from \\\"../v1_0_0/interfaces/IFunctionsRouter.sol\\\";\\nimport {IFunctionsClient} from \\\"../v1_0_0/interfaces/IFunctionsClient.sol\\\";\\n\\nimport {FunctionsRequest} from \\\"../v1_0_0/libraries/FunctionsRequest.sol\\\";\\n\\n/// @title The Chainlink Functions client contract\\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\\nabstract contract FunctionsClient is IFunctionsClient {\\n using FunctionsRequest for FunctionsRequest.Request;\\n\\n IFunctionsRouter internal immutable i_functionsRouter;\\n\\n event RequestSent(bytes32 indexed id);\\n event RequestFulfilled(bytes32 indexed id);\\n\\n error OnlyRouterCanFulfill();\\n\\n constructor(address router) {\\n i_functionsRouter = IFunctionsRouter(router);\\n }\\n\\n /// @notice Sends a Chainlink Functions request\\n /// @param data The CBOR encoded bytes data for a Functions request\\n /// @param subscriptionId The subscription ID that will be charged to service the request\\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\\n /// @return requestId The generated request ID for this request\\n function _sendRequest(\\n bytes memory data,\\n uint64 subscriptionId,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) internal returns (bytes32) {\\n bytes32 requestId = i_functionsRouter.sendRequest(\\n subscriptionId,\\n data,\\n FunctionsRequest.REQUEST_DATA_VERSION,\\n callbackGasLimit,\\n donId\\n );\\n emit RequestSent(requestId);\\n return requestId;\\n }\\n\\n /// @notice User defined function to handle a response from the DON\\n /// @param requestId The request ID, returned by sendRequest()\\n /// @param response Aggregated response from the execution of the user's source code\\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\\n /// @dev Either response or error parameter will be set, but never both\\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\\n\\n /// @inheritdoc IFunctionsClient\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\\n if (msg.sender != address(i_functionsRouter)) {\\n revert OnlyRouterCanFulfill();\\n }\\n _fulfillRequest(requestId, response, err);\\n emit RequestFulfilled(requestId);\\n }\\n}\\n\",\"keccak256\":\"0xdc40f1e9dea8a572d43d310afa68e978c35218d16097b9cfd9d1b6137df3cd0a\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-2-Clause\\npragma solidity ^0.8.4;\\n\\n/**\\n* @dev A library for working with mutable byte buffers in Solidity.\\n*\\n* Byte buffers are mutable and expandable, and provide a variety of primitives\\n* for appending to them. At any time you can fetch a bytes object containing the\\n* current contents of the buffer. The bytes object should not be stored between\\n* operations, as it may change due to resizing of the buffer.\\n*/\\nlibrary Buffer {\\n /**\\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\\n * a capacity. The capacity may be longer than the current value, in\\n * which case it can be extended without the need to allocate more memory.\\n */\\n struct buffer {\\n bytes buf;\\n uint capacity;\\n }\\n\\n /**\\n * @dev Initializes a buffer with an initial capacity.\\n * @param buf The buffer to initialize.\\n * @param capacity The number of bytes of space to allocate the buffer.\\n * @return The buffer, for chaining.\\n */\\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\\n if (capacity % 32 != 0) {\\n capacity += 32 - (capacity % 32);\\n }\\n // Allocate space for the buffer data\\n buf.capacity = capacity;\\n assembly {\\n let ptr := mload(0x40)\\n mstore(buf, ptr)\\n mstore(ptr, 0)\\n let fpm := add(32, add(ptr, capacity))\\n if lt(fpm, ptr) {\\n revert(0, 0)\\n }\\n mstore(0x40, fpm)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Initializes a new buffer from an existing bytes object.\\n * Changes to the buffer may mutate the original value.\\n * @param b The bytes object to initialize the buffer with.\\n * @return A new buffer.\\n */\\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\\n buffer memory buf;\\n buf.buf = b;\\n buf.capacity = b.length;\\n return buf;\\n }\\n\\n function resize(buffer memory buf, uint capacity) private pure {\\n bytes memory oldbuf = buf.buf;\\n init(buf, capacity);\\n append(buf, oldbuf);\\n }\\n\\n /**\\n * @dev Sets buffer length to 0.\\n * @param buf The buffer to truncate.\\n * @return The original buffer, for chaining..\\n */\\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\\n assembly {\\n let bufptr := mload(buf)\\n mstore(bufptr, 0)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to copy.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\\n require(len <= data.length);\\n\\n uint off = buf.buf.length;\\n uint newCapacity = off + len;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint dest;\\n uint src;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Length of existing buffer data\\n let buflen := mload(bufptr)\\n // Start address = buffer address + offset + sizeof(buffer length)\\n dest := add(add(bufptr, 32), off)\\n // Update buffer length if we're extending it\\n if gt(newCapacity, buflen) {\\n mstore(bufptr, newCapacity)\\n }\\n src := add(data, 32)\\n }\\n\\n // Copy word-length chunks while possible\\n for (; len >= 32; len -= 32) {\\n assembly {\\n mstore(dest, mload(src))\\n }\\n dest += 32;\\n src += 32;\\n }\\n\\n // Copy remaining bytes\\n unchecked {\\n uint mask = (256 ** (32 - len)) - 1;\\n assembly {\\n let srcpart := and(mload(src), not(mask))\\n let destpart := and(mload(dest), mask)\\n mstore(dest, or(destpart, srcpart))\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\\n return append(buf, data, data.length);\\n }\\n\\n /**\\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\\n * capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint offPlusOne = off + 1;\\n if (off >= buf.capacity) {\\n resize(buf, offPlusOne * 2);\\n }\\n\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + off\\n let dest := add(add(bufptr, off), 32)\\n mstore8(dest, data)\\n // Update buffer length if we extended it\\n if gt(offPlusOne, mload(bufptr)) {\\n mstore(bufptr, offPlusOne)\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (left-aligned).\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n unchecked {\\n uint mask = (256 ** len) - 1;\\n // Right-align data\\n data = data >> (8 * (32 - len));\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chhaining.\\n */\\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\\n return append(buf, bytes32(data), 20);\\n }\\n\\n /**\\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\\n return append(buf, data, 32);\\n }\\n\\n /**\\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (right-aligned).\\n * @return The original buffer.\\n */\\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint mask = (256 ** len) - 1;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n return buf;\\n }\\n}\",\"keccak256\":\"0x0d86b367813922094e02594a406ba89f5e97d3d74ec2ce3c4032566840e302b0\",\"license\":\"BSD-2-Clause\"},\"@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.4;\\n\\nimport \\\"../../@ensdomains/buffer/v0.1.0/Buffer.sol\\\";\\n\\n/**\\n* @dev A library for populating CBOR encoded payload in Solidity.\\n*\\n* https://datatracker.ietf.org/doc/html/rfc7049\\n*\\n* The library offers various write* and start* methods to encode values of different types.\\n* The resulted buffer can be obtained with data() method.\\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\\n* in an invalid CBOR if start/write/end flow is violated.\\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\\n* except for nested start/end pairs.\\n*/\\n\\nlibrary CBOR {\\n using Buffer for Buffer.buffer;\\n\\n struct CBORBuffer {\\n Buffer.buffer buf;\\n uint256 depth;\\n }\\n\\n uint8 private constant MAJOR_TYPE_INT = 0;\\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\\n uint8 private constant MAJOR_TYPE_BYTES = 2;\\n uint8 private constant MAJOR_TYPE_STRING = 3;\\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\\n uint8 private constant MAJOR_TYPE_MAP = 5;\\n uint8 private constant MAJOR_TYPE_TAG = 6;\\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\\n\\n uint8 private constant TAG_TYPE_BIGNUM = 2;\\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\\n\\n uint8 private constant CBOR_FALSE = 20;\\n uint8 private constant CBOR_TRUE = 21;\\n uint8 private constant CBOR_NULL = 22;\\n uint8 private constant CBOR_UNDEFINED = 23;\\n\\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\\n Buffer.init(cbor.buf, capacity);\\n cbor.depth = 0;\\n return cbor;\\n }\\n\\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\\n require(buf.depth == 0, \\\"Invalid CBOR\\\");\\n return buf.buf.buf;\\n }\\n\\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\\n writeBytes(buf, abi.encode(value));\\n }\\n\\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\\n if (value < 0) {\\n buf.buf.appendUint8(\\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\\n );\\n writeBytes(buf, abi.encode(uint256(-1 - value)));\\n } else {\\n writeUInt256(buf, uint256(value));\\n }\\n }\\n\\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\\n }\\n\\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\\n if(value >= 0) {\\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\\n } else{\\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\\n }\\n }\\n\\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\\n buf.buf.append(value);\\n }\\n\\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\\n buf.buf.append(bytes(value));\\n }\\n\\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\\n }\\n\\n function writeNull(CBORBuffer memory buf) internal pure {\\n writeContentFree(buf, CBOR_NULL);\\n }\\n\\n function writeUndefined(CBORBuffer memory buf) internal pure {\\n writeContentFree(buf, CBOR_UNDEFINED);\\n }\\n\\n function startArray(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\\n buf.depth += 1;\\n }\\n\\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\\n }\\n\\n function startMap(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\\n buf.depth += 1;\\n }\\n\\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\\n }\\n\\n function endSequence(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\\n buf.depth -= 1;\\n }\\n\\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\\n writeString(buf, key);\\n writeString(buf, value);\\n }\\n\\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\\n writeString(buf, key);\\n writeBytes(buf, value);\\n }\\n\\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\\n writeString(buf, key);\\n writeUInt256(buf, value);\\n }\\n\\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\\n writeString(buf, key);\\n writeInt256(buf, value);\\n }\\n\\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\\n writeString(buf, key);\\n writeUInt64(buf, value);\\n }\\n\\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\\n writeString(buf, key);\\n writeInt64(buf, value);\\n }\\n\\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\\n writeString(buf, key);\\n writeBool(buf, value);\\n }\\n\\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n writeNull(buf);\\n }\\n\\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n writeUndefined(buf);\\n }\\n\\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n startMap(buf);\\n }\\n\\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n startArray(buf);\\n }\\n\\n function writeFixedNumeric(\\n CBORBuffer memory buf,\\n uint8 major,\\n uint64 value\\n ) private pure {\\n if (value <= 23) {\\n buf.buf.appendUint8(uint8((major << 5) | value));\\n } else if (value <= 0xFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 24));\\n buf.buf.appendInt(value, 1);\\n } else if (value <= 0xFFFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 25));\\n buf.buf.appendInt(value, 2);\\n } else if (value <= 0xFFFFFFFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 26));\\n buf.buf.appendInt(value, 4);\\n } else {\\n buf.buf.appendUint8(uint8((major << 5) | 27));\\n buf.buf.appendInt(value, 8);\\n }\\n }\\n\\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\\n private\\n pure\\n {\\n buf.buf.appendUint8(uint8((major << 5) | 31));\\n }\\n\\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\\n private\\n pure\\n {\\n writeFixedNumeric(buf, major, length);\\n }\\n\\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\\n }\\n}\",\"keccak256\":\"0xdecf04203502670ac72ba466c75e4f87f4419907365005f0d73e7d07ee3e5715\",\"license\":\"MIT\"},\"contracts/CCExampleClient.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {ICCGatewayClient} from \\\"./interfaces/ICCGatewayClient.sol\\\";\\nimport {ICCGateway} from \\\"./interfaces/ICCGateway.sol\\\";\\n\\ncontract CCExampleClient is ICCGatewayClient {\\n ICCGateway private immutable gateway;\\n\\n uint64 public subscriptionId = 0;\\n bytes public encryptedSecretsReference = \\\"\\\";\\n\\n event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response);\\n event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error);\\n\\n constructor(address gatewayAddress) {\\n gateway = ICCGateway(gatewayAddress);\\n }\\n\\n function updateSubscriptionId(uint64 _subscriptionId) external {\\n subscriptionId = _subscriptionId;\\n }\\n\\n function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external {\\n encryptedSecretsReference = _encryptedSecretsReference;\\n }\\n\\n function request(string[] calldata args, bytes[] calldata bytesArgs) external {\\n require(subscriptionId != 0, \\\"Subscription ID not set\\\");\\n\\n gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference);\\n }\\n\\n function callback(bytes32 requestId) external override {\\n ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true);\\n\\n if (response.state == ICCGatewayClient.CCGResponseState.Success) {\\n emit ResponseReceived(response.subscriptionId, requestId, string(response.data));\\n } else {\\n emit ErrorReceived(response.subscriptionId, requestId, string(response.error));\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf905275976390214962167d4896d9c0eab670fce2b5f5cfd213b1ae2d776347a\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/ICCGateway.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\\nimport {FunctionsRequest} from \\\"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\\\";\\n\\ninterface ICCGateway {\\n struct CCGRequest {\\n string name;\\n uint32 callbackGasLimit;\\n FunctionsRequest.Request config;\\n }\\n\\n /**\\n * @dev Can't register a request with an empty name\\n */\\n error CCGRequestNameEmpty();\\n\\n /**\\n * @dev Only the same source of the requestId is allowed to call the function\\n */\\n error CCGOnlySameSourceAllowed(bytes32 requestId);\\n\\n /**\\n * @dev Only a registered subscriptionId is allowed to call the function\\n */\\n error CCGRequestNotRegistered(uint64 subscriptionId);\\n\\n /**\\n * @dev Can't fulfill a request that has already been fulfilled\\n */\\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\\n\\n /**\\n * @dev Only A manager can call the function\\n */\\n error CCGOnlyManagerAllowed();\\n\\n /**\\n * @dev Send a request to the Functions DON\\n */\\n function sendRequest(\\n uint64 subscriptionId,\\n string[] calldata args,\\n bytes[] calldata bytesArgs,\\n bytes calldata encryptedSecretsReference\\n ) external returns (bytes32 requestId);\\n\\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\\n}\\n\",\"keccak256\":\"0xbc7d92f8db240767c8636e8df9b818cc1f5abfde22b8c49eee50f418fb0dbea5\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/ICCGatewayClient.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\ninterface ICCGatewayClient {\\n enum CCGResponseState {Sent, Success, Error}\\n\\n struct CCGResponse {\\n uint64 subscriptionId;\\n address source;\\n CCGResponseState state;\\n bytes data;\\n bytes error;\\n }\\n\\n function callback(bytes32 requestId) external;\\n}\\n\",\"keccak256\":\"0xb69320aa2152f374dec4cfc70b73f46e0db9774a1411d2acff1481ee3295f86a\",\"license\":\"UNLICENSED\"}},\"version\":1}", + "bytecode": "0x600080546001600160401b031916815560c060405260a090815260019062000028908262000110565b503480156200003657600080fd5b5060405162000d6a38038062000d6a8339810160408190526200005991620001dc565b6001600160a01b03166080526200020e565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200009657607f821691505b602082108103620000b757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200010b57600081815260208120601f850160051c81016020861015620000e65750805b601f850160051c820191505b818110156200010757828155600101620000f2565b5050505b505050565b81516001600160401b038111156200012c576200012c6200006b565b62000144816200013d845462000081565b84620000bd565b602080601f8311600181146200017c5760008415620001635750858301515b600019600386901b1c1916600185901b17855562000107565b600085815260208120601f198616915b82811015620001ad578886015182559484019460019091019084016200018c565b5085821015620001cc5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215620001ef57600080fd5b81516001600160a01b03811681146200020757600080fd5b9392505050565b608051610b39620002316000396000818161023101526102e30152610b396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806309c1ba2e1461006757806314b1dd1b146100975780634ce64f0e146100ca578063cdc634f1146100dd578063cfd58386146100f2578063df13994e14610105575b600080fd5b60005461007a906001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b6100c86100a5366004610415565b6000805467ffffffffffffffff19166001600160401b0392909216919091179055565b005b6100c86100d8366004610439565b610118565b6100e561012a565b60405161008e91906104fa565b6100c8610100366004610558565b6101b8565b6100c86101133660046105c3565b6102c3565b600161012582848361067a565b505050565b60018054610137906105f2565b80601f0160208091040260200160405190810160405280929190818152602001828054610163906105f2565b80156101b05780601f10610185576101008083540402835291602001916101b0565b820191906000526020600020905b81548152906001019060200180831161019357829003601f168201915b505050505081565b600080546001600160401b031690036102175760405162461bcd60e51b815260206004820152601760248201527f537562736372697074696f6e204944206e6f7420736574000000000000000000604482015260640160405180910390fd5b600054604051634b60ac1760e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916396c1582e91610279916001600160401b0316908890889088908890600190600401610824565b6020604051808303816000875af1158015610298573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bc919061090d565b5050505050565b6040516315b851d160e01b815260048101829052600160248201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906315b851d1906044016000604051808303816000875af1158015610334573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261035c91908101906109e9565b905060018160400151600281111561037657610376610abc565b036103c2577fa5522492de1ed169e1e5e76f6cb2ceb5f045ca7f7ea5da3137c573d996cc4b9f81600001518383606001516040516103b693929190610ad2565b60405180910390a15050565b7f331e0adccd60eab7ca94cf49c60a45549ce9dc1281139656a13bdf73774d179c81600001518383608001516040516103b693929190610ad2565b6001600160401b038116811461041257600080fd5b50565b60006020828403121561042757600080fd5b8135610432816103fd565b9392505050565b6000806020838503121561044c57600080fd5b82356001600160401b038082111561046357600080fd5b818501915085601f83011261047757600080fd5b81358181111561048657600080fd5b86602082850101111561049857600080fd5b60209290920196919550909350505050565b60005b838110156104c55781810151838201526020016104ad565b50506000910152565b600081518084526104e68160208601602086016104aa565b601f01601f19169290920160200192915050565b60208152600061043260208301846104ce565b60008083601f84011261051f57600080fd5b5081356001600160401b0381111561053657600080fd5b6020830191508360208260051b850101111561055157600080fd5b9250929050565b6000806000806040858703121561056e57600080fd5b84356001600160401b038082111561058557600080fd5b6105918883890161050d565b909650945060208701359150808211156105aa57600080fd5b506105b78782880161050d565b95989497509550505050565b6000602082840312156105d557600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061060657607f821691505b60208210810361062657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561012557600081815260208120601f850160051c810160208610156106535750805b601f850160051c820191505b818110156106725782815560010161065f565b505050505050565b6001600160401b03831115610691576106916105dc565b6106a58361069f83546105f2565b8361062c565b6000601f8411600181146106d957600085156106c15750838201355b600019600387901b1c1916600186901b1783556102bc565b600083815260209020601f19861690835b8281101561070a57868501358255602094850194600190920191016106ea565b50868210156107275760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000808335601e1984360301811261077957600080fd5b83016020810192503590506001600160401b0381111561079857600080fd5b80360382131561055157600080fd5b600081546107b4816105f2565b8085526020600183811680156107d157600181146107eb57610819565b60ff1985168884015283151560051b880183019550610819565b866000528260002060005b858110156108115781548a82018601529083019084016107f6565b890184019650505b505050505092915050565b6000608082016001600160401b038916835260206080818501528188835260a08501905060a08960051b86010192508960005b8a81101561089157868503609f19018352610872828d610762565b61087d878284610739565b965050509183019190830190600101610857565b5050508382036040850152858252808201600587901b830182018860005b898110156108e957858303601f190184526108ca828c610762565b6108d5858284610739565b9587019594505050908401906001016108af565b505085810360608701526108fd81886107a7565b9c9b505050505050505050505050565b60006020828403121561091f57600080fd5b5051919050565b60405160a081016001600160401b0381118282101715610948576109486105dc565b60405290565b80516003811061095d57600080fd5b919050565b600082601f83011261097357600080fd5b81516001600160401b038082111561098d5761098d6105dc565b604051601f8301601f19908116603f011681019082821181831017156109b5576109b56105dc565b816040528381528660208588010111156109ce57600080fd5b6109df8460208301602089016104aa565b9695505050505050565b6000602082840312156109fb57600080fd5b81516001600160401b0380821115610a1257600080fd5b9083019060a08286031215610a2657600080fd5b610a2e610926565b8251610a39816103fd565b815260208301516001600160a01b0381168114610a5557600080fd5b6020820152610a666040840161094e565b6040820152606083015182811115610a7d57600080fd5b610a8987828601610962565b606083015250608083015182811115610aa157600080fd5b610aad87828601610962565b60808301525095945050505050565b634e487b7160e01b600052602160045260246000fd5b6001600160401b0384168152826020820152606060408201526000610afa60608301846104ce565b9594505050505056fea26469706673582212209c23a4aa128701447d0247b6e250fc1aeb5f0bdf6334f1ef0fdcdc125482ae6a64736f6c63430008140033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100625760003560e01c806309c1ba2e1461006757806314b1dd1b146100975780634ce64f0e146100ca578063cdc634f1146100dd578063cfd58386146100f2578063df13994e14610105575b600080fd5b60005461007a906001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b6100c86100a5366004610415565b6000805467ffffffffffffffff19166001600160401b0392909216919091179055565b005b6100c86100d8366004610439565b610118565b6100e561012a565b60405161008e91906104fa565b6100c8610100366004610558565b6101b8565b6100c86101133660046105c3565b6102c3565b600161012582848361067a565b505050565b60018054610137906105f2565b80601f0160208091040260200160405190810160405280929190818152602001828054610163906105f2565b80156101b05780601f10610185576101008083540402835291602001916101b0565b820191906000526020600020905b81548152906001019060200180831161019357829003601f168201915b505050505081565b600080546001600160401b031690036102175760405162461bcd60e51b815260206004820152601760248201527f537562736372697074696f6e204944206e6f7420736574000000000000000000604482015260640160405180910390fd5b600054604051634b60ac1760e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916396c1582e91610279916001600160401b0316908890889088908890600190600401610824565b6020604051808303816000875af1158015610298573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bc919061090d565b5050505050565b6040516315b851d160e01b815260048101829052600160248201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906315b851d1906044016000604051808303816000875af1158015610334573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261035c91908101906109e9565b905060018160400151600281111561037657610376610abc565b036103c2577fa5522492de1ed169e1e5e76f6cb2ceb5f045ca7f7ea5da3137c573d996cc4b9f81600001518383606001516040516103b693929190610ad2565b60405180910390a15050565b7f331e0adccd60eab7ca94cf49c60a45549ce9dc1281139656a13bdf73774d179c81600001518383608001516040516103b693929190610ad2565b6001600160401b038116811461041257600080fd5b50565b60006020828403121561042757600080fd5b8135610432816103fd565b9392505050565b6000806020838503121561044c57600080fd5b82356001600160401b038082111561046357600080fd5b818501915085601f83011261047757600080fd5b81358181111561048657600080fd5b86602082850101111561049857600080fd5b60209290920196919550909350505050565b60005b838110156104c55781810151838201526020016104ad565b50506000910152565b600081518084526104e68160208601602086016104aa565b601f01601f19169290920160200192915050565b60208152600061043260208301846104ce565b60008083601f84011261051f57600080fd5b5081356001600160401b0381111561053657600080fd5b6020830191508360208260051b850101111561055157600080fd5b9250929050565b6000806000806040858703121561056e57600080fd5b84356001600160401b038082111561058557600080fd5b6105918883890161050d565b909650945060208701359150808211156105aa57600080fd5b506105b78782880161050d565b95989497509550505050565b6000602082840312156105d557600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061060657607f821691505b60208210810361062657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561012557600081815260208120601f850160051c810160208610156106535750805b601f850160051c820191505b818110156106725782815560010161065f565b505050505050565b6001600160401b03831115610691576106916105dc565b6106a58361069f83546105f2565b8361062c565b6000601f8411600181146106d957600085156106c15750838201355b600019600387901b1c1916600186901b1783556102bc565b600083815260209020601f19861690835b8281101561070a57868501358255602094850194600190920191016106ea565b50868210156107275760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000808335601e1984360301811261077957600080fd5b83016020810192503590506001600160401b0381111561079857600080fd5b80360382131561055157600080fd5b600081546107b4816105f2565b8085526020600183811680156107d157600181146107eb57610819565b60ff1985168884015283151560051b880183019550610819565b866000528260002060005b858110156108115781548a82018601529083019084016107f6565b890184019650505b505050505092915050565b6000608082016001600160401b038916835260206080818501528188835260a08501905060a08960051b86010192508960005b8a81101561089157868503609f19018352610872828d610762565b61087d878284610739565b965050509183019190830190600101610857565b5050508382036040850152858252808201600587901b830182018860005b898110156108e957858303601f190184526108ca828c610762565b6108d5858284610739565b9587019594505050908401906001016108af565b505085810360608701526108fd81886107a7565b9c9b505050505050505050505050565b60006020828403121561091f57600080fd5b5051919050565b60405160a081016001600160401b0381118282101715610948576109486105dc565b60405290565b80516003811061095d57600080fd5b919050565b600082601f83011261097357600080fd5b81516001600160401b038082111561098d5761098d6105dc565b604051601f8301601f19908116603f011681019082821181831017156109b5576109b56105dc565b816040528381528660208588010111156109ce57600080fd5b6109df8460208301602089016104aa565b9695505050505050565b6000602082840312156109fb57600080fd5b81516001600160401b0380821115610a1257600080fd5b9083019060a08286031215610a2657600080fd5b610a2e610926565b8251610a39816103fd565b815260208301516001600160a01b0381168114610a5557600080fd5b6020820152610a666040840161094e565b6040820152606083015182811115610a7d57600080fd5b610a8987828601610962565b606083015250608083015182811115610aa157600080fd5b610aad87828601610962565b60808301525095945050505050565b634e487b7160e01b600052602160045260246000fd5b6001600160401b0384168152826020820152606060408201526000610afa60608301846104ce565b9594505050505056fea26469706673582212209c23a4aa128701447d0247b6e250fc1aeb5f0bdf6334f1ef0fdcdc125482ae6a64736f6c63430008140033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 2081, + "contract": "contracts/CCExampleClient.sol:CCExampleClient", + "label": "subscriptionId", + "offset": 0, + "slot": "0", + "type": "t_uint64" + }, + { + "astId": 2084, + "contract": "contracts/CCExampleClient.sol:CCExampleClient", + "label": "encryptedSecretsReference", + "offset": 0, + "slot": "1", + "type": "t_bytes_storage" + } + ], + "types": { + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_uint64": { + "encoding": "inplace", + "label": "uint64", + "numberOfBytes": "8" + } + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/baseSepolia/CCGateway.json b/packages/hardhat/deployments/baseSepolia/CCGateway.json new file mode 100644 index 0000000..5c4465c --- /dev/null +++ b/packages/hardhat/deployments/baseSepolia/CCGateway.json @@ -0,0 +1,1132 @@ +{ + "address": "0x52bfF133bc6A891828baB02fB7338fB943E8D078", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "router", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "initialDonId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AccessControlBadConfirmation", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "neededRole", + "type": "bytes32" + } + ], + "name": "AccessControlUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [], + "name": "CCGOnlyManagerAllowed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + } + ], + "name": "CCGOnlySameSourceAllowed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + } + ], + "name": "CCGRequestAlreadyFulfilled", + "type": "error" + }, + { + "inputs": [], + "name": "CCGRequestNameEmpty", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + } + ], + "name": "CCGRequestNotRegistered", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyArgs", + "type": "error" + }, + { + "inputs": [], + "name": "EmptySource", + "type": "error" + }, + { + "inputs": [], + "name": "NoInlineSecrets", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyRouterCanFulfill", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "RequestFulfilled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "RequestSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "CLIENT_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MANAGER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "donId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + } + ], + "name": "getRequest", + "outputs": [ + { + "components": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "uint32", + "name": "callbackGasLimit", + "type": "uint32" + }, + { + "components": [ + { + "internalType": "enum FunctionsRequest.Location", + "name": "codeLocation", + "type": "uint8" + }, + { + "internalType": "enum FunctionsRequest.Location", + "name": "secretsLocation", + "type": "uint8" + }, + { + "internalType": "enum FunctionsRequest.CodeLanguage", + "name": "language", + "type": "uint8" + }, + { + "internalType": "string", + "name": "source", + "type": "string" + }, + { + "internalType": "bytes", + "name": "encryptedSecretsReference", + "type": "bytes" + }, + { + "internalType": "string[]", + "name": "args", + "type": "string[]" + }, + { + "internalType": "bytes[]", + "name": "bytesArgs", + "type": "bytes[]" + } + ], + "internalType": "struct FunctionsRequest.Request", + "name": "config", + "type": "tuple" + } + ], + "internalType": "struct ICCGateway.CCGRequest", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "remove", + "type": "bool" + } + ], + "name": "getResponse", + "outputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "internalType": "address", + "name": "source", + "type": "address" + }, + { + "internalType": "enum ICCGatewayClient.CCGResponseState", + "name": "state", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "error", + "type": "bytes" + } + ], + "internalType": "struct ICCGatewayClient.CCGResponse", + "name": "response", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "response", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "err", + "type": "bytes" + } + ], + "name": "handleOracleFulfillment", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "internalType": "enum FunctionsRequest.Location", + "name": "codeLocation", + "type": "uint8" + }, + { + "internalType": "string", + "name": "source", + "type": "string" + }, + { + "internalType": "enum FunctionsRequest.Location", + "name": "secretsLocation", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "encryptedSecretsReference", + "type": "bytes" + }, + { + "internalType": "uint32", + "name": "callbackGasLimit", + "type": "uint32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "registerRequest", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + } + ], + "name": "removeRequest", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "callerConfirmation", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "internalType": "string[]", + "name": "args", + "type": "string[]" + }, + { + "internalType": "bytes[]", + "name": "bytesArgs", + "type": "bytes[]" + }, + { + "internalType": "bytes", + "name": "encryptedSecretsReference", + "type": "bytes" + } + ], + "name": "sendRequest", + "outputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "newDonId", + "type": "bytes32" + } + ], + "name": "setDonId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "subscriptions", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x9690b9146d57823482b64d57ccd8c5a02e70cb5b053731805f3bb68a33ee350e", + "receipt": { + "to": null, + "from": "0xD10F43A0aa00D244DAcFBE3C49b9B918B717Ff2c", + "contractAddress": "0x52bfF133bc6A891828baB02fB7338fB943E8D078", + "transactionIndex": 3, + "gasUsed": "2639963", + "logsBloom": "0x00000004000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000100000000000000000000000000000000000000000000020000000004000008000800000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000020000000000000000000080000100000000000020000000000000000000000000000000000000000000000000000000002000000000", + "blockHash": "0xf0eeb2a4d910ed0ed97595a2f5f55244e1f061fe30fce41f4811557d094750cc", + "transactionHash": "0x9690b9146d57823482b64d57ccd8c5a02e70cb5b053731805f3bb68a33ee350e", + "logs": [ + { + "transactionIndex": 3, + "blockNumber": 10770575, + "transactionHash": "0x9690b9146d57823482b64d57ccd8c5a02e70cb5b053731805f3bb68a33ee350e", + "address": "0x52bfF133bc6A891828baB02fB7338fB943E8D078", + "topics": [ + "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000d10f43a0aa00d244dacfbe3c49b9b918b717ff2c", + "0x000000000000000000000000d10f43a0aa00d244dacfbe3c49b9b918b717ff2c" + ], + "data": "0x", + "logIndex": 13, + "blockHash": "0xf0eeb2a4d910ed0ed97595a2f5f55244e1f061fe30fce41f4811557d094750cc" + }, + { + "transactionIndex": 3, + "blockNumber": 10770575, + "transactionHash": "0x9690b9146d57823482b64d57ccd8c5a02e70cb5b053731805f3bb68a33ee350e", + "address": "0x52bfF133bc6A891828baB02fB7338fB943E8D078", + "topics": [ + "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", + "0x241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08", + "0x000000000000000000000000d10f43a0aa00d244dacfbe3c49b9b918b717ff2c", + "0x000000000000000000000000d10f43a0aa00d244dacfbe3c49b9b918b717ff2c" + ], + "data": "0x", + "logIndex": 14, + "blockHash": "0xf0eeb2a4d910ed0ed97595a2f5f55244e1f061fe30fce41f4811557d094750cc" + } + ], + "blockNumber": 10770575, + "cumulativeGasUsed": "3174950", + "status": 1, + "byzantium": true + }, + "args": [ + "0xf9B8fc078197181C841c296C876945aaa425B278", + "0x66756e2d626173652d7365706f6c69612d310000000000000000000000000000", + "0xD10F43A0aa00D244DAcFBE3C49b9B918B717Ff2c" + ], + "numDeployments": 2, + "solcInputHash": "be18bfdeea6869d68a166c8869814257", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"initialDonId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"initialOwner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AccessControlBadConfirmation\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"neededRole\",\"type\":\"bytes32\"}],\"name\":\"AccessControlUnauthorizedAccount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CCGOnlyManagerAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"CCGOnlySameSourceAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"CCGRequestAlreadyFulfilled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CCGRequestNameEmpty\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"}],\"name\":\"CCGRequestNotRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EmptyArgs\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EmptySource\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoInlineSecrets\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyRouterCanFulfill\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"RequestFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"RequestSent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"CLIENT_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MANAGER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"donId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"}],\"name\":\"getRequest\",\"outputs\":[{\"components\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"components\":[{\"internalType\":\"enum FunctionsRequest.Location\",\"name\":\"codeLocation\",\"type\":\"uint8\"},{\"internalType\":\"enum FunctionsRequest.Location\",\"name\":\"secretsLocation\",\"type\":\"uint8\"},{\"internalType\":\"enum FunctionsRequest.CodeLanguage\",\"name\":\"language\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"source\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"encryptedSecretsReference\",\"type\":\"bytes\"},{\"internalType\":\"string[]\",\"name\":\"args\",\"type\":\"string[]\"},{\"internalType\":\"bytes[]\",\"name\":\"bytesArgs\",\"type\":\"bytes[]\"}],\"internalType\":\"struct FunctionsRequest.Request\",\"name\":\"config\",\"type\":\"tuple\"}],\"internalType\":\"struct ICCGateway.CCGRequest\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"remove\",\"type\":\"bool\"}],\"name\":\"getResponse\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"source\",\"type\":\"address\"},{\"internalType\":\"enum ICCGatewayClient.CCGResponseState\",\"name\":\"state\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"error\",\"type\":\"bytes\"}],\"internalType\":\"struct ICCGatewayClient.CCGResponse\",\"name\":\"response\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"response\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"err\",\"type\":\"bytes\"}],\"name\":\"handleOracleFulfillment\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"internalType\":\"enum FunctionsRequest.Location\",\"name\":\"codeLocation\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"source\",\"type\":\"string\"},{\"internalType\":\"enum FunctionsRequest.Location\",\"name\":\"secretsLocation\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"encryptedSecretsReference\",\"type\":\"bytes\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"registerRequest\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"}],\"name\":\"removeRequest\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"callerConfirmation\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"internalType\":\"string[]\",\"name\":\"args\",\"type\":\"string[]\"},{\"internalType\":\"bytes[]\",\"name\":\"bytesArgs\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"encryptedSecretsReference\",\"type\":\"bytes\"}],\"name\":\"sendRequest\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"newDonId\",\"type\":\"bytes32\"}],\"name\":\"setDonId\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"subscriptions\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"AccessControlBadConfirmation()\":[{\"details\":\"The caller of a function is not the expected one. NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\"}],\"AccessControlUnauthorizedAccount(address,bytes32)\":[{\"details\":\"The `account` is missing a role.\"}],\"CCGOnlyManagerAllowed()\":[{\"details\":\"Only A manager can call the function\"}],\"CCGOnlySameSourceAllowed(bytes32)\":[{\"details\":\"Only the same source of the requestId is allowed to call the function\"}],\"CCGRequestAlreadyFulfilled(bytes32)\":[{\"details\":\"Can't fulfill a request that has already been fulfilled\"}],\"CCGRequestNameEmpty()\":[{\"details\":\"Can't register a request with an empty name\"}],\"CCGRequestNotRegistered(uint64)\":[{\"details\":\"Only a registered subscriptionId is allowed to call the function\"}]},\"events\":{\"RoleAdminChanged(bytes32,bytes32,bytes32)\":{\"details\":\"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this.\"},\"RoleGranted(bytes32,address,address)\":{\"details\":\"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.\"},\"RoleRevoked(bytes32,address,address)\":{\"details\":\"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)\"}},\"kind\":\"dev\",\"methods\":{\"donId()\":{\"details\":\"Get the DON ID\",\"returns\":{\"_0\":\"DON ID\"}},\"getResponse(bytes32,bool)\":{\"details\":\"Get the response data\",\"params\":{\"requestId\":\"The request ID, returned by sendRequest()\"},\"returns\":{\"response\":\"CCGResponse\"}},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"handleOracleFulfillment(bytes32,bytes,bytes)\":{\"details\":\"Either response or error parameter will be set, but never both.\",\"params\":{\"err\":\"Aggregated error either from the request's source code or from the execution pipeline.\",\"requestId\":\"The requestId returned by FunctionsClient.sendRequest().\",\"response\":\"Aggregated response from the request's source code.\"}},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `callerConfirmation`. May emit a {RoleRevoked} event.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"sendRequest(uint64,string[],bytes[],bytes)\":{\"params\":{\"args\":\"String arguments passed into the source code and accessible via the global variable `args`\",\"bytesArgs\":\"Bytes arguments passed into the source code and accessible via the global variable `bytesArgs` as hex strings\",\"encryptedSecretsReference\":\"Reference pointing to encrypted secrets\",\"subscriptionId\":\"Subscription ID used to pay for request (FunctionsConsumer contract address must first be added to the subscription)\"}},\"setDonId(bytes32)\":{\"details\":\"Set the DON ID\",\"params\":{\"newDonId\":\"New DON ID\"}},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"handleOracleFulfillment(bytes32,bytes,bytes)\":{\"notice\":\"Chainlink Functions response handler called by the Functions Router during fullilment from the designated transmitter node in an OCR round.\"},\"sendRequest(uint64,string[],bytes[],bytes)\":{\"notice\":\"Triggers an on-demand Functions request using remote encrypted secrets\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/CCGateway.sol\":\"CCGateway\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {IFunctionsRouter} from \\\"./interfaces/IFunctionsRouter.sol\\\";\\nimport {IFunctionsClient} from \\\"./interfaces/IFunctionsClient.sol\\\";\\n\\nimport {FunctionsRequest} from \\\"./libraries/FunctionsRequest.sol\\\";\\n\\n/// @title The Chainlink Functions client contract\\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\\nabstract contract FunctionsClient is IFunctionsClient {\\n using FunctionsRequest for FunctionsRequest.Request;\\n\\n IFunctionsRouter internal immutable i_router;\\n\\n event RequestSent(bytes32 indexed id);\\n event RequestFulfilled(bytes32 indexed id);\\n\\n error OnlyRouterCanFulfill();\\n\\n constructor(address router) {\\n i_router = IFunctionsRouter(router);\\n }\\n\\n /// @notice Sends a Chainlink Functions request\\n /// @param data The CBOR encoded bytes data for a Functions request\\n /// @param subscriptionId The subscription ID that will be charged to service the request\\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\\n /// @return requestId The generated request ID for this request\\n function _sendRequest(\\n bytes memory data,\\n uint64 subscriptionId,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) internal returns (bytes32) {\\n bytes32 requestId = i_router.sendRequest(\\n subscriptionId,\\n data,\\n FunctionsRequest.REQUEST_DATA_VERSION,\\n callbackGasLimit,\\n donId\\n );\\n emit RequestSent(requestId);\\n return requestId;\\n }\\n\\n /// @notice User defined function to handle a response from the DON\\n /// @param requestId The request ID, returned by sendRequest()\\n /// @param response Aggregated response from the execution of the user's source code\\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\\n /// @dev Either response or error parameter will be set, but never both\\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\\n\\n /// @inheritdoc IFunctionsClient\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\\n if (msg.sender != address(i_router)) {\\n revert OnlyRouterCanFulfill();\\n }\\n fulfillRequest(requestId, response, err);\\n emit RequestFulfilled(requestId);\\n }\\n}\\n\",\"keccak256\":\"0x40224641403cb9fa03d4f060296d7420a9ff11b46abadc958ae048459205e397\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\n/// @title Chainlink Functions client interface.\\ninterface IFunctionsClient {\\n /// @notice Chainlink Functions response handler called by the Functions Router\\n /// during fullilment from the designated transmitter node in an OCR round.\\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\\n /// @param response Aggregated response from the request's source code.\\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\\n /// @dev Either response or error parameter will be set, but never both.\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\\n}\\n\",\"keccak256\":\"0x6117b82e7c4eec44ce557b0fc8bc1ac5f49e5d160ac6d4485452d6aafdd762ff\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {FunctionsResponse} from \\\"../libraries/FunctionsResponse.sol\\\";\\n\\n/// @title Chainlink Functions Router interface.\\ninterface IFunctionsRouter {\\n /// @notice The identifier of the route to retrieve the address of the access control contract\\n /// The access control contract controls which accounts can manage subscriptions\\n /// @return id - bytes32 id that can be passed to the \\\"getContractById\\\" of the Router\\n function getAllowListId() external view returns (bytes32);\\n\\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\\n /// The access control contract controls which accounts can manage subscriptions\\n function setAllowListId(bytes32 allowListId) external;\\n\\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\\n /// @return adminFee\\n function getAdminFee() external view returns (uint72 adminFee);\\n\\n /// @notice Sends a request using the provided subscriptionId\\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\\n /// a client can make requests from different contracts referencing the same subscription\\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\\n /// @param dataVersion - Gas limit for the fulfillment callback\\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\\n /// @param donId - An identifier used to determine which route to send the request along\\n /// @return requestId - A unique request identifier\\n function sendRequest(\\n uint64 subscriptionId,\\n bytes calldata data,\\n uint16 dataVersion,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) external returns (bytes32);\\n\\n /// @notice Sends a request to the proposed contracts\\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\\n /// a client can make requests from different contracts referencing the same subscription\\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\\n /// @param dataVersion - Gas limit for the fulfillment callback\\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\\n /// @param donId - An identifier used to determine which route to send the request along\\n /// @return requestId - A unique request identifier\\n function sendRequestToProposed(\\n uint64 subscriptionId,\\n bytes calldata data,\\n uint16 dataVersion,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) external returns (bytes32);\\n\\n /// @notice Fulfill the request by:\\n /// - calling back the data that the Oracle returned to the client contract\\n /// - pay the DON for processing the request\\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\\n /// @param response response data from DON consensus\\n /// @param err error from DON consensus\\n /// @param juelsPerGas - current rate of juels/gas\\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\\n /// @param transmitter - The Node that transmitted the OCR report\\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\\n /// @return fulfillResult -\\n /// @return callbackGasCostJuels -\\n function fulfill(\\n bytes memory response,\\n bytes memory err,\\n uint96 juelsPerGas,\\n uint96 costWithoutFulfillment,\\n address transmitter,\\n FunctionsResponse.Commitment memory commitment\\n ) external returns (FunctionsResponse.FulfillResult, uint96);\\n\\n /// @notice Validate requested gas limit is below the subscription max.\\n /// @param subscriptionId subscription ID\\n /// @param callbackGasLimit desired callback gas limit\\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\\n\\n /// @notice Get the current contract given an ID\\n /// @param id A bytes32 identifier for the route\\n /// @return contract The current contract address\\n function getContractById(bytes32 id) external view returns (address);\\n\\n /// @notice Get the proposed next contract given an ID\\n /// @param id A bytes32 identifier for the route\\n /// @return contract The current or proposed contract address\\n function getProposedContractById(bytes32 id) external view returns (address);\\n\\n /// @notice Return the latest proprosal set\\n /// @return ids The identifiers of the contracts to update\\n /// @return to The addresses of the contracts that will be updated to\\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\\n\\n /// @notice Proposes one or more updates to the contract routes\\n /// @dev Only callable by owner\\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\\n\\n /// @notice Updates the current contract routes to the proposed contracts\\n /// @dev Only callable by owner\\n function updateContracts() external;\\n\\n /// @dev Puts the system into an emergency stopped state.\\n /// @dev Only callable by owner\\n function pause() external;\\n\\n /// @dev Takes the system out of an emergency stopped state.\\n /// @dev Only callable by owner\\n function unpause() external;\\n}\\n\",\"keccak256\":\"0x44db41e8ff90c2828ca0ada125abc4b411921a86514a4a047fd9fd43ba9d7e08\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {CBOR} from \\\"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\\\";\\n\\n/// @title Library for encoding the input data of a Functions request into CBOR\\nlibrary FunctionsRequest {\\n using CBOR for CBOR.CBORBuffer;\\n\\n uint16 public constant REQUEST_DATA_VERSION = 1;\\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\\n\\n enum Location {\\n Inline, // Provided within the Request\\n Remote, // Hosted through remote location that can be accessed through a provided URL\\n DONHosted // Hosted on the DON's storage\\n }\\n\\n enum CodeLanguage {\\n JavaScript\\n // In future version we may add other languages\\n }\\n\\n struct Request {\\n Location codeLocation; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The location of the source code that will be executed on each node in the DON\\n Location secretsLocation; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The location of secrets that will be passed into the source code. *Only Remote secrets are supported\\n CodeLanguage language; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The coding language that the source code is written in\\n string source; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\\n bytes encryptedSecretsReference; // \\u2550\\u2550\\u2578 Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\\n string[] args; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 String arguments that will be passed into the source code\\n bytes[] bytesArgs; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Bytes arguments that will be passed into the source code\\n }\\n\\n error EmptySource();\\n error EmptySecrets();\\n error EmptyArgs();\\n error NoInlineSecrets();\\n\\n /// @notice Encodes a Request to CBOR encoded bytes\\n /// @param self The request to encode\\n /// @return CBOR encoded bytes\\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\\n\\n buffer.writeString(\\\"codeLocation\\\");\\n buffer.writeUInt256(uint256(self.codeLocation));\\n\\n buffer.writeString(\\\"language\\\");\\n buffer.writeUInt256(uint256(self.language));\\n\\n buffer.writeString(\\\"source\\\");\\n buffer.writeString(self.source);\\n\\n if (self.args.length > 0) {\\n buffer.writeString(\\\"args\\\");\\n buffer.startArray();\\n for (uint256 i = 0; i < self.args.length; ++i) {\\n buffer.writeString(self.args[i]);\\n }\\n buffer.endSequence();\\n }\\n\\n if (self.encryptedSecretsReference.length > 0) {\\n if (self.secretsLocation == Location.Inline) {\\n revert NoInlineSecrets();\\n }\\n buffer.writeString(\\\"secretsLocation\\\");\\n buffer.writeUInt256(uint256(self.secretsLocation));\\n buffer.writeString(\\\"secrets\\\");\\n buffer.writeBytes(self.encryptedSecretsReference);\\n }\\n\\n if (self.bytesArgs.length > 0) {\\n buffer.writeString(\\\"bytesArgs\\\");\\n buffer.startArray();\\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\\n buffer.writeBytes(self.bytesArgs[i]);\\n }\\n buffer.endSequence();\\n }\\n\\n return buffer.buf.buf;\\n }\\n\\n /// @notice Initializes a Chainlink Functions Request\\n /// @dev Sets the codeLocation and code on the request\\n /// @param self The uninitialized request\\n /// @param codeLocation The user provided source code location\\n /// @param language The programming language of the user code\\n /// @param source The user provided source code or a url\\n function initializeRequest(\\n Request memory self,\\n Location codeLocation,\\n CodeLanguage language,\\n string memory source\\n ) internal pure {\\n if (bytes(source).length == 0) revert EmptySource();\\n\\n self.codeLocation = codeLocation;\\n self.language = language;\\n self.source = source;\\n }\\n\\n /// @notice Initializes a Chainlink Functions Request\\n /// @dev Simplified version of initializeRequest for PoC\\n /// @param self The uninitialized request\\n /// @param javaScriptSource The user provided JS code (must not be empty)\\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\\n }\\n\\n /// @notice Adds Remote user encrypted secrets to a Request\\n /// @param self The initialized request\\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\\n\\n self.secretsLocation = Location.Remote;\\n self.encryptedSecretsReference = encryptedSecretsReference;\\n }\\n\\n /// @notice Adds DON-hosted secrets reference to a Request\\n /// @param self The initialized request\\n /// @param slotID Slot ID of the user's secrets hosted on DON\\n /// @param version User data version (for the slotID)\\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\\n\\n buffer.writeString(\\\"slotID\\\");\\n buffer.writeUInt64(slotID);\\n buffer.writeString(\\\"version\\\");\\n buffer.writeUInt64(version);\\n\\n self.secretsLocation = Location.DONHosted;\\n self.encryptedSecretsReference = buffer.buf.buf;\\n }\\n\\n /// @notice Sets args for the user run function\\n /// @param self The initialized request\\n /// @param args The array of string args (must not be empty)\\n function setArgs(Request memory self, string[] memory args) internal pure {\\n if (args.length == 0) revert EmptyArgs();\\n\\n self.args = args;\\n }\\n\\n /// @notice Sets bytes args for the user run function\\n /// @param self The initialized request\\n /// @param args The array of bytes args (must not be empty)\\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\\n if (args.length == 0) revert EmptyArgs();\\n\\n self.bytesArgs = args;\\n }\\n}\\n\",\"keccak256\":\"0xed75be0eaba358d468f1fe18adc377d5044f57eff0070081f884a1f212d0adc2\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\n/// @title Library of types that are used for fulfillment of a Functions request\\nlibrary FunctionsResponse {\\n // Used to send request information from the Router to the Coordinator\\n struct RequestMeta {\\n bytes data; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\\n bytes32 flags; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Per-subscription flags\\n address requestingContract; // \\u2550\\u2550\\u2557 The client contract that is sending the request\\n uint96 availableBalance; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u255d Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\\n uint72 adminFee; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\\n uint64 subscriptionId; // \\u2551 Identifier of the billing subscription that will be charged for the request\\n uint64 initiatedRequests; // \\u2551 The number of requests that have been started\\n uint32 callbackGasLimit; // \\u2551 The amount of gas that the callback to the consuming contract will be given\\n uint16 dataVersion; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The version of the structure of the CBOR encoded request data\\n uint64 completedRequests; // \\u2550\\u2550\\u2550\\u2550\\u2557 The number of requests that have successfully completed or timed out\\n address subscriptionOwner; // \\u2550\\u2550\\u2550\\u255d The owner of the billing subscription\\n }\\n\\n enum FulfillResult {\\n FULFILLED, // 0\\n USER_CALLBACK_ERROR, // 1\\n INVALID_REQUEST_ID, // 2\\n COST_EXCEEDS_COMMITMENT, // 3\\n INSUFFICIENT_GAS_PROVIDED, // 4\\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\\n INVALID_COMMITMENT // 6\\n }\\n\\n struct Commitment {\\n bytes32 requestId; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 A unique identifier for a Chainlink Functions request\\n address coordinator; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 The Coordinator contract that manages the DON that is servicing a request\\n uint96 estimatedTotalCostJuels; // \\u2550\\u2550\\u2550\\u2550\\u255d The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\\n address client; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 The client contract that sent the request\\n uint64 subscriptionId; // \\u2551 Identifier of the billing subscription that will be charged for the request\\n uint32 callbackGasLimit; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The amount of gas that the callback to the consuming contract will be given\\n uint72 adminFee; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\\n uint72 donFee; // \\u2551 Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\\n uint40 gasOverheadBeforeCallback; // \\u2551 Represents the average gas execution cost before the fulfillment callback.\\n uint40 gasOverheadAfterCallback; // \\u2551 Represents the average gas execution cost after the fulfillment callback.\\n uint32 timeoutTimestamp; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The timestamp at which a request will be eligible to be timed out\\n }\\n}\\n\",\"keccak256\":\"0xc72eb037effef32146f7cd4086af00f44f28c8649d891e5e404fec5fda7e802b\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {IFunctionsRouter} from \\\"../v1_0_0/interfaces/IFunctionsRouter.sol\\\";\\nimport {IFunctionsClient} from \\\"../v1_0_0/interfaces/IFunctionsClient.sol\\\";\\n\\nimport {FunctionsRequest} from \\\"../v1_0_0/libraries/FunctionsRequest.sol\\\";\\n\\n/// @title The Chainlink Functions client contract\\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\\nabstract contract FunctionsClient is IFunctionsClient {\\n using FunctionsRequest for FunctionsRequest.Request;\\n\\n IFunctionsRouter internal immutable i_functionsRouter;\\n\\n event RequestSent(bytes32 indexed id);\\n event RequestFulfilled(bytes32 indexed id);\\n\\n error OnlyRouterCanFulfill();\\n\\n constructor(address router) {\\n i_functionsRouter = IFunctionsRouter(router);\\n }\\n\\n /// @notice Sends a Chainlink Functions request\\n /// @param data The CBOR encoded bytes data for a Functions request\\n /// @param subscriptionId The subscription ID that will be charged to service the request\\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\\n /// @return requestId The generated request ID for this request\\n function _sendRequest(\\n bytes memory data,\\n uint64 subscriptionId,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) internal returns (bytes32) {\\n bytes32 requestId = i_functionsRouter.sendRequest(\\n subscriptionId,\\n data,\\n FunctionsRequest.REQUEST_DATA_VERSION,\\n callbackGasLimit,\\n donId\\n );\\n emit RequestSent(requestId);\\n return requestId;\\n }\\n\\n /// @notice User defined function to handle a response from the DON\\n /// @param requestId The request ID, returned by sendRequest()\\n /// @param response Aggregated response from the execution of the user's source code\\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\\n /// @dev Either response or error parameter will be set, but never both\\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\\n\\n /// @inheritdoc IFunctionsClient\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\\n if (msg.sender != address(i_functionsRouter)) {\\n revert OnlyRouterCanFulfill();\\n }\\n _fulfillRequest(requestId, response, err);\\n emit RequestFulfilled(requestId);\\n }\\n}\\n\",\"keccak256\":\"0xdc40f1e9dea8a572d43d310afa68e978c35218d16097b9cfd9d1b6137df3cd0a\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-2-Clause\\npragma solidity ^0.8.4;\\n\\n/**\\n* @dev A library for working with mutable byte buffers in Solidity.\\n*\\n* Byte buffers are mutable and expandable, and provide a variety of primitives\\n* for appending to them. At any time you can fetch a bytes object containing the\\n* current contents of the buffer. The bytes object should not be stored between\\n* operations, as it may change due to resizing of the buffer.\\n*/\\nlibrary Buffer {\\n /**\\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\\n * a capacity. The capacity may be longer than the current value, in\\n * which case it can be extended without the need to allocate more memory.\\n */\\n struct buffer {\\n bytes buf;\\n uint capacity;\\n }\\n\\n /**\\n * @dev Initializes a buffer with an initial capacity.\\n * @param buf The buffer to initialize.\\n * @param capacity The number of bytes of space to allocate the buffer.\\n * @return The buffer, for chaining.\\n */\\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\\n if (capacity % 32 != 0) {\\n capacity += 32 - (capacity % 32);\\n }\\n // Allocate space for the buffer data\\n buf.capacity = capacity;\\n assembly {\\n let ptr := mload(0x40)\\n mstore(buf, ptr)\\n mstore(ptr, 0)\\n let fpm := add(32, add(ptr, capacity))\\n if lt(fpm, ptr) {\\n revert(0, 0)\\n }\\n mstore(0x40, fpm)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Initializes a new buffer from an existing bytes object.\\n * Changes to the buffer may mutate the original value.\\n * @param b The bytes object to initialize the buffer with.\\n * @return A new buffer.\\n */\\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\\n buffer memory buf;\\n buf.buf = b;\\n buf.capacity = b.length;\\n return buf;\\n }\\n\\n function resize(buffer memory buf, uint capacity) private pure {\\n bytes memory oldbuf = buf.buf;\\n init(buf, capacity);\\n append(buf, oldbuf);\\n }\\n\\n /**\\n * @dev Sets buffer length to 0.\\n * @param buf The buffer to truncate.\\n * @return The original buffer, for chaining..\\n */\\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\\n assembly {\\n let bufptr := mload(buf)\\n mstore(bufptr, 0)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to copy.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\\n require(len <= data.length);\\n\\n uint off = buf.buf.length;\\n uint newCapacity = off + len;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint dest;\\n uint src;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Length of existing buffer data\\n let buflen := mload(bufptr)\\n // Start address = buffer address + offset + sizeof(buffer length)\\n dest := add(add(bufptr, 32), off)\\n // Update buffer length if we're extending it\\n if gt(newCapacity, buflen) {\\n mstore(bufptr, newCapacity)\\n }\\n src := add(data, 32)\\n }\\n\\n // Copy word-length chunks while possible\\n for (; len >= 32; len -= 32) {\\n assembly {\\n mstore(dest, mload(src))\\n }\\n dest += 32;\\n src += 32;\\n }\\n\\n // Copy remaining bytes\\n unchecked {\\n uint mask = (256 ** (32 - len)) - 1;\\n assembly {\\n let srcpart := and(mload(src), not(mask))\\n let destpart := and(mload(dest), mask)\\n mstore(dest, or(destpart, srcpart))\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\\n return append(buf, data, data.length);\\n }\\n\\n /**\\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\\n * capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint offPlusOne = off + 1;\\n if (off >= buf.capacity) {\\n resize(buf, offPlusOne * 2);\\n }\\n\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + off\\n let dest := add(add(bufptr, off), 32)\\n mstore8(dest, data)\\n // Update buffer length if we extended it\\n if gt(offPlusOne, mload(bufptr)) {\\n mstore(bufptr, offPlusOne)\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (left-aligned).\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n unchecked {\\n uint mask = (256 ** len) - 1;\\n // Right-align data\\n data = data >> (8 * (32 - len));\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chhaining.\\n */\\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\\n return append(buf, bytes32(data), 20);\\n }\\n\\n /**\\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\\n return append(buf, data, 32);\\n }\\n\\n /**\\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (right-aligned).\\n * @return The original buffer.\\n */\\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint mask = (256 ** len) - 1;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n return buf;\\n }\\n}\",\"keccak256\":\"0x0d86b367813922094e02594a406ba89f5e97d3d74ec2ce3c4032566840e302b0\",\"license\":\"BSD-2-Clause\"},\"@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.4;\\n\\nimport \\\"../../@ensdomains/buffer/v0.1.0/Buffer.sol\\\";\\n\\n/**\\n* @dev A library for populating CBOR encoded payload in Solidity.\\n*\\n* https://datatracker.ietf.org/doc/html/rfc7049\\n*\\n* The library offers various write* and start* methods to encode values of different types.\\n* The resulted buffer can be obtained with data() method.\\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\\n* in an invalid CBOR if start/write/end flow is violated.\\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\\n* except for nested start/end pairs.\\n*/\\n\\nlibrary CBOR {\\n using Buffer for Buffer.buffer;\\n\\n struct CBORBuffer {\\n Buffer.buffer buf;\\n uint256 depth;\\n }\\n\\n uint8 private constant MAJOR_TYPE_INT = 0;\\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\\n uint8 private constant MAJOR_TYPE_BYTES = 2;\\n uint8 private constant MAJOR_TYPE_STRING = 3;\\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\\n uint8 private constant MAJOR_TYPE_MAP = 5;\\n uint8 private constant MAJOR_TYPE_TAG = 6;\\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\\n\\n uint8 private constant TAG_TYPE_BIGNUM = 2;\\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\\n\\n uint8 private constant CBOR_FALSE = 20;\\n uint8 private constant CBOR_TRUE = 21;\\n uint8 private constant CBOR_NULL = 22;\\n uint8 private constant CBOR_UNDEFINED = 23;\\n\\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\\n Buffer.init(cbor.buf, capacity);\\n cbor.depth = 0;\\n return cbor;\\n }\\n\\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\\n require(buf.depth == 0, \\\"Invalid CBOR\\\");\\n return buf.buf.buf;\\n }\\n\\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\\n writeBytes(buf, abi.encode(value));\\n }\\n\\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\\n if (value < 0) {\\n buf.buf.appendUint8(\\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\\n );\\n writeBytes(buf, abi.encode(uint256(-1 - value)));\\n } else {\\n writeUInt256(buf, uint256(value));\\n }\\n }\\n\\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\\n }\\n\\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\\n if(value >= 0) {\\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\\n } else{\\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\\n }\\n }\\n\\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\\n buf.buf.append(value);\\n }\\n\\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\\n buf.buf.append(bytes(value));\\n }\\n\\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\\n }\\n\\n function writeNull(CBORBuffer memory buf) internal pure {\\n writeContentFree(buf, CBOR_NULL);\\n }\\n\\n function writeUndefined(CBORBuffer memory buf) internal pure {\\n writeContentFree(buf, CBOR_UNDEFINED);\\n }\\n\\n function startArray(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\\n buf.depth += 1;\\n }\\n\\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\\n }\\n\\n function startMap(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\\n buf.depth += 1;\\n }\\n\\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\\n }\\n\\n function endSequence(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\\n buf.depth -= 1;\\n }\\n\\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\\n writeString(buf, key);\\n writeString(buf, value);\\n }\\n\\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\\n writeString(buf, key);\\n writeBytes(buf, value);\\n }\\n\\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\\n writeString(buf, key);\\n writeUInt256(buf, value);\\n }\\n\\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\\n writeString(buf, key);\\n writeInt256(buf, value);\\n }\\n\\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\\n writeString(buf, key);\\n writeUInt64(buf, value);\\n }\\n\\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\\n writeString(buf, key);\\n writeInt64(buf, value);\\n }\\n\\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\\n writeString(buf, key);\\n writeBool(buf, value);\\n }\\n\\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n writeNull(buf);\\n }\\n\\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n writeUndefined(buf);\\n }\\n\\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n startMap(buf);\\n }\\n\\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n startArray(buf);\\n }\\n\\n function writeFixedNumeric(\\n CBORBuffer memory buf,\\n uint8 major,\\n uint64 value\\n ) private pure {\\n if (value <= 23) {\\n buf.buf.appendUint8(uint8((major << 5) | value));\\n } else if (value <= 0xFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 24));\\n buf.buf.appendInt(value, 1);\\n } else if (value <= 0xFFFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 25));\\n buf.buf.appendInt(value, 2);\\n } else if (value <= 0xFFFFFFFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 26));\\n buf.buf.appendInt(value, 4);\\n } else {\\n buf.buf.appendUint8(uint8((major << 5) | 27));\\n buf.buf.appendInt(value, 8);\\n }\\n }\\n\\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\\n private\\n pure\\n {\\n buf.buf.appendUint8(uint8((major << 5) | 31));\\n }\\n\\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\\n private\\n pure\\n {\\n writeFixedNumeric(buf, major, length);\\n }\\n\\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\\n }\\n}\",\"keccak256\":\"0xdecf04203502670ac72ba466c75e4f87f4419907365005f0d73e7d07ee3e5715\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/AccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IAccessControl} from \\\"./IAccessControl.sol\\\";\\nimport {Context} from \\\"../utils/Context.sol\\\";\\nimport {ERC165} from \\\"../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```solidity\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```solidity\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\\n * to enforce additional security measures for this role.\\n */\\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\\n struct RoleData {\\n mapping(address account => bool) hasRole;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 role => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with an {AccessControlUnauthorizedAccount} error including the required role.\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role);\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\\n return _roles[role].hasRole[account];\\n }\\n\\n /**\\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\\n */\\n function _checkRole(bytes32 role) internal view virtual {\\n _checkRole(role, _msgSender());\\n }\\n\\n /**\\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\\n * is missing `role`.\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert AccessControlUnauthorizedAccount(account, role);\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `callerConfirmation`.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\\n if (callerConfirmation != _msgSender()) {\\n revert AccessControlBadConfirmation();\\n }\\n\\n _revokeRole(role, callerConfirmation);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\\n if (!hasRole(role, account)) {\\n _roles[role].hasRole[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\\n if (hasRole(role, account)) {\\n _roles[role].hasRole[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa0e92d42942f4f57c5be50568dac11e9d00c93efcb458026e18d2d9b9b2e7308\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev The `account` is missing a role.\\n */\\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\\n\\n /**\\n * @dev The caller of a function is not the expected one.\\n *\\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\\n */\\n error AccessControlBadConfirmation();\\n\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `callerConfirmation`.\\n */\\n function renounceRole(bytes32 role, address callerConfirmation) external;\\n}\\n\",\"keccak256\":\"0xb6b36edd6a2999fd243ff226d6cbf84bd71af2432bbd0dfe19392996a1d9cb41\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n function _contextSuffixLength() internal view virtual returns (uint256) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0x9e8778b14317ba9e256c30a76fd6c32b960af621987f56069e1e819c77c6a133\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x4296879f55019b23e135000eb36896057e7101fb7fb859c5ef690cf14643757b\",\"license\":\"MIT\"},\"contracts/CCGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport './interfaces/ICCGateway.sol';\\nimport {ICCGatewayClient} from './interfaces/ICCGatewayClient.sol';\\n\\nimport {FunctionsClient} from \\\"@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol\\\";\\nimport {AccessControl} from \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport {FunctionsRequest} from \\\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\\\";\\n\\ncontract CCGateway is ICCGateway, FunctionsClient, AccessControl {\\n using FunctionsRequest for FunctionsRequest.Request;\\n\\n bytes32 public constant MANAGER_ROLE = keccak256(\\\"MANAGER_ROLE\\\");\\n bytes32 public constant CLIENT_ROLE = keccak256(\\\"CLIENT_ROLE\\\");\\n bytes32 private _donId; // DON ID for the Functions DON to which the requests are sent\\n\\n mapping(uint64 subscriptionId => CCGRequest) private _requests; // Each subscription can only handle one kind of request\\n mapping(bytes32 requestId => ICCGatewayClient.CCGResponse) private unprocessed_responses; // Responses that have not been processed yet\\n\\n // array of registered subscriptions\\n uint64[] public subscriptions;\\n\\n constructor(address router, bytes32 initialDonId, address initialOwner) FunctionsClient(router) {\\n _donId = initialDonId;\\n\\n address to = address(0) == initialOwner ? _msgSender() : initialOwner;\\n _grantRole(DEFAULT_ADMIN_ROLE, to);\\n _grantRole(MANAGER_ROLE, to);\\n }\\n\\n /**\\n * @dev Set the DON ID\\n * @param newDonId New DON ID\\n */\\n function setDonId(bytes32 newDonId) external onlyRole(getRoleAdmin(MANAGER_ROLE)) {\\n _donId = newDonId;\\n }\\n\\n /**\\n * @dev Get the DON ID\\n * @return DON ID\\n */\\n function donId() external view returns (bytes32) {\\n return _donId;\\n }\\n\\n function registerRequest(\\n uint64 subscriptionId,\\n FunctionsRequest.Location codeLocation,\\n string calldata source,\\n FunctionsRequest.Location secretsLocation,\\n bytes calldata encryptedSecretsReference,\\n uint32 callbackGasLimit,\\n string calldata name\\n ) external onlyManager {\\n if (bytes(name).length == 0) {revert CCGRequestNameEmpty();}\\n\\n CCGRequest storage req = _requests[subscriptionId];\\n if(bytes(req.name).length == 0) {subscriptions.push(subscriptionId);}\\n\\n req.name = name;\\n req.callbackGasLimit = callbackGasLimit;\\n\\n // Only JavaScript is supported for now\\n req.config.language = FunctionsRequest.CodeLanguage.JavaScript;\\n req.config.codeLocation = codeLocation;\\n req.config.source = source;\\n req.config.secretsLocation = secretsLocation;\\n req.config.encryptedSecretsReference = encryptedSecretsReference;\\n }\\n\\n function removeRequest(uint64 subscriptionId) external onlyManager {\\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\\n delete _requests[subscriptionId];\\n\\n // Find the index of the subscriptionId in the subscriptions array\\n uint256 index = subscriptions.length;\\n for (uint256 i = 0; i < subscriptions.length; i++) {\\n if (index == subscriptions.length && subscriptions[i] == subscriptionId) index = i;\\n if (index != subscriptions.length && i + 1 < subscriptions.length) subscriptions[i] = subscriptions[i + 1];\\n }\\n\\n subscriptions.pop();\\n }\\n\\n function getRequest(uint64 subscriptionId) external view returns (CCGRequest memory) {\\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\\n return _requests[subscriptionId];\\n }\\n// ---------------------------------------------------------------------------------------------------------------------\\n modifier onlySource(bytes32 requestId) {\\n if (unprocessed_responses[requestId].source != _msgSender()) {revert CCGOnlySameSourceAllowed(requestId);}\\n _;\\n }\\n\\n modifier onlyManager() {\\n if (!hasRole(MANAGER_ROLE, tx.origin)) {revert CCGOnlyManagerAllowed();}\\n _;\\n }\\n// ---------------------------------------------------------------------------------------------------------------------\\n /**\\n * @notice Triggers an on-demand Functions request using remote encrypted secrets\\n * @param subscriptionId Subscription ID used to pay for request (FunctionsConsumer contract address must first be added to the subscription)\\n * @param args String arguments passed into the source code and accessible via the global variable `args`\\n * @param bytesArgs Bytes arguments passed into the source code and accessible via the global variable `bytesArgs` as hex strings\\n * @param encryptedSecretsReference Reference pointing to encrypted secrets\\n */\\n function sendRequest(\\n uint64 subscriptionId,\\n string[] calldata args,\\n bytes[] calldata bytesArgs,\\n bytes calldata encryptedSecretsReference\\n ) external onlyRole(CLIENT_ROLE) returns (bytes32 requestId) {\\n CCGRequest storage request = _requests[subscriptionId];\\n if (bytes(request.name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\\n\\n FunctionsRequest.Request memory req = request.config;\\n req.initializeRequest(req.codeLocation, FunctionsRequest.CodeLanguage.JavaScript, req.source);\\n if (encryptedSecretsReference.length > 0) {req.encryptedSecretsReference = encryptedSecretsReference;}\\n\\n if (args.length > 0) {\\n req.setArgs(args);\\n }\\n if (bytesArgs.length > 0) {\\n req.setBytesArgs(bytesArgs);\\n }\\n\\n requestId = _sendRequest(req.encodeCBOR(), subscriptionId, request.callbackGasLimit, _donId);\\n unprocessed_responses[requestId].state = ICCGatewayClient.CCGResponseState.Sent;\\n unprocessed_responses[requestId].source = _msgSender();\\n }\\n\\n /**\\n * @notice Store latest result/error\\n * @param requestId The request ID, returned by sendRequest()\\n * @param response Aggregated response from the user code\\n * @param err Aggregated error from the user code or from the execution pipeline\\n * Either response or error parameter will be set, but never both\\n */\\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal override {\\n ICCGatewayClient.CCGResponse storage resp = unprocessed_responses[requestId];\\n if (resp.state != ICCGatewayClient.CCGResponseState.Sent) {revert CCGRequestAlreadyFulfilled(requestId);}\\n\\n unprocessed_responses[requestId].state = err.length > 0 ? ICCGatewayClient.CCGResponseState.Error : ICCGatewayClient.CCGResponseState.Success;\\n unprocessed_responses[requestId].data = response;\\n unprocessed_responses[requestId].error = err;\\n\\n ICCGatewayClient(resp.source).callback(requestId);\\n }\\n\\n /**\\n * @dev Get the response data\\n * @param requestId The request ID, returned by sendRequest()\\n * @return response CCGResponse\\n */\\n function getResponse(bytes32 requestId, bool remove) external onlySource(requestId) returns (ICCGatewayClient.CCGResponse memory response) {\\n response = unprocessed_responses[requestId];\\n if (remove) {delete unprocessed_responses[requestId];}\\n }\\n}\",\"keccak256\":\"0x30020047512e69e37da4ab97917f13615bb96d65506baf5856aac3a25f8414af\",\"license\":\"MIT\"},\"contracts/interfaces/ICCGateway.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\\nimport {FunctionsRequest} from \\\"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\\\";\\n\\ninterface ICCGateway {\\n struct CCGRequest {\\n string name;\\n uint32 callbackGasLimit;\\n FunctionsRequest.Request config;\\n }\\n\\n /**\\n * @dev Can't register a request with an empty name\\n */\\n error CCGRequestNameEmpty();\\n\\n /**\\n * @dev Only the same source of the requestId is allowed to call the function\\n */\\n error CCGOnlySameSourceAllowed(bytes32 requestId);\\n\\n /**\\n * @dev Only a registered subscriptionId is allowed to call the function\\n */\\n error CCGRequestNotRegistered(uint64 subscriptionId);\\n\\n /**\\n * @dev Can't fulfill a request that has already been fulfilled\\n */\\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\\n\\n /**\\n * @dev Only A manager can call the function\\n */\\n error CCGOnlyManagerAllowed();\\n\\n /**\\n * @dev Send a request to the Functions DON\\n */\\n function sendRequest(\\n uint64 subscriptionId,\\n string[] calldata args,\\n bytes[] calldata bytesArgs,\\n bytes calldata encryptedSecretsReference\\n ) external returns (bytes32 requestId);\\n\\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\\n}\\n\",\"keccak256\":\"0xbc7d92f8db240767c8636e8df9b818cc1f5abfde22b8c49eee50f418fb0dbea5\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/ICCGatewayClient.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\ninterface ICCGatewayClient {\\n enum CCGResponseState {Sent, Success, Error}\\n\\n struct CCGResponse {\\n uint64 subscriptionId;\\n address source;\\n CCGResponseState state;\\n bytes data;\\n bytes error;\\n }\\n\\n function callback(bytes32 requestId) external;\\n}\\n\",\"keccak256\":\"0xb69320aa2152f374dec4cfc70b73f46e0db9774a1411d2acff1481ee3295f86a\",\"license\":\"UNLICENSED\"}},\"version\":1}", + "bytecode": "0x60a06040523480156200001157600080fd5b5060405162002f2f38038062002f2f83398101604081905262000034916200016e565b6001600160a01b0380841660805260018390556000908216156200005957816200005b565b335b90506200006a600082620000a2565b50620000977f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0882620000a2565b5050505050620001af565b6000828152602081815260408083206001600160a01b038516845290915281205460ff1662000147576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055620000fe3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016200014b565b5060005b92915050565b80516001600160a01b03811681146200016957600080fd5b919050565b6000806000606084860312156200018457600080fd5b6200018f8462000151565b925060208401519150620001a66040850162000151565b90509250925092565b608051612d5d620001d26000396000818161031a0152611a9f0152612d5d6000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c80638dbe7b9d116100a2578063c8ab5f2211610071578063c8ab5f2214610256578063cbbf67ec14610269578063d547741f14610289578063eae6f6521461029c578063ec87621c146102c357600080fd5b80638dbe7b9d1461022057806391d148541461022857806396c1582e1461023b578063a217fddf1461024e57600080fd5b80632d5bbf60116100e95780632d5bbf60146101a95780632f2ff15d146101d457806334d2afd9146101e757806336568abe146101fa57806378ca5de71461020d57600080fd5b806301ffc9a71461011b5780630ca761751461014357806315b851d114610158578063248a9ca314610178575b600080fd5b61012e61012936600461216b565b6102d8565b60405190151581526020015b60405180910390f35b610156610151366004612252565b61030f565b005b61016b6101663660046122be565b610393565b60405161013a919061235f565b61019b6101863660046123db565b60009081526020819052604090206001015490565b60405190815260200161013a565b6101bc6101b73660046123db565b6105ea565b6040516001600160401b03909116815260200161013a565b6101566101e23660046123f4565b610627565b6101566101f5366004612441565b610652565b6101566102083660046123f4565b6108cf565b61015661021b3660046123db565b610907565b60015461019b565b61012e6102363660046123f4565b61094f565b61019b6102493660046124e8565b610978565b61019b600081565b6101566102643660046125a1565b610e5a565b61027c610277366004612441565b610fee565b60405161013a91906126f8565b6101566102973660046123f4565b61148e565b61019b7fa5ff3ec7a96cdbba4d2d5172d66bbc73c6db3885f29b21be5da9fa7a7c02523281565b61019b600080516020612d0883398151915281565b60006001600160e01b03198216637965db0b60e01b148061030957506301ffc9a760e01b6001600160e01b03198316145b92915050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103585760405163c6829f8360e01b815260040160405180910390fd5b6103638383836114b3565b60405183907f85e1543bf2f84fe80c6badbce3648c8539ad1df4d2b3d822938ca0538be727e690600090a2505050565b6040805160a081018252600080825260208201819052918101919091526060808201819052608082015260008381526003602052604090205483906001600160a01b03600160401b9091041633146104065760405163949aaf2d60e01b8152600481018290526024015b60405180910390fd5b600084815260036020908152604091829020825160a08101845281546001600160401b0381168252600160401b81046001600160a01b03169382019390935292909190830190600160e01b900460ff166002811115610467576104676122f3565b6002811115610478576104786122f3565b815260200160018201805461048c906127de565b80601f01602080910402602001604051908101604052809291908181526020018280546104b8906127de565b80156105055780601f106104da57610100808354040283529160200191610505565b820191906000526020600020905b8154815290600101906020018083116104e857829003601f168201915b5050505050815260200160028201805461051e906127de565b80601f016020809104026020016040519081016040528092919081815260200182805461054a906127de565b80156105975780601f1061056c57610100808354040283529160200191610597565b820191906000526020600020905b81548152906001019060200180831161057a57829003601f168201915b505050505081525050915082156105e357600084815260036020526040812080546001600160e81b0319168155906105d26001830182612010565b6105e0600283016000612010565b50505b5092915050565b600481815481106105fa57600080fd5b9060005260206000209060049182820401919006600802915054906101000a90046001600160401b031681565b600082815260208190526040902060010154610642816115e6565b61064c83836115f3565b50505050565b61066a600080516020612d088339815191523261094f565b6106875760405163129d730760e01b815260040160405180910390fd5b6001600160401b038116600090815260026020526040902080546106aa906127de565b90506000036106d757604051630601bb0160e21b81526001600160401b03821660048201526024016103fd565b6001600160401b0381166000908152600260205260408120906106fa8282612010565b60018201805463ffffffff1916905560028201805462ffffff1916815560006107266003850182612010565b610734600283016000612010565b61074260038301600061204a565b610750600483016000612068565b50506004549150600090505b60045481101561088857600454821480156107b85750826001600160401b03166004828154811061078f5761078f612818565b6000918252602090912060048204015460039091166008026101000a90046001600160401b0316145b156107c1578091505b60045482148015906107de57506004546107dc826001612844565b105b156108765760046107f0826001612844565b8154811061080057610800612818565b90600052602060002090600491828204019190066008029054906101000a90046001600160401b03166004828154811061083c5761083c612818565b90600052602060002090600491828204019190066008026101000a8154816001600160401b0302191690836001600160401b031602179055505b8061088081612857565b91505061075c565b50600480548061089a5761089a612870565b60008281526020902060046000199092019182040180546001600160401b03600860038516026101000a021916905590555050565b6001600160a01b03811633146108f85760405163334bd91960e11b815260040160405180910390fd5b6109028282611685565b505050565b600080516020612d0883398151915260009081526020527fe84508f2c7fa9c351146748b3025cb78b45df37d868e48c6a75102fecdeee64654610949816115e6565b50600155565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60007fa5ff3ec7a96cdbba4d2d5172d66bbc73c6db3885f29b21be5da9fa7a7c0252326109a4816115e6565b6001600160401b0389166000908152600260205260409020805481906109c9906127de565b90506000036109f657604051630601bb0160e21b81526001600160401b038b1660048201526024016103fd565b6040805160e081019091526002808301805460009392839160ff1690811115610a2157610a216122f3565b6002811115610a3257610a326122f3565b81528154602090910190610100900460ff166002811115610a5557610a556122f3565b6002811115610a6657610a666122f3565b8152815460209091019062010000900460ff168015610a8757610a876122f3565b8015610a9557610a956122f3565b8152602001600182018054610aa9906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610ad5906127de565b8015610b225780601f10610af757610100808354040283529160200191610b22565b820191906000526020600020905b815481529060010190602001808311610b0557829003601f168201915b50505050508152602001600282018054610b3b906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610b67906127de565b8015610bb45780601f10610b8957610100808354040283529160200191610bb4565b820191906000526020600020905b815481529060010190602001808311610b9757829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b82821015610c8e578382906000526020600020018054610c01906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610c2d906127de565b8015610c7a5780601f10610c4f57610100808354040283529160200191610c7a565b820191906000526020600020905b815481529060010190602001808311610c5d57829003601f168201915b505050505081526020019060010190610be2565b50505050815260200160048201805480602002602001604051908101604052809291908181526020016000905b82821015610d67578382906000526020600020018054610cda906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610d06906127de565b8015610d535780601f10610d2857610100808354040283529160200191610d53565b820191906000526020600020905b815481529060010190602001808311610d3657829003601f168201915b505050505081526020019060010190610cbb565b5050509152505080516060820151919250610d87918391906000906116f0565b8415610dc95785858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050505060808201525b8815610de357610de3610ddc8a8c6128a9565b829061176e565b8615610dfd57610dfd610df6888a612935565b8290611798565b610e1f610e09826117c2565b60018085015490548e9163ffffffff1690611a9a565b6000818152600360205260409020805468010000000000000000600160e81b031916600160401b33021790559b9a5050505050505050505050565b610e72600080516020612d088339815191523261094f565b610e8f5760405163129d730760e01b815260040160405180910390fd5b6000819003610eb15760405163281b14ab60e01b815260040160405180910390fd5b6001600160401b038a16600090815260026020526040902080548190610ed6906127de565b9050600003610f3d576004805460018101825560008290529081047f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160401b03808f1660086003909516949094026101000a938402930219169190911790555b80610f498385836129ea565b506001818101805463ffffffff191663ffffffff87161790556002808301805462ff000019811682558d93919262ff00ff1990911691908490811115610f9157610f916122f3565b021790555060038101610fa5898b836129ea565b5060028082018054899261ff001990911690610100908490811115610fcc57610fcc6122f3565b021790555060048101610fe08688836129ea565b505050505050505050505050565b610ff6612086565b6001600160401b03821660009081526002602052604090208054611019906127de565b905060000361104657604051630601bb0160e21b81526001600160401b03831660048201526024016103fd565b6001600160401b03821660009081526002602052604090819020815160608101909252805482908290611078906127de565b80601f01602080910402602001604051908101604052809291908181526020018280546110a4906127de565b80156110f15780601f106110c6576101008083540402835291602001916110f1565b820191906000526020600020905b8154815290600101906020018083116110d457829003601f168201915b5050509183525050600182015463ffffffff1660208201526040805160e0810182526002808501805493909401939192839160ff90911690811115611138576111386122f3565b6002811115611149576111496122f3565b81528154602090910190610100900460ff16600281111561116c5761116c6122f3565b600281111561117d5761117d6122f3565b8152815460209091019062010000900460ff16801561119e5761119e6122f3565b80156111ac576111ac6122f3565b81526020016001820180546111c0906127de565b80601f01602080910402602001604051908101604052809291908181526020018280546111ec906127de565b80156112395780601f1061120e57610100808354040283529160200191611239565b820191906000526020600020905b81548152906001019060200180831161121c57829003601f168201915b50505050508152602001600282018054611252906127de565b80601f016020809104026020016040519081016040528092919081815260200182805461127e906127de565b80156112cb5780601f106112a0576101008083540402835291602001916112cb565b820191906000526020600020905b8154815290600101906020018083116112ae57829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b828210156113a5578382906000526020600020018054611318906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054611344906127de565b80156113915780601f1061136657610100808354040283529160200191611391565b820191906000526020600020905b81548152906001019060200180831161137457829003601f168201915b5050505050815260200190600101906112f9565b50505050815260200160048201805480602002602001604051908101604052809291908181526020016000905b8282101561147e5783829060005260206000200180546113f1906127de565b80601f016020809104026020016040519081016040528092919081815260200182805461141d906127de565b801561146a5780601f1061143f5761010080835404028352916020019161146a565b820191906000526020600020905b81548152906001019060200180831161144d57829003601f168201915b5050505050815260200190600101906113d2565b5050509152505090525092915050565b6000828152602081905260409020600101546114a9816115e6565b61064c8383611685565b6000838152600360205260408120908154600160e01b900460ff1660028111156114df576114df6122f3565b146114ff576040516287aa6360e01b8152600481018590526024016103fd565b600082511161150f576001611512565b60025b6000858152600360205260409020805460ff60e01b1916600160e01b836002811115611540576115406122f3565b021790555060008481526003602052604090206001016115608482612aaa565b50600084815260036020526040902060020161157c8382612aaa565b508054604051636f89cca760e11b815260048101869052600160401b9091046001600160a01b03169063df13994e90602401600060405180830381600087803b1580156115c857600080fd5b505af11580156115dc573d6000803e3d6000fd5b5050505050505050565b6115f08133611b6c565b50565b60006115ff838361094f565b61167d576000838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556116353390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610309565b506000610309565b6000611691838361094f565b1561167d576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610309565b8051600003611712576040516322ce3edd60e01b815260040160405180910390fd5b83836002811115611725576117256122f3565b90816002811115611738576117386122f3565b9052506040840182801561174e5761174e6122f3565b9081801561175e5761175e6122f3565b9052506060909301929092525050565b80516000036117905760405163fe936cb760e01b815260040160405180910390fd5b60a090910152565b80516000036117ba5760405163fe936cb760e01b815260040160405180910390fd5b60c090910152565b606060006117d1610100611ba9565b905061180a6040518060400160405280600c81526020016b31b7b232a637b1b0ba34b7b760a11b81525082611bca90919063ffffffff16565b8251611828906002811115611821576118216122f3565b8290611be3565b6040805180820190915260088152676c616e677561676560c01b6020820152611852908290611bca565b6040830151611869908015611821576118216122f3565b604080518082019091526006815265736f7572636560d01b6020820152611891908290611bca565b60608301516118a1908290611bca565b60a08301515115611935576040805180820190915260048152636172677360e01b60208201526118d2908290611bca565b6118db81611c1c565b60005b8360a001515181101561192b5761191b8460a00151828151811061190457611904612818565b602002602001015183611bca90919063ffffffff16565b61192481612857565b90506118de565b5061193581611c40565b608083015151156119f957600083602001516002811115611958576119586122f3565b036119765760405163a80d31f760e01b815260040160405180910390fd5b60408051808201909152600f81526e39b2b1b932ba39a637b1b0ba34b7b760891b60208201526119a7908290611bca565b6119c083602001516002811115611821576118216122f3565b6040805180820190915260078152667365637265747360c81b60208201526119e9908290611bca565b60808301516119f9908290611c5e565b60c08301515115611a925760408051808201909152600981526862797465734172677360b81b6020820152611a2f908290611bca565b611a3881611c1c565b60005b8360c0015151811015611a8857611a788460c001518281518110611a6157611a61612818565b602002602001015183611c5e90919063ffffffff16565b611a8181612857565b9050611a3b565b50611a9281611c40565b515192915050565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663461d27628688600188886040518663ffffffff1660e01b8152600401611af2959493929190612b69565b6020604051808303816000875af1158015611b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b359190612bb2565b60405190915081907f1131472297a800fee664d1d89cfa8f7676ff07189ecc53f80bbb5f4969099db890600090a295945050505050565b611b76828261094f565b611ba55760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016103fd565b5050565b611bb16120e3565b8051611bbd9083611c6b565b5060006020820152919050565b611bd78260038351611ce2565b81516109029082611dfb565b8151611bf09060c2611e23565b50611ba58282604051602001611c0891815260200190565b604051602081830303815290604052611c5e565b611c27816004611e8c565b600181602001818151611c3a9190612844565b90525050565b611c4b816007611e8c565b600181602001818151611c3a9190612bcb565b611bd78260028351611ce2565b604080518082019091526060815260006020820152611c8b602083612bde565b15611cb357611c9b602083612bde565b611ca6906020612bcb565b611cb09083612844565b91505b602080840183905260405180855260008152908184010181811015611cd757600080fd5b604052509192915050565b6017816001600160401b031611611d0857825161064c9060e0600585901b168317611e23565b60ff816001600160401b031611611d48578251611d30906018611fe0600586901b1617611e23565b50825161064c906001600160401b0383166001611ea3565b61ffff816001600160401b031611611d89578251611d71906019611fe0600586901b1617611e23565b50825161064c906001600160401b0383166002611ea3565b63ffffffff816001600160401b031611611dcc578251611db490601a611fe0600586901b1617611e23565b50825161064c906001600160401b0383166004611ea3565b8251611de390601b611fe0600586901b1617611e23565b50825161064c906001600160401b0383166008611ea3565b604080518082019091526060815260006020820152611e1c83838451611f28565b9392505050565b6040805180820190915260608152600060208201528251516000611e48826001612844565b905084602001518210611e6957611e6985611e64836002612c00565b611ff9565b8451602083820101858153508051821115611e82578181525b5093949350505050565b815161090290601f611fe0600585901b1617611e23565b6040805180820190915260608152600060208201528351516000611ec78285612844565b90508560200151811115611ee457611ee486611e64836002612c00565b60006001611ef486610100612cfb565b611efe9190612bcb565b90508651828101878319825116178152508051831115611f1c578281525b50959695505050505050565b6040805180820190915260608152600060208201528251821115611f4b57600080fd5b8351516000611f5a8483612844565b90508560200151811115611f7757611f7786611e64836002612c00565b855180518382016020019160009180851115611f91578482525b505050602086015b60208610611fd15780518252611fb0602083612844565b9150611fbd602082612844565b9050611fca602087612bcb565b9550611f99565b51815160001960208890036101000a0190811690199190911617905250849150509392505050565b81516120058383611c6b565b5061064c8382611dfb565b50805461201c906127de565b6000825580601f1061202c575050565b601f0160209004906000526020600020908101906115f09190612118565b50805460008255906000526020600020908101906115f09190612131565b50805460008255906000526020600020908101906115f0919061214e565b60408051606080820183528152600060208201529081016120de6040805160e0810190915280600081526020016000815260200160008152602001606081526020016060815260200160608152602001606081525090565b905290565b604051806040016040528061210b604051806040016040528060608152602001600081525090565b8152602001600081525090565b5b8082111561212d5760008155600101612119565b5090565b8082111561212d5760006121458282612010565b50600101612131565b8082111561212d5760006121628282612010565b5060010161214e565b60006020828403121561217d57600080fd5b81356001600160e01b031981168114611e1c57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156121d3576121d3612195565b604052919050565b60006001600160401b038311156121f4576121f4612195565b612207601f8401601f19166020016121ab565b905082815283838301111561221b57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261224357600080fd5b611e1c838335602085016121db565b60008060006060848603121561226757600080fd5b8335925060208401356001600160401b038082111561228557600080fd5b61229187838801612232565b935060408601359150808211156122a757600080fd5b506122b486828701612232565b9150509250925092565b600080604083850312156122d157600080fd5b82359150602083013580151581146122e857600080fd5b809150509250929050565b634e487b7160e01b600052602160045260246000fd5b600381106115f0576115f06122f3565b6000815180845260005b8181101561233f57602081850181015186830182015201612323565b506000602082860101526020601f19601f83011685010191505092915050565b602081526001600160401b03825116602082015260018060a01b0360208301511660408201526000604083015161239581612309565b80606084015250606083015160a060808401526123b560c0840182612319565b90506080840151601f198483030160a08501526123d28282612319565b95945050505050565b6000602082840312156123ed57600080fd5b5035919050565b6000806040838503121561240757600080fd5b8235915060208301356001600160a01b03811681146122e857600080fd5b80356001600160401b038116811461243c57600080fd5b919050565b60006020828403121561245357600080fd5b611e1c82612425565b60008083601f84011261246e57600080fd5b5081356001600160401b0381111561248557600080fd5b6020830191508360208260051b85010111156124a057600080fd5b9250929050565b60008083601f8401126124b957600080fd5b5081356001600160401b038111156124d057600080fd5b6020830191508360208285010111156124a057600080fd5b60008060008060008060006080888a03121561250357600080fd5b61250c88612425565b965060208801356001600160401b038082111561252857600080fd5b6125348b838c0161245c565b909850965060408a013591508082111561254d57600080fd5b6125598b838c0161245c565b909650945060608a013591508082111561257257600080fd5b5061257f8a828b016124a7565b989b979a50959850939692959293505050565b80356003811061243c57600080fd5b60008060008060008060008060008060e08b8d0312156125c057600080fd5b6125c98b612425565b99506125d760208c01612592565b985060408b01356001600160401b03808211156125f357600080fd5b6125ff8e838f016124a7565b909a50985088915061261360608e01612592565b975060808d013591508082111561262957600080fd5b6126358e838f016124a7565b909750955060a08d0135915063ffffffff8216821461265357600080fd5b90935060c08c0135908082111561266957600080fd5b506126768d828e016124a7565b915080935050809150509295989b9194979a5092959850565b6001811061269f5761269f6122f3565b9052565b600081518084526020808501808196508360051b8101915082860160005b858110156126eb5782840389526126d9848351612319565b988501989350908401906001016126c1565b5091979650505050505050565b6020815260008251606060208401526127146080840182612319565b905063ffffffff60208501511660408401526040840151601f19848303016060850152805161274281612309565b8252602081015161275281612309565b80602084015250604081015161276b604084018261268f565b50606081015160e0606084015261278560e0840182612319565b90506080820151838203608085015261279e8282612319565b91505060a082015183820360a08501526127b882826126a3565b91505060c0820151915082810360c08401526127d481836126a3565b9695505050505050565b600181811c908216806127f257607f821691505b60208210810361281257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156103095761030961282e565b6000600182016128695761286961282e565b5060010190565b634e487b7160e01b600052603160045260246000fd5b60006001600160401b0382111561289f5761289f612195565b5060051b60200190565b60006128bc6128b784612886565b6121ab565b80848252602080830192508560051b8501368111156128da57600080fd5b855b818110156129295780356001600160401b038111156128fb5760008081fd5b870136601f82011261290d5760008081fd5b61291b3682358684016121db565b8652509382019382016128dc565b50919695505050505050565b60006129436128b784612886565b80848252602080830192508560051b85013681111561296157600080fd5b855b818110156129295780356001600160401b038111156129825760008081fd5b61298e36828a01612232565b865250938201938201612963565b601f82111561090257600081815260208120601f850160051c810160208610156129c35750805b601f850160051c820191505b818110156129e2578281556001016129cf565b505050505050565b6001600160401b03831115612a0157612a01612195565b612a1583612a0f83546127de565b8361299c565b6000601f841160018114612a495760008515612a315750838201355b600019600387901b1c1916600186901b178355612aa3565b600083815260209020601f19861690835b82811015612a7a5786850135825560209485019460019092019101612a5a565b5086821015612a975760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b81516001600160401b03811115612ac357612ac3612195565b612ad781612ad184546127de565b8461299c565b602080601f831160018114612b0c5760008415612af45750858301515b600019600386901b1c1916600185901b1785556129e2565b600085815260208120601f198616915b82811015612b3b57888601518255948401946001909101908401612b1c565b5085821015612b595787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160401b038616815260a060208201526000612b8b60a0830187612319565b61ffff9590951660408301525063ffffffff92909216606083015260809091015292915050565b600060208284031215612bc457600080fd5b5051919050565b818103818111156103095761030961282e565b600082612bfb57634e487b7160e01b600052601260045260246000fd5b500690565b80820281158282048414176103095761030961282e565b600181815b80851115612c52578160001904821115612c3857612c3861282e565b80851615612c4557918102915b93841c9390800290612c1c565b509250929050565b600082612c6957506001610309565b81612c7657506000610309565b8160018114612c8c5760028114612c9657612cb2565b6001915050610309565b60ff841115612ca757612ca761282e565b50506001821b610309565b5060208310610133831016604e8410600b8410161715612cd5575081810a610309565b612cdf8383612c17565b8060001904821115612cf357612cf361282e565b029392505050565b6000611e1c8383612c5a56fe241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08a2646970667358221220c853501b7d4e314864358724dac532054bd10ab5dc8600ff8db02415b54e281264736f6c63430008140033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101165760003560e01c80638dbe7b9d116100a2578063c8ab5f2211610071578063c8ab5f2214610256578063cbbf67ec14610269578063d547741f14610289578063eae6f6521461029c578063ec87621c146102c357600080fd5b80638dbe7b9d1461022057806391d148541461022857806396c1582e1461023b578063a217fddf1461024e57600080fd5b80632d5bbf60116100e95780632d5bbf60146101a95780632f2ff15d146101d457806334d2afd9146101e757806336568abe146101fa57806378ca5de71461020d57600080fd5b806301ffc9a71461011b5780630ca761751461014357806315b851d114610158578063248a9ca314610178575b600080fd5b61012e61012936600461216b565b6102d8565b60405190151581526020015b60405180910390f35b610156610151366004612252565b61030f565b005b61016b6101663660046122be565b610393565b60405161013a919061235f565b61019b6101863660046123db565b60009081526020819052604090206001015490565b60405190815260200161013a565b6101bc6101b73660046123db565b6105ea565b6040516001600160401b03909116815260200161013a565b6101566101e23660046123f4565b610627565b6101566101f5366004612441565b610652565b6101566102083660046123f4565b6108cf565b61015661021b3660046123db565b610907565b60015461019b565b61012e6102363660046123f4565b61094f565b61019b6102493660046124e8565b610978565b61019b600081565b6101566102643660046125a1565b610e5a565b61027c610277366004612441565b610fee565b60405161013a91906126f8565b6101566102973660046123f4565b61148e565b61019b7fa5ff3ec7a96cdbba4d2d5172d66bbc73c6db3885f29b21be5da9fa7a7c02523281565b61019b600080516020612d0883398151915281565b60006001600160e01b03198216637965db0b60e01b148061030957506301ffc9a760e01b6001600160e01b03198316145b92915050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103585760405163c6829f8360e01b815260040160405180910390fd5b6103638383836114b3565b60405183907f85e1543bf2f84fe80c6badbce3648c8539ad1df4d2b3d822938ca0538be727e690600090a2505050565b6040805160a081018252600080825260208201819052918101919091526060808201819052608082015260008381526003602052604090205483906001600160a01b03600160401b9091041633146104065760405163949aaf2d60e01b8152600481018290526024015b60405180910390fd5b600084815260036020908152604091829020825160a08101845281546001600160401b0381168252600160401b81046001600160a01b03169382019390935292909190830190600160e01b900460ff166002811115610467576104676122f3565b6002811115610478576104786122f3565b815260200160018201805461048c906127de565b80601f01602080910402602001604051908101604052809291908181526020018280546104b8906127de565b80156105055780601f106104da57610100808354040283529160200191610505565b820191906000526020600020905b8154815290600101906020018083116104e857829003601f168201915b5050505050815260200160028201805461051e906127de565b80601f016020809104026020016040519081016040528092919081815260200182805461054a906127de565b80156105975780601f1061056c57610100808354040283529160200191610597565b820191906000526020600020905b81548152906001019060200180831161057a57829003601f168201915b505050505081525050915082156105e357600084815260036020526040812080546001600160e81b0319168155906105d26001830182612010565b6105e0600283016000612010565b50505b5092915050565b600481815481106105fa57600080fd5b9060005260206000209060049182820401919006600802915054906101000a90046001600160401b031681565b600082815260208190526040902060010154610642816115e6565b61064c83836115f3565b50505050565b61066a600080516020612d088339815191523261094f565b6106875760405163129d730760e01b815260040160405180910390fd5b6001600160401b038116600090815260026020526040902080546106aa906127de565b90506000036106d757604051630601bb0160e21b81526001600160401b03821660048201526024016103fd565b6001600160401b0381166000908152600260205260408120906106fa8282612010565b60018201805463ffffffff1916905560028201805462ffffff1916815560006107266003850182612010565b610734600283016000612010565b61074260038301600061204a565b610750600483016000612068565b50506004549150600090505b60045481101561088857600454821480156107b85750826001600160401b03166004828154811061078f5761078f612818565b6000918252602090912060048204015460039091166008026101000a90046001600160401b0316145b156107c1578091505b60045482148015906107de57506004546107dc826001612844565b105b156108765760046107f0826001612844565b8154811061080057610800612818565b90600052602060002090600491828204019190066008029054906101000a90046001600160401b03166004828154811061083c5761083c612818565b90600052602060002090600491828204019190066008026101000a8154816001600160401b0302191690836001600160401b031602179055505b8061088081612857565b91505061075c565b50600480548061089a5761089a612870565b60008281526020902060046000199092019182040180546001600160401b03600860038516026101000a021916905590555050565b6001600160a01b03811633146108f85760405163334bd91960e11b815260040160405180910390fd5b6109028282611685565b505050565b600080516020612d0883398151915260009081526020527fe84508f2c7fa9c351146748b3025cb78b45df37d868e48c6a75102fecdeee64654610949816115e6565b50600155565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60007fa5ff3ec7a96cdbba4d2d5172d66bbc73c6db3885f29b21be5da9fa7a7c0252326109a4816115e6565b6001600160401b0389166000908152600260205260409020805481906109c9906127de565b90506000036109f657604051630601bb0160e21b81526001600160401b038b1660048201526024016103fd565b6040805160e081019091526002808301805460009392839160ff1690811115610a2157610a216122f3565b6002811115610a3257610a326122f3565b81528154602090910190610100900460ff166002811115610a5557610a556122f3565b6002811115610a6657610a666122f3565b8152815460209091019062010000900460ff168015610a8757610a876122f3565b8015610a9557610a956122f3565b8152602001600182018054610aa9906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610ad5906127de565b8015610b225780601f10610af757610100808354040283529160200191610b22565b820191906000526020600020905b815481529060010190602001808311610b0557829003601f168201915b50505050508152602001600282018054610b3b906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610b67906127de565b8015610bb45780601f10610b8957610100808354040283529160200191610bb4565b820191906000526020600020905b815481529060010190602001808311610b9757829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b82821015610c8e578382906000526020600020018054610c01906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610c2d906127de565b8015610c7a5780601f10610c4f57610100808354040283529160200191610c7a565b820191906000526020600020905b815481529060010190602001808311610c5d57829003601f168201915b505050505081526020019060010190610be2565b50505050815260200160048201805480602002602001604051908101604052809291908181526020016000905b82821015610d67578382906000526020600020018054610cda906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610d06906127de565b8015610d535780601f10610d2857610100808354040283529160200191610d53565b820191906000526020600020905b815481529060010190602001808311610d3657829003601f168201915b505050505081526020019060010190610cbb565b5050509152505080516060820151919250610d87918391906000906116f0565b8415610dc95785858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050505060808201525b8815610de357610de3610ddc8a8c6128a9565b829061176e565b8615610dfd57610dfd610df6888a612935565b8290611798565b610e1f610e09826117c2565b60018085015490548e9163ffffffff1690611a9a565b6000818152600360205260409020805468010000000000000000600160e81b031916600160401b33021790559b9a5050505050505050505050565b610e72600080516020612d088339815191523261094f565b610e8f5760405163129d730760e01b815260040160405180910390fd5b6000819003610eb15760405163281b14ab60e01b815260040160405180910390fd5b6001600160401b038a16600090815260026020526040902080548190610ed6906127de565b9050600003610f3d576004805460018101825560008290529081047f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160401b03808f1660086003909516949094026101000a938402930219169190911790555b80610f498385836129ea565b506001818101805463ffffffff191663ffffffff87161790556002808301805462ff000019811682558d93919262ff00ff1990911691908490811115610f9157610f916122f3565b021790555060038101610fa5898b836129ea565b5060028082018054899261ff001990911690610100908490811115610fcc57610fcc6122f3565b021790555060048101610fe08688836129ea565b505050505050505050505050565b610ff6612086565b6001600160401b03821660009081526002602052604090208054611019906127de565b905060000361104657604051630601bb0160e21b81526001600160401b03831660048201526024016103fd565b6001600160401b03821660009081526002602052604090819020815160608101909252805482908290611078906127de565b80601f01602080910402602001604051908101604052809291908181526020018280546110a4906127de565b80156110f15780601f106110c6576101008083540402835291602001916110f1565b820191906000526020600020905b8154815290600101906020018083116110d457829003601f168201915b5050509183525050600182015463ffffffff1660208201526040805160e0810182526002808501805493909401939192839160ff90911690811115611138576111386122f3565b6002811115611149576111496122f3565b81528154602090910190610100900460ff16600281111561116c5761116c6122f3565b600281111561117d5761117d6122f3565b8152815460209091019062010000900460ff16801561119e5761119e6122f3565b80156111ac576111ac6122f3565b81526020016001820180546111c0906127de565b80601f01602080910402602001604051908101604052809291908181526020018280546111ec906127de565b80156112395780601f1061120e57610100808354040283529160200191611239565b820191906000526020600020905b81548152906001019060200180831161121c57829003601f168201915b50505050508152602001600282018054611252906127de565b80601f016020809104026020016040519081016040528092919081815260200182805461127e906127de565b80156112cb5780601f106112a0576101008083540402835291602001916112cb565b820191906000526020600020905b8154815290600101906020018083116112ae57829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b828210156113a5578382906000526020600020018054611318906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054611344906127de565b80156113915780601f1061136657610100808354040283529160200191611391565b820191906000526020600020905b81548152906001019060200180831161137457829003601f168201915b5050505050815260200190600101906112f9565b50505050815260200160048201805480602002602001604051908101604052809291908181526020016000905b8282101561147e5783829060005260206000200180546113f1906127de565b80601f016020809104026020016040519081016040528092919081815260200182805461141d906127de565b801561146a5780601f1061143f5761010080835404028352916020019161146a565b820191906000526020600020905b81548152906001019060200180831161144d57829003601f168201915b5050505050815260200190600101906113d2565b5050509152505090525092915050565b6000828152602081905260409020600101546114a9816115e6565b61064c8383611685565b6000838152600360205260408120908154600160e01b900460ff1660028111156114df576114df6122f3565b146114ff576040516287aa6360e01b8152600481018590526024016103fd565b600082511161150f576001611512565b60025b6000858152600360205260409020805460ff60e01b1916600160e01b836002811115611540576115406122f3565b021790555060008481526003602052604090206001016115608482612aaa565b50600084815260036020526040902060020161157c8382612aaa565b508054604051636f89cca760e11b815260048101869052600160401b9091046001600160a01b03169063df13994e90602401600060405180830381600087803b1580156115c857600080fd5b505af11580156115dc573d6000803e3d6000fd5b5050505050505050565b6115f08133611b6c565b50565b60006115ff838361094f565b61167d576000838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556116353390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610309565b506000610309565b6000611691838361094f565b1561167d576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610309565b8051600003611712576040516322ce3edd60e01b815260040160405180910390fd5b83836002811115611725576117256122f3565b90816002811115611738576117386122f3565b9052506040840182801561174e5761174e6122f3565b9081801561175e5761175e6122f3565b9052506060909301929092525050565b80516000036117905760405163fe936cb760e01b815260040160405180910390fd5b60a090910152565b80516000036117ba5760405163fe936cb760e01b815260040160405180910390fd5b60c090910152565b606060006117d1610100611ba9565b905061180a6040518060400160405280600c81526020016b31b7b232a637b1b0ba34b7b760a11b81525082611bca90919063ffffffff16565b8251611828906002811115611821576118216122f3565b8290611be3565b6040805180820190915260088152676c616e677561676560c01b6020820152611852908290611bca565b6040830151611869908015611821576118216122f3565b604080518082019091526006815265736f7572636560d01b6020820152611891908290611bca565b60608301516118a1908290611bca565b60a08301515115611935576040805180820190915260048152636172677360e01b60208201526118d2908290611bca565b6118db81611c1c565b60005b8360a001515181101561192b5761191b8460a00151828151811061190457611904612818565b602002602001015183611bca90919063ffffffff16565b61192481612857565b90506118de565b5061193581611c40565b608083015151156119f957600083602001516002811115611958576119586122f3565b036119765760405163a80d31f760e01b815260040160405180910390fd5b60408051808201909152600f81526e39b2b1b932ba39a637b1b0ba34b7b760891b60208201526119a7908290611bca565b6119c083602001516002811115611821576118216122f3565b6040805180820190915260078152667365637265747360c81b60208201526119e9908290611bca565b60808301516119f9908290611c5e565b60c08301515115611a925760408051808201909152600981526862797465734172677360b81b6020820152611a2f908290611bca565b611a3881611c1c565b60005b8360c0015151811015611a8857611a788460c001518281518110611a6157611a61612818565b602002602001015183611c5e90919063ffffffff16565b611a8181612857565b9050611a3b565b50611a9281611c40565b515192915050565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663461d27628688600188886040518663ffffffff1660e01b8152600401611af2959493929190612b69565b6020604051808303816000875af1158015611b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b359190612bb2565b60405190915081907f1131472297a800fee664d1d89cfa8f7676ff07189ecc53f80bbb5f4969099db890600090a295945050505050565b611b76828261094f565b611ba55760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016103fd565b5050565b611bb16120e3565b8051611bbd9083611c6b565b5060006020820152919050565b611bd78260038351611ce2565b81516109029082611dfb565b8151611bf09060c2611e23565b50611ba58282604051602001611c0891815260200190565b604051602081830303815290604052611c5e565b611c27816004611e8c565b600181602001818151611c3a9190612844565b90525050565b611c4b816007611e8c565b600181602001818151611c3a9190612bcb565b611bd78260028351611ce2565b604080518082019091526060815260006020820152611c8b602083612bde565b15611cb357611c9b602083612bde565b611ca6906020612bcb565b611cb09083612844565b91505b602080840183905260405180855260008152908184010181811015611cd757600080fd5b604052509192915050565b6017816001600160401b031611611d0857825161064c9060e0600585901b168317611e23565b60ff816001600160401b031611611d48578251611d30906018611fe0600586901b1617611e23565b50825161064c906001600160401b0383166001611ea3565b61ffff816001600160401b031611611d89578251611d71906019611fe0600586901b1617611e23565b50825161064c906001600160401b0383166002611ea3565b63ffffffff816001600160401b031611611dcc578251611db490601a611fe0600586901b1617611e23565b50825161064c906001600160401b0383166004611ea3565b8251611de390601b611fe0600586901b1617611e23565b50825161064c906001600160401b0383166008611ea3565b604080518082019091526060815260006020820152611e1c83838451611f28565b9392505050565b6040805180820190915260608152600060208201528251516000611e48826001612844565b905084602001518210611e6957611e6985611e64836002612c00565b611ff9565b8451602083820101858153508051821115611e82578181525b5093949350505050565b815161090290601f611fe0600585901b1617611e23565b6040805180820190915260608152600060208201528351516000611ec78285612844565b90508560200151811115611ee457611ee486611e64836002612c00565b60006001611ef486610100612cfb565b611efe9190612bcb565b90508651828101878319825116178152508051831115611f1c578281525b50959695505050505050565b6040805180820190915260608152600060208201528251821115611f4b57600080fd5b8351516000611f5a8483612844565b90508560200151811115611f7757611f7786611e64836002612c00565b855180518382016020019160009180851115611f91578482525b505050602086015b60208610611fd15780518252611fb0602083612844565b9150611fbd602082612844565b9050611fca602087612bcb565b9550611f99565b51815160001960208890036101000a0190811690199190911617905250849150509392505050565b81516120058383611c6b565b5061064c8382611dfb565b50805461201c906127de565b6000825580601f1061202c575050565b601f0160209004906000526020600020908101906115f09190612118565b50805460008255906000526020600020908101906115f09190612131565b50805460008255906000526020600020908101906115f0919061214e565b60408051606080820183528152600060208201529081016120de6040805160e0810190915280600081526020016000815260200160008152602001606081526020016060815260200160608152602001606081525090565b905290565b604051806040016040528061210b604051806040016040528060608152602001600081525090565b8152602001600081525090565b5b8082111561212d5760008155600101612119565b5090565b8082111561212d5760006121458282612010565b50600101612131565b8082111561212d5760006121628282612010565b5060010161214e565b60006020828403121561217d57600080fd5b81356001600160e01b031981168114611e1c57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156121d3576121d3612195565b604052919050565b60006001600160401b038311156121f4576121f4612195565b612207601f8401601f19166020016121ab565b905082815283838301111561221b57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261224357600080fd5b611e1c838335602085016121db565b60008060006060848603121561226757600080fd5b8335925060208401356001600160401b038082111561228557600080fd5b61229187838801612232565b935060408601359150808211156122a757600080fd5b506122b486828701612232565b9150509250925092565b600080604083850312156122d157600080fd5b82359150602083013580151581146122e857600080fd5b809150509250929050565b634e487b7160e01b600052602160045260246000fd5b600381106115f0576115f06122f3565b6000815180845260005b8181101561233f57602081850181015186830182015201612323565b506000602082860101526020601f19601f83011685010191505092915050565b602081526001600160401b03825116602082015260018060a01b0360208301511660408201526000604083015161239581612309565b80606084015250606083015160a060808401526123b560c0840182612319565b90506080840151601f198483030160a08501526123d28282612319565b95945050505050565b6000602082840312156123ed57600080fd5b5035919050565b6000806040838503121561240757600080fd5b8235915060208301356001600160a01b03811681146122e857600080fd5b80356001600160401b038116811461243c57600080fd5b919050565b60006020828403121561245357600080fd5b611e1c82612425565b60008083601f84011261246e57600080fd5b5081356001600160401b0381111561248557600080fd5b6020830191508360208260051b85010111156124a057600080fd5b9250929050565b60008083601f8401126124b957600080fd5b5081356001600160401b038111156124d057600080fd5b6020830191508360208285010111156124a057600080fd5b60008060008060008060006080888a03121561250357600080fd5b61250c88612425565b965060208801356001600160401b038082111561252857600080fd5b6125348b838c0161245c565b909850965060408a013591508082111561254d57600080fd5b6125598b838c0161245c565b909650945060608a013591508082111561257257600080fd5b5061257f8a828b016124a7565b989b979a50959850939692959293505050565b80356003811061243c57600080fd5b60008060008060008060008060008060e08b8d0312156125c057600080fd5b6125c98b612425565b99506125d760208c01612592565b985060408b01356001600160401b03808211156125f357600080fd5b6125ff8e838f016124a7565b909a50985088915061261360608e01612592565b975060808d013591508082111561262957600080fd5b6126358e838f016124a7565b909750955060a08d0135915063ffffffff8216821461265357600080fd5b90935060c08c0135908082111561266957600080fd5b506126768d828e016124a7565b915080935050809150509295989b9194979a5092959850565b6001811061269f5761269f6122f3565b9052565b600081518084526020808501808196508360051b8101915082860160005b858110156126eb5782840389526126d9848351612319565b988501989350908401906001016126c1565b5091979650505050505050565b6020815260008251606060208401526127146080840182612319565b905063ffffffff60208501511660408401526040840151601f19848303016060850152805161274281612309565b8252602081015161275281612309565b80602084015250604081015161276b604084018261268f565b50606081015160e0606084015261278560e0840182612319565b90506080820151838203608085015261279e8282612319565b91505060a082015183820360a08501526127b882826126a3565b91505060c0820151915082810360c08401526127d481836126a3565b9695505050505050565b600181811c908216806127f257607f821691505b60208210810361281257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156103095761030961282e565b6000600182016128695761286961282e565b5060010190565b634e487b7160e01b600052603160045260246000fd5b60006001600160401b0382111561289f5761289f612195565b5060051b60200190565b60006128bc6128b784612886565b6121ab565b80848252602080830192508560051b8501368111156128da57600080fd5b855b818110156129295780356001600160401b038111156128fb5760008081fd5b870136601f82011261290d5760008081fd5b61291b3682358684016121db565b8652509382019382016128dc565b50919695505050505050565b60006129436128b784612886565b80848252602080830192508560051b85013681111561296157600080fd5b855b818110156129295780356001600160401b038111156129825760008081fd5b61298e36828a01612232565b865250938201938201612963565b601f82111561090257600081815260208120601f850160051c810160208610156129c35750805b601f850160051c820191505b818110156129e2578281556001016129cf565b505050505050565b6001600160401b03831115612a0157612a01612195565b612a1583612a0f83546127de565b8361299c565b6000601f841160018114612a495760008515612a315750838201355b600019600387901b1c1916600186901b178355612aa3565b600083815260209020601f19861690835b82811015612a7a5786850135825560209485019460019092019101612a5a565b5086821015612a975760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b81516001600160401b03811115612ac357612ac3612195565b612ad781612ad184546127de565b8461299c565b602080601f831160018114612b0c5760008415612af45750858301515b600019600386901b1c1916600185901b1785556129e2565b600085815260208120601f198616915b82811015612b3b57888601518255948401946001909101908401612b1c565b5085821015612b595787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160401b038616815260a060208201526000612b8b60a0830187612319565b61ffff9590951660408301525063ffffffff92909216606083015260809091015292915050565b600060208284031215612bc457600080fd5b5051919050565b818103818111156103095761030961282e565b600082612bfb57634e487b7160e01b600052601260045260246000fd5b500690565b80820281158282048414176103095761030961282e565b600181815b80851115612c52578160001904821115612c3857612c3861282e565b80851615612c4557918102915b93841c9390800290612c1c565b509250929050565b600082612c6957506001610309565b81612c7657506000610309565b8160018114612c8c5760028114612c9657612cb2565b6001915050610309565b60ff841115612ca757612ca761282e565b50506001821b610309565b5060208310610133831016604e8410600b8410161715612cd5575081810a610309565b612cdf8383612c17565b8060001904821115612cf357612cf361282e565b029392505050565b6000611e1c8383612c5a56fe241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08a2646970667358221220c853501b7d4e314864358724dac532054bd10ab5dc8600ff8db02415b54e281264736f6c63430008140033", + "devdoc": { + "errors": { + "AccessControlBadConfirmation()": [ + { + "details": "The caller of a function is not the expected one. NOTE: Don't confuse with {AccessControlUnauthorizedAccount}." + } + ], + "AccessControlUnauthorizedAccount(address,bytes32)": [ + { + "details": "The `account` is missing a role." + } + ], + "CCGOnlyManagerAllowed()": [ + { + "details": "Only A manager can call the function" + } + ], + "CCGOnlySameSourceAllowed(bytes32)": [ + { + "details": "Only the same source of the requestId is allowed to call the function" + } + ], + "CCGRequestAlreadyFulfilled(bytes32)": [ + { + "details": "Can't fulfill a request that has already been fulfilled" + } + ], + "CCGRequestNameEmpty()": [ + { + "details": "Can't register a request with an empty name" + } + ], + "CCGRequestNotRegistered(uint64)": [ + { + "details": "Only a registered subscriptionId is allowed to call the function" + } + ] + }, + "events": { + "RoleAdminChanged(bytes32,bytes32,bytes32)": { + "details": "Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this." + }, + "RoleGranted(bytes32,address,address)": { + "details": "Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}." + }, + "RoleRevoked(bytes32,address,address)": { + "details": "Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)" + } + }, + "kind": "dev", + "methods": { + "donId()": { + "details": "Get the DON ID", + "returns": { + "_0": "DON ID" + } + }, + "getResponse(bytes32,bool)": { + "details": "Get the response data", + "params": { + "requestId": "The request ID, returned by sendRequest()" + }, + "returns": { + "response": "CCGResponse" + } + }, + "getRoleAdmin(bytes32)": { + "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." + }, + "grantRole(bytes32,address)": { + "details": "Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event." + }, + "handleOracleFulfillment(bytes32,bytes,bytes)": { + "details": "Either response or error parameter will be set, but never both.", + "params": { + "err": "Aggregated error either from the request's source code or from the execution pipeline.", + "requestId": "The requestId returned by FunctionsClient.sendRequest().", + "response": "Aggregated response from the request's source code." + } + }, + "hasRole(bytes32,address)": { + "details": "Returns `true` if `account` has been granted `role`." + }, + "renounceRole(bytes32,address)": { + "details": "Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `callerConfirmation`. May emit a {RoleRevoked} event." + }, + "revokeRole(bytes32,address)": { + "details": "Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event." + }, + "sendRequest(uint64,string[],bytes[],bytes)": { + "params": { + "args": "String arguments passed into the source code and accessible via the global variable `args`", + "bytesArgs": "Bytes arguments passed into the source code and accessible via the global variable `bytesArgs` as hex strings", + "encryptedSecretsReference": "Reference pointing to encrypted secrets", + "subscriptionId": "Subscription ID used to pay for request (FunctionsConsumer contract address must first be added to the subscription)" + } + }, + "setDonId(bytes32)": { + "details": "Set the DON ID", + "params": { + "newDonId": "New DON ID" + } + }, + "supportsInterface(bytes4)": { + "details": "See {IERC165-supportsInterface}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "handleOracleFulfillment(bytes32,bytes,bytes)": { + "notice": "Chainlink Functions response handler called by the Functions Router during fullilment from the designated transmitter node in an OCR round." + }, + "sendRequest(uint64,string[],bytes[],bytes)": { + "notice": "Triggers an on-demand Functions request using remote encrypted secrets" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 2212, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "_roles", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_struct(RoleData)2207_storage)" + }, + { + "astId": 2663, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "_donId", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + }, + { + "astId": 2668, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "_requests", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_uint64,t_struct(CCGRequest)3246_storage)" + }, + { + "astId": 2673, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "unprocessed_responses", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_bytes32,t_struct(CCGResponse)3312_storage)" + }, + { + "astId": 2676, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "subscriptions", + "offset": 0, + "slot": "4", + "type": "t_array(t_uint64)dyn_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes_storage)dyn_storage": { + "base": "t_bytes_storage", + "encoding": "dynamic_array", + "label": "bytes[]", + "numberOfBytes": "32" + }, + "t_array(t_string_storage)dyn_storage": { + "base": "t_string_storage", + "encoding": "dynamic_array", + "label": "string[]", + "numberOfBytes": "32" + }, + "t_array(t_uint64)dyn_storage": { + "base": "t_uint64", + "encoding": "dynamic_array", + "label": "uint64[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_enum(CCGResponseState)3300": { + "encoding": "inplace", + "label": "enum ICCGatewayClient.CCGResponseState", + "numberOfBytes": "1" + }, + "t_enum(CodeLanguage)286": { + "encoding": "inplace", + "label": "enum FunctionsRequest.CodeLanguage", + "numberOfBytes": "1" + }, + "t_enum(Location)284": { + "encoding": "inplace", + "label": "enum FunctionsRequest.Location", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_bytes32,t_struct(CCGResponse)3312_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct ICCGatewayClient.CCGResponse)", + "numberOfBytes": "32", + "value": "t_struct(CCGResponse)3312_storage" + }, + "t_mapping(t_bytes32,t_struct(RoleData)2207_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct AccessControl.RoleData)", + "numberOfBytes": "32", + "value": "t_struct(RoleData)2207_storage" + }, + "t_mapping(t_uint64,t_struct(CCGRequest)3246_storage)": { + "encoding": "mapping", + "key": "t_uint64", + "label": "mapping(uint64 => struct ICCGateway.CCGRequest)", + "numberOfBytes": "32", + "value": "t_struct(CCGRequest)3246_storage" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(CCGRequest)3246_storage": { + "encoding": "inplace", + "label": "struct ICCGateway.CCGRequest", + "members": [ + { + "astId": 3240, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "name", + "offset": 0, + "slot": "0", + "type": "t_string_storage" + }, + { + "astId": 3242, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "callbackGasLimit", + "offset": 0, + "slot": "1", + "type": "t_uint32" + }, + { + "astId": 3245, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "config", + "offset": 0, + "slot": "2", + "type": "t_struct(Request)306_storage" + } + ], + "numberOfBytes": "224" + }, + "t_struct(CCGResponse)3312_storage": { + "encoding": "inplace", + "label": "struct ICCGatewayClient.CCGResponse", + "members": [ + { + "astId": 3302, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "subscriptionId", + "offset": 0, + "slot": "0", + "type": "t_uint64" + }, + { + "astId": 3304, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "source", + "offset": 8, + "slot": "0", + "type": "t_address" + }, + { + "astId": 3307, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "state", + "offset": 28, + "slot": "0", + "type": "t_enum(CCGResponseState)3300" + }, + { + "astId": 3309, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "data", + "offset": 0, + "slot": "1", + "type": "t_bytes_storage" + }, + { + "astId": 3311, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "error", + "offset": 0, + "slot": "2", + "type": "t_bytes_storage" + } + ], + "numberOfBytes": "96" + }, + "t_struct(Request)306_storage": { + "encoding": "inplace", + "label": "struct FunctionsRequest.Request", + "members": [ + { + "astId": 289, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "codeLocation", + "offset": 0, + "slot": "0", + "type": "t_enum(Location)284" + }, + { + "astId": 292, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "secretsLocation", + "offset": 1, + "slot": "0", + "type": "t_enum(Location)284" + }, + { + "astId": 295, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "language", + "offset": 2, + "slot": "0", + "type": "t_enum(CodeLanguage)286" + }, + { + "astId": 297, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "source", + "offset": 0, + "slot": "1", + "type": "t_string_storage" + }, + { + "astId": 299, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "encryptedSecretsReference", + "offset": 0, + "slot": "2", + "type": "t_bytes_storage" + }, + { + "astId": 302, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "args", + "offset": 0, + "slot": "3", + "type": "t_array(t_string_storage)dyn_storage" + }, + { + "astId": 305, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "bytesArgs", + "offset": 0, + "slot": "4", + "type": "t_array(t_bytes_storage)dyn_storage" + } + ], + "numberOfBytes": "160" + }, + "t_struct(RoleData)2207_storage": { + "encoding": "inplace", + "label": "struct AccessControl.RoleData", + "members": [ + { + "astId": 2204, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "hasRole", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 2206, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "adminRole", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + } + ], + "numberOfBytes": "64" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint64": { + "encoding": "inplace", + "label": "uint64", + "numberOfBytes": "8" + } + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/baseSepolia/CCNotificationClient.json b/packages/hardhat/deployments/baseSepolia/CCNotificationClient.json new file mode 100644 index 0000000..d0a1e03 --- /dev/null +++ b/packages/hardhat/deployments/baseSepolia/CCNotificationClient.json @@ -0,0 +1,215 @@ +{ + "address": "0xB4687FD56Fe612889302F10281eFA8373F731e5B", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "gatewayAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "error", + "type": "string" + } + ], + "name": "ErrorReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "response", + "type": "string" + } + ], + "name": "ResponseReceived", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + } + ], + "name": "callback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "encryptedSecretsReference", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "args", + "type": "string[]" + }, + { + "internalType": "bytes[]", + "name": "bytesArgs", + "type": "bytes[]" + } + ], + "name": "request", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "subscriptionId", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_encryptedSecretsReference", + "type": "bytes" + } + ], + "name": "updateEncryptedSecretsReference", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "_subscriptionId", + "type": "uint64" + } + ], + "name": "updateSubscriptionId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x4ae78dc96c4dd5c42cc987aed32a28543d11fbcb8006c84518a63064c6f373c1", + "receipt": { + "to": null, + "from": "0xD10F43A0aa00D244DAcFBE3C49b9B918B717Ff2c", + "contractAddress": "0xB4687FD56Fe612889302F10281eFA8373F731e5B", + "transactionIndex": 10, + "gasUsed": "686011", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x494b855eb6d93e2c58a91c1ca0e6007243536d29aec7c5df5597498ef65d4648", + "transactionHash": "0x4ae78dc96c4dd5c42cc987aed32a28543d11fbcb8006c84518a63064c6f373c1", + "logs": [], + "blockNumber": 10770577, + "cumulativeGasUsed": "1867307", + "status": 1, + "byzantium": true + }, + "args": [ + "0x52bfF133bc6A891828baB02fB7338fB943E8D078" + ], + "numDeployments": 1, + "solcInputHash": "da2f6e6d8541f69733b0b28912d4a325", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"gatewayAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"error\",\"type\":\"string\"}],\"name\":\"ErrorReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"response\",\"type\":\"string\"}],\"name\":\"ResponseReceived\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"callback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"encryptedSecretsReference\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"args\",\"type\":\"string[]\"},{\"internalType\":\"bytes[]\",\"name\":\"bytesArgs\",\"type\":\"bytes[]\"}],\"name\":\"request\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"subscriptionId\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_encryptedSecretsReference\",\"type\":\"bytes\"}],\"name\":\"updateEncryptedSecretsReference\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_subscriptionId\",\"type\":\"uint64\"}],\"name\":\"updateSubscriptionId\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/CCNotificationClient.sol\":\"CCNotificationClient\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\n/// @title Chainlink Functions client interface.\\ninterface IFunctionsClient {\\n /// @notice Chainlink Functions response handler called by the Functions Router\\n /// during fullilment from the designated transmitter node in an OCR round.\\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\\n /// @param response Aggregated response from the request's source code.\\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\\n /// @dev Either response or error parameter will be set, but never both.\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\\n}\\n\",\"keccak256\":\"0x6117b82e7c4eec44ce557b0fc8bc1ac5f49e5d160ac6d4485452d6aafdd762ff\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {FunctionsResponse} from \\\"../libraries/FunctionsResponse.sol\\\";\\n\\n/// @title Chainlink Functions Router interface.\\ninterface IFunctionsRouter {\\n /// @notice The identifier of the route to retrieve the address of the access control contract\\n /// The access control contract controls which accounts can manage subscriptions\\n /// @return id - bytes32 id that can be passed to the \\\"getContractById\\\" of the Router\\n function getAllowListId() external view returns (bytes32);\\n\\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\\n /// The access control contract controls which accounts can manage subscriptions\\n function setAllowListId(bytes32 allowListId) external;\\n\\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\\n /// @return adminFee\\n function getAdminFee() external view returns (uint72 adminFee);\\n\\n /// @notice Sends a request using the provided subscriptionId\\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\\n /// a client can make requests from different contracts referencing the same subscription\\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\\n /// @param dataVersion - Gas limit for the fulfillment callback\\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\\n /// @param donId - An identifier used to determine which route to send the request along\\n /// @return requestId - A unique request identifier\\n function sendRequest(\\n uint64 subscriptionId,\\n bytes calldata data,\\n uint16 dataVersion,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) external returns (bytes32);\\n\\n /// @notice Sends a request to the proposed contracts\\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\\n /// a client can make requests from different contracts referencing the same subscription\\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\\n /// @param dataVersion - Gas limit for the fulfillment callback\\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\\n /// @param donId - An identifier used to determine which route to send the request along\\n /// @return requestId - A unique request identifier\\n function sendRequestToProposed(\\n uint64 subscriptionId,\\n bytes calldata data,\\n uint16 dataVersion,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) external returns (bytes32);\\n\\n /// @notice Fulfill the request by:\\n /// - calling back the data that the Oracle returned to the client contract\\n /// - pay the DON for processing the request\\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\\n /// @param response response data from DON consensus\\n /// @param err error from DON consensus\\n /// @param juelsPerGas - current rate of juels/gas\\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\\n /// @param transmitter - The Node that transmitted the OCR report\\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\\n /// @return fulfillResult -\\n /// @return callbackGasCostJuels -\\n function fulfill(\\n bytes memory response,\\n bytes memory err,\\n uint96 juelsPerGas,\\n uint96 costWithoutFulfillment,\\n address transmitter,\\n FunctionsResponse.Commitment memory commitment\\n ) external returns (FunctionsResponse.FulfillResult, uint96);\\n\\n /// @notice Validate requested gas limit is below the subscription max.\\n /// @param subscriptionId subscription ID\\n /// @param callbackGasLimit desired callback gas limit\\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\\n\\n /// @notice Get the current contract given an ID\\n /// @param id A bytes32 identifier for the route\\n /// @return contract The current contract address\\n function getContractById(bytes32 id) external view returns (address);\\n\\n /// @notice Get the proposed next contract given an ID\\n /// @param id A bytes32 identifier for the route\\n /// @return contract The current or proposed contract address\\n function getProposedContractById(bytes32 id) external view returns (address);\\n\\n /// @notice Return the latest proprosal set\\n /// @return ids The identifiers of the contracts to update\\n /// @return to The addresses of the contracts that will be updated to\\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\\n\\n /// @notice Proposes one or more updates to the contract routes\\n /// @dev Only callable by owner\\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\\n\\n /// @notice Updates the current contract routes to the proposed contracts\\n /// @dev Only callable by owner\\n function updateContracts() external;\\n\\n /// @dev Puts the system into an emergency stopped state.\\n /// @dev Only callable by owner\\n function pause() external;\\n\\n /// @dev Takes the system out of an emergency stopped state.\\n /// @dev Only callable by owner\\n function unpause() external;\\n}\\n\",\"keccak256\":\"0x44db41e8ff90c2828ca0ada125abc4b411921a86514a4a047fd9fd43ba9d7e08\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {CBOR} from \\\"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\\\";\\n\\n/// @title Library for encoding the input data of a Functions request into CBOR\\nlibrary FunctionsRequest {\\n using CBOR for CBOR.CBORBuffer;\\n\\n uint16 public constant REQUEST_DATA_VERSION = 1;\\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\\n\\n enum Location {\\n Inline, // Provided within the Request\\n Remote, // Hosted through remote location that can be accessed through a provided URL\\n DONHosted // Hosted on the DON's storage\\n }\\n\\n enum CodeLanguage {\\n JavaScript\\n // In future version we may add other languages\\n }\\n\\n struct Request {\\n Location codeLocation; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The location of the source code that will be executed on each node in the DON\\n Location secretsLocation; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The location of secrets that will be passed into the source code. *Only Remote secrets are supported\\n CodeLanguage language; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The coding language that the source code is written in\\n string source; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\\n bytes encryptedSecretsReference; // \\u2550\\u2550\\u2578 Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\\n string[] args; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 String arguments that will be passed into the source code\\n bytes[] bytesArgs; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Bytes arguments that will be passed into the source code\\n }\\n\\n error EmptySource();\\n error EmptySecrets();\\n error EmptyArgs();\\n error NoInlineSecrets();\\n\\n /// @notice Encodes a Request to CBOR encoded bytes\\n /// @param self The request to encode\\n /// @return CBOR encoded bytes\\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\\n\\n buffer.writeString(\\\"codeLocation\\\");\\n buffer.writeUInt256(uint256(self.codeLocation));\\n\\n buffer.writeString(\\\"language\\\");\\n buffer.writeUInt256(uint256(self.language));\\n\\n buffer.writeString(\\\"source\\\");\\n buffer.writeString(self.source);\\n\\n if (self.args.length > 0) {\\n buffer.writeString(\\\"args\\\");\\n buffer.startArray();\\n for (uint256 i = 0; i < self.args.length; ++i) {\\n buffer.writeString(self.args[i]);\\n }\\n buffer.endSequence();\\n }\\n\\n if (self.encryptedSecretsReference.length > 0) {\\n if (self.secretsLocation == Location.Inline) {\\n revert NoInlineSecrets();\\n }\\n buffer.writeString(\\\"secretsLocation\\\");\\n buffer.writeUInt256(uint256(self.secretsLocation));\\n buffer.writeString(\\\"secrets\\\");\\n buffer.writeBytes(self.encryptedSecretsReference);\\n }\\n\\n if (self.bytesArgs.length > 0) {\\n buffer.writeString(\\\"bytesArgs\\\");\\n buffer.startArray();\\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\\n buffer.writeBytes(self.bytesArgs[i]);\\n }\\n buffer.endSequence();\\n }\\n\\n return buffer.buf.buf;\\n }\\n\\n /// @notice Initializes a Chainlink Functions Request\\n /// @dev Sets the codeLocation and code on the request\\n /// @param self The uninitialized request\\n /// @param codeLocation The user provided source code location\\n /// @param language The programming language of the user code\\n /// @param source The user provided source code or a url\\n function initializeRequest(\\n Request memory self,\\n Location codeLocation,\\n CodeLanguage language,\\n string memory source\\n ) internal pure {\\n if (bytes(source).length == 0) revert EmptySource();\\n\\n self.codeLocation = codeLocation;\\n self.language = language;\\n self.source = source;\\n }\\n\\n /// @notice Initializes a Chainlink Functions Request\\n /// @dev Simplified version of initializeRequest for PoC\\n /// @param self The uninitialized request\\n /// @param javaScriptSource The user provided JS code (must not be empty)\\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\\n }\\n\\n /// @notice Adds Remote user encrypted secrets to a Request\\n /// @param self The initialized request\\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\\n\\n self.secretsLocation = Location.Remote;\\n self.encryptedSecretsReference = encryptedSecretsReference;\\n }\\n\\n /// @notice Adds DON-hosted secrets reference to a Request\\n /// @param self The initialized request\\n /// @param slotID Slot ID of the user's secrets hosted on DON\\n /// @param version User data version (for the slotID)\\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\\n\\n buffer.writeString(\\\"slotID\\\");\\n buffer.writeUInt64(slotID);\\n buffer.writeString(\\\"version\\\");\\n buffer.writeUInt64(version);\\n\\n self.secretsLocation = Location.DONHosted;\\n self.encryptedSecretsReference = buffer.buf.buf;\\n }\\n\\n /// @notice Sets args for the user run function\\n /// @param self The initialized request\\n /// @param args The array of string args (must not be empty)\\n function setArgs(Request memory self, string[] memory args) internal pure {\\n if (args.length == 0) revert EmptyArgs();\\n\\n self.args = args;\\n }\\n\\n /// @notice Sets bytes args for the user run function\\n /// @param self The initialized request\\n /// @param args The array of bytes args (must not be empty)\\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\\n if (args.length == 0) revert EmptyArgs();\\n\\n self.bytesArgs = args;\\n }\\n}\\n\",\"keccak256\":\"0xed75be0eaba358d468f1fe18adc377d5044f57eff0070081f884a1f212d0adc2\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\n/// @title Library of types that are used for fulfillment of a Functions request\\nlibrary FunctionsResponse {\\n // Used to send request information from the Router to the Coordinator\\n struct RequestMeta {\\n bytes data; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\\n bytes32 flags; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Per-subscription flags\\n address requestingContract; // \\u2550\\u2550\\u2557 The client contract that is sending the request\\n uint96 availableBalance; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u255d Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\\n uint72 adminFee; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\\n uint64 subscriptionId; // \\u2551 Identifier of the billing subscription that will be charged for the request\\n uint64 initiatedRequests; // \\u2551 The number of requests that have been started\\n uint32 callbackGasLimit; // \\u2551 The amount of gas that the callback to the consuming contract will be given\\n uint16 dataVersion; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The version of the structure of the CBOR encoded request data\\n uint64 completedRequests; // \\u2550\\u2550\\u2550\\u2550\\u2557 The number of requests that have successfully completed or timed out\\n address subscriptionOwner; // \\u2550\\u2550\\u2550\\u255d The owner of the billing subscription\\n }\\n\\n enum FulfillResult {\\n FULFILLED, // 0\\n USER_CALLBACK_ERROR, // 1\\n INVALID_REQUEST_ID, // 2\\n COST_EXCEEDS_COMMITMENT, // 3\\n INSUFFICIENT_GAS_PROVIDED, // 4\\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\\n INVALID_COMMITMENT // 6\\n }\\n\\n struct Commitment {\\n bytes32 requestId; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 A unique identifier for a Chainlink Functions request\\n address coordinator; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 The Coordinator contract that manages the DON that is servicing a request\\n uint96 estimatedTotalCostJuels; // \\u2550\\u2550\\u2550\\u2550\\u255d The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\\n address client; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 The client contract that sent the request\\n uint64 subscriptionId; // \\u2551 Identifier of the billing subscription that will be charged for the request\\n uint32 callbackGasLimit; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The amount of gas that the callback to the consuming contract will be given\\n uint72 adminFee; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\\n uint72 donFee; // \\u2551 Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\\n uint40 gasOverheadBeforeCallback; // \\u2551 Represents the average gas execution cost before the fulfillment callback.\\n uint40 gasOverheadAfterCallback; // \\u2551 Represents the average gas execution cost after the fulfillment callback.\\n uint32 timeoutTimestamp; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The timestamp at which a request will be eligible to be timed out\\n }\\n}\\n\",\"keccak256\":\"0xc72eb037effef32146f7cd4086af00f44f28c8649d891e5e404fec5fda7e802b\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {IFunctionsRouter} from \\\"../v1_0_0/interfaces/IFunctionsRouter.sol\\\";\\nimport {IFunctionsClient} from \\\"../v1_0_0/interfaces/IFunctionsClient.sol\\\";\\n\\nimport {FunctionsRequest} from \\\"../v1_0_0/libraries/FunctionsRequest.sol\\\";\\n\\n/// @title The Chainlink Functions client contract\\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\\nabstract contract FunctionsClient is IFunctionsClient {\\n using FunctionsRequest for FunctionsRequest.Request;\\n\\n IFunctionsRouter internal immutable i_functionsRouter;\\n\\n event RequestSent(bytes32 indexed id);\\n event RequestFulfilled(bytes32 indexed id);\\n\\n error OnlyRouterCanFulfill();\\n\\n constructor(address router) {\\n i_functionsRouter = IFunctionsRouter(router);\\n }\\n\\n /// @notice Sends a Chainlink Functions request\\n /// @param data The CBOR encoded bytes data for a Functions request\\n /// @param subscriptionId The subscription ID that will be charged to service the request\\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\\n /// @return requestId The generated request ID for this request\\n function _sendRequest(\\n bytes memory data,\\n uint64 subscriptionId,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) internal returns (bytes32) {\\n bytes32 requestId = i_functionsRouter.sendRequest(\\n subscriptionId,\\n data,\\n FunctionsRequest.REQUEST_DATA_VERSION,\\n callbackGasLimit,\\n donId\\n );\\n emit RequestSent(requestId);\\n return requestId;\\n }\\n\\n /// @notice User defined function to handle a response from the DON\\n /// @param requestId The request ID, returned by sendRequest()\\n /// @param response Aggregated response from the execution of the user's source code\\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\\n /// @dev Either response or error parameter will be set, but never both\\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\\n\\n /// @inheritdoc IFunctionsClient\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\\n if (msg.sender != address(i_functionsRouter)) {\\n revert OnlyRouterCanFulfill();\\n }\\n _fulfillRequest(requestId, response, err);\\n emit RequestFulfilled(requestId);\\n }\\n}\\n\",\"keccak256\":\"0xdc40f1e9dea8a572d43d310afa68e978c35218d16097b9cfd9d1b6137df3cd0a\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-2-Clause\\npragma solidity ^0.8.4;\\n\\n/**\\n* @dev A library for working with mutable byte buffers in Solidity.\\n*\\n* Byte buffers are mutable and expandable, and provide a variety of primitives\\n* for appending to them. At any time you can fetch a bytes object containing the\\n* current contents of the buffer. The bytes object should not be stored between\\n* operations, as it may change due to resizing of the buffer.\\n*/\\nlibrary Buffer {\\n /**\\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\\n * a capacity. The capacity may be longer than the current value, in\\n * which case it can be extended without the need to allocate more memory.\\n */\\n struct buffer {\\n bytes buf;\\n uint capacity;\\n }\\n\\n /**\\n * @dev Initializes a buffer with an initial capacity.\\n * @param buf The buffer to initialize.\\n * @param capacity The number of bytes of space to allocate the buffer.\\n * @return The buffer, for chaining.\\n */\\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\\n if (capacity % 32 != 0) {\\n capacity += 32 - (capacity % 32);\\n }\\n // Allocate space for the buffer data\\n buf.capacity = capacity;\\n assembly {\\n let ptr := mload(0x40)\\n mstore(buf, ptr)\\n mstore(ptr, 0)\\n let fpm := add(32, add(ptr, capacity))\\n if lt(fpm, ptr) {\\n revert(0, 0)\\n }\\n mstore(0x40, fpm)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Initializes a new buffer from an existing bytes object.\\n * Changes to the buffer may mutate the original value.\\n * @param b The bytes object to initialize the buffer with.\\n * @return A new buffer.\\n */\\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\\n buffer memory buf;\\n buf.buf = b;\\n buf.capacity = b.length;\\n return buf;\\n }\\n\\n function resize(buffer memory buf, uint capacity) private pure {\\n bytes memory oldbuf = buf.buf;\\n init(buf, capacity);\\n append(buf, oldbuf);\\n }\\n\\n /**\\n * @dev Sets buffer length to 0.\\n * @param buf The buffer to truncate.\\n * @return The original buffer, for chaining..\\n */\\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\\n assembly {\\n let bufptr := mload(buf)\\n mstore(bufptr, 0)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to copy.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\\n require(len <= data.length);\\n\\n uint off = buf.buf.length;\\n uint newCapacity = off + len;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint dest;\\n uint src;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Length of existing buffer data\\n let buflen := mload(bufptr)\\n // Start address = buffer address + offset + sizeof(buffer length)\\n dest := add(add(bufptr, 32), off)\\n // Update buffer length if we're extending it\\n if gt(newCapacity, buflen) {\\n mstore(bufptr, newCapacity)\\n }\\n src := add(data, 32)\\n }\\n\\n // Copy word-length chunks while possible\\n for (; len >= 32; len -= 32) {\\n assembly {\\n mstore(dest, mload(src))\\n }\\n dest += 32;\\n src += 32;\\n }\\n\\n // Copy remaining bytes\\n unchecked {\\n uint mask = (256 ** (32 - len)) - 1;\\n assembly {\\n let srcpart := and(mload(src), not(mask))\\n let destpart := and(mload(dest), mask)\\n mstore(dest, or(destpart, srcpart))\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\\n return append(buf, data, data.length);\\n }\\n\\n /**\\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\\n * capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint offPlusOne = off + 1;\\n if (off >= buf.capacity) {\\n resize(buf, offPlusOne * 2);\\n }\\n\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + off\\n let dest := add(add(bufptr, off), 32)\\n mstore8(dest, data)\\n // Update buffer length if we extended it\\n if gt(offPlusOne, mload(bufptr)) {\\n mstore(bufptr, offPlusOne)\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (left-aligned).\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n unchecked {\\n uint mask = (256 ** len) - 1;\\n // Right-align data\\n data = data >> (8 * (32 - len));\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chhaining.\\n */\\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\\n return append(buf, bytes32(data), 20);\\n }\\n\\n /**\\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\\n return append(buf, data, 32);\\n }\\n\\n /**\\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (right-aligned).\\n * @return The original buffer.\\n */\\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint mask = (256 ** len) - 1;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n return buf;\\n }\\n}\",\"keccak256\":\"0x0d86b367813922094e02594a406ba89f5e97d3d74ec2ce3c4032566840e302b0\",\"license\":\"BSD-2-Clause\"},\"@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.4;\\n\\nimport \\\"../../@ensdomains/buffer/v0.1.0/Buffer.sol\\\";\\n\\n/**\\n* @dev A library for populating CBOR encoded payload in Solidity.\\n*\\n* https://datatracker.ietf.org/doc/html/rfc7049\\n*\\n* The library offers various write* and start* methods to encode values of different types.\\n* The resulted buffer can be obtained with data() method.\\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\\n* in an invalid CBOR if start/write/end flow is violated.\\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\\n* except for nested start/end pairs.\\n*/\\n\\nlibrary CBOR {\\n using Buffer for Buffer.buffer;\\n\\n struct CBORBuffer {\\n Buffer.buffer buf;\\n uint256 depth;\\n }\\n\\n uint8 private constant MAJOR_TYPE_INT = 0;\\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\\n uint8 private constant MAJOR_TYPE_BYTES = 2;\\n uint8 private constant MAJOR_TYPE_STRING = 3;\\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\\n uint8 private constant MAJOR_TYPE_MAP = 5;\\n uint8 private constant MAJOR_TYPE_TAG = 6;\\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\\n\\n uint8 private constant TAG_TYPE_BIGNUM = 2;\\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\\n\\n uint8 private constant CBOR_FALSE = 20;\\n uint8 private constant CBOR_TRUE = 21;\\n uint8 private constant CBOR_NULL = 22;\\n uint8 private constant CBOR_UNDEFINED = 23;\\n\\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\\n Buffer.init(cbor.buf, capacity);\\n cbor.depth = 0;\\n return cbor;\\n }\\n\\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\\n require(buf.depth == 0, \\\"Invalid CBOR\\\");\\n return buf.buf.buf;\\n }\\n\\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\\n writeBytes(buf, abi.encode(value));\\n }\\n\\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\\n if (value < 0) {\\n buf.buf.appendUint8(\\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\\n );\\n writeBytes(buf, abi.encode(uint256(-1 - value)));\\n } else {\\n writeUInt256(buf, uint256(value));\\n }\\n }\\n\\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\\n }\\n\\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\\n if(value >= 0) {\\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\\n } else{\\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\\n }\\n }\\n\\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\\n buf.buf.append(value);\\n }\\n\\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\\n buf.buf.append(bytes(value));\\n }\\n\\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\\n }\\n\\n function writeNull(CBORBuffer memory buf) internal pure {\\n writeContentFree(buf, CBOR_NULL);\\n }\\n\\n function writeUndefined(CBORBuffer memory buf) internal pure {\\n writeContentFree(buf, CBOR_UNDEFINED);\\n }\\n\\n function startArray(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\\n buf.depth += 1;\\n }\\n\\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\\n }\\n\\n function startMap(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\\n buf.depth += 1;\\n }\\n\\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\\n }\\n\\n function endSequence(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\\n buf.depth -= 1;\\n }\\n\\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\\n writeString(buf, key);\\n writeString(buf, value);\\n }\\n\\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\\n writeString(buf, key);\\n writeBytes(buf, value);\\n }\\n\\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\\n writeString(buf, key);\\n writeUInt256(buf, value);\\n }\\n\\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\\n writeString(buf, key);\\n writeInt256(buf, value);\\n }\\n\\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\\n writeString(buf, key);\\n writeUInt64(buf, value);\\n }\\n\\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\\n writeString(buf, key);\\n writeInt64(buf, value);\\n }\\n\\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\\n writeString(buf, key);\\n writeBool(buf, value);\\n }\\n\\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n writeNull(buf);\\n }\\n\\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n writeUndefined(buf);\\n }\\n\\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n startMap(buf);\\n }\\n\\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n startArray(buf);\\n }\\n\\n function writeFixedNumeric(\\n CBORBuffer memory buf,\\n uint8 major,\\n uint64 value\\n ) private pure {\\n if (value <= 23) {\\n buf.buf.appendUint8(uint8((major << 5) | value));\\n } else if (value <= 0xFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 24));\\n buf.buf.appendInt(value, 1);\\n } else if (value <= 0xFFFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 25));\\n buf.buf.appendInt(value, 2);\\n } else if (value <= 0xFFFFFFFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 26));\\n buf.buf.appendInt(value, 4);\\n } else {\\n buf.buf.appendUint8(uint8((major << 5) | 27));\\n buf.buf.appendInt(value, 8);\\n }\\n }\\n\\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\\n private\\n pure\\n {\\n buf.buf.appendUint8(uint8((major << 5) | 31));\\n }\\n\\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\\n private\\n pure\\n {\\n writeFixedNumeric(buf, major, length);\\n }\\n\\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\\n }\\n}\",\"keccak256\":\"0xdecf04203502670ac72ba466c75e4f87f4419907365005f0d73e7d07ee3e5715\",\"license\":\"MIT\"},\"contracts/CCExampleClient.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {ICCGatewayClient} from \\\"./interfaces/ICCGatewayClient.sol\\\";\\nimport {ICCGateway} from \\\"./interfaces/ICCGateway.sol\\\";\\n\\ncontract CCExampleClient is ICCGatewayClient {\\n ICCGateway private immutable gateway;\\n\\n uint64 public subscriptionId = 0;\\n bytes public encryptedSecretsReference = \\\"\\\";\\n\\n event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response);\\n event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error);\\n\\n constructor(address gatewayAddress) {\\n gateway = ICCGateway(gatewayAddress);\\n }\\n\\n function updateSubscriptionId(uint64 _subscriptionId) external {\\n subscriptionId = _subscriptionId;\\n }\\n\\n function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external {\\n encryptedSecretsReference = _encryptedSecretsReference;\\n }\\n\\n function request(string[] calldata args, bytes[] calldata bytesArgs) external {\\n require(subscriptionId != 0, \\\"Subscription ID not set\\\");\\n\\n gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference);\\n }\\n\\n function callback(bytes32 requestId) external override {\\n ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true);\\n\\n if (response.state == ICCGatewayClient.CCGResponseState.Success) {\\n emit ResponseReceived(response.subscriptionId, requestId, string(response.data));\\n } else {\\n emit ErrorReceived(response.subscriptionId, requestId, string(response.error));\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf905275976390214962167d4896d9c0eab670fce2b5f5cfd213b1ae2d776347a\",\"license\":\"UNLICENSED\"},\"contracts/CCNotificationClient.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {CCExampleClient} from \\\"./CCExampleClient.sol\\\";\\n\\ncontract CCNotificationClient is CCExampleClient {\\n constructor(address gatewayAddress) CCExampleClient(gatewayAddress) {}\\n}\\n\",\"keccak256\":\"0xad7961e1ea78babecd98162342bf18b8ae44e34f6ea1d0f32533666659f68ef5\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/ICCGateway.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\\nimport {FunctionsRequest} from \\\"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\\\";\\n\\ninterface ICCGateway {\\n struct CCGRequest {\\n string name;\\n uint32 callbackGasLimit;\\n FunctionsRequest.Request config;\\n }\\n\\n /**\\n * @dev Can't register a request with an empty name\\n */\\n error CCGRequestNameEmpty();\\n\\n /**\\n * @dev Only the same source of the requestId is allowed to call the function\\n */\\n error CCGOnlySameSourceAllowed(bytes32 requestId);\\n\\n /**\\n * @dev Only a registered subscriptionId is allowed to call the function\\n */\\n error CCGRequestNotRegistered(uint64 subscriptionId);\\n\\n /**\\n * @dev Can't fulfill a request that has already been fulfilled\\n */\\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\\n\\n /**\\n * @dev Only A manager can call the function\\n */\\n error CCGOnlyManagerAllowed();\\n\\n /**\\n * @dev Send a request to the Functions DON\\n */\\n function sendRequest(\\n uint64 subscriptionId,\\n string[] calldata args,\\n bytes[] calldata bytesArgs,\\n bytes calldata encryptedSecretsReference\\n ) external returns (bytes32 requestId);\\n\\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\\n}\\n\",\"keccak256\":\"0xbc7d92f8db240767c8636e8df9b818cc1f5abfde22b8c49eee50f418fb0dbea5\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/ICCGatewayClient.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\ninterface ICCGatewayClient {\\n enum CCGResponseState {Sent, Success, Error}\\n\\n struct CCGResponse {\\n uint64 subscriptionId;\\n address source;\\n CCGResponseState state;\\n bytes data;\\n bytes error;\\n }\\n\\n function callback(bytes32 requestId) external;\\n}\\n\",\"keccak256\":\"0xb69320aa2152f374dec4cfc70b73f46e0db9774a1411d2acff1481ee3295f86a\",\"license\":\"UNLICENSED\"}},\"version\":1}", + "bytecode": "0x600080546001600160401b031916815560c060405260a090815260019062000028908262000110565b503480156200003657600080fd5b5060405162000d6a38038062000d6a8339810160408190526200005991620001dc565b6001600160a01b03166080526200020e565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200009657607f821691505b602082108103620000b757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200010b57600081815260208120601f850160051c81016020861015620000e65750805b601f850160051c820191505b818110156200010757828155600101620000f2565b5050505b505050565b81516001600160401b038111156200012c576200012c6200006b565b62000144816200013d845462000081565b84620000bd565b602080601f8311600181146200017c5760008415620001635750858301515b600019600386901b1c1916600185901b17855562000107565b600085815260208120601f198616915b82811015620001ad578886015182559484019460019091019084016200018c565b5085821015620001cc5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215620001ef57600080fd5b81516001600160a01b03811681146200020757600080fd5b9392505050565b608051610b39620002316000396000818161023101526102e30152610b396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806309c1ba2e1461006757806314b1dd1b146100975780634ce64f0e146100ca578063cdc634f1146100dd578063cfd58386146100f2578063df13994e14610105575b600080fd5b60005461007a906001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b6100c86100a5366004610415565b6000805467ffffffffffffffff19166001600160401b0392909216919091179055565b005b6100c86100d8366004610439565b610118565b6100e561012a565b60405161008e91906104fa565b6100c8610100366004610558565b6101b8565b6100c86101133660046105c3565b6102c3565b600161012582848361067a565b505050565b60018054610137906105f2565b80601f0160208091040260200160405190810160405280929190818152602001828054610163906105f2565b80156101b05780601f10610185576101008083540402835291602001916101b0565b820191906000526020600020905b81548152906001019060200180831161019357829003601f168201915b505050505081565b600080546001600160401b031690036102175760405162461bcd60e51b815260206004820152601760248201527f537562736372697074696f6e204944206e6f7420736574000000000000000000604482015260640160405180910390fd5b600054604051634b60ac1760e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916396c1582e91610279916001600160401b0316908890889088908890600190600401610824565b6020604051808303816000875af1158015610298573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bc919061090d565b5050505050565b6040516315b851d160e01b815260048101829052600160248201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906315b851d1906044016000604051808303816000875af1158015610334573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261035c91908101906109e9565b905060018160400151600281111561037657610376610abc565b036103c2577fa5522492de1ed169e1e5e76f6cb2ceb5f045ca7f7ea5da3137c573d996cc4b9f81600001518383606001516040516103b693929190610ad2565b60405180910390a15050565b7f331e0adccd60eab7ca94cf49c60a45549ce9dc1281139656a13bdf73774d179c81600001518383608001516040516103b693929190610ad2565b6001600160401b038116811461041257600080fd5b50565b60006020828403121561042757600080fd5b8135610432816103fd565b9392505050565b6000806020838503121561044c57600080fd5b82356001600160401b038082111561046357600080fd5b818501915085601f83011261047757600080fd5b81358181111561048657600080fd5b86602082850101111561049857600080fd5b60209290920196919550909350505050565b60005b838110156104c55781810151838201526020016104ad565b50506000910152565b600081518084526104e68160208601602086016104aa565b601f01601f19169290920160200192915050565b60208152600061043260208301846104ce565b60008083601f84011261051f57600080fd5b5081356001600160401b0381111561053657600080fd5b6020830191508360208260051b850101111561055157600080fd5b9250929050565b6000806000806040858703121561056e57600080fd5b84356001600160401b038082111561058557600080fd5b6105918883890161050d565b909650945060208701359150808211156105aa57600080fd5b506105b78782880161050d565b95989497509550505050565b6000602082840312156105d557600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061060657607f821691505b60208210810361062657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561012557600081815260208120601f850160051c810160208610156106535750805b601f850160051c820191505b818110156106725782815560010161065f565b505050505050565b6001600160401b03831115610691576106916105dc565b6106a58361069f83546105f2565b8361062c565b6000601f8411600181146106d957600085156106c15750838201355b600019600387901b1c1916600186901b1783556102bc565b600083815260209020601f19861690835b8281101561070a57868501358255602094850194600190920191016106ea565b50868210156107275760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000808335601e1984360301811261077957600080fd5b83016020810192503590506001600160401b0381111561079857600080fd5b80360382131561055157600080fd5b600081546107b4816105f2565b8085526020600183811680156107d157600181146107eb57610819565b60ff1985168884015283151560051b880183019550610819565b866000528260002060005b858110156108115781548a82018601529083019084016107f6565b890184019650505b505050505092915050565b6000608082016001600160401b038916835260206080818501528188835260a08501905060a08960051b86010192508960005b8a81101561089157868503609f19018352610872828d610762565b61087d878284610739565b965050509183019190830190600101610857565b5050508382036040850152858252808201600587901b830182018860005b898110156108e957858303601f190184526108ca828c610762565b6108d5858284610739565b9587019594505050908401906001016108af565b505085810360608701526108fd81886107a7565b9c9b505050505050505050505050565b60006020828403121561091f57600080fd5b5051919050565b60405160a081016001600160401b0381118282101715610948576109486105dc565b60405290565b80516003811061095d57600080fd5b919050565b600082601f83011261097357600080fd5b81516001600160401b038082111561098d5761098d6105dc565b604051601f8301601f19908116603f011681019082821181831017156109b5576109b56105dc565b816040528381528660208588010111156109ce57600080fd5b6109df8460208301602089016104aa565b9695505050505050565b6000602082840312156109fb57600080fd5b81516001600160401b0380821115610a1257600080fd5b9083019060a08286031215610a2657600080fd5b610a2e610926565b8251610a39816103fd565b815260208301516001600160a01b0381168114610a5557600080fd5b6020820152610a666040840161094e565b6040820152606083015182811115610a7d57600080fd5b610a8987828601610962565b606083015250608083015182811115610aa157600080fd5b610aad87828601610962565b60808301525095945050505050565b634e487b7160e01b600052602160045260246000fd5b6001600160401b0384168152826020820152606060408201526000610afa60608301846104ce565b9594505050505056fea26469706673582212205b5117b00ce65fae13c73e5fe55ef1d7583f0a364b1ac0a38e3f21e0d2c88f9a64736f6c63430008140033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100625760003560e01c806309c1ba2e1461006757806314b1dd1b146100975780634ce64f0e146100ca578063cdc634f1146100dd578063cfd58386146100f2578063df13994e14610105575b600080fd5b60005461007a906001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b6100c86100a5366004610415565b6000805467ffffffffffffffff19166001600160401b0392909216919091179055565b005b6100c86100d8366004610439565b610118565b6100e561012a565b60405161008e91906104fa565b6100c8610100366004610558565b6101b8565b6100c86101133660046105c3565b6102c3565b600161012582848361067a565b505050565b60018054610137906105f2565b80601f0160208091040260200160405190810160405280929190818152602001828054610163906105f2565b80156101b05780601f10610185576101008083540402835291602001916101b0565b820191906000526020600020905b81548152906001019060200180831161019357829003601f168201915b505050505081565b600080546001600160401b031690036102175760405162461bcd60e51b815260206004820152601760248201527f537562736372697074696f6e204944206e6f7420736574000000000000000000604482015260640160405180910390fd5b600054604051634b60ac1760e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916396c1582e91610279916001600160401b0316908890889088908890600190600401610824565b6020604051808303816000875af1158015610298573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bc919061090d565b5050505050565b6040516315b851d160e01b815260048101829052600160248201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906315b851d1906044016000604051808303816000875af1158015610334573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261035c91908101906109e9565b905060018160400151600281111561037657610376610abc565b036103c2577fa5522492de1ed169e1e5e76f6cb2ceb5f045ca7f7ea5da3137c573d996cc4b9f81600001518383606001516040516103b693929190610ad2565b60405180910390a15050565b7f331e0adccd60eab7ca94cf49c60a45549ce9dc1281139656a13bdf73774d179c81600001518383608001516040516103b693929190610ad2565b6001600160401b038116811461041257600080fd5b50565b60006020828403121561042757600080fd5b8135610432816103fd565b9392505050565b6000806020838503121561044c57600080fd5b82356001600160401b038082111561046357600080fd5b818501915085601f83011261047757600080fd5b81358181111561048657600080fd5b86602082850101111561049857600080fd5b60209290920196919550909350505050565b60005b838110156104c55781810151838201526020016104ad565b50506000910152565b600081518084526104e68160208601602086016104aa565b601f01601f19169290920160200192915050565b60208152600061043260208301846104ce565b60008083601f84011261051f57600080fd5b5081356001600160401b0381111561053657600080fd5b6020830191508360208260051b850101111561055157600080fd5b9250929050565b6000806000806040858703121561056e57600080fd5b84356001600160401b038082111561058557600080fd5b6105918883890161050d565b909650945060208701359150808211156105aa57600080fd5b506105b78782880161050d565b95989497509550505050565b6000602082840312156105d557600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061060657607f821691505b60208210810361062657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561012557600081815260208120601f850160051c810160208610156106535750805b601f850160051c820191505b818110156106725782815560010161065f565b505050505050565b6001600160401b03831115610691576106916105dc565b6106a58361069f83546105f2565b8361062c565b6000601f8411600181146106d957600085156106c15750838201355b600019600387901b1c1916600186901b1783556102bc565b600083815260209020601f19861690835b8281101561070a57868501358255602094850194600190920191016106ea565b50868210156107275760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000808335601e1984360301811261077957600080fd5b83016020810192503590506001600160401b0381111561079857600080fd5b80360382131561055157600080fd5b600081546107b4816105f2565b8085526020600183811680156107d157600181146107eb57610819565b60ff1985168884015283151560051b880183019550610819565b866000528260002060005b858110156108115781548a82018601529083019084016107f6565b890184019650505b505050505092915050565b6000608082016001600160401b038916835260206080818501528188835260a08501905060a08960051b86010192508960005b8a81101561089157868503609f19018352610872828d610762565b61087d878284610739565b965050509183019190830190600101610857565b5050508382036040850152858252808201600587901b830182018860005b898110156108e957858303601f190184526108ca828c610762565b6108d5858284610739565b9587019594505050908401906001016108af565b505085810360608701526108fd81886107a7565b9c9b505050505050505050505050565b60006020828403121561091f57600080fd5b5051919050565b60405160a081016001600160401b0381118282101715610948576109486105dc565b60405290565b80516003811061095d57600080fd5b919050565b600082601f83011261097357600080fd5b81516001600160401b038082111561098d5761098d6105dc565b604051601f8301601f19908116603f011681019082821181831017156109b5576109b56105dc565b816040528381528660208588010111156109ce57600080fd5b6109df8460208301602089016104aa565b9695505050505050565b6000602082840312156109fb57600080fd5b81516001600160401b0380821115610a1257600080fd5b9083019060a08286031215610a2657600080fd5b610a2e610926565b8251610a39816103fd565b815260208301516001600160a01b0381168114610a5557600080fd5b6020820152610a666040840161094e565b6040820152606083015182811115610a7d57600080fd5b610a8987828601610962565b606083015250608083015182811115610aa157600080fd5b610aad87828601610962565b60808301525095945050505050565b634e487b7160e01b600052602160045260246000fd5b6001600160401b0384168152826020820152606060408201526000610afa60608301846104ce565b9594505050505056fea26469706673582212205b5117b00ce65fae13c73e5fe55ef1d7583f0a364b1ac0a38e3f21e0d2c88f9a64736f6c63430008140033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 2081, + "contract": "contracts/CCNotificationClient.sol:CCNotificationClient", + "label": "subscriptionId", + "offset": 0, + "slot": "0", + "type": "t_uint64" + }, + { + "astId": 2084, + "contract": "contracts/CCNotificationClient.sol:CCNotificationClient", + "label": "encryptedSecretsReference", + "offset": 0, + "slot": "1", + "type": "t_bytes_storage" + } + ], + "types": { + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_uint64": { + "encoding": "inplace", + "label": "uint64", + "numberOfBytes": "8" + } + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/baseSepolia/solcInputs/55f420078970def91f71afecffd6ca9e.json b/packages/hardhat/deployments/baseSepolia/solcInputs/55f420078970def91f71afecffd6ca9e.json new file mode 100644 index 0000000..48227cb --- /dev/null +++ b/packages/hardhat/deployments/baseSepolia/solcInputs/55f420078970def91f71afecffd6ca9e.json @@ -0,0 +1,63 @@ +{ + "language": "Solidity", + "sources": { + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Chainlink Functions client interface.\ninterface IFunctionsClient {\n /// @notice Chainlink Functions response handler called by the Functions Router\n /// during fullilment from the designated transmitter node in an OCR round.\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\n /// @param response Aggregated response from the request's source code.\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\n /// @dev Either response or error parameter will be set, but never both.\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {FunctionsResponse} from \"../libraries/FunctionsResponse.sol\";\n\n/// @title Chainlink Functions Router interface.\ninterface IFunctionsRouter {\n /// @notice The identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n /// @return id - bytes32 id that can be passed to the \"getContractById\" of the Router\n function getAllowListId() external view returns (bytes32);\n\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n function setAllowListId(bytes32 allowListId) external;\n\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\n /// @return adminFee\n function getAdminFee() external view returns (uint72 adminFee);\n\n /// @notice Sends a request using the provided subscriptionId\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequest(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Sends a request to the proposed contracts\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequestToProposed(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Fulfill the request by:\n /// - calling back the data that the Oracle returned to the client contract\n /// - pay the DON for processing the request\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\n /// @param response response data from DON consensus\n /// @param err error from DON consensus\n /// @param juelsPerGas - current rate of juels/gas\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\n /// @param transmitter - The Node that transmitted the OCR report\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\n /// @return fulfillResult -\n /// @return callbackGasCostJuels -\n function fulfill(\n bytes memory response,\n bytes memory err,\n uint96 juelsPerGas,\n uint96 costWithoutFulfillment,\n address transmitter,\n FunctionsResponse.Commitment memory commitment\n ) external returns (FunctionsResponse.FulfillResult, uint96);\n\n /// @notice Validate requested gas limit is below the subscription max.\n /// @param subscriptionId subscription ID\n /// @param callbackGasLimit desired callback gas limit\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\n\n /// @notice Get the current contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current contract address\n function getContractById(bytes32 id) external view returns (address);\n\n /// @notice Get the proposed next contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current or proposed contract address\n function getProposedContractById(bytes32 id) external view returns (address);\n\n /// @notice Return the latest proprosal set\n /// @return ids The identifiers of the contracts to update\n /// @return to The addresses of the contracts that will be updated to\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\n\n /// @notice Proposes one or more updates to the contract routes\n /// @dev Only callable by owner\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\n\n /// @notice Updates the current contract routes to the proposed contracts\n /// @dev Only callable by owner\n function updateContracts() external;\n\n /// @dev Puts the system into an emergency stopped state.\n /// @dev Only callable by owner\n function pause() external;\n\n /// @dev Takes the system out of an emergency stopped state.\n /// @dev Only callable by owner\n function unpause() external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {CBOR} from \"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\";\n\n/// @title Library for encoding the input data of a Functions request into CBOR\nlibrary FunctionsRequest {\n using CBOR for CBOR.CBORBuffer;\n\n uint16 public constant REQUEST_DATA_VERSION = 1;\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\n\n enum Location {\n Inline, // Provided within the Request\n Remote, // Hosted through remote location that can be accessed through a provided URL\n DONHosted // Hosted on the DON's storage\n }\n\n enum CodeLanguage {\n JavaScript\n // In future version we may add other languages\n }\n\n struct Request {\n Location codeLocation; // ════════════╸ The location of the source code that will be executed on each node in the DON\n Location secretsLocation; // ═════════╸ The location of secrets that will be passed into the source code. *Only Remote secrets are supported\n CodeLanguage language; // ════════════╸ The coding language that the source code is written in\n string source; // ════════════════════╸ Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\n bytes encryptedSecretsReference; // ══╸ Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\n string[] args; // ════════════════════╸ String arguments that will be passed into the source code\n bytes[] bytesArgs; // ════════════════╸ Bytes arguments that will be passed into the source code\n }\n\n error EmptySource();\n error EmptySecrets();\n error EmptyArgs();\n error NoInlineSecrets();\n\n /// @notice Encodes a Request to CBOR encoded bytes\n /// @param self The request to encode\n /// @return CBOR encoded bytes\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"codeLocation\");\n buffer.writeUInt256(uint256(self.codeLocation));\n\n buffer.writeString(\"language\");\n buffer.writeUInt256(uint256(self.language));\n\n buffer.writeString(\"source\");\n buffer.writeString(self.source);\n\n if (self.args.length > 0) {\n buffer.writeString(\"args\");\n buffer.startArray();\n for (uint256 i = 0; i < self.args.length; ++i) {\n buffer.writeString(self.args[i]);\n }\n buffer.endSequence();\n }\n\n if (self.encryptedSecretsReference.length > 0) {\n if (self.secretsLocation == Location.Inline) {\n revert NoInlineSecrets();\n }\n buffer.writeString(\"secretsLocation\");\n buffer.writeUInt256(uint256(self.secretsLocation));\n buffer.writeString(\"secrets\");\n buffer.writeBytes(self.encryptedSecretsReference);\n }\n\n if (self.bytesArgs.length > 0) {\n buffer.writeString(\"bytesArgs\");\n buffer.startArray();\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\n buffer.writeBytes(self.bytesArgs[i]);\n }\n buffer.endSequence();\n }\n\n return buffer.buf.buf;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Sets the codeLocation and code on the request\n /// @param self The uninitialized request\n /// @param codeLocation The user provided source code location\n /// @param language The programming language of the user code\n /// @param source The user provided source code or a url\n function initializeRequest(\n Request memory self,\n Location codeLocation,\n CodeLanguage language,\n string memory source\n ) internal pure {\n if (bytes(source).length == 0) revert EmptySource();\n\n self.codeLocation = codeLocation;\n self.language = language;\n self.source = source;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Simplified version of initializeRequest for PoC\n /// @param self The uninitialized request\n /// @param javaScriptSource The user provided JS code (must not be empty)\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\n }\n\n /// @notice Adds Remote user encrypted secrets to a Request\n /// @param self The initialized request\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\n\n self.secretsLocation = Location.Remote;\n self.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n /// @notice Adds DON-hosted secrets reference to a Request\n /// @param self The initialized request\n /// @param slotID Slot ID of the user's secrets hosted on DON\n /// @param version User data version (for the slotID)\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"slotID\");\n buffer.writeUInt64(slotID);\n buffer.writeString(\"version\");\n buffer.writeUInt64(version);\n\n self.secretsLocation = Location.DONHosted;\n self.encryptedSecretsReference = buffer.buf.buf;\n }\n\n /// @notice Sets args for the user run function\n /// @param self The initialized request\n /// @param args The array of string args (must not be empty)\n function setArgs(Request memory self, string[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.args = args;\n }\n\n /// @notice Sets bytes args for the user run function\n /// @param self The initialized request\n /// @param args The array of bytes args (must not be empty)\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.bytesArgs = args;\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Library of types that are used for fulfillment of a Functions request\nlibrary FunctionsResponse {\n // Used to send request information from the Router to the Coordinator\n struct RequestMeta {\n bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\n bytes32 flags; // ═══════════════╸ Per-subscription flags\n address requestingContract; // ══╗ The client contract that is sending the request\n uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\n uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint64 initiatedRequests; // β•‘ The number of requests that have been started\n uint32 callbackGasLimit; // β•‘ The amount of gas that the callback to the consuming contract will be given\n uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data\n uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out\n address subscriptionOwner; // ═══╝ The owner of the billing subscription\n }\n\n enum FulfillResult {\n FULFILLED, // 0\n USER_CALLBACK_ERROR, // 1\n INVALID_REQUEST_ID, // 2\n COST_EXCEEDS_COMMITMENT, // 3\n INSUFFICIENT_GAS_PROVIDED, // 4\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\n INVALID_COMMITMENT // 6\n }\n\n struct Commitment {\n bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request\n address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request\n uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\n address client; // ════════════════════╗ The client contract that sent the request\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given\n uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint72 donFee; // β•‘ Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\n uint40 gasOverheadBeforeCallback; // β•‘ Represents the average gas execution cost before the fulfillment callback.\n uint40 gasOverheadAfterCallback; // β•‘ Represents the average gas execution cost after the fulfillment callback.\n uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"../v1_0_0/interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"../v1_0_0/interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"../v1_0_0/libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_functionsRouter;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_functionsRouter = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_functionsRouter.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_functionsRouter)) {\n revert OnlyRouterCanFulfill();\n }\n _fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}" + }, + "@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../@ensdomains/buffer/v0.1.0/Buffer.sol\";\n\n/**\n* @dev A library for populating CBOR encoded payload in Solidity.\n*\n* https://datatracker.ietf.org/doc/html/rfc7049\n*\n* The library offers various write* and start* methods to encode values of different types.\n* The resulted buffer can be obtained with data() method.\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\n* in an invalid CBOR if start/write/end flow is violated.\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\n* except for nested start/end pairs.\n*/\n\nlibrary CBOR {\n using Buffer for Buffer.buffer;\n\n struct CBORBuffer {\n Buffer.buffer buf;\n uint256 depth;\n }\n\n uint8 private constant MAJOR_TYPE_INT = 0;\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\n uint8 private constant MAJOR_TYPE_BYTES = 2;\n uint8 private constant MAJOR_TYPE_STRING = 3;\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\n uint8 private constant MAJOR_TYPE_MAP = 5;\n uint8 private constant MAJOR_TYPE_TAG = 6;\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\n\n uint8 private constant TAG_TYPE_BIGNUM = 2;\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\n\n uint8 private constant CBOR_FALSE = 20;\n uint8 private constant CBOR_TRUE = 21;\n uint8 private constant CBOR_NULL = 22;\n uint8 private constant CBOR_UNDEFINED = 23;\n\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\n Buffer.init(cbor.buf, capacity);\n cbor.depth = 0;\n return cbor;\n }\n\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\n require(buf.depth == 0, \"Invalid CBOR\");\n return buf.buf.buf;\n }\n\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\n writeBytes(buf, abi.encode(value));\n }\n\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\n if (value < 0) {\n buf.buf.appendUint8(\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\n );\n writeBytes(buf, abi.encode(uint256(-1 - value)));\n } else {\n writeUInt256(buf, uint256(value));\n }\n }\n\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\n }\n\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\n if(value >= 0) {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\n } else{\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\n }\n }\n\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\n buf.buf.append(value);\n }\n\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\n buf.buf.append(bytes(value));\n }\n\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\n }\n\n function writeNull(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_NULL);\n }\n\n function writeUndefined(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_UNDEFINED);\n }\n\n function startArray(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\n buf.depth += 1;\n }\n\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\n }\n\n function startMap(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\n buf.depth += 1;\n }\n\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\n }\n\n function endSequence(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\n buf.depth -= 1;\n }\n\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\n writeString(buf, key);\n writeString(buf, value);\n }\n\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\n writeString(buf, key);\n writeBytes(buf, value);\n }\n\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\n writeString(buf, key);\n writeUInt256(buf, value);\n }\n\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\n writeString(buf, key);\n writeInt256(buf, value);\n }\n\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\n writeString(buf, key);\n writeUInt64(buf, value);\n }\n\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\n writeString(buf, key);\n writeInt64(buf, value);\n }\n\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\n writeString(buf, key);\n writeBool(buf, value);\n }\n\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeNull(buf);\n }\n\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeUndefined(buf);\n }\n\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startMap(buf);\n }\n\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startArray(buf);\n }\n\n function writeFixedNumeric(\n CBORBuffer memory buf,\n uint8 major,\n uint64 value\n ) private pure {\n if (value <= 23) {\n buf.buf.appendUint8(uint8((major << 5) | value));\n } else if (value <= 0xFF) {\n buf.buf.appendUint8(uint8((major << 5) | 24));\n buf.buf.appendInt(value, 1);\n } else if (value <= 0xFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 25));\n buf.buf.appendInt(value, 2);\n } else if (value <= 0xFFFFFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 26));\n buf.buf.appendInt(value, 4);\n } else {\n buf.buf.appendUint8(uint8((major << 5) | 27));\n buf.buf.appendInt(value, 8);\n }\n }\n\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\n private\n pure\n {\n buf.buf.appendUint8(uint8((major << 5) | 31));\n }\n\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\n private\n pure\n {\n writeFixedNumeric(buf, major, length);\n }\n\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\n }\n}" + }, + "contracts/CCExampleClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from \"./interfaces/ICCGatewayClient.sol\";\nimport {ICCGateway} from \"./interfaces/ICCGateway.sol\";\n\ncontract CCExampleClient is ICCGatewayClient {\n ICCGateway private immutable gateway;\n\n uint64 private subscriptionId = 0;\n bytes private encryptedSecretsReference = \"\";\n\n event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response);\n event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error);\n\n constructor(address gatewayAddress) {\n gateway = ICCGateway(gatewayAddress);\n }\n\n function updateSubscriptionId(uint64 _subscriptionId) external {\n subscriptionId = _subscriptionId;\n }\n\n function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external {\n encryptedSecretsReference = _encryptedSecretsReference;\n }\n\n function request(string[] calldata args, bytes[] calldata bytesArgs) external {\n require(subscriptionId != 0, \"Subscription ID not set\");\n\n gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference);\n }\n\n function callback(bytes32 requestId) external override {\n ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true);\n\n if (response.state == ICCGatewayClient.CCGResponseState.Success) {\n emit ResponseReceived(response.subscriptionId, requestId, string(response.data));\n } else {\n emit ErrorReceived(response.subscriptionId, requestId, string(response.error));\n }\n }\n}\n" + }, + "contracts/interfaces/ICCGateway.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\";\n\ninterface ICCGateway {\n struct CCGRequest {\n string name;\n uint32 callbackGasLimit;\n FunctionsRequest.Request config;\n }\n\n /**\n * @dev Can't register a request with an empty name\n */\n error CCGRequestNameEmpty();\n\n /**\n * @dev Only the same source of the requestId is allowed to call the function\n */\n error CCGOnlySameSourceAllowed(bytes32 requestId);\n\n /**\n * @dev Only a registered subscriptionId is allowed to call the function\n */\n error CCGRequestNotRegistered(uint64 subscriptionId);\n\n /**\n * @dev Can't fulfill a request that has already been fulfilled\n */\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\n\n /**\n * @dev Only A manager can call the function\n */\n error CCGOnlyManagerAllowed();\n\n /**\n * @dev Send a request to the Functions DON\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external returns (bytes32 requestId);\n\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\n}\n" + }, + "contracts/interfaces/ICCGatewayClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\ninterface ICCGatewayClient {\n enum CCGResponseState {Sent, Success, Error}\n\n struct CCGResponse {\n uint64 subscriptionId;\n address source;\n CCGResponseState state;\n bytes data;\n bytes error;\n }\n\n function callback(bytes32 requestId) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/baseSepolia/solcInputs/757a0cc1c674e4e4007b25c045668167.json b/packages/hardhat/deployments/baseSepolia/solcInputs/757a0cc1c674e4e4007b25c045668167.json new file mode 100644 index 0000000..49e3804 --- /dev/null +++ b/packages/hardhat/deployments/baseSepolia/solcInputs/757a0cc1c674e4e4007b25c045668167.json @@ -0,0 +1,81 @@ +{ + "language": "Solidity", + "sources": { + "@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"./interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"./interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"./libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_router;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_router = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_router.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_router)) {\n revert OnlyRouterCanFulfill();\n }\n fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Chainlink Functions client interface.\ninterface IFunctionsClient {\n /// @notice Chainlink Functions response handler called by the Functions Router\n /// during fullilment from the designated transmitter node in an OCR round.\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\n /// @param response Aggregated response from the request's source code.\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\n /// @dev Either response or error parameter will be set, but never both.\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {FunctionsResponse} from \"../libraries/FunctionsResponse.sol\";\n\n/// @title Chainlink Functions Router interface.\ninterface IFunctionsRouter {\n /// @notice The identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n /// @return id - bytes32 id that can be passed to the \"getContractById\" of the Router\n function getAllowListId() external view returns (bytes32);\n\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n function setAllowListId(bytes32 allowListId) external;\n\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\n /// @return adminFee\n function getAdminFee() external view returns (uint72 adminFee);\n\n /// @notice Sends a request using the provided subscriptionId\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequest(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Sends a request to the proposed contracts\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequestToProposed(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Fulfill the request by:\n /// - calling back the data that the Oracle returned to the client contract\n /// - pay the DON for processing the request\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\n /// @param response response data from DON consensus\n /// @param err error from DON consensus\n /// @param juelsPerGas - current rate of juels/gas\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\n /// @param transmitter - The Node that transmitted the OCR report\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\n /// @return fulfillResult -\n /// @return callbackGasCostJuels -\n function fulfill(\n bytes memory response,\n bytes memory err,\n uint96 juelsPerGas,\n uint96 costWithoutFulfillment,\n address transmitter,\n FunctionsResponse.Commitment memory commitment\n ) external returns (FunctionsResponse.FulfillResult, uint96);\n\n /// @notice Validate requested gas limit is below the subscription max.\n /// @param subscriptionId subscription ID\n /// @param callbackGasLimit desired callback gas limit\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\n\n /// @notice Get the current contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current contract address\n function getContractById(bytes32 id) external view returns (address);\n\n /// @notice Get the proposed next contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current or proposed contract address\n function getProposedContractById(bytes32 id) external view returns (address);\n\n /// @notice Return the latest proprosal set\n /// @return ids The identifiers of the contracts to update\n /// @return to The addresses of the contracts that will be updated to\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\n\n /// @notice Proposes one or more updates to the contract routes\n /// @dev Only callable by owner\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\n\n /// @notice Updates the current contract routes to the proposed contracts\n /// @dev Only callable by owner\n function updateContracts() external;\n\n /// @dev Puts the system into an emergency stopped state.\n /// @dev Only callable by owner\n function pause() external;\n\n /// @dev Takes the system out of an emergency stopped state.\n /// @dev Only callable by owner\n function unpause() external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {CBOR} from \"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\";\n\n/// @title Library for encoding the input data of a Functions request into CBOR\nlibrary FunctionsRequest {\n using CBOR for CBOR.CBORBuffer;\n\n uint16 public constant REQUEST_DATA_VERSION = 1;\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\n\n enum Location {\n Inline, // Provided within the Request\n Remote, // Hosted through remote location that can be accessed through a provided URL\n DONHosted // Hosted on the DON's storage\n }\n\n enum CodeLanguage {\n JavaScript\n // In future version we may add other languages\n }\n\n struct Request {\n Location codeLocation; // ════════════╸ The location of the source code that will be executed on each node in the DON\n Location secretsLocation; // ═════════╸ The location of secrets that will be passed into the source code. *Only Remote secrets are supported\n CodeLanguage language; // ════════════╸ The coding language that the source code is written in\n string source; // ════════════════════╸ Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\n bytes encryptedSecretsReference; // ══╸ Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\n string[] args; // ════════════════════╸ String arguments that will be passed into the source code\n bytes[] bytesArgs; // ════════════════╸ Bytes arguments that will be passed into the source code\n }\n\n error EmptySource();\n error EmptySecrets();\n error EmptyArgs();\n error NoInlineSecrets();\n\n /// @notice Encodes a Request to CBOR encoded bytes\n /// @param self The request to encode\n /// @return CBOR encoded bytes\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"codeLocation\");\n buffer.writeUInt256(uint256(self.codeLocation));\n\n buffer.writeString(\"language\");\n buffer.writeUInt256(uint256(self.language));\n\n buffer.writeString(\"source\");\n buffer.writeString(self.source);\n\n if (self.args.length > 0) {\n buffer.writeString(\"args\");\n buffer.startArray();\n for (uint256 i = 0; i < self.args.length; ++i) {\n buffer.writeString(self.args[i]);\n }\n buffer.endSequence();\n }\n\n if (self.encryptedSecretsReference.length > 0) {\n if (self.secretsLocation == Location.Inline) {\n revert NoInlineSecrets();\n }\n buffer.writeString(\"secretsLocation\");\n buffer.writeUInt256(uint256(self.secretsLocation));\n buffer.writeString(\"secrets\");\n buffer.writeBytes(self.encryptedSecretsReference);\n }\n\n if (self.bytesArgs.length > 0) {\n buffer.writeString(\"bytesArgs\");\n buffer.startArray();\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\n buffer.writeBytes(self.bytesArgs[i]);\n }\n buffer.endSequence();\n }\n\n return buffer.buf.buf;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Sets the codeLocation and code on the request\n /// @param self The uninitialized request\n /// @param codeLocation The user provided source code location\n /// @param language The programming language of the user code\n /// @param source The user provided source code or a url\n function initializeRequest(\n Request memory self,\n Location codeLocation,\n CodeLanguage language,\n string memory source\n ) internal pure {\n if (bytes(source).length == 0) revert EmptySource();\n\n self.codeLocation = codeLocation;\n self.language = language;\n self.source = source;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Simplified version of initializeRequest for PoC\n /// @param self The uninitialized request\n /// @param javaScriptSource The user provided JS code (must not be empty)\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\n }\n\n /// @notice Adds Remote user encrypted secrets to a Request\n /// @param self The initialized request\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\n\n self.secretsLocation = Location.Remote;\n self.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n /// @notice Adds DON-hosted secrets reference to a Request\n /// @param self The initialized request\n /// @param slotID Slot ID of the user's secrets hosted on DON\n /// @param version User data version (for the slotID)\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"slotID\");\n buffer.writeUInt64(slotID);\n buffer.writeString(\"version\");\n buffer.writeUInt64(version);\n\n self.secretsLocation = Location.DONHosted;\n self.encryptedSecretsReference = buffer.buf.buf;\n }\n\n /// @notice Sets args for the user run function\n /// @param self The initialized request\n /// @param args The array of string args (must not be empty)\n function setArgs(Request memory self, string[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.args = args;\n }\n\n /// @notice Sets bytes args for the user run function\n /// @param self The initialized request\n /// @param args The array of bytes args (must not be empty)\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.bytesArgs = args;\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Library of types that are used for fulfillment of a Functions request\nlibrary FunctionsResponse {\n // Used to send request information from the Router to the Coordinator\n struct RequestMeta {\n bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\n bytes32 flags; // ═══════════════╸ Per-subscription flags\n address requestingContract; // ══╗ The client contract that is sending the request\n uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\n uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint64 initiatedRequests; // β•‘ The number of requests that have been started\n uint32 callbackGasLimit; // β•‘ The amount of gas that the callback to the consuming contract will be given\n uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data\n uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out\n address subscriptionOwner; // ═══╝ The owner of the billing subscription\n }\n\n enum FulfillResult {\n FULFILLED, // 0\n USER_CALLBACK_ERROR, // 1\n INVALID_REQUEST_ID, // 2\n COST_EXCEEDS_COMMITMENT, // 3\n INSUFFICIENT_GAS_PROVIDED, // 4\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\n INVALID_COMMITMENT // 6\n }\n\n struct Commitment {\n bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request\n address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request\n uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\n address client; // ════════════════════╗ The client contract that sent the request\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given\n uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint72 donFee; // β•‘ Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\n uint40 gasOverheadBeforeCallback; // β•‘ Represents the average gas execution cost before the fulfillment callback.\n uint40 gasOverheadAfterCallback; // β•‘ Represents the average gas execution cost after the fulfillment callback.\n uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"../v1_0_0/interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"../v1_0_0/interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"../v1_0_0/libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_functionsRouter;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_functionsRouter = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_functionsRouter.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_functionsRouter)) {\n revert OnlyRouterCanFulfill();\n }\n _fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}" + }, + "@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../@ensdomains/buffer/v0.1.0/Buffer.sol\";\n\n/**\n* @dev A library for populating CBOR encoded payload in Solidity.\n*\n* https://datatracker.ietf.org/doc/html/rfc7049\n*\n* The library offers various write* and start* methods to encode values of different types.\n* The resulted buffer can be obtained with data() method.\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\n* in an invalid CBOR if start/write/end flow is violated.\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\n* except for nested start/end pairs.\n*/\n\nlibrary CBOR {\n using Buffer for Buffer.buffer;\n\n struct CBORBuffer {\n Buffer.buffer buf;\n uint256 depth;\n }\n\n uint8 private constant MAJOR_TYPE_INT = 0;\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\n uint8 private constant MAJOR_TYPE_BYTES = 2;\n uint8 private constant MAJOR_TYPE_STRING = 3;\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\n uint8 private constant MAJOR_TYPE_MAP = 5;\n uint8 private constant MAJOR_TYPE_TAG = 6;\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\n\n uint8 private constant TAG_TYPE_BIGNUM = 2;\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\n\n uint8 private constant CBOR_FALSE = 20;\n uint8 private constant CBOR_TRUE = 21;\n uint8 private constant CBOR_NULL = 22;\n uint8 private constant CBOR_UNDEFINED = 23;\n\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\n Buffer.init(cbor.buf, capacity);\n cbor.depth = 0;\n return cbor;\n }\n\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\n require(buf.depth == 0, \"Invalid CBOR\");\n return buf.buf.buf;\n }\n\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\n writeBytes(buf, abi.encode(value));\n }\n\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\n if (value < 0) {\n buf.buf.appendUint8(\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\n );\n writeBytes(buf, abi.encode(uint256(-1 - value)));\n } else {\n writeUInt256(buf, uint256(value));\n }\n }\n\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\n }\n\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\n if(value >= 0) {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\n } else{\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\n }\n }\n\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\n buf.buf.append(value);\n }\n\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\n buf.buf.append(bytes(value));\n }\n\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\n }\n\n function writeNull(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_NULL);\n }\n\n function writeUndefined(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_UNDEFINED);\n }\n\n function startArray(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\n buf.depth += 1;\n }\n\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\n }\n\n function startMap(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\n buf.depth += 1;\n }\n\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\n }\n\n function endSequence(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\n buf.depth -= 1;\n }\n\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\n writeString(buf, key);\n writeString(buf, value);\n }\n\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\n writeString(buf, key);\n writeBytes(buf, value);\n }\n\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\n writeString(buf, key);\n writeUInt256(buf, value);\n }\n\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\n writeString(buf, key);\n writeInt256(buf, value);\n }\n\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\n writeString(buf, key);\n writeUInt64(buf, value);\n }\n\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\n writeString(buf, key);\n writeInt64(buf, value);\n }\n\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\n writeString(buf, key);\n writeBool(buf, value);\n }\n\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeNull(buf);\n }\n\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeUndefined(buf);\n }\n\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startMap(buf);\n }\n\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startArray(buf);\n }\n\n function writeFixedNumeric(\n CBORBuffer memory buf,\n uint8 major,\n uint64 value\n ) private pure {\n if (value <= 23) {\n buf.buf.appendUint8(uint8((major << 5) | value));\n } else if (value <= 0xFF) {\n buf.buf.appendUint8(uint8((major << 5) | 24));\n buf.buf.appendInt(value, 1);\n } else if (value <= 0xFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 25));\n buf.buf.appendInt(value, 2);\n } else if (value <= 0xFFFFFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 26));\n buf.buf.appendInt(value, 4);\n } else {\n buf.buf.appendUint8(uint8((major << 5) | 27));\n buf.buf.appendInt(value, 8);\n }\n }\n\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\n private\n pure\n {\n buf.buf.appendUint8(uint8((major << 5) | 31));\n }\n\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\n private\n pure\n {\n writeFixedNumeric(buf, major, length);\n }\n\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\n }\n}" + }, + "@openzeppelin/contracts/access/AccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.20;\n\nimport {IAccessControl} from \"./IAccessControl.sol\";\nimport {Context} from \"../utils/Context.sol\";\nimport {ERC165} from \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account => bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n" + }, + "@openzeppelin/contracts/access/IAccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "contracts/CCGateway.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport './interfaces/ICCGateway.sol';\nimport {ICCGatewayClient} from './interfaces/ICCGatewayClient.sol';\n\nimport {FunctionsClient} from \"@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol\";\nimport {AccessControl} from \"@openzeppelin/contracts/access/AccessControl.sol\";\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\";\n\ncontract CCGateway is ICCGateway, FunctionsClient, AccessControl {\n using FunctionsRequest for FunctionsRequest.Request;\n\n bytes32 public constant MANAGER_ROLE = keccak256(\"MANAGER_ROLE\");\n bytes32 public constant CLIENT_ROLE = keccak256(\"CLIENT_ROLE\");\n bytes32 private _donId; // DON ID for the Functions DON to which the requests are sent\n\n mapping(uint64 subscriptionId => CCGRequest) private _requests; // Each subscription can only handle one kind of request\n mapping(bytes32 requestId => ICCGatewayClient.CCGResponse) private unprocessed_responses; // Responses that have not been processed yet\n\n // array of registered subscriptions\n uint64[] public subscriptions;\n\n constructor(address router, bytes32 initialDonId, address initialOwner) FunctionsClient(router) {\n _donId = initialDonId;\n\n address to = address(0) == initialOwner ? _msgSender() : initialOwner;\n _grantRole(DEFAULT_ADMIN_ROLE, to);\n _grantRole(MANAGER_ROLE, to);\n }\n\n /**\n * @dev Set the DON ID\n * @param newDonId New DON ID\n */\n function setDonId(bytes32 newDonId) external onlyRole(getRoleAdmin(MANAGER_ROLE)) {\n _donId = newDonId;\n }\n\n /**\n * @dev Get the DON ID\n * @return DON ID\n */\n function donId() external view returns (bytes32) {\n return _donId;\n }\n\n function registerRequest(\n uint64 subscriptionId,\n FunctionsRequest.Location codeLocation,\n string calldata source,\n FunctionsRequest.Location secretsLocation,\n bytes calldata encryptedSecretsReference,\n uint32 callbackGasLimit,\n string calldata name\n ) external onlyManager {\n if (bytes(name).length == 0) {revert CCGRequestNameEmpty();}\n\n CCGRequest storage req = _requests[subscriptionId];\n req.name = name;\n req.callbackGasLimit = callbackGasLimit;\n\n // Only JavaScript is supported for now\n req.config.language = FunctionsRequest.CodeLanguage.JavaScript;\n req.config.codeLocation = codeLocation;\n req.config.source = source;\n req.config.secretsLocation = secretsLocation;\n req.config.encryptedSecretsReference = encryptedSecretsReference;\n\n subscriptions.push(subscriptionId);\n }\n\n function removeRequest(uint64 subscriptionId) external onlyManager {\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n delete _requests[subscriptionId];\n\n // Find the index of the subscriptionId in the subscriptions array\n uint256 index = subscriptions.length;\n for (uint256 i = 0; i < subscriptions.length; i++) {\n if (index == subscriptions.length && subscriptions[i] == subscriptionId) index = i;\n if (index != subscriptions.length && i + 1 < subscriptions.length) subscriptions[i] = subscriptions[i + 1];\n }\n\n subscriptions.pop();\n }\n\n function getRequest(uint64 subscriptionId) external view onlyManager returns (CCGRequest memory) {\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n return _requests[subscriptionId];\n }\n// ---------------------------------------------------------------------------------------------------------------------\n modifier onlySource(bytes32 requestId) {\n if (unprocessed_responses[requestId].source != _msgSender()) {revert CCGOnlySameSourceAllowed(requestId);}\n _;\n }\n\n modifier onlyManager() {\n if (!hasRole(MANAGER_ROLE, tx.origin)) {revert CCGOnlyManagerAllowed();}\n _;\n }\n// ---------------------------------------------------------------------------------------------------------------------\n /**\n * @notice Triggers an on-demand Functions request using remote encrypted secrets\n * @param subscriptionId Subscription ID used to pay for request (FunctionsConsumer contract address must first be added to the subscription)\n * @param args String arguments passed into the source code and accessible via the global variable `args`\n * @param bytesArgs Bytes arguments passed into the source code and accessible via the global variable `bytesArgs` as hex strings\n * @param encryptedSecretsReference Reference pointing to encrypted secrets\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external onlyRole(CLIENT_ROLE) returns (bytes32 requestId) {\n CCGRequest storage request = _requests[subscriptionId];\n if (bytes(request.name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n\n FunctionsRequest.Request memory req = request.config;\n req.initializeRequest(req.codeLocation, FunctionsRequest.CodeLanguage.JavaScript, req.source);\n if (encryptedSecretsReference.length > 0) {req.encryptedSecretsReference = encryptedSecretsReference;}\n\n if (args.length > 0) {\n req.setArgs(args);\n }\n if (bytesArgs.length > 0) {\n req.setBytesArgs(bytesArgs);\n }\n\n requestId = _sendRequest(req.encodeCBOR(), subscriptionId, request.callbackGasLimit, _donId);\n unprocessed_responses[requestId].state = ICCGatewayClient.CCGResponseState.Sent;\n unprocessed_responses[requestId].source = _msgSender();\n }\n\n /**\n * @notice Store latest result/error\n * @param requestId The request ID, returned by sendRequest()\n * @param response Aggregated response from the user code\n * @param err Aggregated error from the user code or from the execution pipeline\n * Either response or error parameter will be set, but never both\n */\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal override {\n ICCGatewayClient.CCGResponse storage resp = unprocessed_responses[requestId];\n if (resp.state != ICCGatewayClient.CCGResponseState.Sent) {revert CCGRequestAlreadyFulfilled(requestId);}\n\n unprocessed_responses[requestId].state = err.length > 0 ? ICCGatewayClient.CCGResponseState.Error : ICCGatewayClient.CCGResponseState.Success;\n unprocessed_responses[requestId].data = response;\n unprocessed_responses[requestId].error = err;\n\n ICCGatewayClient(resp.source).callback(requestId);\n }\n\n /**\n * @dev Get the response data\n * @param requestId The request ID, returned by sendRequest()\n * @return response CCGResponse\n */\n function getResponse(bytes32 requestId, bool remove) external onlySource(requestId) returns (ICCGatewayClient.CCGResponse memory response) {\n response = unprocessed_responses[requestId];\n if (remove) {delete unprocessed_responses[requestId];}\n }\n}" + }, + "contracts/interfaces/ICCGateway.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\";\n\ninterface ICCGateway {\n struct CCGRequest {\n string name;\n uint32 callbackGasLimit;\n FunctionsRequest.Request config;\n }\n\n /**\n * @dev Can't register a request with an empty name\n */\n error CCGRequestNameEmpty();\n\n /**\n * @dev Only the same source of the requestId is allowed to call the function\n */\n error CCGOnlySameSourceAllowed(bytes32 requestId);\n\n /**\n * @dev Only a registered subscriptionId is allowed to call the function\n */\n error CCGRequestNotRegistered(uint64 subscriptionId);\n\n /**\n * @dev Can't fulfill a request that has already been fulfilled\n */\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\n\n /**\n * @dev Only A manager can call the function\n */\n error CCGOnlyManagerAllowed();\n\n /**\n * @dev Send a request to the Functions DON\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external returns (bytes32 requestId);\n\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\n}\n" + }, + "contracts/interfaces/ICCGatewayClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\ninterface ICCGatewayClient {\n enum CCGResponseState {Sent, Success, Error}\n\n struct CCGResponse {\n uint64 subscriptionId;\n address source;\n CCGResponseState state;\n bytes data;\n bytes error;\n }\n\n function callback(bytes32 requestId) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/baseSepolia/solcInputs/be18bfdeea6869d68a166c8869814257.json b/packages/hardhat/deployments/baseSepolia/solcInputs/be18bfdeea6869d68a166c8869814257.json new file mode 100644 index 0000000..b29947d --- /dev/null +++ b/packages/hardhat/deployments/baseSepolia/solcInputs/be18bfdeea6869d68a166c8869814257.json @@ -0,0 +1,81 @@ +{ + "language": "Solidity", + "sources": { + "@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"./interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"./interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"./libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_router;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_router = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_router.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_router)) {\n revert OnlyRouterCanFulfill();\n }\n fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Chainlink Functions client interface.\ninterface IFunctionsClient {\n /// @notice Chainlink Functions response handler called by the Functions Router\n /// during fullilment from the designated transmitter node in an OCR round.\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\n /// @param response Aggregated response from the request's source code.\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\n /// @dev Either response or error parameter will be set, but never both.\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {FunctionsResponse} from \"../libraries/FunctionsResponse.sol\";\n\n/// @title Chainlink Functions Router interface.\ninterface IFunctionsRouter {\n /// @notice The identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n /// @return id - bytes32 id that can be passed to the \"getContractById\" of the Router\n function getAllowListId() external view returns (bytes32);\n\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n function setAllowListId(bytes32 allowListId) external;\n\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\n /// @return adminFee\n function getAdminFee() external view returns (uint72 adminFee);\n\n /// @notice Sends a request using the provided subscriptionId\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequest(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Sends a request to the proposed contracts\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequestToProposed(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Fulfill the request by:\n /// - calling back the data that the Oracle returned to the client contract\n /// - pay the DON for processing the request\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\n /// @param response response data from DON consensus\n /// @param err error from DON consensus\n /// @param juelsPerGas - current rate of juels/gas\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\n /// @param transmitter - The Node that transmitted the OCR report\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\n /// @return fulfillResult -\n /// @return callbackGasCostJuels -\n function fulfill(\n bytes memory response,\n bytes memory err,\n uint96 juelsPerGas,\n uint96 costWithoutFulfillment,\n address transmitter,\n FunctionsResponse.Commitment memory commitment\n ) external returns (FunctionsResponse.FulfillResult, uint96);\n\n /// @notice Validate requested gas limit is below the subscription max.\n /// @param subscriptionId subscription ID\n /// @param callbackGasLimit desired callback gas limit\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\n\n /// @notice Get the current contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current contract address\n function getContractById(bytes32 id) external view returns (address);\n\n /// @notice Get the proposed next contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current or proposed contract address\n function getProposedContractById(bytes32 id) external view returns (address);\n\n /// @notice Return the latest proprosal set\n /// @return ids The identifiers of the contracts to update\n /// @return to The addresses of the contracts that will be updated to\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\n\n /// @notice Proposes one or more updates to the contract routes\n /// @dev Only callable by owner\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\n\n /// @notice Updates the current contract routes to the proposed contracts\n /// @dev Only callable by owner\n function updateContracts() external;\n\n /// @dev Puts the system into an emergency stopped state.\n /// @dev Only callable by owner\n function pause() external;\n\n /// @dev Takes the system out of an emergency stopped state.\n /// @dev Only callable by owner\n function unpause() external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {CBOR} from \"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\";\n\n/// @title Library for encoding the input data of a Functions request into CBOR\nlibrary FunctionsRequest {\n using CBOR for CBOR.CBORBuffer;\n\n uint16 public constant REQUEST_DATA_VERSION = 1;\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\n\n enum Location {\n Inline, // Provided within the Request\n Remote, // Hosted through remote location that can be accessed through a provided URL\n DONHosted // Hosted on the DON's storage\n }\n\n enum CodeLanguage {\n JavaScript\n // In future version we may add other languages\n }\n\n struct Request {\n Location codeLocation; // ════════════╸ The location of the source code that will be executed on each node in the DON\n Location secretsLocation; // ═════════╸ The location of secrets that will be passed into the source code. *Only Remote secrets are supported\n CodeLanguage language; // ════════════╸ The coding language that the source code is written in\n string source; // ════════════════════╸ Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\n bytes encryptedSecretsReference; // ══╸ Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\n string[] args; // ════════════════════╸ String arguments that will be passed into the source code\n bytes[] bytesArgs; // ════════════════╸ Bytes arguments that will be passed into the source code\n }\n\n error EmptySource();\n error EmptySecrets();\n error EmptyArgs();\n error NoInlineSecrets();\n\n /// @notice Encodes a Request to CBOR encoded bytes\n /// @param self The request to encode\n /// @return CBOR encoded bytes\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"codeLocation\");\n buffer.writeUInt256(uint256(self.codeLocation));\n\n buffer.writeString(\"language\");\n buffer.writeUInt256(uint256(self.language));\n\n buffer.writeString(\"source\");\n buffer.writeString(self.source);\n\n if (self.args.length > 0) {\n buffer.writeString(\"args\");\n buffer.startArray();\n for (uint256 i = 0; i < self.args.length; ++i) {\n buffer.writeString(self.args[i]);\n }\n buffer.endSequence();\n }\n\n if (self.encryptedSecretsReference.length > 0) {\n if (self.secretsLocation == Location.Inline) {\n revert NoInlineSecrets();\n }\n buffer.writeString(\"secretsLocation\");\n buffer.writeUInt256(uint256(self.secretsLocation));\n buffer.writeString(\"secrets\");\n buffer.writeBytes(self.encryptedSecretsReference);\n }\n\n if (self.bytesArgs.length > 0) {\n buffer.writeString(\"bytesArgs\");\n buffer.startArray();\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\n buffer.writeBytes(self.bytesArgs[i]);\n }\n buffer.endSequence();\n }\n\n return buffer.buf.buf;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Sets the codeLocation and code on the request\n /// @param self The uninitialized request\n /// @param codeLocation The user provided source code location\n /// @param language The programming language of the user code\n /// @param source The user provided source code or a url\n function initializeRequest(\n Request memory self,\n Location codeLocation,\n CodeLanguage language,\n string memory source\n ) internal pure {\n if (bytes(source).length == 0) revert EmptySource();\n\n self.codeLocation = codeLocation;\n self.language = language;\n self.source = source;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Simplified version of initializeRequest for PoC\n /// @param self The uninitialized request\n /// @param javaScriptSource The user provided JS code (must not be empty)\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\n }\n\n /// @notice Adds Remote user encrypted secrets to a Request\n /// @param self The initialized request\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\n\n self.secretsLocation = Location.Remote;\n self.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n /// @notice Adds DON-hosted secrets reference to a Request\n /// @param self The initialized request\n /// @param slotID Slot ID of the user's secrets hosted on DON\n /// @param version User data version (for the slotID)\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"slotID\");\n buffer.writeUInt64(slotID);\n buffer.writeString(\"version\");\n buffer.writeUInt64(version);\n\n self.secretsLocation = Location.DONHosted;\n self.encryptedSecretsReference = buffer.buf.buf;\n }\n\n /// @notice Sets args for the user run function\n /// @param self The initialized request\n /// @param args The array of string args (must not be empty)\n function setArgs(Request memory self, string[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.args = args;\n }\n\n /// @notice Sets bytes args for the user run function\n /// @param self The initialized request\n /// @param args The array of bytes args (must not be empty)\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.bytesArgs = args;\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Library of types that are used for fulfillment of a Functions request\nlibrary FunctionsResponse {\n // Used to send request information from the Router to the Coordinator\n struct RequestMeta {\n bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\n bytes32 flags; // ═══════════════╸ Per-subscription flags\n address requestingContract; // ══╗ The client contract that is sending the request\n uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\n uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint64 initiatedRequests; // β•‘ The number of requests that have been started\n uint32 callbackGasLimit; // β•‘ The amount of gas that the callback to the consuming contract will be given\n uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data\n uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out\n address subscriptionOwner; // ═══╝ The owner of the billing subscription\n }\n\n enum FulfillResult {\n FULFILLED, // 0\n USER_CALLBACK_ERROR, // 1\n INVALID_REQUEST_ID, // 2\n COST_EXCEEDS_COMMITMENT, // 3\n INSUFFICIENT_GAS_PROVIDED, // 4\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\n INVALID_COMMITMENT // 6\n }\n\n struct Commitment {\n bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request\n address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request\n uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\n address client; // ════════════════════╗ The client contract that sent the request\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given\n uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint72 donFee; // β•‘ Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\n uint40 gasOverheadBeforeCallback; // β•‘ Represents the average gas execution cost before the fulfillment callback.\n uint40 gasOverheadAfterCallback; // β•‘ Represents the average gas execution cost after the fulfillment callback.\n uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"../v1_0_0/interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"../v1_0_0/interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"../v1_0_0/libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_functionsRouter;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_functionsRouter = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_functionsRouter.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_functionsRouter)) {\n revert OnlyRouterCanFulfill();\n }\n _fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}" + }, + "@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../@ensdomains/buffer/v0.1.0/Buffer.sol\";\n\n/**\n* @dev A library for populating CBOR encoded payload in Solidity.\n*\n* https://datatracker.ietf.org/doc/html/rfc7049\n*\n* The library offers various write* and start* methods to encode values of different types.\n* The resulted buffer can be obtained with data() method.\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\n* in an invalid CBOR if start/write/end flow is violated.\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\n* except for nested start/end pairs.\n*/\n\nlibrary CBOR {\n using Buffer for Buffer.buffer;\n\n struct CBORBuffer {\n Buffer.buffer buf;\n uint256 depth;\n }\n\n uint8 private constant MAJOR_TYPE_INT = 0;\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\n uint8 private constant MAJOR_TYPE_BYTES = 2;\n uint8 private constant MAJOR_TYPE_STRING = 3;\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\n uint8 private constant MAJOR_TYPE_MAP = 5;\n uint8 private constant MAJOR_TYPE_TAG = 6;\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\n\n uint8 private constant TAG_TYPE_BIGNUM = 2;\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\n\n uint8 private constant CBOR_FALSE = 20;\n uint8 private constant CBOR_TRUE = 21;\n uint8 private constant CBOR_NULL = 22;\n uint8 private constant CBOR_UNDEFINED = 23;\n\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\n Buffer.init(cbor.buf, capacity);\n cbor.depth = 0;\n return cbor;\n }\n\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\n require(buf.depth == 0, \"Invalid CBOR\");\n return buf.buf.buf;\n }\n\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\n writeBytes(buf, abi.encode(value));\n }\n\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\n if (value < 0) {\n buf.buf.appendUint8(\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\n );\n writeBytes(buf, abi.encode(uint256(-1 - value)));\n } else {\n writeUInt256(buf, uint256(value));\n }\n }\n\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\n }\n\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\n if(value >= 0) {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\n } else{\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\n }\n }\n\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\n buf.buf.append(value);\n }\n\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\n buf.buf.append(bytes(value));\n }\n\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\n }\n\n function writeNull(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_NULL);\n }\n\n function writeUndefined(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_UNDEFINED);\n }\n\n function startArray(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\n buf.depth += 1;\n }\n\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\n }\n\n function startMap(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\n buf.depth += 1;\n }\n\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\n }\n\n function endSequence(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\n buf.depth -= 1;\n }\n\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\n writeString(buf, key);\n writeString(buf, value);\n }\n\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\n writeString(buf, key);\n writeBytes(buf, value);\n }\n\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\n writeString(buf, key);\n writeUInt256(buf, value);\n }\n\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\n writeString(buf, key);\n writeInt256(buf, value);\n }\n\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\n writeString(buf, key);\n writeUInt64(buf, value);\n }\n\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\n writeString(buf, key);\n writeInt64(buf, value);\n }\n\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\n writeString(buf, key);\n writeBool(buf, value);\n }\n\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeNull(buf);\n }\n\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeUndefined(buf);\n }\n\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startMap(buf);\n }\n\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startArray(buf);\n }\n\n function writeFixedNumeric(\n CBORBuffer memory buf,\n uint8 major,\n uint64 value\n ) private pure {\n if (value <= 23) {\n buf.buf.appendUint8(uint8((major << 5) | value));\n } else if (value <= 0xFF) {\n buf.buf.appendUint8(uint8((major << 5) | 24));\n buf.buf.appendInt(value, 1);\n } else if (value <= 0xFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 25));\n buf.buf.appendInt(value, 2);\n } else if (value <= 0xFFFFFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 26));\n buf.buf.appendInt(value, 4);\n } else {\n buf.buf.appendUint8(uint8((major << 5) | 27));\n buf.buf.appendInt(value, 8);\n }\n }\n\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\n private\n pure\n {\n buf.buf.appendUint8(uint8((major << 5) | 31));\n }\n\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\n private\n pure\n {\n writeFixedNumeric(buf, major, length);\n }\n\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\n }\n}" + }, + "@openzeppelin/contracts/access/AccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.20;\n\nimport {IAccessControl} from \"./IAccessControl.sol\";\nimport {Context} from \"../utils/Context.sol\";\nimport {ERC165} from \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account => bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n" + }, + "@openzeppelin/contracts/access/IAccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "contracts/CCGateway.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport './interfaces/ICCGateway.sol';\nimport {ICCGatewayClient} from './interfaces/ICCGatewayClient.sol';\n\nimport {FunctionsClient} from \"@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol\";\nimport {AccessControl} from \"@openzeppelin/contracts/access/AccessControl.sol\";\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\";\n\ncontract CCGateway is ICCGateway, FunctionsClient, AccessControl {\n using FunctionsRequest for FunctionsRequest.Request;\n\n bytes32 public constant MANAGER_ROLE = keccak256(\"MANAGER_ROLE\");\n bytes32 public constant CLIENT_ROLE = keccak256(\"CLIENT_ROLE\");\n bytes32 private _donId; // DON ID for the Functions DON to which the requests are sent\n\n mapping(uint64 subscriptionId => CCGRequest) private _requests; // Each subscription can only handle one kind of request\n mapping(bytes32 requestId => ICCGatewayClient.CCGResponse) private unprocessed_responses; // Responses that have not been processed yet\n\n // array of registered subscriptions\n uint64[] public subscriptions;\n\n constructor(address router, bytes32 initialDonId, address initialOwner) FunctionsClient(router) {\n _donId = initialDonId;\n\n address to = address(0) == initialOwner ? _msgSender() : initialOwner;\n _grantRole(DEFAULT_ADMIN_ROLE, to);\n _grantRole(MANAGER_ROLE, to);\n }\n\n /**\n * @dev Set the DON ID\n * @param newDonId New DON ID\n */\n function setDonId(bytes32 newDonId) external onlyRole(getRoleAdmin(MANAGER_ROLE)) {\n _donId = newDonId;\n }\n\n /**\n * @dev Get the DON ID\n * @return DON ID\n */\n function donId() external view returns (bytes32) {\n return _donId;\n }\n\n function registerRequest(\n uint64 subscriptionId,\n FunctionsRequest.Location codeLocation,\n string calldata source,\n FunctionsRequest.Location secretsLocation,\n bytes calldata encryptedSecretsReference,\n uint32 callbackGasLimit,\n string calldata name\n ) external onlyManager {\n if (bytes(name).length == 0) {revert CCGRequestNameEmpty();}\n\n CCGRequest storage req = _requests[subscriptionId];\n if(bytes(req.name).length == 0) {subscriptions.push(subscriptionId);}\n\n req.name = name;\n req.callbackGasLimit = callbackGasLimit;\n\n // Only JavaScript is supported for now\n req.config.language = FunctionsRequest.CodeLanguage.JavaScript;\n req.config.codeLocation = codeLocation;\n req.config.source = source;\n req.config.secretsLocation = secretsLocation;\n req.config.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n function removeRequest(uint64 subscriptionId) external onlyManager {\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n delete _requests[subscriptionId];\n\n // Find the index of the subscriptionId in the subscriptions array\n uint256 index = subscriptions.length;\n for (uint256 i = 0; i < subscriptions.length; i++) {\n if (index == subscriptions.length && subscriptions[i] == subscriptionId) index = i;\n if (index != subscriptions.length && i + 1 < subscriptions.length) subscriptions[i] = subscriptions[i + 1];\n }\n\n subscriptions.pop();\n }\n\n function getRequest(uint64 subscriptionId) external view returns (CCGRequest memory) {\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n return _requests[subscriptionId];\n }\n// ---------------------------------------------------------------------------------------------------------------------\n modifier onlySource(bytes32 requestId) {\n if (unprocessed_responses[requestId].source != _msgSender()) {revert CCGOnlySameSourceAllowed(requestId);}\n _;\n }\n\n modifier onlyManager() {\n if (!hasRole(MANAGER_ROLE, tx.origin)) {revert CCGOnlyManagerAllowed();}\n _;\n }\n// ---------------------------------------------------------------------------------------------------------------------\n /**\n * @notice Triggers an on-demand Functions request using remote encrypted secrets\n * @param subscriptionId Subscription ID used to pay for request (FunctionsConsumer contract address must first be added to the subscription)\n * @param args String arguments passed into the source code and accessible via the global variable `args`\n * @param bytesArgs Bytes arguments passed into the source code and accessible via the global variable `bytesArgs` as hex strings\n * @param encryptedSecretsReference Reference pointing to encrypted secrets\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external onlyRole(CLIENT_ROLE) returns (bytes32 requestId) {\n CCGRequest storage request = _requests[subscriptionId];\n if (bytes(request.name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n\n FunctionsRequest.Request memory req = request.config;\n req.initializeRequest(req.codeLocation, FunctionsRequest.CodeLanguage.JavaScript, req.source);\n if (encryptedSecretsReference.length > 0) {req.encryptedSecretsReference = encryptedSecretsReference;}\n\n if (args.length > 0) {\n req.setArgs(args);\n }\n if (bytesArgs.length > 0) {\n req.setBytesArgs(bytesArgs);\n }\n\n requestId = _sendRequest(req.encodeCBOR(), subscriptionId, request.callbackGasLimit, _donId);\n unprocessed_responses[requestId].state = ICCGatewayClient.CCGResponseState.Sent;\n unprocessed_responses[requestId].source = _msgSender();\n }\n\n /**\n * @notice Store latest result/error\n * @param requestId The request ID, returned by sendRequest()\n * @param response Aggregated response from the user code\n * @param err Aggregated error from the user code or from the execution pipeline\n * Either response or error parameter will be set, but never both\n */\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal override {\n ICCGatewayClient.CCGResponse storage resp = unprocessed_responses[requestId];\n if (resp.state != ICCGatewayClient.CCGResponseState.Sent) {revert CCGRequestAlreadyFulfilled(requestId);}\n\n unprocessed_responses[requestId].state = err.length > 0 ? ICCGatewayClient.CCGResponseState.Error : ICCGatewayClient.CCGResponseState.Success;\n unprocessed_responses[requestId].data = response;\n unprocessed_responses[requestId].error = err;\n\n ICCGatewayClient(resp.source).callback(requestId);\n }\n\n /**\n * @dev Get the response data\n * @param requestId The request ID, returned by sendRequest()\n * @return response CCGResponse\n */\n function getResponse(bytes32 requestId, bool remove) external onlySource(requestId) returns (ICCGatewayClient.CCGResponse memory response) {\n response = unprocessed_responses[requestId];\n if (remove) {delete unprocessed_responses[requestId];}\n }\n}" + }, + "contracts/interfaces/ICCGateway.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\";\n\ninterface ICCGateway {\n struct CCGRequest {\n string name;\n uint32 callbackGasLimit;\n FunctionsRequest.Request config;\n }\n\n /**\n * @dev Can't register a request with an empty name\n */\n error CCGRequestNameEmpty();\n\n /**\n * @dev Only the same source of the requestId is allowed to call the function\n */\n error CCGOnlySameSourceAllowed(bytes32 requestId);\n\n /**\n * @dev Only a registered subscriptionId is allowed to call the function\n */\n error CCGRequestNotRegistered(uint64 subscriptionId);\n\n /**\n * @dev Can't fulfill a request that has already been fulfilled\n */\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\n\n /**\n * @dev Only A manager can call the function\n */\n error CCGOnlyManagerAllowed();\n\n /**\n * @dev Send a request to the Functions DON\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external returns (bytes32 requestId);\n\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\n}\n" + }, + "contracts/interfaces/ICCGatewayClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\ninterface ICCGatewayClient {\n enum CCGResponseState {Sent, Success, Error}\n\n struct CCGResponse {\n uint64 subscriptionId;\n address source;\n CCGResponseState state;\n bytes data;\n bytes error;\n }\n\n function callback(bytes32 requestId) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/baseSepolia/solcInputs/da2f6e6d8541f69733b0b28912d4a325.json b/packages/hardhat/deployments/baseSepolia/solcInputs/da2f6e6d8541f69733b0b28912d4a325.json new file mode 100644 index 0000000..0910532 --- /dev/null +++ b/packages/hardhat/deployments/baseSepolia/solcInputs/da2f6e6d8541f69733b0b28912d4a325.json @@ -0,0 +1,66 @@ +{ + "language": "Solidity", + "sources": { + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Chainlink Functions client interface.\ninterface IFunctionsClient {\n /// @notice Chainlink Functions response handler called by the Functions Router\n /// during fullilment from the designated transmitter node in an OCR round.\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\n /// @param response Aggregated response from the request's source code.\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\n /// @dev Either response or error parameter will be set, but never both.\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {FunctionsResponse} from \"../libraries/FunctionsResponse.sol\";\n\n/// @title Chainlink Functions Router interface.\ninterface IFunctionsRouter {\n /// @notice The identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n /// @return id - bytes32 id that can be passed to the \"getContractById\" of the Router\n function getAllowListId() external view returns (bytes32);\n\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n function setAllowListId(bytes32 allowListId) external;\n\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\n /// @return adminFee\n function getAdminFee() external view returns (uint72 adminFee);\n\n /// @notice Sends a request using the provided subscriptionId\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequest(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Sends a request to the proposed contracts\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequestToProposed(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Fulfill the request by:\n /// - calling back the data that the Oracle returned to the client contract\n /// - pay the DON for processing the request\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\n /// @param response response data from DON consensus\n /// @param err error from DON consensus\n /// @param juelsPerGas - current rate of juels/gas\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\n /// @param transmitter - The Node that transmitted the OCR report\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\n /// @return fulfillResult -\n /// @return callbackGasCostJuels -\n function fulfill(\n bytes memory response,\n bytes memory err,\n uint96 juelsPerGas,\n uint96 costWithoutFulfillment,\n address transmitter,\n FunctionsResponse.Commitment memory commitment\n ) external returns (FunctionsResponse.FulfillResult, uint96);\n\n /// @notice Validate requested gas limit is below the subscription max.\n /// @param subscriptionId subscription ID\n /// @param callbackGasLimit desired callback gas limit\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\n\n /// @notice Get the current contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current contract address\n function getContractById(bytes32 id) external view returns (address);\n\n /// @notice Get the proposed next contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current or proposed contract address\n function getProposedContractById(bytes32 id) external view returns (address);\n\n /// @notice Return the latest proprosal set\n /// @return ids The identifiers of the contracts to update\n /// @return to The addresses of the contracts that will be updated to\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\n\n /// @notice Proposes one or more updates to the contract routes\n /// @dev Only callable by owner\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\n\n /// @notice Updates the current contract routes to the proposed contracts\n /// @dev Only callable by owner\n function updateContracts() external;\n\n /// @dev Puts the system into an emergency stopped state.\n /// @dev Only callable by owner\n function pause() external;\n\n /// @dev Takes the system out of an emergency stopped state.\n /// @dev Only callable by owner\n function unpause() external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {CBOR} from \"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\";\n\n/// @title Library for encoding the input data of a Functions request into CBOR\nlibrary FunctionsRequest {\n using CBOR for CBOR.CBORBuffer;\n\n uint16 public constant REQUEST_DATA_VERSION = 1;\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\n\n enum Location {\n Inline, // Provided within the Request\n Remote, // Hosted through remote location that can be accessed through a provided URL\n DONHosted // Hosted on the DON's storage\n }\n\n enum CodeLanguage {\n JavaScript\n // In future version we may add other languages\n }\n\n struct Request {\n Location codeLocation; // ════════════╸ The location of the source code that will be executed on each node in the DON\n Location secretsLocation; // ═════════╸ The location of secrets that will be passed into the source code. *Only Remote secrets are supported\n CodeLanguage language; // ════════════╸ The coding language that the source code is written in\n string source; // ════════════════════╸ Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\n bytes encryptedSecretsReference; // ══╸ Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\n string[] args; // ════════════════════╸ String arguments that will be passed into the source code\n bytes[] bytesArgs; // ════════════════╸ Bytes arguments that will be passed into the source code\n }\n\n error EmptySource();\n error EmptySecrets();\n error EmptyArgs();\n error NoInlineSecrets();\n\n /// @notice Encodes a Request to CBOR encoded bytes\n /// @param self The request to encode\n /// @return CBOR encoded bytes\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"codeLocation\");\n buffer.writeUInt256(uint256(self.codeLocation));\n\n buffer.writeString(\"language\");\n buffer.writeUInt256(uint256(self.language));\n\n buffer.writeString(\"source\");\n buffer.writeString(self.source);\n\n if (self.args.length > 0) {\n buffer.writeString(\"args\");\n buffer.startArray();\n for (uint256 i = 0; i < self.args.length; ++i) {\n buffer.writeString(self.args[i]);\n }\n buffer.endSequence();\n }\n\n if (self.encryptedSecretsReference.length > 0) {\n if (self.secretsLocation == Location.Inline) {\n revert NoInlineSecrets();\n }\n buffer.writeString(\"secretsLocation\");\n buffer.writeUInt256(uint256(self.secretsLocation));\n buffer.writeString(\"secrets\");\n buffer.writeBytes(self.encryptedSecretsReference);\n }\n\n if (self.bytesArgs.length > 0) {\n buffer.writeString(\"bytesArgs\");\n buffer.startArray();\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\n buffer.writeBytes(self.bytesArgs[i]);\n }\n buffer.endSequence();\n }\n\n return buffer.buf.buf;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Sets the codeLocation and code on the request\n /// @param self The uninitialized request\n /// @param codeLocation The user provided source code location\n /// @param language The programming language of the user code\n /// @param source The user provided source code or a url\n function initializeRequest(\n Request memory self,\n Location codeLocation,\n CodeLanguage language,\n string memory source\n ) internal pure {\n if (bytes(source).length == 0) revert EmptySource();\n\n self.codeLocation = codeLocation;\n self.language = language;\n self.source = source;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Simplified version of initializeRequest for PoC\n /// @param self The uninitialized request\n /// @param javaScriptSource The user provided JS code (must not be empty)\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\n }\n\n /// @notice Adds Remote user encrypted secrets to a Request\n /// @param self The initialized request\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\n\n self.secretsLocation = Location.Remote;\n self.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n /// @notice Adds DON-hosted secrets reference to a Request\n /// @param self The initialized request\n /// @param slotID Slot ID of the user's secrets hosted on DON\n /// @param version User data version (for the slotID)\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"slotID\");\n buffer.writeUInt64(slotID);\n buffer.writeString(\"version\");\n buffer.writeUInt64(version);\n\n self.secretsLocation = Location.DONHosted;\n self.encryptedSecretsReference = buffer.buf.buf;\n }\n\n /// @notice Sets args for the user run function\n /// @param self The initialized request\n /// @param args The array of string args (must not be empty)\n function setArgs(Request memory self, string[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.args = args;\n }\n\n /// @notice Sets bytes args for the user run function\n /// @param self The initialized request\n /// @param args The array of bytes args (must not be empty)\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.bytesArgs = args;\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Library of types that are used for fulfillment of a Functions request\nlibrary FunctionsResponse {\n // Used to send request information from the Router to the Coordinator\n struct RequestMeta {\n bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\n bytes32 flags; // ═══════════════╸ Per-subscription flags\n address requestingContract; // ══╗ The client contract that is sending the request\n uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\n uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint64 initiatedRequests; // β•‘ The number of requests that have been started\n uint32 callbackGasLimit; // β•‘ The amount of gas that the callback to the consuming contract will be given\n uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data\n uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out\n address subscriptionOwner; // ═══╝ The owner of the billing subscription\n }\n\n enum FulfillResult {\n FULFILLED, // 0\n USER_CALLBACK_ERROR, // 1\n INVALID_REQUEST_ID, // 2\n COST_EXCEEDS_COMMITMENT, // 3\n INSUFFICIENT_GAS_PROVIDED, // 4\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\n INVALID_COMMITMENT // 6\n }\n\n struct Commitment {\n bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request\n address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request\n uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\n address client; // ════════════════════╗ The client contract that sent the request\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given\n uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint72 donFee; // β•‘ Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\n uint40 gasOverheadBeforeCallback; // β•‘ Represents the average gas execution cost before the fulfillment callback.\n uint40 gasOverheadAfterCallback; // β•‘ Represents the average gas execution cost after the fulfillment callback.\n uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"../v1_0_0/interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"../v1_0_0/interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"../v1_0_0/libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_functionsRouter;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_functionsRouter = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_functionsRouter.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_functionsRouter)) {\n revert OnlyRouterCanFulfill();\n }\n _fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}" + }, + "@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../@ensdomains/buffer/v0.1.0/Buffer.sol\";\n\n/**\n* @dev A library for populating CBOR encoded payload in Solidity.\n*\n* https://datatracker.ietf.org/doc/html/rfc7049\n*\n* The library offers various write* and start* methods to encode values of different types.\n* The resulted buffer can be obtained with data() method.\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\n* in an invalid CBOR if start/write/end flow is violated.\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\n* except for nested start/end pairs.\n*/\n\nlibrary CBOR {\n using Buffer for Buffer.buffer;\n\n struct CBORBuffer {\n Buffer.buffer buf;\n uint256 depth;\n }\n\n uint8 private constant MAJOR_TYPE_INT = 0;\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\n uint8 private constant MAJOR_TYPE_BYTES = 2;\n uint8 private constant MAJOR_TYPE_STRING = 3;\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\n uint8 private constant MAJOR_TYPE_MAP = 5;\n uint8 private constant MAJOR_TYPE_TAG = 6;\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\n\n uint8 private constant TAG_TYPE_BIGNUM = 2;\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\n\n uint8 private constant CBOR_FALSE = 20;\n uint8 private constant CBOR_TRUE = 21;\n uint8 private constant CBOR_NULL = 22;\n uint8 private constant CBOR_UNDEFINED = 23;\n\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\n Buffer.init(cbor.buf, capacity);\n cbor.depth = 0;\n return cbor;\n }\n\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\n require(buf.depth == 0, \"Invalid CBOR\");\n return buf.buf.buf;\n }\n\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\n writeBytes(buf, abi.encode(value));\n }\n\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\n if (value < 0) {\n buf.buf.appendUint8(\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\n );\n writeBytes(buf, abi.encode(uint256(-1 - value)));\n } else {\n writeUInt256(buf, uint256(value));\n }\n }\n\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\n }\n\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\n if(value >= 0) {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\n } else{\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\n }\n }\n\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\n buf.buf.append(value);\n }\n\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\n buf.buf.append(bytes(value));\n }\n\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\n }\n\n function writeNull(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_NULL);\n }\n\n function writeUndefined(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_UNDEFINED);\n }\n\n function startArray(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\n buf.depth += 1;\n }\n\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\n }\n\n function startMap(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\n buf.depth += 1;\n }\n\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\n }\n\n function endSequence(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\n buf.depth -= 1;\n }\n\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\n writeString(buf, key);\n writeString(buf, value);\n }\n\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\n writeString(buf, key);\n writeBytes(buf, value);\n }\n\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\n writeString(buf, key);\n writeUInt256(buf, value);\n }\n\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\n writeString(buf, key);\n writeInt256(buf, value);\n }\n\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\n writeString(buf, key);\n writeUInt64(buf, value);\n }\n\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\n writeString(buf, key);\n writeInt64(buf, value);\n }\n\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\n writeString(buf, key);\n writeBool(buf, value);\n }\n\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeNull(buf);\n }\n\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeUndefined(buf);\n }\n\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startMap(buf);\n }\n\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startArray(buf);\n }\n\n function writeFixedNumeric(\n CBORBuffer memory buf,\n uint8 major,\n uint64 value\n ) private pure {\n if (value <= 23) {\n buf.buf.appendUint8(uint8((major << 5) | value));\n } else if (value <= 0xFF) {\n buf.buf.appendUint8(uint8((major << 5) | 24));\n buf.buf.appendInt(value, 1);\n } else if (value <= 0xFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 25));\n buf.buf.appendInt(value, 2);\n } else if (value <= 0xFFFFFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 26));\n buf.buf.appendInt(value, 4);\n } else {\n buf.buf.appendUint8(uint8((major << 5) | 27));\n buf.buf.appendInt(value, 8);\n }\n }\n\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\n private\n pure\n {\n buf.buf.appendUint8(uint8((major << 5) | 31));\n }\n\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\n private\n pure\n {\n writeFixedNumeric(buf, major, length);\n }\n\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\n }\n}" + }, + "contracts/CCExampleClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from \"./interfaces/ICCGatewayClient.sol\";\nimport {ICCGateway} from \"./interfaces/ICCGateway.sol\";\n\ncontract CCExampleClient is ICCGatewayClient {\n ICCGateway private immutable gateway;\n\n uint64 public subscriptionId = 0;\n bytes public encryptedSecretsReference = \"\";\n\n event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response);\n event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error);\n\n constructor(address gatewayAddress) {\n gateway = ICCGateway(gatewayAddress);\n }\n\n function updateSubscriptionId(uint64 _subscriptionId) external {\n subscriptionId = _subscriptionId;\n }\n\n function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external {\n encryptedSecretsReference = _encryptedSecretsReference;\n }\n\n function request(string[] calldata args, bytes[] calldata bytesArgs) external {\n require(subscriptionId != 0, \"Subscription ID not set\");\n\n gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference);\n }\n\n function callback(bytes32 requestId) external override {\n ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true);\n\n if (response.state == ICCGatewayClient.CCGResponseState.Success) {\n emit ResponseReceived(response.subscriptionId, requestId, string(response.data));\n } else {\n emit ErrorReceived(response.subscriptionId, requestId, string(response.error));\n }\n }\n}\n" + }, + "contracts/CCNotificationClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {CCExampleClient} from \"./CCExampleClient.sol\";\n\ncontract CCNotificationClient is CCExampleClient {\n constructor(address gatewayAddress) CCExampleClient(gatewayAddress) {}\n}\n" + }, + "contracts/interfaces/ICCGateway.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\";\n\ninterface ICCGateway {\n struct CCGRequest {\n string name;\n uint32 callbackGasLimit;\n FunctionsRequest.Request config;\n }\n\n /**\n * @dev Can't register a request with an empty name\n */\n error CCGRequestNameEmpty();\n\n /**\n * @dev Only the same source of the requestId is allowed to call the function\n */\n error CCGOnlySameSourceAllowed(bytes32 requestId);\n\n /**\n * @dev Only a registered subscriptionId is allowed to call the function\n */\n error CCGRequestNotRegistered(uint64 subscriptionId);\n\n /**\n * @dev Can't fulfill a request that has already been fulfilled\n */\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\n\n /**\n * @dev Only A manager can call the function\n */\n error CCGOnlyManagerAllowed();\n\n /**\n * @dev Send a request to the Functions DON\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external returns (bytes32 requestId);\n\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\n}\n" + }, + "contracts/interfaces/ICCGatewayClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\ninterface ICCGatewayClient {\n enum CCGResponseState {Sent, Success, Error}\n\n struct CCGResponse {\n uint64 subscriptionId;\n address source;\n CCGResponseState state;\n bytes data;\n bytes error;\n }\n\n function callback(bytes32 requestId) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/baseSepolia/solcInputs/fc0de00091a2e0264aed2d3e71476d4f.json b/packages/hardhat/deployments/baseSepolia/solcInputs/fc0de00091a2e0264aed2d3e71476d4f.json new file mode 100644 index 0000000..0b0fb2b --- /dev/null +++ b/packages/hardhat/deployments/baseSepolia/solcInputs/fc0de00091a2e0264aed2d3e71476d4f.json @@ -0,0 +1,63 @@ +{ + "language": "Solidity", + "sources": { + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Chainlink Functions client interface.\ninterface IFunctionsClient {\n /// @notice Chainlink Functions response handler called by the Functions Router\n /// during fullilment from the designated transmitter node in an OCR round.\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\n /// @param response Aggregated response from the request's source code.\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\n /// @dev Either response or error parameter will be set, but never both.\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {FunctionsResponse} from \"../libraries/FunctionsResponse.sol\";\n\n/// @title Chainlink Functions Router interface.\ninterface IFunctionsRouter {\n /// @notice The identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n /// @return id - bytes32 id that can be passed to the \"getContractById\" of the Router\n function getAllowListId() external view returns (bytes32);\n\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n function setAllowListId(bytes32 allowListId) external;\n\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\n /// @return adminFee\n function getAdminFee() external view returns (uint72 adminFee);\n\n /// @notice Sends a request using the provided subscriptionId\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequest(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Sends a request to the proposed contracts\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequestToProposed(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Fulfill the request by:\n /// - calling back the data that the Oracle returned to the client contract\n /// - pay the DON for processing the request\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\n /// @param response response data from DON consensus\n /// @param err error from DON consensus\n /// @param juelsPerGas - current rate of juels/gas\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\n /// @param transmitter - The Node that transmitted the OCR report\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\n /// @return fulfillResult -\n /// @return callbackGasCostJuels -\n function fulfill(\n bytes memory response,\n bytes memory err,\n uint96 juelsPerGas,\n uint96 costWithoutFulfillment,\n address transmitter,\n FunctionsResponse.Commitment memory commitment\n ) external returns (FunctionsResponse.FulfillResult, uint96);\n\n /// @notice Validate requested gas limit is below the subscription max.\n /// @param subscriptionId subscription ID\n /// @param callbackGasLimit desired callback gas limit\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\n\n /// @notice Get the current contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current contract address\n function getContractById(bytes32 id) external view returns (address);\n\n /// @notice Get the proposed next contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current or proposed contract address\n function getProposedContractById(bytes32 id) external view returns (address);\n\n /// @notice Return the latest proprosal set\n /// @return ids The identifiers of the contracts to update\n /// @return to The addresses of the contracts that will be updated to\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\n\n /// @notice Proposes one or more updates to the contract routes\n /// @dev Only callable by owner\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\n\n /// @notice Updates the current contract routes to the proposed contracts\n /// @dev Only callable by owner\n function updateContracts() external;\n\n /// @dev Puts the system into an emergency stopped state.\n /// @dev Only callable by owner\n function pause() external;\n\n /// @dev Takes the system out of an emergency stopped state.\n /// @dev Only callable by owner\n function unpause() external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {CBOR} from \"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\";\n\n/// @title Library for encoding the input data of a Functions request into CBOR\nlibrary FunctionsRequest {\n using CBOR for CBOR.CBORBuffer;\n\n uint16 public constant REQUEST_DATA_VERSION = 1;\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\n\n enum Location {\n Inline, // Provided within the Request\n Remote, // Hosted through remote location that can be accessed through a provided URL\n DONHosted // Hosted on the DON's storage\n }\n\n enum CodeLanguage {\n JavaScript\n // In future version we may add other languages\n }\n\n struct Request {\n Location codeLocation; // ════════════╸ The location of the source code that will be executed on each node in the DON\n Location secretsLocation; // ═════════╸ The location of secrets that will be passed into the source code. *Only Remote secrets are supported\n CodeLanguage language; // ════════════╸ The coding language that the source code is written in\n string source; // ════════════════════╸ Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\n bytes encryptedSecretsReference; // ══╸ Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\n string[] args; // ════════════════════╸ String arguments that will be passed into the source code\n bytes[] bytesArgs; // ════════════════╸ Bytes arguments that will be passed into the source code\n }\n\n error EmptySource();\n error EmptySecrets();\n error EmptyArgs();\n error NoInlineSecrets();\n\n /// @notice Encodes a Request to CBOR encoded bytes\n /// @param self The request to encode\n /// @return CBOR encoded bytes\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"codeLocation\");\n buffer.writeUInt256(uint256(self.codeLocation));\n\n buffer.writeString(\"language\");\n buffer.writeUInt256(uint256(self.language));\n\n buffer.writeString(\"source\");\n buffer.writeString(self.source);\n\n if (self.args.length > 0) {\n buffer.writeString(\"args\");\n buffer.startArray();\n for (uint256 i = 0; i < self.args.length; ++i) {\n buffer.writeString(self.args[i]);\n }\n buffer.endSequence();\n }\n\n if (self.encryptedSecretsReference.length > 0) {\n if (self.secretsLocation == Location.Inline) {\n revert NoInlineSecrets();\n }\n buffer.writeString(\"secretsLocation\");\n buffer.writeUInt256(uint256(self.secretsLocation));\n buffer.writeString(\"secrets\");\n buffer.writeBytes(self.encryptedSecretsReference);\n }\n\n if (self.bytesArgs.length > 0) {\n buffer.writeString(\"bytesArgs\");\n buffer.startArray();\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\n buffer.writeBytes(self.bytesArgs[i]);\n }\n buffer.endSequence();\n }\n\n return buffer.buf.buf;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Sets the codeLocation and code on the request\n /// @param self The uninitialized request\n /// @param codeLocation The user provided source code location\n /// @param language The programming language of the user code\n /// @param source The user provided source code or a url\n function initializeRequest(\n Request memory self,\n Location codeLocation,\n CodeLanguage language,\n string memory source\n ) internal pure {\n if (bytes(source).length == 0) revert EmptySource();\n\n self.codeLocation = codeLocation;\n self.language = language;\n self.source = source;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Simplified version of initializeRequest for PoC\n /// @param self The uninitialized request\n /// @param javaScriptSource The user provided JS code (must not be empty)\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\n }\n\n /// @notice Adds Remote user encrypted secrets to a Request\n /// @param self The initialized request\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\n\n self.secretsLocation = Location.Remote;\n self.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n /// @notice Adds DON-hosted secrets reference to a Request\n /// @param self The initialized request\n /// @param slotID Slot ID of the user's secrets hosted on DON\n /// @param version User data version (for the slotID)\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"slotID\");\n buffer.writeUInt64(slotID);\n buffer.writeString(\"version\");\n buffer.writeUInt64(version);\n\n self.secretsLocation = Location.DONHosted;\n self.encryptedSecretsReference = buffer.buf.buf;\n }\n\n /// @notice Sets args for the user run function\n /// @param self The initialized request\n /// @param args The array of string args (must not be empty)\n function setArgs(Request memory self, string[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.args = args;\n }\n\n /// @notice Sets bytes args for the user run function\n /// @param self The initialized request\n /// @param args The array of bytes args (must not be empty)\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.bytesArgs = args;\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Library of types that are used for fulfillment of a Functions request\nlibrary FunctionsResponse {\n // Used to send request information from the Router to the Coordinator\n struct RequestMeta {\n bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\n bytes32 flags; // ═══════════════╸ Per-subscription flags\n address requestingContract; // ══╗ The client contract that is sending the request\n uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\n uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint64 initiatedRequests; // β•‘ The number of requests that have been started\n uint32 callbackGasLimit; // β•‘ The amount of gas that the callback to the consuming contract will be given\n uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data\n uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out\n address subscriptionOwner; // ═══╝ The owner of the billing subscription\n }\n\n enum FulfillResult {\n FULFILLED, // 0\n USER_CALLBACK_ERROR, // 1\n INVALID_REQUEST_ID, // 2\n COST_EXCEEDS_COMMITMENT, // 3\n INSUFFICIENT_GAS_PROVIDED, // 4\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\n INVALID_COMMITMENT // 6\n }\n\n struct Commitment {\n bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request\n address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request\n uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\n address client; // ════════════════════╗ The client contract that sent the request\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given\n uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint72 donFee; // β•‘ Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\n uint40 gasOverheadBeforeCallback; // β•‘ Represents the average gas execution cost before the fulfillment callback.\n uint40 gasOverheadAfterCallback; // β•‘ Represents the average gas execution cost after the fulfillment callback.\n uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"../v1_0_0/interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"../v1_0_0/interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"../v1_0_0/libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_functionsRouter;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_functionsRouter = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_functionsRouter.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_functionsRouter)) {\n revert OnlyRouterCanFulfill();\n }\n _fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}" + }, + "@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../@ensdomains/buffer/v0.1.0/Buffer.sol\";\n\n/**\n* @dev A library for populating CBOR encoded payload in Solidity.\n*\n* https://datatracker.ietf.org/doc/html/rfc7049\n*\n* The library offers various write* and start* methods to encode values of different types.\n* The resulted buffer can be obtained with data() method.\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\n* in an invalid CBOR if start/write/end flow is violated.\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\n* except for nested start/end pairs.\n*/\n\nlibrary CBOR {\n using Buffer for Buffer.buffer;\n\n struct CBORBuffer {\n Buffer.buffer buf;\n uint256 depth;\n }\n\n uint8 private constant MAJOR_TYPE_INT = 0;\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\n uint8 private constant MAJOR_TYPE_BYTES = 2;\n uint8 private constant MAJOR_TYPE_STRING = 3;\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\n uint8 private constant MAJOR_TYPE_MAP = 5;\n uint8 private constant MAJOR_TYPE_TAG = 6;\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\n\n uint8 private constant TAG_TYPE_BIGNUM = 2;\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\n\n uint8 private constant CBOR_FALSE = 20;\n uint8 private constant CBOR_TRUE = 21;\n uint8 private constant CBOR_NULL = 22;\n uint8 private constant CBOR_UNDEFINED = 23;\n\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\n Buffer.init(cbor.buf, capacity);\n cbor.depth = 0;\n return cbor;\n }\n\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\n require(buf.depth == 0, \"Invalid CBOR\");\n return buf.buf.buf;\n }\n\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\n writeBytes(buf, abi.encode(value));\n }\n\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\n if (value < 0) {\n buf.buf.appendUint8(\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\n );\n writeBytes(buf, abi.encode(uint256(-1 - value)));\n } else {\n writeUInt256(buf, uint256(value));\n }\n }\n\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\n }\n\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\n if(value >= 0) {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\n } else{\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\n }\n }\n\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\n buf.buf.append(value);\n }\n\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\n buf.buf.append(bytes(value));\n }\n\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\n }\n\n function writeNull(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_NULL);\n }\n\n function writeUndefined(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_UNDEFINED);\n }\n\n function startArray(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\n buf.depth += 1;\n }\n\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\n }\n\n function startMap(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\n buf.depth += 1;\n }\n\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\n }\n\n function endSequence(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\n buf.depth -= 1;\n }\n\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\n writeString(buf, key);\n writeString(buf, value);\n }\n\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\n writeString(buf, key);\n writeBytes(buf, value);\n }\n\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\n writeString(buf, key);\n writeUInt256(buf, value);\n }\n\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\n writeString(buf, key);\n writeInt256(buf, value);\n }\n\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\n writeString(buf, key);\n writeUInt64(buf, value);\n }\n\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\n writeString(buf, key);\n writeInt64(buf, value);\n }\n\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\n writeString(buf, key);\n writeBool(buf, value);\n }\n\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeNull(buf);\n }\n\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeUndefined(buf);\n }\n\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startMap(buf);\n }\n\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startArray(buf);\n }\n\n function writeFixedNumeric(\n CBORBuffer memory buf,\n uint8 major,\n uint64 value\n ) private pure {\n if (value <= 23) {\n buf.buf.appendUint8(uint8((major << 5) | value));\n } else if (value <= 0xFF) {\n buf.buf.appendUint8(uint8((major << 5) | 24));\n buf.buf.appendInt(value, 1);\n } else if (value <= 0xFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 25));\n buf.buf.appendInt(value, 2);\n } else if (value <= 0xFFFFFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 26));\n buf.buf.appendInt(value, 4);\n } else {\n buf.buf.appendUint8(uint8((major << 5) | 27));\n buf.buf.appendInt(value, 8);\n }\n }\n\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\n private\n pure\n {\n buf.buf.appendUint8(uint8((major << 5) | 31));\n }\n\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\n private\n pure\n {\n writeFixedNumeric(buf, major, length);\n }\n\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\n }\n}" + }, + "contracts/CCExampleClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from \"./interfaces/ICCGatewayClient.sol\";\nimport {ICCGateway} from \"./interfaces/ICCGateway.sol\";\n\ncontract CCExampleClient is ICCGatewayClient {\n ICCGateway private immutable gateway;\n\n uint64 public subscriptionId = 0;\n bytes public encryptedSecretsReference = \"\";\n\n event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response);\n event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error);\n\n constructor(address gatewayAddress) {\n gateway = ICCGateway(gatewayAddress);\n }\n\n function updateSubscriptionId(uint64 _subscriptionId) external {\n subscriptionId = _subscriptionId;\n }\n\n function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external {\n encryptedSecretsReference = _encryptedSecretsReference;\n }\n\n function request(string[] calldata args, bytes[] calldata bytesArgs) external {\n require(subscriptionId != 0, \"Subscription ID not set\");\n\n gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference);\n }\n\n function callback(bytes32 requestId) external override {\n ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true);\n\n if (response.state == ICCGatewayClient.CCGResponseState.Success) {\n emit ResponseReceived(response.subscriptionId, requestId, string(response.data));\n } else {\n emit ErrorReceived(response.subscriptionId, requestId, string(response.error));\n }\n }\n}\n" + }, + "contracts/interfaces/ICCGateway.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\";\n\ninterface ICCGateway {\n struct CCGRequest {\n string name;\n uint32 callbackGasLimit;\n FunctionsRequest.Request config;\n }\n\n /**\n * @dev Can't register a request with an empty name\n */\n error CCGRequestNameEmpty();\n\n /**\n * @dev Only the same source of the requestId is allowed to call the function\n */\n error CCGOnlySameSourceAllowed(bytes32 requestId);\n\n /**\n * @dev Only a registered subscriptionId is allowed to call the function\n */\n error CCGRequestNotRegistered(uint64 subscriptionId);\n\n /**\n * @dev Can't fulfill a request that has already been fulfilled\n */\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\n\n /**\n * @dev Only A manager can call the function\n */\n error CCGOnlyManagerAllowed();\n\n /**\n * @dev Send a request to the Functions DON\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external returns (bytes32 requestId);\n\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\n}\n" + }, + "contracts/interfaces/ICCGatewayClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\ninterface ICCGatewayClient {\n enum CCGResponseState {Sent, Success, Error}\n\n struct CCGResponse {\n uint64 subscriptionId;\n address source;\n CCGResponseState state;\n bytes data;\n bytes error;\n }\n\n function callback(bytes32 requestId) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/optimismSepolia/.chainId b/packages/hardhat/deployments/optimismSepolia/.chainId new file mode 100644 index 0000000..03f37de --- /dev/null +++ b/packages/hardhat/deployments/optimismSepolia/.chainId @@ -0,0 +1 @@ +11155420 \ No newline at end of file diff --git a/packages/hardhat/deployments/optimismSepolia/CCExampleClient.json b/packages/hardhat/deployments/optimismSepolia/CCExampleClient.json new file mode 100644 index 0000000..9cd3984 --- /dev/null +++ b/packages/hardhat/deployments/optimismSepolia/CCExampleClient.json @@ -0,0 +1,215 @@ +{ + "address": "0xeDf5a10bb18B25a8abe24AFd8a59C12700B241ba", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "gatewayAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "error", + "type": "string" + } + ], + "name": "ErrorReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "response", + "type": "string" + } + ], + "name": "ResponseReceived", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + } + ], + "name": "callback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "encryptedSecretsReference", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "args", + "type": "string[]" + }, + { + "internalType": "bytes[]", + "name": "bytesArgs", + "type": "bytes[]" + } + ], + "name": "request", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "subscriptionId", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_encryptedSecretsReference", + "type": "bytes" + } + ], + "name": "updateEncryptedSecretsReference", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "_subscriptionId", + "type": "uint64" + } + ], + "name": "updateSubscriptionId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xeb918ab534dabd98f6f3a66aaf3d119b7005de4fad824b1b365e9fb5287400c7", + "receipt": { + "to": null, + "from": "0xD10F43A0aa00D244DAcFBE3C49b9B918B717Ff2c", + "contractAddress": "0xeDf5a10bb18B25a8abe24AFd8a59C12700B241ba", + "transactionIndex": 3, + "gasUsed": "686011", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x38b1ca6655c0ed08a8da8940c139b2c0c5ae31bc2843441802614fdebeee860d", + "transactionHash": "0xeb918ab534dabd98f6f3a66aaf3d119b7005de4fad824b1b365e9fb5287400c7", + "logs": [], + "blockNumber": 12753431, + "cumulativeGasUsed": "1800757", + "status": 1, + "byzantium": true + }, + "args": [ + "0x0910A0FE7881D332230Ce1FB7f2BaA1Ebe527473" + ], + "numDeployments": 3, + "solcInputHash": "fc0de00091a2e0264aed2d3e71476d4f", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"gatewayAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"error\",\"type\":\"string\"}],\"name\":\"ErrorReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"response\",\"type\":\"string\"}],\"name\":\"ResponseReceived\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"callback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"encryptedSecretsReference\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"args\",\"type\":\"string[]\"},{\"internalType\":\"bytes[]\",\"name\":\"bytesArgs\",\"type\":\"bytes[]\"}],\"name\":\"request\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"subscriptionId\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_encryptedSecretsReference\",\"type\":\"bytes\"}],\"name\":\"updateEncryptedSecretsReference\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_subscriptionId\",\"type\":\"uint64\"}],\"name\":\"updateSubscriptionId\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/CCExampleClient.sol\":\"CCExampleClient\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\n/// @title Chainlink Functions client interface.\\ninterface IFunctionsClient {\\n /// @notice Chainlink Functions response handler called by the Functions Router\\n /// during fullilment from the designated transmitter node in an OCR round.\\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\\n /// @param response Aggregated response from the request's source code.\\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\\n /// @dev Either response or error parameter will be set, but never both.\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\\n}\\n\",\"keccak256\":\"0x6117b82e7c4eec44ce557b0fc8bc1ac5f49e5d160ac6d4485452d6aafdd762ff\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {FunctionsResponse} from \\\"../libraries/FunctionsResponse.sol\\\";\\n\\n/// @title Chainlink Functions Router interface.\\ninterface IFunctionsRouter {\\n /// @notice The identifier of the route to retrieve the address of the access control contract\\n /// The access control contract controls which accounts can manage subscriptions\\n /// @return id - bytes32 id that can be passed to the \\\"getContractById\\\" of the Router\\n function getAllowListId() external view returns (bytes32);\\n\\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\\n /// The access control contract controls which accounts can manage subscriptions\\n function setAllowListId(bytes32 allowListId) external;\\n\\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\\n /// @return adminFee\\n function getAdminFee() external view returns (uint72 adminFee);\\n\\n /// @notice Sends a request using the provided subscriptionId\\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\\n /// a client can make requests from different contracts referencing the same subscription\\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\\n /// @param dataVersion - Gas limit for the fulfillment callback\\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\\n /// @param donId - An identifier used to determine which route to send the request along\\n /// @return requestId - A unique request identifier\\n function sendRequest(\\n uint64 subscriptionId,\\n bytes calldata data,\\n uint16 dataVersion,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) external returns (bytes32);\\n\\n /// @notice Sends a request to the proposed contracts\\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\\n /// a client can make requests from different contracts referencing the same subscription\\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\\n /// @param dataVersion - Gas limit for the fulfillment callback\\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\\n /// @param donId - An identifier used to determine which route to send the request along\\n /// @return requestId - A unique request identifier\\n function sendRequestToProposed(\\n uint64 subscriptionId,\\n bytes calldata data,\\n uint16 dataVersion,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) external returns (bytes32);\\n\\n /// @notice Fulfill the request by:\\n /// - calling back the data that the Oracle returned to the client contract\\n /// - pay the DON for processing the request\\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\\n /// @param response response data from DON consensus\\n /// @param err error from DON consensus\\n /// @param juelsPerGas - current rate of juels/gas\\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\\n /// @param transmitter - The Node that transmitted the OCR report\\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\\n /// @return fulfillResult -\\n /// @return callbackGasCostJuels -\\n function fulfill(\\n bytes memory response,\\n bytes memory err,\\n uint96 juelsPerGas,\\n uint96 costWithoutFulfillment,\\n address transmitter,\\n FunctionsResponse.Commitment memory commitment\\n ) external returns (FunctionsResponse.FulfillResult, uint96);\\n\\n /// @notice Validate requested gas limit is below the subscription max.\\n /// @param subscriptionId subscription ID\\n /// @param callbackGasLimit desired callback gas limit\\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\\n\\n /// @notice Get the current contract given an ID\\n /// @param id A bytes32 identifier for the route\\n /// @return contract The current contract address\\n function getContractById(bytes32 id) external view returns (address);\\n\\n /// @notice Get the proposed next contract given an ID\\n /// @param id A bytes32 identifier for the route\\n /// @return contract The current or proposed contract address\\n function getProposedContractById(bytes32 id) external view returns (address);\\n\\n /// @notice Return the latest proprosal set\\n /// @return ids The identifiers of the contracts to update\\n /// @return to The addresses of the contracts that will be updated to\\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\\n\\n /// @notice Proposes one or more updates to the contract routes\\n /// @dev Only callable by owner\\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\\n\\n /// @notice Updates the current contract routes to the proposed contracts\\n /// @dev Only callable by owner\\n function updateContracts() external;\\n\\n /// @dev Puts the system into an emergency stopped state.\\n /// @dev Only callable by owner\\n function pause() external;\\n\\n /// @dev Takes the system out of an emergency stopped state.\\n /// @dev Only callable by owner\\n function unpause() external;\\n}\\n\",\"keccak256\":\"0x44db41e8ff90c2828ca0ada125abc4b411921a86514a4a047fd9fd43ba9d7e08\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {CBOR} from \\\"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\\\";\\n\\n/// @title Library for encoding the input data of a Functions request into CBOR\\nlibrary FunctionsRequest {\\n using CBOR for CBOR.CBORBuffer;\\n\\n uint16 public constant REQUEST_DATA_VERSION = 1;\\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\\n\\n enum Location {\\n Inline, // Provided within the Request\\n Remote, // Hosted through remote location that can be accessed through a provided URL\\n DONHosted // Hosted on the DON's storage\\n }\\n\\n enum CodeLanguage {\\n JavaScript\\n // In future version we may add other languages\\n }\\n\\n struct Request {\\n Location codeLocation; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The location of the source code that will be executed on each node in the DON\\n Location secretsLocation; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The location of secrets that will be passed into the source code. *Only Remote secrets are supported\\n CodeLanguage language; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The coding language that the source code is written in\\n string source; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\\n bytes encryptedSecretsReference; // \\u2550\\u2550\\u2578 Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\\n string[] args; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 String arguments that will be passed into the source code\\n bytes[] bytesArgs; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Bytes arguments that will be passed into the source code\\n }\\n\\n error EmptySource();\\n error EmptySecrets();\\n error EmptyArgs();\\n error NoInlineSecrets();\\n\\n /// @notice Encodes a Request to CBOR encoded bytes\\n /// @param self The request to encode\\n /// @return CBOR encoded bytes\\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\\n\\n buffer.writeString(\\\"codeLocation\\\");\\n buffer.writeUInt256(uint256(self.codeLocation));\\n\\n buffer.writeString(\\\"language\\\");\\n buffer.writeUInt256(uint256(self.language));\\n\\n buffer.writeString(\\\"source\\\");\\n buffer.writeString(self.source);\\n\\n if (self.args.length > 0) {\\n buffer.writeString(\\\"args\\\");\\n buffer.startArray();\\n for (uint256 i = 0; i < self.args.length; ++i) {\\n buffer.writeString(self.args[i]);\\n }\\n buffer.endSequence();\\n }\\n\\n if (self.encryptedSecretsReference.length > 0) {\\n if (self.secretsLocation == Location.Inline) {\\n revert NoInlineSecrets();\\n }\\n buffer.writeString(\\\"secretsLocation\\\");\\n buffer.writeUInt256(uint256(self.secretsLocation));\\n buffer.writeString(\\\"secrets\\\");\\n buffer.writeBytes(self.encryptedSecretsReference);\\n }\\n\\n if (self.bytesArgs.length > 0) {\\n buffer.writeString(\\\"bytesArgs\\\");\\n buffer.startArray();\\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\\n buffer.writeBytes(self.bytesArgs[i]);\\n }\\n buffer.endSequence();\\n }\\n\\n return buffer.buf.buf;\\n }\\n\\n /// @notice Initializes a Chainlink Functions Request\\n /// @dev Sets the codeLocation and code on the request\\n /// @param self The uninitialized request\\n /// @param codeLocation The user provided source code location\\n /// @param language The programming language of the user code\\n /// @param source The user provided source code or a url\\n function initializeRequest(\\n Request memory self,\\n Location codeLocation,\\n CodeLanguage language,\\n string memory source\\n ) internal pure {\\n if (bytes(source).length == 0) revert EmptySource();\\n\\n self.codeLocation = codeLocation;\\n self.language = language;\\n self.source = source;\\n }\\n\\n /// @notice Initializes a Chainlink Functions Request\\n /// @dev Simplified version of initializeRequest for PoC\\n /// @param self The uninitialized request\\n /// @param javaScriptSource The user provided JS code (must not be empty)\\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\\n }\\n\\n /// @notice Adds Remote user encrypted secrets to a Request\\n /// @param self The initialized request\\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\\n\\n self.secretsLocation = Location.Remote;\\n self.encryptedSecretsReference = encryptedSecretsReference;\\n }\\n\\n /// @notice Adds DON-hosted secrets reference to a Request\\n /// @param self The initialized request\\n /// @param slotID Slot ID of the user's secrets hosted on DON\\n /// @param version User data version (for the slotID)\\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\\n\\n buffer.writeString(\\\"slotID\\\");\\n buffer.writeUInt64(slotID);\\n buffer.writeString(\\\"version\\\");\\n buffer.writeUInt64(version);\\n\\n self.secretsLocation = Location.DONHosted;\\n self.encryptedSecretsReference = buffer.buf.buf;\\n }\\n\\n /// @notice Sets args for the user run function\\n /// @param self The initialized request\\n /// @param args The array of string args (must not be empty)\\n function setArgs(Request memory self, string[] memory args) internal pure {\\n if (args.length == 0) revert EmptyArgs();\\n\\n self.args = args;\\n }\\n\\n /// @notice Sets bytes args for the user run function\\n /// @param self The initialized request\\n /// @param args The array of bytes args (must not be empty)\\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\\n if (args.length == 0) revert EmptyArgs();\\n\\n self.bytesArgs = args;\\n }\\n}\\n\",\"keccak256\":\"0xed75be0eaba358d468f1fe18adc377d5044f57eff0070081f884a1f212d0adc2\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\n/// @title Library of types that are used for fulfillment of a Functions request\\nlibrary FunctionsResponse {\\n // Used to send request information from the Router to the Coordinator\\n struct RequestMeta {\\n bytes data; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\\n bytes32 flags; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Per-subscription flags\\n address requestingContract; // \\u2550\\u2550\\u2557 The client contract that is sending the request\\n uint96 availableBalance; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u255d Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\\n uint72 adminFee; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\\n uint64 subscriptionId; // \\u2551 Identifier of the billing subscription that will be charged for the request\\n uint64 initiatedRequests; // \\u2551 The number of requests that have been started\\n uint32 callbackGasLimit; // \\u2551 The amount of gas that the callback to the consuming contract will be given\\n uint16 dataVersion; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The version of the structure of the CBOR encoded request data\\n uint64 completedRequests; // \\u2550\\u2550\\u2550\\u2550\\u2557 The number of requests that have successfully completed or timed out\\n address subscriptionOwner; // \\u2550\\u2550\\u2550\\u255d The owner of the billing subscription\\n }\\n\\n enum FulfillResult {\\n FULFILLED, // 0\\n USER_CALLBACK_ERROR, // 1\\n INVALID_REQUEST_ID, // 2\\n COST_EXCEEDS_COMMITMENT, // 3\\n INSUFFICIENT_GAS_PROVIDED, // 4\\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\\n INVALID_COMMITMENT // 6\\n }\\n\\n struct Commitment {\\n bytes32 requestId; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 A unique identifier for a Chainlink Functions request\\n address coordinator; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 The Coordinator contract that manages the DON that is servicing a request\\n uint96 estimatedTotalCostJuels; // \\u2550\\u2550\\u2550\\u2550\\u255d The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\\n address client; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 The client contract that sent the request\\n uint64 subscriptionId; // \\u2551 Identifier of the billing subscription that will be charged for the request\\n uint32 callbackGasLimit; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The amount of gas that the callback to the consuming contract will be given\\n uint72 adminFee; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\\n uint72 donFee; // \\u2551 Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\\n uint40 gasOverheadBeforeCallback; // \\u2551 Represents the average gas execution cost before the fulfillment callback.\\n uint40 gasOverheadAfterCallback; // \\u2551 Represents the average gas execution cost after the fulfillment callback.\\n uint32 timeoutTimestamp; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The timestamp at which a request will be eligible to be timed out\\n }\\n}\\n\",\"keccak256\":\"0xc72eb037effef32146f7cd4086af00f44f28c8649d891e5e404fec5fda7e802b\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {IFunctionsRouter} from \\\"../v1_0_0/interfaces/IFunctionsRouter.sol\\\";\\nimport {IFunctionsClient} from \\\"../v1_0_0/interfaces/IFunctionsClient.sol\\\";\\n\\nimport {FunctionsRequest} from \\\"../v1_0_0/libraries/FunctionsRequest.sol\\\";\\n\\n/// @title The Chainlink Functions client contract\\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\\nabstract contract FunctionsClient is IFunctionsClient {\\n using FunctionsRequest for FunctionsRequest.Request;\\n\\n IFunctionsRouter internal immutable i_functionsRouter;\\n\\n event RequestSent(bytes32 indexed id);\\n event RequestFulfilled(bytes32 indexed id);\\n\\n error OnlyRouterCanFulfill();\\n\\n constructor(address router) {\\n i_functionsRouter = IFunctionsRouter(router);\\n }\\n\\n /// @notice Sends a Chainlink Functions request\\n /// @param data The CBOR encoded bytes data for a Functions request\\n /// @param subscriptionId The subscription ID that will be charged to service the request\\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\\n /// @return requestId The generated request ID for this request\\n function _sendRequest(\\n bytes memory data,\\n uint64 subscriptionId,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) internal returns (bytes32) {\\n bytes32 requestId = i_functionsRouter.sendRequest(\\n subscriptionId,\\n data,\\n FunctionsRequest.REQUEST_DATA_VERSION,\\n callbackGasLimit,\\n donId\\n );\\n emit RequestSent(requestId);\\n return requestId;\\n }\\n\\n /// @notice User defined function to handle a response from the DON\\n /// @param requestId The request ID, returned by sendRequest()\\n /// @param response Aggregated response from the execution of the user's source code\\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\\n /// @dev Either response or error parameter will be set, but never both\\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\\n\\n /// @inheritdoc IFunctionsClient\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\\n if (msg.sender != address(i_functionsRouter)) {\\n revert OnlyRouterCanFulfill();\\n }\\n _fulfillRequest(requestId, response, err);\\n emit RequestFulfilled(requestId);\\n }\\n}\\n\",\"keccak256\":\"0xdc40f1e9dea8a572d43d310afa68e978c35218d16097b9cfd9d1b6137df3cd0a\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-2-Clause\\npragma solidity ^0.8.4;\\n\\n/**\\n* @dev A library for working with mutable byte buffers in Solidity.\\n*\\n* Byte buffers are mutable and expandable, and provide a variety of primitives\\n* for appending to them. At any time you can fetch a bytes object containing the\\n* current contents of the buffer. The bytes object should not be stored between\\n* operations, as it may change due to resizing of the buffer.\\n*/\\nlibrary Buffer {\\n /**\\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\\n * a capacity. The capacity may be longer than the current value, in\\n * which case it can be extended without the need to allocate more memory.\\n */\\n struct buffer {\\n bytes buf;\\n uint capacity;\\n }\\n\\n /**\\n * @dev Initializes a buffer with an initial capacity.\\n * @param buf The buffer to initialize.\\n * @param capacity The number of bytes of space to allocate the buffer.\\n * @return The buffer, for chaining.\\n */\\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\\n if (capacity % 32 != 0) {\\n capacity += 32 - (capacity % 32);\\n }\\n // Allocate space for the buffer data\\n buf.capacity = capacity;\\n assembly {\\n let ptr := mload(0x40)\\n mstore(buf, ptr)\\n mstore(ptr, 0)\\n let fpm := add(32, add(ptr, capacity))\\n if lt(fpm, ptr) {\\n revert(0, 0)\\n }\\n mstore(0x40, fpm)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Initializes a new buffer from an existing bytes object.\\n * Changes to the buffer may mutate the original value.\\n * @param b The bytes object to initialize the buffer with.\\n * @return A new buffer.\\n */\\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\\n buffer memory buf;\\n buf.buf = b;\\n buf.capacity = b.length;\\n return buf;\\n }\\n\\n function resize(buffer memory buf, uint capacity) private pure {\\n bytes memory oldbuf = buf.buf;\\n init(buf, capacity);\\n append(buf, oldbuf);\\n }\\n\\n /**\\n * @dev Sets buffer length to 0.\\n * @param buf The buffer to truncate.\\n * @return The original buffer, for chaining..\\n */\\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\\n assembly {\\n let bufptr := mload(buf)\\n mstore(bufptr, 0)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to copy.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\\n require(len <= data.length);\\n\\n uint off = buf.buf.length;\\n uint newCapacity = off + len;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint dest;\\n uint src;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Length of existing buffer data\\n let buflen := mload(bufptr)\\n // Start address = buffer address + offset + sizeof(buffer length)\\n dest := add(add(bufptr, 32), off)\\n // Update buffer length if we're extending it\\n if gt(newCapacity, buflen) {\\n mstore(bufptr, newCapacity)\\n }\\n src := add(data, 32)\\n }\\n\\n // Copy word-length chunks while possible\\n for (; len >= 32; len -= 32) {\\n assembly {\\n mstore(dest, mload(src))\\n }\\n dest += 32;\\n src += 32;\\n }\\n\\n // Copy remaining bytes\\n unchecked {\\n uint mask = (256 ** (32 - len)) - 1;\\n assembly {\\n let srcpart := and(mload(src), not(mask))\\n let destpart := and(mload(dest), mask)\\n mstore(dest, or(destpart, srcpart))\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\\n return append(buf, data, data.length);\\n }\\n\\n /**\\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\\n * capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint offPlusOne = off + 1;\\n if (off >= buf.capacity) {\\n resize(buf, offPlusOne * 2);\\n }\\n\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + off\\n let dest := add(add(bufptr, off), 32)\\n mstore8(dest, data)\\n // Update buffer length if we extended it\\n if gt(offPlusOne, mload(bufptr)) {\\n mstore(bufptr, offPlusOne)\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (left-aligned).\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n unchecked {\\n uint mask = (256 ** len) - 1;\\n // Right-align data\\n data = data >> (8 * (32 - len));\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chhaining.\\n */\\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\\n return append(buf, bytes32(data), 20);\\n }\\n\\n /**\\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\\n return append(buf, data, 32);\\n }\\n\\n /**\\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (right-aligned).\\n * @return The original buffer.\\n */\\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint mask = (256 ** len) - 1;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n return buf;\\n }\\n}\",\"keccak256\":\"0x0d86b367813922094e02594a406ba89f5e97d3d74ec2ce3c4032566840e302b0\",\"license\":\"BSD-2-Clause\"},\"@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.4;\\n\\nimport \\\"../../@ensdomains/buffer/v0.1.0/Buffer.sol\\\";\\n\\n/**\\n* @dev A library for populating CBOR encoded payload in Solidity.\\n*\\n* https://datatracker.ietf.org/doc/html/rfc7049\\n*\\n* The library offers various write* and start* methods to encode values of different types.\\n* The resulted buffer can be obtained with data() method.\\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\\n* in an invalid CBOR if start/write/end flow is violated.\\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\\n* except for nested start/end pairs.\\n*/\\n\\nlibrary CBOR {\\n using Buffer for Buffer.buffer;\\n\\n struct CBORBuffer {\\n Buffer.buffer buf;\\n uint256 depth;\\n }\\n\\n uint8 private constant MAJOR_TYPE_INT = 0;\\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\\n uint8 private constant MAJOR_TYPE_BYTES = 2;\\n uint8 private constant MAJOR_TYPE_STRING = 3;\\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\\n uint8 private constant MAJOR_TYPE_MAP = 5;\\n uint8 private constant MAJOR_TYPE_TAG = 6;\\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\\n\\n uint8 private constant TAG_TYPE_BIGNUM = 2;\\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\\n\\n uint8 private constant CBOR_FALSE = 20;\\n uint8 private constant CBOR_TRUE = 21;\\n uint8 private constant CBOR_NULL = 22;\\n uint8 private constant CBOR_UNDEFINED = 23;\\n\\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\\n Buffer.init(cbor.buf, capacity);\\n cbor.depth = 0;\\n return cbor;\\n }\\n\\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\\n require(buf.depth == 0, \\\"Invalid CBOR\\\");\\n return buf.buf.buf;\\n }\\n\\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\\n writeBytes(buf, abi.encode(value));\\n }\\n\\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\\n if (value < 0) {\\n buf.buf.appendUint8(\\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\\n );\\n writeBytes(buf, abi.encode(uint256(-1 - value)));\\n } else {\\n writeUInt256(buf, uint256(value));\\n }\\n }\\n\\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\\n }\\n\\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\\n if(value >= 0) {\\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\\n } else{\\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\\n }\\n }\\n\\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\\n buf.buf.append(value);\\n }\\n\\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\\n buf.buf.append(bytes(value));\\n }\\n\\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\\n }\\n\\n function writeNull(CBORBuffer memory buf) internal pure {\\n writeContentFree(buf, CBOR_NULL);\\n }\\n\\n function writeUndefined(CBORBuffer memory buf) internal pure {\\n writeContentFree(buf, CBOR_UNDEFINED);\\n }\\n\\n function startArray(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\\n buf.depth += 1;\\n }\\n\\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\\n }\\n\\n function startMap(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\\n buf.depth += 1;\\n }\\n\\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\\n }\\n\\n function endSequence(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\\n buf.depth -= 1;\\n }\\n\\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\\n writeString(buf, key);\\n writeString(buf, value);\\n }\\n\\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\\n writeString(buf, key);\\n writeBytes(buf, value);\\n }\\n\\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\\n writeString(buf, key);\\n writeUInt256(buf, value);\\n }\\n\\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\\n writeString(buf, key);\\n writeInt256(buf, value);\\n }\\n\\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\\n writeString(buf, key);\\n writeUInt64(buf, value);\\n }\\n\\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\\n writeString(buf, key);\\n writeInt64(buf, value);\\n }\\n\\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\\n writeString(buf, key);\\n writeBool(buf, value);\\n }\\n\\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n writeNull(buf);\\n }\\n\\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n writeUndefined(buf);\\n }\\n\\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n startMap(buf);\\n }\\n\\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n startArray(buf);\\n }\\n\\n function writeFixedNumeric(\\n CBORBuffer memory buf,\\n uint8 major,\\n uint64 value\\n ) private pure {\\n if (value <= 23) {\\n buf.buf.appendUint8(uint8((major << 5) | value));\\n } else if (value <= 0xFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 24));\\n buf.buf.appendInt(value, 1);\\n } else if (value <= 0xFFFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 25));\\n buf.buf.appendInt(value, 2);\\n } else if (value <= 0xFFFFFFFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 26));\\n buf.buf.appendInt(value, 4);\\n } else {\\n buf.buf.appendUint8(uint8((major << 5) | 27));\\n buf.buf.appendInt(value, 8);\\n }\\n }\\n\\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\\n private\\n pure\\n {\\n buf.buf.appendUint8(uint8((major << 5) | 31));\\n }\\n\\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\\n private\\n pure\\n {\\n writeFixedNumeric(buf, major, length);\\n }\\n\\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\\n }\\n}\",\"keccak256\":\"0xdecf04203502670ac72ba466c75e4f87f4419907365005f0d73e7d07ee3e5715\",\"license\":\"MIT\"},\"contracts/CCExampleClient.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {ICCGatewayClient} from \\\"./interfaces/ICCGatewayClient.sol\\\";\\nimport {ICCGateway} from \\\"./interfaces/ICCGateway.sol\\\";\\n\\ncontract CCExampleClient is ICCGatewayClient {\\n ICCGateway private immutable gateway;\\n\\n uint64 public subscriptionId = 0;\\n bytes public encryptedSecretsReference = \\\"\\\";\\n\\n event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response);\\n event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error);\\n\\n constructor(address gatewayAddress) {\\n gateway = ICCGateway(gatewayAddress);\\n }\\n\\n function updateSubscriptionId(uint64 _subscriptionId) external {\\n subscriptionId = _subscriptionId;\\n }\\n\\n function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external {\\n encryptedSecretsReference = _encryptedSecretsReference;\\n }\\n\\n function request(string[] calldata args, bytes[] calldata bytesArgs) external {\\n require(subscriptionId != 0, \\\"Subscription ID not set\\\");\\n\\n gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference);\\n }\\n\\n function callback(bytes32 requestId) external override {\\n ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true);\\n\\n if (response.state == ICCGatewayClient.CCGResponseState.Success) {\\n emit ResponseReceived(response.subscriptionId, requestId, string(response.data));\\n } else {\\n emit ErrorReceived(response.subscriptionId, requestId, string(response.error));\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf905275976390214962167d4896d9c0eab670fce2b5f5cfd213b1ae2d776347a\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/ICCGateway.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\\nimport {FunctionsRequest} from \\\"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\\\";\\n\\ninterface ICCGateway {\\n struct CCGRequest {\\n string name;\\n uint32 callbackGasLimit;\\n FunctionsRequest.Request config;\\n }\\n\\n /**\\n * @dev Can't register a request with an empty name\\n */\\n error CCGRequestNameEmpty();\\n\\n /**\\n * @dev Only the same source of the requestId is allowed to call the function\\n */\\n error CCGOnlySameSourceAllowed(bytes32 requestId);\\n\\n /**\\n * @dev Only a registered subscriptionId is allowed to call the function\\n */\\n error CCGRequestNotRegistered(uint64 subscriptionId);\\n\\n /**\\n * @dev Can't fulfill a request that has already been fulfilled\\n */\\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\\n\\n /**\\n * @dev Only A manager can call the function\\n */\\n error CCGOnlyManagerAllowed();\\n\\n /**\\n * @dev Send a request to the Functions DON\\n */\\n function sendRequest(\\n uint64 subscriptionId,\\n string[] calldata args,\\n bytes[] calldata bytesArgs,\\n bytes calldata encryptedSecretsReference\\n ) external returns (bytes32 requestId);\\n\\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\\n}\\n\",\"keccak256\":\"0xbc7d92f8db240767c8636e8df9b818cc1f5abfde22b8c49eee50f418fb0dbea5\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/ICCGatewayClient.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\ninterface ICCGatewayClient {\\n enum CCGResponseState {Sent, Success, Error}\\n\\n struct CCGResponse {\\n uint64 subscriptionId;\\n address source;\\n CCGResponseState state;\\n bytes data;\\n bytes error;\\n }\\n\\n function callback(bytes32 requestId) external;\\n}\\n\",\"keccak256\":\"0xb69320aa2152f374dec4cfc70b73f46e0db9774a1411d2acff1481ee3295f86a\",\"license\":\"UNLICENSED\"}},\"version\":1}", + "bytecode": "0x600080546001600160401b031916815560c060405260a090815260019062000028908262000110565b503480156200003657600080fd5b5060405162000d6a38038062000d6a8339810160408190526200005991620001dc565b6001600160a01b03166080526200020e565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200009657607f821691505b602082108103620000b757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200010b57600081815260208120601f850160051c81016020861015620000e65750805b601f850160051c820191505b818110156200010757828155600101620000f2565b5050505b505050565b81516001600160401b038111156200012c576200012c6200006b565b62000144816200013d845462000081565b84620000bd565b602080601f8311600181146200017c5760008415620001635750858301515b600019600386901b1c1916600185901b17855562000107565b600085815260208120601f198616915b82811015620001ad578886015182559484019460019091019084016200018c565b5085821015620001cc5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215620001ef57600080fd5b81516001600160a01b03811681146200020757600080fd5b9392505050565b608051610b39620002316000396000818161023101526102e30152610b396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806309c1ba2e1461006757806314b1dd1b146100975780634ce64f0e146100ca578063cdc634f1146100dd578063cfd58386146100f2578063df13994e14610105575b600080fd5b60005461007a906001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b6100c86100a5366004610415565b6000805467ffffffffffffffff19166001600160401b0392909216919091179055565b005b6100c86100d8366004610439565b610118565b6100e561012a565b60405161008e91906104fa565b6100c8610100366004610558565b6101b8565b6100c86101133660046105c3565b6102c3565b600161012582848361067a565b505050565b60018054610137906105f2565b80601f0160208091040260200160405190810160405280929190818152602001828054610163906105f2565b80156101b05780601f10610185576101008083540402835291602001916101b0565b820191906000526020600020905b81548152906001019060200180831161019357829003601f168201915b505050505081565b600080546001600160401b031690036102175760405162461bcd60e51b815260206004820152601760248201527f537562736372697074696f6e204944206e6f7420736574000000000000000000604482015260640160405180910390fd5b600054604051634b60ac1760e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916396c1582e91610279916001600160401b0316908890889088908890600190600401610824565b6020604051808303816000875af1158015610298573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bc919061090d565b5050505050565b6040516315b851d160e01b815260048101829052600160248201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906315b851d1906044016000604051808303816000875af1158015610334573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261035c91908101906109e9565b905060018160400151600281111561037657610376610abc565b036103c2577fa5522492de1ed169e1e5e76f6cb2ceb5f045ca7f7ea5da3137c573d996cc4b9f81600001518383606001516040516103b693929190610ad2565b60405180910390a15050565b7f331e0adccd60eab7ca94cf49c60a45549ce9dc1281139656a13bdf73774d179c81600001518383608001516040516103b693929190610ad2565b6001600160401b038116811461041257600080fd5b50565b60006020828403121561042757600080fd5b8135610432816103fd565b9392505050565b6000806020838503121561044c57600080fd5b82356001600160401b038082111561046357600080fd5b818501915085601f83011261047757600080fd5b81358181111561048657600080fd5b86602082850101111561049857600080fd5b60209290920196919550909350505050565b60005b838110156104c55781810151838201526020016104ad565b50506000910152565b600081518084526104e68160208601602086016104aa565b601f01601f19169290920160200192915050565b60208152600061043260208301846104ce565b60008083601f84011261051f57600080fd5b5081356001600160401b0381111561053657600080fd5b6020830191508360208260051b850101111561055157600080fd5b9250929050565b6000806000806040858703121561056e57600080fd5b84356001600160401b038082111561058557600080fd5b6105918883890161050d565b909650945060208701359150808211156105aa57600080fd5b506105b78782880161050d565b95989497509550505050565b6000602082840312156105d557600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061060657607f821691505b60208210810361062657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561012557600081815260208120601f850160051c810160208610156106535750805b601f850160051c820191505b818110156106725782815560010161065f565b505050505050565b6001600160401b03831115610691576106916105dc565b6106a58361069f83546105f2565b8361062c565b6000601f8411600181146106d957600085156106c15750838201355b600019600387901b1c1916600186901b1783556102bc565b600083815260209020601f19861690835b8281101561070a57868501358255602094850194600190920191016106ea565b50868210156107275760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000808335601e1984360301811261077957600080fd5b83016020810192503590506001600160401b0381111561079857600080fd5b80360382131561055157600080fd5b600081546107b4816105f2565b8085526020600183811680156107d157600181146107eb57610819565b60ff1985168884015283151560051b880183019550610819565b866000528260002060005b858110156108115781548a82018601529083019084016107f6565b890184019650505b505050505092915050565b6000608082016001600160401b038916835260206080818501528188835260a08501905060a08960051b86010192508960005b8a81101561089157868503609f19018352610872828d610762565b61087d878284610739565b965050509183019190830190600101610857565b5050508382036040850152858252808201600587901b830182018860005b898110156108e957858303601f190184526108ca828c610762565b6108d5858284610739565b9587019594505050908401906001016108af565b505085810360608701526108fd81886107a7565b9c9b505050505050505050505050565b60006020828403121561091f57600080fd5b5051919050565b60405160a081016001600160401b0381118282101715610948576109486105dc565b60405290565b80516003811061095d57600080fd5b919050565b600082601f83011261097357600080fd5b81516001600160401b038082111561098d5761098d6105dc565b604051601f8301601f19908116603f011681019082821181831017156109b5576109b56105dc565b816040528381528660208588010111156109ce57600080fd5b6109df8460208301602089016104aa565b9695505050505050565b6000602082840312156109fb57600080fd5b81516001600160401b0380821115610a1257600080fd5b9083019060a08286031215610a2657600080fd5b610a2e610926565b8251610a39816103fd565b815260208301516001600160a01b0381168114610a5557600080fd5b6020820152610a666040840161094e565b6040820152606083015182811115610a7d57600080fd5b610a8987828601610962565b606083015250608083015182811115610aa157600080fd5b610aad87828601610962565b60808301525095945050505050565b634e487b7160e01b600052602160045260246000fd5b6001600160401b0384168152826020820152606060408201526000610afa60608301846104ce565b9594505050505056fea26469706673582212209c23a4aa128701447d0247b6e250fc1aeb5f0bdf6334f1ef0fdcdc125482ae6a64736f6c63430008140033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100625760003560e01c806309c1ba2e1461006757806314b1dd1b146100975780634ce64f0e146100ca578063cdc634f1146100dd578063cfd58386146100f2578063df13994e14610105575b600080fd5b60005461007a906001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b6100c86100a5366004610415565b6000805467ffffffffffffffff19166001600160401b0392909216919091179055565b005b6100c86100d8366004610439565b610118565b6100e561012a565b60405161008e91906104fa565b6100c8610100366004610558565b6101b8565b6100c86101133660046105c3565b6102c3565b600161012582848361067a565b505050565b60018054610137906105f2565b80601f0160208091040260200160405190810160405280929190818152602001828054610163906105f2565b80156101b05780601f10610185576101008083540402835291602001916101b0565b820191906000526020600020905b81548152906001019060200180831161019357829003601f168201915b505050505081565b600080546001600160401b031690036102175760405162461bcd60e51b815260206004820152601760248201527f537562736372697074696f6e204944206e6f7420736574000000000000000000604482015260640160405180910390fd5b600054604051634b60ac1760e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916396c1582e91610279916001600160401b0316908890889088908890600190600401610824565b6020604051808303816000875af1158015610298573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bc919061090d565b5050505050565b6040516315b851d160e01b815260048101829052600160248201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906315b851d1906044016000604051808303816000875af1158015610334573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261035c91908101906109e9565b905060018160400151600281111561037657610376610abc565b036103c2577fa5522492de1ed169e1e5e76f6cb2ceb5f045ca7f7ea5da3137c573d996cc4b9f81600001518383606001516040516103b693929190610ad2565b60405180910390a15050565b7f331e0adccd60eab7ca94cf49c60a45549ce9dc1281139656a13bdf73774d179c81600001518383608001516040516103b693929190610ad2565b6001600160401b038116811461041257600080fd5b50565b60006020828403121561042757600080fd5b8135610432816103fd565b9392505050565b6000806020838503121561044c57600080fd5b82356001600160401b038082111561046357600080fd5b818501915085601f83011261047757600080fd5b81358181111561048657600080fd5b86602082850101111561049857600080fd5b60209290920196919550909350505050565b60005b838110156104c55781810151838201526020016104ad565b50506000910152565b600081518084526104e68160208601602086016104aa565b601f01601f19169290920160200192915050565b60208152600061043260208301846104ce565b60008083601f84011261051f57600080fd5b5081356001600160401b0381111561053657600080fd5b6020830191508360208260051b850101111561055157600080fd5b9250929050565b6000806000806040858703121561056e57600080fd5b84356001600160401b038082111561058557600080fd5b6105918883890161050d565b909650945060208701359150808211156105aa57600080fd5b506105b78782880161050d565b95989497509550505050565b6000602082840312156105d557600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061060657607f821691505b60208210810361062657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561012557600081815260208120601f850160051c810160208610156106535750805b601f850160051c820191505b818110156106725782815560010161065f565b505050505050565b6001600160401b03831115610691576106916105dc565b6106a58361069f83546105f2565b8361062c565b6000601f8411600181146106d957600085156106c15750838201355b600019600387901b1c1916600186901b1783556102bc565b600083815260209020601f19861690835b8281101561070a57868501358255602094850194600190920191016106ea565b50868210156107275760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000808335601e1984360301811261077957600080fd5b83016020810192503590506001600160401b0381111561079857600080fd5b80360382131561055157600080fd5b600081546107b4816105f2565b8085526020600183811680156107d157600181146107eb57610819565b60ff1985168884015283151560051b880183019550610819565b866000528260002060005b858110156108115781548a82018601529083019084016107f6565b890184019650505b505050505092915050565b6000608082016001600160401b038916835260206080818501528188835260a08501905060a08960051b86010192508960005b8a81101561089157868503609f19018352610872828d610762565b61087d878284610739565b965050509183019190830190600101610857565b5050508382036040850152858252808201600587901b830182018860005b898110156108e957858303601f190184526108ca828c610762565b6108d5858284610739565b9587019594505050908401906001016108af565b505085810360608701526108fd81886107a7565b9c9b505050505050505050505050565b60006020828403121561091f57600080fd5b5051919050565b60405160a081016001600160401b0381118282101715610948576109486105dc565b60405290565b80516003811061095d57600080fd5b919050565b600082601f83011261097357600080fd5b81516001600160401b038082111561098d5761098d6105dc565b604051601f8301601f19908116603f011681019082821181831017156109b5576109b56105dc565b816040528381528660208588010111156109ce57600080fd5b6109df8460208301602089016104aa565b9695505050505050565b6000602082840312156109fb57600080fd5b81516001600160401b0380821115610a1257600080fd5b9083019060a08286031215610a2657600080fd5b610a2e610926565b8251610a39816103fd565b815260208301516001600160a01b0381168114610a5557600080fd5b6020820152610a666040840161094e565b6040820152606083015182811115610a7d57600080fd5b610a8987828601610962565b606083015250608083015182811115610aa157600080fd5b610aad87828601610962565b60808301525095945050505050565b634e487b7160e01b600052602160045260246000fd5b6001600160401b0384168152826020820152606060408201526000610afa60608301846104ce565b9594505050505056fea26469706673582212209c23a4aa128701447d0247b6e250fc1aeb5f0bdf6334f1ef0fdcdc125482ae6a64736f6c63430008140033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 2081, + "contract": "contracts/CCExampleClient.sol:CCExampleClient", + "label": "subscriptionId", + "offset": 0, + "slot": "0", + "type": "t_uint64" + }, + { + "astId": 2084, + "contract": "contracts/CCExampleClient.sol:CCExampleClient", + "label": "encryptedSecretsReference", + "offset": 0, + "slot": "1", + "type": "t_bytes_storage" + } + ], + "types": { + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_uint64": { + "encoding": "inplace", + "label": "uint64", + "numberOfBytes": "8" + } + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/optimismSepolia/CCGateway.json b/packages/hardhat/deployments/optimismSepolia/CCGateway.json new file mode 100644 index 0000000..6350ee4 --- /dev/null +++ b/packages/hardhat/deployments/optimismSepolia/CCGateway.json @@ -0,0 +1,1132 @@ +{ + "address": "0x0910A0FE7881D332230Ce1FB7f2BaA1Ebe527473", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "router", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "initialDonId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AccessControlBadConfirmation", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "neededRole", + "type": "bytes32" + } + ], + "name": "AccessControlUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [], + "name": "CCGOnlyManagerAllowed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + } + ], + "name": "CCGOnlySameSourceAllowed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + } + ], + "name": "CCGRequestAlreadyFulfilled", + "type": "error" + }, + { + "inputs": [], + "name": "CCGRequestNameEmpty", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + } + ], + "name": "CCGRequestNotRegistered", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyArgs", + "type": "error" + }, + { + "inputs": [], + "name": "EmptySource", + "type": "error" + }, + { + "inputs": [], + "name": "NoInlineSecrets", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyRouterCanFulfill", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "RequestFulfilled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "RequestSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "CLIENT_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MANAGER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "donId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + } + ], + "name": "getRequest", + "outputs": [ + { + "components": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "uint32", + "name": "callbackGasLimit", + "type": "uint32" + }, + { + "components": [ + { + "internalType": "enum FunctionsRequest.Location", + "name": "codeLocation", + "type": "uint8" + }, + { + "internalType": "enum FunctionsRequest.Location", + "name": "secretsLocation", + "type": "uint8" + }, + { + "internalType": "enum FunctionsRequest.CodeLanguage", + "name": "language", + "type": "uint8" + }, + { + "internalType": "string", + "name": "source", + "type": "string" + }, + { + "internalType": "bytes", + "name": "encryptedSecretsReference", + "type": "bytes" + }, + { + "internalType": "string[]", + "name": "args", + "type": "string[]" + }, + { + "internalType": "bytes[]", + "name": "bytesArgs", + "type": "bytes[]" + } + ], + "internalType": "struct FunctionsRequest.Request", + "name": "config", + "type": "tuple" + } + ], + "internalType": "struct ICCGateway.CCGRequest", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "remove", + "type": "bool" + } + ], + "name": "getResponse", + "outputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "internalType": "address", + "name": "source", + "type": "address" + }, + { + "internalType": "enum ICCGatewayClient.CCGResponseState", + "name": "state", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "error", + "type": "bytes" + } + ], + "internalType": "struct ICCGatewayClient.CCGResponse", + "name": "response", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "response", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "err", + "type": "bytes" + } + ], + "name": "handleOracleFulfillment", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "internalType": "enum FunctionsRequest.Location", + "name": "codeLocation", + "type": "uint8" + }, + { + "internalType": "string", + "name": "source", + "type": "string" + }, + { + "internalType": "enum FunctionsRequest.Location", + "name": "secretsLocation", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "encryptedSecretsReference", + "type": "bytes" + }, + { + "internalType": "uint32", + "name": "callbackGasLimit", + "type": "uint32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "registerRequest", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + } + ], + "name": "removeRequest", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "callerConfirmation", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "internalType": "string[]", + "name": "args", + "type": "string[]" + }, + { + "internalType": "bytes[]", + "name": "bytesArgs", + "type": "bytes[]" + }, + { + "internalType": "bytes", + "name": "encryptedSecretsReference", + "type": "bytes" + } + ], + "name": "sendRequest", + "outputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "newDonId", + "type": "bytes32" + } + ], + "name": "setDonId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "subscriptions", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0xcb7760828bb4acac5b886e1c5538c667b3ebc314080be303fe0ec31cb64dffe3", + "receipt": { + "to": null, + "from": "0xD10F43A0aa00D244DAcFBE3C49b9B918B717Ff2c", + "contractAddress": "0x0910A0FE7881D332230Ce1FB7f2BaA1Ebe527473", + "transactionIndex": 2, + "gasUsed": "2640011", + "logsBloom": "0x00000204000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000020000000004000008000800000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000020000000000000000000080000100400000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x091b88898ba98980029bad600ae018db46c5c8a597e4cab252d46ed989331611", + "transactionHash": "0xcb7760828bb4acac5b886e1c5538c667b3ebc314080be303fe0ec31cb64dffe3", + "logs": [ + { + "transactionIndex": 2, + "blockNumber": 12753057, + "transactionHash": "0xcb7760828bb4acac5b886e1c5538c667b3ebc314080be303fe0ec31cb64dffe3", + "address": "0x0910A0FE7881D332230Ce1FB7f2BaA1Ebe527473", + "topics": [ + "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000d10f43a0aa00d244dacfbe3c49b9b918b717ff2c", + "0x000000000000000000000000d10f43a0aa00d244dacfbe3c49b9b918b717ff2c" + ], + "data": "0x", + "logIndex": 9, + "blockHash": "0x091b88898ba98980029bad600ae018db46c5c8a597e4cab252d46ed989331611" + }, + { + "transactionIndex": 2, + "blockNumber": 12753057, + "transactionHash": "0xcb7760828bb4acac5b886e1c5538c667b3ebc314080be303fe0ec31cb64dffe3", + "address": "0x0910A0FE7881D332230Ce1FB7f2BaA1Ebe527473", + "topics": [ + "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", + "0x241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08", + "0x000000000000000000000000d10f43a0aa00d244dacfbe3c49b9b918b717ff2c", + "0x000000000000000000000000d10f43a0aa00d244dacfbe3c49b9b918b717ff2c" + ], + "data": "0x", + "logIndex": 10, + "blockHash": "0x091b88898ba98980029bad600ae018db46c5c8a597e4cab252d46ed989331611" + } + ], + "blockNumber": 12753057, + "cumulativeGasUsed": "3076137", + "status": 1, + "byzantium": true + }, + "args": [ + "0xC17094E3A1348E5C7544D4fF8A36c28f2C6AAE28", + "0x66756e2d6f7074696d69736d2d7365706f6c69612d3100000000000000000000", + "0xD10F43A0aa00D244DAcFBE3C49b9B918B717Ff2c" + ], + "numDeployments": 3, + "solcInputHash": "be18bfdeea6869d68a166c8869814257", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"initialDonId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"initialOwner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AccessControlBadConfirmation\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"neededRole\",\"type\":\"bytes32\"}],\"name\":\"AccessControlUnauthorizedAccount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CCGOnlyManagerAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"CCGOnlySameSourceAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"CCGRequestAlreadyFulfilled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CCGRequestNameEmpty\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"}],\"name\":\"CCGRequestNotRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EmptyArgs\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EmptySource\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoInlineSecrets\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyRouterCanFulfill\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"RequestFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"RequestSent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"CLIENT_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MANAGER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"donId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"}],\"name\":\"getRequest\",\"outputs\":[{\"components\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"components\":[{\"internalType\":\"enum FunctionsRequest.Location\",\"name\":\"codeLocation\",\"type\":\"uint8\"},{\"internalType\":\"enum FunctionsRequest.Location\",\"name\":\"secretsLocation\",\"type\":\"uint8\"},{\"internalType\":\"enum FunctionsRequest.CodeLanguage\",\"name\":\"language\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"source\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"encryptedSecretsReference\",\"type\":\"bytes\"},{\"internalType\":\"string[]\",\"name\":\"args\",\"type\":\"string[]\"},{\"internalType\":\"bytes[]\",\"name\":\"bytesArgs\",\"type\":\"bytes[]\"}],\"internalType\":\"struct FunctionsRequest.Request\",\"name\":\"config\",\"type\":\"tuple\"}],\"internalType\":\"struct ICCGateway.CCGRequest\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"remove\",\"type\":\"bool\"}],\"name\":\"getResponse\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"source\",\"type\":\"address\"},{\"internalType\":\"enum ICCGatewayClient.CCGResponseState\",\"name\":\"state\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"error\",\"type\":\"bytes\"}],\"internalType\":\"struct ICCGatewayClient.CCGResponse\",\"name\":\"response\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"response\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"err\",\"type\":\"bytes\"}],\"name\":\"handleOracleFulfillment\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"internalType\":\"enum FunctionsRequest.Location\",\"name\":\"codeLocation\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"source\",\"type\":\"string\"},{\"internalType\":\"enum FunctionsRequest.Location\",\"name\":\"secretsLocation\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"encryptedSecretsReference\",\"type\":\"bytes\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"registerRequest\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"}],\"name\":\"removeRequest\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"callerConfirmation\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"internalType\":\"string[]\",\"name\":\"args\",\"type\":\"string[]\"},{\"internalType\":\"bytes[]\",\"name\":\"bytesArgs\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"encryptedSecretsReference\",\"type\":\"bytes\"}],\"name\":\"sendRequest\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"newDonId\",\"type\":\"bytes32\"}],\"name\":\"setDonId\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"subscriptions\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"AccessControlBadConfirmation()\":[{\"details\":\"The caller of a function is not the expected one. NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\"}],\"AccessControlUnauthorizedAccount(address,bytes32)\":[{\"details\":\"The `account` is missing a role.\"}],\"CCGOnlyManagerAllowed()\":[{\"details\":\"Only A manager can call the function\"}],\"CCGOnlySameSourceAllowed(bytes32)\":[{\"details\":\"Only the same source of the requestId is allowed to call the function\"}],\"CCGRequestAlreadyFulfilled(bytes32)\":[{\"details\":\"Can't fulfill a request that has already been fulfilled\"}],\"CCGRequestNameEmpty()\":[{\"details\":\"Can't register a request with an empty name\"}],\"CCGRequestNotRegistered(uint64)\":[{\"details\":\"Only a registered subscriptionId is allowed to call the function\"}]},\"events\":{\"RoleAdminChanged(bytes32,bytes32,bytes32)\":{\"details\":\"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this.\"},\"RoleGranted(bytes32,address,address)\":{\"details\":\"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.\"},\"RoleRevoked(bytes32,address,address)\":{\"details\":\"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)\"}},\"kind\":\"dev\",\"methods\":{\"donId()\":{\"details\":\"Get the DON ID\",\"returns\":{\"_0\":\"DON ID\"}},\"getResponse(bytes32,bool)\":{\"details\":\"Get the response data\",\"params\":{\"requestId\":\"The request ID, returned by sendRequest()\"},\"returns\":{\"response\":\"CCGResponse\"}},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"handleOracleFulfillment(bytes32,bytes,bytes)\":{\"details\":\"Either response or error parameter will be set, but never both.\",\"params\":{\"err\":\"Aggregated error either from the request's source code or from the execution pipeline.\",\"requestId\":\"The requestId returned by FunctionsClient.sendRequest().\",\"response\":\"Aggregated response from the request's source code.\"}},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `callerConfirmation`. May emit a {RoleRevoked} event.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"sendRequest(uint64,string[],bytes[],bytes)\":{\"params\":{\"args\":\"String arguments passed into the source code and accessible via the global variable `args`\",\"bytesArgs\":\"Bytes arguments passed into the source code and accessible via the global variable `bytesArgs` as hex strings\",\"encryptedSecretsReference\":\"Reference pointing to encrypted secrets\",\"subscriptionId\":\"Subscription ID used to pay for request (FunctionsConsumer contract address must first be added to the subscription)\"}},\"setDonId(bytes32)\":{\"details\":\"Set the DON ID\",\"params\":{\"newDonId\":\"New DON ID\"}},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"handleOracleFulfillment(bytes32,bytes,bytes)\":{\"notice\":\"Chainlink Functions response handler called by the Functions Router during fullilment from the designated transmitter node in an OCR round.\"},\"sendRequest(uint64,string[],bytes[],bytes)\":{\"notice\":\"Triggers an on-demand Functions request using remote encrypted secrets\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/CCGateway.sol\":\"CCGateway\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {IFunctionsRouter} from \\\"./interfaces/IFunctionsRouter.sol\\\";\\nimport {IFunctionsClient} from \\\"./interfaces/IFunctionsClient.sol\\\";\\n\\nimport {FunctionsRequest} from \\\"./libraries/FunctionsRequest.sol\\\";\\n\\n/// @title The Chainlink Functions client contract\\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\\nabstract contract FunctionsClient is IFunctionsClient {\\n using FunctionsRequest for FunctionsRequest.Request;\\n\\n IFunctionsRouter internal immutable i_router;\\n\\n event RequestSent(bytes32 indexed id);\\n event RequestFulfilled(bytes32 indexed id);\\n\\n error OnlyRouterCanFulfill();\\n\\n constructor(address router) {\\n i_router = IFunctionsRouter(router);\\n }\\n\\n /// @notice Sends a Chainlink Functions request\\n /// @param data The CBOR encoded bytes data for a Functions request\\n /// @param subscriptionId The subscription ID that will be charged to service the request\\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\\n /// @return requestId The generated request ID for this request\\n function _sendRequest(\\n bytes memory data,\\n uint64 subscriptionId,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) internal returns (bytes32) {\\n bytes32 requestId = i_router.sendRequest(\\n subscriptionId,\\n data,\\n FunctionsRequest.REQUEST_DATA_VERSION,\\n callbackGasLimit,\\n donId\\n );\\n emit RequestSent(requestId);\\n return requestId;\\n }\\n\\n /// @notice User defined function to handle a response from the DON\\n /// @param requestId The request ID, returned by sendRequest()\\n /// @param response Aggregated response from the execution of the user's source code\\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\\n /// @dev Either response or error parameter will be set, but never both\\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\\n\\n /// @inheritdoc IFunctionsClient\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\\n if (msg.sender != address(i_router)) {\\n revert OnlyRouterCanFulfill();\\n }\\n fulfillRequest(requestId, response, err);\\n emit RequestFulfilled(requestId);\\n }\\n}\\n\",\"keccak256\":\"0x40224641403cb9fa03d4f060296d7420a9ff11b46abadc958ae048459205e397\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\n/// @title Chainlink Functions client interface.\\ninterface IFunctionsClient {\\n /// @notice Chainlink Functions response handler called by the Functions Router\\n /// during fullilment from the designated transmitter node in an OCR round.\\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\\n /// @param response Aggregated response from the request's source code.\\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\\n /// @dev Either response or error parameter will be set, but never both.\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\\n}\\n\",\"keccak256\":\"0x6117b82e7c4eec44ce557b0fc8bc1ac5f49e5d160ac6d4485452d6aafdd762ff\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {FunctionsResponse} from \\\"../libraries/FunctionsResponse.sol\\\";\\n\\n/// @title Chainlink Functions Router interface.\\ninterface IFunctionsRouter {\\n /// @notice The identifier of the route to retrieve the address of the access control contract\\n /// The access control contract controls which accounts can manage subscriptions\\n /// @return id - bytes32 id that can be passed to the \\\"getContractById\\\" of the Router\\n function getAllowListId() external view returns (bytes32);\\n\\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\\n /// The access control contract controls which accounts can manage subscriptions\\n function setAllowListId(bytes32 allowListId) external;\\n\\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\\n /// @return adminFee\\n function getAdminFee() external view returns (uint72 adminFee);\\n\\n /// @notice Sends a request using the provided subscriptionId\\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\\n /// a client can make requests from different contracts referencing the same subscription\\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\\n /// @param dataVersion - Gas limit for the fulfillment callback\\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\\n /// @param donId - An identifier used to determine which route to send the request along\\n /// @return requestId - A unique request identifier\\n function sendRequest(\\n uint64 subscriptionId,\\n bytes calldata data,\\n uint16 dataVersion,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) external returns (bytes32);\\n\\n /// @notice Sends a request to the proposed contracts\\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\\n /// a client can make requests from different contracts referencing the same subscription\\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\\n /// @param dataVersion - Gas limit for the fulfillment callback\\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\\n /// @param donId - An identifier used to determine which route to send the request along\\n /// @return requestId - A unique request identifier\\n function sendRequestToProposed(\\n uint64 subscriptionId,\\n bytes calldata data,\\n uint16 dataVersion,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) external returns (bytes32);\\n\\n /// @notice Fulfill the request by:\\n /// - calling back the data that the Oracle returned to the client contract\\n /// - pay the DON for processing the request\\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\\n /// @param response response data from DON consensus\\n /// @param err error from DON consensus\\n /// @param juelsPerGas - current rate of juels/gas\\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\\n /// @param transmitter - The Node that transmitted the OCR report\\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\\n /// @return fulfillResult -\\n /// @return callbackGasCostJuels -\\n function fulfill(\\n bytes memory response,\\n bytes memory err,\\n uint96 juelsPerGas,\\n uint96 costWithoutFulfillment,\\n address transmitter,\\n FunctionsResponse.Commitment memory commitment\\n ) external returns (FunctionsResponse.FulfillResult, uint96);\\n\\n /// @notice Validate requested gas limit is below the subscription max.\\n /// @param subscriptionId subscription ID\\n /// @param callbackGasLimit desired callback gas limit\\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\\n\\n /// @notice Get the current contract given an ID\\n /// @param id A bytes32 identifier for the route\\n /// @return contract The current contract address\\n function getContractById(bytes32 id) external view returns (address);\\n\\n /// @notice Get the proposed next contract given an ID\\n /// @param id A bytes32 identifier for the route\\n /// @return contract The current or proposed contract address\\n function getProposedContractById(bytes32 id) external view returns (address);\\n\\n /// @notice Return the latest proprosal set\\n /// @return ids The identifiers of the contracts to update\\n /// @return to The addresses of the contracts that will be updated to\\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\\n\\n /// @notice Proposes one or more updates to the contract routes\\n /// @dev Only callable by owner\\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\\n\\n /// @notice Updates the current contract routes to the proposed contracts\\n /// @dev Only callable by owner\\n function updateContracts() external;\\n\\n /// @dev Puts the system into an emergency stopped state.\\n /// @dev Only callable by owner\\n function pause() external;\\n\\n /// @dev Takes the system out of an emergency stopped state.\\n /// @dev Only callable by owner\\n function unpause() external;\\n}\\n\",\"keccak256\":\"0x44db41e8ff90c2828ca0ada125abc4b411921a86514a4a047fd9fd43ba9d7e08\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {CBOR} from \\\"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\\\";\\n\\n/// @title Library for encoding the input data of a Functions request into CBOR\\nlibrary FunctionsRequest {\\n using CBOR for CBOR.CBORBuffer;\\n\\n uint16 public constant REQUEST_DATA_VERSION = 1;\\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\\n\\n enum Location {\\n Inline, // Provided within the Request\\n Remote, // Hosted through remote location that can be accessed through a provided URL\\n DONHosted // Hosted on the DON's storage\\n }\\n\\n enum CodeLanguage {\\n JavaScript\\n // In future version we may add other languages\\n }\\n\\n struct Request {\\n Location codeLocation; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The location of the source code that will be executed on each node in the DON\\n Location secretsLocation; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The location of secrets that will be passed into the source code. *Only Remote secrets are supported\\n CodeLanguage language; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The coding language that the source code is written in\\n string source; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\\n bytes encryptedSecretsReference; // \\u2550\\u2550\\u2578 Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\\n string[] args; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 String arguments that will be passed into the source code\\n bytes[] bytesArgs; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Bytes arguments that will be passed into the source code\\n }\\n\\n error EmptySource();\\n error EmptySecrets();\\n error EmptyArgs();\\n error NoInlineSecrets();\\n\\n /// @notice Encodes a Request to CBOR encoded bytes\\n /// @param self The request to encode\\n /// @return CBOR encoded bytes\\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\\n\\n buffer.writeString(\\\"codeLocation\\\");\\n buffer.writeUInt256(uint256(self.codeLocation));\\n\\n buffer.writeString(\\\"language\\\");\\n buffer.writeUInt256(uint256(self.language));\\n\\n buffer.writeString(\\\"source\\\");\\n buffer.writeString(self.source);\\n\\n if (self.args.length > 0) {\\n buffer.writeString(\\\"args\\\");\\n buffer.startArray();\\n for (uint256 i = 0; i < self.args.length; ++i) {\\n buffer.writeString(self.args[i]);\\n }\\n buffer.endSequence();\\n }\\n\\n if (self.encryptedSecretsReference.length > 0) {\\n if (self.secretsLocation == Location.Inline) {\\n revert NoInlineSecrets();\\n }\\n buffer.writeString(\\\"secretsLocation\\\");\\n buffer.writeUInt256(uint256(self.secretsLocation));\\n buffer.writeString(\\\"secrets\\\");\\n buffer.writeBytes(self.encryptedSecretsReference);\\n }\\n\\n if (self.bytesArgs.length > 0) {\\n buffer.writeString(\\\"bytesArgs\\\");\\n buffer.startArray();\\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\\n buffer.writeBytes(self.bytesArgs[i]);\\n }\\n buffer.endSequence();\\n }\\n\\n return buffer.buf.buf;\\n }\\n\\n /// @notice Initializes a Chainlink Functions Request\\n /// @dev Sets the codeLocation and code on the request\\n /// @param self The uninitialized request\\n /// @param codeLocation The user provided source code location\\n /// @param language The programming language of the user code\\n /// @param source The user provided source code or a url\\n function initializeRequest(\\n Request memory self,\\n Location codeLocation,\\n CodeLanguage language,\\n string memory source\\n ) internal pure {\\n if (bytes(source).length == 0) revert EmptySource();\\n\\n self.codeLocation = codeLocation;\\n self.language = language;\\n self.source = source;\\n }\\n\\n /// @notice Initializes a Chainlink Functions Request\\n /// @dev Simplified version of initializeRequest for PoC\\n /// @param self The uninitialized request\\n /// @param javaScriptSource The user provided JS code (must not be empty)\\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\\n }\\n\\n /// @notice Adds Remote user encrypted secrets to a Request\\n /// @param self The initialized request\\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\\n\\n self.secretsLocation = Location.Remote;\\n self.encryptedSecretsReference = encryptedSecretsReference;\\n }\\n\\n /// @notice Adds DON-hosted secrets reference to a Request\\n /// @param self The initialized request\\n /// @param slotID Slot ID of the user's secrets hosted on DON\\n /// @param version User data version (for the slotID)\\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\\n\\n buffer.writeString(\\\"slotID\\\");\\n buffer.writeUInt64(slotID);\\n buffer.writeString(\\\"version\\\");\\n buffer.writeUInt64(version);\\n\\n self.secretsLocation = Location.DONHosted;\\n self.encryptedSecretsReference = buffer.buf.buf;\\n }\\n\\n /// @notice Sets args for the user run function\\n /// @param self The initialized request\\n /// @param args The array of string args (must not be empty)\\n function setArgs(Request memory self, string[] memory args) internal pure {\\n if (args.length == 0) revert EmptyArgs();\\n\\n self.args = args;\\n }\\n\\n /// @notice Sets bytes args for the user run function\\n /// @param self The initialized request\\n /// @param args The array of bytes args (must not be empty)\\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\\n if (args.length == 0) revert EmptyArgs();\\n\\n self.bytesArgs = args;\\n }\\n}\\n\",\"keccak256\":\"0xed75be0eaba358d468f1fe18adc377d5044f57eff0070081f884a1f212d0adc2\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\n/// @title Library of types that are used for fulfillment of a Functions request\\nlibrary FunctionsResponse {\\n // Used to send request information from the Router to the Coordinator\\n struct RequestMeta {\\n bytes data; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\\n bytes32 flags; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Per-subscription flags\\n address requestingContract; // \\u2550\\u2550\\u2557 The client contract that is sending the request\\n uint96 availableBalance; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u255d Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\\n uint72 adminFee; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\\n uint64 subscriptionId; // \\u2551 Identifier of the billing subscription that will be charged for the request\\n uint64 initiatedRequests; // \\u2551 The number of requests that have been started\\n uint32 callbackGasLimit; // \\u2551 The amount of gas that the callback to the consuming contract will be given\\n uint16 dataVersion; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The version of the structure of the CBOR encoded request data\\n uint64 completedRequests; // \\u2550\\u2550\\u2550\\u2550\\u2557 The number of requests that have successfully completed or timed out\\n address subscriptionOwner; // \\u2550\\u2550\\u2550\\u255d The owner of the billing subscription\\n }\\n\\n enum FulfillResult {\\n FULFILLED, // 0\\n USER_CALLBACK_ERROR, // 1\\n INVALID_REQUEST_ID, // 2\\n COST_EXCEEDS_COMMITMENT, // 3\\n INSUFFICIENT_GAS_PROVIDED, // 4\\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\\n INVALID_COMMITMENT // 6\\n }\\n\\n struct Commitment {\\n bytes32 requestId; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 A unique identifier for a Chainlink Functions request\\n address coordinator; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 The Coordinator contract that manages the DON that is servicing a request\\n uint96 estimatedTotalCostJuels; // \\u2550\\u2550\\u2550\\u2550\\u255d The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\\n address client; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 The client contract that sent the request\\n uint64 subscriptionId; // \\u2551 Identifier of the billing subscription that will be charged for the request\\n uint32 callbackGasLimit; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The amount of gas that the callback to the consuming contract will be given\\n uint72 adminFee; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\\n uint72 donFee; // \\u2551 Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\\n uint40 gasOverheadBeforeCallback; // \\u2551 Represents the average gas execution cost before the fulfillment callback.\\n uint40 gasOverheadAfterCallback; // \\u2551 Represents the average gas execution cost after the fulfillment callback.\\n uint32 timeoutTimestamp; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The timestamp at which a request will be eligible to be timed out\\n }\\n}\\n\",\"keccak256\":\"0xc72eb037effef32146f7cd4086af00f44f28c8649d891e5e404fec5fda7e802b\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {IFunctionsRouter} from \\\"../v1_0_0/interfaces/IFunctionsRouter.sol\\\";\\nimport {IFunctionsClient} from \\\"../v1_0_0/interfaces/IFunctionsClient.sol\\\";\\n\\nimport {FunctionsRequest} from \\\"../v1_0_0/libraries/FunctionsRequest.sol\\\";\\n\\n/// @title The Chainlink Functions client contract\\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\\nabstract contract FunctionsClient is IFunctionsClient {\\n using FunctionsRequest for FunctionsRequest.Request;\\n\\n IFunctionsRouter internal immutable i_functionsRouter;\\n\\n event RequestSent(bytes32 indexed id);\\n event RequestFulfilled(bytes32 indexed id);\\n\\n error OnlyRouterCanFulfill();\\n\\n constructor(address router) {\\n i_functionsRouter = IFunctionsRouter(router);\\n }\\n\\n /// @notice Sends a Chainlink Functions request\\n /// @param data The CBOR encoded bytes data for a Functions request\\n /// @param subscriptionId The subscription ID that will be charged to service the request\\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\\n /// @return requestId The generated request ID for this request\\n function _sendRequest(\\n bytes memory data,\\n uint64 subscriptionId,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) internal returns (bytes32) {\\n bytes32 requestId = i_functionsRouter.sendRequest(\\n subscriptionId,\\n data,\\n FunctionsRequest.REQUEST_DATA_VERSION,\\n callbackGasLimit,\\n donId\\n );\\n emit RequestSent(requestId);\\n return requestId;\\n }\\n\\n /// @notice User defined function to handle a response from the DON\\n /// @param requestId The request ID, returned by sendRequest()\\n /// @param response Aggregated response from the execution of the user's source code\\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\\n /// @dev Either response or error parameter will be set, but never both\\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\\n\\n /// @inheritdoc IFunctionsClient\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\\n if (msg.sender != address(i_functionsRouter)) {\\n revert OnlyRouterCanFulfill();\\n }\\n _fulfillRequest(requestId, response, err);\\n emit RequestFulfilled(requestId);\\n }\\n}\\n\",\"keccak256\":\"0xdc40f1e9dea8a572d43d310afa68e978c35218d16097b9cfd9d1b6137df3cd0a\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-2-Clause\\npragma solidity ^0.8.4;\\n\\n/**\\n* @dev A library for working with mutable byte buffers in Solidity.\\n*\\n* Byte buffers are mutable and expandable, and provide a variety of primitives\\n* for appending to them. At any time you can fetch a bytes object containing the\\n* current contents of the buffer. The bytes object should not be stored between\\n* operations, as it may change due to resizing of the buffer.\\n*/\\nlibrary Buffer {\\n /**\\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\\n * a capacity. The capacity may be longer than the current value, in\\n * which case it can be extended without the need to allocate more memory.\\n */\\n struct buffer {\\n bytes buf;\\n uint capacity;\\n }\\n\\n /**\\n * @dev Initializes a buffer with an initial capacity.\\n * @param buf The buffer to initialize.\\n * @param capacity The number of bytes of space to allocate the buffer.\\n * @return The buffer, for chaining.\\n */\\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\\n if (capacity % 32 != 0) {\\n capacity += 32 - (capacity % 32);\\n }\\n // Allocate space for the buffer data\\n buf.capacity = capacity;\\n assembly {\\n let ptr := mload(0x40)\\n mstore(buf, ptr)\\n mstore(ptr, 0)\\n let fpm := add(32, add(ptr, capacity))\\n if lt(fpm, ptr) {\\n revert(0, 0)\\n }\\n mstore(0x40, fpm)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Initializes a new buffer from an existing bytes object.\\n * Changes to the buffer may mutate the original value.\\n * @param b The bytes object to initialize the buffer with.\\n * @return A new buffer.\\n */\\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\\n buffer memory buf;\\n buf.buf = b;\\n buf.capacity = b.length;\\n return buf;\\n }\\n\\n function resize(buffer memory buf, uint capacity) private pure {\\n bytes memory oldbuf = buf.buf;\\n init(buf, capacity);\\n append(buf, oldbuf);\\n }\\n\\n /**\\n * @dev Sets buffer length to 0.\\n * @param buf The buffer to truncate.\\n * @return The original buffer, for chaining..\\n */\\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\\n assembly {\\n let bufptr := mload(buf)\\n mstore(bufptr, 0)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to copy.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\\n require(len <= data.length);\\n\\n uint off = buf.buf.length;\\n uint newCapacity = off + len;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint dest;\\n uint src;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Length of existing buffer data\\n let buflen := mload(bufptr)\\n // Start address = buffer address + offset + sizeof(buffer length)\\n dest := add(add(bufptr, 32), off)\\n // Update buffer length if we're extending it\\n if gt(newCapacity, buflen) {\\n mstore(bufptr, newCapacity)\\n }\\n src := add(data, 32)\\n }\\n\\n // Copy word-length chunks while possible\\n for (; len >= 32; len -= 32) {\\n assembly {\\n mstore(dest, mload(src))\\n }\\n dest += 32;\\n src += 32;\\n }\\n\\n // Copy remaining bytes\\n unchecked {\\n uint mask = (256 ** (32 - len)) - 1;\\n assembly {\\n let srcpart := and(mload(src), not(mask))\\n let destpart := and(mload(dest), mask)\\n mstore(dest, or(destpart, srcpart))\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\\n return append(buf, data, data.length);\\n }\\n\\n /**\\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\\n * capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint offPlusOne = off + 1;\\n if (off >= buf.capacity) {\\n resize(buf, offPlusOne * 2);\\n }\\n\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + off\\n let dest := add(add(bufptr, off), 32)\\n mstore8(dest, data)\\n // Update buffer length if we extended it\\n if gt(offPlusOne, mload(bufptr)) {\\n mstore(bufptr, offPlusOne)\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (left-aligned).\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n unchecked {\\n uint mask = (256 ** len) - 1;\\n // Right-align data\\n data = data >> (8 * (32 - len));\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chhaining.\\n */\\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\\n return append(buf, bytes32(data), 20);\\n }\\n\\n /**\\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\\n return append(buf, data, 32);\\n }\\n\\n /**\\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (right-aligned).\\n * @return The original buffer.\\n */\\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint mask = (256 ** len) - 1;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n return buf;\\n }\\n}\",\"keccak256\":\"0x0d86b367813922094e02594a406ba89f5e97d3d74ec2ce3c4032566840e302b0\",\"license\":\"BSD-2-Clause\"},\"@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.4;\\n\\nimport \\\"../../@ensdomains/buffer/v0.1.0/Buffer.sol\\\";\\n\\n/**\\n* @dev A library for populating CBOR encoded payload in Solidity.\\n*\\n* https://datatracker.ietf.org/doc/html/rfc7049\\n*\\n* The library offers various write* and start* methods to encode values of different types.\\n* The resulted buffer can be obtained with data() method.\\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\\n* in an invalid CBOR if start/write/end flow is violated.\\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\\n* except for nested start/end pairs.\\n*/\\n\\nlibrary CBOR {\\n using Buffer for Buffer.buffer;\\n\\n struct CBORBuffer {\\n Buffer.buffer buf;\\n uint256 depth;\\n }\\n\\n uint8 private constant MAJOR_TYPE_INT = 0;\\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\\n uint8 private constant MAJOR_TYPE_BYTES = 2;\\n uint8 private constant MAJOR_TYPE_STRING = 3;\\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\\n uint8 private constant MAJOR_TYPE_MAP = 5;\\n uint8 private constant MAJOR_TYPE_TAG = 6;\\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\\n\\n uint8 private constant TAG_TYPE_BIGNUM = 2;\\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\\n\\n uint8 private constant CBOR_FALSE = 20;\\n uint8 private constant CBOR_TRUE = 21;\\n uint8 private constant CBOR_NULL = 22;\\n uint8 private constant CBOR_UNDEFINED = 23;\\n\\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\\n Buffer.init(cbor.buf, capacity);\\n cbor.depth = 0;\\n return cbor;\\n }\\n\\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\\n require(buf.depth == 0, \\\"Invalid CBOR\\\");\\n return buf.buf.buf;\\n }\\n\\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\\n writeBytes(buf, abi.encode(value));\\n }\\n\\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\\n if (value < 0) {\\n buf.buf.appendUint8(\\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\\n );\\n writeBytes(buf, abi.encode(uint256(-1 - value)));\\n } else {\\n writeUInt256(buf, uint256(value));\\n }\\n }\\n\\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\\n }\\n\\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\\n if(value >= 0) {\\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\\n } else{\\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\\n }\\n }\\n\\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\\n buf.buf.append(value);\\n }\\n\\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\\n buf.buf.append(bytes(value));\\n }\\n\\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\\n }\\n\\n function writeNull(CBORBuffer memory buf) internal pure {\\n writeContentFree(buf, CBOR_NULL);\\n }\\n\\n function writeUndefined(CBORBuffer memory buf) internal pure {\\n writeContentFree(buf, CBOR_UNDEFINED);\\n }\\n\\n function startArray(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\\n buf.depth += 1;\\n }\\n\\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\\n }\\n\\n function startMap(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\\n buf.depth += 1;\\n }\\n\\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\\n }\\n\\n function endSequence(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\\n buf.depth -= 1;\\n }\\n\\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\\n writeString(buf, key);\\n writeString(buf, value);\\n }\\n\\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\\n writeString(buf, key);\\n writeBytes(buf, value);\\n }\\n\\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\\n writeString(buf, key);\\n writeUInt256(buf, value);\\n }\\n\\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\\n writeString(buf, key);\\n writeInt256(buf, value);\\n }\\n\\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\\n writeString(buf, key);\\n writeUInt64(buf, value);\\n }\\n\\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\\n writeString(buf, key);\\n writeInt64(buf, value);\\n }\\n\\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\\n writeString(buf, key);\\n writeBool(buf, value);\\n }\\n\\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n writeNull(buf);\\n }\\n\\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n writeUndefined(buf);\\n }\\n\\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n startMap(buf);\\n }\\n\\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n startArray(buf);\\n }\\n\\n function writeFixedNumeric(\\n CBORBuffer memory buf,\\n uint8 major,\\n uint64 value\\n ) private pure {\\n if (value <= 23) {\\n buf.buf.appendUint8(uint8((major << 5) | value));\\n } else if (value <= 0xFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 24));\\n buf.buf.appendInt(value, 1);\\n } else if (value <= 0xFFFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 25));\\n buf.buf.appendInt(value, 2);\\n } else if (value <= 0xFFFFFFFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 26));\\n buf.buf.appendInt(value, 4);\\n } else {\\n buf.buf.appendUint8(uint8((major << 5) | 27));\\n buf.buf.appendInt(value, 8);\\n }\\n }\\n\\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\\n private\\n pure\\n {\\n buf.buf.appendUint8(uint8((major << 5) | 31));\\n }\\n\\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\\n private\\n pure\\n {\\n writeFixedNumeric(buf, major, length);\\n }\\n\\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\\n }\\n}\",\"keccak256\":\"0xdecf04203502670ac72ba466c75e4f87f4419907365005f0d73e7d07ee3e5715\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/AccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IAccessControl} from \\\"./IAccessControl.sol\\\";\\nimport {Context} from \\\"../utils/Context.sol\\\";\\nimport {ERC165} from \\\"../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```solidity\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```solidity\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\\n * to enforce additional security measures for this role.\\n */\\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\\n struct RoleData {\\n mapping(address account => bool) hasRole;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 role => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with an {AccessControlUnauthorizedAccount} error including the required role.\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role);\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\\n return _roles[role].hasRole[account];\\n }\\n\\n /**\\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\\n */\\n function _checkRole(bytes32 role) internal view virtual {\\n _checkRole(role, _msgSender());\\n }\\n\\n /**\\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\\n * is missing `role`.\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert AccessControlUnauthorizedAccount(account, role);\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `callerConfirmation`.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\\n if (callerConfirmation != _msgSender()) {\\n revert AccessControlBadConfirmation();\\n }\\n\\n _revokeRole(role, callerConfirmation);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\\n if (!hasRole(role, account)) {\\n _roles[role].hasRole[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\\n if (hasRole(role, account)) {\\n _roles[role].hasRole[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa0e92d42942f4f57c5be50568dac11e9d00c93efcb458026e18d2d9b9b2e7308\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev The `account` is missing a role.\\n */\\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\\n\\n /**\\n * @dev The caller of a function is not the expected one.\\n *\\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\\n */\\n error AccessControlBadConfirmation();\\n\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `callerConfirmation`.\\n */\\n function renounceRole(bytes32 role, address callerConfirmation) external;\\n}\\n\",\"keccak256\":\"0xb6b36edd6a2999fd243ff226d6cbf84bd71af2432bbd0dfe19392996a1d9cb41\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n function _contextSuffixLength() internal view virtual returns (uint256) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0x9e8778b14317ba9e256c30a76fd6c32b960af621987f56069e1e819c77c6a133\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x4296879f55019b23e135000eb36896057e7101fb7fb859c5ef690cf14643757b\",\"license\":\"MIT\"},\"contracts/CCGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport './interfaces/ICCGateway.sol';\\nimport {ICCGatewayClient} from './interfaces/ICCGatewayClient.sol';\\n\\nimport {FunctionsClient} from \\\"@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol\\\";\\nimport {AccessControl} from \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport {FunctionsRequest} from \\\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\\\";\\n\\ncontract CCGateway is ICCGateway, FunctionsClient, AccessControl {\\n using FunctionsRequest for FunctionsRequest.Request;\\n\\n bytes32 public constant MANAGER_ROLE = keccak256(\\\"MANAGER_ROLE\\\");\\n bytes32 public constant CLIENT_ROLE = keccak256(\\\"CLIENT_ROLE\\\");\\n bytes32 private _donId; // DON ID for the Functions DON to which the requests are sent\\n\\n mapping(uint64 subscriptionId => CCGRequest) private _requests; // Each subscription can only handle one kind of request\\n mapping(bytes32 requestId => ICCGatewayClient.CCGResponse) private unprocessed_responses; // Responses that have not been processed yet\\n\\n // array of registered subscriptions\\n uint64[] public subscriptions;\\n\\n constructor(address router, bytes32 initialDonId, address initialOwner) FunctionsClient(router) {\\n _donId = initialDonId;\\n\\n address to = address(0) == initialOwner ? _msgSender() : initialOwner;\\n _grantRole(DEFAULT_ADMIN_ROLE, to);\\n _grantRole(MANAGER_ROLE, to);\\n }\\n\\n /**\\n * @dev Set the DON ID\\n * @param newDonId New DON ID\\n */\\n function setDonId(bytes32 newDonId) external onlyRole(getRoleAdmin(MANAGER_ROLE)) {\\n _donId = newDonId;\\n }\\n\\n /**\\n * @dev Get the DON ID\\n * @return DON ID\\n */\\n function donId() external view returns (bytes32) {\\n return _donId;\\n }\\n\\n function registerRequest(\\n uint64 subscriptionId,\\n FunctionsRequest.Location codeLocation,\\n string calldata source,\\n FunctionsRequest.Location secretsLocation,\\n bytes calldata encryptedSecretsReference,\\n uint32 callbackGasLimit,\\n string calldata name\\n ) external onlyManager {\\n if (bytes(name).length == 0) {revert CCGRequestNameEmpty();}\\n\\n CCGRequest storage req = _requests[subscriptionId];\\n if(bytes(req.name).length == 0) {subscriptions.push(subscriptionId);}\\n\\n req.name = name;\\n req.callbackGasLimit = callbackGasLimit;\\n\\n // Only JavaScript is supported for now\\n req.config.language = FunctionsRequest.CodeLanguage.JavaScript;\\n req.config.codeLocation = codeLocation;\\n req.config.source = source;\\n req.config.secretsLocation = secretsLocation;\\n req.config.encryptedSecretsReference = encryptedSecretsReference;\\n }\\n\\n function removeRequest(uint64 subscriptionId) external onlyManager {\\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\\n delete _requests[subscriptionId];\\n\\n // Find the index of the subscriptionId in the subscriptions array\\n uint256 index = subscriptions.length;\\n for (uint256 i = 0; i < subscriptions.length; i++) {\\n if (index == subscriptions.length && subscriptions[i] == subscriptionId) index = i;\\n if (index != subscriptions.length && i + 1 < subscriptions.length) subscriptions[i] = subscriptions[i + 1];\\n }\\n\\n subscriptions.pop();\\n }\\n\\n function getRequest(uint64 subscriptionId) external view returns (CCGRequest memory) {\\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\\n return _requests[subscriptionId];\\n }\\n// ---------------------------------------------------------------------------------------------------------------------\\n modifier onlySource(bytes32 requestId) {\\n if (unprocessed_responses[requestId].source != _msgSender()) {revert CCGOnlySameSourceAllowed(requestId);}\\n _;\\n }\\n\\n modifier onlyManager() {\\n if (!hasRole(MANAGER_ROLE, tx.origin)) {revert CCGOnlyManagerAllowed();}\\n _;\\n }\\n// ---------------------------------------------------------------------------------------------------------------------\\n /**\\n * @notice Triggers an on-demand Functions request using remote encrypted secrets\\n * @param subscriptionId Subscription ID used to pay for request (FunctionsConsumer contract address must first be added to the subscription)\\n * @param args String arguments passed into the source code and accessible via the global variable `args`\\n * @param bytesArgs Bytes arguments passed into the source code and accessible via the global variable `bytesArgs` as hex strings\\n * @param encryptedSecretsReference Reference pointing to encrypted secrets\\n */\\n function sendRequest(\\n uint64 subscriptionId,\\n string[] calldata args,\\n bytes[] calldata bytesArgs,\\n bytes calldata encryptedSecretsReference\\n ) external onlyRole(CLIENT_ROLE) returns (bytes32 requestId) {\\n CCGRequest storage request = _requests[subscriptionId];\\n if (bytes(request.name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\\n\\n FunctionsRequest.Request memory req = request.config;\\n req.initializeRequest(req.codeLocation, FunctionsRequest.CodeLanguage.JavaScript, req.source);\\n if (encryptedSecretsReference.length > 0) {req.encryptedSecretsReference = encryptedSecretsReference;}\\n\\n if (args.length > 0) {\\n req.setArgs(args);\\n }\\n if (bytesArgs.length > 0) {\\n req.setBytesArgs(bytesArgs);\\n }\\n\\n requestId = _sendRequest(req.encodeCBOR(), subscriptionId, request.callbackGasLimit, _donId);\\n unprocessed_responses[requestId].state = ICCGatewayClient.CCGResponseState.Sent;\\n unprocessed_responses[requestId].source = _msgSender();\\n }\\n\\n /**\\n * @notice Store latest result/error\\n * @param requestId The request ID, returned by sendRequest()\\n * @param response Aggregated response from the user code\\n * @param err Aggregated error from the user code or from the execution pipeline\\n * Either response or error parameter will be set, but never both\\n */\\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal override {\\n ICCGatewayClient.CCGResponse storage resp = unprocessed_responses[requestId];\\n if (resp.state != ICCGatewayClient.CCGResponseState.Sent) {revert CCGRequestAlreadyFulfilled(requestId);}\\n\\n unprocessed_responses[requestId].state = err.length > 0 ? ICCGatewayClient.CCGResponseState.Error : ICCGatewayClient.CCGResponseState.Success;\\n unprocessed_responses[requestId].data = response;\\n unprocessed_responses[requestId].error = err;\\n\\n ICCGatewayClient(resp.source).callback(requestId);\\n }\\n\\n /**\\n * @dev Get the response data\\n * @param requestId The request ID, returned by sendRequest()\\n * @return response CCGResponse\\n */\\n function getResponse(bytes32 requestId, bool remove) external onlySource(requestId) returns (ICCGatewayClient.CCGResponse memory response) {\\n response = unprocessed_responses[requestId];\\n if (remove) {delete unprocessed_responses[requestId];}\\n }\\n}\",\"keccak256\":\"0x30020047512e69e37da4ab97917f13615bb96d65506baf5856aac3a25f8414af\",\"license\":\"MIT\"},\"contracts/interfaces/ICCGateway.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\\nimport {FunctionsRequest} from \\\"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\\\";\\n\\ninterface ICCGateway {\\n struct CCGRequest {\\n string name;\\n uint32 callbackGasLimit;\\n FunctionsRequest.Request config;\\n }\\n\\n /**\\n * @dev Can't register a request with an empty name\\n */\\n error CCGRequestNameEmpty();\\n\\n /**\\n * @dev Only the same source of the requestId is allowed to call the function\\n */\\n error CCGOnlySameSourceAllowed(bytes32 requestId);\\n\\n /**\\n * @dev Only a registered subscriptionId is allowed to call the function\\n */\\n error CCGRequestNotRegistered(uint64 subscriptionId);\\n\\n /**\\n * @dev Can't fulfill a request that has already been fulfilled\\n */\\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\\n\\n /**\\n * @dev Only A manager can call the function\\n */\\n error CCGOnlyManagerAllowed();\\n\\n /**\\n * @dev Send a request to the Functions DON\\n */\\n function sendRequest(\\n uint64 subscriptionId,\\n string[] calldata args,\\n bytes[] calldata bytesArgs,\\n bytes calldata encryptedSecretsReference\\n ) external returns (bytes32 requestId);\\n\\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\\n}\\n\",\"keccak256\":\"0xbc7d92f8db240767c8636e8df9b818cc1f5abfde22b8c49eee50f418fb0dbea5\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/ICCGatewayClient.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\ninterface ICCGatewayClient {\\n enum CCGResponseState {Sent, Success, Error}\\n\\n struct CCGResponse {\\n uint64 subscriptionId;\\n address source;\\n CCGResponseState state;\\n bytes data;\\n bytes error;\\n }\\n\\n function callback(bytes32 requestId) external;\\n}\\n\",\"keccak256\":\"0xb69320aa2152f374dec4cfc70b73f46e0db9774a1411d2acff1481ee3295f86a\",\"license\":\"UNLICENSED\"}},\"version\":1}", + "bytecode": "0x60a06040523480156200001157600080fd5b5060405162002f2f38038062002f2f83398101604081905262000034916200016e565b6001600160a01b0380841660805260018390556000908216156200005957816200005b565b335b90506200006a600082620000a2565b50620000977f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0882620000a2565b5050505050620001af565b6000828152602081815260408083206001600160a01b038516845290915281205460ff1662000147576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055620000fe3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016200014b565b5060005b92915050565b80516001600160a01b03811681146200016957600080fd5b919050565b6000806000606084860312156200018457600080fd5b6200018f8462000151565b925060208401519150620001a66040850162000151565b90509250925092565b608051612d5d620001d26000396000818161031a0152611a9f0152612d5d6000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c80638dbe7b9d116100a2578063c8ab5f2211610071578063c8ab5f2214610256578063cbbf67ec14610269578063d547741f14610289578063eae6f6521461029c578063ec87621c146102c357600080fd5b80638dbe7b9d1461022057806391d148541461022857806396c1582e1461023b578063a217fddf1461024e57600080fd5b80632d5bbf60116100e95780632d5bbf60146101a95780632f2ff15d146101d457806334d2afd9146101e757806336568abe146101fa57806378ca5de71461020d57600080fd5b806301ffc9a71461011b5780630ca761751461014357806315b851d114610158578063248a9ca314610178575b600080fd5b61012e61012936600461216b565b6102d8565b60405190151581526020015b60405180910390f35b610156610151366004612252565b61030f565b005b61016b6101663660046122be565b610393565b60405161013a919061235f565b61019b6101863660046123db565b60009081526020819052604090206001015490565b60405190815260200161013a565b6101bc6101b73660046123db565b6105ea565b6040516001600160401b03909116815260200161013a565b6101566101e23660046123f4565b610627565b6101566101f5366004612441565b610652565b6101566102083660046123f4565b6108cf565b61015661021b3660046123db565b610907565b60015461019b565b61012e6102363660046123f4565b61094f565b61019b6102493660046124e8565b610978565b61019b600081565b6101566102643660046125a1565b610e5a565b61027c610277366004612441565b610fee565b60405161013a91906126f8565b6101566102973660046123f4565b61148e565b61019b7fa5ff3ec7a96cdbba4d2d5172d66bbc73c6db3885f29b21be5da9fa7a7c02523281565b61019b600080516020612d0883398151915281565b60006001600160e01b03198216637965db0b60e01b148061030957506301ffc9a760e01b6001600160e01b03198316145b92915050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103585760405163c6829f8360e01b815260040160405180910390fd5b6103638383836114b3565b60405183907f85e1543bf2f84fe80c6badbce3648c8539ad1df4d2b3d822938ca0538be727e690600090a2505050565b6040805160a081018252600080825260208201819052918101919091526060808201819052608082015260008381526003602052604090205483906001600160a01b03600160401b9091041633146104065760405163949aaf2d60e01b8152600481018290526024015b60405180910390fd5b600084815260036020908152604091829020825160a08101845281546001600160401b0381168252600160401b81046001600160a01b03169382019390935292909190830190600160e01b900460ff166002811115610467576104676122f3565b6002811115610478576104786122f3565b815260200160018201805461048c906127de565b80601f01602080910402602001604051908101604052809291908181526020018280546104b8906127de565b80156105055780601f106104da57610100808354040283529160200191610505565b820191906000526020600020905b8154815290600101906020018083116104e857829003601f168201915b5050505050815260200160028201805461051e906127de565b80601f016020809104026020016040519081016040528092919081815260200182805461054a906127de565b80156105975780601f1061056c57610100808354040283529160200191610597565b820191906000526020600020905b81548152906001019060200180831161057a57829003601f168201915b505050505081525050915082156105e357600084815260036020526040812080546001600160e81b0319168155906105d26001830182612010565b6105e0600283016000612010565b50505b5092915050565b600481815481106105fa57600080fd5b9060005260206000209060049182820401919006600802915054906101000a90046001600160401b031681565b600082815260208190526040902060010154610642816115e6565b61064c83836115f3565b50505050565b61066a600080516020612d088339815191523261094f565b6106875760405163129d730760e01b815260040160405180910390fd5b6001600160401b038116600090815260026020526040902080546106aa906127de565b90506000036106d757604051630601bb0160e21b81526001600160401b03821660048201526024016103fd565b6001600160401b0381166000908152600260205260408120906106fa8282612010565b60018201805463ffffffff1916905560028201805462ffffff1916815560006107266003850182612010565b610734600283016000612010565b61074260038301600061204a565b610750600483016000612068565b50506004549150600090505b60045481101561088857600454821480156107b85750826001600160401b03166004828154811061078f5761078f612818565b6000918252602090912060048204015460039091166008026101000a90046001600160401b0316145b156107c1578091505b60045482148015906107de57506004546107dc826001612844565b105b156108765760046107f0826001612844565b8154811061080057610800612818565b90600052602060002090600491828204019190066008029054906101000a90046001600160401b03166004828154811061083c5761083c612818565b90600052602060002090600491828204019190066008026101000a8154816001600160401b0302191690836001600160401b031602179055505b8061088081612857565b91505061075c565b50600480548061089a5761089a612870565b60008281526020902060046000199092019182040180546001600160401b03600860038516026101000a021916905590555050565b6001600160a01b03811633146108f85760405163334bd91960e11b815260040160405180910390fd5b6109028282611685565b505050565b600080516020612d0883398151915260009081526020527fe84508f2c7fa9c351146748b3025cb78b45df37d868e48c6a75102fecdeee64654610949816115e6565b50600155565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60007fa5ff3ec7a96cdbba4d2d5172d66bbc73c6db3885f29b21be5da9fa7a7c0252326109a4816115e6565b6001600160401b0389166000908152600260205260409020805481906109c9906127de565b90506000036109f657604051630601bb0160e21b81526001600160401b038b1660048201526024016103fd565b6040805160e081019091526002808301805460009392839160ff1690811115610a2157610a216122f3565b6002811115610a3257610a326122f3565b81528154602090910190610100900460ff166002811115610a5557610a556122f3565b6002811115610a6657610a666122f3565b8152815460209091019062010000900460ff168015610a8757610a876122f3565b8015610a9557610a956122f3565b8152602001600182018054610aa9906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610ad5906127de565b8015610b225780601f10610af757610100808354040283529160200191610b22565b820191906000526020600020905b815481529060010190602001808311610b0557829003601f168201915b50505050508152602001600282018054610b3b906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610b67906127de565b8015610bb45780601f10610b8957610100808354040283529160200191610bb4565b820191906000526020600020905b815481529060010190602001808311610b9757829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b82821015610c8e578382906000526020600020018054610c01906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610c2d906127de565b8015610c7a5780601f10610c4f57610100808354040283529160200191610c7a565b820191906000526020600020905b815481529060010190602001808311610c5d57829003601f168201915b505050505081526020019060010190610be2565b50505050815260200160048201805480602002602001604051908101604052809291908181526020016000905b82821015610d67578382906000526020600020018054610cda906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610d06906127de565b8015610d535780601f10610d2857610100808354040283529160200191610d53565b820191906000526020600020905b815481529060010190602001808311610d3657829003601f168201915b505050505081526020019060010190610cbb565b5050509152505080516060820151919250610d87918391906000906116f0565b8415610dc95785858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050505060808201525b8815610de357610de3610ddc8a8c6128a9565b829061176e565b8615610dfd57610dfd610df6888a612935565b8290611798565b610e1f610e09826117c2565b60018085015490548e9163ffffffff1690611a9a565b6000818152600360205260409020805468010000000000000000600160e81b031916600160401b33021790559b9a5050505050505050505050565b610e72600080516020612d088339815191523261094f565b610e8f5760405163129d730760e01b815260040160405180910390fd5b6000819003610eb15760405163281b14ab60e01b815260040160405180910390fd5b6001600160401b038a16600090815260026020526040902080548190610ed6906127de565b9050600003610f3d576004805460018101825560008290529081047f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160401b03808f1660086003909516949094026101000a938402930219169190911790555b80610f498385836129ea565b506001818101805463ffffffff191663ffffffff87161790556002808301805462ff000019811682558d93919262ff00ff1990911691908490811115610f9157610f916122f3565b021790555060038101610fa5898b836129ea565b5060028082018054899261ff001990911690610100908490811115610fcc57610fcc6122f3565b021790555060048101610fe08688836129ea565b505050505050505050505050565b610ff6612086565b6001600160401b03821660009081526002602052604090208054611019906127de565b905060000361104657604051630601bb0160e21b81526001600160401b03831660048201526024016103fd565b6001600160401b03821660009081526002602052604090819020815160608101909252805482908290611078906127de565b80601f01602080910402602001604051908101604052809291908181526020018280546110a4906127de565b80156110f15780601f106110c6576101008083540402835291602001916110f1565b820191906000526020600020905b8154815290600101906020018083116110d457829003601f168201915b5050509183525050600182015463ffffffff1660208201526040805160e0810182526002808501805493909401939192839160ff90911690811115611138576111386122f3565b6002811115611149576111496122f3565b81528154602090910190610100900460ff16600281111561116c5761116c6122f3565b600281111561117d5761117d6122f3565b8152815460209091019062010000900460ff16801561119e5761119e6122f3565b80156111ac576111ac6122f3565b81526020016001820180546111c0906127de565b80601f01602080910402602001604051908101604052809291908181526020018280546111ec906127de565b80156112395780601f1061120e57610100808354040283529160200191611239565b820191906000526020600020905b81548152906001019060200180831161121c57829003601f168201915b50505050508152602001600282018054611252906127de565b80601f016020809104026020016040519081016040528092919081815260200182805461127e906127de565b80156112cb5780601f106112a0576101008083540402835291602001916112cb565b820191906000526020600020905b8154815290600101906020018083116112ae57829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b828210156113a5578382906000526020600020018054611318906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054611344906127de565b80156113915780601f1061136657610100808354040283529160200191611391565b820191906000526020600020905b81548152906001019060200180831161137457829003601f168201915b5050505050815260200190600101906112f9565b50505050815260200160048201805480602002602001604051908101604052809291908181526020016000905b8282101561147e5783829060005260206000200180546113f1906127de565b80601f016020809104026020016040519081016040528092919081815260200182805461141d906127de565b801561146a5780601f1061143f5761010080835404028352916020019161146a565b820191906000526020600020905b81548152906001019060200180831161144d57829003601f168201915b5050505050815260200190600101906113d2565b5050509152505090525092915050565b6000828152602081905260409020600101546114a9816115e6565b61064c8383611685565b6000838152600360205260408120908154600160e01b900460ff1660028111156114df576114df6122f3565b146114ff576040516287aa6360e01b8152600481018590526024016103fd565b600082511161150f576001611512565b60025b6000858152600360205260409020805460ff60e01b1916600160e01b836002811115611540576115406122f3565b021790555060008481526003602052604090206001016115608482612aaa565b50600084815260036020526040902060020161157c8382612aaa565b508054604051636f89cca760e11b815260048101869052600160401b9091046001600160a01b03169063df13994e90602401600060405180830381600087803b1580156115c857600080fd5b505af11580156115dc573d6000803e3d6000fd5b5050505050505050565b6115f08133611b6c565b50565b60006115ff838361094f565b61167d576000838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556116353390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610309565b506000610309565b6000611691838361094f565b1561167d576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610309565b8051600003611712576040516322ce3edd60e01b815260040160405180910390fd5b83836002811115611725576117256122f3565b90816002811115611738576117386122f3565b9052506040840182801561174e5761174e6122f3565b9081801561175e5761175e6122f3565b9052506060909301929092525050565b80516000036117905760405163fe936cb760e01b815260040160405180910390fd5b60a090910152565b80516000036117ba5760405163fe936cb760e01b815260040160405180910390fd5b60c090910152565b606060006117d1610100611ba9565b905061180a6040518060400160405280600c81526020016b31b7b232a637b1b0ba34b7b760a11b81525082611bca90919063ffffffff16565b8251611828906002811115611821576118216122f3565b8290611be3565b6040805180820190915260088152676c616e677561676560c01b6020820152611852908290611bca565b6040830151611869908015611821576118216122f3565b604080518082019091526006815265736f7572636560d01b6020820152611891908290611bca565b60608301516118a1908290611bca565b60a08301515115611935576040805180820190915260048152636172677360e01b60208201526118d2908290611bca565b6118db81611c1c565b60005b8360a001515181101561192b5761191b8460a00151828151811061190457611904612818565b602002602001015183611bca90919063ffffffff16565b61192481612857565b90506118de565b5061193581611c40565b608083015151156119f957600083602001516002811115611958576119586122f3565b036119765760405163a80d31f760e01b815260040160405180910390fd5b60408051808201909152600f81526e39b2b1b932ba39a637b1b0ba34b7b760891b60208201526119a7908290611bca565b6119c083602001516002811115611821576118216122f3565b6040805180820190915260078152667365637265747360c81b60208201526119e9908290611bca565b60808301516119f9908290611c5e565b60c08301515115611a925760408051808201909152600981526862797465734172677360b81b6020820152611a2f908290611bca565b611a3881611c1c565b60005b8360c0015151811015611a8857611a788460c001518281518110611a6157611a61612818565b602002602001015183611c5e90919063ffffffff16565b611a8181612857565b9050611a3b565b50611a9281611c40565b515192915050565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663461d27628688600188886040518663ffffffff1660e01b8152600401611af2959493929190612b69565b6020604051808303816000875af1158015611b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b359190612bb2565b60405190915081907f1131472297a800fee664d1d89cfa8f7676ff07189ecc53f80bbb5f4969099db890600090a295945050505050565b611b76828261094f565b611ba55760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016103fd565b5050565b611bb16120e3565b8051611bbd9083611c6b565b5060006020820152919050565b611bd78260038351611ce2565b81516109029082611dfb565b8151611bf09060c2611e23565b50611ba58282604051602001611c0891815260200190565b604051602081830303815290604052611c5e565b611c27816004611e8c565b600181602001818151611c3a9190612844565b90525050565b611c4b816007611e8c565b600181602001818151611c3a9190612bcb565b611bd78260028351611ce2565b604080518082019091526060815260006020820152611c8b602083612bde565b15611cb357611c9b602083612bde565b611ca6906020612bcb565b611cb09083612844565b91505b602080840183905260405180855260008152908184010181811015611cd757600080fd5b604052509192915050565b6017816001600160401b031611611d0857825161064c9060e0600585901b168317611e23565b60ff816001600160401b031611611d48578251611d30906018611fe0600586901b1617611e23565b50825161064c906001600160401b0383166001611ea3565b61ffff816001600160401b031611611d89578251611d71906019611fe0600586901b1617611e23565b50825161064c906001600160401b0383166002611ea3565b63ffffffff816001600160401b031611611dcc578251611db490601a611fe0600586901b1617611e23565b50825161064c906001600160401b0383166004611ea3565b8251611de390601b611fe0600586901b1617611e23565b50825161064c906001600160401b0383166008611ea3565b604080518082019091526060815260006020820152611e1c83838451611f28565b9392505050565b6040805180820190915260608152600060208201528251516000611e48826001612844565b905084602001518210611e6957611e6985611e64836002612c00565b611ff9565b8451602083820101858153508051821115611e82578181525b5093949350505050565b815161090290601f611fe0600585901b1617611e23565b6040805180820190915260608152600060208201528351516000611ec78285612844565b90508560200151811115611ee457611ee486611e64836002612c00565b60006001611ef486610100612cfb565b611efe9190612bcb565b90508651828101878319825116178152508051831115611f1c578281525b50959695505050505050565b6040805180820190915260608152600060208201528251821115611f4b57600080fd5b8351516000611f5a8483612844565b90508560200151811115611f7757611f7786611e64836002612c00565b855180518382016020019160009180851115611f91578482525b505050602086015b60208610611fd15780518252611fb0602083612844565b9150611fbd602082612844565b9050611fca602087612bcb565b9550611f99565b51815160001960208890036101000a0190811690199190911617905250849150509392505050565b81516120058383611c6b565b5061064c8382611dfb565b50805461201c906127de565b6000825580601f1061202c575050565b601f0160209004906000526020600020908101906115f09190612118565b50805460008255906000526020600020908101906115f09190612131565b50805460008255906000526020600020908101906115f0919061214e565b60408051606080820183528152600060208201529081016120de6040805160e0810190915280600081526020016000815260200160008152602001606081526020016060815260200160608152602001606081525090565b905290565b604051806040016040528061210b604051806040016040528060608152602001600081525090565b8152602001600081525090565b5b8082111561212d5760008155600101612119565b5090565b8082111561212d5760006121458282612010565b50600101612131565b8082111561212d5760006121628282612010565b5060010161214e565b60006020828403121561217d57600080fd5b81356001600160e01b031981168114611e1c57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156121d3576121d3612195565b604052919050565b60006001600160401b038311156121f4576121f4612195565b612207601f8401601f19166020016121ab565b905082815283838301111561221b57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261224357600080fd5b611e1c838335602085016121db565b60008060006060848603121561226757600080fd5b8335925060208401356001600160401b038082111561228557600080fd5b61229187838801612232565b935060408601359150808211156122a757600080fd5b506122b486828701612232565b9150509250925092565b600080604083850312156122d157600080fd5b82359150602083013580151581146122e857600080fd5b809150509250929050565b634e487b7160e01b600052602160045260246000fd5b600381106115f0576115f06122f3565b6000815180845260005b8181101561233f57602081850181015186830182015201612323565b506000602082860101526020601f19601f83011685010191505092915050565b602081526001600160401b03825116602082015260018060a01b0360208301511660408201526000604083015161239581612309565b80606084015250606083015160a060808401526123b560c0840182612319565b90506080840151601f198483030160a08501526123d28282612319565b95945050505050565b6000602082840312156123ed57600080fd5b5035919050565b6000806040838503121561240757600080fd5b8235915060208301356001600160a01b03811681146122e857600080fd5b80356001600160401b038116811461243c57600080fd5b919050565b60006020828403121561245357600080fd5b611e1c82612425565b60008083601f84011261246e57600080fd5b5081356001600160401b0381111561248557600080fd5b6020830191508360208260051b85010111156124a057600080fd5b9250929050565b60008083601f8401126124b957600080fd5b5081356001600160401b038111156124d057600080fd5b6020830191508360208285010111156124a057600080fd5b60008060008060008060006080888a03121561250357600080fd5b61250c88612425565b965060208801356001600160401b038082111561252857600080fd5b6125348b838c0161245c565b909850965060408a013591508082111561254d57600080fd5b6125598b838c0161245c565b909650945060608a013591508082111561257257600080fd5b5061257f8a828b016124a7565b989b979a50959850939692959293505050565b80356003811061243c57600080fd5b60008060008060008060008060008060e08b8d0312156125c057600080fd5b6125c98b612425565b99506125d760208c01612592565b985060408b01356001600160401b03808211156125f357600080fd5b6125ff8e838f016124a7565b909a50985088915061261360608e01612592565b975060808d013591508082111561262957600080fd5b6126358e838f016124a7565b909750955060a08d0135915063ffffffff8216821461265357600080fd5b90935060c08c0135908082111561266957600080fd5b506126768d828e016124a7565b915080935050809150509295989b9194979a5092959850565b6001811061269f5761269f6122f3565b9052565b600081518084526020808501808196508360051b8101915082860160005b858110156126eb5782840389526126d9848351612319565b988501989350908401906001016126c1565b5091979650505050505050565b6020815260008251606060208401526127146080840182612319565b905063ffffffff60208501511660408401526040840151601f19848303016060850152805161274281612309565b8252602081015161275281612309565b80602084015250604081015161276b604084018261268f565b50606081015160e0606084015261278560e0840182612319565b90506080820151838203608085015261279e8282612319565b91505060a082015183820360a08501526127b882826126a3565b91505060c0820151915082810360c08401526127d481836126a3565b9695505050505050565b600181811c908216806127f257607f821691505b60208210810361281257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156103095761030961282e565b6000600182016128695761286961282e565b5060010190565b634e487b7160e01b600052603160045260246000fd5b60006001600160401b0382111561289f5761289f612195565b5060051b60200190565b60006128bc6128b784612886565b6121ab565b80848252602080830192508560051b8501368111156128da57600080fd5b855b818110156129295780356001600160401b038111156128fb5760008081fd5b870136601f82011261290d5760008081fd5b61291b3682358684016121db565b8652509382019382016128dc565b50919695505050505050565b60006129436128b784612886565b80848252602080830192508560051b85013681111561296157600080fd5b855b818110156129295780356001600160401b038111156129825760008081fd5b61298e36828a01612232565b865250938201938201612963565b601f82111561090257600081815260208120601f850160051c810160208610156129c35750805b601f850160051c820191505b818110156129e2578281556001016129cf565b505050505050565b6001600160401b03831115612a0157612a01612195565b612a1583612a0f83546127de565b8361299c565b6000601f841160018114612a495760008515612a315750838201355b600019600387901b1c1916600186901b178355612aa3565b600083815260209020601f19861690835b82811015612a7a5786850135825560209485019460019092019101612a5a565b5086821015612a975760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b81516001600160401b03811115612ac357612ac3612195565b612ad781612ad184546127de565b8461299c565b602080601f831160018114612b0c5760008415612af45750858301515b600019600386901b1c1916600185901b1785556129e2565b600085815260208120601f198616915b82811015612b3b57888601518255948401946001909101908401612b1c565b5085821015612b595787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160401b038616815260a060208201526000612b8b60a0830187612319565b61ffff9590951660408301525063ffffffff92909216606083015260809091015292915050565b600060208284031215612bc457600080fd5b5051919050565b818103818111156103095761030961282e565b600082612bfb57634e487b7160e01b600052601260045260246000fd5b500690565b80820281158282048414176103095761030961282e565b600181815b80851115612c52578160001904821115612c3857612c3861282e565b80851615612c4557918102915b93841c9390800290612c1c565b509250929050565b600082612c6957506001610309565b81612c7657506000610309565b8160018114612c8c5760028114612c9657612cb2565b6001915050610309565b60ff841115612ca757612ca761282e565b50506001821b610309565b5060208310610133831016604e8410600b8410161715612cd5575081810a610309565b612cdf8383612c17565b8060001904821115612cf357612cf361282e565b029392505050565b6000611e1c8383612c5a56fe241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08a2646970667358221220c853501b7d4e314864358724dac532054bd10ab5dc8600ff8db02415b54e281264736f6c63430008140033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101165760003560e01c80638dbe7b9d116100a2578063c8ab5f2211610071578063c8ab5f2214610256578063cbbf67ec14610269578063d547741f14610289578063eae6f6521461029c578063ec87621c146102c357600080fd5b80638dbe7b9d1461022057806391d148541461022857806396c1582e1461023b578063a217fddf1461024e57600080fd5b80632d5bbf60116100e95780632d5bbf60146101a95780632f2ff15d146101d457806334d2afd9146101e757806336568abe146101fa57806378ca5de71461020d57600080fd5b806301ffc9a71461011b5780630ca761751461014357806315b851d114610158578063248a9ca314610178575b600080fd5b61012e61012936600461216b565b6102d8565b60405190151581526020015b60405180910390f35b610156610151366004612252565b61030f565b005b61016b6101663660046122be565b610393565b60405161013a919061235f565b61019b6101863660046123db565b60009081526020819052604090206001015490565b60405190815260200161013a565b6101bc6101b73660046123db565b6105ea565b6040516001600160401b03909116815260200161013a565b6101566101e23660046123f4565b610627565b6101566101f5366004612441565b610652565b6101566102083660046123f4565b6108cf565b61015661021b3660046123db565b610907565b60015461019b565b61012e6102363660046123f4565b61094f565b61019b6102493660046124e8565b610978565b61019b600081565b6101566102643660046125a1565b610e5a565b61027c610277366004612441565b610fee565b60405161013a91906126f8565b6101566102973660046123f4565b61148e565b61019b7fa5ff3ec7a96cdbba4d2d5172d66bbc73c6db3885f29b21be5da9fa7a7c02523281565b61019b600080516020612d0883398151915281565b60006001600160e01b03198216637965db0b60e01b148061030957506301ffc9a760e01b6001600160e01b03198316145b92915050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103585760405163c6829f8360e01b815260040160405180910390fd5b6103638383836114b3565b60405183907f85e1543bf2f84fe80c6badbce3648c8539ad1df4d2b3d822938ca0538be727e690600090a2505050565b6040805160a081018252600080825260208201819052918101919091526060808201819052608082015260008381526003602052604090205483906001600160a01b03600160401b9091041633146104065760405163949aaf2d60e01b8152600481018290526024015b60405180910390fd5b600084815260036020908152604091829020825160a08101845281546001600160401b0381168252600160401b81046001600160a01b03169382019390935292909190830190600160e01b900460ff166002811115610467576104676122f3565b6002811115610478576104786122f3565b815260200160018201805461048c906127de565b80601f01602080910402602001604051908101604052809291908181526020018280546104b8906127de565b80156105055780601f106104da57610100808354040283529160200191610505565b820191906000526020600020905b8154815290600101906020018083116104e857829003601f168201915b5050505050815260200160028201805461051e906127de565b80601f016020809104026020016040519081016040528092919081815260200182805461054a906127de565b80156105975780601f1061056c57610100808354040283529160200191610597565b820191906000526020600020905b81548152906001019060200180831161057a57829003601f168201915b505050505081525050915082156105e357600084815260036020526040812080546001600160e81b0319168155906105d26001830182612010565b6105e0600283016000612010565b50505b5092915050565b600481815481106105fa57600080fd5b9060005260206000209060049182820401919006600802915054906101000a90046001600160401b031681565b600082815260208190526040902060010154610642816115e6565b61064c83836115f3565b50505050565b61066a600080516020612d088339815191523261094f565b6106875760405163129d730760e01b815260040160405180910390fd5b6001600160401b038116600090815260026020526040902080546106aa906127de565b90506000036106d757604051630601bb0160e21b81526001600160401b03821660048201526024016103fd565b6001600160401b0381166000908152600260205260408120906106fa8282612010565b60018201805463ffffffff1916905560028201805462ffffff1916815560006107266003850182612010565b610734600283016000612010565b61074260038301600061204a565b610750600483016000612068565b50506004549150600090505b60045481101561088857600454821480156107b85750826001600160401b03166004828154811061078f5761078f612818565b6000918252602090912060048204015460039091166008026101000a90046001600160401b0316145b156107c1578091505b60045482148015906107de57506004546107dc826001612844565b105b156108765760046107f0826001612844565b8154811061080057610800612818565b90600052602060002090600491828204019190066008029054906101000a90046001600160401b03166004828154811061083c5761083c612818565b90600052602060002090600491828204019190066008026101000a8154816001600160401b0302191690836001600160401b031602179055505b8061088081612857565b91505061075c565b50600480548061089a5761089a612870565b60008281526020902060046000199092019182040180546001600160401b03600860038516026101000a021916905590555050565b6001600160a01b03811633146108f85760405163334bd91960e11b815260040160405180910390fd5b6109028282611685565b505050565b600080516020612d0883398151915260009081526020527fe84508f2c7fa9c351146748b3025cb78b45df37d868e48c6a75102fecdeee64654610949816115e6565b50600155565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60007fa5ff3ec7a96cdbba4d2d5172d66bbc73c6db3885f29b21be5da9fa7a7c0252326109a4816115e6565b6001600160401b0389166000908152600260205260409020805481906109c9906127de565b90506000036109f657604051630601bb0160e21b81526001600160401b038b1660048201526024016103fd565b6040805160e081019091526002808301805460009392839160ff1690811115610a2157610a216122f3565b6002811115610a3257610a326122f3565b81528154602090910190610100900460ff166002811115610a5557610a556122f3565b6002811115610a6657610a666122f3565b8152815460209091019062010000900460ff168015610a8757610a876122f3565b8015610a9557610a956122f3565b8152602001600182018054610aa9906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610ad5906127de565b8015610b225780601f10610af757610100808354040283529160200191610b22565b820191906000526020600020905b815481529060010190602001808311610b0557829003601f168201915b50505050508152602001600282018054610b3b906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610b67906127de565b8015610bb45780601f10610b8957610100808354040283529160200191610bb4565b820191906000526020600020905b815481529060010190602001808311610b9757829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b82821015610c8e578382906000526020600020018054610c01906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610c2d906127de565b8015610c7a5780601f10610c4f57610100808354040283529160200191610c7a565b820191906000526020600020905b815481529060010190602001808311610c5d57829003601f168201915b505050505081526020019060010190610be2565b50505050815260200160048201805480602002602001604051908101604052809291908181526020016000905b82821015610d67578382906000526020600020018054610cda906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610d06906127de565b8015610d535780601f10610d2857610100808354040283529160200191610d53565b820191906000526020600020905b815481529060010190602001808311610d3657829003601f168201915b505050505081526020019060010190610cbb565b5050509152505080516060820151919250610d87918391906000906116f0565b8415610dc95785858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050505060808201525b8815610de357610de3610ddc8a8c6128a9565b829061176e565b8615610dfd57610dfd610df6888a612935565b8290611798565b610e1f610e09826117c2565b60018085015490548e9163ffffffff1690611a9a565b6000818152600360205260409020805468010000000000000000600160e81b031916600160401b33021790559b9a5050505050505050505050565b610e72600080516020612d088339815191523261094f565b610e8f5760405163129d730760e01b815260040160405180910390fd5b6000819003610eb15760405163281b14ab60e01b815260040160405180910390fd5b6001600160401b038a16600090815260026020526040902080548190610ed6906127de565b9050600003610f3d576004805460018101825560008290529081047f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160401b03808f1660086003909516949094026101000a938402930219169190911790555b80610f498385836129ea565b506001818101805463ffffffff191663ffffffff87161790556002808301805462ff000019811682558d93919262ff00ff1990911691908490811115610f9157610f916122f3565b021790555060038101610fa5898b836129ea565b5060028082018054899261ff001990911690610100908490811115610fcc57610fcc6122f3565b021790555060048101610fe08688836129ea565b505050505050505050505050565b610ff6612086565b6001600160401b03821660009081526002602052604090208054611019906127de565b905060000361104657604051630601bb0160e21b81526001600160401b03831660048201526024016103fd565b6001600160401b03821660009081526002602052604090819020815160608101909252805482908290611078906127de565b80601f01602080910402602001604051908101604052809291908181526020018280546110a4906127de565b80156110f15780601f106110c6576101008083540402835291602001916110f1565b820191906000526020600020905b8154815290600101906020018083116110d457829003601f168201915b5050509183525050600182015463ffffffff1660208201526040805160e0810182526002808501805493909401939192839160ff90911690811115611138576111386122f3565b6002811115611149576111496122f3565b81528154602090910190610100900460ff16600281111561116c5761116c6122f3565b600281111561117d5761117d6122f3565b8152815460209091019062010000900460ff16801561119e5761119e6122f3565b80156111ac576111ac6122f3565b81526020016001820180546111c0906127de565b80601f01602080910402602001604051908101604052809291908181526020018280546111ec906127de565b80156112395780601f1061120e57610100808354040283529160200191611239565b820191906000526020600020905b81548152906001019060200180831161121c57829003601f168201915b50505050508152602001600282018054611252906127de565b80601f016020809104026020016040519081016040528092919081815260200182805461127e906127de565b80156112cb5780601f106112a0576101008083540402835291602001916112cb565b820191906000526020600020905b8154815290600101906020018083116112ae57829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b828210156113a5578382906000526020600020018054611318906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054611344906127de565b80156113915780601f1061136657610100808354040283529160200191611391565b820191906000526020600020905b81548152906001019060200180831161137457829003601f168201915b5050505050815260200190600101906112f9565b50505050815260200160048201805480602002602001604051908101604052809291908181526020016000905b8282101561147e5783829060005260206000200180546113f1906127de565b80601f016020809104026020016040519081016040528092919081815260200182805461141d906127de565b801561146a5780601f1061143f5761010080835404028352916020019161146a565b820191906000526020600020905b81548152906001019060200180831161144d57829003601f168201915b5050505050815260200190600101906113d2565b5050509152505090525092915050565b6000828152602081905260409020600101546114a9816115e6565b61064c8383611685565b6000838152600360205260408120908154600160e01b900460ff1660028111156114df576114df6122f3565b146114ff576040516287aa6360e01b8152600481018590526024016103fd565b600082511161150f576001611512565b60025b6000858152600360205260409020805460ff60e01b1916600160e01b836002811115611540576115406122f3565b021790555060008481526003602052604090206001016115608482612aaa565b50600084815260036020526040902060020161157c8382612aaa565b508054604051636f89cca760e11b815260048101869052600160401b9091046001600160a01b03169063df13994e90602401600060405180830381600087803b1580156115c857600080fd5b505af11580156115dc573d6000803e3d6000fd5b5050505050505050565b6115f08133611b6c565b50565b60006115ff838361094f565b61167d576000838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556116353390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610309565b506000610309565b6000611691838361094f565b1561167d576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610309565b8051600003611712576040516322ce3edd60e01b815260040160405180910390fd5b83836002811115611725576117256122f3565b90816002811115611738576117386122f3565b9052506040840182801561174e5761174e6122f3565b9081801561175e5761175e6122f3565b9052506060909301929092525050565b80516000036117905760405163fe936cb760e01b815260040160405180910390fd5b60a090910152565b80516000036117ba5760405163fe936cb760e01b815260040160405180910390fd5b60c090910152565b606060006117d1610100611ba9565b905061180a6040518060400160405280600c81526020016b31b7b232a637b1b0ba34b7b760a11b81525082611bca90919063ffffffff16565b8251611828906002811115611821576118216122f3565b8290611be3565b6040805180820190915260088152676c616e677561676560c01b6020820152611852908290611bca565b6040830151611869908015611821576118216122f3565b604080518082019091526006815265736f7572636560d01b6020820152611891908290611bca565b60608301516118a1908290611bca565b60a08301515115611935576040805180820190915260048152636172677360e01b60208201526118d2908290611bca565b6118db81611c1c565b60005b8360a001515181101561192b5761191b8460a00151828151811061190457611904612818565b602002602001015183611bca90919063ffffffff16565b61192481612857565b90506118de565b5061193581611c40565b608083015151156119f957600083602001516002811115611958576119586122f3565b036119765760405163a80d31f760e01b815260040160405180910390fd5b60408051808201909152600f81526e39b2b1b932ba39a637b1b0ba34b7b760891b60208201526119a7908290611bca565b6119c083602001516002811115611821576118216122f3565b6040805180820190915260078152667365637265747360c81b60208201526119e9908290611bca565b60808301516119f9908290611c5e565b60c08301515115611a925760408051808201909152600981526862797465734172677360b81b6020820152611a2f908290611bca565b611a3881611c1c565b60005b8360c0015151811015611a8857611a788460c001518281518110611a6157611a61612818565b602002602001015183611c5e90919063ffffffff16565b611a8181612857565b9050611a3b565b50611a9281611c40565b515192915050565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663461d27628688600188886040518663ffffffff1660e01b8152600401611af2959493929190612b69565b6020604051808303816000875af1158015611b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b359190612bb2565b60405190915081907f1131472297a800fee664d1d89cfa8f7676ff07189ecc53f80bbb5f4969099db890600090a295945050505050565b611b76828261094f565b611ba55760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016103fd565b5050565b611bb16120e3565b8051611bbd9083611c6b565b5060006020820152919050565b611bd78260038351611ce2565b81516109029082611dfb565b8151611bf09060c2611e23565b50611ba58282604051602001611c0891815260200190565b604051602081830303815290604052611c5e565b611c27816004611e8c565b600181602001818151611c3a9190612844565b90525050565b611c4b816007611e8c565b600181602001818151611c3a9190612bcb565b611bd78260028351611ce2565b604080518082019091526060815260006020820152611c8b602083612bde565b15611cb357611c9b602083612bde565b611ca6906020612bcb565b611cb09083612844565b91505b602080840183905260405180855260008152908184010181811015611cd757600080fd5b604052509192915050565b6017816001600160401b031611611d0857825161064c9060e0600585901b168317611e23565b60ff816001600160401b031611611d48578251611d30906018611fe0600586901b1617611e23565b50825161064c906001600160401b0383166001611ea3565b61ffff816001600160401b031611611d89578251611d71906019611fe0600586901b1617611e23565b50825161064c906001600160401b0383166002611ea3565b63ffffffff816001600160401b031611611dcc578251611db490601a611fe0600586901b1617611e23565b50825161064c906001600160401b0383166004611ea3565b8251611de390601b611fe0600586901b1617611e23565b50825161064c906001600160401b0383166008611ea3565b604080518082019091526060815260006020820152611e1c83838451611f28565b9392505050565b6040805180820190915260608152600060208201528251516000611e48826001612844565b905084602001518210611e6957611e6985611e64836002612c00565b611ff9565b8451602083820101858153508051821115611e82578181525b5093949350505050565b815161090290601f611fe0600585901b1617611e23565b6040805180820190915260608152600060208201528351516000611ec78285612844565b90508560200151811115611ee457611ee486611e64836002612c00565b60006001611ef486610100612cfb565b611efe9190612bcb565b90508651828101878319825116178152508051831115611f1c578281525b50959695505050505050565b6040805180820190915260608152600060208201528251821115611f4b57600080fd5b8351516000611f5a8483612844565b90508560200151811115611f7757611f7786611e64836002612c00565b855180518382016020019160009180851115611f91578482525b505050602086015b60208610611fd15780518252611fb0602083612844565b9150611fbd602082612844565b9050611fca602087612bcb565b9550611f99565b51815160001960208890036101000a0190811690199190911617905250849150509392505050565b81516120058383611c6b565b5061064c8382611dfb565b50805461201c906127de565b6000825580601f1061202c575050565b601f0160209004906000526020600020908101906115f09190612118565b50805460008255906000526020600020908101906115f09190612131565b50805460008255906000526020600020908101906115f0919061214e565b60408051606080820183528152600060208201529081016120de6040805160e0810190915280600081526020016000815260200160008152602001606081526020016060815260200160608152602001606081525090565b905290565b604051806040016040528061210b604051806040016040528060608152602001600081525090565b8152602001600081525090565b5b8082111561212d5760008155600101612119565b5090565b8082111561212d5760006121458282612010565b50600101612131565b8082111561212d5760006121628282612010565b5060010161214e565b60006020828403121561217d57600080fd5b81356001600160e01b031981168114611e1c57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156121d3576121d3612195565b604052919050565b60006001600160401b038311156121f4576121f4612195565b612207601f8401601f19166020016121ab565b905082815283838301111561221b57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261224357600080fd5b611e1c838335602085016121db565b60008060006060848603121561226757600080fd5b8335925060208401356001600160401b038082111561228557600080fd5b61229187838801612232565b935060408601359150808211156122a757600080fd5b506122b486828701612232565b9150509250925092565b600080604083850312156122d157600080fd5b82359150602083013580151581146122e857600080fd5b809150509250929050565b634e487b7160e01b600052602160045260246000fd5b600381106115f0576115f06122f3565b6000815180845260005b8181101561233f57602081850181015186830182015201612323565b506000602082860101526020601f19601f83011685010191505092915050565b602081526001600160401b03825116602082015260018060a01b0360208301511660408201526000604083015161239581612309565b80606084015250606083015160a060808401526123b560c0840182612319565b90506080840151601f198483030160a08501526123d28282612319565b95945050505050565b6000602082840312156123ed57600080fd5b5035919050565b6000806040838503121561240757600080fd5b8235915060208301356001600160a01b03811681146122e857600080fd5b80356001600160401b038116811461243c57600080fd5b919050565b60006020828403121561245357600080fd5b611e1c82612425565b60008083601f84011261246e57600080fd5b5081356001600160401b0381111561248557600080fd5b6020830191508360208260051b85010111156124a057600080fd5b9250929050565b60008083601f8401126124b957600080fd5b5081356001600160401b038111156124d057600080fd5b6020830191508360208285010111156124a057600080fd5b60008060008060008060006080888a03121561250357600080fd5b61250c88612425565b965060208801356001600160401b038082111561252857600080fd5b6125348b838c0161245c565b909850965060408a013591508082111561254d57600080fd5b6125598b838c0161245c565b909650945060608a013591508082111561257257600080fd5b5061257f8a828b016124a7565b989b979a50959850939692959293505050565b80356003811061243c57600080fd5b60008060008060008060008060008060e08b8d0312156125c057600080fd5b6125c98b612425565b99506125d760208c01612592565b985060408b01356001600160401b03808211156125f357600080fd5b6125ff8e838f016124a7565b909a50985088915061261360608e01612592565b975060808d013591508082111561262957600080fd5b6126358e838f016124a7565b909750955060a08d0135915063ffffffff8216821461265357600080fd5b90935060c08c0135908082111561266957600080fd5b506126768d828e016124a7565b915080935050809150509295989b9194979a5092959850565b6001811061269f5761269f6122f3565b9052565b600081518084526020808501808196508360051b8101915082860160005b858110156126eb5782840389526126d9848351612319565b988501989350908401906001016126c1565b5091979650505050505050565b6020815260008251606060208401526127146080840182612319565b905063ffffffff60208501511660408401526040840151601f19848303016060850152805161274281612309565b8252602081015161275281612309565b80602084015250604081015161276b604084018261268f565b50606081015160e0606084015261278560e0840182612319565b90506080820151838203608085015261279e8282612319565b91505060a082015183820360a08501526127b882826126a3565b91505060c0820151915082810360c08401526127d481836126a3565b9695505050505050565b600181811c908216806127f257607f821691505b60208210810361281257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156103095761030961282e565b6000600182016128695761286961282e565b5060010190565b634e487b7160e01b600052603160045260246000fd5b60006001600160401b0382111561289f5761289f612195565b5060051b60200190565b60006128bc6128b784612886565b6121ab565b80848252602080830192508560051b8501368111156128da57600080fd5b855b818110156129295780356001600160401b038111156128fb5760008081fd5b870136601f82011261290d5760008081fd5b61291b3682358684016121db565b8652509382019382016128dc565b50919695505050505050565b60006129436128b784612886565b80848252602080830192508560051b85013681111561296157600080fd5b855b818110156129295780356001600160401b038111156129825760008081fd5b61298e36828a01612232565b865250938201938201612963565b601f82111561090257600081815260208120601f850160051c810160208610156129c35750805b601f850160051c820191505b818110156129e2578281556001016129cf565b505050505050565b6001600160401b03831115612a0157612a01612195565b612a1583612a0f83546127de565b8361299c565b6000601f841160018114612a495760008515612a315750838201355b600019600387901b1c1916600186901b178355612aa3565b600083815260209020601f19861690835b82811015612a7a5786850135825560209485019460019092019101612a5a565b5086821015612a975760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b81516001600160401b03811115612ac357612ac3612195565b612ad781612ad184546127de565b8461299c565b602080601f831160018114612b0c5760008415612af45750858301515b600019600386901b1c1916600185901b1785556129e2565b600085815260208120601f198616915b82811015612b3b57888601518255948401946001909101908401612b1c565b5085821015612b595787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160401b038616815260a060208201526000612b8b60a0830187612319565b61ffff9590951660408301525063ffffffff92909216606083015260809091015292915050565b600060208284031215612bc457600080fd5b5051919050565b818103818111156103095761030961282e565b600082612bfb57634e487b7160e01b600052601260045260246000fd5b500690565b80820281158282048414176103095761030961282e565b600181815b80851115612c52578160001904821115612c3857612c3861282e565b80851615612c4557918102915b93841c9390800290612c1c565b509250929050565b600082612c6957506001610309565b81612c7657506000610309565b8160018114612c8c5760028114612c9657612cb2565b6001915050610309565b60ff841115612ca757612ca761282e565b50506001821b610309565b5060208310610133831016604e8410600b8410161715612cd5575081810a610309565b612cdf8383612c17565b8060001904821115612cf357612cf361282e565b029392505050565b6000611e1c8383612c5a56fe241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08a2646970667358221220c853501b7d4e314864358724dac532054bd10ab5dc8600ff8db02415b54e281264736f6c63430008140033", + "devdoc": { + "errors": { + "AccessControlBadConfirmation()": [ + { + "details": "The caller of a function is not the expected one. NOTE: Don't confuse with {AccessControlUnauthorizedAccount}." + } + ], + "AccessControlUnauthorizedAccount(address,bytes32)": [ + { + "details": "The `account` is missing a role." + } + ], + "CCGOnlyManagerAllowed()": [ + { + "details": "Only A manager can call the function" + } + ], + "CCGOnlySameSourceAllowed(bytes32)": [ + { + "details": "Only the same source of the requestId is allowed to call the function" + } + ], + "CCGRequestAlreadyFulfilled(bytes32)": [ + { + "details": "Can't fulfill a request that has already been fulfilled" + } + ], + "CCGRequestNameEmpty()": [ + { + "details": "Can't register a request with an empty name" + } + ], + "CCGRequestNotRegistered(uint64)": [ + { + "details": "Only a registered subscriptionId is allowed to call the function" + } + ] + }, + "events": { + "RoleAdminChanged(bytes32,bytes32,bytes32)": { + "details": "Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this." + }, + "RoleGranted(bytes32,address,address)": { + "details": "Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}." + }, + "RoleRevoked(bytes32,address,address)": { + "details": "Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)" + } + }, + "kind": "dev", + "methods": { + "donId()": { + "details": "Get the DON ID", + "returns": { + "_0": "DON ID" + } + }, + "getResponse(bytes32,bool)": { + "details": "Get the response data", + "params": { + "requestId": "The request ID, returned by sendRequest()" + }, + "returns": { + "response": "CCGResponse" + } + }, + "getRoleAdmin(bytes32)": { + "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." + }, + "grantRole(bytes32,address)": { + "details": "Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event." + }, + "handleOracleFulfillment(bytes32,bytes,bytes)": { + "details": "Either response or error parameter will be set, but never both.", + "params": { + "err": "Aggregated error either from the request's source code or from the execution pipeline.", + "requestId": "The requestId returned by FunctionsClient.sendRequest().", + "response": "Aggregated response from the request's source code." + } + }, + "hasRole(bytes32,address)": { + "details": "Returns `true` if `account` has been granted `role`." + }, + "renounceRole(bytes32,address)": { + "details": "Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `callerConfirmation`. May emit a {RoleRevoked} event." + }, + "revokeRole(bytes32,address)": { + "details": "Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event." + }, + "sendRequest(uint64,string[],bytes[],bytes)": { + "params": { + "args": "String arguments passed into the source code and accessible via the global variable `args`", + "bytesArgs": "Bytes arguments passed into the source code and accessible via the global variable `bytesArgs` as hex strings", + "encryptedSecretsReference": "Reference pointing to encrypted secrets", + "subscriptionId": "Subscription ID used to pay for request (FunctionsConsumer contract address must first be added to the subscription)" + } + }, + "setDonId(bytes32)": { + "details": "Set the DON ID", + "params": { + "newDonId": "New DON ID" + } + }, + "supportsInterface(bytes4)": { + "details": "See {IERC165-supportsInterface}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "handleOracleFulfillment(bytes32,bytes,bytes)": { + "notice": "Chainlink Functions response handler called by the Functions Router during fullilment from the designated transmitter node in an OCR round." + }, + "sendRequest(uint64,string[],bytes[],bytes)": { + "notice": "Triggers an on-demand Functions request using remote encrypted secrets" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 2212, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "_roles", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_struct(RoleData)2207_storage)" + }, + { + "astId": 2663, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "_donId", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + }, + { + "astId": 2668, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "_requests", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_uint64,t_struct(CCGRequest)3246_storage)" + }, + { + "astId": 2673, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "unprocessed_responses", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_bytes32,t_struct(CCGResponse)3312_storage)" + }, + { + "astId": 2676, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "subscriptions", + "offset": 0, + "slot": "4", + "type": "t_array(t_uint64)dyn_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes_storage)dyn_storage": { + "base": "t_bytes_storage", + "encoding": "dynamic_array", + "label": "bytes[]", + "numberOfBytes": "32" + }, + "t_array(t_string_storage)dyn_storage": { + "base": "t_string_storage", + "encoding": "dynamic_array", + "label": "string[]", + "numberOfBytes": "32" + }, + "t_array(t_uint64)dyn_storage": { + "base": "t_uint64", + "encoding": "dynamic_array", + "label": "uint64[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_enum(CCGResponseState)3300": { + "encoding": "inplace", + "label": "enum ICCGatewayClient.CCGResponseState", + "numberOfBytes": "1" + }, + "t_enum(CodeLanguage)286": { + "encoding": "inplace", + "label": "enum FunctionsRequest.CodeLanguage", + "numberOfBytes": "1" + }, + "t_enum(Location)284": { + "encoding": "inplace", + "label": "enum FunctionsRequest.Location", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_bytes32,t_struct(CCGResponse)3312_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct ICCGatewayClient.CCGResponse)", + "numberOfBytes": "32", + "value": "t_struct(CCGResponse)3312_storage" + }, + "t_mapping(t_bytes32,t_struct(RoleData)2207_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct AccessControl.RoleData)", + "numberOfBytes": "32", + "value": "t_struct(RoleData)2207_storage" + }, + "t_mapping(t_uint64,t_struct(CCGRequest)3246_storage)": { + "encoding": "mapping", + "key": "t_uint64", + "label": "mapping(uint64 => struct ICCGateway.CCGRequest)", + "numberOfBytes": "32", + "value": "t_struct(CCGRequest)3246_storage" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(CCGRequest)3246_storage": { + "encoding": "inplace", + "label": "struct ICCGateway.CCGRequest", + "members": [ + { + "astId": 3240, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "name", + "offset": 0, + "slot": "0", + "type": "t_string_storage" + }, + { + "astId": 3242, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "callbackGasLimit", + "offset": 0, + "slot": "1", + "type": "t_uint32" + }, + { + "astId": 3245, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "config", + "offset": 0, + "slot": "2", + "type": "t_struct(Request)306_storage" + } + ], + "numberOfBytes": "224" + }, + "t_struct(CCGResponse)3312_storage": { + "encoding": "inplace", + "label": "struct ICCGatewayClient.CCGResponse", + "members": [ + { + "astId": 3302, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "subscriptionId", + "offset": 0, + "slot": "0", + "type": "t_uint64" + }, + { + "astId": 3304, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "source", + "offset": 8, + "slot": "0", + "type": "t_address" + }, + { + "astId": 3307, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "state", + "offset": 28, + "slot": "0", + "type": "t_enum(CCGResponseState)3300" + }, + { + "astId": 3309, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "data", + "offset": 0, + "slot": "1", + "type": "t_bytes_storage" + }, + { + "astId": 3311, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "error", + "offset": 0, + "slot": "2", + "type": "t_bytes_storage" + } + ], + "numberOfBytes": "96" + }, + "t_struct(Request)306_storage": { + "encoding": "inplace", + "label": "struct FunctionsRequest.Request", + "members": [ + { + "astId": 289, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "codeLocation", + "offset": 0, + "slot": "0", + "type": "t_enum(Location)284" + }, + { + "astId": 292, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "secretsLocation", + "offset": 1, + "slot": "0", + "type": "t_enum(Location)284" + }, + { + "astId": 295, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "language", + "offset": 2, + "slot": "0", + "type": "t_enum(CodeLanguage)286" + }, + { + "astId": 297, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "source", + "offset": 0, + "slot": "1", + "type": "t_string_storage" + }, + { + "astId": 299, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "encryptedSecretsReference", + "offset": 0, + "slot": "2", + "type": "t_bytes_storage" + }, + { + "astId": 302, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "args", + "offset": 0, + "slot": "3", + "type": "t_array(t_string_storage)dyn_storage" + }, + { + "astId": 305, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "bytesArgs", + "offset": 0, + "slot": "4", + "type": "t_array(t_bytes_storage)dyn_storage" + } + ], + "numberOfBytes": "160" + }, + "t_struct(RoleData)2207_storage": { + "encoding": "inplace", + "label": "struct AccessControl.RoleData", + "members": [ + { + "astId": 2204, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "hasRole", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 2206, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "adminRole", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + } + ], + "numberOfBytes": "64" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint64": { + "encoding": "inplace", + "label": "uint64", + "numberOfBytes": "8" + } + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/optimismSepolia/CCNotificationClient.json b/packages/hardhat/deployments/optimismSepolia/CCNotificationClient.json new file mode 100644 index 0000000..3541cba --- /dev/null +++ b/packages/hardhat/deployments/optimismSepolia/CCNotificationClient.json @@ -0,0 +1,215 @@ +{ + "address": "0xa5c0FBac120fAc50dbBe1A3D6f2a189dFc4C195c", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "gatewayAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "error", + "type": "string" + } + ], + "name": "ErrorReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "response", + "type": "string" + } + ], + "name": "ResponseReceived", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + } + ], + "name": "callback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "encryptedSecretsReference", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "args", + "type": "string[]" + }, + { + "internalType": "bytes[]", + "name": "bytesArgs", + "type": "bytes[]" + } + ], + "name": "request", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "subscriptionId", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_encryptedSecretsReference", + "type": "bytes" + } + ], + "name": "updateEncryptedSecretsReference", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "_subscriptionId", + "type": "uint64" + } + ], + "name": "updateSubscriptionId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xe684d4e9e4d760e5d07aba956a2cd956508e82fa2261d85706ecfa05e228e73f", + "receipt": { + "to": null, + "from": "0xD10F43A0aa00D244DAcFBE3C49b9B918B717Ff2c", + "contractAddress": "0xa5c0FBac120fAc50dbBe1A3D6f2a189dFc4C195c", + "transactionIndex": 1, + "gasUsed": "686011", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x51e864b3945191f3147e579ed653e6f574a43a8f2f7f41497483c6dea78790ea", + "transactionHash": "0xe684d4e9e4d760e5d07aba956a2cd956508e82fa2261d85706ecfa05e228e73f", + "logs": [], + "blockNumber": 12753428, + "cumulativeGasUsed": "741098", + "status": 1, + "byzantium": true + }, + "args": [ + "0x0910A0FE7881D332230Ce1FB7f2BaA1Ebe527473" + ], + "numDeployments": 1, + "solcInputHash": "da2f6e6d8541f69733b0b28912d4a325", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"gatewayAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"error\",\"type\":\"string\"}],\"name\":\"ErrorReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"response\",\"type\":\"string\"}],\"name\":\"ResponseReceived\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"callback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"encryptedSecretsReference\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"args\",\"type\":\"string[]\"},{\"internalType\":\"bytes[]\",\"name\":\"bytesArgs\",\"type\":\"bytes[]\"}],\"name\":\"request\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"subscriptionId\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_encryptedSecretsReference\",\"type\":\"bytes\"}],\"name\":\"updateEncryptedSecretsReference\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_subscriptionId\",\"type\":\"uint64\"}],\"name\":\"updateSubscriptionId\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/CCNotificationClient.sol\":\"CCNotificationClient\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\n/// @title Chainlink Functions client interface.\\ninterface IFunctionsClient {\\n /// @notice Chainlink Functions response handler called by the Functions Router\\n /// during fullilment from the designated transmitter node in an OCR round.\\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\\n /// @param response Aggregated response from the request's source code.\\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\\n /// @dev Either response or error parameter will be set, but never both.\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\\n}\\n\",\"keccak256\":\"0x6117b82e7c4eec44ce557b0fc8bc1ac5f49e5d160ac6d4485452d6aafdd762ff\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {FunctionsResponse} from \\\"../libraries/FunctionsResponse.sol\\\";\\n\\n/// @title Chainlink Functions Router interface.\\ninterface IFunctionsRouter {\\n /// @notice The identifier of the route to retrieve the address of the access control contract\\n /// The access control contract controls which accounts can manage subscriptions\\n /// @return id - bytes32 id that can be passed to the \\\"getContractById\\\" of the Router\\n function getAllowListId() external view returns (bytes32);\\n\\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\\n /// The access control contract controls which accounts can manage subscriptions\\n function setAllowListId(bytes32 allowListId) external;\\n\\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\\n /// @return adminFee\\n function getAdminFee() external view returns (uint72 adminFee);\\n\\n /// @notice Sends a request using the provided subscriptionId\\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\\n /// a client can make requests from different contracts referencing the same subscription\\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\\n /// @param dataVersion - Gas limit for the fulfillment callback\\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\\n /// @param donId - An identifier used to determine which route to send the request along\\n /// @return requestId - A unique request identifier\\n function sendRequest(\\n uint64 subscriptionId,\\n bytes calldata data,\\n uint16 dataVersion,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) external returns (bytes32);\\n\\n /// @notice Sends a request to the proposed contracts\\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\\n /// a client can make requests from different contracts referencing the same subscription\\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\\n /// @param dataVersion - Gas limit for the fulfillment callback\\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\\n /// @param donId - An identifier used to determine which route to send the request along\\n /// @return requestId - A unique request identifier\\n function sendRequestToProposed(\\n uint64 subscriptionId,\\n bytes calldata data,\\n uint16 dataVersion,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) external returns (bytes32);\\n\\n /// @notice Fulfill the request by:\\n /// - calling back the data that the Oracle returned to the client contract\\n /// - pay the DON for processing the request\\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\\n /// @param response response data from DON consensus\\n /// @param err error from DON consensus\\n /// @param juelsPerGas - current rate of juels/gas\\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\\n /// @param transmitter - The Node that transmitted the OCR report\\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\\n /// @return fulfillResult -\\n /// @return callbackGasCostJuels -\\n function fulfill(\\n bytes memory response,\\n bytes memory err,\\n uint96 juelsPerGas,\\n uint96 costWithoutFulfillment,\\n address transmitter,\\n FunctionsResponse.Commitment memory commitment\\n ) external returns (FunctionsResponse.FulfillResult, uint96);\\n\\n /// @notice Validate requested gas limit is below the subscription max.\\n /// @param subscriptionId subscription ID\\n /// @param callbackGasLimit desired callback gas limit\\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\\n\\n /// @notice Get the current contract given an ID\\n /// @param id A bytes32 identifier for the route\\n /// @return contract The current contract address\\n function getContractById(bytes32 id) external view returns (address);\\n\\n /// @notice Get the proposed next contract given an ID\\n /// @param id A bytes32 identifier for the route\\n /// @return contract The current or proposed contract address\\n function getProposedContractById(bytes32 id) external view returns (address);\\n\\n /// @notice Return the latest proprosal set\\n /// @return ids The identifiers of the contracts to update\\n /// @return to The addresses of the contracts that will be updated to\\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\\n\\n /// @notice Proposes one or more updates to the contract routes\\n /// @dev Only callable by owner\\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\\n\\n /// @notice Updates the current contract routes to the proposed contracts\\n /// @dev Only callable by owner\\n function updateContracts() external;\\n\\n /// @dev Puts the system into an emergency stopped state.\\n /// @dev Only callable by owner\\n function pause() external;\\n\\n /// @dev Takes the system out of an emergency stopped state.\\n /// @dev Only callable by owner\\n function unpause() external;\\n}\\n\",\"keccak256\":\"0x44db41e8ff90c2828ca0ada125abc4b411921a86514a4a047fd9fd43ba9d7e08\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {CBOR} from \\\"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\\\";\\n\\n/// @title Library for encoding the input data of a Functions request into CBOR\\nlibrary FunctionsRequest {\\n using CBOR for CBOR.CBORBuffer;\\n\\n uint16 public constant REQUEST_DATA_VERSION = 1;\\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\\n\\n enum Location {\\n Inline, // Provided within the Request\\n Remote, // Hosted through remote location that can be accessed through a provided URL\\n DONHosted // Hosted on the DON's storage\\n }\\n\\n enum CodeLanguage {\\n JavaScript\\n // In future version we may add other languages\\n }\\n\\n struct Request {\\n Location codeLocation; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The location of the source code that will be executed on each node in the DON\\n Location secretsLocation; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The location of secrets that will be passed into the source code. *Only Remote secrets are supported\\n CodeLanguage language; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The coding language that the source code is written in\\n string source; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\\n bytes encryptedSecretsReference; // \\u2550\\u2550\\u2578 Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\\n string[] args; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 String arguments that will be passed into the source code\\n bytes[] bytesArgs; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Bytes arguments that will be passed into the source code\\n }\\n\\n error EmptySource();\\n error EmptySecrets();\\n error EmptyArgs();\\n error NoInlineSecrets();\\n\\n /// @notice Encodes a Request to CBOR encoded bytes\\n /// @param self The request to encode\\n /// @return CBOR encoded bytes\\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\\n\\n buffer.writeString(\\\"codeLocation\\\");\\n buffer.writeUInt256(uint256(self.codeLocation));\\n\\n buffer.writeString(\\\"language\\\");\\n buffer.writeUInt256(uint256(self.language));\\n\\n buffer.writeString(\\\"source\\\");\\n buffer.writeString(self.source);\\n\\n if (self.args.length > 0) {\\n buffer.writeString(\\\"args\\\");\\n buffer.startArray();\\n for (uint256 i = 0; i < self.args.length; ++i) {\\n buffer.writeString(self.args[i]);\\n }\\n buffer.endSequence();\\n }\\n\\n if (self.encryptedSecretsReference.length > 0) {\\n if (self.secretsLocation == Location.Inline) {\\n revert NoInlineSecrets();\\n }\\n buffer.writeString(\\\"secretsLocation\\\");\\n buffer.writeUInt256(uint256(self.secretsLocation));\\n buffer.writeString(\\\"secrets\\\");\\n buffer.writeBytes(self.encryptedSecretsReference);\\n }\\n\\n if (self.bytesArgs.length > 0) {\\n buffer.writeString(\\\"bytesArgs\\\");\\n buffer.startArray();\\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\\n buffer.writeBytes(self.bytesArgs[i]);\\n }\\n buffer.endSequence();\\n }\\n\\n return buffer.buf.buf;\\n }\\n\\n /// @notice Initializes a Chainlink Functions Request\\n /// @dev Sets the codeLocation and code on the request\\n /// @param self The uninitialized request\\n /// @param codeLocation The user provided source code location\\n /// @param language The programming language of the user code\\n /// @param source The user provided source code or a url\\n function initializeRequest(\\n Request memory self,\\n Location codeLocation,\\n CodeLanguage language,\\n string memory source\\n ) internal pure {\\n if (bytes(source).length == 0) revert EmptySource();\\n\\n self.codeLocation = codeLocation;\\n self.language = language;\\n self.source = source;\\n }\\n\\n /// @notice Initializes a Chainlink Functions Request\\n /// @dev Simplified version of initializeRequest for PoC\\n /// @param self The uninitialized request\\n /// @param javaScriptSource The user provided JS code (must not be empty)\\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\\n }\\n\\n /// @notice Adds Remote user encrypted secrets to a Request\\n /// @param self The initialized request\\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\\n\\n self.secretsLocation = Location.Remote;\\n self.encryptedSecretsReference = encryptedSecretsReference;\\n }\\n\\n /// @notice Adds DON-hosted secrets reference to a Request\\n /// @param self The initialized request\\n /// @param slotID Slot ID of the user's secrets hosted on DON\\n /// @param version User data version (for the slotID)\\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\\n\\n buffer.writeString(\\\"slotID\\\");\\n buffer.writeUInt64(slotID);\\n buffer.writeString(\\\"version\\\");\\n buffer.writeUInt64(version);\\n\\n self.secretsLocation = Location.DONHosted;\\n self.encryptedSecretsReference = buffer.buf.buf;\\n }\\n\\n /// @notice Sets args for the user run function\\n /// @param self The initialized request\\n /// @param args The array of string args (must not be empty)\\n function setArgs(Request memory self, string[] memory args) internal pure {\\n if (args.length == 0) revert EmptyArgs();\\n\\n self.args = args;\\n }\\n\\n /// @notice Sets bytes args for the user run function\\n /// @param self The initialized request\\n /// @param args The array of bytes args (must not be empty)\\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\\n if (args.length == 0) revert EmptyArgs();\\n\\n self.bytesArgs = args;\\n }\\n}\\n\",\"keccak256\":\"0xed75be0eaba358d468f1fe18adc377d5044f57eff0070081f884a1f212d0adc2\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\n/// @title Library of types that are used for fulfillment of a Functions request\\nlibrary FunctionsResponse {\\n // Used to send request information from the Router to the Coordinator\\n struct RequestMeta {\\n bytes data; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\\n bytes32 flags; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Per-subscription flags\\n address requestingContract; // \\u2550\\u2550\\u2557 The client contract that is sending the request\\n uint96 availableBalance; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u255d Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\\n uint72 adminFee; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\\n uint64 subscriptionId; // \\u2551 Identifier of the billing subscription that will be charged for the request\\n uint64 initiatedRequests; // \\u2551 The number of requests that have been started\\n uint32 callbackGasLimit; // \\u2551 The amount of gas that the callback to the consuming contract will be given\\n uint16 dataVersion; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The version of the structure of the CBOR encoded request data\\n uint64 completedRequests; // \\u2550\\u2550\\u2550\\u2550\\u2557 The number of requests that have successfully completed or timed out\\n address subscriptionOwner; // \\u2550\\u2550\\u2550\\u255d The owner of the billing subscription\\n }\\n\\n enum FulfillResult {\\n FULFILLED, // 0\\n USER_CALLBACK_ERROR, // 1\\n INVALID_REQUEST_ID, // 2\\n COST_EXCEEDS_COMMITMENT, // 3\\n INSUFFICIENT_GAS_PROVIDED, // 4\\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\\n INVALID_COMMITMENT // 6\\n }\\n\\n struct Commitment {\\n bytes32 requestId; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 A unique identifier for a Chainlink Functions request\\n address coordinator; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 The Coordinator contract that manages the DON that is servicing a request\\n uint96 estimatedTotalCostJuels; // \\u2550\\u2550\\u2550\\u2550\\u255d The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\\n address client; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 The client contract that sent the request\\n uint64 subscriptionId; // \\u2551 Identifier of the billing subscription that will be charged for the request\\n uint32 callbackGasLimit; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The amount of gas that the callback to the consuming contract will be given\\n uint72 adminFee; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\\n uint72 donFee; // \\u2551 Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\\n uint40 gasOverheadBeforeCallback; // \\u2551 Represents the average gas execution cost before the fulfillment callback.\\n uint40 gasOverheadAfterCallback; // \\u2551 Represents the average gas execution cost after the fulfillment callback.\\n uint32 timeoutTimestamp; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The timestamp at which a request will be eligible to be timed out\\n }\\n}\\n\",\"keccak256\":\"0xc72eb037effef32146f7cd4086af00f44f28c8649d891e5e404fec5fda7e802b\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {IFunctionsRouter} from \\\"../v1_0_0/interfaces/IFunctionsRouter.sol\\\";\\nimport {IFunctionsClient} from \\\"../v1_0_0/interfaces/IFunctionsClient.sol\\\";\\n\\nimport {FunctionsRequest} from \\\"../v1_0_0/libraries/FunctionsRequest.sol\\\";\\n\\n/// @title The Chainlink Functions client contract\\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\\nabstract contract FunctionsClient is IFunctionsClient {\\n using FunctionsRequest for FunctionsRequest.Request;\\n\\n IFunctionsRouter internal immutable i_functionsRouter;\\n\\n event RequestSent(bytes32 indexed id);\\n event RequestFulfilled(bytes32 indexed id);\\n\\n error OnlyRouterCanFulfill();\\n\\n constructor(address router) {\\n i_functionsRouter = IFunctionsRouter(router);\\n }\\n\\n /// @notice Sends a Chainlink Functions request\\n /// @param data The CBOR encoded bytes data for a Functions request\\n /// @param subscriptionId The subscription ID that will be charged to service the request\\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\\n /// @return requestId The generated request ID for this request\\n function _sendRequest(\\n bytes memory data,\\n uint64 subscriptionId,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) internal returns (bytes32) {\\n bytes32 requestId = i_functionsRouter.sendRequest(\\n subscriptionId,\\n data,\\n FunctionsRequest.REQUEST_DATA_VERSION,\\n callbackGasLimit,\\n donId\\n );\\n emit RequestSent(requestId);\\n return requestId;\\n }\\n\\n /// @notice User defined function to handle a response from the DON\\n /// @param requestId The request ID, returned by sendRequest()\\n /// @param response Aggregated response from the execution of the user's source code\\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\\n /// @dev Either response or error parameter will be set, but never both\\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\\n\\n /// @inheritdoc IFunctionsClient\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\\n if (msg.sender != address(i_functionsRouter)) {\\n revert OnlyRouterCanFulfill();\\n }\\n _fulfillRequest(requestId, response, err);\\n emit RequestFulfilled(requestId);\\n }\\n}\\n\",\"keccak256\":\"0xdc40f1e9dea8a572d43d310afa68e978c35218d16097b9cfd9d1b6137df3cd0a\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-2-Clause\\npragma solidity ^0.8.4;\\n\\n/**\\n* @dev A library for working with mutable byte buffers in Solidity.\\n*\\n* Byte buffers are mutable and expandable, and provide a variety of primitives\\n* for appending to them. At any time you can fetch a bytes object containing the\\n* current contents of the buffer. The bytes object should not be stored between\\n* operations, as it may change due to resizing of the buffer.\\n*/\\nlibrary Buffer {\\n /**\\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\\n * a capacity. The capacity may be longer than the current value, in\\n * which case it can be extended without the need to allocate more memory.\\n */\\n struct buffer {\\n bytes buf;\\n uint capacity;\\n }\\n\\n /**\\n * @dev Initializes a buffer with an initial capacity.\\n * @param buf The buffer to initialize.\\n * @param capacity The number of bytes of space to allocate the buffer.\\n * @return The buffer, for chaining.\\n */\\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\\n if (capacity % 32 != 0) {\\n capacity += 32 - (capacity % 32);\\n }\\n // Allocate space for the buffer data\\n buf.capacity = capacity;\\n assembly {\\n let ptr := mload(0x40)\\n mstore(buf, ptr)\\n mstore(ptr, 0)\\n let fpm := add(32, add(ptr, capacity))\\n if lt(fpm, ptr) {\\n revert(0, 0)\\n }\\n mstore(0x40, fpm)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Initializes a new buffer from an existing bytes object.\\n * Changes to the buffer may mutate the original value.\\n * @param b The bytes object to initialize the buffer with.\\n * @return A new buffer.\\n */\\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\\n buffer memory buf;\\n buf.buf = b;\\n buf.capacity = b.length;\\n return buf;\\n }\\n\\n function resize(buffer memory buf, uint capacity) private pure {\\n bytes memory oldbuf = buf.buf;\\n init(buf, capacity);\\n append(buf, oldbuf);\\n }\\n\\n /**\\n * @dev Sets buffer length to 0.\\n * @param buf The buffer to truncate.\\n * @return The original buffer, for chaining..\\n */\\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\\n assembly {\\n let bufptr := mload(buf)\\n mstore(bufptr, 0)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to copy.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\\n require(len <= data.length);\\n\\n uint off = buf.buf.length;\\n uint newCapacity = off + len;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint dest;\\n uint src;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Length of existing buffer data\\n let buflen := mload(bufptr)\\n // Start address = buffer address + offset + sizeof(buffer length)\\n dest := add(add(bufptr, 32), off)\\n // Update buffer length if we're extending it\\n if gt(newCapacity, buflen) {\\n mstore(bufptr, newCapacity)\\n }\\n src := add(data, 32)\\n }\\n\\n // Copy word-length chunks while possible\\n for (; len >= 32; len -= 32) {\\n assembly {\\n mstore(dest, mload(src))\\n }\\n dest += 32;\\n src += 32;\\n }\\n\\n // Copy remaining bytes\\n unchecked {\\n uint mask = (256 ** (32 - len)) - 1;\\n assembly {\\n let srcpart := and(mload(src), not(mask))\\n let destpart := and(mload(dest), mask)\\n mstore(dest, or(destpart, srcpart))\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\\n return append(buf, data, data.length);\\n }\\n\\n /**\\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\\n * capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint offPlusOne = off + 1;\\n if (off >= buf.capacity) {\\n resize(buf, offPlusOne * 2);\\n }\\n\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + off\\n let dest := add(add(bufptr, off), 32)\\n mstore8(dest, data)\\n // Update buffer length if we extended it\\n if gt(offPlusOne, mload(bufptr)) {\\n mstore(bufptr, offPlusOne)\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (left-aligned).\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n unchecked {\\n uint mask = (256 ** len) - 1;\\n // Right-align data\\n data = data >> (8 * (32 - len));\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chhaining.\\n */\\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\\n return append(buf, bytes32(data), 20);\\n }\\n\\n /**\\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\\n return append(buf, data, 32);\\n }\\n\\n /**\\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (right-aligned).\\n * @return The original buffer.\\n */\\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint mask = (256 ** len) - 1;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n return buf;\\n }\\n}\",\"keccak256\":\"0x0d86b367813922094e02594a406ba89f5e97d3d74ec2ce3c4032566840e302b0\",\"license\":\"BSD-2-Clause\"},\"@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.4;\\n\\nimport \\\"../../@ensdomains/buffer/v0.1.0/Buffer.sol\\\";\\n\\n/**\\n* @dev A library for populating CBOR encoded payload in Solidity.\\n*\\n* https://datatracker.ietf.org/doc/html/rfc7049\\n*\\n* The library offers various write* and start* methods to encode values of different types.\\n* The resulted buffer can be obtained with data() method.\\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\\n* in an invalid CBOR if start/write/end flow is violated.\\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\\n* except for nested start/end pairs.\\n*/\\n\\nlibrary CBOR {\\n using Buffer for Buffer.buffer;\\n\\n struct CBORBuffer {\\n Buffer.buffer buf;\\n uint256 depth;\\n }\\n\\n uint8 private constant MAJOR_TYPE_INT = 0;\\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\\n uint8 private constant MAJOR_TYPE_BYTES = 2;\\n uint8 private constant MAJOR_TYPE_STRING = 3;\\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\\n uint8 private constant MAJOR_TYPE_MAP = 5;\\n uint8 private constant MAJOR_TYPE_TAG = 6;\\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\\n\\n uint8 private constant TAG_TYPE_BIGNUM = 2;\\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\\n\\n uint8 private constant CBOR_FALSE = 20;\\n uint8 private constant CBOR_TRUE = 21;\\n uint8 private constant CBOR_NULL = 22;\\n uint8 private constant CBOR_UNDEFINED = 23;\\n\\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\\n Buffer.init(cbor.buf, capacity);\\n cbor.depth = 0;\\n return cbor;\\n }\\n\\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\\n require(buf.depth == 0, \\\"Invalid CBOR\\\");\\n return buf.buf.buf;\\n }\\n\\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\\n writeBytes(buf, abi.encode(value));\\n }\\n\\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\\n if (value < 0) {\\n buf.buf.appendUint8(\\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\\n );\\n writeBytes(buf, abi.encode(uint256(-1 - value)));\\n } else {\\n writeUInt256(buf, uint256(value));\\n }\\n }\\n\\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\\n }\\n\\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\\n if(value >= 0) {\\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\\n } else{\\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\\n }\\n }\\n\\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\\n buf.buf.append(value);\\n }\\n\\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\\n buf.buf.append(bytes(value));\\n }\\n\\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\\n }\\n\\n function writeNull(CBORBuffer memory buf) internal pure {\\n writeContentFree(buf, CBOR_NULL);\\n }\\n\\n function writeUndefined(CBORBuffer memory buf) internal pure {\\n writeContentFree(buf, CBOR_UNDEFINED);\\n }\\n\\n function startArray(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\\n buf.depth += 1;\\n }\\n\\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\\n }\\n\\n function startMap(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\\n buf.depth += 1;\\n }\\n\\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\\n }\\n\\n function endSequence(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\\n buf.depth -= 1;\\n }\\n\\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\\n writeString(buf, key);\\n writeString(buf, value);\\n }\\n\\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\\n writeString(buf, key);\\n writeBytes(buf, value);\\n }\\n\\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\\n writeString(buf, key);\\n writeUInt256(buf, value);\\n }\\n\\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\\n writeString(buf, key);\\n writeInt256(buf, value);\\n }\\n\\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\\n writeString(buf, key);\\n writeUInt64(buf, value);\\n }\\n\\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\\n writeString(buf, key);\\n writeInt64(buf, value);\\n }\\n\\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\\n writeString(buf, key);\\n writeBool(buf, value);\\n }\\n\\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n writeNull(buf);\\n }\\n\\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n writeUndefined(buf);\\n }\\n\\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n startMap(buf);\\n }\\n\\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n startArray(buf);\\n }\\n\\n function writeFixedNumeric(\\n CBORBuffer memory buf,\\n uint8 major,\\n uint64 value\\n ) private pure {\\n if (value <= 23) {\\n buf.buf.appendUint8(uint8((major << 5) | value));\\n } else if (value <= 0xFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 24));\\n buf.buf.appendInt(value, 1);\\n } else if (value <= 0xFFFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 25));\\n buf.buf.appendInt(value, 2);\\n } else if (value <= 0xFFFFFFFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 26));\\n buf.buf.appendInt(value, 4);\\n } else {\\n buf.buf.appendUint8(uint8((major << 5) | 27));\\n buf.buf.appendInt(value, 8);\\n }\\n }\\n\\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\\n private\\n pure\\n {\\n buf.buf.appendUint8(uint8((major << 5) | 31));\\n }\\n\\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\\n private\\n pure\\n {\\n writeFixedNumeric(buf, major, length);\\n }\\n\\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\\n }\\n}\",\"keccak256\":\"0xdecf04203502670ac72ba466c75e4f87f4419907365005f0d73e7d07ee3e5715\",\"license\":\"MIT\"},\"contracts/CCExampleClient.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {ICCGatewayClient} from \\\"./interfaces/ICCGatewayClient.sol\\\";\\nimport {ICCGateway} from \\\"./interfaces/ICCGateway.sol\\\";\\n\\ncontract CCExampleClient is ICCGatewayClient {\\n ICCGateway private immutable gateway;\\n\\n uint64 public subscriptionId = 0;\\n bytes public encryptedSecretsReference = \\\"\\\";\\n\\n event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response);\\n event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error);\\n\\n constructor(address gatewayAddress) {\\n gateway = ICCGateway(gatewayAddress);\\n }\\n\\n function updateSubscriptionId(uint64 _subscriptionId) external {\\n subscriptionId = _subscriptionId;\\n }\\n\\n function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external {\\n encryptedSecretsReference = _encryptedSecretsReference;\\n }\\n\\n function request(string[] calldata args, bytes[] calldata bytesArgs) external {\\n require(subscriptionId != 0, \\\"Subscription ID not set\\\");\\n\\n gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference);\\n }\\n\\n function callback(bytes32 requestId) external override {\\n ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true);\\n\\n if (response.state == ICCGatewayClient.CCGResponseState.Success) {\\n emit ResponseReceived(response.subscriptionId, requestId, string(response.data));\\n } else {\\n emit ErrorReceived(response.subscriptionId, requestId, string(response.error));\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf905275976390214962167d4896d9c0eab670fce2b5f5cfd213b1ae2d776347a\",\"license\":\"UNLICENSED\"},\"contracts/CCNotificationClient.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {CCExampleClient} from \\\"./CCExampleClient.sol\\\";\\n\\ncontract CCNotificationClient is CCExampleClient {\\n constructor(address gatewayAddress) CCExampleClient(gatewayAddress) {}\\n}\\n\",\"keccak256\":\"0xad7961e1ea78babecd98162342bf18b8ae44e34f6ea1d0f32533666659f68ef5\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/ICCGateway.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\\nimport {FunctionsRequest} from \\\"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\\\";\\n\\ninterface ICCGateway {\\n struct CCGRequest {\\n string name;\\n uint32 callbackGasLimit;\\n FunctionsRequest.Request config;\\n }\\n\\n /**\\n * @dev Can't register a request with an empty name\\n */\\n error CCGRequestNameEmpty();\\n\\n /**\\n * @dev Only the same source of the requestId is allowed to call the function\\n */\\n error CCGOnlySameSourceAllowed(bytes32 requestId);\\n\\n /**\\n * @dev Only a registered subscriptionId is allowed to call the function\\n */\\n error CCGRequestNotRegistered(uint64 subscriptionId);\\n\\n /**\\n * @dev Can't fulfill a request that has already been fulfilled\\n */\\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\\n\\n /**\\n * @dev Only A manager can call the function\\n */\\n error CCGOnlyManagerAllowed();\\n\\n /**\\n * @dev Send a request to the Functions DON\\n */\\n function sendRequest(\\n uint64 subscriptionId,\\n string[] calldata args,\\n bytes[] calldata bytesArgs,\\n bytes calldata encryptedSecretsReference\\n ) external returns (bytes32 requestId);\\n\\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\\n}\\n\",\"keccak256\":\"0xbc7d92f8db240767c8636e8df9b818cc1f5abfde22b8c49eee50f418fb0dbea5\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/ICCGatewayClient.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\ninterface ICCGatewayClient {\\n enum CCGResponseState {Sent, Success, Error}\\n\\n struct CCGResponse {\\n uint64 subscriptionId;\\n address source;\\n CCGResponseState state;\\n bytes data;\\n bytes error;\\n }\\n\\n function callback(bytes32 requestId) external;\\n}\\n\",\"keccak256\":\"0xb69320aa2152f374dec4cfc70b73f46e0db9774a1411d2acff1481ee3295f86a\",\"license\":\"UNLICENSED\"}},\"version\":1}", + "bytecode": "0x600080546001600160401b031916815560c060405260a090815260019062000028908262000110565b503480156200003657600080fd5b5060405162000d6a38038062000d6a8339810160408190526200005991620001dc565b6001600160a01b03166080526200020e565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200009657607f821691505b602082108103620000b757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200010b57600081815260208120601f850160051c81016020861015620000e65750805b601f850160051c820191505b818110156200010757828155600101620000f2565b5050505b505050565b81516001600160401b038111156200012c576200012c6200006b565b62000144816200013d845462000081565b84620000bd565b602080601f8311600181146200017c5760008415620001635750858301515b600019600386901b1c1916600185901b17855562000107565b600085815260208120601f198616915b82811015620001ad578886015182559484019460019091019084016200018c565b5085821015620001cc5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215620001ef57600080fd5b81516001600160a01b03811681146200020757600080fd5b9392505050565b608051610b39620002316000396000818161023101526102e30152610b396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806309c1ba2e1461006757806314b1dd1b146100975780634ce64f0e146100ca578063cdc634f1146100dd578063cfd58386146100f2578063df13994e14610105575b600080fd5b60005461007a906001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b6100c86100a5366004610415565b6000805467ffffffffffffffff19166001600160401b0392909216919091179055565b005b6100c86100d8366004610439565b610118565b6100e561012a565b60405161008e91906104fa565b6100c8610100366004610558565b6101b8565b6100c86101133660046105c3565b6102c3565b600161012582848361067a565b505050565b60018054610137906105f2565b80601f0160208091040260200160405190810160405280929190818152602001828054610163906105f2565b80156101b05780601f10610185576101008083540402835291602001916101b0565b820191906000526020600020905b81548152906001019060200180831161019357829003601f168201915b505050505081565b600080546001600160401b031690036102175760405162461bcd60e51b815260206004820152601760248201527f537562736372697074696f6e204944206e6f7420736574000000000000000000604482015260640160405180910390fd5b600054604051634b60ac1760e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916396c1582e91610279916001600160401b0316908890889088908890600190600401610824565b6020604051808303816000875af1158015610298573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bc919061090d565b5050505050565b6040516315b851d160e01b815260048101829052600160248201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906315b851d1906044016000604051808303816000875af1158015610334573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261035c91908101906109e9565b905060018160400151600281111561037657610376610abc565b036103c2577fa5522492de1ed169e1e5e76f6cb2ceb5f045ca7f7ea5da3137c573d996cc4b9f81600001518383606001516040516103b693929190610ad2565b60405180910390a15050565b7f331e0adccd60eab7ca94cf49c60a45549ce9dc1281139656a13bdf73774d179c81600001518383608001516040516103b693929190610ad2565b6001600160401b038116811461041257600080fd5b50565b60006020828403121561042757600080fd5b8135610432816103fd565b9392505050565b6000806020838503121561044c57600080fd5b82356001600160401b038082111561046357600080fd5b818501915085601f83011261047757600080fd5b81358181111561048657600080fd5b86602082850101111561049857600080fd5b60209290920196919550909350505050565b60005b838110156104c55781810151838201526020016104ad565b50506000910152565b600081518084526104e68160208601602086016104aa565b601f01601f19169290920160200192915050565b60208152600061043260208301846104ce565b60008083601f84011261051f57600080fd5b5081356001600160401b0381111561053657600080fd5b6020830191508360208260051b850101111561055157600080fd5b9250929050565b6000806000806040858703121561056e57600080fd5b84356001600160401b038082111561058557600080fd5b6105918883890161050d565b909650945060208701359150808211156105aa57600080fd5b506105b78782880161050d565b95989497509550505050565b6000602082840312156105d557600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061060657607f821691505b60208210810361062657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561012557600081815260208120601f850160051c810160208610156106535750805b601f850160051c820191505b818110156106725782815560010161065f565b505050505050565b6001600160401b03831115610691576106916105dc565b6106a58361069f83546105f2565b8361062c565b6000601f8411600181146106d957600085156106c15750838201355b600019600387901b1c1916600186901b1783556102bc565b600083815260209020601f19861690835b8281101561070a57868501358255602094850194600190920191016106ea565b50868210156107275760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000808335601e1984360301811261077957600080fd5b83016020810192503590506001600160401b0381111561079857600080fd5b80360382131561055157600080fd5b600081546107b4816105f2565b8085526020600183811680156107d157600181146107eb57610819565b60ff1985168884015283151560051b880183019550610819565b866000528260002060005b858110156108115781548a82018601529083019084016107f6565b890184019650505b505050505092915050565b6000608082016001600160401b038916835260206080818501528188835260a08501905060a08960051b86010192508960005b8a81101561089157868503609f19018352610872828d610762565b61087d878284610739565b965050509183019190830190600101610857565b5050508382036040850152858252808201600587901b830182018860005b898110156108e957858303601f190184526108ca828c610762565b6108d5858284610739565b9587019594505050908401906001016108af565b505085810360608701526108fd81886107a7565b9c9b505050505050505050505050565b60006020828403121561091f57600080fd5b5051919050565b60405160a081016001600160401b0381118282101715610948576109486105dc565b60405290565b80516003811061095d57600080fd5b919050565b600082601f83011261097357600080fd5b81516001600160401b038082111561098d5761098d6105dc565b604051601f8301601f19908116603f011681019082821181831017156109b5576109b56105dc565b816040528381528660208588010111156109ce57600080fd5b6109df8460208301602089016104aa565b9695505050505050565b6000602082840312156109fb57600080fd5b81516001600160401b0380821115610a1257600080fd5b9083019060a08286031215610a2657600080fd5b610a2e610926565b8251610a39816103fd565b815260208301516001600160a01b0381168114610a5557600080fd5b6020820152610a666040840161094e565b6040820152606083015182811115610a7d57600080fd5b610a8987828601610962565b606083015250608083015182811115610aa157600080fd5b610aad87828601610962565b60808301525095945050505050565b634e487b7160e01b600052602160045260246000fd5b6001600160401b0384168152826020820152606060408201526000610afa60608301846104ce565b9594505050505056fea26469706673582212205b5117b00ce65fae13c73e5fe55ef1d7583f0a364b1ac0a38e3f21e0d2c88f9a64736f6c63430008140033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100625760003560e01c806309c1ba2e1461006757806314b1dd1b146100975780634ce64f0e146100ca578063cdc634f1146100dd578063cfd58386146100f2578063df13994e14610105575b600080fd5b60005461007a906001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b6100c86100a5366004610415565b6000805467ffffffffffffffff19166001600160401b0392909216919091179055565b005b6100c86100d8366004610439565b610118565b6100e561012a565b60405161008e91906104fa565b6100c8610100366004610558565b6101b8565b6100c86101133660046105c3565b6102c3565b600161012582848361067a565b505050565b60018054610137906105f2565b80601f0160208091040260200160405190810160405280929190818152602001828054610163906105f2565b80156101b05780601f10610185576101008083540402835291602001916101b0565b820191906000526020600020905b81548152906001019060200180831161019357829003601f168201915b505050505081565b600080546001600160401b031690036102175760405162461bcd60e51b815260206004820152601760248201527f537562736372697074696f6e204944206e6f7420736574000000000000000000604482015260640160405180910390fd5b600054604051634b60ac1760e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916396c1582e91610279916001600160401b0316908890889088908890600190600401610824565b6020604051808303816000875af1158015610298573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bc919061090d565b5050505050565b6040516315b851d160e01b815260048101829052600160248201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906315b851d1906044016000604051808303816000875af1158015610334573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261035c91908101906109e9565b905060018160400151600281111561037657610376610abc565b036103c2577fa5522492de1ed169e1e5e76f6cb2ceb5f045ca7f7ea5da3137c573d996cc4b9f81600001518383606001516040516103b693929190610ad2565b60405180910390a15050565b7f331e0adccd60eab7ca94cf49c60a45549ce9dc1281139656a13bdf73774d179c81600001518383608001516040516103b693929190610ad2565b6001600160401b038116811461041257600080fd5b50565b60006020828403121561042757600080fd5b8135610432816103fd565b9392505050565b6000806020838503121561044c57600080fd5b82356001600160401b038082111561046357600080fd5b818501915085601f83011261047757600080fd5b81358181111561048657600080fd5b86602082850101111561049857600080fd5b60209290920196919550909350505050565b60005b838110156104c55781810151838201526020016104ad565b50506000910152565b600081518084526104e68160208601602086016104aa565b601f01601f19169290920160200192915050565b60208152600061043260208301846104ce565b60008083601f84011261051f57600080fd5b5081356001600160401b0381111561053657600080fd5b6020830191508360208260051b850101111561055157600080fd5b9250929050565b6000806000806040858703121561056e57600080fd5b84356001600160401b038082111561058557600080fd5b6105918883890161050d565b909650945060208701359150808211156105aa57600080fd5b506105b78782880161050d565b95989497509550505050565b6000602082840312156105d557600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061060657607f821691505b60208210810361062657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561012557600081815260208120601f850160051c810160208610156106535750805b601f850160051c820191505b818110156106725782815560010161065f565b505050505050565b6001600160401b03831115610691576106916105dc565b6106a58361069f83546105f2565b8361062c565b6000601f8411600181146106d957600085156106c15750838201355b600019600387901b1c1916600186901b1783556102bc565b600083815260209020601f19861690835b8281101561070a57868501358255602094850194600190920191016106ea565b50868210156107275760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000808335601e1984360301811261077957600080fd5b83016020810192503590506001600160401b0381111561079857600080fd5b80360382131561055157600080fd5b600081546107b4816105f2565b8085526020600183811680156107d157600181146107eb57610819565b60ff1985168884015283151560051b880183019550610819565b866000528260002060005b858110156108115781548a82018601529083019084016107f6565b890184019650505b505050505092915050565b6000608082016001600160401b038916835260206080818501528188835260a08501905060a08960051b86010192508960005b8a81101561089157868503609f19018352610872828d610762565b61087d878284610739565b965050509183019190830190600101610857565b5050508382036040850152858252808201600587901b830182018860005b898110156108e957858303601f190184526108ca828c610762565b6108d5858284610739565b9587019594505050908401906001016108af565b505085810360608701526108fd81886107a7565b9c9b505050505050505050505050565b60006020828403121561091f57600080fd5b5051919050565b60405160a081016001600160401b0381118282101715610948576109486105dc565b60405290565b80516003811061095d57600080fd5b919050565b600082601f83011261097357600080fd5b81516001600160401b038082111561098d5761098d6105dc565b604051601f8301601f19908116603f011681019082821181831017156109b5576109b56105dc565b816040528381528660208588010111156109ce57600080fd5b6109df8460208301602089016104aa565b9695505050505050565b6000602082840312156109fb57600080fd5b81516001600160401b0380821115610a1257600080fd5b9083019060a08286031215610a2657600080fd5b610a2e610926565b8251610a39816103fd565b815260208301516001600160a01b0381168114610a5557600080fd5b6020820152610a666040840161094e565b6040820152606083015182811115610a7d57600080fd5b610a8987828601610962565b606083015250608083015182811115610aa157600080fd5b610aad87828601610962565b60808301525095945050505050565b634e487b7160e01b600052602160045260246000fd5b6001600160401b0384168152826020820152606060408201526000610afa60608301846104ce565b9594505050505056fea26469706673582212205b5117b00ce65fae13c73e5fe55ef1d7583f0a364b1ac0a38e3f21e0d2c88f9a64736f6c63430008140033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 2081, + "contract": "contracts/CCNotificationClient.sol:CCNotificationClient", + "label": "subscriptionId", + "offset": 0, + "slot": "0", + "type": "t_uint64" + }, + { + "astId": 2084, + "contract": "contracts/CCNotificationClient.sol:CCNotificationClient", + "label": "encryptedSecretsReference", + "offset": 0, + "slot": "1", + "type": "t_bytes_storage" + } + ], + "types": { + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_uint64": { + "encoding": "inplace", + "label": "uint64", + "numberOfBytes": "8" + } + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/optimismSepolia/solcInputs/53149b43bdceb93f30f39d8cad0df810.json b/packages/hardhat/deployments/optimismSepolia/solcInputs/53149b43bdceb93f30f39d8cad0df810.json new file mode 100644 index 0000000..9f9aa88 --- /dev/null +++ b/packages/hardhat/deployments/optimismSepolia/solcInputs/53149b43bdceb93f30f39d8cad0df810.json @@ -0,0 +1,84 @@ +{ + "language": "Solidity", + "sources": { + "@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"./interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"./interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"./libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_router;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_router = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_router.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_router)) {\n revert OnlyRouterCanFulfill();\n }\n fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Chainlink Functions client interface.\ninterface IFunctionsClient {\n /// @notice Chainlink Functions response handler called by the Functions Router\n /// during fullilment from the designated transmitter node in an OCR round.\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\n /// @param response Aggregated response from the request's source code.\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\n /// @dev Either response or error parameter will be set, but never both.\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {FunctionsResponse} from \"../libraries/FunctionsResponse.sol\";\n\n/// @title Chainlink Functions Router interface.\ninterface IFunctionsRouter {\n /// @notice The identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n /// @return id - bytes32 id that can be passed to the \"getContractById\" of the Router\n function getAllowListId() external view returns (bytes32);\n\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n function setAllowListId(bytes32 allowListId) external;\n\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\n /// @return adminFee\n function getAdminFee() external view returns (uint72 adminFee);\n\n /// @notice Sends a request using the provided subscriptionId\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequest(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Sends a request to the proposed contracts\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequestToProposed(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Fulfill the request by:\n /// - calling back the data that the Oracle returned to the client contract\n /// - pay the DON for processing the request\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\n /// @param response response data from DON consensus\n /// @param err error from DON consensus\n /// @param juelsPerGas - current rate of juels/gas\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\n /// @param transmitter - The Node that transmitted the OCR report\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\n /// @return fulfillResult -\n /// @return callbackGasCostJuels -\n function fulfill(\n bytes memory response,\n bytes memory err,\n uint96 juelsPerGas,\n uint96 costWithoutFulfillment,\n address transmitter,\n FunctionsResponse.Commitment memory commitment\n ) external returns (FunctionsResponse.FulfillResult, uint96);\n\n /// @notice Validate requested gas limit is below the subscription max.\n /// @param subscriptionId subscription ID\n /// @param callbackGasLimit desired callback gas limit\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\n\n /// @notice Get the current contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current contract address\n function getContractById(bytes32 id) external view returns (address);\n\n /// @notice Get the proposed next contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current or proposed contract address\n function getProposedContractById(bytes32 id) external view returns (address);\n\n /// @notice Return the latest proprosal set\n /// @return ids The identifiers of the contracts to update\n /// @return to The addresses of the contracts that will be updated to\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\n\n /// @notice Proposes one or more updates to the contract routes\n /// @dev Only callable by owner\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\n\n /// @notice Updates the current contract routes to the proposed contracts\n /// @dev Only callable by owner\n function updateContracts() external;\n\n /// @dev Puts the system into an emergency stopped state.\n /// @dev Only callable by owner\n function pause() external;\n\n /// @dev Takes the system out of an emergency stopped state.\n /// @dev Only callable by owner\n function unpause() external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {CBOR} from \"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\";\n\n/// @title Library for encoding the input data of a Functions request into CBOR\nlibrary FunctionsRequest {\n using CBOR for CBOR.CBORBuffer;\n\n uint16 public constant REQUEST_DATA_VERSION = 1;\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\n\n enum Location {\n Inline, // Provided within the Request\n Remote, // Hosted through remote location that can be accessed through a provided URL\n DONHosted // Hosted on the DON's storage\n }\n\n enum CodeLanguage {\n JavaScript\n // In future version we may add other languages\n }\n\n struct Request {\n Location codeLocation; // ════════════╸ The location of the source code that will be executed on each node in the DON\n Location secretsLocation; // ═════════╸ The location of secrets that will be passed into the source code. *Only Remote secrets are supported\n CodeLanguage language; // ════════════╸ The coding language that the source code is written in\n string source; // ════════════════════╸ Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\n bytes encryptedSecretsReference; // ══╸ Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\n string[] args; // ════════════════════╸ String arguments that will be passed into the source code\n bytes[] bytesArgs; // ════════════════╸ Bytes arguments that will be passed into the source code\n }\n\n error EmptySource();\n error EmptySecrets();\n error EmptyArgs();\n error NoInlineSecrets();\n\n /// @notice Encodes a Request to CBOR encoded bytes\n /// @param self The request to encode\n /// @return CBOR encoded bytes\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"codeLocation\");\n buffer.writeUInt256(uint256(self.codeLocation));\n\n buffer.writeString(\"language\");\n buffer.writeUInt256(uint256(self.language));\n\n buffer.writeString(\"source\");\n buffer.writeString(self.source);\n\n if (self.args.length > 0) {\n buffer.writeString(\"args\");\n buffer.startArray();\n for (uint256 i = 0; i < self.args.length; ++i) {\n buffer.writeString(self.args[i]);\n }\n buffer.endSequence();\n }\n\n if (self.encryptedSecretsReference.length > 0) {\n if (self.secretsLocation == Location.Inline) {\n revert NoInlineSecrets();\n }\n buffer.writeString(\"secretsLocation\");\n buffer.writeUInt256(uint256(self.secretsLocation));\n buffer.writeString(\"secrets\");\n buffer.writeBytes(self.encryptedSecretsReference);\n }\n\n if (self.bytesArgs.length > 0) {\n buffer.writeString(\"bytesArgs\");\n buffer.startArray();\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\n buffer.writeBytes(self.bytesArgs[i]);\n }\n buffer.endSequence();\n }\n\n return buffer.buf.buf;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Sets the codeLocation and code on the request\n /// @param self The uninitialized request\n /// @param codeLocation The user provided source code location\n /// @param language The programming language of the user code\n /// @param source The user provided source code or a url\n function initializeRequest(\n Request memory self,\n Location codeLocation,\n CodeLanguage language,\n string memory source\n ) internal pure {\n if (bytes(source).length == 0) revert EmptySource();\n\n self.codeLocation = codeLocation;\n self.language = language;\n self.source = source;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Simplified version of initializeRequest for PoC\n /// @param self The uninitialized request\n /// @param javaScriptSource The user provided JS code (must not be empty)\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\n }\n\n /// @notice Adds Remote user encrypted secrets to a Request\n /// @param self The initialized request\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\n\n self.secretsLocation = Location.Remote;\n self.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n /// @notice Adds DON-hosted secrets reference to a Request\n /// @param self The initialized request\n /// @param slotID Slot ID of the user's secrets hosted on DON\n /// @param version User data version (for the slotID)\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"slotID\");\n buffer.writeUInt64(slotID);\n buffer.writeString(\"version\");\n buffer.writeUInt64(version);\n\n self.secretsLocation = Location.DONHosted;\n self.encryptedSecretsReference = buffer.buf.buf;\n }\n\n /// @notice Sets args for the user run function\n /// @param self The initialized request\n /// @param args The array of string args (must not be empty)\n function setArgs(Request memory self, string[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.args = args;\n }\n\n /// @notice Sets bytes args for the user run function\n /// @param self The initialized request\n /// @param args The array of bytes args (must not be empty)\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.bytesArgs = args;\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Library of types that are used for fulfillment of a Functions request\nlibrary FunctionsResponse {\n // Used to send request information from the Router to the Coordinator\n struct RequestMeta {\n bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\n bytes32 flags; // ═══════════════╸ Per-subscription flags\n address requestingContract; // ══╗ The client contract that is sending the request\n uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\n uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint64 initiatedRequests; // β•‘ The number of requests that have been started\n uint32 callbackGasLimit; // β•‘ The amount of gas that the callback to the consuming contract will be given\n uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data\n uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out\n address subscriptionOwner; // ═══╝ The owner of the billing subscription\n }\n\n enum FulfillResult {\n FULFILLED, // 0\n USER_CALLBACK_ERROR, // 1\n INVALID_REQUEST_ID, // 2\n COST_EXCEEDS_COMMITMENT, // 3\n INSUFFICIENT_GAS_PROVIDED, // 4\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\n INVALID_COMMITMENT // 6\n }\n\n struct Commitment {\n bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request\n address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request\n uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\n address client; // ════════════════════╗ The client contract that sent the request\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given\n uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint72 donFee; // β•‘ Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\n uint40 gasOverheadBeforeCallback; // β•‘ Represents the average gas execution cost before the fulfillment callback.\n uint40 gasOverheadAfterCallback; // β•‘ Represents the average gas execution cost after the fulfillment callback.\n uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"../v1_0_0/interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"../v1_0_0/interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"../v1_0_0/libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_functionsRouter;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_functionsRouter = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_functionsRouter.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_functionsRouter)) {\n revert OnlyRouterCanFulfill();\n }\n _fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}" + }, + "@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../@ensdomains/buffer/v0.1.0/Buffer.sol\";\n\n/**\n* @dev A library for populating CBOR encoded payload in Solidity.\n*\n* https://datatracker.ietf.org/doc/html/rfc7049\n*\n* The library offers various write* and start* methods to encode values of different types.\n* The resulted buffer can be obtained with data() method.\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\n* in an invalid CBOR if start/write/end flow is violated.\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\n* except for nested start/end pairs.\n*/\n\nlibrary CBOR {\n using Buffer for Buffer.buffer;\n\n struct CBORBuffer {\n Buffer.buffer buf;\n uint256 depth;\n }\n\n uint8 private constant MAJOR_TYPE_INT = 0;\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\n uint8 private constant MAJOR_TYPE_BYTES = 2;\n uint8 private constant MAJOR_TYPE_STRING = 3;\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\n uint8 private constant MAJOR_TYPE_MAP = 5;\n uint8 private constant MAJOR_TYPE_TAG = 6;\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\n\n uint8 private constant TAG_TYPE_BIGNUM = 2;\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\n\n uint8 private constant CBOR_FALSE = 20;\n uint8 private constant CBOR_TRUE = 21;\n uint8 private constant CBOR_NULL = 22;\n uint8 private constant CBOR_UNDEFINED = 23;\n\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\n Buffer.init(cbor.buf, capacity);\n cbor.depth = 0;\n return cbor;\n }\n\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\n require(buf.depth == 0, \"Invalid CBOR\");\n return buf.buf.buf;\n }\n\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\n writeBytes(buf, abi.encode(value));\n }\n\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\n if (value < 0) {\n buf.buf.appendUint8(\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\n );\n writeBytes(buf, abi.encode(uint256(-1 - value)));\n } else {\n writeUInt256(buf, uint256(value));\n }\n }\n\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\n }\n\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\n if(value >= 0) {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\n } else{\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\n }\n }\n\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\n buf.buf.append(value);\n }\n\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\n buf.buf.append(bytes(value));\n }\n\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\n }\n\n function writeNull(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_NULL);\n }\n\n function writeUndefined(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_UNDEFINED);\n }\n\n function startArray(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\n buf.depth += 1;\n }\n\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\n }\n\n function startMap(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\n buf.depth += 1;\n }\n\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\n }\n\n function endSequence(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\n buf.depth -= 1;\n }\n\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\n writeString(buf, key);\n writeString(buf, value);\n }\n\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\n writeString(buf, key);\n writeBytes(buf, value);\n }\n\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\n writeString(buf, key);\n writeUInt256(buf, value);\n }\n\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\n writeString(buf, key);\n writeInt256(buf, value);\n }\n\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\n writeString(buf, key);\n writeUInt64(buf, value);\n }\n\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\n writeString(buf, key);\n writeInt64(buf, value);\n }\n\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\n writeString(buf, key);\n writeBool(buf, value);\n }\n\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeNull(buf);\n }\n\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeUndefined(buf);\n }\n\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startMap(buf);\n }\n\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startArray(buf);\n }\n\n function writeFixedNumeric(\n CBORBuffer memory buf,\n uint8 major,\n uint64 value\n ) private pure {\n if (value <= 23) {\n buf.buf.appendUint8(uint8((major << 5) | value));\n } else if (value <= 0xFF) {\n buf.buf.appendUint8(uint8((major << 5) | 24));\n buf.buf.appendInt(value, 1);\n } else if (value <= 0xFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 25));\n buf.buf.appendInt(value, 2);\n } else if (value <= 0xFFFFFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 26));\n buf.buf.appendInt(value, 4);\n } else {\n buf.buf.appendUint8(uint8((major << 5) | 27));\n buf.buf.appendInt(value, 8);\n }\n }\n\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\n private\n pure\n {\n buf.buf.appendUint8(uint8((major << 5) | 31));\n }\n\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\n private\n pure\n {\n writeFixedNumeric(buf, major, length);\n }\n\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\n }\n}" + }, + "@openzeppelin/contracts/access/AccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.20;\n\nimport {IAccessControl} from \"./IAccessControl.sol\";\nimport {Context} from \"../utils/Context.sol\";\nimport {ERC165} from \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account => bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n" + }, + "@openzeppelin/contracts/access/IAccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "contracts/CCExampleClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from \"./interfaces/ICCGatewayClient.sol\";\nimport {ICCGateway} from \"./interfaces/ICCGateway.sol\";\n\ncontract CCExampleClient is ICCGatewayClient {\n ICCGateway private immutable gateway;\n\n uint64 private subscriptionId = 0;\n bytes private encryptedSecretsReference = \"\";\n\n event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response);\n event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error);\n\n constructor(address gatewayAddress) {\n gateway = ICCGateway(gatewayAddress);\n }\n\n function updateSubscriptionId(uint64 _subscriptionId) external {\n subscriptionId = _subscriptionId;\n }\n\n function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external {\n encryptedSecretsReference = _encryptedSecretsReference;\n }\n\n function request(string[] calldata args, bytes[] calldata bytesArgs) external {\n gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference);\n }\n\n function callback(bytes32 requestId) external override {\n ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true);\n\n if (response.state == ICCGatewayClient.CCGResponseState.Success) {\n emit ResponseReceived(response.subscriptionId, requestId, string(response.data));\n } else {\n emit ErrorReceived(response.subscriptionId, requestId, string(response.error));\n }\n }\n}\n" + }, + "contracts/CCGateway.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport './interfaces/ICCGateway.sol';\nimport {ICCGatewayClient} from './interfaces/ICCGatewayClient.sol';\n\nimport {FunctionsClient} from \"@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol\";\nimport {AccessControl} from \"@openzeppelin/contracts/access/AccessControl.sol\";\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\";\n\ncontract CCGateway is ICCGateway, FunctionsClient, AccessControl {\n using FunctionsRequest for FunctionsRequest.Request;\n\n bytes32 public constant MANAGER_ROLE = keccak256(\"MANAGER_ROLE\");\n bytes32 public constant CLIENT_ROLE = keccak256(\"CLIENT_ROLE\");\n bytes32 private _donId; // DON ID for the Functions DON to which the requests are sent\n\n mapping(uint64 subscriptionId => CCGRequest) private _requests; // Each subscription can only handle one kind of request\n mapping(bytes32 requestId => ICCGatewayClient.CCGResponse) private unprocessed_responses; // Responses that have not been processed yet\n\n constructor(address router, bytes32 initialDonId, address initialOwner) FunctionsClient(router) {\n _donId = initialDonId;\n\n address to = address(0) == initialOwner ? _msgSender() : initialOwner;\n _grantRole(DEFAULT_ADMIN_ROLE, to);\n _grantRole(MANAGER_ROLE, to);\n }\n\n /**\n * @dev Set the DON ID\n * @param newDonId New DON ID\n */\n function setDonId(bytes32 newDonId) external onlyRole(getRoleAdmin(MANAGER_ROLE)) {\n _donId = newDonId;\n }\n\n /**\n * @dev Get the DON ID\n * @return DON ID\n */\n function donId() external view returns (bytes32) {\n return _donId;\n }\n\n function registerRequest(\n uint64 subscriptionId,\n FunctionsRequest.Location codeLocation,\n string calldata source,\n FunctionsRequest.Location secretsLocation,\n bytes calldata encryptedSecretsReference,\n uint32 callbackGasLimit,\n string calldata name\n ) external onlyRole(MANAGER_ROLE) {\n if(bytes(name).length == 0) {revert CCGRequestNameEmpty();}\n\n CCGRequest storage req = _requests[subscriptionId];\n req.name = name;\n req.callbackGasLimit = callbackGasLimit;\n\n // Only JavaScript is supported for now\n req.config.language = FunctionsRequest.CodeLanguage.JavaScript;\n req.config.codeLocation = codeLocation;\n req.config.source = source;\n req.config.secretsLocation = secretsLocation;\n req.config.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n\n function getRequest(uint64 subscriptionId) external view onlyManager returns (CCGRequest memory) {\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n return _requests[subscriptionId];\n }\n// ---------------------------------------------------------------------------------------------------------------------\n modifier onlySource(bytes32 requestId) {\n if (unprocessed_responses[requestId].source != _msgSender()) {revert CCGOnlySameSourceAllowed(requestId);}\n _;\n }\n\n modifier onlyManager() {\n if (!hasRole(MANAGER_ROLE, tx.origin)) {revert CCGOnlyManagerAllowed();}\n _;\n }\n// ---------------------------------------------------------------------------------------------------------------------\n /**\n * @notice Triggers an on-demand Functions request using remote encrypted secrets\n * @param subscriptionId Subscription ID used to pay for request (FunctionsConsumer contract address must first be added to the subscription)\n * @param args String arguments passed into the source code and accessible via the global variable `args`\n * @param bytesArgs Bytes arguments passed into the source code and accessible via the global variable `bytesArgs` as hex strings\n * @param encryptedSecretsReference Reference pointing to encrypted secrets\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external onlyRole(CLIENT_ROLE) returns (bytes32 requestId) {\n CCGRequest storage request = _requests[subscriptionId];\n if (bytes(request.name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n\n FunctionsRequest.Request memory req = request.config;\n req.initializeRequest(req.codeLocation, FunctionsRequest.CodeLanguage.JavaScript, req.source);\n if(encryptedSecretsReference.length > 0) {req.encryptedSecretsReference = encryptedSecretsReference;}\n\n if (args.length > 0) {\n req.setArgs(args);\n }\n if (bytesArgs.length > 0) {\n req.setBytesArgs(bytesArgs);\n }\n\n requestId = _sendRequest(req.encodeCBOR(), subscriptionId, request.callbackGasLimit, _donId);\n unprocessed_responses[requestId].state = ICCGatewayClient.CCGResponseState.Sent;\n unprocessed_responses[requestId].source = _msgSender();\n }\n\n /**\n * @notice Store latest result/error\n * @param requestId The request ID, returned by sendRequest()\n * @param response Aggregated response from the user code\n * @param err Aggregated error from the user code or from the execution pipeline\n * Either response or error parameter will be set, but never both\n */\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal override {\n ICCGatewayClient.CCGResponse storage resp = unprocessed_responses[requestId];\n if (resp.state != ICCGatewayClient.CCGResponseState.Sent) {revert CCGRequestAlreadyFulfilled(requestId);}\n\n unprocessed_responses[requestId].state = err.length > 0 ? ICCGatewayClient.CCGResponseState.Error : ICCGatewayClient.CCGResponseState.Success;\n unprocessed_responses[requestId].data = response;\n unprocessed_responses[requestId].error = err;\n\n // TODO: Call the client's callback function.\n ICCGatewayClient(resp.source).callback(requestId);\n }\n\n /**\n * @dev Get the response data\n * @param requestId The request ID, returned by sendRequest()\n * @return response CCGResponse\n */\n function getResponse(bytes32 requestId, bool remove) external onlySource(requestId) returns (ICCGatewayClient.CCGResponse memory response) {\n response = unprocessed_responses[requestId];\n if (remove) {delete unprocessed_responses[requestId];}\n }\n}" + }, + "contracts/interfaces/ICCGateway.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\";\n\ninterface ICCGateway {\n struct CCGRequest {\n string name;\n uint32 callbackGasLimit;\n FunctionsRequest.Request config;\n }\n\n /**\n * @dev Can't register a request with an empty name\n */\n error CCGRequestNameEmpty();\n\n /**\n * @dev Only the same source of the requestId is allowed to call the function\n */\n error CCGOnlySameSourceAllowed(bytes32 requestId);\n\n /**\n * @dev Only a registered subscriptionId is allowed to call the function\n */\n error CCGRequestNotRegistered(uint64 subscriptionId);\n\n /**\n * @dev Can't fulfill a request that has already been fulfilled\n */\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\n\n /**\n * @dev Only A manager can call the function\n */\n error CCGOnlyManagerAllowed();\n\n /**\n * @dev Send a request to the Functions DON\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external returns (bytes32 requestId);\n\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\n}\n" + }, + "contracts/interfaces/ICCGatewayClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\ninterface ICCGatewayClient {\n enum CCGResponseState {Sent, Success, Error}\n\n struct CCGResponse {\n uint64 subscriptionId;\n address source;\n CCGResponseState state;\n bytes data;\n bytes error;\n }\n\n function callback(bytes32 requestId) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/optimismSepolia/solcInputs/55f420078970def91f71afecffd6ca9e.json b/packages/hardhat/deployments/optimismSepolia/solcInputs/55f420078970def91f71afecffd6ca9e.json new file mode 100644 index 0000000..48227cb --- /dev/null +++ b/packages/hardhat/deployments/optimismSepolia/solcInputs/55f420078970def91f71afecffd6ca9e.json @@ -0,0 +1,63 @@ +{ + "language": "Solidity", + "sources": { + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Chainlink Functions client interface.\ninterface IFunctionsClient {\n /// @notice Chainlink Functions response handler called by the Functions Router\n /// during fullilment from the designated transmitter node in an OCR round.\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\n /// @param response Aggregated response from the request's source code.\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\n /// @dev Either response or error parameter will be set, but never both.\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {FunctionsResponse} from \"../libraries/FunctionsResponse.sol\";\n\n/// @title Chainlink Functions Router interface.\ninterface IFunctionsRouter {\n /// @notice The identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n /// @return id - bytes32 id that can be passed to the \"getContractById\" of the Router\n function getAllowListId() external view returns (bytes32);\n\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n function setAllowListId(bytes32 allowListId) external;\n\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\n /// @return adminFee\n function getAdminFee() external view returns (uint72 adminFee);\n\n /// @notice Sends a request using the provided subscriptionId\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequest(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Sends a request to the proposed contracts\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequestToProposed(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Fulfill the request by:\n /// - calling back the data that the Oracle returned to the client contract\n /// - pay the DON for processing the request\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\n /// @param response response data from DON consensus\n /// @param err error from DON consensus\n /// @param juelsPerGas - current rate of juels/gas\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\n /// @param transmitter - The Node that transmitted the OCR report\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\n /// @return fulfillResult -\n /// @return callbackGasCostJuels -\n function fulfill(\n bytes memory response,\n bytes memory err,\n uint96 juelsPerGas,\n uint96 costWithoutFulfillment,\n address transmitter,\n FunctionsResponse.Commitment memory commitment\n ) external returns (FunctionsResponse.FulfillResult, uint96);\n\n /// @notice Validate requested gas limit is below the subscription max.\n /// @param subscriptionId subscription ID\n /// @param callbackGasLimit desired callback gas limit\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\n\n /// @notice Get the current contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current contract address\n function getContractById(bytes32 id) external view returns (address);\n\n /// @notice Get the proposed next contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current or proposed contract address\n function getProposedContractById(bytes32 id) external view returns (address);\n\n /// @notice Return the latest proprosal set\n /// @return ids The identifiers of the contracts to update\n /// @return to The addresses of the contracts that will be updated to\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\n\n /// @notice Proposes one or more updates to the contract routes\n /// @dev Only callable by owner\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\n\n /// @notice Updates the current contract routes to the proposed contracts\n /// @dev Only callable by owner\n function updateContracts() external;\n\n /// @dev Puts the system into an emergency stopped state.\n /// @dev Only callable by owner\n function pause() external;\n\n /// @dev Takes the system out of an emergency stopped state.\n /// @dev Only callable by owner\n function unpause() external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {CBOR} from \"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\";\n\n/// @title Library for encoding the input data of a Functions request into CBOR\nlibrary FunctionsRequest {\n using CBOR for CBOR.CBORBuffer;\n\n uint16 public constant REQUEST_DATA_VERSION = 1;\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\n\n enum Location {\n Inline, // Provided within the Request\n Remote, // Hosted through remote location that can be accessed through a provided URL\n DONHosted // Hosted on the DON's storage\n }\n\n enum CodeLanguage {\n JavaScript\n // In future version we may add other languages\n }\n\n struct Request {\n Location codeLocation; // ════════════╸ The location of the source code that will be executed on each node in the DON\n Location secretsLocation; // ═════════╸ The location of secrets that will be passed into the source code. *Only Remote secrets are supported\n CodeLanguage language; // ════════════╸ The coding language that the source code is written in\n string source; // ════════════════════╸ Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\n bytes encryptedSecretsReference; // ══╸ Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\n string[] args; // ════════════════════╸ String arguments that will be passed into the source code\n bytes[] bytesArgs; // ════════════════╸ Bytes arguments that will be passed into the source code\n }\n\n error EmptySource();\n error EmptySecrets();\n error EmptyArgs();\n error NoInlineSecrets();\n\n /// @notice Encodes a Request to CBOR encoded bytes\n /// @param self The request to encode\n /// @return CBOR encoded bytes\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"codeLocation\");\n buffer.writeUInt256(uint256(self.codeLocation));\n\n buffer.writeString(\"language\");\n buffer.writeUInt256(uint256(self.language));\n\n buffer.writeString(\"source\");\n buffer.writeString(self.source);\n\n if (self.args.length > 0) {\n buffer.writeString(\"args\");\n buffer.startArray();\n for (uint256 i = 0; i < self.args.length; ++i) {\n buffer.writeString(self.args[i]);\n }\n buffer.endSequence();\n }\n\n if (self.encryptedSecretsReference.length > 0) {\n if (self.secretsLocation == Location.Inline) {\n revert NoInlineSecrets();\n }\n buffer.writeString(\"secretsLocation\");\n buffer.writeUInt256(uint256(self.secretsLocation));\n buffer.writeString(\"secrets\");\n buffer.writeBytes(self.encryptedSecretsReference);\n }\n\n if (self.bytesArgs.length > 0) {\n buffer.writeString(\"bytesArgs\");\n buffer.startArray();\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\n buffer.writeBytes(self.bytesArgs[i]);\n }\n buffer.endSequence();\n }\n\n return buffer.buf.buf;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Sets the codeLocation and code on the request\n /// @param self The uninitialized request\n /// @param codeLocation The user provided source code location\n /// @param language The programming language of the user code\n /// @param source The user provided source code or a url\n function initializeRequest(\n Request memory self,\n Location codeLocation,\n CodeLanguage language,\n string memory source\n ) internal pure {\n if (bytes(source).length == 0) revert EmptySource();\n\n self.codeLocation = codeLocation;\n self.language = language;\n self.source = source;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Simplified version of initializeRequest for PoC\n /// @param self The uninitialized request\n /// @param javaScriptSource The user provided JS code (must not be empty)\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\n }\n\n /// @notice Adds Remote user encrypted secrets to a Request\n /// @param self The initialized request\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\n\n self.secretsLocation = Location.Remote;\n self.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n /// @notice Adds DON-hosted secrets reference to a Request\n /// @param self The initialized request\n /// @param slotID Slot ID of the user's secrets hosted on DON\n /// @param version User data version (for the slotID)\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"slotID\");\n buffer.writeUInt64(slotID);\n buffer.writeString(\"version\");\n buffer.writeUInt64(version);\n\n self.secretsLocation = Location.DONHosted;\n self.encryptedSecretsReference = buffer.buf.buf;\n }\n\n /// @notice Sets args for the user run function\n /// @param self The initialized request\n /// @param args The array of string args (must not be empty)\n function setArgs(Request memory self, string[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.args = args;\n }\n\n /// @notice Sets bytes args for the user run function\n /// @param self The initialized request\n /// @param args The array of bytes args (must not be empty)\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.bytesArgs = args;\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Library of types that are used for fulfillment of a Functions request\nlibrary FunctionsResponse {\n // Used to send request information from the Router to the Coordinator\n struct RequestMeta {\n bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\n bytes32 flags; // ═══════════════╸ Per-subscription flags\n address requestingContract; // ══╗ The client contract that is sending the request\n uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\n uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint64 initiatedRequests; // β•‘ The number of requests that have been started\n uint32 callbackGasLimit; // β•‘ The amount of gas that the callback to the consuming contract will be given\n uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data\n uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out\n address subscriptionOwner; // ═══╝ The owner of the billing subscription\n }\n\n enum FulfillResult {\n FULFILLED, // 0\n USER_CALLBACK_ERROR, // 1\n INVALID_REQUEST_ID, // 2\n COST_EXCEEDS_COMMITMENT, // 3\n INSUFFICIENT_GAS_PROVIDED, // 4\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\n INVALID_COMMITMENT // 6\n }\n\n struct Commitment {\n bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request\n address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request\n uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\n address client; // ════════════════════╗ The client contract that sent the request\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given\n uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint72 donFee; // β•‘ Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\n uint40 gasOverheadBeforeCallback; // β•‘ Represents the average gas execution cost before the fulfillment callback.\n uint40 gasOverheadAfterCallback; // β•‘ Represents the average gas execution cost after the fulfillment callback.\n uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"../v1_0_0/interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"../v1_0_0/interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"../v1_0_0/libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_functionsRouter;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_functionsRouter = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_functionsRouter.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_functionsRouter)) {\n revert OnlyRouterCanFulfill();\n }\n _fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}" + }, + "@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../@ensdomains/buffer/v0.1.0/Buffer.sol\";\n\n/**\n* @dev A library for populating CBOR encoded payload in Solidity.\n*\n* https://datatracker.ietf.org/doc/html/rfc7049\n*\n* The library offers various write* and start* methods to encode values of different types.\n* The resulted buffer can be obtained with data() method.\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\n* in an invalid CBOR if start/write/end flow is violated.\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\n* except for nested start/end pairs.\n*/\n\nlibrary CBOR {\n using Buffer for Buffer.buffer;\n\n struct CBORBuffer {\n Buffer.buffer buf;\n uint256 depth;\n }\n\n uint8 private constant MAJOR_TYPE_INT = 0;\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\n uint8 private constant MAJOR_TYPE_BYTES = 2;\n uint8 private constant MAJOR_TYPE_STRING = 3;\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\n uint8 private constant MAJOR_TYPE_MAP = 5;\n uint8 private constant MAJOR_TYPE_TAG = 6;\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\n\n uint8 private constant TAG_TYPE_BIGNUM = 2;\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\n\n uint8 private constant CBOR_FALSE = 20;\n uint8 private constant CBOR_TRUE = 21;\n uint8 private constant CBOR_NULL = 22;\n uint8 private constant CBOR_UNDEFINED = 23;\n\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\n Buffer.init(cbor.buf, capacity);\n cbor.depth = 0;\n return cbor;\n }\n\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\n require(buf.depth == 0, \"Invalid CBOR\");\n return buf.buf.buf;\n }\n\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\n writeBytes(buf, abi.encode(value));\n }\n\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\n if (value < 0) {\n buf.buf.appendUint8(\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\n );\n writeBytes(buf, abi.encode(uint256(-1 - value)));\n } else {\n writeUInt256(buf, uint256(value));\n }\n }\n\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\n }\n\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\n if(value >= 0) {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\n } else{\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\n }\n }\n\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\n buf.buf.append(value);\n }\n\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\n buf.buf.append(bytes(value));\n }\n\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\n }\n\n function writeNull(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_NULL);\n }\n\n function writeUndefined(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_UNDEFINED);\n }\n\n function startArray(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\n buf.depth += 1;\n }\n\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\n }\n\n function startMap(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\n buf.depth += 1;\n }\n\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\n }\n\n function endSequence(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\n buf.depth -= 1;\n }\n\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\n writeString(buf, key);\n writeString(buf, value);\n }\n\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\n writeString(buf, key);\n writeBytes(buf, value);\n }\n\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\n writeString(buf, key);\n writeUInt256(buf, value);\n }\n\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\n writeString(buf, key);\n writeInt256(buf, value);\n }\n\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\n writeString(buf, key);\n writeUInt64(buf, value);\n }\n\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\n writeString(buf, key);\n writeInt64(buf, value);\n }\n\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\n writeString(buf, key);\n writeBool(buf, value);\n }\n\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeNull(buf);\n }\n\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeUndefined(buf);\n }\n\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startMap(buf);\n }\n\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startArray(buf);\n }\n\n function writeFixedNumeric(\n CBORBuffer memory buf,\n uint8 major,\n uint64 value\n ) private pure {\n if (value <= 23) {\n buf.buf.appendUint8(uint8((major << 5) | value));\n } else if (value <= 0xFF) {\n buf.buf.appendUint8(uint8((major << 5) | 24));\n buf.buf.appendInt(value, 1);\n } else if (value <= 0xFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 25));\n buf.buf.appendInt(value, 2);\n } else if (value <= 0xFFFFFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 26));\n buf.buf.appendInt(value, 4);\n } else {\n buf.buf.appendUint8(uint8((major << 5) | 27));\n buf.buf.appendInt(value, 8);\n }\n }\n\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\n private\n pure\n {\n buf.buf.appendUint8(uint8((major << 5) | 31));\n }\n\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\n private\n pure\n {\n writeFixedNumeric(buf, major, length);\n }\n\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\n }\n}" + }, + "contracts/CCExampleClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from \"./interfaces/ICCGatewayClient.sol\";\nimport {ICCGateway} from \"./interfaces/ICCGateway.sol\";\n\ncontract CCExampleClient is ICCGatewayClient {\n ICCGateway private immutable gateway;\n\n uint64 private subscriptionId = 0;\n bytes private encryptedSecretsReference = \"\";\n\n event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response);\n event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error);\n\n constructor(address gatewayAddress) {\n gateway = ICCGateway(gatewayAddress);\n }\n\n function updateSubscriptionId(uint64 _subscriptionId) external {\n subscriptionId = _subscriptionId;\n }\n\n function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external {\n encryptedSecretsReference = _encryptedSecretsReference;\n }\n\n function request(string[] calldata args, bytes[] calldata bytesArgs) external {\n require(subscriptionId != 0, \"Subscription ID not set\");\n\n gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference);\n }\n\n function callback(bytes32 requestId) external override {\n ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true);\n\n if (response.state == ICCGatewayClient.CCGResponseState.Success) {\n emit ResponseReceived(response.subscriptionId, requestId, string(response.data));\n } else {\n emit ErrorReceived(response.subscriptionId, requestId, string(response.error));\n }\n }\n}\n" + }, + "contracts/interfaces/ICCGateway.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\";\n\ninterface ICCGateway {\n struct CCGRequest {\n string name;\n uint32 callbackGasLimit;\n FunctionsRequest.Request config;\n }\n\n /**\n * @dev Can't register a request with an empty name\n */\n error CCGRequestNameEmpty();\n\n /**\n * @dev Only the same source of the requestId is allowed to call the function\n */\n error CCGOnlySameSourceAllowed(bytes32 requestId);\n\n /**\n * @dev Only a registered subscriptionId is allowed to call the function\n */\n error CCGRequestNotRegistered(uint64 subscriptionId);\n\n /**\n * @dev Can't fulfill a request that has already been fulfilled\n */\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\n\n /**\n * @dev Only A manager can call the function\n */\n error CCGOnlyManagerAllowed();\n\n /**\n * @dev Send a request to the Functions DON\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external returns (bytes32 requestId);\n\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\n}\n" + }, + "contracts/interfaces/ICCGatewayClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\ninterface ICCGatewayClient {\n enum CCGResponseState {Sent, Success, Error}\n\n struct CCGResponse {\n uint64 subscriptionId;\n address source;\n CCGResponseState state;\n bytes data;\n bytes error;\n }\n\n function callback(bytes32 requestId) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/optimismSepolia/solcInputs/757a0cc1c674e4e4007b25c045668167.json b/packages/hardhat/deployments/optimismSepolia/solcInputs/757a0cc1c674e4e4007b25c045668167.json new file mode 100644 index 0000000..49e3804 --- /dev/null +++ b/packages/hardhat/deployments/optimismSepolia/solcInputs/757a0cc1c674e4e4007b25c045668167.json @@ -0,0 +1,81 @@ +{ + "language": "Solidity", + "sources": { + "@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"./interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"./interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"./libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_router;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_router = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_router.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_router)) {\n revert OnlyRouterCanFulfill();\n }\n fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Chainlink Functions client interface.\ninterface IFunctionsClient {\n /// @notice Chainlink Functions response handler called by the Functions Router\n /// during fullilment from the designated transmitter node in an OCR round.\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\n /// @param response Aggregated response from the request's source code.\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\n /// @dev Either response or error parameter will be set, but never both.\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {FunctionsResponse} from \"../libraries/FunctionsResponse.sol\";\n\n/// @title Chainlink Functions Router interface.\ninterface IFunctionsRouter {\n /// @notice The identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n /// @return id - bytes32 id that can be passed to the \"getContractById\" of the Router\n function getAllowListId() external view returns (bytes32);\n\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n function setAllowListId(bytes32 allowListId) external;\n\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\n /// @return adminFee\n function getAdminFee() external view returns (uint72 adminFee);\n\n /// @notice Sends a request using the provided subscriptionId\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequest(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Sends a request to the proposed contracts\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequestToProposed(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Fulfill the request by:\n /// - calling back the data that the Oracle returned to the client contract\n /// - pay the DON for processing the request\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\n /// @param response response data from DON consensus\n /// @param err error from DON consensus\n /// @param juelsPerGas - current rate of juels/gas\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\n /// @param transmitter - The Node that transmitted the OCR report\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\n /// @return fulfillResult -\n /// @return callbackGasCostJuels -\n function fulfill(\n bytes memory response,\n bytes memory err,\n uint96 juelsPerGas,\n uint96 costWithoutFulfillment,\n address transmitter,\n FunctionsResponse.Commitment memory commitment\n ) external returns (FunctionsResponse.FulfillResult, uint96);\n\n /// @notice Validate requested gas limit is below the subscription max.\n /// @param subscriptionId subscription ID\n /// @param callbackGasLimit desired callback gas limit\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\n\n /// @notice Get the current contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current contract address\n function getContractById(bytes32 id) external view returns (address);\n\n /// @notice Get the proposed next contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current or proposed contract address\n function getProposedContractById(bytes32 id) external view returns (address);\n\n /// @notice Return the latest proprosal set\n /// @return ids The identifiers of the contracts to update\n /// @return to The addresses of the contracts that will be updated to\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\n\n /// @notice Proposes one or more updates to the contract routes\n /// @dev Only callable by owner\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\n\n /// @notice Updates the current contract routes to the proposed contracts\n /// @dev Only callable by owner\n function updateContracts() external;\n\n /// @dev Puts the system into an emergency stopped state.\n /// @dev Only callable by owner\n function pause() external;\n\n /// @dev Takes the system out of an emergency stopped state.\n /// @dev Only callable by owner\n function unpause() external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {CBOR} from \"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\";\n\n/// @title Library for encoding the input data of a Functions request into CBOR\nlibrary FunctionsRequest {\n using CBOR for CBOR.CBORBuffer;\n\n uint16 public constant REQUEST_DATA_VERSION = 1;\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\n\n enum Location {\n Inline, // Provided within the Request\n Remote, // Hosted through remote location that can be accessed through a provided URL\n DONHosted // Hosted on the DON's storage\n }\n\n enum CodeLanguage {\n JavaScript\n // In future version we may add other languages\n }\n\n struct Request {\n Location codeLocation; // ════════════╸ The location of the source code that will be executed on each node in the DON\n Location secretsLocation; // ═════════╸ The location of secrets that will be passed into the source code. *Only Remote secrets are supported\n CodeLanguage language; // ════════════╸ The coding language that the source code is written in\n string source; // ════════════════════╸ Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\n bytes encryptedSecretsReference; // ══╸ Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\n string[] args; // ════════════════════╸ String arguments that will be passed into the source code\n bytes[] bytesArgs; // ════════════════╸ Bytes arguments that will be passed into the source code\n }\n\n error EmptySource();\n error EmptySecrets();\n error EmptyArgs();\n error NoInlineSecrets();\n\n /// @notice Encodes a Request to CBOR encoded bytes\n /// @param self The request to encode\n /// @return CBOR encoded bytes\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"codeLocation\");\n buffer.writeUInt256(uint256(self.codeLocation));\n\n buffer.writeString(\"language\");\n buffer.writeUInt256(uint256(self.language));\n\n buffer.writeString(\"source\");\n buffer.writeString(self.source);\n\n if (self.args.length > 0) {\n buffer.writeString(\"args\");\n buffer.startArray();\n for (uint256 i = 0; i < self.args.length; ++i) {\n buffer.writeString(self.args[i]);\n }\n buffer.endSequence();\n }\n\n if (self.encryptedSecretsReference.length > 0) {\n if (self.secretsLocation == Location.Inline) {\n revert NoInlineSecrets();\n }\n buffer.writeString(\"secretsLocation\");\n buffer.writeUInt256(uint256(self.secretsLocation));\n buffer.writeString(\"secrets\");\n buffer.writeBytes(self.encryptedSecretsReference);\n }\n\n if (self.bytesArgs.length > 0) {\n buffer.writeString(\"bytesArgs\");\n buffer.startArray();\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\n buffer.writeBytes(self.bytesArgs[i]);\n }\n buffer.endSequence();\n }\n\n return buffer.buf.buf;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Sets the codeLocation and code on the request\n /// @param self The uninitialized request\n /// @param codeLocation The user provided source code location\n /// @param language The programming language of the user code\n /// @param source The user provided source code or a url\n function initializeRequest(\n Request memory self,\n Location codeLocation,\n CodeLanguage language,\n string memory source\n ) internal pure {\n if (bytes(source).length == 0) revert EmptySource();\n\n self.codeLocation = codeLocation;\n self.language = language;\n self.source = source;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Simplified version of initializeRequest for PoC\n /// @param self The uninitialized request\n /// @param javaScriptSource The user provided JS code (must not be empty)\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\n }\n\n /// @notice Adds Remote user encrypted secrets to a Request\n /// @param self The initialized request\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\n\n self.secretsLocation = Location.Remote;\n self.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n /// @notice Adds DON-hosted secrets reference to a Request\n /// @param self The initialized request\n /// @param slotID Slot ID of the user's secrets hosted on DON\n /// @param version User data version (for the slotID)\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"slotID\");\n buffer.writeUInt64(slotID);\n buffer.writeString(\"version\");\n buffer.writeUInt64(version);\n\n self.secretsLocation = Location.DONHosted;\n self.encryptedSecretsReference = buffer.buf.buf;\n }\n\n /// @notice Sets args for the user run function\n /// @param self The initialized request\n /// @param args The array of string args (must not be empty)\n function setArgs(Request memory self, string[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.args = args;\n }\n\n /// @notice Sets bytes args for the user run function\n /// @param self The initialized request\n /// @param args The array of bytes args (must not be empty)\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.bytesArgs = args;\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Library of types that are used for fulfillment of a Functions request\nlibrary FunctionsResponse {\n // Used to send request information from the Router to the Coordinator\n struct RequestMeta {\n bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\n bytes32 flags; // ═══════════════╸ Per-subscription flags\n address requestingContract; // ══╗ The client contract that is sending the request\n uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\n uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint64 initiatedRequests; // β•‘ The number of requests that have been started\n uint32 callbackGasLimit; // β•‘ The amount of gas that the callback to the consuming contract will be given\n uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data\n uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out\n address subscriptionOwner; // ═══╝ The owner of the billing subscription\n }\n\n enum FulfillResult {\n FULFILLED, // 0\n USER_CALLBACK_ERROR, // 1\n INVALID_REQUEST_ID, // 2\n COST_EXCEEDS_COMMITMENT, // 3\n INSUFFICIENT_GAS_PROVIDED, // 4\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\n INVALID_COMMITMENT // 6\n }\n\n struct Commitment {\n bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request\n address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request\n uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\n address client; // ════════════════════╗ The client contract that sent the request\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given\n uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint72 donFee; // β•‘ Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\n uint40 gasOverheadBeforeCallback; // β•‘ Represents the average gas execution cost before the fulfillment callback.\n uint40 gasOverheadAfterCallback; // β•‘ Represents the average gas execution cost after the fulfillment callback.\n uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"../v1_0_0/interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"../v1_0_0/interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"../v1_0_0/libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_functionsRouter;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_functionsRouter = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_functionsRouter.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_functionsRouter)) {\n revert OnlyRouterCanFulfill();\n }\n _fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}" + }, + "@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../@ensdomains/buffer/v0.1.0/Buffer.sol\";\n\n/**\n* @dev A library for populating CBOR encoded payload in Solidity.\n*\n* https://datatracker.ietf.org/doc/html/rfc7049\n*\n* The library offers various write* and start* methods to encode values of different types.\n* The resulted buffer can be obtained with data() method.\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\n* in an invalid CBOR if start/write/end flow is violated.\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\n* except for nested start/end pairs.\n*/\n\nlibrary CBOR {\n using Buffer for Buffer.buffer;\n\n struct CBORBuffer {\n Buffer.buffer buf;\n uint256 depth;\n }\n\n uint8 private constant MAJOR_TYPE_INT = 0;\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\n uint8 private constant MAJOR_TYPE_BYTES = 2;\n uint8 private constant MAJOR_TYPE_STRING = 3;\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\n uint8 private constant MAJOR_TYPE_MAP = 5;\n uint8 private constant MAJOR_TYPE_TAG = 6;\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\n\n uint8 private constant TAG_TYPE_BIGNUM = 2;\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\n\n uint8 private constant CBOR_FALSE = 20;\n uint8 private constant CBOR_TRUE = 21;\n uint8 private constant CBOR_NULL = 22;\n uint8 private constant CBOR_UNDEFINED = 23;\n\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\n Buffer.init(cbor.buf, capacity);\n cbor.depth = 0;\n return cbor;\n }\n\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\n require(buf.depth == 0, \"Invalid CBOR\");\n return buf.buf.buf;\n }\n\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\n writeBytes(buf, abi.encode(value));\n }\n\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\n if (value < 0) {\n buf.buf.appendUint8(\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\n );\n writeBytes(buf, abi.encode(uint256(-1 - value)));\n } else {\n writeUInt256(buf, uint256(value));\n }\n }\n\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\n }\n\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\n if(value >= 0) {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\n } else{\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\n }\n }\n\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\n buf.buf.append(value);\n }\n\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\n buf.buf.append(bytes(value));\n }\n\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\n }\n\n function writeNull(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_NULL);\n }\n\n function writeUndefined(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_UNDEFINED);\n }\n\n function startArray(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\n buf.depth += 1;\n }\n\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\n }\n\n function startMap(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\n buf.depth += 1;\n }\n\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\n }\n\n function endSequence(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\n buf.depth -= 1;\n }\n\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\n writeString(buf, key);\n writeString(buf, value);\n }\n\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\n writeString(buf, key);\n writeBytes(buf, value);\n }\n\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\n writeString(buf, key);\n writeUInt256(buf, value);\n }\n\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\n writeString(buf, key);\n writeInt256(buf, value);\n }\n\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\n writeString(buf, key);\n writeUInt64(buf, value);\n }\n\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\n writeString(buf, key);\n writeInt64(buf, value);\n }\n\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\n writeString(buf, key);\n writeBool(buf, value);\n }\n\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeNull(buf);\n }\n\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeUndefined(buf);\n }\n\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startMap(buf);\n }\n\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startArray(buf);\n }\n\n function writeFixedNumeric(\n CBORBuffer memory buf,\n uint8 major,\n uint64 value\n ) private pure {\n if (value <= 23) {\n buf.buf.appendUint8(uint8((major << 5) | value));\n } else if (value <= 0xFF) {\n buf.buf.appendUint8(uint8((major << 5) | 24));\n buf.buf.appendInt(value, 1);\n } else if (value <= 0xFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 25));\n buf.buf.appendInt(value, 2);\n } else if (value <= 0xFFFFFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 26));\n buf.buf.appendInt(value, 4);\n } else {\n buf.buf.appendUint8(uint8((major << 5) | 27));\n buf.buf.appendInt(value, 8);\n }\n }\n\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\n private\n pure\n {\n buf.buf.appendUint8(uint8((major << 5) | 31));\n }\n\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\n private\n pure\n {\n writeFixedNumeric(buf, major, length);\n }\n\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\n }\n}" + }, + "@openzeppelin/contracts/access/AccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.20;\n\nimport {IAccessControl} from \"./IAccessControl.sol\";\nimport {Context} from \"../utils/Context.sol\";\nimport {ERC165} from \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account => bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n" + }, + "@openzeppelin/contracts/access/IAccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "contracts/CCGateway.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport './interfaces/ICCGateway.sol';\nimport {ICCGatewayClient} from './interfaces/ICCGatewayClient.sol';\n\nimport {FunctionsClient} from \"@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol\";\nimport {AccessControl} from \"@openzeppelin/contracts/access/AccessControl.sol\";\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\";\n\ncontract CCGateway is ICCGateway, FunctionsClient, AccessControl {\n using FunctionsRequest for FunctionsRequest.Request;\n\n bytes32 public constant MANAGER_ROLE = keccak256(\"MANAGER_ROLE\");\n bytes32 public constant CLIENT_ROLE = keccak256(\"CLIENT_ROLE\");\n bytes32 private _donId; // DON ID for the Functions DON to which the requests are sent\n\n mapping(uint64 subscriptionId => CCGRequest) private _requests; // Each subscription can only handle one kind of request\n mapping(bytes32 requestId => ICCGatewayClient.CCGResponse) private unprocessed_responses; // Responses that have not been processed yet\n\n // array of registered subscriptions\n uint64[] public subscriptions;\n\n constructor(address router, bytes32 initialDonId, address initialOwner) FunctionsClient(router) {\n _donId = initialDonId;\n\n address to = address(0) == initialOwner ? _msgSender() : initialOwner;\n _grantRole(DEFAULT_ADMIN_ROLE, to);\n _grantRole(MANAGER_ROLE, to);\n }\n\n /**\n * @dev Set the DON ID\n * @param newDonId New DON ID\n */\n function setDonId(bytes32 newDonId) external onlyRole(getRoleAdmin(MANAGER_ROLE)) {\n _donId = newDonId;\n }\n\n /**\n * @dev Get the DON ID\n * @return DON ID\n */\n function donId() external view returns (bytes32) {\n return _donId;\n }\n\n function registerRequest(\n uint64 subscriptionId,\n FunctionsRequest.Location codeLocation,\n string calldata source,\n FunctionsRequest.Location secretsLocation,\n bytes calldata encryptedSecretsReference,\n uint32 callbackGasLimit,\n string calldata name\n ) external onlyManager {\n if (bytes(name).length == 0) {revert CCGRequestNameEmpty();}\n\n CCGRequest storage req = _requests[subscriptionId];\n req.name = name;\n req.callbackGasLimit = callbackGasLimit;\n\n // Only JavaScript is supported for now\n req.config.language = FunctionsRequest.CodeLanguage.JavaScript;\n req.config.codeLocation = codeLocation;\n req.config.source = source;\n req.config.secretsLocation = secretsLocation;\n req.config.encryptedSecretsReference = encryptedSecretsReference;\n\n subscriptions.push(subscriptionId);\n }\n\n function removeRequest(uint64 subscriptionId) external onlyManager {\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n delete _requests[subscriptionId];\n\n // Find the index of the subscriptionId in the subscriptions array\n uint256 index = subscriptions.length;\n for (uint256 i = 0; i < subscriptions.length; i++) {\n if (index == subscriptions.length && subscriptions[i] == subscriptionId) index = i;\n if (index != subscriptions.length && i + 1 < subscriptions.length) subscriptions[i] = subscriptions[i + 1];\n }\n\n subscriptions.pop();\n }\n\n function getRequest(uint64 subscriptionId) external view onlyManager returns (CCGRequest memory) {\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n return _requests[subscriptionId];\n }\n// ---------------------------------------------------------------------------------------------------------------------\n modifier onlySource(bytes32 requestId) {\n if (unprocessed_responses[requestId].source != _msgSender()) {revert CCGOnlySameSourceAllowed(requestId);}\n _;\n }\n\n modifier onlyManager() {\n if (!hasRole(MANAGER_ROLE, tx.origin)) {revert CCGOnlyManagerAllowed();}\n _;\n }\n// ---------------------------------------------------------------------------------------------------------------------\n /**\n * @notice Triggers an on-demand Functions request using remote encrypted secrets\n * @param subscriptionId Subscription ID used to pay for request (FunctionsConsumer contract address must first be added to the subscription)\n * @param args String arguments passed into the source code and accessible via the global variable `args`\n * @param bytesArgs Bytes arguments passed into the source code and accessible via the global variable `bytesArgs` as hex strings\n * @param encryptedSecretsReference Reference pointing to encrypted secrets\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external onlyRole(CLIENT_ROLE) returns (bytes32 requestId) {\n CCGRequest storage request = _requests[subscriptionId];\n if (bytes(request.name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n\n FunctionsRequest.Request memory req = request.config;\n req.initializeRequest(req.codeLocation, FunctionsRequest.CodeLanguage.JavaScript, req.source);\n if (encryptedSecretsReference.length > 0) {req.encryptedSecretsReference = encryptedSecretsReference;}\n\n if (args.length > 0) {\n req.setArgs(args);\n }\n if (bytesArgs.length > 0) {\n req.setBytesArgs(bytesArgs);\n }\n\n requestId = _sendRequest(req.encodeCBOR(), subscriptionId, request.callbackGasLimit, _donId);\n unprocessed_responses[requestId].state = ICCGatewayClient.CCGResponseState.Sent;\n unprocessed_responses[requestId].source = _msgSender();\n }\n\n /**\n * @notice Store latest result/error\n * @param requestId The request ID, returned by sendRequest()\n * @param response Aggregated response from the user code\n * @param err Aggregated error from the user code or from the execution pipeline\n * Either response or error parameter will be set, but never both\n */\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal override {\n ICCGatewayClient.CCGResponse storage resp = unprocessed_responses[requestId];\n if (resp.state != ICCGatewayClient.CCGResponseState.Sent) {revert CCGRequestAlreadyFulfilled(requestId);}\n\n unprocessed_responses[requestId].state = err.length > 0 ? ICCGatewayClient.CCGResponseState.Error : ICCGatewayClient.CCGResponseState.Success;\n unprocessed_responses[requestId].data = response;\n unprocessed_responses[requestId].error = err;\n\n ICCGatewayClient(resp.source).callback(requestId);\n }\n\n /**\n * @dev Get the response data\n * @param requestId The request ID, returned by sendRequest()\n * @return response CCGResponse\n */\n function getResponse(bytes32 requestId, bool remove) external onlySource(requestId) returns (ICCGatewayClient.CCGResponse memory response) {\n response = unprocessed_responses[requestId];\n if (remove) {delete unprocessed_responses[requestId];}\n }\n}" + }, + "contracts/interfaces/ICCGateway.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\";\n\ninterface ICCGateway {\n struct CCGRequest {\n string name;\n uint32 callbackGasLimit;\n FunctionsRequest.Request config;\n }\n\n /**\n * @dev Can't register a request with an empty name\n */\n error CCGRequestNameEmpty();\n\n /**\n * @dev Only the same source of the requestId is allowed to call the function\n */\n error CCGOnlySameSourceAllowed(bytes32 requestId);\n\n /**\n * @dev Only a registered subscriptionId is allowed to call the function\n */\n error CCGRequestNotRegistered(uint64 subscriptionId);\n\n /**\n * @dev Can't fulfill a request that has already been fulfilled\n */\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\n\n /**\n * @dev Only A manager can call the function\n */\n error CCGOnlyManagerAllowed();\n\n /**\n * @dev Send a request to the Functions DON\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external returns (bytes32 requestId);\n\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\n}\n" + }, + "contracts/interfaces/ICCGatewayClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\ninterface ICCGatewayClient {\n enum CCGResponseState {Sent, Success, Error}\n\n struct CCGResponse {\n uint64 subscriptionId;\n address source;\n CCGResponseState state;\n bytes data;\n bytes error;\n }\n\n function callback(bytes32 requestId) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/optimismSepolia/solcInputs/be18bfdeea6869d68a166c8869814257.json b/packages/hardhat/deployments/optimismSepolia/solcInputs/be18bfdeea6869d68a166c8869814257.json new file mode 100644 index 0000000..b29947d --- /dev/null +++ b/packages/hardhat/deployments/optimismSepolia/solcInputs/be18bfdeea6869d68a166c8869814257.json @@ -0,0 +1,81 @@ +{ + "language": "Solidity", + "sources": { + "@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"./interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"./interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"./libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_router;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_router = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_router.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_router)) {\n revert OnlyRouterCanFulfill();\n }\n fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Chainlink Functions client interface.\ninterface IFunctionsClient {\n /// @notice Chainlink Functions response handler called by the Functions Router\n /// during fullilment from the designated transmitter node in an OCR round.\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\n /// @param response Aggregated response from the request's source code.\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\n /// @dev Either response or error parameter will be set, but never both.\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {FunctionsResponse} from \"../libraries/FunctionsResponse.sol\";\n\n/// @title Chainlink Functions Router interface.\ninterface IFunctionsRouter {\n /// @notice The identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n /// @return id - bytes32 id that can be passed to the \"getContractById\" of the Router\n function getAllowListId() external view returns (bytes32);\n\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n function setAllowListId(bytes32 allowListId) external;\n\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\n /// @return adminFee\n function getAdminFee() external view returns (uint72 adminFee);\n\n /// @notice Sends a request using the provided subscriptionId\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequest(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Sends a request to the proposed contracts\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequestToProposed(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Fulfill the request by:\n /// - calling back the data that the Oracle returned to the client contract\n /// - pay the DON for processing the request\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\n /// @param response response data from DON consensus\n /// @param err error from DON consensus\n /// @param juelsPerGas - current rate of juels/gas\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\n /// @param transmitter - The Node that transmitted the OCR report\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\n /// @return fulfillResult -\n /// @return callbackGasCostJuels -\n function fulfill(\n bytes memory response,\n bytes memory err,\n uint96 juelsPerGas,\n uint96 costWithoutFulfillment,\n address transmitter,\n FunctionsResponse.Commitment memory commitment\n ) external returns (FunctionsResponse.FulfillResult, uint96);\n\n /// @notice Validate requested gas limit is below the subscription max.\n /// @param subscriptionId subscription ID\n /// @param callbackGasLimit desired callback gas limit\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\n\n /// @notice Get the current contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current contract address\n function getContractById(bytes32 id) external view returns (address);\n\n /// @notice Get the proposed next contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current or proposed contract address\n function getProposedContractById(bytes32 id) external view returns (address);\n\n /// @notice Return the latest proprosal set\n /// @return ids The identifiers of the contracts to update\n /// @return to The addresses of the contracts that will be updated to\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\n\n /// @notice Proposes one or more updates to the contract routes\n /// @dev Only callable by owner\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\n\n /// @notice Updates the current contract routes to the proposed contracts\n /// @dev Only callable by owner\n function updateContracts() external;\n\n /// @dev Puts the system into an emergency stopped state.\n /// @dev Only callable by owner\n function pause() external;\n\n /// @dev Takes the system out of an emergency stopped state.\n /// @dev Only callable by owner\n function unpause() external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {CBOR} from \"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\";\n\n/// @title Library for encoding the input data of a Functions request into CBOR\nlibrary FunctionsRequest {\n using CBOR for CBOR.CBORBuffer;\n\n uint16 public constant REQUEST_DATA_VERSION = 1;\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\n\n enum Location {\n Inline, // Provided within the Request\n Remote, // Hosted through remote location that can be accessed through a provided URL\n DONHosted // Hosted on the DON's storage\n }\n\n enum CodeLanguage {\n JavaScript\n // In future version we may add other languages\n }\n\n struct Request {\n Location codeLocation; // ════════════╸ The location of the source code that will be executed on each node in the DON\n Location secretsLocation; // ═════════╸ The location of secrets that will be passed into the source code. *Only Remote secrets are supported\n CodeLanguage language; // ════════════╸ The coding language that the source code is written in\n string source; // ════════════════════╸ Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\n bytes encryptedSecretsReference; // ══╸ Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\n string[] args; // ════════════════════╸ String arguments that will be passed into the source code\n bytes[] bytesArgs; // ════════════════╸ Bytes arguments that will be passed into the source code\n }\n\n error EmptySource();\n error EmptySecrets();\n error EmptyArgs();\n error NoInlineSecrets();\n\n /// @notice Encodes a Request to CBOR encoded bytes\n /// @param self The request to encode\n /// @return CBOR encoded bytes\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"codeLocation\");\n buffer.writeUInt256(uint256(self.codeLocation));\n\n buffer.writeString(\"language\");\n buffer.writeUInt256(uint256(self.language));\n\n buffer.writeString(\"source\");\n buffer.writeString(self.source);\n\n if (self.args.length > 0) {\n buffer.writeString(\"args\");\n buffer.startArray();\n for (uint256 i = 0; i < self.args.length; ++i) {\n buffer.writeString(self.args[i]);\n }\n buffer.endSequence();\n }\n\n if (self.encryptedSecretsReference.length > 0) {\n if (self.secretsLocation == Location.Inline) {\n revert NoInlineSecrets();\n }\n buffer.writeString(\"secretsLocation\");\n buffer.writeUInt256(uint256(self.secretsLocation));\n buffer.writeString(\"secrets\");\n buffer.writeBytes(self.encryptedSecretsReference);\n }\n\n if (self.bytesArgs.length > 0) {\n buffer.writeString(\"bytesArgs\");\n buffer.startArray();\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\n buffer.writeBytes(self.bytesArgs[i]);\n }\n buffer.endSequence();\n }\n\n return buffer.buf.buf;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Sets the codeLocation and code on the request\n /// @param self The uninitialized request\n /// @param codeLocation The user provided source code location\n /// @param language The programming language of the user code\n /// @param source The user provided source code or a url\n function initializeRequest(\n Request memory self,\n Location codeLocation,\n CodeLanguage language,\n string memory source\n ) internal pure {\n if (bytes(source).length == 0) revert EmptySource();\n\n self.codeLocation = codeLocation;\n self.language = language;\n self.source = source;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Simplified version of initializeRequest for PoC\n /// @param self The uninitialized request\n /// @param javaScriptSource The user provided JS code (must not be empty)\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\n }\n\n /// @notice Adds Remote user encrypted secrets to a Request\n /// @param self The initialized request\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\n\n self.secretsLocation = Location.Remote;\n self.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n /// @notice Adds DON-hosted secrets reference to a Request\n /// @param self The initialized request\n /// @param slotID Slot ID of the user's secrets hosted on DON\n /// @param version User data version (for the slotID)\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"slotID\");\n buffer.writeUInt64(slotID);\n buffer.writeString(\"version\");\n buffer.writeUInt64(version);\n\n self.secretsLocation = Location.DONHosted;\n self.encryptedSecretsReference = buffer.buf.buf;\n }\n\n /// @notice Sets args for the user run function\n /// @param self The initialized request\n /// @param args The array of string args (must not be empty)\n function setArgs(Request memory self, string[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.args = args;\n }\n\n /// @notice Sets bytes args for the user run function\n /// @param self The initialized request\n /// @param args The array of bytes args (must not be empty)\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.bytesArgs = args;\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Library of types that are used for fulfillment of a Functions request\nlibrary FunctionsResponse {\n // Used to send request information from the Router to the Coordinator\n struct RequestMeta {\n bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\n bytes32 flags; // ═══════════════╸ Per-subscription flags\n address requestingContract; // ══╗ The client contract that is sending the request\n uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\n uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint64 initiatedRequests; // β•‘ The number of requests that have been started\n uint32 callbackGasLimit; // β•‘ The amount of gas that the callback to the consuming contract will be given\n uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data\n uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out\n address subscriptionOwner; // ═══╝ The owner of the billing subscription\n }\n\n enum FulfillResult {\n FULFILLED, // 0\n USER_CALLBACK_ERROR, // 1\n INVALID_REQUEST_ID, // 2\n COST_EXCEEDS_COMMITMENT, // 3\n INSUFFICIENT_GAS_PROVIDED, // 4\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\n INVALID_COMMITMENT // 6\n }\n\n struct Commitment {\n bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request\n address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request\n uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\n address client; // ════════════════════╗ The client contract that sent the request\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given\n uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint72 donFee; // β•‘ Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\n uint40 gasOverheadBeforeCallback; // β•‘ Represents the average gas execution cost before the fulfillment callback.\n uint40 gasOverheadAfterCallback; // β•‘ Represents the average gas execution cost after the fulfillment callback.\n uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"../v1_0_0/interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"../v1_0_0/interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"../v1_0_0/libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_functionsRouter;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_functionsRouter = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_functionsRouter.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_functionsRouter)) {\n revert OnlyRouterCanFulfill();\n }\n _fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}" + }, + "@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../@ensdomains/buffer/v0.1.0/Buffer.sol\";\n\n/**\n* @dev A library for populating CBOR encoded payload in Solidity.\n*\n* https://datatracker.ietf.org/doc/html/rfc7049\n*\n* The library offers various write* and start* methods to encode values of different types.\n* The resulted buffer can be obtained with data() method.\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\n* in an invalid CBOR if start/write/end flow is violated.\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\n* except for nested start/end pairs.\n*/\n\nlibrary CBOR {\n using Buffer for Buffer.buffer;\n\n struct CBORBuffer {\n Buffer.buffer buf;\n uint256 depth;\n }\n\n uint8 private constant MAJOR_TYPE_INT = 0;\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\n uint8 private constant MAJOR_TYPE_BYTES = 2;\n uint8 private constant MAJOR_TYPE_STRING = 3;\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\n uint8 private constant MAJOR_TYPE_MAP = 5;\n uint8 private constant MAJOR_TYPE_TAG = 6;\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\n\n uint8 private constant TAG_TYPE_BIGNUM = 2;\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\n\n uint8 private constant CBOR_FALSE = 20;\n uint8 private constant CBOR_TRUE = 21;\n uint8 private constant CBOR_NULL = 22;\n uint8 private constant CBOR_UNDEFINED = 23;\n\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\n Buffer.init(cbor.buf, capacity);\n cbor.depth = 0;\n return cbor;\n }\n\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\n require(buf.depth == 0, \"Invalid CBOR\");\n return buf.buf.buf;\n }\n\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\n writeBytes(buf, abi.encode(value));\n }\n\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\n if (value < 0) {\n buf.buf.appendUint8(\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\n );\n writeBytes(buf, abi.encode(uint256(-1 - value)));\n } else {\n writeUInt256(buf, uint256(value));\n }\n }\n\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\n }\n\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\n if(value >= 0) {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\n } else{\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\n }\n }\n\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\n buf.buf.append(value);\n }\n\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\n buf.buf.append(bytes(value));\n }\n\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\n }\n\n function writeNull(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_NULL);\n }\n\n function writeUndefined(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_UNDEFINED);\n }\n\n function startArray(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\n buf.depth += 1;\n }\n\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\n }\n\n function startMap(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\n buf.depth += 1;\n }\n\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\n }\n\n function endSequence(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\n buf.depth -= 1;\n }\n\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\n writeString(buf, key);\n writeString(buf, value);\n }\n\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\n writeString(buf, key);\n writeBytes(buf, value);\n }\n\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\n writeString(buf, key);\n writeUInt256(buf, value);\n }\n\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\n writeString(buf, key);\n writeInt256(buf, value);\n }\n\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\n writeString(buf, key);\n writeUInt64(buf, value);\n }\n\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\n writeString(buf, key);\n writeInt64(buf, value);\n }\n\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\n writeString(buf, key);\n writeBool(buf, value);\n }\n\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeNull(buf);\n }\n\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeUndefined(buf);\n }\n\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startMap(buf);\n }\n\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startArray(buf);\n }\n\n function writeFixedNumeric(\n CBORBuffer memory buf,\n uint8 major,\n uint64 value\n ) private pure {\n if (value <= 23) {\n buf.buf.appendUint8(uint8((major << 5) | value));\n } else if (value <= 0xFF) {\n buf.buf.appendUint8(uint8((major << 5) | 24));\n buf.buf.appendInt(value, 1);\n } else if (value <= 0xFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 25));\n buf.buf.appendInt(value, 2);\n } else if (value <= 0xFFFFFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 26));\n buf.buf.appendInt(value, 4);\n } else {\n buf.buf.appendUint8(uint8((major << 5) | 27));\n buf.buf.appendInt(value, 8);\n }\n }\n\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\n private\n pure\n {\n buf.buf.appendUint8(uint8((major << 5) | 31));\n }\n\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\n private\n pure\n {\n writeFixedNumeric(buf, major, length);\n }\n\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\n }\n}" + }, + "@openzeppelin/contracts/access/AccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.20;\n\nimport {IAccessControl} from \"./IAccessControl.sol\";\nimport {Context} from \"../utils/Context.sol\";\nimport {ERC165} from \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account => bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n" + }, + "@openzeppelin/contracts/access/IAccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "contracts/CCGateway.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport './interfaces/ICCGateway.sol';\nimport {ICCGatewayClient} from './interfaces/ICCGatewayClient.sol';\n\nimport {FunctionsClient} from \"@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol\";\nimport {AccessControl} from \"@openzeppelin/contracts/access/AccessControl.sol\";\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\";\n\ncontract CCGateway is ICCGateway, FunctionsClient, AccessControl {\n using FunctionsRequest for FunctionsRequest.Request;\n\n bytes32 public constant MANAGER_ROLE = keccak256(\"MANAGER_ROLE\");\n bytes32 public constant CLIENT_ROLE = keccak256(\"CLIENT_ROLE\");\n bytes32 private _donId; // DON ID for the Functions DON to which the requests are sent\n\n mapping(uint64 subscriptionId => CCGRequest) private _requests; // Each subscription can only handle one kind of request\n mapping(bytes32 requestId => ICCGatewayClient.CCGResponse) private unprocessed_responses; // Responses that have not been processed yet\n\n // array of registered subscriptions\n uint64[] public subscriptions;\n\n constructor(address router, bytes32 initialDonId, address initialOwner) FunctionsClient(router) {\n _donId = initialDonId;\n\n address to = address(0) == initialOwner ? _msgSender() : initialOwner;\n _grantRole(DEFAULT_ADMIN_ROLE, to);\n _grantRole(MANAGER_ROLE, to);\n }\n\n /**\n * @dev Set the DON ID\n * @param newDonId New DON ID\n */\n function setDonId(bytes32 newDonId) external onlyRole(getRoleAdmin(MANAGER_ROLE)) {\n _donId = newDonId;\n }\n\n /**\n * @dev Get the DON ID\n * @return DON ID\n */\n function donId() external view returns (bytes32) {\n return _donId;\n }\n\n function registerRequest(\n uint64 subscriptionId,\n FunctionsRequest.Location codeLocation,\n string calldata source,\n FunctionsRequest.Location secretsLocation,\n bytes calldata encryptedSecretsReference,\n uint32 callbackGasLimit,\n string calldata name\n ) external onlyManager {\n if (bytes(name).length == 0) {revert CCGRequestNameEmpty();}\n\n CCGRequest storage req = _requests[subscriptionId];\n if(bytes(req.name).length == 0) {subscriptions.push(subscriptionId);}\n\n req.name = name;\n req.callbackGasLimit = callbackGasLimit;\n\n // Only JavaScript is supported for now\n req.config.language = FunctionsRequest.CodeLanguage.JavaScript;\n req.config.codeLocation = codeLocation;\n req.config.source = source;\n req.config.secretsLocation = secretsLocation;\n req.config.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n function removeRequest(uint64 subscriptionId) external onlyManager {\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n delete _requests[subscriptionId];\n\n // Find the index of the subscriptionId in the subscriptions array\n uint256 index = subscriptions.length;\n for (uint256 i = 0; i < subscriptions.length; i++) {\n if (index == subscriptions.length && subscriptions[i] == subscriptionId) index = i;\n if (index != subscriptions.length && i + 1 < subscriptions.length) subscriptions[i] = subscriptions[i + 1];\n }\n\n subscriptions.pop();\n }\n\n function getRequest(uint64 subscriptionId) external view returns (CCGRequest memory) {\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n return _requests[subscriptionId];\n }\n// ---------------------------------------------------------------------------------------------------------------------\n modifier onlySource(bytes32 requestId) {\n if (unprocessed_responses[requestId].source != _msgSender()) {revert CCGOnlySameSourceAllowed(requestId);}\n _;\n }\n\n modifier onlyManager() {\n if (!hasRole(MANAGER_ROLE, tx.origin)) {revert CCGOnlyManagerAllowed();}\n _;\n }\n// ---------------------------------------------------------------------------------------------------------------------\n /**\n * @notice Triggers an on-demand Functions request using remote encrypted secrets\n * @param subscriptionId Subscription ID used to pay for request (FunctionsConsumer contract address must first be added to the subscription)\n * @param args String arguments passed into the source code and accessible via the global variable `args`\n * @param bytesArgs Bytes arguments passed into the source code and accessible via the global variable `bytesArgs` as hex strings\n * @param encryptedSecretsReference Reference pointing to encrypted secrets\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external onlyRole(CLIENT_ROLE) returns (bytes32 requestId) {\n CCGRequest storage request = _requests[subscriptionId];\n if (bytes(request.name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n\n FunctionsRequest.Request memory req = request.config;\n req.initializeRequest(req.codeLocation, FunctionsRequest.CodeLanguage.JavaScript, req.source);\n if (encryptedSecretsReference.length > 0) {req.encryptedSecretsReference = encryptedSecretsReference;}\n\n if (args.length > 0) {\n req.setArgs(args);\n }\n if (bytesArgs.length > 0) {\n req.setBytesArgs(bytesArgs);\n }\n\n requestId = _sendRequest(req.encodeCBOR(), subscriptionId, request.callbackGasLimit, _donId);\n unprocessed_responses[requestId].state = ICCGatewayClient.CCGResponseState.Sent;\n unprocessed_responses[requestId].source = _msgSender();\n }\n\n /**\n * @notice Store latest result/error\n * @param requestId The request ID, returned by sendRequest()\n * @param response Aggregated response from the user code\n * @param err Aggregated error from the user code or from the execution pipeline\n * Either response or error parameter will be set, but never both\n */\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal override {\n ICCGatewayClient.CCGResponse storage resp = unprocessed_responses[requestId];\n if (resp.state != ICCGatewayClient.CCGResponseState.Sent) {revert CCGRequestAlreadyFulfilled(requestId);}\n\n unprocessed_responses[requestId].state = err.length > 0 ? ICCGatewayClient.CCGResponseState.Error : ICCGatewayClient.CCGResponseState.Success;\n unprocessed_responses[requestId].data = response;\n unprocessed_responses[requestId].error = err;\n\n ICCGatewayClient(resp.source).callback(requestId);\n }\n\n /**\n * @dev Get the response data\n * @param requestId The request ID, returned by sendRequest()\n * @return response CCGResponse\n */\n function getResponse(bytes32 requestId, bool remove) external onlySource(requestId) returns (ICCGatewayClient.CCGResponse memory response) {\n response = unprocessed_responses[requestId];\n if (remove) {delete unprocessed_responses[requestId];}\n }\n}" + }, + "contracts/interfaces/ICCGateway.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\";\n\ninterface ICCGateway {\n struct CCGRequest {\n string name;\n uint32 callbackGasLimit;\n FunctionsRequest.Request config;\n }\n\n /**\n * @dev Can't register a request with an empty name\n */\n error CCGRequestNameEmpty();\n\n /**\n * @dev Only the same source of the requestId is allowed to call the function\n */\n error CCGOnlySameSourceAllowed(bytes32 requestId);\n\n /**\n * @dev Only a registered subscriptionId is allowed to call the function\n */\n error CCGRequestNotRegistered(uint64 subscriptionId);\n\n /**\n * @dev Can't fulfill a request that has already been fulfilled\n */\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\n\n /**\n * @dev Only A manager can call the function\n */\n error CCGOnlyManagerAllowed();\n\n /**\n * @dev Send a request to the Functions DON\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external returns (bytes32 requestId);\n\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\n}\n" + }, + "contracts/interfaces/ICCGatewayClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\ninterface ICCGatewayClient {\n enum CCGResponseState {Sent, Success, Error}\n\n struct CCGResponse {\n uint64 subscriptionId;\n address source;\n CCGResponseState state;\n bytes data;\n bytes error;\n }\n\n function callback(bytes32 requestId) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/optimismSepolia/solcInputs/da2f6e6d8541f69733b0b28912d4a325.json b/packages/hardhat/deployments/optimismSepolia/solcInputs/da2f6e6d8541f69733b0b28912d4a325.json new file mode 100644 index 0000000..0910532 --- /dev/null +++ b/packages/hardhat/deployments/optimismSepolia/solcInputs/da2f6e6d8541f69733b0b28912d4a325.json @@ -0,0 +1,66 @@ +{ + "language": "Solidity", + "sources": { + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Chainlink Functions client interface.\ninterface IFunctionsClient {\n /// @notice Chainlink Functions response handler called by the Functions Router\n /// during fullilment from the designated transmitter node in an OCR round.\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\n /// @param response Aggregated response from the request's source code.\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\n /// @dev Either response or error parameter will be set, but never both.\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {FunctionsResponse} from \"../libraries/FunctionsResponse.sol\";\n\n/// @title Chainlink Functions Router interface.\ninterface IFunctionsRouter {\n /// @notice The identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n /// @return id - bytes32 id that can be passed to the \"getContractById\" of the Router\n function getAllowListId() external view returns (bytes32);\n\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n function setAllowListId(bytes32 allowListId) external;\n\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\n /// @return adminFee\n function getAdminFee() external view returns (uint72 adminFee);\n\n /// @notice Sends a request using the provided subscriptionId\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequest(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Sends a request to the proposed contracts\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequestToProposed(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Fulfill the request by:\n /// - calling back the data that the Oracle returned to the client contract\n /// - pay the DON for processing the request\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\n /// @param response response data from DON consensus\n /// @param err error from DON consensus\n /// @param juelsPerGas - current rate of juels/gas\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\n /// @param transmitter - The Node that transmitted the OCR report\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\n /// @return fulfillResult -\n /// @return callbackGasCostJuels -\n function fulfill(\n bytes memory response,\n bytes memory err,\n uint96 juelsPerGas,\n uint96 costWithoutFulfillment,\n address transmitter,\n FunctionsResponse.Commitment memory commitment\n ) external returns (FunctionsResponse.FulfillResult, uint96);\n\n /// @notice Validate requested gas limit is below the subscription max.\n /// @param subscriptionId subscription ID\n /// @param callbackGasLimit desired callback gas limit\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\n\n /// @notice Get the current contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current contract address\n function getContractById(bytes32 id) external view returns (address);\n\n /// @notice Get the proposed next contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current or proposed contract address\n function getProposedContractById(bytes32 id) external view returns (address);\n\n /// @notice Return the latest proprosal set\n /// @return ids The identifiers of the contracts to update\n /// @return to The addresses of the contracts that will be updated to\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\n\n /// @notice Proposes one or more updates to the contract routes\n /// @dev Only callable by owner\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\n\n /// @notice Updates the current contract routes to the proposed contracts\n /// @dev Only callable by owner\n function updateContracts() external;\n\n /// @dev Puts the system into an emergency stopped state.\n /// @dev Only callable by owner\n function pause() external;\n\n /// @dev Takes the system out of an emergency stopped state.\n /// @dev Only callable by owner\n function unpause() external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {CBOR} from \"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\";\n\n/// @title Library for encoding the input data of a Functions request into CBOR\nlibrary FunctionsRequest {\n using CBOR for CBOR.CBORBuffer;\n\n uint16 public constant REQUEST_DATA_VERSION = 1;\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\n\n enum Location {\n Inline, // Provided within the Request\n Remote, // Hosted through remote location that can be accessed through a provided URL\n DONHosted // Hosted on the DON's storage\n }\n\n enum CodeLanguage {\n JavaScript\n // In future version we may add other languages\n }\n\n struct Request {\n Location codeLocation; // ════════════╸ The location of the source code that will be executed on each node in the DON\n Location secretsLocation; // ═════════╸ The location of secrets that will be passed into the source code. *Only Remote secrets are supported\n CodeLanguage language; // ════════════╸ The coding language that the source code is written in\n string source; // ════════════════════╸ Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\n bytes encryptedSecretsReference; // ══╸ Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\n string[] args; // ════════════════════╸ String arguments that will be passed into the source code\n bytes[] bytesArgs; // ════════════════╸ Bytes arguments that will be passed into the source code\n }\n\n error EmptySource();\n error EmptySecrets();\n error EmptyArgs();\n error NoInlineSecrets();\n\n /// @notice Encodes a Request to CBOR encoded bytes\n /// @param self The request to encode\n /// @return CBOR encoded bytes\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"codeLocation\");\n buffer.writeUInt256(uint256(self.codeLocation));\n\n buffer.writeString(\"language\");\n buffer.writeUInt256(uint256(self.language));\n\n buffer.writeString(\"source\");\n buffer.writeString(self.source);\n\n if (self.args.length > 0) {\n buffer.writeString(\"args\");\n buffer.startArray();\n for (uint256 i = 0; i < self.args.length; ++i) {\n buffer.writeString(self.args[i]);\n }\n buffer.endSequence();\n }\n\n if (self.encryptedSecretsReference.length > 0) {\n if (self.secretsLocation == Location.Inline) {\n revert NoInlineSecrets();\n }\n buffer.writeString(\"secretsLocation\");\n buffer.writeUInt256(uint256(self.secretsLocation));\n buffer.writeString(\"secrets\");\n buffer.writeBytes(self.encryptedSecretsReference);\n }\n\n if (self.bytesArgs.length > 0) {\n buffer.writeString(\"bytesArgs\");\n buffer.startArray();\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\n buffer.writeBytes(self.bytesArgs[i]);\n }\n buffer.endSequence();\n }\n\n return buffer.buf.buf;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Sets the codeLocation and code on the request\n /// @param self The uninitialized request\n /// @param codeLocation The user provided source code location\n /// @param language The programming language of the user code\n /// @param source The user provided source code or a url\n function initializeRequest(\n Request memory self,\n Location codeLocation,\n CodeLanguage language,\n string memory source\n ) internal pure {\n if (bytes(source).length == 0) revert EmptySource();\n\n self.codeLocation = codeLocation;\n self.language = language;\n self.source = source;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Simplified version of initializeRequest for PoC\n /// @param self The uninitialized request\n /// @param javaScriptSource The user provided JS code (must not be empty)\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\n }\n\n /// @notice Adds Remote user encrypted secrets to a Request\n /// @param self The initialized request\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\n\n self.secretsLocation = Location.Remote;\n self.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n /// @notice Adds DON-hosted secrets reference to a Request\n /// @param self The initialized request\n /// @param slotID Slot ID of the user's secrets hosted on DON\n /// @param version User data version (for the slotID)\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"slotID\");\n buffer.writeUInt64(slotID);\n buffer.writeString(\"version\");\n buffer.writeUInt64(version);\n\n self.secretsLocation = Location.DONHosted;\n self.encryptedSecretsReference = buffer.buf.buf;\n }\n\n /// @notice Sets args for the user run function\n /// @param self The initialized request\n /// @param args The array of string args (must not be empty)\n function setArgs(Request memory self, string[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.args = args;\n }\n\n /// @notice Sets bytes args for the user run function\n /// @param self The initialized request\n /// @param args The array of bytes args (must not be empty)\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.bytesArgs = args;\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Library of types that are used for fulfillment of a Functions request\nlibrary FunctionsResponse {\n // Used to send request information from the Router to the Coordinator\n struct RequestMeta {\n bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\n bytes32 flags; // ═══════════════╸ Per-subscription flags\n address requestingContract; // ══╗ The client contract that is sending the request\n uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\n uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint64 initiatedRequests; // β•‘ The number of requests that have been started\n uint32 callbackGasLimit; // β•‘ The amount of gas that the callback to the consuming contract will be given\n uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data\n uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out\n address subscriptionOwner; // ═══╝ The owner of the billing subscription\n }\n\n enum FulfillResult {\n FULFILLED, // 0\n USER_CALLBACK_ERROR, // 1\n INVALID_REQUEST_ID, // 2\n COST_EXCEEDS_COMMITMENT, // 3\n INSUFFICIENT_GAS_PROVIDED, // 4\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\n INVALID_COMMITMENT // 6\n }\n\n struct Commitment {\n bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request\n address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request\n uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\n address client; // ════════════════════╗ The client contract that sent the request\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given\n uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint72 donFee; // β•‘ Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\n uint40 gasOverheadBeforeCallback; // β•‘ Represents the average gas execution cost before the fulfillment callback.\n uint40 gasOverheadAfterCallback; // β•‘ Represents the average gas execution cost after the fulfillment callback.\n uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"../v1_0_0/interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"../v1_0_0/interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"../v1_0_0/libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_functionsRouter;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_functionsRouter = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_functionsRouter.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_functionsRouter)) {\n revert OnlyRouterCanFulfill();\n }\n _fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}" + }, + "@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../@ensdomains/buffer/v0.1.0/Buffer.sol\";\n\n/**\n* @dev A library for populating CBOR encoded payload in Solidity.\n*\n* https://datatracker.ietf.org/doc/html/rfc7049\n*\n* The library offers various write* and start* methods to encode values of different types.\n* The resulted buffer can be obtained with data() method.\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\n* in an invalid CBOR if start/write/end flow is violated.\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\n* except for nested start/end pairs.\n*/\n\nlibrary CBOR {\n using Buffer for Buffer.buffer;\n\n struct CBORBuffer {\n Buffer.buffer buf;\n uint256 depth;\n }\n\n uint8 private constant MAJOR_TYPE_INT = 0;\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\n uint8 private constant MAJOR_TYPE_BYTES = 2;\n uint8 private constant MAJOR_TYPE_STRING = 3;\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\n uint8 private constant MAJOR_TYPE_MAP = 5;\n uint8 private constant MAJOR_TYPE_TAG = 6;\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\n\n uint8 private constant TAG_TYPE_BIGNUM = 2;\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\n\n uint8 private constant CBOR_FALSE = 20;\n uint8 private constant CBOR_TRUE = 21;\n uint8 private constant CBOR_NULL = 22;\n uint8 private constant CBOR_UNDEFINED = 23;\n\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\n Buffer.init(cbor.buf, capacity);\n cbor.depth = 0;\n return cbor;\n }\n\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\n require(buf.depth == 0, \"Invalid CBOR\");\n return buf.buf.buf;\n }\n\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\n writeBytes(buf, abi.encode(value));\n }\n\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\n if (value < 0) {\n buf.buf.appendUint8(\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\n );\n writeBytes(buf, abi.encode(uint256(-1 - value)));\n } else {\n writeUInt256(buf, uint256(value));\n }\n }\n\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\n }\n\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\n if(value >= 0) {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\n } else{\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\n }\n }\n\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\n buf.buf.append(value);\n }\n\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\n buf.buf.append(bytes(value));\n }\n\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\n }\n\n function writeNull(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_NULL);\n }\n\n function writeUndefined(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_UNDEFINED);\n }\n\n function startArray(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\n buf.depth += 1;\n }\n\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\n }\n\n function startMap(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\n buf.depth += 1;\n }\n\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\n }\n\n function endSequence(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\n buf.depth -= 1;\n }\n\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\n writeString(buf, key);\n writeString(buf, value);\n }\n\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\n writeString(buf, key);\n writeBytes(buf, value);\n }\n\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\n writeString(buf, key);\n writeUInt256(buf, value);\n }\n\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\n writeString(buf, key);\n writeInt256(buf, value);\n }\n\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\n writeString(buf, key);\n writeUInt64(buf, value);\n }\n\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\n writeString(buf, key);\n writeInt64(buf, value);\n }\n\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\n writeString(buf, key);\n writeBool(buf, value);\n }\n\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeNull(buf);\n }\n\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeUndefined(buf);\n }\n\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startMap(buf);\n }\n\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startArray(buf);\n }\n\n function writeFixedNumeric(\n CBORBuffer memory buf,\n uint8 major,\n uint64 value\n ) private pure {\n if (value <= 23) {\n buf.buf.appendUint8(uint8((major << 5) | value));\n } else if (value <= 0xFF) {\n buf.buf.appendUint8(uint8((major << 5) | 24));\n buf.buf.appendInt(value, 1);\n } else if (value <= 0xFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 25));\n buf.buf.appendInt(value, 2);\n } else if (value <= 0xFFFFFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 26));\n buf.buf.appendInt(value, 4);\n } else {\n buf.buf.appendUint8(uint8((major << 5) | 27));\n buf.buf.appendInt(value, 8);\n }\n }\n\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\n private\n pure\n {\n buf.buf.appendUint8(uint8((major << 5) | 31));\n }\n\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\n private\n pure\n {\n writeFixedNumeric(buf, major, length);\n }\n\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\n }\n}" + }, + "contracts/CCExampleClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from \"./interfaces/ICCGatewayClient.sol\";\nimport {ICCGateway} from \"./interfaces/ICCGateway.sol\";\n\ncontract CCExampleClient is ICCGatewayClient {\n ICCGateway private immutable gateway;\n\n uint64 public subscriptionId = 0;\n bytes public encryptedSecretsReference = \"\";\n\n event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response);\n event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error);\n\n constructor(address gatewayAddress) {\n gateway = ICCGateway(gatewayAddress);\n }\n\n function updateSubscriptionId(uint64 _subscriptionId) external {\n subscriptionId = _subscriptionId;\n }\n\n function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external {\n encryptedSecretsReference = _encryptedSecretsReference;\n }\n\n function request(string[] calldata args, bytes[] calldata bytesArgs) external {\n require(subscriptionId != 0, \"Subscription ID not set\");\n\n gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference);\n }\n\n function callback(bytes32 requestId) external override {\n ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true);\n\n if (response.state == ICCGatewayClient.CCGResponseState.Success) {\n emit ResponseReceived(response.subscriptionId, requestId, string(response.data));\n } else {\n emit ErrorReceived(response.subscriptionId, requestId, string(response.error));\n }\n }\n}\n" + }, + "contracts/CCNotificationClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {CCExampleClient} from \"./CCExampleClient.sol\";\n\ncontract CCNotificationClient is CCExampleClient {\n constructor(address gatewayAddress) CCExampleClient(gatewayAddress) {}\n}\n" + }, + "contracts/interfaces/ICCGateway.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\";\n\ninterface ICCGateway {\n struct CCGRequest {\n string name;\n uint32 callbackGasLimit;\n FunctionsRequest.Request config;\n }\n\n /**\n * @dev Can't register a request with an empty name\n */\n error CCGRequestNameEmpty();\n\n /**\n * @dev Only the same source of the requestId is allowed to call the function\n */\n error CCGOnlySameSourceAllowed(bytes32 requestId);\n\n /**\n * @dev Only a registered subscriptionId is allowed to call the function\n */\n error CCGRequestNotRegistered(uint64 subscriptionId);\n\n /**\n * @dev Can't fulfill a request that has already been fulfilled\n */\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\n\n /**\n * @dev Only A manager can call the function\n */\n error CCGOnlyManagerAllowed();\n\n /**\n * @dev Send a request to the Functions DON\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external returns (bytes32 requestId);\n\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\n}\n" + }, + "contracts/interfaces/ICCGatewayClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\ninterface ICCGatewayClient {\n enum CCGResponseState {Sent, Success, Error}\n\n struct CCGResponse {\n uint64 subscriptionId;\n address source;\n CCGResponseState state;\n bytes data;\n bytes error;\n }\n\n function callback(bytes32 requestId) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/optimismSepolia/solcInputs/fc0de00091a2e0264aed2d3e71476d4f.json b/packages/hardhat/deployments/optimismSepolia/solcInputs/fc0de00091a2e0264aed2d3e71476d4f.json new file mode 100644 index 0000000..0b0fb2b --- /dev/null +++ b/packages/hardhat/deployments/optimismSepolia/solcInputs/fc0de00091a2e0264aed2d3e71476d4f.json @@ -0,0 +1,63 @@ +{ + "language": "Solidity", + "sources": { + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Chainlink Functions client interface.\ninterface IFunctionsClient {\n /// @notice Chainlink Functions response handler called by the Functions Router\n /// during fullilment from the designated transmitter node in an OCR round.\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\n /// @param response Aggregated response from the request's source code.\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\n /// @dev Either response or error parameter will be set, but never both.\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {FunctionsResponse} from \"../libraries/FunctionsResponse.sol\";\n\n/// @title Chainlink Functions Router interface.\ninterface IFunctionsRouter {\n /// @notice The identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n /// @return id - bytes32 id that can be passed to the \"getContractById\" of the Router\n function getAllowListId() external view returns (bytes32);\n\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n function setAllowListId(bytes32 allowListId) external;\n\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\n /// @return adminFee\n function getAdminFee() external view returns (uint72 adminFee);\n\n /// @notice Sends a request using the provided subscriptionId\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequest(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Sends a request to the proposed contracts\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequestToProposed(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Fulfill the request by:\n /// - calling back the data that the Oracle returned to the client contract\n /// - pay the DON for processing the request\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\n /// @param response response data from DON consensus\n /// @param err error from DON consensus\n /// @param juelsPerGas - current rate of juels/gas\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\n /// @param transmitter - The Node that transmitted the OCR report\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\n /// @return fulfillResult -\n /// @return callbackGasCostJuels -\n function fulfill(\n bytes memory response,\n bytes memory err,\n uint96 juelsPerGas,\n uint96 costWithoutFulfillment,\n address transmitter,\n FunctionsResponse.Commitment memory commitment\n ) external returns (FunctionsResponse.FulfillResult, uint96);\n\n /// @notice Validate requested gas limit is below the subscription max.\n /// @param subscriptionId subscription ID\n /// @param callbackGasLimit desired callback gas limit\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\n\n /// @notice Get the current contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current contract address\n function getContractById(bytes32 id) external view returns (address);\n\n /// @notice Get the proposed next contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current or proposed contract address\n function getProposedContractById(bytes32 id) external view returns (address);\n\n /// @notice Return the latest proprosal set\n /// @return ids The identifiers of the contracts to update\n /// @return to The addresses of the contracts that will be updated to\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\n\n /// @notice Proposes one or more updates to the contract routes\n /// @dev Only callable by owner\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\n\n /// @notice Updates the current contract routes to the proposed contracts\n /// @dev Only callable by owner\n function updateContracts() external;\n\n /// @dev Puts the system into an emergency stopped state.\n /// @dev Only callable by owner\n function pause() external;\n\n /// @dev Takes the system out of an emergency stopped state.\n /// @dev Only callable by owner\n function unpause() external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {CBOR} from \"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\";\n\n/// @title Library for encoding the input data of a Functions request into CBOR\nlibrary FunctionsRequest {\n using CBOR for CBOR.CBORBuffer;\n\n uint16 public constant REQUEST_DATA_VERSION = 1;\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\n\n enum Location {\n Inline, // Provided within the Request\n Remote, // Hosted through remote location that can be accessed through a provided URL\n DONHosted // Hosted on the DON's storage\n }\n\n enum CodeLanguage {\n JavaScript\n // In future version we may add other languages\n }\n\n struct Request {\n Location codeLocation; // ════════════╸ The location of the source code that will be executed on each node in the DON\n Location secretsLocation; // ═════════╸ The location of secrets that will be passed into the source code. *Only Remote secrets are supported\n CodeLanguage language; // ════════════╸ The coding language that the source code is written in\n string source; // ════════════════════╸ Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\n bytes encryptedSecretsReference; // ══╸ Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\n string[] args; // ════════════════════╸ String arguments that will be passed into the source code\n bytes[] bytesArgs; // ════════════════╸ Bytes arguments that will be passed into the source code\n }\n\n error EmptySource();\n error EmptySecrets();\n error EmptyArgs();\n error NoInlineSecrets();\n\n /// @notice Encodes a Request to CBOR encoded bytes\n /// @param self The request to encode\n /// @return CBOR encoded bytes\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"codeLocation\");\n buffer.writeUInt256(uint256(self.codeLocation));\n\n buffer.writeString(\"language\");\n buffer.writeUInt256(uint256(self.language));\n\n buffer.writeString(\"source\");\n buffer.writeString(self.source);\n\n if (self.args.length > 0) {\n buffer.writeString(\"args\");\n buffer.startArray();\n for (uint256 i = 0; i < self.args.length; ++i) {\n buffer.writeString(self.args[i]);\n }\n buffer.endSequence();\n }\n\n if (self.encryptedSecretsReference.length > 0) {\n if (self.secretsLocation == Location.Inline) {\n revert NoInlineSecrets();\n }\n buffer.writeString(\"secretsLocation\");\n buffer.writeUInt256(uint256(self.secretsLocation));\n buffer.writeString(\"secrets\");\n buffer.writeBytes(self.encryptedSecretsReference);\n }\n\n if (self.bytesArgs.length > 0) {\n buffer.writeString(\"bytesArgs\");\n buffer.startArray();\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\n buffer.writeBytes(self.bytesArgs[i]);\n }\n buffer.endSequence();\n }\n\n return buffer.buf.buf;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Sets the codeLocation and code on the request\n /// @param self The uninitialized request\n /// @param codeLocation The user provided source code location\n /// @param language The programming language of the user code\n /// @param source The user provided source code or a url\n function initializeRequest(\n Request memory self,\n Location codeLocation,\n CodeLanguage language,\n string memory source\n ) internal pure {\n if (bytes(source).length == 0) revert EmptySource();\n\n self.codeLocation = codeLocation;\n self.language = language;\n self.source = source;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Simplified version of initializeRequest for PoC\n /// @param self The uninitialized request\n /// @param javaScriptSource The user provided JS code (must not be empty)\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\n }\n\n /// @notice Adds Remote user encrypted secrets to a Request\n /// @param self The initialized request\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\n\n self.secretsLocation = Location.Remote;\n self.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n /// @notice Adds DON-hosted secrets reference to a Request\n /// @param self The initialized request\n /// @param slotID Slot ID of the user's secrets hosted on DON\n /// @param version User data version (for the slotID)\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"slotID\");\n buffer.writeUInt64(slotID);\n buffer.writeString(\"version\");\n buffer.writeUInt64(version);\n\n self.secretsLocation = Location.DONHosted;\n self.encryptedSecretsReference = buffer.buf.buf;\n }\n\n /// @notice Sets args for the user run function\n /// @param self The initialized request\n /// @param args The array of string args (must not be empty)\n function setArgs(Request memory self, string[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.args = args;\n }\n\n /// @notice Sets bytes args for the user run function\n /// @param self The initialized request\n /// @param args The array of bytes args (must not be empty)\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.bytesArgs = args;\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Library of types that are used for fulfillment of a Functions request\nlibrary FunctionsResponse {\n // Used to send request information from the Router to the Coordinator\n struct RequestMeta {\n bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\n bytes32 flags; // ═══════════════╸ Per-subscription flags\n address requestingContract; // ══╗ The client contract that is sending the request\n uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\n uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint64 initiatedRequests; // β•‘ The number of requests that have been started\n uint32 callbackGasLimit; // β•‘ The amount of gas that the callback to the consuming contract will be given\n uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data\n uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out\n address subscriptionOwner; // ═══╝ The owner of the billing subscription\n }\n\n enum FulfillResult {\n FULFILLED, // 0\n USER_CALLBACK_ERROR, // 1\n INVALID_REQUEST_ID, // 2\n COST_EXCEEDS_COMMITMENT, // 3\n INSUFFICIENT_GAS_PROVIDED, // 4\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\n INVALID_COMMITMENT // 6\n }\n\n struct Commitment {\n bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request\n address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request\n uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\n address client; // ════════════════════╗ The client contract that sent the request\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given\n uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint72 donFee; // β•‘ Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\n uint40 gasOverheadBeforeCallback; // β•‘ Represents the average gas execution cost before the fulfillment callback.\n uint40 gasOverheadAfterCallback; // β•‘ Represents the average gas execution cost after the fulfillment callback.\n uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"../v1_0_0/interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"../v1_0_0/interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"../v1_0_0/libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_functionsRouter;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_functionsRouter = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_functionsRouter.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_functionsRouter)) {\n revert OnlyRouterCanFulfill();\n }\n _fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}" + }, + "@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../@ensdomains/buffer/v0.1.0/Buffer.sol\";\n\n/**\n* @dev A library for populating CBOR encoded payload in Solidity.\n*\n* https://datatracker.ietf.org/doc/html/rfc7049\n*\n* The library offers various write* and start* methods to encode values of different types.\n* The resulted buffer can be obtained with data() method.\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\n* in an invalid CBOR if start/write/end flow is violated.\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\n* except for nested start/end pairs.\n*/\n\nlibrary CBOR {\n using Buffer for Buffer.buffer;\n\n struct CBORBuffer {\n Buffer.buffer buf;\n uint256 depth;\n }\n\n uint8 private constant MAJOR_TYPE_INT = 0;\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\n uint8 private constant MAJOR_TYPE_BYTES = 2;\n uint8 private constant MAJOR_TYPE_STRING = 3;\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\n uint8 private constant MAJOR_TYPE_MAP = 5;\n uint8 private constant MAJOR_TYPE_TAG = 6;\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\n\n uint8 private constant TAG_TYPE_BIGNUM = 2;\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\n\n uint8 private constant CBOR_FALSE = 20;\n uint8 private constant CBOR_TRUE = 21;\n uint8 private constant CBOR_NULL = 22;\n uint8 private constant CBOR_UNDEFINED = 23;\n\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\n Buffer.init(cbor.buf, capacity);\n cbor.depth = 0;\n return cbor;\n }\n\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\n require(buf.depth == 0, \"Invalid CBOR\");\n return buf.buf.buf;\n }\n\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\n writeBytes(buf, abi.encode(value));\n }\n\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\n if (value < 0) {\n buf.buf.appendUint8(\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\n );\n writeBytes(buf, abi.encode(uint256(-1 - value)));\n } else {\n writeUInt256(buf, uint256(value));\n }\n }\n\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\n }\n\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\n if(value >= 0) {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\n } else{\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\n }\n }\n\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\n buf.buf.append(value);\n }\n\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\n buf.buf.append(bytes(value));\n }\n\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\n }\n\n function writeNull(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_NULL);\n }\n\n function writeUndefined(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_UNDEFINED);\n }\n\n function startArray(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\n buf.depth += 1;\n }\n\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\n }\n\n function startMap(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\n buf.depth += 1;\n }\n\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\n }\n\n function endSequence(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\n buf.depth -= 1;\n }\n\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\n writeString(buf, key);\n writeString(buf, value);\n }\n\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\n writeString(buf, key);\n writeBytes(buf, value);\n }\n\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\n writeString(buf, key);\n writeUInt256(buf, value);\n }\n\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\n writeString(buf, key);\n writeInt256(buf, value);\n }\n\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\n writeString(buf, key);\n writeUInt64(buf, value);\n }\n\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\n writeString(buf, key);\n writeInt64(buf, value);\n }\n\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\n writeString(buf, key);\n writeBool(buf, value);\n }\n\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeNull(buf);\n }\n\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeUndefined(buf);\n }\n\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startMap(buf);\n }\n\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startArray(buf);\n }\n\n function writeFixedNumeric(\n CBORBuffer memory buf,\n uint8 major,\n uint64 value\n ) private pure {\n if (value <= 23) {\n buf.buf.appendUint8(uint8((major << 5) | value));\n } else if (value <= 0xFF) {\n buf.buf.appendUint8(uint8((major << 5) | 24));\n buf.buf.appendInt(value, 1);\n } else if (value <= 0xFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 25));\n buf.buf.appendInt(value, 2);\n } else if (value <= 0xFFFFFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 26));\n buf.buf.appendInt(value, 4);\n } else {\n buf.buf.appendUint8(uint8((major << 5) | 27));\n buf.buf.appendInt(value, 8);\n }\n }\n\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\n private\n pure\n {\n buf.buf.appendUint8(uint8((major << 5) | 31));\n }\n\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\n private\n pure\n {\n writeFixedNumeric(buf, major, length);\n }\n\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\n }\n}" + }, + "contracts/CCExampleClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from \"./interfaces/ICCGatewayClient.sol\";\nimport {ICCGateway} from \"./interfaces/ICCGateway.sol\";\n\ncontract CCExampleClient is ICCGatewayClient {\n ICCGateway private immutable gateway;\n\n uint64 public subscriptionId = 0;\n bytes public encryptedSecretsReference = \"\";\n\n event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response);\n event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error);\n\n constructor(address gatewayAddress) {\n gateway = ICCGateway(gatewayAddress);\n }\n\n function updateSubscriptionId(uint64 _subscriptionId) external {\n subscriptionId = _subscriptionId;\n }\n\n function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external {\n encryptedSecretsReference = _encryptedSecretsReference;\n }\n\n function request(string[] calldata args, bytes[] calldata bytesArgs) external {\n require(subscriptionId != 0, \"Subscription ID not set\");\n\n gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference);\n }\n\n function callback(bytes32 requestId) external override {\n ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true);\n\n if (response.state == ICCGatewayClient.CCGResponseState.Success) {\n emit ResponseReceived(response.subscriptionId, requestId, string(response.data));\n } else {\n emit ErrorReceived(response.subscriptionId, requestId, string(response.error));\n }\n }\n}\n" + }, + "contracts/interfaces/ICCGateway.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\";\n\ninterface ICCGateway {\n struct CCGRequest {\n string name;\n uint32 callbackGasLimit;\n FunctionsRequest.Request config;\n }\n\n /**\n * @dev Can't register a request with an empty name\n */\n error CCGRequestNameEmpty();\n\n /**\n * @dev Only the same source of the requestId is allowed to call the function\n */\n error CCGOnlySameSourceAllowed(bytes32 requestId);\n\n /**\n * @dev Only a registered subscriptionId is allowed to call the function\n */\n error CCGRequestNotRegistered(uint64 subscriptionId);\n\n /**\n * @dev Can't fulfill a request that has already been fulfilled\n */\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\n\n /**\n * @dev Only A manager can call the function\n */\n error CCGOnlyManagerAllowed();\n\n /**\n * @dev Send a request to the Functions DON\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external returns (bytes32 requestId);\n\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\n}\n" + }, + "contracts/interfaces/ICCGatewayClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\ninterface ICCGatewayClient {\n enum CCGResponseState {Sent, Success, Error}\n\n struct CCGResponse {\n uint64 subscriptionId;\n address source;\n CCGResponseState state;\n bytes data;\n bytes error;\n }\n\n function callback(bytes32 requestId) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/polygonAmoy/.chainId b/packages/hardhat/deployments/polygonAmoy/.chainId new file mode 100644 index 0000000..b8ca309 --- /dev/null +++ b/packages/hardhat/deployments/polygonAmoy/.chainId @@ -0,0 +1 @@ +80002 \ No newline at end of file diff --git a/packages/hardhat/deployments/polygonAmoy/CCExampleClient.json b/packages/hardhat/deployments/polygonAmoy/CCExampleClient.json new file mode 100644 index 0000000..cb9fd2d --- /dev/null +++ b/packages/hardhat/deployments/polygonAmoy/CCExampleClient.json @@ -0,0 +1,231 @@ +{ + "address": "0x1fF76d624Bd7E17220c1F367ce54019bE121A8c7", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "gatewayAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "error", + "type": "string" + } + ], + "name": "ErrorReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "response", + "type": "string" + } + ], + "name": "ResponseReceived", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + } + ], + "name": "callback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "encryptedSecretsReference", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "args", + "type": "string[]" + }, + { + "internalType": "bytes[]", + "name": "bytesArgs", + "type": "bytes[]" + } + ], + "name": "request", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "subscriptionId", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_encryptedSecretsReference", + "type": "bytes" + } + ], + "name": "updateEncryptedSecretsReference", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "_subscriptionId", + "type": "uint64" + } + ], + "name": "updateSubscriptionId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xf676ad4bdce83f9444e2ec816a02077db1a9dd5f95e0c3d2796521baa42e839c", + "receipt": { + "to": null, + "from": "0xD10F43A0aa00D244DAcFBE3C49b9B918B717Ff2c", + "contractAddress": "0x1fF76d624Bd7E17220c1F367ce54019bE121A8c7", + "transactionIndex": 2, + "gasUsed": "686011", + "logsBloom": "0x00000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000008000000000000000000040000000000000000000000000000000000000800000000000000000000100000000000000000000000000100000000008000000000000000000000080800000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000004000000000000000000001000000000000000000000080000000100000000000000000000000000000000000000000000000000000000000000000000000100000", + "blockHash": "0xf8c1773b37fb8198a907f3fd959a83cbd78bf9205a63908e42817da792f7e0e5", + "transactionHash": "0xf676ad4bdce83f9444e2ec816a02077db1a9dd5f95e0c3d2796521baa42e839c", + "logs": [ + { + "transactionIndex": 2, + "blockNumber": 7768177, + "transactionHash": "0xf676ad4bdce83f9444e2ec816a02077db1a9dd5f95e0c3d2796521baa42e839c", + "address": "0x0000000000000000000000000000000000001010", + "topics": [ + "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", + "0x0000000000000000000000000000000000000000000000000000000000001010", + "0x000000000000000000000000d10f43a0aa00d244dacfbe3c49b9b918b717ff2c", + "0x0000000000000000000000004631753190f2f5a15a7ba172bbac102b7d95fa22" + ], + "data": "0x000000000000000000000000000000000000000000000000002bde9ee2caf80b000000000000000000000000000000000000000000000000089bc79b2c59235400000000000000000000000000000000000000000000007f49dde78057d92b88000000000000000000000000000000000000000000000000086fe8fc498e2b4900000000000000000000000000000000000000000000007f4a09c61f3aa42393", + "logIndex": 2, + "blockHash": "0xf8c1773b37fb8198a907f3fd959a83cbd78bf9205a63908e42817da792f7e0e5" + } + ], + "blockNumber": 7768177, + "cumulativeGasUsed": "763707", + "status": 1, + "byzantium": true + }, + "args": [ + "0x26f0EB234DE737fE9dEf0fF1F3206848e55799D8" + ], + "numDeployments": 3, + "solcInputHash": "fc0de00091a2e0264aed2d3e71476d4f", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"gatewayAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"error\",\"type\":\"string\"}],\"name\":\"ErrorReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"response\",\"type\":\"string\"}],\"name\":\"ResponseReceived\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"callback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"encryptedSecretsReference\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"args\",\"type\":\"string[]\"},{\"internalType\":\"bytes[]\",\"name\":\"bytesArgs\",\"type\":\"bytes[]\"}],\"name\":\"request\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"subscriptionId\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_encryptedSecretsReference\",\"type\":\"bytes\"}],\"name\":\"updateEncryptedSecretsReference\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_subscriptionId\",\"type\":\"uint64\"}],\"name\":\"updateSubscriptionId\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/CCExampleClient.sol\":\"CCExampleClient\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\n/// @title Chainlink Functions client interface.\\ninterface IFunctionsClient {\\n /// @notice Chainlink Functions response handler called by the Functions Router\\n /// during fullilment from the designated transmitter node in an OCR round.\\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\\n /// @param response Aggregated response from the request's source code.\\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\\n /// @dev Either response or error parameter will be set, but never both.\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\\n}\\n\",\"keccak256\":\"0x6117b82e7c4eec44ce557b0fc8bc1ac5f49e5d160ac6d4485452d6aafdd762ff\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {FunctionsResponse} from \\\"../libraries/FunctionsResponse.sol\\\";\\n\\n/// @title Chainlink Functions Router interface.\\ninterface IFunctionsRouter {\\n /// @notice The identifier of the route to retrieve the address of the access control contract\\n /// The access control contract controls which accounts can manage subscriptions\\n /// @return id - bytes32 id that can be passed to the \\\"getContractById\\\" of the Router\\n function getAllowListId() external view returns (bytes32);\\n\\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\\n /// The access control contract controls which accounts can manage subscriptions\\n function setAllowListId(bytes32 allowListId) external;\\n\\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\\n /// @return adminFee\\n function getAdminFee() external view returns (uint72 adminFee);\\n\\n /// @notice Sends a request using the provided subscriptionId\\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\\n /// a client can make requests from different contracts referencing the same subscription\\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\\n /// @param dataVersion - Gas limit for the fulfillment callback\\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\\n /// @param donId - An identifier used to determine which route to send the request along\\n /// @return requestId - A unique request identifier\\n function sendRequest(\\n uint64 subscriptionId,\\n bytes calldata data,\\n uint16 dataVersion,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) external returns (bytes32);\\n\\n /// @notice Sends a request to the proposed contracts\\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\\n /// a client can make requests from different contracts referencing the same subscription\\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\\n /// @param dataVersion - Gas limit for the fulfillment callback\\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\\n /// @param donId - An identifier used to determine which route to send the request along\\n /// @return requestId - A unique request identifier\\n function sendRequestToProposed(\\n uint64 subscriptionId,\\n bytes calldata data,\\n uint16 dataVersion,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) external returns (bytes32);\\n\\n /// @notice Fulfill the request by:\\n /// - calling back the data that the Oracle returned to the client contract\\n /// - pay the DON for processing the request\\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\\n /// @param response response data from DON consensus\\n /// @param err error from DON consensus\\n /// @param juelsPerGas - current rate of juels/gas\\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\\n /// @param transmitter - The Node that transmitted the OCR report\\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\\n /// @return fulfillResult -\\n /// @return callbackGasCostJuels -\\n function fulfill(\\n bytes memory response,\\n bytes memory err,\\n uint96 juelsPerGas,\\n uint96 costWithoutFulfillment,\\n address transmitter,\\n FunctionsResponse.Commitment memory commitment\\n ) external returns (FunctionsResponse.FulfillResult, uint96);\\n\\n /// @notice Validate requested gas limit is below the subscription max.\\n /// @param subscriptionId subscription ID\\n /// @param callbackGasLimit desired callback gas limit\\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\\n\\n /// @notice Get the current contract given an ID\\n /// @param id A bytes32 identifier for the route\\n /// @return contract The current contract address\\n function getContractById(bytes32 id) external view returns (address);\\n\\n /// @notice Get the proposed next contract given an ID\\n /// @param id A bytes32 identifier for the route\\n /// @return contract The current or proposed contract address\\n function getProposedContractById(bytes32 id) external view returns (address);\\n\\n /// @notice Return the latest proprosal set\\n /// @return ids The identifiers of the contracts to update\\n /// @return to The addresses of the contracts that will be updated to\\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\\n\\n /// @notice Proposes one or more updates to the contract routes\\n /// @dev Only callable by owner\\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\\n\\n /// @notice Updates the current contract routes to the proposed contracts\\n /// @dev Only callable by owner\\n function updateContracts() external;\\n\\n /// @dev Puts the system into an emergency stopped state.\\n /// @dev Only callable by owner\\n function pause() external;\\n\\n /// @dev Takes the system out of an emergency stopped state.\\n /// @dev Only callable by owner\\n function unpause() external;\\n}\\n\",\"keccak256\":\"0x44db41e8ff90c2828ca0ada125abc4b411921a86514a4a047fd9fd43ba9d7e08\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {CBOR} from \\\"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\\\";\\n\\n/// @title Library for encoding the input data of a Functions request into CBOR\\nlibrary FunctionsRequest {\\n using CBOR for CBOR.CBORBuffer;\\n\\n uint16 public constant REQUEST_DATA_VERSION = 1;\\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\\n\\n enum Location {\\n Inline, // Provided within the Request\\n Remote, // Hosted through remote location that can be accessed through a provided URL\\n DONHosted // Hosted on the DON's storage\\n }\\n\\n enum CodeLanguage {\\n JavaScript\\n // In future version we may add other languages\\n }\\n\\n struct Request {\\n Location codeLocation; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The location of the source code that will be executed on each node in the DON\\n Location secretsLocation; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The location of secrets that will be passed into the source code. *Only Remote secrets are supported\\n CodeLanguage language; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The coding language that the source code is written in\\n string source; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\\n bytes encryptedSecretsReference; // \\u2550\\u2550\\u2578 Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\\n string[] args; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 String arguments that will be passed into the source code\\n bytes[] bytesArgs; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Bytes arguments that will be passed into the source code\\n }\\n\\n error EmptySource();\\n error EmptySecrets();\\n error EmptyArgs();\\n error NoInlineSecrets();\\n\\n /// @notice Encodes a Request to CBOR encoded bytes\\n /// @param self The request to encode\\n /// @return CBOR encoded bytes\\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\\n\\n buffer.writeString(\\\"codeLocation\\\");\\n buffer.writeUInt256(uint256(self.codeLocation));\\n\\n buffer.writeString(\\\"language\\\");\\n buffer.writeUInt256(uint256(self.language));\\n\\n buffer.writeString(\\\"source\\\");\\n buffer.writeString(self.source);\\n\\n if (self.args.length > 0) {\\n buffer.writeString(\\\"args\\\");\\n buffer.startArray();\\n for (uint256 i = 0; i < self.args.length; ++i) {\\n buffer.writeString(self.args[i]);\\n }\\n buffer.endSequence();\\n }\\n\\n if (self.encryptedSecretsReference.length > 0) {\\n if (self.secretsLocation == Location.Inline) {\\n revert NoInlineSecrets();\\n }\\n buffer.writeString(\\\"secretsLocation\\\");\\n buffer.writeUInt256(uint256(self.secretsLocation));\\n buffer.writeString(\\\"secrets\\\");\\n buffer.writeBytes(self.encryptedSecretsReference);\\n }\\n\\n if (self.bytesArgs.length > 0) {\\n buffer.writeString(\\\"bytesArgs\\\");\\n buffer.startArray();\\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\\n buffer.writeBytes(self.bytesArgs[i]);\\n }\\n buffer.endSequence();\\n }\\n\\n return buffer.buf.buf;\\n }\\n\\n /// @notice Initializes a Chainlink Functions Request\\n /// @dev Sets the codeLocation and code on the request\\n /// @param self The uninitialized request\\n /// @param codeLocation The user provided source code location\\n /// @param language The programming language of the user code\\n /// @param source The user provided source code or a url\\n function initializeRequest(\\n Request memory self,\\n Location codeLocation,\\n CodeLanguage language,\\n string memory source\\n ) internal pure {\\n if (bytes(source).length == 0) revert EmptySource();\\n\\n self.codeLocation = codeLocation;\\n self.language = language;\\n self.source = source;\\n }\\n\\n /// @notice Initializes a Chainlink Functions Request\\n /// @dev Simplified version of initializeRequest for PoC\\n /// @param self The uninitialized request\\n /// @param javaScriptSource The user provided JS code (must not be empty)\\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\\n }\\n\\n /// @notice Adds Remote user encrypted secrets to a Request\\n /// @param self The initialized request\\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\\n\\n self.secretsLocation = Location.Remote;\\n self.encryptedSecretsReference = encryptedSecretsReference;\\n }\\n\\n /// @notice Adds DON-hosted secrets reference to a Request\\n /// @param self The initialized request\\n /// @param slotID Slot ID of the user's secrets hosted on DON\\n /// @param version User data version (for the slotID)\\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\\n\\n buffer.writeString(\\\"slotID\\\");\\n buffer.writeUInt64(slotID);\\n buffer.writeString(\\\"version\\\");\\n buffer.writeUInt64(version);\\n\\n self.secretsLocation = Location.DONHosted;\\n self.encryptedSecretsReference = buffer.buf.buf;\\n }\\n\\n /// @notice Sets args for the user run function\\n /// @param self The initialized request\\n /// @param args The array of string args (must not be empty)\\n function setArgs(Request memory self, string[] memory args) internal pure {\\n if (args.length == 0) revert EmptyArgs();\\n\\n self.args = args;\\n }\\n\\n /// @notice Sets bytes args for the user run function\\n /// @param self The initialized request\\n /// @param args The array of bytes args (must not be empty)\\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\\n if (args.length == 0) revert EmptyArgs();\\n\\n self.bytesArgs = args;\\n }\\n}\\n\",\"keccak256\":\"0xed75be0eaba358d468f1fe18adc377d5044f57eff0070081f884a1f212d0adc2\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\n/// @title Library of types that are used for fulfillment of a Functions request\\nlibrary FunctionsResponse {\\n // Used to send request information from the Router to the Coordinator\\n struct RequestMeta {\\n bytes data; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\\n bytes32 flags; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Per-subscription flags\\n address requestingContract; // \\u2550\\u2550\\u2557 The client contract that is sending the request\\n uint96 availableBalance; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u255d Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\\n uint72 adminFee; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\\n uint64 subscriptionId; // \\u2551 Identifier of the billing subscription that will be charged for the request\\n uint64 initiatedRequests; // \\u2551 The number of requests that have been started\\n uint32 callbackGasLimit; // \\u2551 The amount of gas that the callback to the consuming contract will be given\\n uint16 dataVersion; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The version of the structure of the CBOR encoded request data\\n uint64 completedRequests; // \\u2550\\u2550\\u2550\\u2550\\u2557 The number of requests that have successfully completed or timed out\\n address subscriptionOwner; // \\u2550\\u2550\\u2550\\u255d The owner of the billing subscription\\n }\\n\\n enum FulfillResult {\\n FULFILLED, // 0\\n USER_CALLBACK_ERROR, // 1\\n INVALID_REQUEST_ID, // 2\\n COST_EXCEEDS_COMMITMENT, // 3\\n INSUFFICIENT_GAS_PROVIDED, // 4\\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\\n INVALID_COMMITMENT // 6\\n }\\n\\n struct Commitment {\\n bytes32 requestId; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 A unique identifier for a Chainlink Functions request\\n address coordinator; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 The Coordinator contract that manages the DON that is servicing a request\\n uint96 estimatedTotalCostJuels; // \\u2550\\u2550\\u2550\\u2550\\u255d The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\\n address client; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 The client contract that sent the request\\n uint64 subscriptionId; // \\u2551 Identifier of the billing subscription that will be charged for the request\\n uint32 callbackGasLimit; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The amount of gas that the callback to the consuming contract will be given\\n uint72 adminFee; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\\n uint72 donFee; // \\u2551 Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\\n uint40 gasOverheadBeforeCallback; // \\u2551 Represents the average gas execution cost before the fulfillment callback.\\n uint40 gasOverheadAfterCallback; // \\u2551 Represents the average gas execution cost after the fulfillment callback.\\n uint32 timeoutTimestamp; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The timestamp at which a request will be eligible to be timed out\\n }\\n}\\n\",\"keccak256\":\"0xc72eb037effef32146f7cd4086af00f44f28c8649d891e5e404fec5fda7e802b\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {IFunctionsRouter} from \\\"../v1_0_0/interfaces/IFunctionsRouter.sol\\\";\\nimport {IFunctionsClient} from \\\"../v1_0_0/interfaces/IFunctionsClient.sol\\\";\\n\\nimport {FunctionsRequest} from \\\"../v1_0_0/libraries/FunctionsRequest.sol\\\";\\n\\n/// @title The Chainlink Functions client contract\\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\\nabstract contract FunctionsClient is IFunctionsClient {\\n using FunctionsRequest for FunctionsRequest.Request;\\n\\n IFunctionsRouter internal immutable i_functionsRouter;\\n\\n event RequestSent(bytes32 indexed id);\\n event RequestFulfilled(bytes32 indexed id);\\n\\n error OnlyRouterCanFulfill();\\n\\n constructor(address router) {\\n i_functionsRouter = IFunctionsRouter(router);\\n }\\n\\n /// @notice Sends a Chainlink Functions request\\n /// @param data The CBOR encoded bytes data for a Functions request\\n /// @param subscriptionId The subscription ID that will be charged to service the request\\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\\n /// @return requestId The generated request ID for this request\\n function _sendRequest(\\n bytes memory data,\\n uint64 subscriptionId,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) internal returns (bytes32) {\\n bytes32 requestId = i_functionsRouter.sendRequest(\\n subscriptionId,\\n data,\\n FunctionsRequest.REQUEST_DATA_VERSION,\\n callbackGasLimit,\\n donId\\n );\\n emit RequestSent(requestId);\\n return requestId;\\n }\\n\\n /// @notice User defined function to handle a response from the DON\\n /// @param requestId The request ID, returned by sendRequest()\\n /// @param response Aggregated response from the execution of the user's source code\\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\\n /// @dev Either response or error parameter will be set, but never both\\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\\n\\n /// @inheritdoc IFunctionsClient\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\\n if (msg.sender != address(i_functionsRouter)) {\\n revert OnlyRouterCanFulfill();\\n }\\n _fulfillRequest(requestId, response, err);\\n emit RequestFulfilled(requestId);\\n }\\n}\\n\",\"keccak256\":\"0xdc40f1e9dea8a572d43d310afa68e978c35218d16097b9cfd9d1b6137df3cd0a\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-2-Clause\\npragma solidity ^0.8.4;\\n\\n/**\\n* @dev A library for working with mutable byte buffers in Solidity.\\n*\\n* Byte buffers are mutable and expandable, and provide a variety of primitives\\n* for appending to them. At any time you can fetch a bytes object containing the\\n* current contents of the buffer. The bytes object should not be stored between\\n* operations, as it may change due to resizing of the buffer.\\n*/\\nlibrary Buffer {\\n /**\\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\\n * a capacity. The capacity may be longer than the current value, in\\n * which case it can be extended without the need to allocate more memory.\\n */\\n struct buffer {\\n bytes buf;\\n uint capacity;\\n }\\n\\n /**\\n * @dev Initializes a buffer with an initial capacity.\\n * @param buf The buffer to initialize.\\n * @param capacity The number of bytes of space to allocate the buffer.\\n * @return The buffer, for chaining.\\n */\\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\\n if (capacity % 32 != 0) {\\n capacity += 32 - (capacity % 32);\\n }\\n // Allocate space for the buffer data\\n buf.capacity = capacity;\\n assembly {\\n let ptr := mload(0x40)\\n mstore(buf, ptr)\\n mstore(ptr, 0)\\n let fpm := add(32, add(ptr, capacity))\\n if lt(fpm, ptr) {\\n revert(0, 0)\\n }\\n mstore(0x40, fpm)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Initializes a new buffer from an existing bytes object.\\n * Changes to the buffer may mutate the original value.\\n * @param b The bytes object to initialize the buffer with.\\n * @return A new buffer.\\n */\\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\\n buffer memory buf;\\n buf.buf = b;\\n buf.capacity = b.length;\\n return buf;\\n }\\n\\n function resize(buffer memory buf, uint capacity) private pure {\\n bytes memory oldbuf = buf.buf;\\n init(buf, capacity);\\n append(buf, oldbuf);\\n }\\n\\n /**\\n * @dev Sets buffer length to 0.\\n * @param buf The buffer to truncate.\\n * @return The original buffer, for chaining..\\n */\\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\\n assembly {\\n let bufptr := mload(buf)\\n mstore(bufptr, 0)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to copy.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\\n require(len <= data.length);\\n\\n uint off = buf.buf.length;\\n uint newCapacity = off + len;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint dest;\\n uint src;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Length of existing buffer data\\n let buflen := mload(bufptr)\\n // Start address = buffer address + offset + sizeof(buffer length)\\n dest := add(add(bufptr, 32), off)\\n // Update buffer length if we're extending it\\n if gt(newCapacity, buflen) {\\n mstore(bufptr, newCapacity)\\n }\\n src := add(data, 32)\\n }\\n\\n // Copy word-length chunks while possible\\n for (; len >= 32; len -= 32) {\\n assembly {\\n mstore(dest, mload(src))\\n }\\n dest += 32;\\n src += 32;\\n }\\n\\n // Copy remaining bytes\\n unchecked {\\n uint mask = (256 ** (32 - len)) - 1;\\n assembly {\\n let srcpart := and(mload(src), not(mask))\\n let destpart := and(mload(dest), mask)\\n mstore(dest, or(destpart, srcpart))\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\\n return append(buf, data, data.length);\\n }\\n\\n /**\\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\\n * capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint offPlusOne = off + 1;\\n if (off >= buf.capacity) {\\n resize(buf, offPlusOne * 2);\\n }\\n\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + off\\n let dest := add(add(bufptr, off), 32)\\n mstore8(dest, data)\\n // Update buffer length if we extended it\\n if gt(offPlusOne, mload(bufptr)) {\\n mstore(bufptr, offPlusOne)\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (left-aligned).\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n unchecked {\\n uint mask = (256 ** len) - 1;\\n // Right-align data\\n data = data >> (8 * (32 - len));\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chhaining.\\n */\\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\\n return append(buf, bytes32(data), 20);\\n }\\n\\n /**\\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\\n return append(buf, data, 32);\\n }\\n\\n /**\\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (right-aligned).\\n * @return The original buffer.\\n */\\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint mask = (256 ** len) - 1;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n return buf;\\n }\\n}\",\"keccak256\":\"0x0d86b367813922094e02594a406ba89f5e97d3d74ec2ce3c4032566840e302b0\",\"license\":\"BSD-2-Clause\"},\"@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.4;\\n\\nimport \\\"../../@ensdomains/buffer/v0.1.0/Buffer.sol\\\";\\n\\n/**\\n* @dev A library for populating CBOR encoded payload in Solidity.\\n*\\n* https://datatracker.ietf.org/doc/html/rfc7049\\n*\\n* The library offers various write* and start* methods to encode values of different types.\\n* The resulted buffer can be obtained with data() method.\\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\\n* in an invalid CBOR if start/write/end flow is violated.\\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\\n* except for nested start/end pairs.\\n*/\\n\\nlibrary CBOR {\\n using Buffer for Buffer.buffer;\\n\\n struct CBORBuffer {\\n Buffer.buffer buf;\\n uint256 depth;\\n }\\n\\n uint8 private constant MAJOR_TYPE_INT = 0;\\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\\n uint8 private constant MAJOR_TYPE_BYTES = 2;\\n uint8 private constant MAJOR_TYPE_STRING = 3;\\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\\n uint8 private constant MAJOR_TYPE_MAP = 5;\\n uint8 private constant MAJOR_TYPE_TAG = 6;\\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\\n\\n uint8 private constant TAG_TYPE_BIGNUM = 2;\\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\\n\\n uint8 private constant CBOR_FALSE = 20;\\n uint8 private constant CBOR_TRUE = 21;\\n uint8 private constant CBOR_NULL = 22;\\n uint8 private constant CBOR_UNDEFINED = 23;\\n\\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\\n Buffer.init(cbor.buf, capacity);\\n cbor.depth = 0;\\n return cbor;\\n }\\n\\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\\n require(buf.depth == 0, \\\"Invalid CBOR\\\");\\n return buf.buf.buf;\\n }\\n\\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\\n writeBytes(buf, abi.encode(value));\\n }\\n\\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\\n if (value < 0) {\\n buf.buf.appendUint8(\\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\\n );\\n writeBytes(buf, abi.encode(uint256(-1 - value)));\\n } else {\\n writeUInt256(buf, uint256(value));\\n }\\n }\\n\\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\\n }\\n\\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\\n if(value >= 0) {\\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\\n } else{\\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\\n }\\n }\\n\\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\\n buf.buf.append(value);\\n }\\n\\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\\n buf.buf.append(bytes(value));\\n }\\n\\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\\n }\\n\\n function writeNull(CBORBuffer memory buf) internal pure {\\n writeContentFree(buf, CBOR_NULL);\\n }\\n\\n function writeUndefined(CBORBuffer memory buf) internal pure {\\n writeContentFree(buf, CBOR_UNDEFINED);\\n }\\n\\n function startArray(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\\n buf.depth += 1;\\n }\\n\\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\\n }\\n\\n function startMap(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\\n buf.depth += 1;\\n }\\n\\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\\n }\\n\\n function endSequence(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\\n buf.depth -= 1;\\n }\\n\\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\\n writeString(buf, key);\\n writeString(buf, value);\\n }\\n\\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\\n writeString(buf, key);\\n writeBytes(buf, value);\\n }\\n\\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\\n writeString(buf, key);\\n writeUInt256(buf, value);\\n }\\n\\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\\n writeString(buf, key);\\n writeInt256(buf, value);\\n }\\n\\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\\n writeString(buf, key);\\n writeUInt64(buf, value);\\n }\\n\\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\\n writeString(buf, key);\\n writeInt64(buf, value);\\n }\\n\\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\\n writeString(buf, key);\\n writeBool(buf, value);\\n }\\n\\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n writeNull(buf);\\n }\\n\\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n writeUndefined(buf);\\n }\\n\\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n startMap(buf);\\n }\\n\\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n startArray(buf);\\n }\\n\\n function writeFixedNumeric(\\n CBORBuffer memory buf,\\n uint8 major,\\n uint64 value\\n ) private pure {\\n if (value <= 23) {\\n buf.buf.appendUint8(uint8((major << 5) | value));\\n } else if (value <= 0xFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 24));\\n buf.buf.appendInt(value, 1);\\n } else if (value <= 0xFFFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 25));\\n buf.buf.appendInt(value, 2);\\n } else if (value <= 0xFFFFFFFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 26));\\n buf.buf.appendInt(value, 4);\\n } else {\\n buf.buf.appendUint8(uint8((major << 5) | 27));\\n buf.buf.appendInt(value, 8);\\n }\\n }\\n\\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\\n private\\n pure\\n {\\n buf.buf.appendUint8(uint8((major << 5) | 31));\\n }\\n\\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\\n private\\n pure\\n {\\n writeFixedNumeric(buf, major, length);\\n }\\n\\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\\n }\\n}\",\"keccak256\":\"0xdecf04203502670ac72ba466c75e4f87f4419907365005f0d73e7d07ee3e5715\",\"license\":\"MIT\"},\"contracts/CCExampleClient.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {ICCGatewayClient} from \\\"./interfaces/ICCGatewayClient.sol\\\";\\nimport {ICCGateway} from \\\"./interfaces/ICCGateway.sol\\\";\\n\\ncontract CCExampleClient is ICCGatewayClient {\\n ICCGateway private immutable gateway;\\n\\n uint64 public subscriptionId = 0;\\n bytes public encryptedSecretsReference = \\\"\\\";\\n\\n event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response);\\n event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error);\\n\\n constructor(address gatewayAddress) {\\n gateway = ICCGateway(gatewayAddress);\\n }\\n\\n function updateSubscriptionId(uint64 _subscriptionId) external {\\n subscriptionId = _subscriptionId;\\n }\\n\\n function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external {\\n encryptedSecretsReference = _encryptedSecretsReference;\\n }\\n\\n function request(string[] calldata args, bytes[] calldata bytesArgs) external {\\n require(subscriptionId != 0, \\\"Subscription ID not set\\\");\\n\\n gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference);\\n }\\n\\n function callback(bytes32 requestId) external override {\\n ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true);\\n\\n if (response.state == ICCGatewayClient.CCGResponseState.Success) {\\n emit ResponseReceived(response.subscriptionId, requestId, string(response.data));\\n } else {\\n emit ErrorReceived(response.subscriptionId, requestId, string(response.error));\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf905275976390214962167d4896d9c0eab670fce2b5f5cfd213b1ae2d776347a\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/ICCGateway.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\\nimport {FunctionsRequest} from \\\"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\\\";\\n\\ninterface ICCGateway {\\n struct CCGRequest {\\n string name;\\n uint32 callbackGasLimit;\\n FunctionsRequest.Request config;\\n }\\n\\n /**\\n * @dev Can't register a request with an empty name\\n */\\n error CCGRequestNameEmpty();\\n\\n /**\\n * @dev Only the same source of the requestId is allowed to call the function\\n */\\n error CCGOnlySameSourceAllowed(bytes32 requestId);\\n\\n /**\\n * @dev Only a registered subscriptionId is allowed to call the function\\n */\\n error CCGRequestNotRegistered(uint64 subscriptionId);\\n\\n /**\\n * @dev Can't fulfill a request that has already been fulfilled\\n */\\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\\n\\n /**\\n * @dev Only A manager can call the function\\n */\\n error CCGOnlyManagerAllowed();\\n\\n /**\\n * @dev Send a request to the Functions DON\\n */\\n function sendRequest(\\n uint64 subscriptionId,\\n string[] calldata args,\\n bytes[] calldata bytesArgs,\\n bytes calldata encryptedSecretsReference\\n ) external returns (bytes32 requestId);\\n\\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\\n}\\n\",\"keccak256\":\"0xbc7d92f8db240767c8636e8df9b818cc1f5abfde22b8c49eee50f418fb0dbea5\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/ICCGatewayClient.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\ninterface ICCGatewayClient {\\n enum CCGResponseState {Sent, Success, Error}\\n\\n struct CCGResponse {\\n uint64 subscriptionId;\\n address source;\\n CCGResponseState state;\\n bytes data;\\n bytes error;\\n }\\n\\n function callback(bytes32 requestId) external;\\n}\\n\",\"keccak256\":\"0xb69320aa2152f374dec4cfc70b73f46e0db9774a1411d2acff1481ee3295f86a\",\"license\":\"UNLICENSED\"}},\"version\":1}", + "bytecode": "0x600080546001600160401b031916815560c060405260a090815260019062000028908262000110565b503480156200003657600080fd5b5060405162000d6a38038062000d6a8339810160408190526200005991620001dc565b6001600160a01b03166080526200020e565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200009657607f821691505b602082108103620000b757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200010b57600081815260208120601f850160051c81016020861015620000e65750805b601f850160051c820191505b818110156200010757828155600101620000f2565b5050505b505050565b81516001600160401b038111156200012c576200012c6200006b565b62000144816200013d845462000081565b84620000bd565b602080601f8311600181146200017c5760008415620001635750858301515b600019600386901b1c1916600185901b17855562000107565b600085815260208120601f198616915b82811015620001ad578886015182559484019460019091019084016200018c565b5085821015620001cc5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215620001ef57600080fd5b81516001600160a01b03811681146200020757600080fd5b9392505050565b608051610b39620002316000396000818161023101526102e30152610b396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806309c1ba2e1461006757806314b1dd1b146100975780634ce64f0e146100ca578063cdc634f1146100dd578063cfd58386146100f2578063df13994e14610105575b600080fd5b60005461007a906001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b6100c86100a5366004610415565b6000805467ffffffffffffffff19166001600160401b0392909216919091179055565b005b6100c86100d8366004610439565b610118565b6100e561012a565b60405161008e91906104fa565b6100c8610100366004610558565b6101b8565b6100c86101133660046105c3565b6102c3565b600161012582848361067a565b505050565b60018054610137906105f2565b80601f0160208091040260200160405190810160405280929190818152602001828054610163906105f2565b80156101b05780601f10610185576101008083540402835291602001916101b0565b820191906000526020600020905b81548152906001019060200180831161019357829003601f168201915b505050505081565b600080546001600160401b031690036102175760405162461bcd60e51b815260206004820152601760248201527f537562736372697074696f6e204944206e6f7420736574000000000000000000604482015260640160405180910390fd5b600054604051634b60ac1760e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916396c1582e91610279916001600160401b0316908890889088908890600190600401610824565b6020604051808303816000875af1158015610298573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bc919061090d565b5050505050565b6040516315b851d160e01b815260048101829052600160248201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906315b851d1906044016000604051808303816000875af1158015610334573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261035c91908101906109e9565b905060018160400151600281111561037657610376610abc565b036103c2577fa5522492de1ed169e1e5e76f6cb2ceb5f045ca7f7ea5da3137c573d996cc4b9f81600001518383606001516040516103b693929190610ad2565b60405180910390a15050565b7f331e0adccd60eab7ca94cf49c60a45549ce9dc1281139656a13bdf73774d179c81600001518383608001516040516103b693929190610ad2565b6001600160401b038116811461041257600080fd5b50565b60006020828403121561042757600080fd5b8135610432816103fd565b9392505050565b6000806020838503121561044c57600080fd5b82356001600160401b038082111561046357600080fd5b818501915085601f83011261047757600080fd5b81358181111561048657600080fd5b86602082850101111561049857600080fd5b60209290920196919550909350505050565b60005b838110156104c55781810151838201526020016104ad565b50506000910152565b600081518084526104e68160208601602086016104aa565b601f01601f19169290920160200192915050565b60208152600061043260208301846104ce565b60008083601f84011261051f57600080fd5b5081356001600160401b0381111561053657600080fd5b6020830191508360208260051b850101111561055157600080fd5b9250929050565b6000806000806040858703121561056e57600080fd5b84356001600160401b038082111561058557600080fd5b6105918883890161050d565b909650945060208701359150808211156105aa57600080fd5b506105b78782880161050d565b95989497509550505050565b6000602082840312156105d557600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061060657607f821691505b60208210810361062657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561012557600081815260208120601f850160051c810160208610156106535750805b601f850160051c820191505b818110156106725782815560010161065f565b505050505050565b6001600160401b03831115610691576106916105dc565b6106a58361069f83546105f2565b8361062c565b6000601f8411600181146106d957600085156106c15750838201355b600019600387901b1c1916600186901b1783556102bc565b600083815260209020601f19861690835b8281101561070a57868501358255602094850194600190920191016106ea565b50868210156107275760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000808335601e1984360301811261077957600080fd5b83016020810192503590506001600160401b0381111561079857600080fd5b80360382131561055157600080fd5b600081546107b4816105f2565b8085526020600183811680156107d157600181146107eb57610819565b60ff1985168884015283151560051b880183019550610819565b866000528260002060005b858110156108115781548a82018601529083019084016107f6565b890184019650505b505050505092915050565b6000608082016001600160401b038916835260206080818501528188835260a08501905060a08960051b86010192508960005b8a81101561089157868503609f19018352610872828d610762565b61087d878284610739565b965050509183019190830190600101610857565b5050508382036040850152858252808201600587901b830182018860005b898110156108e957858303601f190184526108ca828c610762565b6108d5858284610739565b9587019594505050908401906001016108af565b505085810360608701526108fd81886107a7565b9c9b505050505050505050505050565b60006020828403121561091f57600080fd5b5051919050565b60405160a081016001600160401b0381118282101715610948576109486105dc565b60405290565b80516003811061095d57600080fd5b919050565b600082601f83011261097357600080fd5b81516001600160401b038082111561098d5761098d6105dc565b604051601f8301601f19908116603f011681019082821181831017156109b5576109b56105dc565b816040528381528660208588010111156109ce57600080fd5b6109df8460208301602089016104aa565b9695505050505050565b6000602082840312156109fb57600080fd5b81516001600160401b0380821115610a1257600080fd5b9083019060a08286031215610a2657600080fd5b610a2e610926565b8251610a39816103fd565b815260208301516001600160a01b0381168114610a5557600080fd5b6020820152610a666040840161094e565b6040820152606083015182811115610a7d57600080fd5b610a8987828601610962565b606083015250608083015182811115610aa157600080fd5b610aad87828601610962565b60808301525095945050505050565b634e487b7160e01b600052602160045260246000fd5b6001600160401b0384168152826020820152606060408201526000610afa60608301846104ce565b9594505050505056fea26469706673582212209c23a4aa128701447d0247b6e250fc1aeb5f0bdf6334f1ef0fdcdc125482ae6a64736f6c63430008140033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100625760003560e01c806309c1ba2e1461006757806314b1dd1b146100975780634ce64f0e146100ca578063cdc634f1146100dd578063cfd58386146100f2578063df13994e14610105575b600080fd5b60005461007a906001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b6100c86100a5366004610415565b6000805467ffffffffffffffff19166001600160401b0392909216919091179055565b005b6100c86100d8366004610439565b610118565b6100e561012a565b60405161008e91906104fa565b6100c8610100366004610558565b6101b8565b6100c86101133660046105c3565b6102c3565b600161012582848361067a565b505050565b60018054610137906105f2565b80601f0160208091040260200160405190810160405280929190818152602001828054610163906105f2565b80156101b05780601f10610185576101008083540402835291602001916101b0565b820191906000526020600020905b81548152906001019060200180831161019357829003601f168201915b505050505081565b600080546001600160401b031690036102175760405162461bcd60e51b815260206004820152601760248201527f537562736372697074696f6e204944206e6f7420736574000000000000000000604482015260640160405180910390fd5b600054604051634b60ac1760e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916396c1582e91610279916001600160401b0316908890889088908890600190600401610824565b6020604051808303816000875af1158015610298573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bc919061090d565b5050505050565b6040516315b851d160e01b815260048101829052600160248201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906315b851d1906044016000604051808303816000875af1158015610334573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261035c91908101906109e9565b905060018160400151600281111561037657610376610abc565b036103c2577fa5522492de1ed169e1e5e76f6cb2ceb5f045ca7f7ea5da3137c573d996cc4b9f81600001518383606001516040516103b693929190610ad2565b60405180910390a15050565b7f331e0adccd60eab7ca94cf49c60a45549ce9dc1281139656a13bdf73774d179c81600001518383608001516040516103b693929190610ad2565b6001600160401b038116811461041257600080fd5b50565b60006020828403121561042757600080fd5b8135610432816103fd565b9392505050565b6000806020838503121561044c57600080fd5b82356001600160401b038082111561046357600080fd5b818501915085601f83011261047757600080fd5b81358181111561048657600080fd5b86602082850101111561049857600080fd5b60209290920196919550909350505050565b60005b838110156104c55781810151838201526020016104ad565b50506000910152565b600081518084526104e68160208601602086016104aa565b601f01601f19169290920160200192915050565b60208152600061043260208301846104ce565b60008083601f84011261051f57600080fd5b5081356001600160401b0381111561053657600080fd5b6020830191508360208260051b850101111561055157600080fd5b9250929050565b6000806000806040858703121561056e57600080fd5b84356001600160401b038082111561058557600080fd5b6105918883890161050d565b909650945060208701359150808211156105aa57600080fd5b506105b78782880161050d565b95989497509550505050565b6000602082840312156105d557600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061060657607f821691505b60208210810361062657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561012557600081815260208120601f850160051c810160208610156106535750805b601f850160051c820191505b818110156106725782815560010161065f565b505050505050565b6001600160401b03831115610691576106916105dc565b6106a58361069f83546105f2565b8361062c565b6000601f8411600181146106d957600085156106c15750838201355b600019600387901b1c1916600186901b1783556102bc565b600083815260209020601f19861690835b8281101561070a57868501358255602094850194600190920191016106ea565b50868210156107275760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000808335601e1984360301811261077957600080fd5b83016020810192503590506001600160401b0381111561079857600080fd5b80360382131561055157600080fd5b600081546107b4816105f2565b8085526020600183811680156107d157600181146107eb57610819565b60ff1985168884015283151560051b880183019550610819565b866000528260002060005b858110156108115781548a82018601529083019084016107f6565b890184019650505b505050505092915050565b6000608082016001600160401b038916835260206080818501528188835260a08501905060a08960051b86010192508960005b8a81101561089157868503609f19018352610872828d610762565b61087d878284610739565b965050509183019190830190600101610857565b5050508382036040850152858252808201600587901b830182018860005b898110156108e957858303601f190184526108ca828c610762565b6108d5858284610739565b9587019594505050908401906001016108af565b505085810360608701526108fd81886107a7565b9c9b505050505050505050505050565b60006020828403121561091f57600080fd5b5051919050565b60405160a081016001600160401b0381118282101715610948576109486105dc565b60405290565b80516003811061095d57600080fd5b919050565b600082601f83011261097357600080fd5b81516001600160401b038082111561098d5761098d6105dc565b604051601f8301601f19908116603f011681019082821181831017156109b5576109b56105dc565b816040528381528660208588010111156109ce57600080fd5b6109df8460208301602089016104aa565b9695505050505050565b6000602082840312156109fb57600080fd5b81516001600160401b0380821115610a1257600080fd5b9083019060a08286031215610a2657600080fd5b610a2e610926565b8251610a39816103fd565b815260208301516001600160a01b0381168114610a5557600080fd5b6020820152610a666040840161094e565b6040820152606083015182811115610a7d57600080fd5b610a8987828601610962565b606083015250608083015182811115610aa157600080fd5b610aad87828601610962565b60808301525095945050505050565b634e487b7160e01b600052602160045260246000fd5b6001600160401b0384168152826020820152606060408201526000610afa60608301846104ce565b9594505050505056fea26469706673582212209c23a4aa128701447d0247b6e250fc1aeb5f0bdf6334f1ef0fdcdc125482ae6a64736f6c63430008140033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 2081, + "contract": "contracts/CCExampleClient.sol:CCExampleClient", + "label": "subscriptionId", + "offset": 0, + "slot": "0", + "type": "t_uint64" + }, + { + "astId": 2084, + "contract": "contracts/CCExampleClient.sol:CCExampleClient", + "label": "encryptedSecretsReference", + "offset": 0, + "slot": "1", + "type": "t_bytes_storage" + } + ], + "types": { + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_uint64": { + "encoding": "inplace", + "label": "uint64", + "numberOfBytes": "8" + } + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/polygonAmoy/CCGateway.json b/packages/hardhat/deployments/polygonAmoy/CCGateway.json new file mode 100644 index 0000000..dc5da69 --- /dev/null +++ b/packages/hardhat/deployments/polygonAmoy/CCGateway.json @@ -0,0 +1,1147 @@ +{ + "address": "0x26f0EB234DE737fE9dEf0fF1F3206848e55799D8", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "router", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "initialDonId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AccessControlBadConfirmation", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "neededRole", + "type": "bytes32" + } + ], + "name": "AccessControlUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [], + "name": "CCGOnlyManagerAllowed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + } + ], + "name": "CCGOnlySameSourceAllowed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + } + ], + "name": "CCGRequestAlreadyFulfilled", + "type": "error" + }, + { + "inputs": [], + "name": "CCGRequestNameEmpty", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + } + ], + "name": "CCGRequestNotRegistered", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyArgs", + "type": "error" + }, + { + "inputs": [], + "name": "EmptySource", + "type": "error" + }, + { + "inputs": [], + "name": "NoInlineSecrets", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyRouterCanFulfill", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "RequestFulfilled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "RequestSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "CLIENT_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MANAGER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "donId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + } + ], + "name": "getRequest", + "outputs": [ + { + "components": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "uint32", + "name": "callbackGasLimit", + "type": "uint32" + }, + { + "components": [ + { + "internalType": "enum FunctionsRequest.Location", + "name": "codeLocation", + "type": "uint8" + }, + { + "internalType": "enum FunctionsRequest.Location", + "name": "secretsLocation", + "type": "uint8" + }, + { + "internalType": "enum FunctionsRequest.CodeLanguage", + "name": "language", + "type": "uint8" + }, + { + "internalType": "string", + "name": "source", + "type": "string" + }, + { + "internalType": "bytes", + "name": "encryptedSecretsReference", + "type": "bytes" + }, + { + "internalType": "string[]", + "name": "args", + "type": "string[]" + }, + { + "internalType": "bytes[]", + "name": "bytesArgs", + "type": "bytes[]" + } + ], + "internalType": "struct FunctionsRequest.Request", + "name": "config", + "type": "tuple" + } + ], + "internalType": "struct ICCGateway.CCGRequest", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "remove", + "type": "bool" + } + ], + "name": "getResponse", + "outputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "internalType": "address", + "name": "source", + "type": "address" + }, + { + "internalType": "enum ICCGatewayClient.CCGResponseState", + "name": "state", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "error", + "type": "bytes" + } + ], + "internalType": "struct ICCGatewayClient.CCGResponse", + "name": "response", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "response", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "err", + "type": "bytes" + } + ], + "name": "handleOracleFulfillment", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "internalType": "enum FunctionsRequest.Location", + "name": "codeLocation", + "type": "uint8" + }, + { + "internalType": "string", + "name": "source", + "type": "string" + }, + { + "internalType": "enum FunctionsRequest.Location", + "name": "secretsLocation", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "encryptedSecretsReference", + "type": "bytes" + }, + { + "internalType": "uint32", + "name": "callbackGasLimit", + "type": "uint32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "registerRequest", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + } + ], + "name": "removeRequest", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "callerConfirmation", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "internalType": "string[]", + "name": "args", + "type": "string[]" + }, + { + "internalType": "bytes[]", + "name": "bytesArgs", + "type": "bytes[]" + }, + { + "internalType": "bytes", + "name": "encryptedSecretsReference", + "type": "bytes" + } + ], + "name": "sendRequest", + "outputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "newDonId", + "type": "bytes32" + } + ], + "name": "setDonId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "subscriptions", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x95bd98f7b9065d204c2f3acbbbb40e22479ebcaa74c3138c24fe3d0f9def487a", + "receipt": { + "to": null, + "from": "0xD10F43A0aa00D244DAcFBE3C49b9B918B717Ff2c", + "contractAddress": "0x26f0EB234DE737fE9dEf0fF1F3206848e55799D8", + "transactionIndex": 2, + "gasUsed": "2639963", + "logsBloom": "0x00080004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000020000000000000000000800000000000000000000100080000000000000000020000000004000008000800000000000000000080800000000000020000000000000000000000000040000000000000000000000000000000000000200000000000000000000000000000000000000000000000001000000000004000000000000000000001020000000000000000000080000100100080000020002000000000000000000000000000000000000000000000000000000000100000", + "blockHash": "0x4fdd6166123a67a08406ccb8f73c892c27e914347bda32e4c6b67b97a6a6a1b9", + "transactionHash": "0x95bd98f7b9065d204c2f3acbbbb40e22479ebcaa74c3138c24fe3d0f9def487a", + "logs": [ + { + "transactionIndex": 2, + "blockNumber": 7768175, + "transactionHash": "0x95bd98f7b9065d204c2f3acbbbb40e22479ebcaa74c3138c24fe3d0f9def487a", + "address": "0x26f0EB234DE737fE9dEf0fF1F3206848e55799D8", + "topics": [ + "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000d10f43a0aa00d244dacfbe3c49b9b918b717ff2c", + "0x000000000000000000000000d10f43a0aa00d244dacfbe3c49b9b918b717ff2c" + ], + "data": "0x", + "logIndex": 5, + "blockHash": "0x4fdd6166123a67a08406ccb8f73c892c27e914347bda32e4c6b67b97a6a6a1b9" + }, + { + "transactionIndex": 2, + "blockNumber": 7768175, + "transactionHash": "0x95bd98f7b9065d204c2f3acbbbb40e22479ebcaa74c3138c24fe3d0f9def487a", + "address": "0x26f0EB234DE737fE9dEf0fF1F3206848e55799D8", + "topics": [ + "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", + "0x241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08", + "0x000000000000000000000000d10f43a0aa00d244dacfbe3c49b9b918b717ff2c", + "0x000000000000000000000000d10f43a0aa00d244dacfbe3c49b9b918b717ff2c" + ], + "data": "0x", + "logIndex": 6, + "blockHash": "0x4fdd6166123a67a08406ccb8f73c892c27e914347bda32e4c6b67b97a6a6a1b9" + }, + { + "transactionIndex": 2, + "blockNumber": 7768175, + "transactionHash": "0x95bd98f7b9065d204c2f3acbbbb40e22479ebcaa74c3138c24fe3d0f9def487a", + "address": "0x0000000000000000000000000000000000001010", + "topics": [ + "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", + "0x0000000000000000000000000000000000000000000000000000000000001010", + "0x000000000000000000000000d10f43a0aa00d244dacfbe3c49b9b918b717ff2c", + "0x0000000000000000000000006dc2dd54f24979ec26212794c71afefed722280c" + ], + "data": "0x00000000000000000000000000000000000000000000000000a8d2951cac3eab00000000000000000000000000000000000000000000000009449a304b619f540000000000000000000000000000000000000000000001a7c365da891fcdcf3f000000000000000000000000000000000000000000000000089bc79b2eb560a90000000000000000000000000000000000000000000001a7c40ead1e3c7a0dea", + "logIndex": 7, + "blockHash": "0x4fdd6166123a67a08406ccb8f73c892c27e914347bda32e4c6b67b97a6a6a1b9" + } + ], + "blockNumber": 7768175, + "cumulativeGasUsed": "2871431", + "status": 1, + "byzantium": true + }, + "args": [ + "0xC22a79eBA640940ABB6dF0f7982cc119578E11De", + "0x66756e2d706f6c79676f6e2d616d6f792d310000000000000000000000000000", + "0xD10F43A0aa00D244DAcFBE3C49b9B918B717Ff2c" + ], + "numDeployments": 3, + "solcInputHash": "be18bfdeea6869d68a166c8869814257", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"initialDonId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"initialOwner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AccessControlBadConfirmation\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"neededRole\",\"type\":\"bytes32\"}],\"name\":\"AccessControlUnauthorizedAccount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CCGOnlyManagerAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"CCGOnlySameSourceAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"CCGRequestAlreadyFulfilled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CCGRequestNameEmpty\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"}],\"name\":\"CCGRequestNotRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EmptyArgs\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EmptySource\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoInlineSecrets\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyRouterCanFulfill\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"RequestFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"RequestSent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"CLIENT_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MANAGER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"donId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"}],\"name\":\"getRequest\",\"outputs\":[{\"components\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"components\":[{\"internalType\":\"enum FunctionsRequest.Location\",\"name\":\"codeLocation\",\"type\":\"uint8\"},{\"internalType\":\"enum FunctionsRequest.Location\",\"name\":\"secretsLocation\",\"type\":\"uint8\"},{\"internalType\":\"enum FunctionsRequest.CodeLanguage\",\"name\":\"language\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"source\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"encryptedSecretsReference\",\"type\":\"bytes\"},{\"internalType\":\"string[]\",\"name\":\"args\",\"type\":\"string[]\"},{\"internalType\":\"bytes[]\",\"name\":\"bytesArgs\",\"type\":\"bytes[]\"}],\"internalType\":\"struct FunctionsRequest.Request\",\"name\":\"config\",\"type\":\"tuple\"}],\"internalType\":\"struct ICCGateway.CCGRequest\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"remove\",\"type\":\"bool\"}],\"name\":\"getResponse\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"source\",\"type\":\"address\"},{\"internalType\":\"enum ICCGatewayClient.CCGResponseState\",\"name\":\"state\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"error\",\"type\":\"bytes\"}],\"internalType\":\"struct ICCGatewayClient.CCGResponse\",\"name\":\"response\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"response\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"err\",\"type\":\"bytes\"}],\"name\":\"handleOracleFulfillment\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"internalType\":\"enum FunctionsRequest.Location\",\"name\":\"codeLocation\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"source\",\"type\":\"string\"},{\"internalType\":\"enum FunctionsRequest.Location\",\"name\":\"secretsLocation\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"encryptedSecretsReference\",\"type\":\"bytes\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"registerRequest\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"}],\"name\":\"removeRequest\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"callerConfirmation\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"internalType\":\"string[]\",\"name\":\"args\",\"type\":\"string[]\"},{\"internalType\":\"bytes[]\",\"name\":\"bytesArgs\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"encryptedSecretsReference\",\"type\":\"bytes\"}],\"name\":\"sendRequest\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"newDonId\",\"type\":\"bytes32\"}],\"name\":\"setDonId\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"subscriptions\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"AccessControlBadConfirmation()\":[{\"details\":\"The caller of a function is not the expected one. NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\"}],\"AccessControlUnauthorizedAccount(address,bytes32)\":[{\"details\":\"The `account` is missing a role.\"}],\"CCGOnlyManagerAllowed()\":[{\"details\":\"Only A manager can call the function\"}],\"CCGOnlySameSourceAllowed(bytes32)\":[{\"details\":\"Only the same source of the requestId is allowed to call the function\"}],\"CCGRequestAlreadyFulfilled(bytes32)\":[{\"details\":\"Can't fulfill a request that has already been fulfilled\"}],\"CCGRequestNameEmpty()\":[{\"details\":\"Can't register a request with an empty name\"}],\"CCGRequestNotRegistered(uint64)\":[{\"details\":\"Only a registered subscriptionId is allowed to call the function\"}]},\"events\":{\"RoleAdminChanged(bytes32,bytes32,bytes32)\":{\"details\":\"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this.\"},\"RoleGranted(bytes32,address,address)\":{\"details\":\"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.\"},\"RoleRevoked(bytes32,address,address)\":{\"details\":\"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)\"}},\"kind\":\"dev\",\"methods\":{\"donId()\":{\"details\":\"Get the DON ID\",\"returns\":{\"_0\":\"DON ID\"}},\"getResponse(bytes32,bool)\":{\"details\":\"Get the response data\",\"params\":{\"requestId\":\"The request ID, returned by sendRequest()\"},\"returns\":{\"response\":\"CCGResponse\"}},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"handleOracleFulfillment(bytes32,bytes,bytes)\":{\"details\":\"Either response or error parameter will be set, but never both.\",\"params\":{\"err\":\"Aggregated error either from the request's source code or from the execution pipeline.\",\"requestId\":\"The requestId returned by FunctionsClient.sendRequest().\",\"response\":\"Aggregated response from the request's source code.\"}},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `callerConfirmation`. May emit a {RoleRevoked} event.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"sendRequest(uint64,string[],bytes[],bytes)\":{\"params\":{\"args\":\"String arguments passed into the source code and accessible via the global variable `args`\",\"bytesArgs\":\"Bytes arguments passed into the source code and accessible via the global variable `bytesArgs` as hex strings\",\"encryptedSecretsReference\":\"Reference pointing to encrypted secrets\",\"subscriptionId\":\"Subscription ID used to pay for request (FunctionsConsumer contract address must first be added to the subscription)\"}},\"setDonId(bytes32)\":{\"details\":\"Set the DON ID\",\"params\":{\"newDonId\":\"New DON ID\"}},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"handleOracleFulfillment(bytes32,bytes,bytes)\":{\"notice\":\"Chainlink Functions response handler called by the Functions Router during fullilment from the designated transmitter node in an OCR round.\"},\"sendRequest(uint64,string[],bytes[],bytes)\":{\"notice\":\"Triggers an on-demand Functions request using remote encrypted secrets\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/CCGateway.sol\":\"CCGateway\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {IFunctionsRouter} from \\\"./interfaces/IFunctionsRouter.sol\\\";\\nimport {IFunctionsClient} from \\\"./interfaces/IFunctionsClient.sol\\\";\\n\\nimport {FunctionsRequest} from \\\"./libraries/FunctionsRequest.sol\\\";\\n\\n/// @title The Chainlink Functions client contract\\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\\nabstract contract FunctionsClient is IFunctionsClient {\\n using FunctionsRequest for FunctionsRequest.Request;\\n\\n IFunctionsRouter internal immutable i_router;\\n\\n event RequestSent(bytes32 indexed id);\\n event RequestFulfilled(bytes32 indexed id);\\n\\n error OnlyRouterCanFulfill();\\n\\n constructor(address router) {\\n i_router = IFunctionsRouter(router);\\n }\\n\\n /// @notice Sends a Chainlink Functions request\\n /// @param data The CBOR encoded bytes data for a Functions request\\n /// @param subscriptionId The subscription ID that will be charged to service the request\\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\\n /// @return requestId The generated request ID for this request\\n function _sendRequest(\\n bytes memory data,\\n uint64 subscriptionId,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) internal returns (bytes32) {\\n bytes32 requestId = i_router.sendRequest(\\n subscriptionId,\\n data,\\n FunctionsRequest.REQUEST_DATA_VERSION,\\n callbackGasLimit,\\n donId\\n );\\n emit RequestSent(requestId);\\n return requestId;\\n }\\n\\n /// @notice User defined function to handle a response from the DON\\n /// @param requestId The request ID, returned by sendRequest()\\n /// @param response Aggregated response from the execution of the user's source code\\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\\n /// @dev Either response or error parameter will be set, but never both\\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\\n\\n /// @inheritdoc IFunctionsClient\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\\n if (msg.sender != address(i_router)) {\\n revert OnlyRouterCanFulfill();\\n }\\n fulfillRequest(requestId, response, err);\\n emit RequestFulfilled(requestId);\\n }\\n}\\n\",\"keccak256\":\"0x40224641403cb9fa03d4f060296d7420a9ff11b46abadc958ae048459205e397\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\n/// @title Chainlink Functions client interface.\\ninterface IFunctionsClient {\\n /// @notice Chainlink Functions response handler called by the Functions Router\\n /// during fullilment from the designated transmitter node in an OCR round.\\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\\n /// @param response Aggregated response from the request's source code.\\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\\n /// @dev Either response or error parameter will be set, but never both.\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\\n}\\n\",\"keccak256\":\"0x6117b82e7c4eec44ce557b0fc8bc1ac5f49e5d160ac6d4485452d6aafdd762ff\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {FunctionsResponse} from \\\"../libraries/FunctionsResponse.sol\\\";\\n\\n/// @title Chainlink Functions Router interface.\\ninterface IFunctionsRouter {\\n /// @notice The identifier of the route to retrieve the address of the access control contract\\n /// The access control contract controls which accounts can manage subscriptions\\n /// @return id - bytes32 id that can be passed to the \\\"getContractById\\\" of the Router\\n function getAllowListId() external view returns (bytes32);\\n\\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\\n /// The access control contract controls which accounts can manage subscriptions\\n function setAllowListId(bytes32 allowListId) external;\\n\\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\\n /// @return adminFee\\n function getAdminFee() external view returns (uint72 adminFee);\\n\\n /// @notice Sends a request using the provided subscriptionId\\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\\n /// a client can make requests from different contracts referencing the same subscription\\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\\n /// @param dataVersion - Gas limit for the fulfillment callback\\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\\n /// @param donId - An identifier used to determine which route to send the request along\\n /// @return requestId - A unique request identifier\\n function sendRequest(\\n uint64 subscriptionId,\\n bytes calldata data,\\n uint16 dataVersion,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) external returns (bytes32);\\n\\n /// @notice Sends a request to the proposed contracts\\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\\n /// a client can make requests from different contracts referencing the same subscription\\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\\n /// @param dataVersion - Gas limit for the fulfillment callback\\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\\n /// @param donId - An identifier used to determine which route to send the request along\\n /// @return requestId - A unique request identifier\\n function sendRequestToProposed(\\n uint64 subscriptionId,\\n bytes calldata data,\\n uint16 dataVersion,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) external returns (bytes32);\\n\\n /// @notice Fulfill the request by:\\n /// - calling back the data that the Oracle returned to the client contract\\n /// - pay the DON for processing the request\\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\\n /// @param response response data from DON consensus\\n /// @param err error from DON consensus\\n /// @param juelsPerGas - current rate of juels/gas\\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\\n /// @param transmitter - The Node that transmitted the OCR report\\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\\n /// @return fulfillResult -\\n /// @return callbackGasCostJuels -\\n function fulfill(\\n bytes memory response,\\n bytes memory err,\\n uint96 juelsPerGas,\\n uint96 costWithoutFulfillment,\\n address transmitter,\\n FunctionsResponse.Commitment memory commitment\\n ) external returns (FunctionsResponse.FulfillResult, uint96);\\n\\n /// @notice Validate requested gas limit is below the subscription max.\\n /// @param subscriptionId subscription ID\\n /// @param callbackGasLimit desired callback gas limit\\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\\n\\n /// @notice Get the current contract given an ID\\n /// @param id A bytes32 identifier for the route\\n /// @return contract The current contract address\\n function getContractById(bytes32 id) external view returns (address);\\n\\n /// @notice Get the proposed next contract given an ID\\n /// @param id A bytes32 identifier for the route\\n /// @return contract The current or proposed contract address\\n function getProposedContractById(bytes32 id) external view returns (address);\\n\\n /// @notice Return the latest proprosal set\\n /// @return ids The identifiers of the contracts to update\\n /// @return to The addresses of the contracts that will be updated to\\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\\n\\n /// @notice Proposes one or more updates to the contract routes\\n /// @dev Only callable by owner\\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\\n\\n /// @notice Updates the current contract routes to the proposed contracts\\n /// @dev Only callable by owner\\n function updateContracts() external;\\n\\n /// @dev Puts the system into an emergency stopped state.\\n /// @dev Only callable by owner\\n function pause() external;\\n\\n /// @dev Takes the system out of an emergency stopped state.\\n /// @dev Only callable by owner\\n function unpause() external;\\n}\\n\",\"keccak256\":\"0x44db41e8ff90c2828ca0ada125abc4b411921a86514a4a047fd9fd43ba9d7e08\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {CBOR} from \\\"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\\\";\\n\\n/// @title Library for encoding the input data of a Functions request into CBOR\\nlibrary FunctionsRequest {\\n using CBOR for CBOR.CBORBuffer;\\n\\n uint16 public constant REQUEST_DATA_VERSION = 1;\\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\\n\\n enum Location {\\n Inline, // Provided within the Request\\n Remote, // Hosted through remote location that can be accessed through a provided URL\\n DONHosted // Hosted on the DON's storage\\n }\\n\\n enum CodeLanguage {\\n JavaScript\\n // In future version we may add other languages\\n }\\n\\n struct Request {\\n Location codeLocation; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The location of the source code that will be executed on each node in the DON\\n Location secretsLocation; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The location of secrets that will be passed into the source code. *Only Remote secrets are supported\\n CodeLanguage language; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The coding language that the source code is written in\\n string source; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\\n bytes encryptedSecretsReference; // \\u2550\\u2550\\u2578 Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\\n string[] args; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 String arguments that will be passed into the source code\\n bytes[] bytesArgs; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Bytes arguments that will be passed into the source code\\n }\\n\\n error EmptySource();\\n error EmptySecrets();\\n error EmptyArgs();\\n error NoInlineSecrets();\\n\\n /// @notice Encodes a Request to CBOR encoded bytes\\n /// @param self The request to encode\\n /// @return CBOR encoded bytes\\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\\n\\n buffer.writeString(\\\"codeLocation\\\");\\n buffer.writeUInt256(uint256(self.codeLocation));\\n\\n buffer.writeString(\\\"language\\\");\\n buffer.writeUInt256(uint256(self.language));\\n\\n buffer.writeString(\\\"source\\\");\\n buffer.writeString(self.source);\\n\\n if (self.args.length > 0) {\\n buffer.writeString(\\\"args\\\");\\n buffer.startArray();\\n for (uint256 i = 0; i < self.args.length; ++i) {\\n buffer.writeString(self.args[i]);\\n }\\n buffer.endSequence();\\n }\\n\\n if (self.encryptedSecretsReference.length > 0) {\\n if (self.secretsLocation == Location.Inline) {\\n revert NoInlineSecrets();\\n }\\n buffer.writeString(\\\"secretsLocation\\\");\\n buffer.writeUInt256(uint256(self.secretsLocation));\\n buffer.writeString(\\\"secrets\\\");\\n buffer.writeBytes(self.encryptedSecretsReference);\\n }\\n\\n if (self.bytesArgs.length > 0) {\\n buffer.writeString(\\\"bytesArgs\\\");\\n buffer.startArray();\\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\\n buffer.writeBytes(self.bytesArgs[i]);\\n }\\n buffer.endSequence();\\n }\\n\\n return buffer.buf.buf;\\n }\\n\\n /// @notice Initializes a Chainlink Functions Request\\n /// @dev Sets the codeLocation and code on the request\\n /// @param self The uninitialized request\\n /// @param codeLocation The user provided source code location\\n /// @param language The programming language of the user code\\n /// @param source The user provided source code or a url\\n function initializeRequest(\\n Request memory self,\\n Location codeLocation,\\n CodeLanguage language,\\n string memory source\\n ) internal pure {\\n if (bytes(source).length == 0) revert EmptySource();\\n\\n self.codeLocation = codeLocation;\\n self.language = language;\\n self.source = source;\\n }\\n\\n /// @notice Initializes a Chainlink Functions Request\\n /// @dev Simplified version of initializeRequest for PoC\\n /// @param self The uninitialized request\\n /// @param javaScriptSource The user provided JS code (must not be empty)\\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\\n }\\n\\n /// @notice Adds Remote user encrypted secrets to a Request\\n /// @param self The initialized request\\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\\n\\n self.secretsLocation = Location.Remote;\\n self.encryptedSecretsReference = encryptedSecretsReference;\\n }\\n\\n /// @notice Adds DON-hosted secrets reference to a Request\\n /// @param self The initialized request\\n /// @param slotID Slot ID of the user's secrets hosted on DON\\n /// @param version User data version (for the slotID)\\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\\n\\n buffer.writeString(\\\"slotID\\\");\\n buffer.writeUInt64(slotID);\\n buffer.writeString(\\\"version\\\");\\n buffer.writeUInt64(version);\\n\\n self.secretsLocation = Location.DONHosted;\\n self.encryptedSecretsReference = buffer.buf.buf;\\n }\\n\\n /// @notice Sets args for the user run function\\n /// @param self The initialized request\\n /// @param args The array of string args (must not be empty)\\n function setArgs(Request memory self, string[] memory args) internal pure {\\n if (args.length == 0) revert EmptyArgs();\\n\\n self.args = args;\\n }\\n\\n /// @notice Sets bytes args for the user run function\\n /// @param self The initialized request\\n /// @param args The array of bytes args (must not be empty)\\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\\n if (args.length == 0) revert EmptyArgs();\\n\\n self.bytesArgs = args;\\n }\\n}\\n\",\"keccak256\":\"0xed75be0eaba358d468f1fe18adc377d5044f57eff0070081f884a1f212d0adc2\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\n/// @title Library of types that are used for fulfillment of a Functions request\\nlibrary FunctionsResponse {\\n // Used to send request information from the Router to the Coordinator\\n struct RequestMeta {\\n bytes data; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\\n bytes32 flags; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Per-subscription flags\\n address requestingContract; // \\u2550\\u2550\\u2557 The client contract that is sending the request\\n uint96 availableBalance; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u255d Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\\n uint72 adminFee; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\\n uint64 subscriptionId; // \\u2551 Identifier of the billing subscription that will be charged for the request\\n uint64 initiatedRequests; // \\u2551 The number of requests that have been started\\n uint32 callbackGasLimit; // \\u2551 The amount of gas that the callback to the consuming contract will be given\\n uint16 dataVersion; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The version of the structure of the CBOR encoded request data\\n uint64 completedRequests; // \\u2550\\u2550\\u2550\\u2550\\u2557 The number of requests that have successfully completed or timed out\\n address subscriptionOwner; // \\u2550\\u2550\\u2550\\u255d The owner of the billing subscription\\n }\\n\\n enum FulfillResult {\\n FULFILLED, // 0\\n USER_CALLBACK_ERROR, // 1\\n INVALID_REQUEST_ID, // 2\\n COST_EXCEEDS_COMMITMENT, // 3\\n INSUFFICIENT_GAS_PROVIDED, // 4\\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\\n INVALID_COMMITMENT // 6\\n }\\n\\n struct Commitment {\\n bytes32 requestId; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 A unique identifier for a Chainlink Functions request\\n address coordinator; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 The Coordinator contract that manages the DON that is servicing a request\\n uint96 estimatedTotalCostJuels; // \\u2550\\u2550\\u2550\\u2550\\u255d The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\\n address client; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 The client contract that sent the request\\n uint64 subscriptionId; // \\u2551 Identifier of the billing subscription that will be charged for the request\\n uint32 callbackGasLimit; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The amount of gas that the callback to the consuming contract will be given\\n uint72 adminFee; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\\n uint72 donFee; // \\u2551 Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\\n uint40 gasOverheadBeforeCallback; // \\u2551 Represents the average gas execution cost before the fulfillment callback.\\n uint40 gasOverheadAfterCallback; // \\u2551 Represents the average gas execution cost after the fulfillment callback.\\n uint32 timeoutTimestamp; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The timestamp at which a request will be eligible to be timed out\\n }\\n}\\n\",\"keccak256\":\"0xc72eb037effef32146f7cd4086af00f44f28c8649d891e5e404fec5fda7e802b\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {IFunctionsRouter} from \\\"../v1_0_0/interfaces/IFunctionsRouter.sol\\\";\\nimport {IFunctionsClient} from \\\"../v1_0_0/interfaces/IFunctionsClient.sol\\\";\\n\\nimport {FunctionsRequest} from \\\"../v1_0_0/libraries/FunctionsRequest.sol\\\";\\n\\n/// @title The Chainlink Functions client contract\\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\\nabstract contract FunctionsClient is IFunctionsClient {\\n using FunctionsRequest for FunctionsRequest.Request;\\n\\n IFunctionsRouter internal immutable i_functionsRouter;\\n\\n event RequestSent(bytes32 indexed id);\\n event RequestFulfilled(bytes32 indexed id);\\n\\n error OnlyRouterCanFulfill();\\n\\n constructor(address router) {\\n i_functionsRouter = IFunctionsRouter(router);\\n }\\n\\n /// @notice Sends a Chainlink Functions request\\n /// @param data The CBOR encoded bytes data for a Functions request\\n /// @param subscriptionId The subscription ID that will be charged to service the request\\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\\n /// @return requestId The generated request ID for this request\\n function _sendRequest(\\n bytes memory data,\\n uint64 subscriptionId,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) internal returns (bytes32) {\\n bytes32 requestId = i_functionsRouter.sendRequest(\\n subscriptionId,\\n data,\\n FunctionsRequest.REQUEST_DATA_VERSION,\\n callbackGasLimit,\\n donId\\n );\\n emit RequestSent(requestId);\\n return requestId;\\n }\\n\\n /// @notice User defined function to handle a response from the DON\\n /// @param requestId The request ID, returned by sendRequest()\\n /// @param response Aggregated response from the execution of the user's source code\\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\\n /// @dev Either response or error parameter will be set, but never both\\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\\n\\n /// @inheritdoc IFunctionsClient\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\\n if (msg.sender != address(i_functionsRouter)) {\\n revert OnlyRouterCanFulfill();\\n }\\n _fulfillRequest(requestId, response, err);\\n emit RequestFulfilled(requestId);\\n }\\n}\\n\",\"keccak256\":\"0xdc40f1e9dea8a572d43d310afa68e978c35218d16097b9cfd9d1b6137df3cd0a\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-2-Clause\\npragma solidity ^0.8.4;\\n\\n/**\\n* @dev A library for working with mutable byte buffers in Solidity.\\n*\\n* Byte buffers are mutable and expandable, and provide a variety of primitives\\n* for appending to them. At any time you can fetch a bytes object containing the\\n* current contents of the buffer. The bytes object should not be stored between\\n* operations, as it may change due to resizing of the buffer.\\n*/\\nlibrary Buffer {\\n /**\\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\\n * a capacity. The capacity may be longer than the current value, in\\n * which case it can be extended without the need to allocate more memory.\\n */\\n struct buffer {\\n bytes buf;\\n uint capacity;\\n }\\n\\n /**\\n * @dev Initializes a buffer with an initial capacity.\\n * @param buf The buffer to initialize.\\n * @param capacity The number of bytes of space to allocate the buffer.\\n * @return The buffer, for chaining.\\n */\\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\\n if (capacity % 32 != 0) {\\n capacity += 32 - (capacity % 32);\\n }\\n // Allocate space for the buffer data\\n buf.capacity = capacity;\\n assembly {\\n let ptr := mload(0x40)\\n mstore(buf, ptr)\\n mstore(ptr, 0)\\n let fpm := add(32, add(ptr, capacity))\\n if lt(fpm, ptr) {\\n revert(0, 0)\\n }\\n mstore(0x40, fpm)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Initializes a new buffer from an existing bytes object.\\n * Changes to the buffer may mutate the original value.\\n * @param b The bytes object to initialize the buffer with.\\n * @return A new buffer.\\n */\\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\\n buffer memory buf;\\n buf.buf = b;\\n buf.capacity = b.length;\\n return buf;\\n }\\n\\n function resize(buffer memory buf, uint capacity) private pure {\\n bytes memory oldbuf = buf.buf;\\n init(buf, capacity);\\n append(buf, oldbuf);\\n }\\n\\n /**\\n * @dev Sets buffer length to 0.\\n * @param buf The buffer to truncate.\\n * @return The original buffer, for chaining..\\n */\\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\\n assembly {\\n let bufptr := mload(buf)\\n mstore(bufptr, 0)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to copy.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\\n require(len <= data.length);\\n\\n uint off = buf.buf.length;\\n uint newCapacity = off + len;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint dest;\\n uint src;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Length of existing buffer data\\n let buflen := mload(bufptr)\\n // Start address = buffer address + offset + sizeof(buffer length)\\n dest := add(add(bufptr, 32), off)\\n // Update buffer length if we're extending it\\n if gt(newCapacity, buflen) {\\n mstore(bufptr, newCapacity)\\n }\\n src := add(data, 32)\\n }\\n\\n // Copy word-length chunks while possible\\n for (; len >= 32; len -= 32) {\\n assembly {\\n mstore(dest, mload(src))\\n }\\n dest += 32;\\n src += 32;\\n }\\n\\n // Copy remaining bytes\\n unchecked {\\n uint mask = (256 ** (32 - len)) - 1;\\n assembly {\\n let srcpart := and(mload(src), not(mask))\\n let destpart := and(mload(dest), mask)\\n mstore(dest, or(destpart, srcpart))\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\\n return append(buf, data, data.length);\\n }\\n\\n /**\\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\\n * capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint offPlusOne = off + 1;\\n if (off >= buf.capacity) {\\n resize(buf, offPlusOne * 2);\\n }\\n\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + off\\n let dest := add(add(bufptr, off), 32)\\n mstore8(dest, data)\\n // Update buffer length if we extended it\\n if gt(offPlusOne, mload(bufptr)) {\\n mstore(bufptr, offPlusOne)\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (left-aligned).\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n unchecked {\\n uint mask = (256 ** len) - 1;\\n // Right-align data\\n data = data >> (8 * (32 - len));\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chhaining.\\n */\\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\\n return append(buf, bytes32(data), 20);\\n }\\n\\n /**\\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\\n return append(buf, data, 32);\\n }\\n\\n /**\\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (right-aligned).\\n * @return The original buffer.\\n */\\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint mask = (256 ** len) - 1;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n return buf;\\n }\\n}\",\"keccak256\":\"0x0d86b367813922094e02594a406ba89f5e97d3d74ec2ce3c4032566840e302b0\",\"license\":\"BSD-2-Clause\"},\"@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.4;\\n\\nimport \\\"../../@ensdomains/buffer/v0.1.0/Buffer.sol\\\";\\n\\n/**\\n* @dev A library for populating CBOR encoded payload in Solidity.\\n*\\n* https://datatracker.ietf.org/doc/html/rfc7049\\n*\\n* The library offers various write* and start* methods to encode values of different types.\\n* The resulted buffer can be obtained with data() method.\\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\\n* in an invalid CBOR if start/write/end flow is violated.\\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\\n* except for nested start/end pairs.\\n*/\\n\\nlibrary CBOR {\\n using Buffer for Buffer.buffer;\\n\\n struct CBORBuffer {\\n Buffer.buffer buf;\\n uint256 depth;\\n }\\n\\n uint8 private constant MAJOR_TYPE_INT = 0;\\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\\n uint8 private constant MAJOR_TYPE_BYTES = 2;\\n uint8 private constant MAJOR_TYPE_STRING = 3;\\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\\n uint8 private constant MAJOR_TYPE_MAP = 5;\\n uint8 private constant MAJOR_TYPE_TAG = 6;\\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\\n\\n uint8 private constant TAG_TYPE_BIGNUM = 2;\\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\\n\\n uint8 private constant CBOR_FALSE = 20;\\n uint8 private constant CBOR_TRUE = 21;\\n uint8 private constant CBOR_NULL = 22;\\n uint8 private constant CBOR_UNDEFINED = 23;\\n\\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\\n Buffer.init(cbor.buf, capacity);\\n cbor.depth = 0;\\n return cbor;\\n }\\n\\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\\n require(buf.depth == 0, \\\"Invalid CBOR\\\");\\n return buf.buf.buf;\\n }\\n\\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\\n writeBytes(buf, abi.encode(value));\\n }\\n\\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\\n if (value < 0) {\\n buf.buf.appendUint8(\\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\\n );\\n writeBytes(buf, abi.encode(uint256(-1 - value)));\\n } else {\\n writeUInt256(buf, uint256(value));\\n }\\n }\\n\\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\\n }\\n\\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\\n if(value >= 0) {\\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\\n } else{\\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\\n }\\n }\\n\\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\\n buf.buf.append(value);\\n }\\n\\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\\n buf.buf.append(bytes(value));\\n }\\n\\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\\n }\\n\\n function writeNull(CBORBuffer memory buf) internal pure {\\n writeContentFree(buf, CBOR_NULL);\\n }\\n\\n function writeUndefined(CBORBuffer memory buf) internal pure {\\n writeContentFree(buf, CBOR_UNDEFINED);\\n }\\n\\n function startArray(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\\n buf.depth += 1;\\n }\\n\\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\\n }\\n\\n function startMap(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\\n buf.depth += 1;\\n }\\n\\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\\n }\\n\\n function endSequence(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\\n buf.depth -= 1;\\n }\\n\\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\\n writeString(buf, key);\\n writeString(buf, value);\\n }\\n\\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\\n writeString(buf, key);\\n writeBytes(buf, value);\\n }\\n\\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\\n writeString(buf, key);\\n writeUInt256(buf, value);\\n }\\n\\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\\n writeString(buf, key);\\n writeInt256(buf, value);\\n }\\n\\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\\n writeString(buf, key);\\n writeUInt64(buf, value);\\n }\\n\\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\\n writeString(buf, key);\\n writeInt64(buf, value);\\n }\\n\\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\\n writeString(buf, key);\\n writeBool(buf, value);\\n }\\n\\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n writeNull(buf);\\n }\\n\\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n writeUndefined(buf);\\n }\\n\\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n startMap(buf);\\n }\\n\\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n startArray(buf);\\n }\\n\\n function writeFixedNumeric(\\n CBORBuffer memory buf,\\n uint8 major,\\n uint64 value\\n ) private pure {\\n if (value <= 23) {\\n buf.buf.appendUint8(uint8((major << 5) | value));\\n } else if (value <= 0xFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 24));\\n buf.buf.appendInt(value, 1);\\n } else if (value <= 0xFFFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 25));\\n buf.buf.appendInt(value, 2);\\n } else if (value <= 0xFFFFFFFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 26));\\n buf.buf.appendInt(value, 4);\\n } else {\\n buf.buf.appendUint8(uint8((major << 5) | 27));\\n buf.buf.appendInt(value, 8);\\n }\\n }\\n\\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\\n private\\n pure\\n {\\n buf.buf.appendUint8(uint8((major << 5) | 31));\\n }\\n\\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\\n private\\n pure\\n {\\n writeFixedNumeric(buf, major, length);\\n }\\n\\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\\n }\\n}\",\"keccak256\":\"0xdecf04203502670ac72ba466c75e4f87f4419907365005f0d73e7d07ee3e5715\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/AccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IAccessControl} from \\\"./IAccessControl.sol\\\";\\nimport {Context} from \\\"../utils/Context.sol\\\";\\nimport {ERC165} from \\\"../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```solidity\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```solidity\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\\n * to enforce additional security measures for this role.\\n */\\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\\n struct RoleData {\\n mapping(address account => bool) hasRole;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 role => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with an {AccessControlUnauthorizedAccount} error including the required role.\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role);\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\\n return _roles[role].hasRole[account];\\n }\\n\\n /**\\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\\n */\\n function _checkRole(bytes32 role) internal view virtual {\\n _checkRole(role, _msgSender());\\n }\\n\\n /**\\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\\n * is missing `role`.\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert AccessControlUnauthorizedAccount(account, role);\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `callerConfirmation`.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\\n if (callerConfirmation != _msgSender()) {\\n revert AccessControlBadConfirmation();\\n }\\n\\n _revokeRole(role, callerConfirmation);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\\n if (!hasRole(role, account)) {\\n _roles[role].hasRole[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\\n if (hasRole(role, account)) {\\n _roles[role].hasRole[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa0e92d42942f4f57c5be50568dac11e9d00c93efcb458026e18d2d9b9b2e7308\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev The `account` is missing a role.\\n */\\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\\n\\n /**\\n * @dev The caller of a function is not the expected one.\\n *\\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\\n */\\n error AccessControlBadConfirmation();\\n\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `callerConfirmation`.\\n */\\n function renounceRole(bytes32 role, address callerConfirmation) external;\\n}\\n\",\"keccak256\":\"0xb6b36edd6a2999fd243ff226d6cbf84bd71af2432bbd0dfe19392996a1d9cb41\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n function _contextSuffixLength() internal view virtual returns (uint256) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0x9e8778b14317ba9e256c30a76fd6c32b960af621987f56069e1e819c77c6a133\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x4296879f55019b23e135000eb36896057e7101fb7fb859c5ef690cf14643757b\",\"license\":\"MIT\"},\"contracts/CCGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport './interfaces/ICCGateway.sol';\\nimport {ICCGatewayClient} from './interfaces/ICCGatewayClient.sol';\\n\\nimport {FunctionsClient} from \\\"@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol\\\";\\nimport {AccessControl} from \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport {FunctionsRequest} from \\\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\\\";\\n\\ncontract CCGateway is ICCGateway, FunctionsClient, AccessControl {\\n using FunctionsRequest for FunctionsRequest.Request;\\n\\n bytes32 public constant MANAGER_ROLE = keccak256(\\\"MANAGER_ROLE\\\");\\n bytes32 public constant CLIENT_ROLE = keccak256(\\\"CLIENT_ROLE\\\");\\n bytes32 private _donId; // DON ID for the Functions DON to which the requests are sent\\n\\n mapping(uint64 subscriptionId => CCGRequest) private _requests; // Each subscription can only handle one kind of request\\n mapping(bytes32 requestId => ICCGatewayClient.CCGResponse) private unprocessed_responses; // Responses that have not been processed yet\\n\\n // array of registered subscriptions\\n uint64[] public subscriptions;\\n\\n constructor(address router, bytes32 initialDonId, address initialOwner) FunctionsClient(router) {\\n _donId = initialDonId;\\n\\n address to = address(0) == initialOwner ? _msgSender() : initialOwner;\\n _grantRole(DEFAULT_ADMIN_ROLE, to);\\n _grantRole(MANAGER_ROLE, to);\\n }\\n\\n /**\\n * @dev Set the DON ID\\n * @param newDonId New DON ID\\n */\\n function setDonId(bytes32 newDonId) external onlyRole(getRoleAdmin(MANAGER_ROLE)) {\\n _donId = newDonId;\\n }\\n\\n /**\\n * @dev Get the DON ID\\n * @return DON ID\\n */\\n function donId() external view returns (bytes32) {\\n return _donId;\\n }\\n\\n function registerRequest(\\n uint64 subscriptionId,\\n FunctionsRequest.Location codeLocation,\\n string calldata source,\\n FunctionsRequest.Location secretsLocation,\\n bytes calldata encryptedSecretsReference,\\n uint32 callbackGasLimit,\\n string calldata name\\n ) external onlyManager {\\n if (bytes(name).length == 0) {revert CCGRequestNameEmpty();}\\n\\n CCGRequest storage req = _requests[subscriptionId];\\n if(bytes(req.name).length == 0) {subscriptions.push(subscriptionId);}\\n\\n req.name = name;\\n req.callbackGasLimit = callbackGasLimit;\\n\\n // Only JavaScript is supported for now\\n req.config.language = FunctionsRequest.CodeLanguage.JavaScript;\\n req.config.codeLocation = codeLocation;\\n req.config.source = source;\\n req.config.secretsLocation = secretsLocation;\\n req.config.encryptedSecretsReference = encryptedSecretsReference;\\n }\\n\\n function removeRequest(uint64 subscriptionId) external onlyManager {\\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\\n delete _requests[subscriptionId];\\n\\n // Find the index of the subscriptionId in the subscriptions array\\n uint256 index = subscriptions.length;\\n for (uint256 i = 0; i < subscriptions.length; i++) {\\n if (index == subscriptions.length && subscriptions[i] == subscriptionId) index = i;\\n if (index != subscriptions.length && i + 1 < subscriptions.length) subscriptions[i] = subscriptions[i + 1];\\n }\\n\\n subscriptions.pop();\\n }\\n\\n function getRequest(uint64 subscriptionId) external view returns (CCGRequest memory) {\\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\\n return _requests[subscriptionId];\\n }\\n// ---------------------------------------------------------------------------------------------------------------------\\n modifier onlySource(bytes32 requestId) {\\n if (unprocessed_responses[requestId].source != _msgSender()) {revert CCGOnlySameSourceAllowed(requestId);}\\n _;\\n }\\n\\n modifier onlyManager() {\\n if (!hasRole(MANAGER_ROLE, tx.origin)) {revert CCGOnlyManagerAllowed();}\\n _;\\n }\\n// ---------------------------------------------------------------------------------------------------------------------\\n /**\\n * @notice Triggers an on-demand Functions request using remote encrypted secrets\\n * @param subscriptionId Subscription ID used to pay for request (FunctionsConsumer contract address must first be added to the subscription)\\n * @param args String arguments passed into the source code and accessible via the global variable `args`\\n * @param bytesArgs Bytes arguments passed into the source code and accessible via the global variable `bytesArgs` as hex strings\\n * @param encryptedSecretsReference Reference pointing to encrypted secrets\\n */\\n function sendRequest(\\n uint64 subscriptionId,\\n string[] calldata args,\\n bytes[] calldata bytesArgs,\\n bytes calldata encryptedSecretsReference\\n ) external onlyRole(CLIENT_ROLE) returns (bytes32 requestId) {\\n CCGRequest storage request = _requests[subscriptionId];\\n if (bytes(request.name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\\n\\n FunctionsRequest.Request memory req = request.config;\\n req.initializeRequest(req.codeLocation, FunctionsRequest.CodeLanguage.JavaScript, req.source);\\n if (encryptedSecretsReference.length > 0) {req.encryptedSecretsReference = encryptedSecretsReference;}\\n\\n if (args.length > 0) {\\n req.setArgs(args);\\n }\\n if (bytesArgs.length > 0) {\\n req.setBytesArgs(bytesArgs);\\n }\\n\\n requestId = _sendRequest(req.encodeCBOR(), subscriptionId, request.callbackGasLimit, _donId);\\n unprocessed_responses[requestId].state = ICCGatewayClient.CCGResponseState.Sent;\\n unprocessed_responses[requestId].source = _msgSender();\\n }\\n\\n /**\\n * @notice Store latest result/error\\n * @param requestId The request ID, returned by sendRequest()\\n * @param response Aggregated response from the user code\\n * @param err Aggregated error from the user code or from the execution pipeline\\n * Either response or error parameter will be set, but never both\\n */\\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal override {\\n ICCGatewayClient.CCGResponse storage resp = unprocessed_responses[requestId];\\n if (resp.state != ICCGatewayClient.CCGResponseState.Sent) {revert CCGRequestAlreadyFulfilled(requestId);}\\n\\n unprocessed_responses[requestId].state = err.length > 0 ? ICCGatewayClient.CCGResponseState.Error : ICCGatewayClient.CCGResponseState.Success;\\n unprocessed_responses[requestId].data = response;\\n unprocessed_responses[requestId].error = err;\\n\\n ICCGatewayClient(resp.source).callback(requestId);\\n }\\n\\n /**\\n * @dev Get the response data\\n * @param requestId The request ID, returned by sendRequest()\\n * @return response CCGResponse\\n */\\n function getResponse(bytes32 requestId, bool remove) external onlySource(requestId) returns (ICCGatewayClient.CCGResponse memory response) {\\n response = unprocessed_responses[requestId];\\n if (remove) {delete unprocessed_responses[requestId];}\\n }\\n}\",\"keccak256\":\"0x30020047512e69e37da4ab97917f13615bb96d65506baf5856aac3a25f8414af\",\"license\":\"MIT\"},\"contracts/interfaces/ICCGateway.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\\nimport {FunctionsRequest} from \\\"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\\\";\\n\\ninterface ICCGateway {\\n struct CCGRequest {\\n string name;\\n uint32 callbackGasLimit;\\n FunctionsRequest.Request config;\\n }\\n\\n /**\\n * @dev Can't register a request with an empty name\\n */\\n error CCGRequestNameEmpty();\\n\\n /**\\n * @dev Only the same source of the requestId is allowed to call the function\\n */\\n error CCGOnlySameSourceAllowed(bytes32 requestId);\\n\\n /**\\n * @dev Only a registered subscriptionId is allowed to call the function\\n */\\n error CCGRequestNotRegistered(uint64 subscriptionId);\\n\\n /**\\n * @dev Can't fulfill a request that has already been fulfilled\\n */\\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\\n\\n /**\\n * @dev Only A manager can call the function\\n */\\n error CCGOnlyManagerAllowed();\\n\\n /**\\n * @dev Send a request to the Functions DON\\n */\\n function sendRequest(\\n uint64 subscriptionId,\\n string[] calldata args,\\n bytes[] calldata bytesArgs,\\n bytes calldata encryptedSecretsReference\\n ) external returns (bytes32 requestId);\\n\\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\\n}\\n\",\"keccak256\":\"0xbc7d92f8db240767c8636e8df9b818cc1f5abfde22b8c49eee50f418fb0dbea5\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/ICCGatewayClient.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\ninterface ICCGatewayClient {\\n enum CCGResponseState {Sent, Success, Error}\\n\\n struct CCGResponse {\\n uint64 subscriptionId;\\n address source;\\n CCGResponseState state;\\n bytes data;\\n bytes error;\\n }\\n\\n function callback(bytes32 requestId) external;\\n}\\n\",\"keccak256\":\"0xb69320aa2152f374dec4cfc70b73f46e0db9774a1411d2acff1481ee3295f86a\",\"license\":\"UNLICENSED\"}},\"version\":1}", + "bytecode": "0x60a06040523480156200001157600080fd5b5060405162002f2f38038062002f2f83398101604081905262000034916200016e565b6001600160a01b0380841660805260018390556000908216156200005957816200005b565b335b90506200006a600082620000a2565b50620000977f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0882620000a2565b5050505050620001af565b6000828152602081815260408083206001600160a01b038516845290915281205460ff1662000147576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055620000fe3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016200014b565b5060005b92915050565b80516001600160a01b03811681146200016957600080fd5b919050565b6000806000606084860312156200018457600080fd5b6200018f8462000151565b925060208401519150620001a66040850162000151565b90509250925092565b608051612d5d620001d26000396000818161031a0152611a9f0152612d5d6000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c80638dbe7b9d116100a2578063c8ab5f2211610071578063c8ab5f2214610256578063cbbf67ec14610269578063d547741f14610289578063eae6f6521461029c578063ec87621c146102c357600080fd5b80638dbe7b9d1461022057806391d148541461022857806396c1582e1461023b578063a217fddf1461024e57600080fd5b80632d5bbf60116100e95780632d5bbf60146101a95780632f2ff15d146101d457806334d2afd9146101e757806336568abe146101fa57806378ca5de71461020d57600080fd5b806301ffc9a71461011b5780630ca761751461014357806315b851d114610158578063248a9ca314610178575b600080fd5b61012e61012936600461216b565b6102d8565b60405190151581526020015b60405180910390f35b610156610151366004612252565b61030f565b005b61016b6101663660046122be565b610393565b60405161013a919061235f565b61019b6101863660046123db565b60009081526020819052604090206001015490565b60405190815260200161013a565b6101bc6101b73660046123db565b6105ea565b6040516001600160401b03909116815260200161013a565b6101566101e23660046123f4565b610627565b6101566101f5366004612441565b610652565b6101566102083660046123f4565b6108cf565b61015661021b3660046123db565b610907565b60015461019b565b61012e6102363660046123f4565b61094f565b61019b6102493660046124e8565b610978565b61019b600081565b6101566102643660046125a1565b610e5a565b61027c610277366004612441565b610fee565b60405161013a91906126f8565b6101566102973660046123f4565b61148e565b61019b7fa5ff3ec7a96cdbba4d2d5172d66bbc73c6db3885f29b21be5da9fa7a7c02523281565b61019b600080516020612d0883398151915281565b60006001600160e01b03198216637965db0b60e01b148061030957506301ffc9a760e01b6001600160e01b03198316145b92915050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103585760405163c6829f8360e01b815260040160405180910390fd5b6103638383836114b3565b60405183907f85e1543bf2f84fe80c6badbce3648c8539ad1df4d2b3d822938ca0538be727e690600090a2505050565b6040805160a081018252600080825260208201819052918101919091526060808201819052608082015260008381526003602052604090205483906001600160a01b03600160401b9091041633146104065760405163949aaf2d60e01b8152600481018290526024015b60405180910390fd5b600084815260036020908152604091829020825160a08101845281546001600160401b0381168252600160401b81046001600160a01b03169382019390935292909190830190600160e01b900460ff166002811115610467576104676122f3565b6002811115610478576104786122f3565b815260200160018201805461048c906127de565b80601f01602080910402602001604051908101604052809291908181526020018280546104b8906127de565b80156105055780601f106104da57610100808354040283529160200191610505565b820191906000526020600020905b8154815290600101906020018083116104e857829003601f168201915b5050505050815260200160028201805461051e906127de565b80601f016020809104026020016040519081016040528092919081815260200182805461054a906127de565b80156105975780601f1061056c57610100808354040283529160200191610597565b820191906000526020600020905b81548152906001019060200180831161057a57829003601f168201915b505050505081525050915082156105e357600084815260036020526040812080546001600160e81b0319168155906105d26001830182612010565b6105e0600283016000612010565b50505b5092915050565b600481815481106105fa57600080fd5b9060005260206000209060049182820401919006600802915054906101000a90046001600160401b031681565b600082815260208190526040902060010154610642816115e6565b61064c83836115f3565b50505050565b61066a600080516020612d088339815191523261094f565b6106875760405163129d730760e01b815260040160405180910390fd5b6001600160401b038116600090815260026020526040902080546106aa906127de565b90506000036106d757604051630601bb0160e21b81526001600160401b03821660048201526024016103fd565b6001600160401b0381166000908152600260205260408120906106fa8282612010565b60018201805463ffffffff1916905560028201805462ffffff1916815560006107266003850182612010565b610734600283016000612010565b61074260038301600061204a565b610750600483016000612068565b50506004549150600090505b60045481101561088857600454821480156107b85750826001600160401b03166004828154811061078f5761078f612818565b6000918252602090912060048204015460039091166008026101000a90046001600160401b0316145b156107c1578091505b60045482148015906107de57506004546107dc826001612844565b105b156108765760046107f0826001612844565b8154811061080057610800612818565b90600052602060002090600491828204019190066008029054906101000a90046001600160401b03166004828154811061083c5761083c612818565b90600052602060002090600491828204019190066008026101000a8154816001600160401b0302191690836001600160401b031602179055505b8061088081612857565b91505061075c565b50600480548061089a5761089a612870565b60008281526020902060046000199092019182040180546001600160401b03600860038516026101000a021916905590555050565b6001600160a01b03811633146108f85760405163334bd91960e11b815260040160405180910390fd5b6109028282611685565b505050565b600080516020612d0883398151915260009081526020527fe84508f2c7fa9c351146748b3025cb78b45df37d868e48c6a75102fecdeee64654610949816115e6565b50600155565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60007fa5ff3ec7a96cdbba4d2d5172d66bbc73c6db3885f29b21be5da9fa7a7c0252326109a4816115e6565b6001600160401b0389166000908152600260205260409020805481906109c9906127de565b90506000036109f657604051630601bb0160e21b81526001600160401b038b1660048201526024016103fd565b6040805160e081019091526002808301805460009392839160ff1690811115610a2157610a216122f3565b6002811115610a3257610a326122f3565b81528154602090910190610100900460ff166002811115610a5557610a556122f3565b6002811115610a6657610a666122f3565b8152815460209091019062010000900460ff168015610a8757610a876122f3565b8015610a9557610a956122f3565b8152602001600182018054610aa9906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610ad5906127de565b8015610b225780601f10610af757610100808354040283529160200191610b22565b820191906000526020600020905b815481529060010190602001808311610b0557829003601f168201915b50505050508152602001600282018054610b3b906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610b67906127de565b8015610bb45780601f10610b8957610100808354040283529160200191610bb4565b820191906000526020600020905b815481529060010190602001808311610b9757829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b82821015610c8e578382906000526020600020018054610c01906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610c2d906127de565b8015610c7a5780601f10610c4f57610100808354040283529160200191610c7a565b820191906000526020600020905b815481529060010190602001808311610c5d57829003601f168201915b505050505081526020019060010190610be2565b50505050815260200160048201805480602002602001604051908101604052809291908181526020016000905b82821015610d67578382906000526020600020018054610cda906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610d06906127de565b8015610d535780601f10610d2857610100808354040283529160200191610d53565b820191906000526020600020905b815481529060010190602001808311610d3657829003601f168201915b505050505081526020019060010190610cbb565b5050509152505080516060820151919250610d87918391906000906116f0565b8415610dc95785858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050505060808201525b8815610de357610de3610ddc8a8c6128a9565b829061176e565b8615610dfd57610dfd610df6888a612935565b8290611798565b610e1f610e09826117c2565b60018085015490548e9163ffffffff1690611a9a565b6000818152600360205260409020805468010000000000000000600160e81b031916600160401b33021790559b9a5050505050505050505050565b610e72600080516020612d088339815191523261094f565b610e8f5760405163129d730760e01b815260040160405180910390fd5b6000819003610eb15760405163281b14ab60e01b815260040160405180910390fd5b6001600160401b038a16600090815260026020526040902080548190610ed6906127de565b9050600003610f3d576004805460018101825560008290529081047f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160401b03808f1660086003909516949094026101000a938402930219169190911790555b80610f498385836129ea565b506001818101805463ffffffff191663ffffffff87161790556002808301805462ff000019811682558d93919262ff00ff1990911691908490811115610f9157610f916122f3565b021790555060038101610fa5898b836129ea565b5060028082018054899261ff001990911690610100908490811115610fcc57610fcc6122f3565b021790555060048101610fe08688836129ea565b505050505050505050505050565b610ff6612086565b6001600160401b03821660009081526002602052604090208054611019906127de565b905060000361104657604051630601bb0160e21b81526001600160401b03831660048201526024016103fd565b6001600160401b03821660009081526002602052604090819020815160608101909252805482908290611078906127de565b80601f01602080910402602001604051908101604052809291908181526020018280546110a4906127de565b80156110f15780601f106110c6576101008083540402835291602001916110f1565b820191906000526020600020905b8154815290600101906020018083116110d457829003601f168201915b5050509183525050600182015463ffffffff1660208201526040805160e0810182526002808501805493909401939192839160ff90911690811115611138576111386122f3565b6002811115611149576111496122f3565b81528154602090910190610100900460ff16600281111561116c5761116c6122f3565b600281111561117d5761117d6122f3565b8152815460209091019062010000900460ff16801561119e5761119e6122f3565b80156111ac576111ac6122f3565b81526020016001820180546111c0906127de565b80601f01602080910402602001604051908101604052809291908181526020018280546111ec906127de565b80156112395780601f1061120e57610100808354040283529160200191611239565b820191906000526020600020905b81548152906001019060200180831161121c57829003601f168201915b50505050508152602001600282018054611252906127de565b80601f016020809104026020016040519081016040528092919081815260200182805461127e906127de565b80156112cb5780601f106112a0576101008083540402835291602001916112cb565b820191906000526020600020905b8154815290600101906020018083116112ae57829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b828210156113a5578382906000526020600020018054611318906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054611344906127de565b80156113915780601f1061136657610100808354040283529160200191611391565b820191906000526020600020905b81548152906001019060200180831161137457829003601f168201915b5050505050815260200190600101906112f9565b50505050815260200160048201805480602002602001604051908101604052809291908181526020016000905b8282101561147e5783829060005260206000200180546113f1906127de565b80601f016020809104026020016040519081016040528092919081815260200182805461141d906127de565b801561146a5780601f1061143f5761010080835404028352916020019161146a565b820191906000526020600020905b81548152906001019060200180831161144d57829003601f168201915b5050505050815260200190600101906113d2565b5050509152505090525092915050565b6000828152602081905260409020600101546114a9816115e6565b61064c8383611685565b6000838152600360205260408120908154600160e01b900460ff1660028111156114df576114df6122f3565b146114ff576040516287aa6360e01b8152600481018590526024016103fd565b600082511161150f576001611512565b60025b6000858152600360205260409020805460ff60e01b1916600160e01b836002811115611540576115406122f3565b021790555060008481526003602052604090206001016115608482612aaa565b50600084815260036020526040902060020161157c8382612aaa565b508054604051636f89cca760e11b815260048101869052600160401b9091046001600160a01b03169063df13994e90602401600060405180830381600087803b1580156115c857600080fd5b505af11580156115dc573d6000803e3d6000fd5b5050505050505050565b6115f08133611b6c565b50565b60006115ff838361094f565b61167d576000838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556116353390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610309565b506000610309565b6000611691838361094f565b1561167d576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610309565b8051600003611712576040516322ce3edd60e01b815260040160405180910390fd5b83836002811115611725576117256122f3565b90816002811115611738576117386122f3565b9052506040840182801561174e5761174e6122f3565b9081801561175e5761175e6122f3565b9052506060909301929092525050565b80516000036117905760405163fe936cb760e01b815260040160405180910390fd5b60a090910152565b80516000036117ba5760405163fe936cb760e01b815260040160405180910390fd5b60c090910152565b606060006117d1610100611ba9565b905061180a6040518060400160405280600c81526020016b31b7b232a637b1b0ba34b7b760a11b81525082611bca90919063ffffffff16565b8251611828906002811115611821576118216122f3565b8290611be3565b6040805180820190915260088152676c616e677561676560c01b6020820152611852908290611bca565b6040830151611869908015611821576118216122f3565b604080518082019091526006815265736f7572636560d01b6020820152611891908290611bca565b60608301516118a1908290611bca565b60a08301515115611935576040805180820190915260048152636172677360e01b60208201526118d2908290611bca565b6118db81611c1c565b60005b8360a001515181101561192b5761191b8460a00151828151811061190457611904612818565b602002602001015183611bca90919063ffffffff16565b61192481612857565b90506118de565b5061193581611c40565b608083015151156119f957600083602001516002811115611958576119586122f3565b036119765760405163a80d31f760e01b815260040160405180910390fd5b60408051808201909152600f81526e39b2b1b932ba39a637b1b0ba34b7b760891b60208201526119a7908290611bca565b6119c083602001516002811115611821576118216122f3565b6040805180820190915260078152667365637265747360c81b60208201526119e9908290611bca565b60808301516119f9908290611c5e565b60c08301515115611a925760408051808201909152600981526862797465734172677360b81b6020820152611a2f908290611bca565b611a3881611c1c565b60005b8360c0015151811015611a8857611a788460c001518281518110611a6157611a61612818565b602002602001015183611c5e90919063ffffffff16565b611a8181612857565b9050611a3b565b50611a9281611c40565b515192915050565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663461d27628688600188886040518663ffffffff1660e01b8152600401611af2959493929190612b69565b6020604051808303816000875af1158015611b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b359190612bb2565b60405190915081907f1131472297a800fee664d1d89cfa8f7676ff07189ecc53f80bbb5f4969099db890600090a295945050505050565b611b76828261094f565b611ba55760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016103fd565b5050565b611bb16120e3565b8051611bbd9083611c6b565b5060006020820152919050565b611bd78260038351611ce2565b81516109029082611dfb565b8151611bf09060c2611e23565b50611ba58282604051602001611c0891815260200190565b604051602081830303815290604052611c5e565b611c27816004611e8c565b600181602001818151611c3a9190612844565b90525050565b611c4b816007611e8c565b600181602001818151611c3a9190612bcb565b611bd78260028351611ce2565b604080518082019091526060815260006020820152611c8b602083612bde565b15611cb357611c9b602083612bde565b611ca6906020612bcb565b611cb09083612844565b91505b602080840183905260405180855260008152908184010181811015611cd757600080fd5b604052509192915050565b6017816001600160401b031611611d0857825161064c9060e0600585901b168317611e23565b60ff816001600160401b031611611d48578251611d30906018611fe0600586901b1617611e23565b50825161064c906001600160401b0383166001611ea3565b61ffff816001600160401b031611611d89578251611d71906019611fe0600586901b1617611e23565b50825161064c906001600160401b0383166002611ea3565b63ffffffff816001600160401b031611611dcc578251611db490601a611fe0600586901b1617611e23565b50825161064c906001600160401b0383166004611ea3565b8251611de390601b611fe0600586901b1617611e23565b50825161064c906001600160401b0383166008611ea3565b604080518082019091526060815260006020820152611e1c83838451611f28565b9392505050565b6040805180820190915260608152600060208201528251516000611e48826001612844565b905084602001518210611e6957611e6985611e64836002612c00565b611ff9565b8451602083820101858153508051821115611e82578181525b5093949350505050565b815161090290601f611fe0600585901b1617611e23565b6040805180820190915260608152600060208201528351516000611ec78285612844565b90508560200151811115611ee457611ee486611e64836002612c00565b60006001611ef486610100612cfb565b611efe9190612bcb565b90508651828101878319825116178152508051831115611f1c578281525b50959695505050505050565b6040805180820190915260608152600060208201528251821115611f4b57600080fd5b8351516000611f5a8483612844565b90508560200151811115611f7757611f7786611e64836002612c00565b855180518382016020019160009180851115611f91578482525b505050602086015b60208610611fd15780518252611fb0602083612844565b9150611fbd602082612844565b9050611fca602087612bcb565b9550611f99565b51815160001960208890036101000a0190811690199190911617905250849150509392505050565b81516120058383611c6b565b5061064c8382611dfb565b50805461201c906127de565b6000825580601f1061202c575050565b601f0160209004906000526020600020908101906115f09190612118565b50805460008255906000526020600020908101906115f09190612131565b50805460008255906000526020600020908101906115f0919061214e565b60408051606080820183528152600060208201529081016120de6040805160e0810190915280600081526020016000815260200160008152602001606081526020016060815260200160608152602001606081525090565b905290565b604051806040016040528061210b604051806040016040528060608152602001600081525090565b8152602001600081525090565b5b8082111561212d5760008155600101612119565b5090565b8082111561212d5760006121458282612010565b50600101612131565b8082111561212d5760006121628282612010565b5060010161214e565b60006020828403121561217d57600080fd5b81356001600160e01b031981168114611e1c57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156121d3576121d3612195565b604052919050565b60006001600160401b038311156121f4576121f4612195565b612207601f8401601f19166020016121ab565b905082815283838301111561221b57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261224357600080fd5b611e1c838335602085016121db565b60008060006060848603121561226757600080fd5b8335925060208401356001600160401b038082111561228557600080fd5b61229187838801612232565b935060408601359150808211156122a757600080fd5b506122b486828701612232565b9150509250925092565b600080604083850312156122d157600080fd5b82359150602083013580151581146122e857600080fd5b809150509250929050565b634e487b7160e01b600052602160045260246000fd5b600381106115f0576115f06122f3565b6000815180845260005b8181101561233f57602081850181015186830182015201612323565b506000602082860101526020601f19601f83011685010191505092915050565b602081526001600160401b03825116602082015260018060a01b0360208301511660408201526000604083015161239581612309565b80606084015250606083015160a060808401526123b560c0840182612319565b90506080840151601f198483030160a08501526123d28282612319565b95945050505050565b6000602082840312156123ed57600080fd5b5035919050565b6000806040838503121561240757600080fd5b8235915060208301356001600160a01b03811681146122e857600080fd5b80356001600160401b038116811461243c57600080fd5b919050565b60006020828403121561245357600080fd5b611e1c82612425565b60008083601f84011261246e57600080fd5b5081356001600160401b0381111561248557600080fd5b6020830191508360208260051b85010111156124a057600080fd5b9250929050565b60008083601f8401126124b957600080fd5b5081356001600160401b038111156124d057600080fd5b6020830191508360208285010111156124a057600080fd5b60008060008060008060006080888a03121561250357600080fd5b61250c88612425565b965060208801356001600160401b038082111561252857600080fd5b6125348b838c0161245c565b909850965060408a013591508082111561254d57600080fd5b6125598b838c0161245c565b909650945060608a013591508082111561257257600080fd5b5061257f8a828b016124a7565b989b979a50959850939692959293505050565b80356003811061243c57600080fd5b60008060008060008060008060008060e08b8d0312156125c057600080fd5b6125c98b612425565b99506125d760208c01612592565b985060408b01356001600160401b03808211156125f357600080fd5b6125ff8e838f016124a7565b909a50985088915061261360608e01612592565b975060808d013591508082111561262957600080fd5b6126358e838f016124a7565b909750955060a08d0135915063ffffffff8216821461265357600080fd5b90935060c08c0135908082111561266957600080fd5b506126768d828e016124a7565b915080935050809150509295989b9194979a5092959850565b6001811061269f5761269f6122f3565b9052565b600081518084526020808501808196508360051b8101915082860160005b858110156126eb5782840389526126d9848351612319565b988501989350908401906001016126c1565b5091979650505050505050565b6020815260008251606060208401526127146080840182612319565b905063ffffffff60208501511660408401526040840151601f19848303016060850152805161274281612309565b8252602081015161275281612309565b80602084015250604081015161276b604084018261268f565b50606081015160e0606084015261278560e0840182612319565b90506080820151838203608085015261279e8282612319565b91505060a082015183820360a08501526127b882826126a3565b91505060c0820151915082810360c08401526127d481836126a3565b9695505050505050565b600181811c908216806127f257607f821691505b60208210810361281257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156103095761030961282e565b6000600182016128695761286961282e565b5060010190565b634e487b7160e01b600052603160045260246000fd5b60006001600160401b0382111561289f5761289f612195565b5060051b60200190565b60006128bc6128b784612886565b6121ab565b80848252602080830192508560051b8501368111156128da57600080fd5b855b818110156129295780356001600160401b038111156128fb5760008081fd5b870136601f82011261290d5760008081fd5b61291b3682358684016121db565b8652509382019382016128dc565b50919695505050505050565b60006129436128b784612886565b80848252602080830192508560051b85013681111561296157600080fd5b855b818110156129295780356001600160401b038111156129825760008081fd5b61298e36828a01612232565b865250938201938201612963565b601f82111561090257600081815260208120601f850160051c810160208610156129c35750805b601f850160051c820191505b818110156129e2578281556001016129cf565b505050505050565b6001600160401b03831115612a0157612a01612195565b612a1583612a0f83546127de565b8361299c565b6000601f841160018114612a495760008515612a315750838201355b600019600387901b1c1916600186901b178355612aa3565b600083815260209020601f19861690835b82811015612a7a5786850135825560209485019460019092019101612a5a565b5086821015612a975760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b81516001600160401b03811115612ac357612ac3612195565b612ad781612ad184546127de565b8461299c565b602080601f831160018114612b0c5760008415612af45750858301515b600019600386901b1c1916600185901b1785556129e2565b600085815260208120601f198616915b82811015612b3b57888601518255948401946001909101908401612b1c565b5085821015612b595787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160401b038616815260a060208201526000612b8b60a0830187612319565b61ffff9590951660408301525063ffffffff92909216606083015260809091015292915050565b600060208284031215612bc457600080fd5b5051919050565b818103818111156103095761030961282e565b600082612bfb57634e487b7160e01b600052601260045260246000fd5b500690565b80820281158282048414176103095761030961282e565b600181815b80851115612c52578160001904821115612c3857612c3861282e565b80851615612c4557918102915b93841c9390800290612c1c565b509250929050565b600082612c6957506001610309565b81612c7657506000610309565b8160018114612c8c5760028114612c9657612cb2565b6001915050610309565b60ff841115612ca757612ca761282e565b50506001821b610309565b5060208310610133831016604e8410600b8410161715612cd5575081810a610309565b612cdf8383612c17565b8060001904821115612cf357612cf361282e565b029392505050565b6000611e1c8383612c5a56fe241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08a2646970667358221220c853501b7d4e314864358724dac532054bd10ab5dc8600ff8db02415b54e281264736f6c63430008140033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101165760003560e01c80638dbe7b9d116100a2578063c8ab5f2211610071578063c8ab5f2214610256578063cbbf67ec14610269578063d547741f14610289578063eae6f6521461029c578063ec87621c146102c357600080fd5b80638dbe7b9d1461022057806391d148541461022857806396c1582e1461023b578063a217fddf1461024e57600080fd5b80632d5bbf60116100e95780632d5bbf60146101a95780632f2ff15d146101d457806334d2afd9146101e757806336568abe146101fa57806378ca5de71461020d57600080fd5b806301ffc9a71461011b5780630ca761751461014357806315b851d114610158578063248a9ca314610178575b600080fd5b61012e61012936600461216b565b6102d8565b60405190151581526020015b60405180910390f35b610156610151366004612252565b61030f565b005b61016b6101663660046122be565b610393565b60405161013a919061235f565b61019b6101863660046123db565b60009081526020819052604090206001015490565b60405190815260200161013a565b6101bc6101b73660046123db565b6105ea565b6040516001600160401b03909116815260200161013a565b6101566101e23660046123f4565b610627565b6101566101f5366004612441565b610652565b6101566102083660046123f4565b6108cf565b61015661021b3660046123db565b610907565b60015461019b565b61012e6102363660046123f4565b61094f565b61019b6102493660046124e8565b610978565b61019b600081565b6101566102643660046125a1565b610e5a565b61027c610277366004612441565b610fee565b60405161013a91906126f8565b6101566102973660046123f4565b61148e565b61019b7fa5ff3ec7a96cdbba4d2d5172d66bbc73c6db3885f29b21be5da9fa7a7c02523281565b61019b600080516020612d0883398151915281565b60006001600160e01b03198216637965db0b60e01b148061030957506301ffc9a760e01b6001600160e01b03198316145b92915050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103585760405163c6829f8360e01b815260040160405180910390fd5b6103638383836114b3565b60405183907f85e1543bf2f84fe80c6badbce3648c8539ad1df4d2b3d822938ca0538be727e690600090a2505050565b6040805160a081018252600080825260208201819052918101919091526060808201819052608082015260008381526003602052604090205483906001600160a01b03600160401b9091041633146104065760405163949aaf2d60e01b8152600481018290526024015b60405180910390fd5b600084815260036020908152604091829020825160a08101845281546001600160401b0381168252600160401b81046001600160a01b03169382019390935292909190830190600160e01b900460ff166002811115610467576104676122f3565b6002811115610478576104786122f3565b815260200160018201805461048c906127de565b80601f01602080910402602001604051908101604052809291908181526020018280546104b8906127de565b80156105055780601f106104da57610100808354040283529160200191610505565b820191906000526020600020905b8154815290600101906020018083116104e857829003601f168201915b5050505050815260200160028201805461051e906127de565b80601f016020809104026020016040519081016040528092919081815260200182805461054a906127de565b80156105975780601f1061056c57610100808354040283529160200191610597565b820191906000526020600020905b81548152906001019060200180831161057a57829003601f168201915b505050505081525050915082156105e357600084815260036020526040812080546001600160e81b0319168155906105d26001830182612010565b6105e0600283016000612010565b50505b5092915050565b600481815481106105fa57600080fd5b9060005260206000209060049182820401919006600802915054906101000a90046001600160401b031681565b600082815260208190526040902060010154610642816115e6565b61064c83836115f3565b50505050565b61066a600080516020612d088339815191523261094f565b6106875760405163129d730760e01b815260040160405180910390fd5b6001600160401b038116600090815260026020526040902080546106aa906127de565b90506000036106d757604051630601bb0160e21b81526001600160401b03821660048201526024016103fd565b6001600160401b0381166000908152600260205260408120906106fa8282612010565b60018201805463ffffffff1916905560028201805462ffffff1916815560006107266003850182612010565b610734600283016000612010565b61074260038301600061204a565b610750600483016000612068565b50506004549150600090505b60045481101561088857600454821480156107b85750826001600160401b03166004828154811061078f5761078f612818565b6000918252602090912060048204015460039091166008026101000a90046001600160401b0316145b156107c1578091505b60045482148015906107de57506004546107dc826001612844565b105b156108765760046107f0826001612844565b8154811061080057610800612818565b90600052602060002090600491828204019190066008029054906101000a90046001600160401b03166004828154811061083c5761083c612818565b90600052602060002090600491828204019190066008026101000a8154816001600160401b0302191690836001600160401b031602179055505b8061088081612857565b91505061075c565b50600480548061089a5761089a612870565b60008281526020902060046000199092019182040180546001600160401b03600860038516026101000a021916905590555050565b6001600160a01b03811633146108f85760405163334bd91960e11b815260040160405180910390fd5b6109028282611685565b505050565b600080516020612d0883398151915260009081526020527fe84508f2c7fa9c351146748b3025cb78b45df37d868e48c6a75102fecdeee64654610949816115e6565b50600155565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60007fa5ff3ec7a96cdbba4d2d5172d66bbc73c6db3885f29b21be5da9fa7a7c0252326109a4816115e6565b6001600160401b0389166000908152600260205260409020805481906109c9906127de565b90506000036109f657604051630601bb0160e21b81526001600160401b038b1660048201526024016103fd565b6040805160e081019091526002808301805460009392839160ff1690811115610a2157610a216122f3565b6002811115610a3257610a326122f3565b81528154602090910190610100900460ff166002811115610a5557610a556122f3565b6002811115610a6657610a666122f3565b8152815460209091019062010000900460ff168015610a8757610a876122f3565b8015610a9557610a956122f3565b8152602001600182018054610aa9906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610ad5906127de565b8015610b225780601f10610af757610100808354040283529160200191610b22565b820191906000526020600020905b815481529060010190602001808311610b0557829003601f168201915b50505050508152602001600282018054610b3b906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610b67906127de565b8015610bb45780601f10610b8957610100808354040283529160200191610bb4565b820191906000526020600020905b815481529060010190602001808311610b9757829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b82821015610c8e578382906000526020600020018054610c01906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610c2d906127de565b8015610c7a5780601f10610c4f57610100808354040283529160200191610c7a565b820191906000526020600020905b815481529060010190602001808311610c5d57829003601f168201915b505050505081526020019060010190610be2565b50505050815260200160048201805480602002602001604051908101604052809291908181526020016000905b82821015610d67578382906000526020600020018054610cda906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610d06906127de565b8015610d535780601f10610d2857610100808354040283529160200191610d53565b820191906000526020600020905b815481529060010190602001808311610d3657829003601f168201915b505050505081526020019060010190610cbb565b5050509152505080516060820151919250610d87918391906000906116f0565b8415610dc95785858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050505060808201525b8815610de357610de3610ddc8a8c6128a9565b829061176e565b8615610dfd57610dfd610df6888a612935565b8290611798565b610e1f610e09826117c2565b60018085015490548e9163ffffffff1690611a9a565b6000818152600360205260409020805468010000000000000000600160e81b031916600160401b33021790559b9a5050505050505050505050565b610e72600080516020612d088339815191523261094f565b610e8f5760405163129d730760e01b815260040160405180910390fd5b6000819003610eb15760405163281b14ab60e01b815260040160405180910390fd5b6001600160401b038a16600090815260026020526040902080548190610ed6906127de565b9050600003610f3d576004805460018101825560008290529081047f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160401b03808f1660086003909516949094026101000a938402930219169190911790555b80610f498385836129ea565b506001818101805463ffffffff191663ffffffff87161790556002808301805462ff000019811682558d93919262ff00ff1990911691908490811115610f9157610f916122f3565b021790555060038101610fa5898b836129ea565b5060028082018054899261ff001990911690610100908490811115610fcc57610fcc6122f3565b021790555060048101610fe08688836129ea565b505050505050505050505050565b610ff6612086565b6001600160401b03821660009081526002602052604090208054611019906127de565b905060000361104657604051630601bb0160e21b81526001600160401b03831660048201526024016103fd565b6001600160401b03821660009081526002602052604090819020815160608101909252805482908290611078906127de565b80601f01602080910402602001604051908101604052809291908181526020018280546110a4906127de565b80156110f15780601f106110c6576101008083540402835291602001916110f1565b820191906000526020600020905b8154815290600101906020018083116110d457829003601f168201915b5050509183525050600182015463ffffffff1660208201526040805160e0810182526002808501805493909401939192839160ff90911690811115611138576111386122f3565b6002811115611149576111496122f3565b81528154602090910190610100900460ff16600281111561116c5761116c6122f3565b600281111561117d5761117d6122f3565b8152815460209091019062010000900460ff16801561119e5761119e6122f3565b80156111ac576111ac6122f3565b81526020016001820180546111c0906127de565b80601f01602080910402602001604051908101604052809291908181526020018280546111ec906127de565b80156112395780601f1061120e57610100808354040283529160200191611239565b820191906000526020600020905b81548152906001019060200180831161121c57829003601f168201915b50505050508152602001600282018054611252906127de565b80601f016020809104026020016040519081016040528092919081815260200182805461127e906127de565b80156112cb5780601f106112a0576101008083540402835291602001916112cb565b820191906000526020600020905b8154815290600101906020018083116112ae57829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b828210156113a5578382906000526020600020018054611318906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054611344906127de565b80156113915780601f1061136657610100808354040283529160200191611391565b820191906000526020600020905b81548152906001019060200180831161137457829003601f168201915b5050505050815260200190600101906112f9565b50505050815260200160048201805480602002602001604051908101604052809291908181526020016000905b8282101561147e5783829060005260206000200180546113f1906127de565b80601f016020809104026020016040519081016040528092919081815260200182805461141d906127de565b801561146a5780601f1061143f5761010080835404028352916020019161146a565b820191906000526020600020905b81548152906001019060200180831161144d57829003601f168201915b5050505050815260200190600101906113d2565b5050509152505090525092915050565b6000828152602081905260409020600101546114a9816115e6565b61064c8383611685565b6000838152600360205260408120908154600160e01b900460ff1660028111156114df576114df6122f3565b146114ff576040516287aa6360e01b8152600481018590526024016103fd565b600082511161150f576001611512565b60025b6000858152600360205260409020805460ff60e01b1916600160e01b836002811115611540576115406122f3565b021790555060008481526003602052604090206001016115608482612aaa565b50600084815260036020526040902060020161157c8382612aaa565b508054604051636f89cca760e11b815260048101869052600160401b9091046001600160a01b03169063df13994e90602401600060405180830381600087803b1580156115c857600080fd5b505af11580156115dc573d6000803e3d6000fd5b5050505050505050565b6115f08133611b6c565b50565b60006115ff838361094f565b61167d576000838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556116353390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610309565b506000610309565b6000611691838361094f565b1561167d576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610309565b8051600003611712576040516322ce3edd60e01b815260040160405180910390fd5b83836002811115611725576117256122f3565b90816002811115611738576117386122f3565b9052506040840182801561174e5761174e6122f3565b9081801561175e5761175e6122f3565b9052506060909301929092525050565b80516000036117905760405163fe936cb760e01b815260040160405180910390fd5b60a090910152565b80516000036117ba5760405163fe936cb760e01b815260040160405180910390fd5b60c090910152565b606060006117d1610100611ba9565b905061180a6040518060400160405280600c81526020016b31b7b232a637b1b0ba34b7b760a11b81525082611bca90919063ffffffff16565b8251611828906002811115611821576118216122f3565b8290611be3565b6040805180820190915260088152676c616e677561676560c01b6020820152611852908290611bca565b6040830151611869908015611821576118216122f3565b604080518082019091526006815265736f7572636560d01b6020820152611891908290611bca565b60608301516118a1908290611bca565b60a08301515115611935576040805180820190915260048152636172677360e01b60208201526118d2908290611bca565b6118db81611c1c565b60005b8360a001515181101561192b5761191b8460a00151828151811061190457611904612818565b602002602001015183611bca90919063ffffffff16565b61192481612857565b90506118de565b5061193581611c40565b608083015151156119f957600083602001516002811115611958576119586122f3565b036119765760405163a80d31f760e01b815260040160405180910390fd5b60408051808201909152600f81526e39b2b1b932ba39a637b1b0ba34b7b760891b60208201526119a7908290611bca565b6119c083602001516002811115611821576118216122f3565b6040805180820190915260078152667365637265747360c81b60208201526119e9908290611bca565b60808301516119f9908290611c5e565b60c08301515115611a925760408051808201909152600981526862797465734172677360b81b6020820152611a2f908290611bca565b611a3881611c1c565b60005b8360c0015151811015611a8857611a788460c001518281518110611a6157611a61612818565b602002602001015183611c5e90919063ffffffff16565b611a8181612857565b9050611a3b565b50611a9281611c40565b515192915050565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663461d27628688600188886040518663ffffffff1660e01b8152600401611af2959493929190612b69565b6020604051808303816000875af1158015611b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b359190612bb2565b60405190915081907f1131472297a800fee664d1d89cfa8f7676ff07189ecc53f80bbb5f4969099db890600090a295945050505050565b611b76828261094f565b611ba55760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016103fd565b5050565b611bb16120e3565b8051611bbd9083611c6b565b5060006020820152919050565b611bd78260038351611ce2565b81516109029082611dfb565b8151611bf09060c2611e23565b50611ba58282604051602001611c0891815260200190565b604051602081830303815290604052611c5e565b611c27816004611e8c565b600181602001818151611c3a9190612844565b90525050565b611c4b816007611e8c565b600181602001818151611c3a9190612bcb565b611bd78260028351611ce2565b604080518082019091526060815260006020820152611c8b602083612bde565b15611cb357611c9b602083612bde565b611ca6906020612bcb565b611cb09083612844565b91505b602080840183905260405180855260008152908184010181811015611cd757600080fd5b604052509192915050565b6017816001600160401b031611611d0857825161064c9060e0600585901b168317611e23565b60ff816001600160401b031611611d48578251611d30906018611fe0600586901b1617611e23565b50825161064c906001600160401b0383166001611ea3565b61ffff816001600160401b031611611d89578251611d71906019611fe0600586901b1617611e23565b50825161064c906001600160401b0383166002611ea3565b63ffffffff816001600160401b031611611dcc578251611db490601a611fe0600586901b1617611e23565b50825161064c906001600160401b0383166004611ea3565b8251611de390601b611fe0600586901b1617611e23565b50825161064c906001600160401b0383166008611ea3565b604080518082019091526060815260006020820152611e1c83838451611f28565b9392505050565b6040805180820190915260608152600060208201528251516000611e48826001612844565b905084602001518210611e6957611e6985611e64836002612c00565b611ff9565b8451602083820101858153508051821115611e82578181525b5093949350505050565b815161090290601f611fe0600585901b1617611e23565b6040805180820190915260608152600060208201528351516000611ec78285612844565b90508560200151811115611ee457611ee486611e64836002612c00565b60006001611ef486610100612cfb565b611efe9190612bcb565b90508651828101878319825116178152508051831115611f1c578281525b50959695505050505050565b6040805180820190915260608152600060208201528251821115611f4b57600080fd5b8351516000611f5a8483612844565b90508560200151811115611f7757611f7786611e64836002612c00565b855180518382016020019160009180851115611f91578482525b505050602086015b60208610611fd15780518252611fb0602083612844565b9150611fbd602082612844565b9050611fca602087612bcb565b9550611f99565b51815160001960208890036101000a0190811690199190911617905250849150509392505050565b81516120058383611c6b565b5061064c8382611dfb565b50805461201c906127de565b6000825580601f1061202c575050565b601f0160209004906000526020600020908101906115f09190612118565b50805460008255906000526020600020908101906115f09190612131565b50805460008255906000526020600020908101906115f0919061214e565b60408051606080820183528152600060208201529081016120de6040805160e0810190915280600081526020016000815260200160008152602001606081526020016060815260200160608152602001606081525090565b905290565b604051806040016040528061210b604051806040016040528060608152602001600081525090565b8152602001600081525090565b5b8082111561212d5760008155600101612119565b5090565b8082111561212d5760006121458282612010565b50600101612131565b8082111561212d5760006121628282612010565b5060010161214e565b60006020828403121561217d57600080fd5b81356001600160e01b031981168114611e1c57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156121d3576121d3612195565b604052919050565b60006001600160401b038311156121f4576121f4612195565b612207601f8401601f19166020016121ab565b905082815283838301111561221b57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261224357600080fd5b611e1c838335602085016121db565b60008060006060848603121561226757600080fd5b8335925060208401356001600160401b038082111561228557600080fd5b61229187838801612232565b935060408601359150808211156122a757600080fd5b506122b486828701612232565b9150509250925092565b600080604083850312156122d157600080fd5b82359150602083013580151581146122e857600080fd5b809150509250929050565b634e487b7160e01b600052602160045260246000fd5b600381106115f0576115f06122f3565b6000815180845260005b8181101561233f57602081850181015186830182015201612323565b506000602082860101526020601f19601f83011685010191505092915050565b602081526001600160401b03825116602082015260018060a01b0360208301511660408201526000604083015161239581612309565b80606084015250606083015160a060808401526123b560c0840182612319565b90506080840151601f198483030160a08501526123d28282612319565b95945050505050565b6000602082840312156123ed57600080fd5b5035919050565b6000806040838503121561240757600080fd5b8235915060208301356001600160a01b03811681146122e857600080fd5b80356001600160401b038116811461243c57600080fd5b919050565b60006020828403121561245357600080fd5b611e1c82612425565b60008083601f84011261246e57600080fd5b5081356001600160401b0381111561248557600080fd5b6020830191508360208260051b85010111156124a057600080fd5b9250929050565b60008083601f8401126124b957600080fd5b5081356001600160401b038111156124d057600080fd5b6020830191508360208285010111156124a057600080fd5b60008060008060008060006080888a03121561250357600080fd5b61250c88612425565b965060208801356001600160401b038082111561252857600080fd5b6125348b838c0161245c565b909850965060408a013591508082111561254d57600080fd5b6125598b838c0161245c565b909650945060608a013591508082111561257257600080fd5b5061257f8a828b016124a7565b989b979a50959850939692959293505050565b80356003811061243c57600080fd5b60008060008060008060008060008060e08b8d0312156125c057600080fd5b6125c98b612425565b99506125d760208c01612592565b985060408b01356001600160401b03808211156125f357600080fd5b6125ff8e838f016124a7565b909a50985088915061261360608e01612592565b975060808d013591508082111561262957600080fd5b6126358e838f016124a7565b909750955060a08d0135915063ffffffff8216821461265357600080fd5b90935060c08c0135908082111561266957600080fd5b506126768d828e016124a7565b915080935050809150509295989b9194979a5092959850565b6001811061269f5761269f6122f3565b9052565b600081518084526020808501808196508360051b8101915082860160005b858110156126eb5782840389526126d9848351612319565b988501989350908401906001016126c1565b5091979650505050505050565b6020815260008251606060208401526127146080840182612319565b905063ffffffff60208501511660408401526040840151601f19848303016060850152805161274281612309565b8252602081015161275281612309565b80602084015250604081015161276b604084018261268f565b50606081015160e0606084015261278560e0840182612319565b90506080820151838203608085015261279e8282612319565b91505060a082015183820360a08501526127b882826126a3565b91505060c0820151915082810360c08401526127d481836126a3565b9695505050505050565b600181811c908216806127f257607f821691505b60208210810361281257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156103095761030961282e565b6000600182016128695761286961282e565b5060010190565b634e487b7160e01b600052603160045260246000fd5b60006001600160401b0382111561289f5761289f612195565b5060051b60200190565b60006128bc6128b784612886565b6121ab565b80848252602080830192508560051b8501368111156128da57600080fd5b855b818110156129295780356001600160401b038111156128fb5760008081fd5b870136601f82011261290d5760008081fd5b61291b3682358684016121db565b8652509382019382016128dc565b50919695505050505050565b60006129436128b784612886565b80848252602080830192508560051b85013681111561296157600080fd5b855b818110156129295780356001600160401b038111156129825760008081fd5b61298e36828a01612232565b865250938201938201612963565b601f82111561090257600081815260208120601f850160051c810160208610156129c35750805b601f850160051c820191505b818110156129e2578281556001016129cf565b505050505050565b6001600160401b03831115612a0157612a01612195565b612a1583612a0f83546127de565b8361299c565b6000601f841160018114612a495760008515612a315750838201355b600019600387901b1c1916600186901b178355612aa3565b600083815260209020601f19861690835b82811015612a7a5786850135825560209485019460019092019101612a5a565b5086821015612a975760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b81516001600160401b03811115612ac357612ac3612195565b612ad781612ad184546127de565b8461299c565b602080601f831160018114612b0c5760008415612af45750858301515b600019600386901b1c1916600185901b1785556129e2565b600085815260208120601f198616915b82811015612b3b57888601518255948401946001909101908401612b1c565b5085821015612b595787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160401b038616815260a060208201526000612b8b60a0830187612319565b61ffff9590951660408301525063ffffffff92909216606083015260809091015292915050565b600060208284031215612bc457600080fd5b5051919050565b818103818111156103095761030961282e565b600082612bfb57634e487b7160e01b600052601260045260246000fd5b500690565b80820281158282048414176103095761030961282e565b600181815b80851115612c52578160001904821115612c3857612c3861282e565b80851615612c4557918102915b93841c9390800290612c1c565b509250929050565b600082612c6957506001610309565b81612c7657506000610309565b8160018114612c8c5760028114612c9657612cb2565b6001915050610309565b60ff841115612ca757612ca761282e565b50506001821b610309565b5060208310610133831016604e8410600b8410161715612cd5575081810a610309565b612cdf8383612c17565b8060001904821115612cf357612cf361282e565b029392505050565b6000611e1c8383612c5a56fe241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08a2646970667358221220c853501b7d4e314864358724dac532054bd10ab5dc8600ff8db02415b54e281264736f6c63430008140033", + "devdoc": { + "errors": { + "AccessControlBadConfirmation()": [ + { + "details": "The caller of a function is not the expected one. NOTE: Don't confuse with {AccessControlUnauthorizedAccount}." + } + ], + "AccessControlUnauthorizedAccount(address,bytes32)": [ + { + "details": "The `account` is missing a role." + } + ], + "CCGOnlyManagerAllowed()": [ + { + "details": "Only A manager can call the function" + } + ], + "CCGOnlySameSourceAllowed(bytes32)": [ + { + "details": "Only the same source of the requestId is allowed to call the function" + } + ], + "CCGRequestAlreadyFulfilled(bytes32)": [ + { + "details": "Can't fulfill a request that has already been fulfilled" + } + ], + "CCGRequestNameEmpty()": [ + { + "details": "Can't register a request with an empty name" + } + ], + "CCGRequestNotRegistered(uint64)": [ + { + "details": "Only a registered subscriptionId is allowed to call the function" + } + ] + }, + "events": { + "RoleAdminChanged(bytes32,bytes32,bytes32)": { + "details": "Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this." + }, + "RoleGranted(bytes32,address,address)": { + "details": "Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}." + }, + "RoleRevoked(bytes32,address,address)": { + "details": "Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)" + } + }, + "kind": "dev", + "methods": { + "donId()": { + "details": "Get the DON ID", + "returns": { + "_0": "DON ID" + } + }, + "getResponse(bytes32,bool)": { + "details": "Get the response data", + "params": { + "requestId": "The request ID, returned by sendRequest()" + }, + "returns": { + "response": "CCGResponse" + } + }, + "getRoleAdmin(bytes32)": { + "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." + }, + "grantRole(bytes32,address)": { + "details": "Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event." + }, + "handleOracleFulfillment(bytes32,bytes,bytes)": { + "details": "Either response or error parameter will be set, but never both.", + "params": { + "err": "Aggregated error either from the request's source code or from the execution pipeline.", + "requestId": "The requestId returned by FunctionsClient.sendRequest().", + "response": "Aggregated response from the request's source code." + } + }, + "hasRole(bytes32,address)": { + "details": "Returns `true` if `account` has been granted `role`." + }, + "renounceRole(bytes32,address)": { + "details": "Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `callerConfirmation`. May emit a {RoleRevoked} event." + }, + "revokeRole(bytes32,address)": { + "details": "Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event." + }, + "sendRequest(uint64,string[],bytes[],bytes)": { + "params": { + "args": "String arguments passed into the source code and accessible via the global variable `args`", + "bytesArgs": "Bytes arguments passed into the source code and accessible via the global variable `bytesArgs` as hex strings", + "encryptedSecretsReference": "Reference pointing to encrypted secrets", + "subscriptionId": "Subscription ID used to pay for request (FunctionsConsumer contract address must first be added to the subscription)" + } + }, + "setDonId(bytes32)": { + "details": "Set the DON ID", + "params": { + "newDonId": "New DON ID" + } + }, + "supportsInterface(bytes4)": { + "details": "See {IERC165-supportsInterface}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "handleOracleFulfillment(bytes32,bytes,bytes)": { + "notice": "Chainlink Functions response handler called by the Functions Router during fullilment from the designated transmitter node in an OCR round." + }, + "sendRequest(uint64,string[],bytes[],bytes)": { + "notice": "Triggers an on-demand Functions request using remote encrypted secrets" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 2212, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "_roles", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_struct(RoleData)2207_storage)" + }, + { + "astId": 2663, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "_donId", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + }, + { + "astId": 2668, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "_requests", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_uint64,t_struct(CCGRequest)3246_storage)" + }, + { + "astId": 2673, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "unprocessed_responses", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_bytes32,t_struct(CCGResponse)3312_storage)" + }, + { + "astId": 2676, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "subscriptions", + "offset": 0, + "slot": "4", + "type": "t_array(t_uint64)dyn_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes_storage)dyn_storage": { + "base": "t_bytes_storage", + "encoding": "dynamic_array", + "label": "bytes[]", + "numberOfBytes": "32" + }, + "t_array(t_string_storage)dyn_storage": { + "base": "t_string_storage", + "encoding": "dynamic_array", + "label": "string[]", + "numberOfBytes": "32" + }, + "t_array(t_uint64)dyn_storage": { + "base": "t_uint64", + "encoding": "dynamic_array", + "label": "uint64[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_enum(CCGResponseState)3300": { + "encoding": "inplace", + "label": "enum ICCGatewayClient.CCGResponseState", + "numberOfBytes": "1" + }, + "t_enum(CodeLanguage)286": { + "encoding": "inplace", + "label": "enum FunctionsRequest.CodeLanguage", + "numberOfBytes": "1" + }, + "t_enum(Location)284": { + "encoding": "inplace", + "label": "enum FunctionsRequest.Location", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_bytes32,t_struct(CCGResponse)3312_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct ICCGatewayClient.CCGResponse)", + "numberOfBytes": "32", + "value": "t_struct(CCGResponse)3312_storage" + }, + "t_mapping(t_bytes32,t_struct(RoleData)2207_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct AccessControl.RoleData)", + "numberOfBytes": "32", + "value": "t_struct(RoleData)2207_storage" + }, + "t_mapping(t_uint64,t_struct(CCGRequest)3246_storage)": { + "encoding": "mapping", + "key": "t_uint64", + "label": "mapping(uint64 => struct ICCGateway.CCGRequest)", + "numberOfBytes": "32", + "value": "t_struct(CCGRequest)3246_storage" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(CCGRequest)3246_storage": { + "encoding": "inplace", + "label": "struct ICCGateway.CCGRequest", + "members": [ + { + "astId": 3240, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "name", + "offset": 0, + "slot": "0", + "type": "t_string_storage" + }, + { + "astId": 3242, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "callbackGasLimit", + "offset": 0, + "slot": "1", + "type": "t_uint32" + }, + { + "astId": 3245, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "config", + "offset": 0, + "slot": "2", + "type": "t_struct(Request)306_storage" + } + ], + "numberOfBytes": "224" + }, + "t_struct(CCGResponse)3312_storage": { + "encoding": "inplace", + "label": "struct ICCGatewayClient.CCGResponse", + "members": [ + { + "astId": 3302, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "subscriptionId", + "offset": 0, + "slot": "0", + "type": "t_uint64" + }, + { + "astId": 3304, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "source", + "offset": 8, + "slot": "0", + "type": "t_address" + }, + { + "astId": 3307, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "state", + "offset": 28, + "slot": "0", + "type": "t_enum(CCGResponseState)3300" + }, + { + "astId": 3309, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "data", + "offset": 0, + "slot": "1", + "type": "t_bytes_storage" + }, + { + "astId": 3311, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "error", + "offset": 0, + "slot": "2", + "type": "t_bytes_storage" + } + ], + "numberOfBytes": "96" + }, + "t_struct(Request)306_storage": { + "encoding": "inplace", + "label": "struct FunctionsRequest.Request", + "members": [ + { + "astId": 289, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "codeLocation", + "offset": 0, + "slot": "0", + "type": "t_enum(Location)284" + }, + { + "astId": 292, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "secretsLocation", + "offset": 1, + "slot": "0", + "type": "t_enum(Location)284" + }, + { + "astId": 295, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "language", + "offset": 2, + "slot": "0", + "type": "t_enum(CodeLanguage)286" + }, + { + "astId": 297, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "source", + "offset": 0, + "slot": "1", + "type": "t_string_storage" + }, + { + "astId": 299, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "encryptedSecretsReference", + "offset": 0, + "slot": "2", + "type": "t_bytes_storage" + }, + { + "astId": 302, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "args", + "offset": 0, + "slot": "3", + "type": "t_array(t_string_storage)dyn_storage" + }, + { + "astId": 305, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "bytesArgs", + "offset": 0, + "slot": "4", + "type": "t_array(t_bytes_storage)dyn_storage" + } + ], + "numberOfBytes": "160" + }, + "t_struct(RoleData)2207_storage": { + "encoding": "inplace", + "label": "struct AccessControl.RoleData", + "members": [ + { + "astId": 2204, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "hasRole", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 2206, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "adminRole", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + } + ], + "numberOfBytes": "64" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint64": { + "encoding": "inplace", + "label": "uint64", + "numberOfBytes": "8" + } + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/polygonAmoy/CCNotificationClient.json b/packages/hardhat/deployments/polygonAmoy/CCNotificationClient.json new file mode 100644 index 0000000..678e4bb --- /dev/null +++ b/packages/hardhat/deployments/polygonAmoy/CCNotificationClient.json @@ -0,0 +1,231 @@ +{ + "address": "0xC227503b9D94135D4E9d45AB938E5591C6F9087c", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "gatewayAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "error", + "type": "string" + } + ], + "name": "ErrorReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "response", + "type": "string" + } + ], + "name": "ResponseReceived", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + } + ], + "name": "callback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "encryptedSecretsReference", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "args", + "type": "string[]" + }, + { + "internalType": "bytes[]", + "name": "bytesArgs", + "type": "bytes[]" + } + ], + "name": "request", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "subscriptionId", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_encryptedSecretsReference", + "type": "bytes" + } + ], + "name": "updateEncryptedSecretsReference", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "_subscriptionId", + "type": "uint64" + } + ], + "name": "updateSubscriptionId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x9148cc86d39ad56fdf2232260ee82cd8a1e0cb5fc9e7aa24990adabf6e9a71b8", + "receipt": { + "to": null, + "from": "0xD10F43A0aa00D244DAcFBE3C49b9B918B717Ff2c", + "contractAddress": "0xC227503b9D94135D4E9d45AB938E5591C6F9087c", + "transactionIndex": 0, + "gasUsed": "686011", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100080000000000000000000000000000000008000000000000000000000080800000000000020000000000000000000000000040000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000004000000000000000000001000000000000000000000080000000100000000000000000000000000000000000000000000000000000000000000000000000100000", + "blockHash": "0x3ee80a68921e8ad7ba16d4ff744095e66cbfaca1fe1294e3cbc5431f2462af3f", + "transactionHash": "0x9148cc86d39ad56fdf2232260ee82cd8a1e0cb5fc9e7aa24990adabf6e9a71b8", + "logs": [ + { + "transactionIndex": 0, + "blockNumber": 7769750, + "transactionHash": "0x9148cc86d39ad56fdf2232260ee82cd8a1e0cb5fc9e7aa24990adabf6e9a71b8", + "address": "0x0000000000000000000000000000000000001010", + "topics": [ + "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", + "0x0000000000000000000000000000000000000000000000000000000000001010", + "0x000000000000000000000000d10f43a0aa00d244dacfbe3c49b9b918b717ff2c", + "0x0000000000000000000000006dc2dd54f24979ec26212794c71afefed722280c" + ], + "data": "0x000000000000000000000000000000000000000000000000002bde9ee2caf80b0000000000000000000000000000000000000000000000000740bd564bcfb2d30000000000000000000000000000000000000000000001a7d041ea492529fe2b0000000000000000000000000000000000000000000000000714deb76904bac80000000000000000000000000000000000000000000001a7d06dc8e807f4f636", + "logIndex": 0, + "blockHash": "0x3ee80a68921e8ad7ba16d4ff744095e66cbfaca1fe1294e3cbc5431f2462af3f" + } + ], + "blockNumber": 7769750, + "cumulativeGasUsed": "686011", + "status": 1, + "byzantium": true + }, + "args": [ + "0x26f0EB234DE737fE9dEf0fF1F3206848e55799D8" + ], + "numDeployments": 1, + "solcInputHash": "da2f6e6d8541f69733b0b28912d4a325", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"gatewayAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"error\",\"type\":\"string\"}],\"name\":\"ErrorReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"response\",\"type\":\"string\"}],\"name\":\"ResponseReceived\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"callback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"encryptedSecretsReference\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"args\",\"type\":\"string[]\"},{\"internalType\":\"bytes[]\",\"name\":\"bytesArgs\",\"type\":\"bytes[]\"}],\"name\":\"request\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"subscriptionId\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_encryptedSecretsReference\",\"type\":\"bytes\"}],\"name\":\"updateEncryptedSecretsReference\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_subscriptionId\",\"type\":\"uint64\"}],\"name\":\"updateSubscriptionId\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/CCNotificationClient.sol\":\"CCNotificationClient\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\n/// @title Chainlink Functions client interface.\\ninterface IFunctionsClient {\\n /// @notice Chainlink Functions response handler called by the Functions Router\\n /// during fullilment from the designated transmitter node in an OCR round.\\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\\n /// @param response Aggregated response from the request's source code.\\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\\n /// @dev Either response or error parameter will be set, but never both.\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\\n}\\n\",\"keccak256\":\"0x6117b82e7c4eec44ce557b0fc8bc1ac5f49e5d160ac6d4485452d6aafdd762ff\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {FunctionsResponse} from \\\"../libraries/FunctionsResponse.sol\\\";\\n\\n/// @title Chainlink Functions Router interface.\\ninterface IFunctionsRouter {\\n /// @notice The identifier of the route to retrieve the address of the access control contract\\n /// The access control contract controls which accounts can manage subscriptions\\n /// @return id - bytes32 id that can be passed to the \\\"getContractById\\\" of the Router\\n function getAllowListId() external view returns (bytes32);\\n\\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\\n /// The access control contract controls which accounts can manage subscriptions\\n function setAllowListId(bytes32 allowListId) external;\\n\\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\\n /// @return adminFee\\n function getAdminFee() external view returns (uint72 adminFee);\\n\\n /// @notice Sends a request using the provided subscriptionId\\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\\n /// a client can make requests from different contracts referencing the same subscription\\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\\n /// @param dataVersion - Gas limit for the fulfillment callback\\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\\n /// @param donId - An identifier used to determine which route to send the request along\\n /// @return requestId - A unique request identifier\\n function sendRequest(\\n uint64 subscriptionId,\\n bytes calldata data,\\n uint16 dataVersion,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) external returns (bytes32);\\n\\n /// @notice Sends a request to the proposed contracts\\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\\n /// a client can make requests from different contracts referencing the same subscription\\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\\n /// @param dataVersion - Gas limit for the fulfillment callback\\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\\n /// @param donId - An identifier used to determine which route to send the request along\\n /// @return requestId - A unique request identifier\\n function sendRequestToProposed(\\n uint64 subscriptionId,\\n bytes calldata data,\\n uint16 dataVersion,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) external returns (bytes32);\\n\\n /// @notice Fulfill the request by:\\n /// - calling back the data that the Oracle returned to the client contract\\n /// - pay the DON for processing the request\\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\\n /// @param response response data from DON consensus\\n /// @param err error from DON consensus\\n /// @param juelsPerGas - current rate of juels/gas\\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\\n /// @param transmitter - The Node that transmitted the OCR report\\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\\n /// @return fulfillResult -\\n /// @return callbackGasCostJuels -\\n function fulfill(\\n bytes memory response,\\n bytes memory err,\\n uint96 juelsPerGas,\\n uint96 costWithoutFulfillment,\\n address transmitter,\\n FunctionsResponse.Commitment memory commitment\\n ) external returns (FunctionsResponse.FulfillResult, uint96);\\n\\n /// @notice Validate requested gas limit is below the subscription max.\\n /// @param subscriptionId subscription ID\\n /// @param callbackGasLimit desired callback gas limit\\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\\n\\n /// @notice Get the current contract given an ID\\n /// @param id A bytes32 identifier for the route\\n /// @return contract The current contract address\\n function getContractById(bytes32 id) external view returns (address);\\n\\n /// @notice Get the proposed next contract given an ID\\n /// @param id A bytes32 identifier for the route\\n /// @return contract The current or proposed contract address\\n function getProposedContractById(bytes32 id) external view returns (address);\\n\\n /// @notice Return the latest proprosal set\\n /// @return ids The identifiers of the contracts to update\\n /// @return to The addresses of the contracts that will be updated to\\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\\n\\n /// @notice Proposes one or more updates to the contract routes\\n /// @dev Only callable by owner\\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\\n\\n /// @notice Updates the current contract routes to the proposed contracts\\n /// @dev Only callable by owner\\n function updateContracts() external;\\n\\n /// @dev Puts the system into an emergency stopped state.\\n /// @dev Only callable by owner\\n function pause() external;\\n\\n /// @dev Takes the system out of an emergency stopped state.\\n /// @dev Only callable by owner\\n function unpause() external;\\n}\\n\",\"keccak256\":\"0x44db41e8ff90c2828ca0ada125abc4b411921a86514a4a047fd9fd43ba9d7e08\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {CBOR} from \\\"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\\\";\\n\\n/// @title Library for encoding the input data of a Functions request into CBOR\\nlibrary FunctionsRequest {\\n using CBOR for CBOR.CBORBuffer;\\n\\n uint16 public constant REQUEST_DATA_VERSION = 1;\\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\\n\\n enum Location {\\n Inline, // Provided within the Request\\n Remote, // Hosted through remote location that can be accessed through a provided URL\\n DONHosted // Hosted on the DON's storage\\n }\\n\\n enum CodeLanguage {\\n JavaScript\\n // In future version we may add other languages\\n }\\n\\n struct Request {\\n Location codeLocation; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The location of the source code that will be executed on each node in the DON\\n Location secretsLocation; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The location of secrets that will be passed into the source code. *Only Remote secrets are supported\\n CodeLanguage language; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The coding language that the source code is written in\\n string source; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\\n bytes encryptedSecretsReference; // \\u2550\\u2550\\u2578 Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\\n string[] args; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 String arguments that will be passed into the source code\\n bytes[] bytesArgs; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Bytes arguments that will be passed into the source code\\n }\\n\\n error EmptySource();\\n error EmptySecrets();\\n error EmptyArgs();\\n error NoInlineSecrets();\\n\\n /// @notice Encodes a Request to CBOR encoded bytes\\n /// @param self The request to encode\\n /// @return CBOR encoded bytes\\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\\n\\n buffer.writeString(\\\"codeLocation\\\");\\n buffer.writeUInt256(uint256(self.codeLocation));\\n\\n buffer.writeString(\\\"language\\\");\\n buffer.writeUInt256(uint256(self.language));\\n\\n buffer.writeString(\\\"source\\\");\\n buffer.writeString(self.source);\\n\\n if (self.args.length > 0) {\\n buffer.writeString(\\\"args\\\");\\n buffer.startArray();\\n for (uint256 i = 0; i < self.args.length; ++i) {\\n buffer.writeString(self.args[i]);\\n }\\n buffer.endSequence();\\n }\\n\\n if (self.encryptedSecretsReference.length > 0) {\\n if (self.secretsLocation == Location.Inline) {\\n revert NoInlineSecrets();\\n }\\n buffer.writeString(\\\"secretsLocation\\\");\\n buffer.writeUInt256(uint256(self.secretsLocation));\\n buffer.writeString(\\\"secrets\\\");\\n buffer.writeBytes(self.encryptedSecretsReference);\\n }\\n\\n if (self.bytesArgs.length > 0) {\\n buffer.writeString(\\\"bytesArgs\\\");\\n buffer.startArray();\\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\\n buffer.writeBytes(self.bytesArgs[i]);\\n }\\n buffer.endSequence();\\n }\\n\\n return buffer.buf.buf;\\n }\\n\\n /// @notice Initializes a Chainlink Functions Request\\n /// @dev Sets the codeLocation and code on the request\\n /// @param self The uninitialized request\\n /// @param codeLocation The user provided source code location\\n /// @param language The programming language of the user code\\n /// @param source The user provided source code or a url\\n function initializeRequest(\\n Request memory self,\\n Location codeLocation,\\n CodeLanguage language,\\n string memory source\\n ) internal pure {\\n if (bytes(source).length == 0) revert EmptySource();\\n\\n self.codeLocation = codeLocation;\\n self.language = language;\\n self.source = source;\\n }\\n\\n /// @notice Initializes a Chainlink Functions Request\\n /// @dev Simplified version of initializeRequest for PoC\\n /// @param self The uninitialized request\\n /// @param javaScriptSource The user provided JS code (must not be empty)\\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\\n }\\n\\n /// @notice Adds Remote user encrypted secrets to a Request\\n /// @param self The initialized request\\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\\n\\n self.secretsLocation = Location.Remote;\\n self.encryptedSecretsReference = encryptedSecretsReference;\\n }\\n\\n /// @notice Adds DON-hosted secrets reference to a Request\\n /// @param self The initialized request\\n /// @param slotID Slot ID of the user's secrets hosted on DON\\n /// @param version User data version (for the slotID)\\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\\n\\n buffer.writeString(\\\"slotID\\\");\\n buffer.writeUInt64(slotID);\\n buffer.writeString(\\\"version\\\");\\n buffer.writeUInt64(version);\\n\\n self.secretsLocation = Location.DONHosted;\\n self.encryptedSecretsReference = buffer.buf.buf;\\n }\\n\\n /// @notice Sets args for the user run function\\n /// @param self The initialized request\\n /// @param args The array of string args (must not be empty)\\n function setArgs(Request memory self, string[] memory args) internal pure {\\n if (args.length == 0) revert EmptyArgs();\\n\\n self.args = args;\\n }\\n\\n /// @notice Sets bytes args for the user run function\\n /// @param self The initialized request\\n /// @param args The array of bytes args (must not be empty)\\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\\n if (args.length == 0) revert EmptyArgs();\\n\\n self.bytesArgs = args;\\n }\\n}\\n\",\"keccak256\":\"0xed75be0eaba358d468f1fe18adc377d5044f57eff0070081f884a1f212d0adc2\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\n/// @title Library of types that are used for fulfillment of a Functions request\\nlibrary FunctionsResponse {\\n // Used to send request information from the Router to the Coordinator\\n struct RequestMeta {\\n bytes data; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\\n bytes32 flags; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Per-subscription flags\\n address requestingContract; // \\u2550\\u2550\\u2557 The client contract that is sending the request\\n uint96 availableBalance; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u255d Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\\n uint72 adminFee; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\\n uint64 subscriptionId; // \\u2551 Identifier of the billing subscription that will be charged for the request\\n uint64 initiatedRequests; // \\u2551 The number of requests that have been started\\n uint32 callbackGasLimit; // \\u2551 The amount of gas that the callback to the consuming contract will be given\\n uint16 dataVersion; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The version of the structure of the CBOR encoded request data\\n uint64 completedRequests; // \\u2550\\u2550\\u2550\\u2550\\u2557 The number of requests that have successfully completed or timed out\\n address subscriptionOwner; // \\u2550\\u2550\\u2550\\u255d The owner of the billing subscription\\n }\\n\\n enum FulfillResult {\\n FULFILLED, // 0\\n USER_CALLBACK_ERROR, // 1\\n INVALID_REQUEST_ID, // 2\\n COST_EXCEEDS_COMMITMENT, // 3\\n INSUFFICIENT_GAS_PROVIDED, // 4\\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\\n INVALID_COMMITMENT // 6\\n }\\n\\n struct Commitment {\\n bytes32 requestId; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 A unique identifier for a Chainlink Functions request\\n address coordinator; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 The Coordinator contract that manages the DON that is servicing a request\\n uint96 estimatedTotalCostJuels; // \\u2550\\u2550\\u2550\\u2550\\u255d The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\\n address client; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 The client contract that sent the request\\n uint64 subscriptionId; // \\u2551 Identifier of the billing subscription that will be charged for the request\\n uint32 callbackGasLimit; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The amount of gas that the callback to the consuming contract will be given\\n uint72 adminFee; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\\n uint72 donFee; // \\u2551 Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\\n uint40 gasOverheadBeforeCallback; // \\u2551 Represents the average gas execution cost before the fulfillment callback.\\n uint40 gasOverheadAfterCallback; // \\u2551 Represents the average gas execution cost after the fulfillment callback.\\n uint32 timeoutTimestamp; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The timestamp at which a request will be eligible to be timed out\\n }\\n}\\n\",\"keccak256\":\"0xc72eb037effef32146f7cd4086af00f44f28c8649d891e5e404fec5fda7e802b\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {IFunctionsRouter} from \\\"../v1_0_0/interfaces/IFunctionsRouter.sol\\\";\\nimport {IFunctionsClient} from \\\"../v1_0_0/interfaces/IFunctionsClient.sol\\\";\\n\\nimport {FunctionsRequest} from \\\"../v1_0_0/libraries/FunctionsRequest.sol\\\";\\n\\n/// @title The Chainlink Functions client contract\\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\\nabstract contract FunctionsClient is IFunctionsClient {\\n using FunctionsRequest for FunctionsRequest.Request;\\n\\n IFunctionsRouter internal immutable i_functionsRouter;\\n\\n event RequestSent(bytes32 indexed id);\\n event RequestFulfilled(bytes32 indexed id);\\n\\n error OnlyRouterCanFulfill();\\n\\n constructor(address router) {\\n i_functionsRouter = IFunctionsRouter(router);\\n }\\n\\n /// @notice Sends a Chainlink Functions request\\n /// @param data The CBOR encoded bytes data for a Functions request\\n /// @param subscriptionId The subscription ID that will be charged to service the request\\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\\n /// @return requestId The generated request ID for this request\\n function _sendRequest(\\n bytes memory data,\\n uint64 subscriptionId,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) internal returns (bytes32) {\\n bytes32 requestId = i_functionsRouter.sendRequest(\\n subscriptionId,\\n data,\\n FunctionsRequest.REQUEST_DATA_VERSION,\\n callbackGasLimit,\\n donId\\n );\\n emit RequestSent(requestId);\\n return requestId;\\n }\\n\\n /// @notice User defined function to handle a response from the DON\\n /// @param requestId The request ID, returned by sendRequest()\\n /// @param response Aggregated response from the execution of the user's source code\\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\\n /// @dev Either response or error parameter will be set, but never both\\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\\n\\n /// @inheritdoc IFunctionsClient\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\\n if (msg.sender != address(i_functionsRouter)) {\\n revert OnlyRouterCanFulfill();\\n }\\n _fulfillRequest(requestId, response, err);\\n emit RequestFulfilled(requestId);\\n }\\n}\\n\",\"keccak256\":\"0xdc40f1e9dea8a572d43d310afa68e978c35218d16097b9cfd9d1b6137df3cd0a\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-2-Clause\\npragma solidity ^0.8.4;\\n\\n/**\\n* @dev A library for working with mutable byte buffers in Solidity.\\n*\\n* Byte buffers are mutable and expandable, and provide a variety of primitives\\n* for appending to them. At any time you can fetch a bytes object containing the\\n* current contents of the buffer. The bytes object should not be stored between\\n* operations, as it may change due to resizing of the buffer.\\n*/\\nlibrary Buffer {\\n /**\\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\\n * a capacity. The capacity may be longer than the current value, in\\n * which case it can be extended without the need to allocate more memory.\\n */\\n struct buffer {\\n bytes buf;\\n uint capacity;\\n }\\n\\n /**\\n * @dev Initializes a buffer with an initial capacity.\\n * @param buf The buffer to initialize.\\n * @param capacity The number of bytes of space to allocate the buffer.\\n * @return The buffer, for chaining.\\n */\\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\\n if (capacity % 32 != 0) {\\n capacity += 32 - (capacity % 32);\\n }\\n // Allocate space for the buffer data\\n buf.capacity = capacity;\\n assembly {\\n let ptr := mload(0x40)\\n mstore(buf, ptr)\\n mstore(ptr, 0)\\n let fpm := add(32, add(ptr, capacity))\\n if lt(fpm, ptr) {\\n revert(0, 0)\\n }\\n mstore(0x40, fpm)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Initializes a new buffer from an existing bytes object.\\n * Changes to the buffer may mutate the original value.\\n * @param b The bytes object to initialize the buffer with.\\n * @return A new buffer.\\n */\\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\\n buffer memory buf;\\n buf.buf = b;\\n buf.capacity = b.length;\\n return buf;\\n }\\n\\n function resize(buffer memory buf, uint capacity) private pure {\\n bytes memory oldbuf = buf.buf;\\n init(buf, capacity);\\n append(buf, oldbuf);\\n }\\n\\n /**\\n * @dev Sets buffer length to 0.\\n * @param buf The buffer to truncate.\\n * @return The original buffer, for chaining..\\n */\\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\\n assembly {\\n let bufptr := mload(buf)\\n mstore(bufptr, 0)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to copy.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\\n require(len <= data.length);\\n\\n uint off = buf.buf.length;\\n uint newCapacity = off + len;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint dest;\\n uint src;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Length of existing buffer data\\n let buflen := mload(bufptr)\\n // Start address = buffer address + offset + sizeof(buffer length)\\n dest := add(add(bufptr, 32), off)\\n // Update buffer length if we're extending it\\n if gt(newCapacity, buflen) {\\n mstore(bufptr, newCapacity)\\n }\\n src := add(data, 32)\\n }\\n\\n // Copy word-length chunks while possible\\n for (; len >= 32; len -= 32) {\\n assembly {\\n mstore(dest, mload(src))\\n }\\n dest += 32;\\n src += 32;\\n }\\n\\n // Copy remaining bytes\\n unchecked {\\n uint mask = (256 ** (32 - len)) - 1;\\n assembly {\\n let srcpart := and(mload(src), not(mask))\\n let destpart := and(mload(dest), mask)\\n mstore(dest, or(destpart, srcpart))\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\\n return append(buf, data, data.length);\\n }\\n\\n /**\\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\\n * capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint offPlusOne = off + 1;\\n if (off >= buf.capacity) {\\n resize(buf, offPlusOne * 2);\\n }\\n\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + off\\n let dest := add(add(bufptr, off), 32)\\n mstore8(dest, data)\\n // Update buffer length if we extended it\\n if gt(offPlusOne, mload(bufptr)) {\\n mstore(bufptr, offPlusOne)\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (left-aligned).\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n unchecked {\\n uint mask = (256 ** len) - 1;\\n // Right-align data\\n data = data >> (8 * (32 - len));\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chhaining.\\n */\\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\\n return append(buf, bytes32(data), 20);\\n }\\n\\n /**\\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\\n return append(buf, data, 32);\\n }\\n\\n /**\\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (right-aligned).\\n * @return The original buffer.\\n */\\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint mask = (256 ** len) - 1;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n return buf;\\n }\\n}\",\"keccak256\":\"0x0d86b367813922094e02594a406ba89f5e97d3d74ec2ce3c4032566840e302b0\",\"license\":\"BSD-2-Clause\"},\"@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.4;\\n\\nimport \\\"../../@ensdomains/buffer/v0.1.0/Buffer.sol\\\";\\n\\n/**\\n* @dev A library for populating CBOR encoded payload in Solidity.\\n*\\n* https://datatracker.ietf.org/doc/html/rfc7049\\n*\\n* The library offers various write* and start* methods to encode values of different types.\\n* The resulted buffer can be obtained with data() method.\\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\\n* in an invalid CBOR if start/write/end flow is violated.\\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\\n* except for nested start/end pairs.\\n*/\\n\\nlibrary CBOR {\\n using Buffer for Buffer.buffer;\\n\\n struct CBORBuffer {\\n Buffer.buffer buf;\\n uint256 depth;\\n }\\n\\n uint8 private constant MAJOR_TYPE_INT = 0;\\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\\n uint8 private constant MAJOR_TYPE_BYTES = 2;\\n uint8 private constant MAJOR_TYPE_STRING = 3;\\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\\n uint8 private constant MAJOR_TYPE_MAP = 5;\\n uint8 private constant MAJOR_TYPE_TAG = 6;\\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\\n\\n uint8 private constant TAG_TYPE_BIGNUM = 2;\\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\\n\\n uint8 private constant CBOR_FALSE = 20;\\n uint8 private constant CBOR_TRUE = 21;\\n uint8 private constant CBOR_NULL = 22;\\n uint8 private constant CBOR_UNDEFINED = 23;\\n\\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\\n Buffer.init(cbor.buf, capacity);\\n cbor.depth = 0;\\n return cbor;\\n }\\n\\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\\n require(buf.depth == 0, \\\"Invalid CBOR\\\");\\n return buf.buf.buf;\\n }\\n\\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\\n writeBytes(buf, abi.encode(value));\\n }\\n\\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\\n if (value < 0) {\\n buf.buf.appendUint8(\\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\\n );\\n writeBytes(buf, abi.encode(uint256(-1 - value)));\\n } else {\\n writeUInt256(buf, uint256(value));\\n }\\n }\\n\\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\\n }\\n\\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\\n if(value >= 0) {\\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\\n } else{\\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\\n }\\n }\\n\\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\\n buf.buf.append(value);\\n }\\n\\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\\n buf.buf.append(bytes(value));\\n }\\n\\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\\n }\\n\\n function writeNull(CBORBuffer memory buf) internal pure {\\n writeContentFree(buf, CBOR_NULL);\\n }\\n\\n function writeUndefined(CBORBuffer memory buf) internal pure {\\n writeContentFree(buf, CBOR_UNDEFINED);\\n }\\n\\n function startArray(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\\n buf.depth += 1;\\n }\\n\\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\\n }\\n\\n function startMap(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\\n buf.depth += 1;\\n }\\n\\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\\n }\\n\\n function endSequence(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\\n buf.depth -= 1;\\n }\\n\\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\\n writeString(buf, key);\\n writeString(buf, value);\\n }\\n\\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\\n writeString(buf, key);\\n writeBytes(buf, value);\\n }\\n\\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\\n writeString(buf, key);\\n writeUInt256(buf, value);\\n }\\n\\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\\n writeString(buf, key);\\n writeInt256(buf, value);\\n }\\n\\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\\n writeString(buf, key);\\n writeUInt64(buf, value);\\n }\\n\\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\\n writeString(buf, key);\\n writeInt64(buf, value);\\n }\\n\\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\\n writeString(buf, key);\\n writeBool(buf, value);\\n }\\n\\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n writeNull(buf);\\n }\\n\\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n writeUndefined(buf);\\n }\\n\\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n startMap(buf);\\n }\\n\\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n startArray(buf);\\n }\\n\\n function writeFixedNumeric(\\n CBORBuffer memory buf,\\n uint8 major,\\n uint64 value\\n ) private pure {\\n if (value <= 23) {\\n buf.buf.appendUint8(uint8((major << 5) | value));\\n } else if (value <= 0xFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 24));\\n buf.buf.appendInt(value, 1);\\n } else if (value <= 0xFFFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 25));\\n buf.buf.appendInt(value, 2);\\n } else if (value <= 0xFFFFFFFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 26));\\n buf.buf.appendInt(value, 4);\\n } else {\\n buf.buf.appendUint8(uint8((major << 5) | 27));\\n buf.buf.appendInt(value, 8);\\n }\\n }\\n\\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\\n private\\n pure\\n {\\n buf.buf.appendUint8(uint8((major << 5) | 31));\\n }\\n\\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\\n private\\n pure\\n {\\n writeFixedNumeric(buf, major, length);\\n }\\n\\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\\n }\\n}\",\"keccak256\":\"0xdecf04203502670ac72ba466c75e4f87f4419907365005f0d73e7d07ee3e5715\",\"license\":\"MIT\"},\"contracts/CCExampleClient.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {ICCGatewayClient} from \\\"./interfaces/ICCGatewayClient.sol\\\";\\nimport {ICCGateway} from \\\"./interfaces/ICCGateway.sol\\\";\\n\\ncontract CCExampleClient is ICCGatewayClient {\\n ICCGateway private immutable gateway;\\n\\n uint64 public subscriptionId = 0;\\n bytes public encryptedSecretsReference = \\\"\\\";\\n\\n event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response);\\n event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error);\\n\\n constructor(address gatewayAddress) {\\n gateway = ICCGateway(gatewayAddress);\\n }\\n\\n function updateSubscriptionId(uint64 _subscriptionId) external {\\n subscriptionId = _subscriptionId;\\n }\\n\\n function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external {\\n encryptedSecretsReference = _encryptedSecretsReference;\\n }\\n\\n function request(string[] calldata args, bytes[] calldata bytesArgs) external {\\n require(subscriptionId != 0, \\\"Subscription ID not set\\\");\\n\\n gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference);\\n }\\n\\n function callback(bytes32 requestId) external override {\\n ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true);\\n\\n if (response.state == ICCGatewayClient.CCGResponseState.Success) {\\n emit ResponseReceived(response.subscriptionId, requestId, string(response.data));\\n } else {\\n emit ErrorReceived(response.subscriptionId, requestId, string(response.error));\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf905275976390214962167d4896d9c0eab670fce2b5f5cfd213b1ae2d776347a\",\"license\":\"UNLICENSED\"},\"contracts/CCNotificationClient.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {CCExampleClient} from \\\"./CCExampleClient.sol\\\";\\n\\ncontract CCNotificationClient is CCExampleClient {\\n constructor(address gatewayAddress) CCExampleClient(gatewayAddress) {}\\n}\\n\",\"keccak256\":\"0xad7961e1ea78babecd98162342bf18b8ae44e34f6ea1d0f32533666659f68ef5\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/ICCGateway.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\\nimport {FunctionsRequest} from \\\"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\\\";\\n\\ninterface ICCGateway {\\n struct CCGRequest {\\n string name;\\n uint32 callbackGasLimit;\\n FunctionsRequest.Request config;\\n }\\n\\n /**\\n * @dev Can't register a request with an empty name\\n */\\n error CCGRequestNameEmpty();\\n\\n /**\\n * @dev Only the same source of the requestId is allowed to call the function\\n */\\n error CCGOnlySameSourceAllowed(bytes32 requestId);\\n\\n /**\\n * @dev Only a registered subscriptionId is allowed to call the function\\n */\\n error CCGRequestNotRegistered(uint64 subscriptionId);\\n\\n /**\\n * @dev Can't fulfill a request that has already been fulfilled\\n */\\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\\n\\n /**\\n * @dev Only A manager can call the function\\n */\\n error CCGOnlyManagerAllowed();\\n\\n /**\\n * @dev Send a request to the Functions DON\\n */\\n function sendRequest(\\n uint64 subscriptionId,\\n string[] calldata args,\\n bytes[] calldata bytesArgs,\\n bytes calldata encryptedSecretsReference\\n ) external returns (bytes32 requestId);\\n\\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\\n}\\n\",\"keccak256\":\"0xbc7d92f8db240767c8636e8df9b818cc1f5abfde22b8c49eee50f418fb0dbea5\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/ICCGatewayClient.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\ninterface ICCGatewayClient {\\n enum CCGResponseState {Sent, Success, Error}\\n\\n struct CCGResponse {\\n uint64 subscriptionId;\\n address source;\\n CCGResponseState state;\\n bytes data;\\n bytes error;\\n }\\n\\n function callback(bytes32 requestId) external;\\n}\\n\",\"keccak256\":\"0xb69320aa2152f374dec4cfc70b73f46e0db9774a1411d2acff1481ee3295f86a\",\"license\":\"UNLICENSED\"}},\"version\":1}", + "bytecode": "0x600080546001600160401b031916815560c060405260a090815260019062000028908262000110565b503480156200003657600080fd5b5060405162000d6a38038062000d6a8339810160408190526200005991620001dc565b6001600160a01b03166080526200020e565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200009657607f821691505b602082108103620000b757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200010b57600081815260208120601f850160051c81016020861015620000e65750805b601f850160051c820191505b818110156200010757828155600101620000f2565b5050505b505050565b81516001600160401b038111156200012c576200012c6200006b565b62000144816200013d845462000081565b84620000bd565b602080601f8311600181146200017c5760008415620001635750858301515b600019600386901b1c1916600185901b17855562000107565b600085815260208120601f198616915b82811015620001ad578886015182559484019460019091019084016200018c565b5085821015620001cc5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215620001ef57600080fd5b81516001600160a01b03811681146200020757600080fd5b9392505050565b608051610b39620002316000396000818161023101526102e30152610b396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806309c1ba2e1461006757806314b1dd1b146100975780634ce64f0e146100ca578063cdc634f1146100dd578063cfd58386146100f2578063df13994e14610105575b600080fd5b60005461007a906001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b6100c86100a5366004610415565b6000805467ffffffffffffffff19166001600160401b0392909216919091179055565b005b6100c86100d8366004610439565b610118565b6100e561012a565b60405161008e91906104fa565b6100c8610100366004610558565b6101b8565b6100c86101133660046105c3565b6102c3565b600161012582848361067a565b505050565b60018054610137906105f2565b80601f0160208091040260200160405190810160405280929190818152602001828054610163906105f2565b80156101b05780601f10610185576101008083540402835291602001916101b0565b820191906000526020600020905b81548152906001019060200180831161019357829003601f168201915b505050505081565b600080546001600160401b031690036102175760405162461bcd60e51b815260206004820152601760248201527f537562736372697074696f6e204944206e6f7420736574000000000000000000604482015260640160405180910390fd5b600054604051634b60ac1760e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916396c1582e91610279916001600160401b0316908890889088908890600190600401610824565b6020604051808303816000875af1158015610298573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bc919061090d565b5050505050565b6040516315b851d160e01b815260048101829052600160248201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906315b851d1906044016000604051808303816000875af1158015610334573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261035c91908101906109e9565b905060018160400151600281111561037657610376610abc565b036103c2577fa5522492de1ed169e1e5e76f6cb2ceb5f045ca7f7ea5da3137c573d996cc4b9f81600001518383606001516040516103b693929190610ad2565b60405180910390a15050565b7f331e0adccd60eab7ca94cf49c60a45549ce9dc1281139656a13bdf73774d179c81600001518383608001516040516103b693929190610ad2565b6001600160401b038116811461041257600080fd5b50565b60006020828403121561042757600080fd5b8135610432816103fd565b9392505050565b6000806020838503121561044c57600080fd5b82356001600160401b038082111561046357600080fd5b818501915085601f83011261047757600080fd5b81358181111561048657600080fd5b86602082850101111561049857600080fd5b60209290920196919550909350505050565b60005b838110156104c55781810151838201526020016104ad565b50506000910152565b600081518084526104e68160208601602086016104aa565b601f01601f19169290920160200192915050565b60208152600061043260208301846104ce565b60008083601f84011261051f57600080fd5b5081356001600160401b0381111561053657600080fd5b6020830191508360208260051b850101111561055157600080fd5b9250929050565b6000806000806040858703121561056e57600080fd5b84356001600160401b038082111561058557600080fd5b6105918883890161050d565b909650945060208701359150808211156105aa57600080fd5b506105b78782880161050d565b95989497509550505050565b6000602082840312156105d557600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061060657607f821691505b60208210810361062657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561012557600081815260208120601f850160051c810160208610156106535750805b601f850160051c820191505b818110156106725782815560010161065f565b505050505050565b6001600160401b03831115610691576106916105dc565b6106a58361069f83546105f2565b8361062c565b6000601f8411600181146106d957600085156106c15750838201355b600019600387901b1c1916600186901b1783556102bc565b600083815260209020601f19861690835b8281101561070a57868501358255602094850194600190920191016106ea565b50868210156107275760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000808335601e1984360301811261077957600080fd5b83016020810192503590506001600160401b0381111561079857600080fd5b80360382131561055157600080fd5b600081546107b4816105f2565b8085526020600183811680156107d157600181146107eb57610819565b60ff1985168884015283151560051b880183019550610819565b866000528260002060005b858110156108115781548a82018601529083019084016107f6565b890184019650505b505050505092915050565b6000608082016001600160401b038916835260206080818501528188835260a08501905060a08960051b86010192508960005b8a81101561089157868503609f19018352610872828d610762565b61087d878284610739565b965050509183019190830190600101610857565b5050508382036040850152858252808201600587901b830182018860005b898110156108e957858303601f190184526108ca828c610762565b6108d5858284610739565b9587019594505050908401906001016108af565b505085810360608701526108fd81886107a7565b9c9b505050505050505050505050565b60006020828403121561091f57600080fd5b5051919050565b60405160a081016001600160401b0381118282101715610948576109486105dc565b60405290565b80516003811061095d57600080fd5b919050565b600082601f83011261097357600080fd5b81516001600160401b038082111561098d5761098d6105dc565b604051601f8301601f19908116603f011681019082821181831017156109b5576109b56105dc565b816040528381528660208588010111156109ce57600080fd5b6109df8460208301602089016104aa565b9695505050505050565b6000602082840312156109fb57600080fd5b81516001600160401b0380821115610a1257600080fd5b9083019060a08286031215610a2657600080fd5b610a2e610926565b8251610a39816103fd565b815260208301516001600160a01b0381168114610a5557600080fd5b6020820152610a666040840161094e565b6040820152606083015182811115610a7d57600080fd5b610a8987828601610962565b606083015250608083015182811115610aa157600080fd5b610aad87828601610962565b60808301525095945050505050565b634e487b7160e01b600052602160045260246000fd5b6001600160401b0384168152826020820152606060408201526000610afa60608301846104ce565b9594505050505056fea26469706673582212205b5117b00ce65fae13c73e5fe55ef1d7583f0a364b1ac0a38e3f21e0d2c88f9a64736f6c63430008140033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100625760003560e01c806309c1ba2e1461006757806314b1dd1b146100975780634ce64f0e146100ca578063cdc634f1146100dd578063cfd58386146100f2578063df13994e14610105575b600080fd5b60005461007a906001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b6100c86100a5366004610415565b6000805467ffffffffffffffff19166001600160401b0392909216919091179055565b005b6100c86100d8366004610439565b610118565b6100e561012a565b60405161008e91906104fa565b6100c8610100366004610558565b6101b8565b6100c86101133660046105c3565b6102c3565b600161012582848361067a565b505050565b60018054610137906105f2565b80601f0160208091040260200160405190810160405280929190818152602001828054610163906105f2565b80156101b05780601f10610185576101008083540402835291602001916101b0565b820191906000526020600020905b81548152906001019060200180831161019357829003601f168201915b505050505081565b600080546001600160401b031690036102175760405162461bcd60e51b815260206004820152601760248201527f537562736372697074696f6e204944206e6f7420736574000000000000000000604482015260640160405180910390fd5b600054604051634b60ac1760e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916396c1582e91610279916001600160401b0316908890889088908890600190600401610824565b6020604051808303816000875af1158015610298573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bc919061090d565b5050505050565b6040516315b851d160e01b815260048101829052600160248201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906315b851d1906044016000604051808303816000875af1158015610334573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261035c91908101906109e9565b905060018160400151600281111561037657610376610abc565b036103c2577fa5522492de1ed169e1e5e76f6cb2ceb5f045ca7f7ea5da3137c573d996cc4b9f81600001518383606001516040516103b693929190610ad2565b60405180910390a15050565b7f331e0adccd60eab7ca94cf49c60a45549ce9dc1281139656a13bdf73774d179c81600001518383608001516040516103b693929190610ad2565b6001600160401b038116811461041257600080fd5b50565b60006020828403121561042757600080fd5b8135610432816103fd565b9392505050565b6000806020838503121561044c57600080fd5b82356001600160401b038082111561046357600080fd5b818501915085601f83011261047757600080fd5b81358181111561048657600080fd5b86602082850101111561049857600080fd5b60209290920196919550909350505050565b60005b838110156104c55781810151838201526020016104ad565b50506000910152565b600081518084526104e68160208601602086016104aa565b601f01601f19169290920160200192915050565b60208152600061043260208301846104ce565b60008083601f84011261051f57600080fd5b5081356001600160401b0381111561053657600080fd5b6020830191508360208260051b850101111561055157600080fd5b9250929050565b6000806000806040858703121561056e57600080fd5b84356001600160401b038082111561058557600080fd5b6105918883890161050d565b909650945060208701359150808211156105aa57600080fd5b506105b78782880161050d565b95989497509550505050565b6000602082840312156105d557600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061060657607f821691505b60208210810361062657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561012557600081815260208120601f850160051c810160208610156106535750805b601f850160051c820191505b818110156106725782815560010161065f565b505050505050565b6001600160401b03831115610691576106916105dc565b6106a58361069f83546105f2565b8361062c565b6000601f8411600181146106d957600085156106c15750838201355b600019600387901b1c1916600186901b1783556102bc565b600083815260209020601f19861690835b8281101561070a57868501358255602094850194600190920191016106ea565b50868210156107275760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000808335601e1984360301811261077957600080fd5b83016020810192503590506001600160401b0381111561079857600080fd5b80360382131561055157600080fd5b600081546107b4816105f2565b8085526020600183811680156107d157600181146107eb57610819565b60ff1985168884015283151560051b880183019550610819565b866000528260002060005b858110156108115781548a82018601529083019084016107f6565b890184019650505b505050505092915050565b6000608082016001600160401b038916835260206080818501528188835260a08501905060a08960051b86010192508960005b8a81101561089157868503609f19018352610872828d610762565b61087d878284610739565b965050509183019190830190600101610857565b5050508382036040850152858252808201600587901b830182018860005b898110156108e957858303601f190184526108ca828c610762565b6108d5858284610739565b9587019594505050908401906001016108af565b505085810360608701526108fd81886107a7565b9c9b505050505050505050505050565b60006020828403121561091f57600080fd5b5051919050565b60405160a081016001600160401b0381118282101715610948576109486105dc565b60405290565b80516003811061095d57600080fd5b919050565b600082601f83011261097357600080fd5b81516001600160401b038082111561098d5761098d6105dc565b604051601f8301601f19908116603f011681019082821181831017156109b5576109b56105dc565b816040528381528660208588010111156109ce57600080fd5b6109df8460208301602089016104aa565b9695505050505050565b6000602082840312156109fb57600080fd5b81516001600160401b0380821115610a1257600080fd5b9083019060a08286031215610a2657600080fd5b610a2e610926565b8251610a39816103fd565b815260208301516001600160a01b0381168114610a5557600080fd5b6020820152610a666040840161094e565b6040820152606083015182811115610a7d57600080fd5b610a8987828601610962565b606083015250608083015182811115610aa157600080fd5b610aad87828601610962565b60808301525095945050505050565b634e487b7160e01b600052602160045260246000fd5b6001600160401b0384168152826020820152606060408201526000610afa60608301846104ce565b9594505050505056fea26469706673582212205b5117b00ce65fae13c73e5fe55ef1d7583f0a364b1ac0a38e3f21e0d2c88f9a64736f6c63430008140033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 2081, + "contract": "contracts/CCNotificationClient.sol:CCNotificationClient", + "label": "subscriptionId", + "offset": 0, + "slot": "0", + "type": "t_uint64" + }, + { + "astId": 2084, + "contract": "contracts/CCNotificationClient.sol:CCNotificationClient", + "label": "encryptedSecretsReference", + "offset": 0, + "slot": "1", + "type": "t_bytes_storage" + } + ], + "types": { + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_uint64": { + "encoding": "inplace", + "label": "uint64", + "numberOfBytes": "8" + } + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/polygonAmoy/solcInputs/53149b43bdceb93f30f39d8cad0df810.json b/packages/hardhat/deployments/polygonAmoy/solcInputs/53149b43bdceb93f30f39d8cad0df810.json new file mode 100644 index 0000000..9f9aa88 --- /dev/null +++ b/packages/hardhat/deployments/polygonAmoy/solcInputs/53149b43bdceb93f30f39d8cad0df810.json @@ -0,0 +1,84 @@ +{ + "language": "Solidity", + "sources": { + "@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"./interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"./interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"./libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_router;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_router = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_router.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_router)) {\n revert OnlyRouterCanFulfill();\n }\n fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Chainlink Functions client interface.\ninterface IFunctionsClient {\n /// @notice Chainlink Functions response handler called by the Functions Router\n /// during fullilment from the designated transmitter node in an OCR round.\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\n /// @param response Aggregated response from the request's source code.\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\n /// @dev Either response or error parameter will be set, but never both.\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {FunctionsResponse} from \"../libraries/FunctionsResponse.sol\";\n\n/// @title Chainlink Functions Router interface.\ninterface IFunctionsRouter {\n /// @notice The identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n /// @return id - bytes32 id that can be passed to the \"getContractById\" of the Router\n function getAllowListId() external view returns (bytes32);\n\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n function setAllowListId(bytes32 allowListId) external;\n\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\n /// @return adminFee\n function getAdminFee() external view returns (uint72 adminFee);\n\n /// @notice Sends a request using the provided subscriptionId\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequest(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Sends a request to the proposed contracts\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequestToProposed(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Fulfill the request by:\n /// - calling back the data that the Oracle returned to the client contract\n /// - pay the DON for processing the request\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\n /// @param response response data from DON consensus\n /// @param err error from DON consensus\n /// @param juelsPerGas - current rate of juels/gas\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\n /// @param transmitter - The Node that transmitted the OCR report\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\n /// @return fulfillResult -\n /// @return callbackGasCostJuels -\n function fulfill(\n bytes memory response,\n bytes memory err,\n uint96 juelsPerGas,\n uint96 costWithoutFulfillment,\n address transmitter,\n FunctionsResponse.Commitment memory commitment\n ) external returns (FunctionsResponse.FulfillResult, uint96);\n\n /// @notice Validate requested gas limit is below the subscription max.\n /// @param subscriptionId subscription ID\n /// @param callbackGasLimit desired callback gas limit\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\n\n /// @notice Get the current contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current contract address\n function getContractById(bytes32 id) external view returns (address);\n\n /// @notice Get the proposed next contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current or proposed contract address\n function getProposedContractById(bytes32 id) external view returns (address);\n\n /// @notice Return the latest proprosal set\n /// @return ids The identifiers of the contracts to update\n /// @return to The addresses of the contracts that will be updated to\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\n\n /// @notice Proposes one or more updates to the contract routes\n /// @dev Only callable by owner\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\n\n /// @notice Updates the current contract routes to the proposed contracts\n /// @dev Only callable by owner\n function updateContracts() external;\n\n /// @dev Puts the system into an emergency stopped state.\n /// @dev Only callable by owner\n function pause() external;\n\n /// @dev Takes the system out of an emergency stopped state.\n /// @dev Only callable by owner\n function unpause() external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {CBOR} from \"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\";\n\n/// @title Library for encoding the input data of a Functions request into CBOR\nlibrary FunctionsRequest {\n using CBOR for CBOR.CBORBuffer;\n\n uint16 public constant REQUEST_DATA_VERSION = 1;\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\n\n enum Location {\n Inline, // Provided within the Request\n Remote, // Hosted through remote location that can be accessed through a provided URL\n DONHosted // Hosted on the DON's storage\n }\n\n enum CodeLanguage {\n JavaScript\n // In future version we may add other languages\n }\n\n struct Request {\n Location codeLocation; // ════════════╸ The location of the source code that will be executed on each node in the DON\n Location secretsLocation; // ═════════╸ The location of secrets that will be passed into the source code. *Only Remote secrets are supported\n CodeLanguage language; // ════════════╸ The coding language that the source code is written in\n string source; // ════════════════════╸ Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\n bytes encryptedSecretsReference; // ══╸ Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\n string[] args; // ════════════════════╸ String arguments that will be passed into the source code\n bytes[] bytesArgs; // ════════════════╸ Bytes arguments that will be passed into the source code\n }\n\n error EmptySource();\n error EmptySecrets();\n error EmptyArgs();\n error NoInlineSecrets();\n\n /// @notice Encodes a Request to CBOR encoded bytes\n /// @param self The request to encode\n /// @return CBOR encoded bytes\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"codeLocation\");\n buffer.writeUInt256(uint256(self.codeLocation));\n\n buffer.writeString(\"language\");\n buffer.writeUInt256(uint256(self.language));\n\n buffer.writeString(\"source\");\n buffer.writeString(self.source);\n\n if (self.args.length > 0) {\n buffer.writeString(\"args\");\n buffer.startArray();\n for (uint256 i = 0; i < self.args.length; ++i) {\n buffer.writeString(self.args[i]);\n }\n buffer.endSequence();\n }\n\n if (self.encryptedSecretsReference.length > 0) {\n if (self.secretsLocation == Location.Inline) {\n revert NoInlineSecrets();\n }\n buffer.writeString(\"secretsLocation\");\n buffer.writeUInt256(uint256(self.secretsLocation));\n buffer.writeString(\"secrets\");\n buffer.writeBytes(self.encryptedSecretsReference);\n }\n\n if (self.bytesArgs.length > 0) {\n buffer.writeString(\"bytesArgs\");\n buffer.startArray();\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\n buffer.writeBytes(self.bytesArgs[i]);\n }\n buffer.endSequence();\n }\n\n return buffer.buf.buf;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Sets the codeLocation and code on the request\n /// @param self The uninitialized request\n /// @param codeLocation The user provided source code location\n /// @param language The programming language of the user code\n /// @param source The user provided source code or a url\n function initializeRequest(\n Request memory self,\n Location codeLocation,\n CodeLanguage language,\n string memory source\n ) internal pure {\n if (bytes(source).length == 0) revert EmptySource();\n\n self.codeLocation = codeLocation;\n self.language = language;\n self.source = source;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Simplified version of initializeRequest for PoC\n /// @param self The uninitialized request\n /// @param javaScriptSource The user provided JS code (must not be empty)\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\n }\n\n /// @notice Adds Remote user encrypted secrets to a Request\n /// @param self The initialized request\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\n\n self.secretsLocation = Location.Remote;\n self.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n /// @notice Adds DON-hosted secrets reference to a Request\n /// @param self The initialized request\n /// @param slotID Slot ID of the user's secrets hosted on DON\n /// @param version User data version (for the slotID)\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"slotID\");\n buffer.writeUInt64(slotID);\n buffer.writeString(\"version\");\n buffer.writeUInt64(version);\n\n self.secretsLocation = Location.DONHosted;\n self.encryptedSecretsReference = buffer.buf.buf;\n }\n\n /// @notice Sets args for the user run function\n /// @param self The initialized request\n /// @param args The array of string args (must not be empty)\n function setArgs(Request memory self, string[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.args = args;\n }\n\n /// @notice Sets bytes args for the user run function\n /// @param self The initialized request\n /// @param args The array of bytes args (must not be empty)\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.bytesArgs = args;\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Library of types that are used for fulfillment of a Functions request\nlibrary FunctionsResponse {\n // Used to send request information from the Router to the Coordinator\n struct RequestMeta {\n bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\n bytes32 flags; // ═══════════════╸ Per-subscription flags\n address requestingContract; // ══╗ The client contract that is sending the request\n uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\n uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint64 initiatedRequests; // β•‘ The number of requests that have been started\n uint32 callbackGasLimit; // β•‘ The amount of gas that the callback to the consuming contract will be given\n uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data\n uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out\n address subscriptionOwner; // ═══╝ The owner of the billing subscription\n }\n\n enum FulfillResult {\n FULFILLED, // 0\n USER_CALLBACK_ERROR, // 1\n INVALID_REQUEST_ID, // 2\n COST_EXCEEDS_COMMITMENT, // 3\n INSUFFICIENT_GAS_PROVIDED, // 4\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\n INVALID_COMMITMENT // 6\n }\n\n struct Commitment {\n bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request\n address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request\n uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\n address client; // ════════════════════╗ The client contract that sent the request\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given\n uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint72 donFee; // β•‘ Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\n uint40 gasOverheadBeforeCallback; // β•‘ Represents the average gas execution cost before the fulfillment callback.\n uint40 gasOverheadAfterCallback; // β•‘ Represents the average gas execution cost after the fulfillment callback.\n uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"../v1_0_0/interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"../v1_0_0/interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"../v1_0_0/libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_functionsRouter;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_functionsRouter = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_functionsRouter.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_functionsRouter)) {\n revert OnlyRouterCanFulfill();\n }\n _fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}" + }, + "@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../@ensdomains/buffer/v0.1.0/Buffer.sol\";\n\n/**\n* @dev A library for populating CBOR encoded payload in Solidity.\n*\n* https://datatracker.ietf.org/doc/html/rfc7049\n*\n* The library offers various write* and start* methods to encode values of different types.\n* The resulted buffer can be obtained with data() method.\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\n* in an invalid CBOR if start/write/end flow is violated.\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\n* except for nested start/end pairs.\n*/\n\nlibrary CBOR {\n using Buffer for Buffer.buffer;\n\n struct CBORBuffer {\n Buffer.buffer buf;\n uint256 depth;\n }\n\n uint8 private constant MAJOR_TYPE_INT = 0;\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\n uint8 private constant MAJOR_TYPE_BYTES = 2;\n uint8 private constant MAJOR_TYPE_STRING = 3;\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\n uint8 private constant MAJOR_TYPE_MAP = 5;\n uint8 private constant MAJOR_TYPE_TAG = 6;\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\n\n uint8 private constant TAG_TYPE_BIGNUM = 2;\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\n\n uint8 private constant CBOR_FALSE = 20;\n uint8 private constant CBOR_TRUE = 21;\n uint8 private constant CBOR_NULL = 22;\n uint8 private constant CBOR_UNDEFINED = 23;\n\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\n Buffer.init(cbor.buf, capacity);\n cbor.depth = 0;\n return cbor;\n }\n\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\n require(buf.depth == 0, \"Invalid CBOR\");\n return buf.buf.buf;\n }\n\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\n writeBytes(buf, abi.encode(value));\n }\n\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\n if (value < 0) {\n buf.buf.appendUint8(\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\n );\n writeBytes(buf, abi.encode(uint256(-1 - value)));\n } else {\n writeUInt256(buf, uint256(value));\n }\n }\n\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\n }\n\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\n if(value >= 0) {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\n } else{\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\n }\n }\n\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\n buf.buf.append(value);\n }\n\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\n buf.buf.append(bytes(value));\n }\n\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\n }\n\n function writeNull(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_NULL);\n }\n\n function writeUndefined(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_UNDEFINED);\n }\n\n function startArray(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\n buf.depth += 1;\n }\n\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\n }\n\n function startMap(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\n buf.depth += 1;\n }\n\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\n }\n\n function endSequence(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\n buf.depth -= 1;\n }\n\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\n writeString(buf, key);\n writeString(buf, value);\n }\n\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\n writeString(buf, key);\n writeBytes(buf, value);\n }\n\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\n writeString(buf, key);\n writeUInt256(buf, value);\n }\n\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\n writeString(buf, key);\n writeInt256(buf, value);\n }\n\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\n writeString(buf, key);\n writeUInt64(buf, value);\n }\n\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\n writeString(buf, key);\n writeInt64(buf, value);\n }\n\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\n writeString(buf, key);\n writeBool(buf, value);\n }\n\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeNull(buf);\n }\n\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeUndefined(buf);\n }\n\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startMap(buf);\n }\n\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startArray(buf);\n }\n\n function writeFixedNumeric(\n CBORBuffer memory buf,\n uint8 major,\n uint64 value\n ) private pure {\n if (value <= 23) {\n buf.buf.appendUint8(uint8((major << 5) | value));\n } else if (value <= 0xFF) {\n buf.buf.appendUint8(uint8((major << 5) | 24));\n buf.buf.appendInt(value, 1);\n } else if (value <= 0xFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 25));\n buf.buf.appendInt(value, 2);\n } else if (value <= 0xFFFFFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 26));\n buf.buf.appendInt(value, 4);\n } else {\n buf.buf.appendUint8(uint8((major << 5) | 27));\n buf.buf.appendInt(value, 8);\n }\n }\n\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\n private\n pure\n {\n buf.buf.appendUint8(uint8((major << 5) | 31));\n }\n\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\n private\n pure\n {\n writeFixedNumeric(buf, major, length);\n }\n\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\n }\n}" + }, + "@openzeppelin/contracts/access/AccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.20;\n\nimport {IAccessControl} from \"./IAccessControl.sol\";\nimport {Context} from \"../utils/Context.sol\";\nimport {ERC165} from \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account => bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n" + }, + "@openzeppelin/contracts/access/IAccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "contracts/CCExampleClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from \"./interfaces/ICCGatewayClient.sol\";\nimport {ICCGateway} from \"./interfaces/ICCGateway.sol\";\n\ncontract CCExampleClient is ICCGatewayClient {\n ICCGateway private immutable gateway;\n\n uint64 private subscriptionId = 0;\n bytes private encryptedSecretsReference = \"\";\n\n event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response);\n event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error);\n\n constructor(address gatewayAddress) {\n gateway = ICCGateway(gatewayAddress);\n }\n\n function updateSubscriptionId(uint64 _subscriptionId) external {\n subscriptionId = _subscriptionId;\n }\n\n function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external {\n encryptedSecretsReference = _encryptedSecretsReference;\n }\n\n function request(string[] calldata args, bytes[] calldata bytesArgs) external {\n gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference);\n }\n\n function callback(bytes32 requestId) external override {\n ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true);\n\n if (response.state == ICCGatewayClient.CCGResponseState.Success) {\n emit ResponseReceived(response.subscriptionId, requestId, string(response.data));\n } else {\n emit ErrorReceived(response.subscriptionId, requestId, string(response.error));\n }\n }\n}\n" + }, + "contracts/CCGateway.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport './interfaces/ICCGateway.sol';\nimport {ICCGatewayClient} from './interfaces/ICCGatewayClient.sol';\n\nimport {FunctionsClient} from \"@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol\";\nimport {AccessControl} from \"@openzeppelin/contracts/access/AccessControl.sol\";\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\";\n\ncontract CCGateway is ICCGateway, FunctionsClient, AccessControl {\n using FunctionsRequest for FunctionsRequest.Request;\n\n bytes32 public constant MANAGER_ROLE = keccak256(\"MANAGER_ROLE\");\n bytes32 public constant CLIENT_ROLE = keccak256(\"CLIENT_ROLE\");\n bytes32 private _donId; // DON ID for the Functions DON to which the requests are sent\n\n mapping(uint64 subscriptionId => CCGRequest) private _requests; // Each subscription can only handle one kind of request\n mapping(bytes32 requestId => ICCGatewayClient.CCGResponse) private unprocessed_responses; // Responses that have not been processed yet\n\n constructor(address router, bytes32 initialDonId, address initialOwner) FunctionsClient(router) {\n _donId = initialDonId;\n\n address to = address(0) == initialOwner ? _msgSender() : initialOwner;\n _grantRole(DEFAULT_ADMIN_ROLE, to);\n _grantRole(MANAGER_ROLE, to);\n }\n\n /**\n * @dev Set the DON ID\n * @param newDonId New DON ID\n */\n function setDonId(bytes32 newDonId) external onlyRole(getRoleAdmin(MANAGER_ROLE)) {\n _donId = newDonId;\n }\n\n /**\n * @dev Get the DON ID\n * @return DON ID\n */\n function donId() external view returns (bytes32) {\n return _donId;\n }\n\n function registerRequest(\n uint64 subscriptionId,\n FunctionsRequest.Location codeLocation,\n string calldata source,\n FunctionsRequest.Location secretsLocation,\n bytes calldata encryptedSecretsReference,\n uint32 callbackGasLimit,\n string calldata name\n ) external onlyRole(MANAGER_ROLE) {\n if(bytes(name).length == 0) {revert CCGRequestNameEmpty();}\n\n CCGRequest storage req = _requests[subscriptionId];\n req.name = name;\n req.callbackGasLimit = callbackGasLimit;\n\n // Only JavaScript is supported for now\n req.config.language = FunctionsRequest.CodeLanguage.JavaScript;\n req.config.codeLocation = codeLocation;\n req.config.source = source;\n req.config.secretsLocation = secretsLocation;\n req.config.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n\n function getRequest(uint64 subscriptionId) external view onlyManager returns (CCGRequest memory) {\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n return _requests[subscriptionId];\n }\n// ---------------------------------------------------------------------------------------------------------------------\n modifier onlySource(bytes32 requestId) {\n if (unprocessed_responses[requestId].source != _msgSender()) {revert CCGOnlySameSourceAllowed(requestId);}\n _;\n }\n\n modifier onlyManager() {\n if (!hasRole(MANAGER_ROLE, tx.origin)) {revert CCGOnlyManagerAllowed();}\n _;\n }\n// ---------------------------------------------------------------------------------------------------------------------\n /**\n * @notice Triggers an on-demand Functions request using remote encrypted secrets\n * @param subscriptionId Subscription ID used to pay for request (FunctionsConsumer contract address must first be added to the subscription)\n * @param args String arguments passed into the source code and accessible via the global variable `args`\n * @param bytesArgs Bytes arguments passed into the source code and accessible via the global variable `bytesArgs` as hex strings\n * @param encryptedSecretsReference Reference pointing to encrypted secrets\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external onlyRole(CLIENT_ROLE) returns (bytes32 requestId) {\n CCGRequest storage request = _requests[subscriptionId];\n if (bytes(request.name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n\n FunctionsRequest.Request memory req = request.config;\n req.initializeRequest(req.codeLocation, FunctionsRequest.CodeLanguage.JavaScript, req.source);\n if(encryptedSecretsReference.length > 0) {req.encryptedSecretsReference = encryptedSecretsReference;}\n\n if (args.length > 0) {\n req.setArgs(args);\n }\n if (bytesArgs.length > 0) {\n req.setBytesArgs(bytesArgs);\n }\n\n requestId = _sendRequest(req.encodeCBOR(), subscriptionId, request.callbackGasLimit, _donId);\n unprocessed_responses[requestId].state = ICCGatewayClient.CCGResponseState.Sent;\n unprocessed_responses[requestId].source = _msgSender();\n }\n\n /**\n * @notice Store latest result/error\n * @param requestId The request ID, returned by sendRequest()\n * @param response Aggregated response from the user code\n * @param err Aggregated error from the user code or from the execution pipeline\n * Either response or error parameter will be set, but never both\n */\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal override {\n ICCGatewayClient.CCGResponse storage resp = unprocessed_responses[requestId];\n if (resp.state != ICCGatewayClient.CCGResponseState.Sent) {revert CCGRequestAlreadyFulfilled(requestId);}\n\n unprocessed_responses[requestId].state = err.length > 0 ? ICCGatewayClient.CCGResponseState.Error : ICCGatewayClient.CCGResponseState.Success;\n unprocessed_responses[requestId].data = response;\n unprocessed_responses[requestId].error = err;\n\n // TODO: Call the client's callback function.\n ICCGatewayClient(resp.source).callback(requestId);\n }\n\n /**\n * @dev Get the response data\n * @param requestId The request ID, returned by sendRequest()\n * @return response CCGResponse\n */\n function getResponse(bytes32 requestId, bool remove) external onlySource(requestId) returns (ICCGatewayClient.CCGResponse memory response) {\n response = unprocessed_responses[requestId];\n if (remove) {delete unprocessed_responses[requestId];}\n }\n}" + }, + "contracts/interfaces/ICCGateway.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\";\n\ninterface ICCGateway {\n struct CCGRequest {\n string name;\n uint32 callbackGasLimit;\n FunctionsRequest.Request config;\n }\n\n /**\n * @dev Can't register a request with an empty name\n */\n error CCGRequestNameEmpty();\n\n /**\n * @dev Only the same source of the requestId is allowed to call the function\n */\n error CCGOnlySameSourceAllowed(bytes32 requestId);\n\n /**\n * @dev Only a registered subscriptionId is allowed to call the function\n */\n error CCGRequestNotRegistered(uint64 subscriptionId);\n\n /**\n * @dev Can't fulfill a request that has already been fulfilled\n */\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\n\n /**\n * @dev Only A manager can call the function\n */\n error CCGOnlyManagerAllowed();\n\n /**\n * @dev Send a request to the Functions DON\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external returns (bytes32 requestId);\n\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\n}\n" + }, + "contracts/interfaces/ICCGatewayClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\ninterface ICCGatewayClient {\n enum CCGResponseState {Sent, Success, Error}\n\n struct CCGResponse {\n uint64 subscriptionId;\n address source;\n CCGResponseState state;\n bytes data;\n bytes error;\n }\n\n function callback(bytes32 requestId) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/polygonAmoy/solcInputs/55f420078970def91f71afecffd6ca9e.json b/packages/hardhat/deployments/polygonAmoy/solcInputs/55f420078970def91f71afecffd6ca9e.json new file mode 100644 index 0000000..48227cb --- /dev/null +++ b/packages/hardhat/deployments/polygonAmoy/solcInputs/55f420078970def91f71afecffd6ca9e.json @@ -0,0 +1,63 @@ +{ + "language": "Solidity", + "sources": { + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Chainlink Functions client interface.\ninterface IFunctionsClient {\n /// @notice Chainlink Functions response handler called by the Functions Router\n /// during fullilment from the designated transmitter node in an OCR round.\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\n /// @param response Aggregated response from the request's source code.\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\n /// @dev Either response or error parameter will be set, but never both.\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {FunctionsResponse} from \"../libraries/FunctionsResponse.sol\";\n\n/// @title Chainlink Functions Router interface.\ninterface IFunctionsRouter {\n /// @notice The identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n /// @return id - bytes32 id that can be passed to the \"getContractById\" of the Router\n function getAllowListId() external view returns (bytes32);\n\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n function setAllowListId(bytes32 allowListId) external;\n\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\n /// @return adminFee\n function getAdminFee() external view returns (uint72 adminFee);\n\n /// @notice Sends a request using the provided subscriptionId\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequest(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Sends a request to the proposed contracts\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequestToProposed(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Fulfill the request by:\n /// - calling back the data that the Oracle returned to the client contract\n /// - pay the DON for processing the request\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\n /// @param response response data from DON consensus\n /// @param err error from DON consensus\n /// @param juelsPerGas - current rate of juels/gas\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\n /// @param transmitter - The Node that transmitted the OCR report\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\n /// @return fulfillResult -\n /// @return callbackGasCostJuels -\n function fulfill(\n bytes memory response,\n bytes memory err,\n uint96 juelsPerGas,\n uint96 costWithoutFulfillment,\n address transmitter,\n FunctionsResponse.Commitment memory commitment\n ) external returns (FunctionsResponse.FulfillResult, uint96);\n\n /// @notice Validate requested gas limit is below the subscription max.\n /// @param subscriptionId subscription ID\n /// @param callbackGasLimit desired callback gas limit\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\n\n /// @notice Get the current contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current contract address\n function getContractById(bytes32 id) external view returns (address);\n\n /// @notice Get the proposed next contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current or proposed contract address\n function getProposedContractById(bytes32 id) external view returns (address);\n\n /// @notice Return the latest proprosal set\n /// @return ids The identifiers of the contracts to update\n /// @return to The addresses of the contracts that will be updated to\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\n\n /// @notice Proposes one or more updates to the contract routes\n /// @dev Only callable by owner\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\n\n /// @notice Updates the current contract routes to the proposed contracts\n /// @dev Only callable by owner\n function updateContracts() external;\n\n /// @dev Puts the system into an emergency stopped state.\n /// @dev Only callable by owner\n function pause() external;\n\n /// @dev Takes the system out of an emergency stopped state.\n /// @dev Only callable by owner\n function unpause() external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {CBOR} from \"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\";\n\n/// @title Library for encoding the input data of a Functions request into CBOR\nlibrary FunctionsRequest {\n using CBOR for CBOR.CBORBuffer;\n\n uint16 public constant REQUEST_DATA_VERSION = 1;\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\n\n enum Location {\n Inline, // Provided within the Request\n Remote, // Hosted through remote location that can be accessed through a provided URL\n DONHosted // Hosted on the DON's storage\n }\n\n enum CodeLanguage {\n JavaScript\n // In future version we may add other languages\n }\n\n struct Request {\n Location codeLocation; // ════════════╸ The location of the source code that will be executed on each node in the DON\n Location secretsLocation; // ═════════╸ The location of secrets that will be passed into the source code. *Only Remote secrets are supported\n CodeLanguage language; // ════════════╸ The coding language that the source code is written in\n string source; // ════════════════════╸ Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\n bytes encryptedSecretsReference; // ══╸ Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\n string[] args; // ════════════════════╸ String arguments that will be passed into the source code\n bytes[] bytesArgs; // ════════════════╸ Bytes arguments that will be passed into the source code\n }\n\n error EmptySource();\n error EmptySecrets();\n error EmptyArgs();\n error NoInlineSecrets();\n\n /// @notice Encodes a Request to CBOR encoded bytes\n /// @param self The request to encode\n /// @return CBOR encoded bytes\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"codeLocation\");\n buffer.writeUInt256(uint256(self.codeLocation));\n\n buffer.writeString(\"language\");\n buffer.writeUInt256(uint256(self.language));\n\n buffer.writeString(\"source\");\n buffer.writeString(self.source);\n\n if (self.args.length > 0) {\n buffer.writeString(\"args\");\n buffer.startArray();\n for (uint256 i = 0; i < self.args.length; ++i) {\n buffer.writeString(self.args[i]);\n }\n buffer.endSequence();\n }\n\n if (self.encryptedSecretsReference.length > 0) {\n if (self.secretsLocation == Location.Inline) {\n revert NoInlineSecrets();\n }\n buffer.writeString(\"secretsLocation\");\n buffer.writeUInt256(uint256(self.secretsLocation));\n buffer.writeString(\"secrets\");\n buffer.writeBytes(self.encryptedSecretsReference);\n }\n\n if (self.bytesArgs.length > 0) {\n buffer.writeString(\"bytesArgs\");\n buffer.startArray();\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\n buffer.writeBytes(self.bytesArgs[i]);\n }\n buffer.endSequence();\n }\n\n return buffer.buf.buf;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Sets the codeLocation and code on the request\n /// @param self The uninitialized request\n /// @param codeLocation The user provided source code location\n /// @param language The programming language of the user code\n /// @param source The user provided source code or a url\n function initializeRequest(\n Request memory self,\n Location codeLocation,\n CodeLanguage language,\n string memory source\n ) internal pure {\n if (bytes(source).length == 0) revert EmptySource();\n\n self.codeLocation = codeLocation;\n self.language = language;\n self.source = source;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Simplified version of initializeRequest for PoC\n /// @param self The uninitialized request\n /// @param javaScriptSource The user provided JS code (must not be empty)\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\n }\n\n /// @notice Adds Remote user encrypted secrets to a Request\n /// @param self The initialized request\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\n\n self.secretsLocation = Location.Remote;\n self.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n /// @notice Adds DON-hosted secrets reference to a Request\n /// @param self The initialized request\n /// @param slotID Slot ID of the user's secrets hosted on DON\n /// @param version User data version (for the slotID)\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"slotID\");\n buffer.writeUInt64(slotID);\n buffer.writeString(\"version\");\n buffer.writeUInt64(version);\n\n self.secretsLocation = Location.DONHosted;\n self.encryptedSecretsReference = buffer.buf.buf;\n }\n\n /// @notice Sets args for the user run function\n /// @param self The initialized request\n /// @param args The array of string args (must not be empty)\n function setArgs(Request memory self, string[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.args = args;\n }\n\n /// @notice Sets bytes args for the user run function\n /// @param self The initialized request\n /// @param args The array of bytes args (must not be empty)\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.bytesArgs = args;\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Library of types that are used for fulfillment of a Functions request\nlibrary FunctionsResponse {\n // Used to send request information from the Router to the Coordinator\n struct RequestMeta {\n bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\n bytes32 flags; // ═══════════════╸ Per-subscription flags\n address requestingContract; // ══╗ The client contract that is sending the request\n uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\n uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint64 initiatedRequests; // β•‘ The number of requests that have been started\n uint32 callbackGasLimit; // β•‘ The amount of gas that the callback to the consuming contract will be given\n uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data\n uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out\n address subscriptionOwner; // ═══╝ The owner of the billing subscription\n }\n\n enum FulfillResult {\n FULFILLED, // 0\n USER_CALLBACK_ERROR, // 1\n INVALID_REQUEST_ID, // 2\n COST_EXCEEDS_COMMITMENT, // 3\n INSUFFICIENT_GAS_PROVIDED, // 4\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\n INVALID_COMMITMENT // 6\n }\n\n struct Commitment {\n bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request\n address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request\n uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\n address client; // ════════════════════╗ The client contract that sent the request\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given\n uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint72 donFee; // β•‘ Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\n uint40 gasOverheadBeforeCallback; // β•‘ Represents the average gas execution cost before the fulfillment callback.\n uint40 gasOverheadAfterCallback; // β•‘ Represents the average gas execution cost after the fulfillment callback.\n uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"../v1_0_0/interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"../v1_0_0/interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"../v1_0_0/libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_functionsRouter;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_functionsRouter = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_functionsRouter.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_functionsRouter)) {\n revert OnlyRouterCanFulfill();\n }\n _fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}" + }, + "@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../@ensdomains/buffer/v0.1.0/Buffer.sol\";\n\n/**\n* @dev A library for populating CBOR encoded payload in Solidity.\n*\n* https://datatracker.ietf.org/doc/html/rfc7049\n*\n* The library offers various write* and start* methods to encode values of different types.\n* The resulted buffer can be obtained with data() method.\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\n* in an invalid CBOR if start/write/end flow is violated.\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\n* except for nested start/end pairs.\n*/\n\nlibrary CBOR {\n using Buffer for Buffer.buffer;\n\n struct CBORBuffer {\n Buffer.buffer buf;\n uint256 depth;\n }\n\n uint8 private constant MAJOR_TYPE_INT = 0;\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\n uint8 private constant MAJOR_TYPE_BYTES = 2;\n uint8 private constant MAJOR_TYPE_STRING = 3;\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\n uint8 private constant MAJOR_TYPE_MAP = 5;\n uint8 private constant MAJOR_TYPE_TAG = 6;\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\n\n uint8 private constant TAG_TYPE_BIGNUM = 2;\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\n\n uint8 private constant CBOR_FALSE = 20;\n uint8 private constant CBOR_TRUE = 21;\n uint8 private constant CBOR_NULL = 22;\n uint8 private constant CBOR_UNDEFINED = 23;\n\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\n Buffer.init(cbor.buf, capacity);\n cbor.depth = 0;\n return cbor;\n }\n\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\n require(buf.depth == 0, \"Invalid CBOR\");\n return buf.buf.buf;\n }\n\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\n writeBytes(buf, abi.encode(value));\n }\n\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\n if (value < 0) {\n buf.buf.appendUint8(\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\n );\n writeBytes(buf, abi.encode(uint256(-1 - value)));\n } else {\n writeUInt256(buf, uint256(value));\n }\n }\n\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\n }\n\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\n if(value >= 0) {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\n } else{\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\n }\n }\n\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\n buf.buf.append(value);\n }\n\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\n buf.buf.append(bytes(value));\n }\n\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\n }\n\n function writeNull(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_NULL);\n }\n\n function writeUndefined(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_UNDEFINED);\n }\n\n function startArray(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\n buf.depth += 1;\n }\n\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\n }\n\n function startMap(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\n buf.depth += 1;\n }\n\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\n }\n\n function endSequence(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\n buf.depth -= 1;\n }\n\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\n writeString(buf, key);\n writeString(buf, value);\n }\n\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\n writeString(buf, key);\n writeBytes(buf, value);\n }\n\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\n writeString(buf, key);\n writeUInt256(buf, value);\n }\n\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\n writeString(buf, key);\n writeInt256(buf, value);\n }\n\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\n writeString(buf, key);\n writeUInt64(buf, value);\n }\n\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\n writeString(buf, key);\n writeInt64(buf, value);\n }\n\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\n writeString(buf, key);\n writeBool(buf, value);\n }\n\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeNull(buf);\n }\n\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeUndefined(buf);\n }\n\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startMap(buf);\n }\n\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startArray(buf);\n }\n\n function writeFixedNumeric(\n CBORBuffer memory buf,\n uint8 major,\n uint64 value\n ) private pure {\n if (value <= 23) {\n buf.buf.appendUint8(uint8((major << 5) | value));\n } else if (value <= 0xFF) {\n buf.buf.appendUint8(uint8((major << 5) | 24));\n buf.buf.appendInt(value, 1);\n } else if (value <= 0xFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 25));\n buf.buf.appendInt(value, 2);\n } else if (value <= 0xFFFFFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 26));\n buf.buf.appendInt(value, 4);\n } else {\n buf.buf.appendUint8(uint8((major << 5) | 27));\n buf.buf.appendInt(value, 8);\n }\n }\n\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\n private\n pure\n {\n buf.buf.appendUint8(uint8((major << 5) | 31));\n }\n\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\n private\n pure\n {\n writeFixedNumeric(buf, major, length);\n }\n\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\n }\n}" + }, + "contracts/CCExampleClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from \"./interfaces/ICCGatewayClient.sol\";\nimport {ICCGateway} from \"./interfaces/ICCGateway.sol\";\n\ncontract CCExampleClient is ICCGatewayClient {\n ICCGateway private immutable gateway;\n\n uint64 private subscriptionId = 0;\n bytes private encryptedSecretsReference = \"\";\n\n event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response);\n event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error);\n\n constructor(address gatewayAddress) {\n gateway = ICCGateway(gatewayAddress);\n }\n\n function updateSubscriptionId(uint64 _subscriptionId) external {\n subscriptionId = _subscriptionId;\n }\n\n function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external {\n encryptedSecretsReference = _encryptedSecretsReference;\n }\n\n function request(string[] calldata args, bytes[] calldata bytesArgs) external {\n require(subscriptionId != 0, \"Subscription ID not set\");\n\n gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference);\n }\n\n function callback(bytes32 requestId) external override {\n ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true);\n\n if (response.state == ICCGatewayClient.CCGResponseState.Success) {\n emit ResponseReceived(response.subscriptionId, requestId, string(response.data));\n } else {\n emit ErrorReceived(response.subscriptionId, requestId, string(response.error));\n }\n }\n}\n" + }, + "contracts/interfaces/ICCGateway.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\";\n\ninterface ICCGateway {\n struct CCGRequest {\n string name;\n uint32 callbackGasLimit;\n FunctionsRequest.Request config;\n }\n\n /**\n * @dev Can't register a request with an empty name\n */\n error CCGRequestNameEmpty();\n\n /**\n * @dev Only the same source of the requestId is allowed to call the function\n */\n error CCGOnlySameSourceAllowed(bytes32 requestId);\n\n /**\n * @dev Only a registered subscriptionId is allowed to call the function\n */\n error CCGRequestNotRegistered(uint64 subscriptionId);\n\n /**\n * @dev Can't fulfill a request that has already been fulfilled\n */\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\n\n /**\n * @dev Only A manager can call the function\n */\n error CCGOnlyManagerAllowed();\n\n /**\n * @dev Send a request to the Functions DON\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external returns (bytes32 requestId);\n\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\n}\n" + }, + "contracts/interfaces/ICCGatewayClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\ninterface ICCGatewayClient {\n enum CCGResponseState {Sent, Success, Error}\n\n struct CCGResponse {\n uint64 subscriptionId;\n address source;\n CCGResponseState state;\n bytes data;\n bytes error;\n }\n\n function callback(bytes32 requestId) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/polygonAmoy/solcInputs/757a0cc1c674e4e4007b25c045668167.json b/packages/hardhat/deployments/polygonAmoy/solcInputs/757a0cc1c674e4e4007b25c045668167.json new file mode 100644 index 0000000..49e3804 --- /dev/null +++ b/packages/hardhat/deployments/polygonAmoy/solcInputs/757a0cc1c674e4e4007b25c045668167.json @@ -0,0 +1,81 @@ +{ + "language": "Solidity", + "sources": { + "@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"./interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"./interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"./libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_router;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_router = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_router.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_router)) {\n revert OnlyRouterCanFulfill();\n }\n fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Chainlink Functions client interface.\ninterface IFunctionsClient {\n /// @notice Chainlink Functions response handler called by the Functions Router\n /// during fullilment from the designated transmitter node in an OCR round.\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\n /// @param response Aggregated response from the request's source code.\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\n /// @dev Either response or error parameter will be set, but never both.\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {FunctionsResponse} from \"../libraries/FunctionsResponse.sol\";\n\n/// @title Chainlink Functions Router interface.\ninterface IFunctionsRouter {\n /// @notice The identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n /// @return id - bytes32 id that can be passed to the \"getContractById\" of the Router\n function getAllowListId() external view returns (bytes32);\n\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n function setAllowListId(bytes32 allowListId) external;\n\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\n /// @return adminFee\n function getAdminFee() external view returns (uint72 adminFee);\n\n /// @notice Sends a request using the provided subscriptionId\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequest(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Sends a request to the proposed contracts\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequestToProposed(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Fulfill the request by:\n /// - calling back the data that the Oracle returned to the client contract\n /// - pay the DON for processing the request\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\n /// @param response response data from DON consensus\n /// @param err error from DON consensus\n /// @param juelsPerGas - current rate of juels/gas\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\n /// @param transmitter - The Node that transmitted the OCR report\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\n /// @return fulfillResult -\n /// @return callbackGasCostJuels -\n function fulfill(\n bytes memory response,\n bytes memory err,\n uint96 juelsPerGas,\n uint96 costWithoutFulfillment,\n address transmitter,\n FunctionsResponse.Commitment memory commitment\n ) external returns (FunctionsResponse.FulfillResult, uint96);\n\n /// @notice Validate requested gas limit is below the subscription max.\n /// @param subscriptionId subscription ID\n /// @param callbackGasLimit desired callback gas limit\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\n\n /// @notice Get the current contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current contract address\n function getContractById(bytes32 id) external view returns (address);\n\n /// @notice Get the proposed next contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current or proposed contract address\n function getProposedContractById(bytes32 id) external view returns (address);\n\n /// @notice Return the latest proprosal set\n /// @return ids The identifiers of the contracts to update\n /// @return to The addresses of the contracts that will be updated to\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\n\n /// @notice Proposes one or more updates to the contract routes\n /// @dev Only callable by owner\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\n\n /// @notice Updates the current contract routes to the proposed contracts\n /// @dev Only callable by owner\n function updateContracts() external;\n\n /// @dev Puts the system into an emergency stopped state.\n /// @dev Only callable by owner\n function pause() external;\n\n /// @dev Takes the system out of an emergency stopped state.\n /// @dev Only callable by owner\n function unpause() external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {CBOR} from \"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\";\n\n/// @title Library for encoding the input data of a Functions request into CBOR\nlibrary FunctionsRequest {\n using CBOR for CBOR.CBORBuffer;\n\n uint16 public constant REQUEST_DATA_VERSION = 1;\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\n\n enum Location {\n Inline, // Provided within the Request\n Remote, // Hosted through remote location that can be accessed through a provided URL\n DONHosted // Hosted on the DON's storage\n }\n\n enum CodeLanguage {\n JavaScript\n // In future version we may add other languages\n }\n\n struct Request {\n Location codeLocation; // ════════════╸ The location of the source code that will be executed on each node in the DON\n Location secretsLocation; // ═════════╸ The location of secrets that will be passed into the source code. *Only Remote secrets are supported\n CodeLanguage language; // ════════════╸ The coding language that the source code is written in\n string source; // ════════════════════╸ Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\n bytes encryptedSecretsReference; // ══╸ Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\n string[] args; // ════════════════════╸ String arguments that will be passed into the source code\n bytes[] bytesArgs; // ════════════════╸ Bytes arguments that will be passed into the source code\n }\n\n error EmptySource();\n error EmptySecrets();\n error EmptyArgs();\n error NoInlineSecrets();\n\n /// @notice Encodes a Request to CBOR encoded bytes\n /// @param self The request to encode\n /// @return CBOR encoded bytes\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"codeLocation\");\n buffer.writeUInt256(uint256(self.codeLocation));\n\n buffer.writeString(\"language\");\n buffer.writeUInt256(uint256(self.language));\n\n buffer.writeString(\"source\");\n buffer.writeString(self.source);\n\n if (self.args.length > 0) {\n buffer.writeString(\"args\");\n buffer.startArray();\n for (uint256 i = 0; i < self.args.length; ++i) {\n buffer.writeString(self.args[i]);\n }\n buffer.endSequence();\n }\n\n if (self.encryptedSecretsReference.length > 0) {\n if (self.secretsLocation == Location.Inline) {\n revert NoInlineSecrets();\n }\n buffer.writeString(\"secretsLocation\");\n buffer.writeUInt256(uint256(self.secretsLocation));\n buffer.writeString(\"secrets\");\n buffer.writeBytes(self.encryptedSecretsReference);\n }\n\n if (self.bytesArgs.length > 0) {\n buffer.writeString(\"bytesArgs\");\n buffer.startArray();\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\n buffer.writeBytes(self.bytesArgs[i]);\n }\n buffer.endSequence();\n }\n\n return buffer.buf.buf;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Sets the codeLocation and code on the request\n /// @param self The uninitialized request\n /// @param codeLocation The user provided source code location\n /// @param language The programming language of the user code\n /// @param source The user provided source code or a url\n function initializeRequest(\n Request memory self,\n Location codeLocation,\n CodeLanguage language,\n string memory source\n ) internal pure {\n if (bytes(source).length == 0) revert EmptySource();\n\n self.codeLocation = codeLocation;\n self.language = language;\n self.source = source;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Simplified version of initializeRequest for PoC\n /// @param self The uninitialized request\n /// @param javaScriptSource The user provided JS code (must not be empty)\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\n }\n\n /// @notice Adds Remote user encrypted secrets to a Request\n /// @param self The initialized request\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\n\n self.secretsLocation = Location.Remote;\n self.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n /// @notice Adds DON-hosted secrets reference to a Request\n /// @param self The initialized request\n /// @param slotID Slot ID of the user's secrets hosted on DON\n /// @param version User data version (for the slotID)\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"slotID\");\n buffer.writeUInt64(slotID);\n buffer.writeString(\"version\");\n buffer.writeUInt64(version);\n\n self.secretsLocation = Location.DONHosted;\n self.encryptedSecretsReference = buffer.buf.buf;\n }\n\n /// @notice Sets args for the user run function\n /// @param self The initialized request\n /// @param args The array of string args (must not be empty)\n function setArgs(Request memory self, string[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.args = args;\n }\n\n /// @notice Sets bytes args for the user run function\n /// @param self The initialized request\n /// @param args The array of bytes args (must not be empty)\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.bytesArgs = args;\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Library of types that are used for fulfillment of a Functions request\nlibrary FunctionsResponse {\n // Used to send request information from the Router to the Coordinator\n struct RequestMeta {\n bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\n bytes32 flags; // ═══════════════╸ Per-subscription flags\n address requestingContract; // ══╗ The client contract that is sending the request\n uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\n uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint64 initiatedRequests; // β•‘ The number of requests that have been started\n uint32 callbackGasLimit; // β•‘ The amount of gas that the callback to the consuming contract will be given\n uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data\n uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out\n address subscriptionOwner; // ═══╝ The owner of the billing subscription\n }\n\n enum FulfillResult {\n FULFILLED, // 0\n USER_CALLBACK_ERROR, // 1\n INVALID_REQUEST_ID, // 2\n COST_EXCEEDS_COMMITMENT, // 3\n INSUFFICIENT_GAS_PROVIDED, // 4\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\n INVALID_COMMITMENT // 6\n }\n\n struct Commitment {\n bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request\n address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request\n uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\n address client; // ════════════════════╗ The client contract that sent the request\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given\n uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint72 donFee; // β•‘ Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\n uint40 gasOverheadBeforeCallback; // β•‘ Represents the average gas execution cost before the fulfillment callback.\n uint40 gasOverheadAfterCallback; // β•‘ Represents the average gas execution cost after the fulfillment callback.\n uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"../v1_0_0/interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"../v1_0_0/interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"../v1_0_0/libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_functionsRouter;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_functionsRouter = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_functionsRouter.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_functionsRouter)) {\n revert OnlyRouterCanFulfill();\n }\n _fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}" + }, + "@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../@ensdomains/buffer/v0.1.0/Buffer.sol\";\n\n/**\n* @dev A library for populating CBOR encoded payload in Solidity.\n*\n* https://datatracker.ietf.org/doc/html/rfc7049\n*\n* The library offers various write* and start* methods to encode values of different types.\n* The resulted buffer can be obtained with data() method.\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\n* in an invalid CBOR if start/write/end flow is violated.\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\n* except for nested start/end pairs.\n*/\n\nlibrary CBOR {\n using Buffer for Buffer.buffer;\n\n struct CBORBuffer {\n Buffer.buffer buf;\n uint256 depth;\n }\n\n uint8 private constant MAJOR_TYPE_INT = 0;\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\n uint8 private constant MAJOR_TYPE_BYTES = 2;\n uint8 private constant MAJOR_TYPE_STRING = 3;\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\n uint8 private constant MAJOR_TYPE_MAP = 5;\n uint8 private constant MAJOR_TYPE_TAG = 6;\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\n\n uint8 private constant TAG_TYPE_BIGNUM = 2;\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\n\n uint8 private constant CBOR_FALSE = 20;\n uint8 private constant CBOR_TRUE = 21;\n uint8 private constant CBOR_NULL = 22;\n uint8 private constant CBOR_UNDEFINED = 23;\n\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\n Buffer.init(cbor.buf, capacity);\n cbor.depth = 0;\n return cbor;\n }\n\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\n require(buf.depth == 0, \"Invalid CBOR\");\n return buf.buf.buf;\n }\n\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\n writeBytes(buf, abi.encode(value));\n }\n\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\n if (value < 0) {\n buf.buf.appendUint8(\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\n );\n writeBytes(buf, abi.encode(uint256(-1 - value)));\n } else {\n writeUInt256(buf, uint256(value));\n }\n }\n\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\n }\n\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\n if(value >= 0) {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\n } else{\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\n }\n }\n\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\n buf.buf.append(value);\n }\n\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\n buf.buf.append(bytes(value));\n }\n\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\n }\n\n function writeNull(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_NULL);\n }\n\n function writeUndefined(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_UNDEFINED);\n }\n\n function startArray(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\n buf.depth += 1;\n }\n\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\n }\n\n function startMap(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\n buf.depth += 1;\n }\n\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\n }\n\n function endSequence(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\n buf.depth -= 1;\n }\n\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\n writeString(buf, key);\n writeString(buf, value);\n }\n\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\n writeString(buf, key);\n writeBytes(buf, value);\n }\n\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\n writeString(buf, key);\n writeUInt256(buf, value);\n }\n\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\n writeString(buf, key);\n writeInt256(buf, value);\n }\n\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\n writeString(buf, key);\n writeUInt64(buf, value);\n }\n\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\n writeString(buf, key);\n writeInt64(buf, value);\n }\n\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\n writeString(buf, key);\n writeBool(buf, value);\n }\n\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeNull(buf);\n }\n\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeUndefined(buf);\n }\n\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startMap(buf);\n }\n\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startArray(buf);\n }\n\n function writeFixedNumeric(\n CBORBuffer memory buf,\n uint8 major,\n uint64 value\n ) private pure {\n if (value <= 23) {\n buf.buf.appendUint8(uint8((major << 5) | value));\n } else if (value <= 0xFF) {\n buf.buf.appendUint8(uint8((major << 5) | 24));\n buf.buf.appendInt(value, 1);\n } else if (value <= 0xFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 25));\n buf.buf.appendInt(value, 2);\n } else if (value <= 0xFFFFFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 26));\n buf.buf.appendInt(value, 4);\n } else {\n buf.buf.appendUint8(uint8((major << 5) | 27));\n buf.buf.appendInt(value, 8);\n }\n }\n\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\n private\n pure\n {\n buf.buf.appendUint8(uint8((major << 5) | 31));\n }\n\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\n private\n pure\n {\n writeFixedNumeric(buf, major, length);\n }\n\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\n }\n}" + }, + "@openzeppelin/contracts/access/AccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.20;\n\nimport {IAccessControl} from \"./IAccessControl.sol\";\nimport {Context} from \"../utils/Context.sol\";\nimport {ERC165} from \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account => bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n" + }, + "@openzeppelin/contracts/access/IAccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "contracts/CCGateway.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport './interfaces/ICCGateway.sol';\nimport {ICCGatewayClient} from './interfaces/ICCGatewayClient.sol';\n\nimport {FunctionsClient} from \"@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol\";\nimport {AccessControl} from \"@openzeppelin/contracts/access/AccessControl.sol\";\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\";\n\ncontract CCGateway is ICCGateway, FunctionsClient, AccessControl {\n using FunctionsRequest for FunctionsRequest.Request;\n\n bytes32 public constant MANAGER_ROLE = keccak256(\"MANAGER_ROLE\");\n bytes32 public constant CLIENT_ROLE = keccak256(\"CLIENT_ROLE\");\n bytes32 private _donId; // DON ID for the Functions DON to which the requests are sent\n\n mapping(uint64 subscriptionId => CCGRequest) private _requests; // Each subscription can only handle one kind of request\n mapping(bytes32 requestId => ICCGatewayClient.CCGResponse) private unprocessed_responses; // Responses that have not been processed yet\n\n // array of registered subscriptions\n uint64[] public subscriptions;\n\n constructor(address router, bytes32 initialDonId, address initialOwner) FunctionsClient(router) {\n _donId = initialDonId;\n\n address to = address(0) == initialOwner ? _msgSender() : initialOwner;\n _grantRole(DEFAULT_ADMIN_ROLE, to);\n _grantRole(MANAGER_ROLE, to);\n }\n\n /**\n * @dev Set the DON ID\n * @param newDonId New DON ID\n */\n function setDonId(bytes32 newDonId) external onlyRole(getRoleAdmin(MANAGER_ROLE)) {\n _donId = newDonId;\n }\n\n /**\n * @dev Get the DON ID\n * @return DON ID\n */\n function donId() external view returns (bytes32) {\n return _donId;\n }\n\n function registerRequest(\n uint64 subscriptionId,\n FunctionsRequest.Location codeLocation,\n string calldata source,\n FunctionsRequest.Location secretsLocation,\n bytes calldata encryptedSecretsReference,\n uint32 callbackGasLimit,\n string calldata name\n ) external onlyManager {\n if (bytes(name).length == 0) {revert CCGRequestNameEmpty();}\n\n CCGRequest storage req = _requests[subscriptionId];\n req.name = name;\n req.callbackGasLimit = callbackGasLimit;\n\n // Only JavaScript is supported for now\n req.config.language = FunctionsRequest.CodeLanguage.JavaScript;\n req.config.codeLocation = codeLocation;\n req.config.source = source;\n req.config.secretsLocation = secretsLocation;\n req.config.encryptedSecretsReference = encryptedSecretsReference;\n\n subscriptions.push(subscriptionId);\n }\n\n function removeRequest(uint64 subscriptionId) external onlyManager {\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n delete _requests[subscriptionId];\n\n // Find the index of the subscriptionId in the subscriptions array\n uint256 index = subscriptions.length;\n for (uint256 i = 0; i < subscriptions.length; i++) {\n if (index == subscriptions.length && subscriptions[i] == subscriptionId) index = i;\n if (index != subscriptions.length && i + 1 < subscriptions.length) subscriptions[i] = subscriptions[i + 1];\n }\n\n subscriptions.pop();\n }\n\n function getRequest(uint64 subscriptionId) external view onlyManager returns (CCGRequest memory) {\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n return _requests[subscriptionId];\n }\n// ---------------------------------------------------------------------------------------------------------------------\n modifier onlySource(bytes32 requestId) {\n if (unprocessed_responses[requestId].source != _msgSender()) {revert CCGOnlySameSourceAllowed(requestId);}\n _;\n }\n\n modifier onlyManager() {\n if (!hasRole(MANAGER_ROLE, tx.origin)) {revert CCGOnlyManagerAllowed();}\n _;\n }\n// ---------------------------------------------------------------------------------------------------------------------\n /**\n * @notice Triggers an on-demand Functions request using remote encrypted secrets\n * @param subscriptionId Subscription ID used to pay for request (FunctionsConsumer contract address must first be added to the subscription)\n * @param args String arguments passed into the source code and accessible via the global variable `args`\n * @param bytesArgs Bytes arguments passed into the source code and accessible via the global variable `bytesArgs` as hex strings\n * @param encryptedSecretsReference Reference pointing to encrypted secrets\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external onlyRole(CLIENT_ROLE) returns (bytes32 requestId) {\n CCGRequest storage request = _requests[subscriptionId];\n if (bytes(request.name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n\n FunctionsRequest.Request memory req = request.config;\n req.initializeRequest(req.codeLocation, FunctionsRequest.CodeLanguage.JavaScript, req.source);\n if (encryptedSecretsReference.length > 0) {req.encryptedSecretsReference = encryptedSecretsReference;}\n\n if (args.length > 0) {\n req.setArgs(args);\n }\n if (bytesArgs.length > 0) {\n req.setBytesArgs(bytesArgs);\n }\n\n requestId = _sendRequest(req.encodeCBOR(), subscriptionId, request.callbackGasLimit, _donId);\n unprocessed_responses[requestId].state = ICCGatewayClient.CCGResponseState.Sent;\n unprocessed_responses[requestId].source = _msgSender();\n }\n\n /**\n * @notice Store latest result/error\n * @param requestId The request ID, returned by sendRequest()\n * @param response Aggregated response from the user code\n * @param err Aggregated error from the user code or from the execution pipeline\n * Either response or error parameter will be set, but never both\n */\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal override {\n ICCGatewayClient.CCGResponse storage resp = unprocessed_responses[requestId];\n if (resp.state != ICCGatewayClient.CCGResponseState.Sent) {revert CCGRequestAlreadyFulfilled(requestId);}\n\n unprocessed_responses[requestId].state = err.length > 0 ? ICCGatewayClient.CCGResponseState.Error : ICCGatewayClient.CCGResponseState.Success;\n unprocessed_responses[requestId].data = response;\n unprocessed_responses[requestId].error = err;\n\n ICCGatewayClient(resp.source).callback(requestId);\n }\n\n /**\n * @dev Get the response data\n * @param requestId The request ID, returned by sendRequest()\n * @return response CCGResponse\n */\n function getResponse(bytes32 requestId, bool remove) external onlySource(requestId) returns (ICCGatewayClient.CCGResponse memory response) {\n response = unprocessed_responses[requestId];\n if (remove) {delete unprocessed_responses[requestId];}\n }\n}" + }, + "contracts/interfaces/ICCGateway.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\";\n\ninterface ICCGateway {\n struct CCGRequest {\n string name;\n uint32 callbackGasLimit;\n FunctionsRequest.Request config;\n }\n\n /**\n * @dev Can't register a request with an empty name\n */\n error CCGRequestNameEmpty();\n\n /**\n * @dev Only the same source of the requestId is allowed to call the function\n */\n error CCGOnlySameSourceAllowed(bytes32 requestId);\n\n /**\n * @dev Only a registered subscriptionId is allowed to call the function\n */\n error CCGRequestNotRegistered(uint64 subscriptionId);\n\n /**\n * @dev Can't fulfill a request that has already been fulfilled\n */\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\n\n /**\n * @dev Only A manager can call the function\n */\n error CCGOnlyManagerAllowed();\n\n /**\n * @dev Send a request to the Functions DON\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external returns (bytes32 requestId);\n\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\n}\n" + }, + "contracts/interfaces/ICCGatewayClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\ninterface ICCGatewayClient {\n enum CCGResponseState {Sent, Success, Error}\n\n struct CCGResponse {\n uint64 subscriptionId;\n address source;\n CCGResponseState state;\n bytes data;\n bytes error;\n }\n\n function callback(bytes32 requestId) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/polygonAmoy/solcInputs/be18bfdeea6869d68a166c8869814257.json b/packages/hardhat/deployments/polygonAmoy/solcInputs/be18bfdeea6869d68a166c8869814257.json new file mode 100644 index 0000000..b29947d --- /dev/null +++ b/packages/hardhat/deployments/polygonAmoy/solcInputs/be18bfdeea6869d68a166c8869814257.json @@ -0,0 +1,81 @@ +{ + "language": "Solidity", + "sources": { + "@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"./interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"./interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"./libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_router;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_router = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_router.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_router)) {\n revert OnlyRouterCanFulfill();\n }\n fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Chainlink Functions client interface.\ninterface IFunctionsClient {\n /// @notice Chainlink Functions response handler called by the Functions Router\n /// during fullilment from the designated transmitter node in an OCR round.\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\n /// @param response Aggregated response from the request's source code.\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\n /// @dev Either response or error parameter will be set, but never both.\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {FunctionsResponse} from \"../libraries/FunctionsResponse.sol\";\n\n/// @title Chainlink Functions Router interface.\ninterface IFunctionsRouter {\n /// @notice The identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n /// @return id - bytes32 id that can be passed to the \"getContractById\" of the Router\n function getAllowListId() external view returns (bytes32);\n\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n function setAllowListId(bytes32 allowListId) external;\n\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\n /// @return adminFee\n function getAdminFee() external view returns (uint72 adminFee);\n\n /// @notice Sends a request using the provided subscriptionId\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequest(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Sends a request to the proposed contracts\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequestToProposed(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Fulfill the request by:\n /// - calling back the data that the Oracle returned to the client contract\n /// - pay the DON for processing the request\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\n /// @param response response data from DON consensus\n /// @param err error from DON consensus\n /// @param juelsPerGas - current rate of juels/gas\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\n /// @param transmitter - The Node that transmitted the OCR report\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\n /// @return fulfillResult -\n /// @return callbackGasCostJuels -\n function fulfill(\n bytes memory response,\n bytes memory err,\n uint96 juelsPerGas,\n uint96 costWithoutFulfillment,\n address transmitter,\n FunctionsResponse.Commitment memory commitment\n ) external returns (FunctionsResponse.FulfillResult, uint96);\n\n /// @notice Validate requested gas limit is below the subscription max.\n /// @param subscriptionId subscription ID\n /// @param callbackGasLimit desired callback gas limit\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\n\n /// @notice Get the current contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current contract address\n function getContractById(bytes32 id) external view returns (address);\n\n /// @notice Get the proposed next contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current or proposed contract address\n function getProposedContractById(bytes32 id) external view returns (address);\n\n /// @notice Return the latest proprosal set\n /// @return ids The identifiers of the contracts to update\n /// @return to The addresses of the contracts that will be updated to\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\n\n /// @notice Proposes one or more updates to the contract routes\n /// @dev Only callable by owner\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\n\n /// @notice Updates the current contract routes to the proposed contracts\n /// @dev Only callable by owner\n function updateContracts() external;\n\n /// @dev Puts the system into an emergency stopped state.\n /// @dev Only callable by owner\n function pause() external;\n\n /// @dev Takes the system out of an emergency stopped state.\n /// @dev Only callable by owner\n function unpause() external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {CBOR} from \"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\";\n\n/// @title Library for encoding the input data of a Functions request into CBOR\nlibrary FunctionsRequest {\n using CBOR for CBOR.CBORBuffer;\n\n uint16 public constant REQUEST_DATA_VERSION = 1;\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\n\n enum Location {\n Inline, // Provided within the Request\n Remote, // Hosted through remote location that can be accessed through a provided URL\n DONHosted // Hosted on the DON's storage\n }\n\n enum CodeLanguage {\n JavaScript\n // In future version we may add other languages\n }\n\n struct Request {\n Location codeLocation; // ════════════╸ The location of the source code that will be executed on each node in the DON\n Location secretsLocation; // ═════════╸ The location of secrets that will be passed into the source code. *Only Remote secrets are supported\n CodeLanguage language; // ════════════╸ The coding language that the source code is written in\n string source; // ════════════════════╸ Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\n bytes encryptedSecretsReference; // ══╸ Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\n string[] args; // ════════════════════╸ String arguments that will be passed into the source code\n bytes[] bytesArgs; // ════════════════╸ Bytes arguments that will be passed into the source code\n }\n\n error EmptySource();\n error EmptySecrets();\n error EmptyArgs();\n error NoInlineSecrets();\n\n /// @notice Encodes a Request to CBOR encoded bytes\n /// @param self The request to encode\n /// @return CBOR encoded bytes\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"codeLocation\");\n buffer.writeUInt256(uint256(self.codeLocation));\n\n buffer.writeString(\"language\");\n buffer.writeUInt256(uint256(self.language));\n\n buffer.writeString(\"source\");\n buffer.writeString(self.source);\n\n if (self.args.length > 0) {\n buffer.writeString(\"args\");\n buffer.startArray();\n for (uint256 i = 0; i < self.args.length; ++i) {\n buffer.writeString(self.args[i]);\n }\n buffer.endSequence();\n }\n\n if (self.encryptedSecretsReference.length > 0) {\n if (self.secretsLocation == Location.Inline) {\n revert NoInlineSecrets();\n }\n buffer.writeString(\"secretsLocation\");\n buffer.writeUInt256(uint256(self.secretsLocation));\n buffer.writeString(\"secrets\");\n buffer.writeBytes(self.encryptedSecretsReference);\n }\n\n if (self.bytesArgs.length > 0) {\n buffer.writeString(\"bytesArgs\");\n buffer.startArray();\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\n buffer.writeBytes(self.bytesArgs[i]);\n }\n buffer.endSequence();\n }\n\n return buffer.buf.buf;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Sets the codeLocation and code on the request\n /// @param self The uninitialized request\n /// @param codeLocation The user provided source code location\n /// @param language The programming language of the user code\n /// @param source The user provided source code or a url\n function initializeRequest(\n Request memory self,\n Location codeLocation,\n CodeLanguage language,\n string memory source\n ) internal pure {\n if (bytes(source).length == 0) revert EmptySource();\n\n self.codeLocation = codeLocation;\n self.language = language;\n self.source = source;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Simplified version of initializeRequest for PoC\n /// @param self The uninitialized request\n /// @param javaScriptSource The user provided JS code (must not be empty)\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\n }\n\n /// @notice Adds Remote user encrypted secrets to a Request\n /// @param self The initialized request\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\n\n self.secretsLocation = Location.Remote;\n self.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n /// @notice Adds DON-hosted secrets reference to a Request\n /// @param self The initialized request\n /// @param slotID Slot ID of the user's secrets hosted on DON\n /// @param version User data version (for the slotID)\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"slotID\");\n buffer.writeUInt64(slotID);\n buffer.writeString(\"version\");\n buffer.writeUInt64(version);\n\n self.secretsLocation = Location.DONHosted;\n self.encryptedSecretsReference = buffer.buf.buf;\n }\n\n /// @notice Sets args for the user run function\n /// @param self The initialized request\n /// @param args The array of string args (must not be empty)\n function setArgs(Request memory self, string[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.args = args;\n }\n\n /// @notice Sets bytes args for the user run function\n /// @param self The initialized request\n /// @param args The array of bytes args (must not be empty)\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.bytesArgs = args;\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Library of types that are used for fulfillment of a Functions request\nlibrary FunctionsResponse {\n // Used to send request information from the Router to the Coordinator\n struct RequestMeta {\n bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\n bytes32 flags; // ═══════════════╸ Per-subscription flags\n address requestingContract; // ══╗ The client contract that is sending the request\n uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\n uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint64 initiatedRequests; // β•‘ The number of requests that have been started\n uint32 callbackGasLimit; // β•‘ The amount of gas that the callback to the consuming contract will be given\n uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data\n uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out\n address subscriptionOwner; // ═══╝ The owner of the billing subscription\n }\n\n enum FulfillResult {\n FULFILLED, // 0\n USER_CALLBACK_ERROR, // 1\n INVALID_REQUEST_ID, // 2\n COST_EXCEEDS_COMMITMENT, // 3\n INSUFFICIENT_GAS_PROVIDED, // 4\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\n INVALID_COMMITMENT // 6\n }\n\n struct Commitment {\n bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request\n address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request\n uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\n address client; // ════════════════════╗ The client contract that sent the request\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given\n uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint72 donFee; // β•‘ Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\n uint40 gasOverheadBeforeCallback; // β•‘ Represents the average gas execution cost before the fulfillment callback.\n uint40 gasOverheadAfterCallback; // β•‘ Represents the average gas execution cost after the fulfillment callback.\n uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"../v1_0_0/interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"../v1_0_0/interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"../v1_0_0/libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_functionsRouter;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_functionsRouter = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_functionsRouter.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_functionsRouter)) {\n revert OnlyRouterCanFulfill();\n }\n _fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}" + }, + "@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../@ensdomains/buffer/v0.1.0/Buffer.sol\";\n\n/**\n* @dev A library for populating CBOR encoded payload in Solidity.\n*\n* https://datatracker.ietf.org/doc/html/rfc7049\n*\n* The library offers various write* and start* methods to encode values of different types.\n* The resulted buffer can be obtained with data() method.\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\n* in an invalid CBOR if start/write/end flow is violated.\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\n* except for nested start/end pairs.\n*/\n\nlibrary CBOR {\n using Buffer for Buffer.buffer;\n\n struct CBORBuffer {\n Buffer.buffer buf;\n uint256 depth;\n }\n\n uint8 private constant MAJOR_TYPE_INT = 0;\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\n uint8 private constant MAJOR_TYPE_BYTES = 2;\n uint8 private constant MAJOR_TYPE_STRING = 3;\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\n uint8 private constant MAJOR_TYPE_MAP = 5;\n uint8 private constant MAJOR_TYPE_TAG = 6;\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\n\n uint8 private constant TAG_TYPE_BIGNUM = 2;\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\n\n uint8 private constant CBOR_FALSE = 20;\n uint8 private constant CBOR_TRUE = 21;\n uint8 private constant CBOR_NULL = 22;\n uint8 private constant CBOR_UNDEFINED = 23;\n\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\n Buffer.init(cbor.buf, capacity);\n cbor.depth = 0;\n return cbor;\n }\n\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\n require(buf.depth == 0, \"Invalid CBOR\");\n return buf.buf.buf;\n }\n\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\n writeBytes(buf, abi.encode(value));\n }\n\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\n if (value < 0) {\n buf.buf.appendUint8(\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\n );\n writeBytes(buf, abi.encode(uint256(-1 - value)));\n } else {\n writeUInt256(buf, uint256(value));\n }\n }\n\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\n }\n\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\n if(value >= 0) {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\n } else{\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\n }\n }\n\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\n buf.buf.append(value);\n }\n\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\n buf.buf.append(bytes(value));\n }\n\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\n }\n\n function writeNull(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_NULL);\n }\n\n function writeUndefined(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_UNDEFINED);\n }\n\n function startArray(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\n buf.depth += 1;\n }\n\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\n }\n\n function startMap(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\n buf.depth += 1;\n }\n\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\n }\n\n function endSequence(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\n buf.depth -= 1;\n }\n\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\n writeString(buf, key);\n writeString(buf, value);\n }\n\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\n writeString(buf, key);\n writeBytes(buf, value);\n }\n\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\n writeString(buf, key);\n writeUInt256(buf, value);\n }\n\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\n writeString(buf, key);\n writeInt256(buf, value);\n }\n\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\n writeString(buf, key);\n writeUInt64(buf, value);\n }\n\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\n writeString(buf, key);\n writeInt64(buf, value);\n }\n\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\n writeString(buf, key);\n writeBool(buf, value);\n }\n\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeNull(buf);\n }\n\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeUndefined(buf);\n }\n\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startMap(buf);\n }\n\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startArray(buf);\n }\n\n function writeFixedNumeric(\n CBORBuffer memory buf,\n uint8 major,\n uint64 value\n ) private pure {\n if (value <= 23) {\n buf.buf.appendUint8(uint8((major << 5) | value));\n } else if (value <= 0xFF) {\n buf.buf.appendUint8(uint8((major << 5) | 24));\n buf.buf.appendInt(value, 1);\n } else if (value <= 0xFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 25));\n buf.buf.appendInt(value, 2);\n } else if (value <= 0xFFFFFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 26));\n buf.buf.appendInt(value, 4);\n } else {\n buf.buf.appendUint8(uint8((major << 5) | 27));\n buf.buf.appendInt(value, 8);\n }\n }\n\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\n private\n pure\n {\n buf.buf.appendUint8(uint8((major << 5) | 31));\n }\n\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\n private\n pure\n {\n writeFixedNumeric(buf, major, length);\n }\n\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\n }\n}" + }, + "@openzeppelin/contracts/access/AccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.20;\n\nimport {IAccessControl} from \"./IAccessControl.sol\";\nimport {Context} from \"../utils/Context.sol\";\nimport {ERC165} from \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account => bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n" + }, + "@openzeppelin/contracts/access/IAccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "contracts/CCGateway.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport './interfaces/ICCGateway.sol';\nimport {ICCGatewayClient} from './interfaces/ICCGatewayClient.sol';\n\nimport {FunctionsClient} from \"@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol\";\nimport {AccessControl} from \"@openzeppelin/contracts/access/AccessControl.sol\";\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\";\n\ncontract CCGateway is ICCGateway, FunctionsClient, AccessControl {\n using FunctionsRequest for FunctionsRequest.Request;\n\n bytes32 public constant MANAGER_ROLE = keccak256(\"MANAGER_ROLE\");\n bytes32 public constant CLIENT_ROLE = keccak256(\"CLIENT_ROLE\");\n bytes32 private _donId; // DON ID for the Functions DON to which the requests are sent\n\n mapping(uint64 subscriptionId => CCGRequest) private _requests; // Each subscription can only handle one kind of request\n mapping(bytes32 requestId => ICCGatewayClient.CCGResponse) private unprocessed_responses; // Responses that have not been processed yet\n\n // array of registered subscriptions\n uint64[] public subscriptions;\n\n constructor(address router, bytes32 initialDonId, address initialOwner) FunctionsClient(router) {\n _donId = initialDonId;\n\n address to = address(0) == initialOwner ? _msgSender() : initialOwner;\n _grantRole(DEFAULT_ADMIN_ROLE, to);\n _grantRole(MANAGER_ROLE, to);\n }\n\n /**\n * @dev Set the DON ID\n * @param newDonId New DON ID\n */\n function setDonId(bytes32 newDonId) external onlyRole(getRoleAdmin(MANAGER_ROLE)) {\n _donId = newDonId;\n }\n\n /**\n * @dev Get the DON ID\n * @return DON ID\n */\n function donId() external view returns (bytes32) {\n return _donId;\n }\n\n function registerRequest(\n uint64 subscriptionId,\n FunctionsRequest.Location codeLocation,\n string calldata source,\n FunctionsRequest.Location secretsLocation,\n bytes calldata encryptedSecretsReference,\n uint32 callbackGasLimit,\n string calldata name\n ) external onlyManager {\n if (bytes(name).length == 0) {revert CCGRequestNameEmpty();}\n\n CCGRequest storage req = _requests[subscriptionId];\n if(bytes(req.name).length == 0) {subscriptions.push(subscriptionId);}\n\n req.name = name;\n req.callbackGasLimit = callbackGasLimit;\n\n // Only JavaScript is supported for now\n req.config.language = FunctionsRequest.CodeLanguage.JavaScript;\n req.config.codeLocation = codeLocation;\n req.config.source = source;\n req.config.secretsLocation = secretsLocation;\n req.config.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n function removeRequest(uint64 subscriptionId) external onlyManager {\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n delete _requests[subscriptionId];\n\n // Find the index of the subscriptionId in the subscriptions array\n uint256 index = subscriptions.length;\n for (uint256 i = 0; i < subscriptions.length; i++) {\n if (index == subscriptions.length && subscriptions[i] == subscriptionId) index = i;\n if (index != subscriptions.length && i + 1 < subscriptions.length) subscriptions[i] = subscriptions[i + 1];\n }\n\n subscriptions.pop();\n }\n\n function getRequest(uint64 subscriptionId) external view returns (CCGRequest memory) {\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n return _requests[subscriptionId];\n }\n// ---------------------------------------------------------------------------------------------------------------------\n modifier onlySource(bytes32 requestId) {\n if (unprocessed_responses[requestId].source != _msgSender()) {revert CCGOnlySameSourceAllowed(requestId);}\n _;\n }\n\n modifier onlyManager() {\n if (!hasRole(MANAGER_ROLE, tx.origin)) {revert CCGOnlyManagerAllowed();}\n _;\n }\n// ---------------------------------------------------------------------------------------------------------------------\n /**\n * @notice Triggers an on-demand Functions request using remote encrypted secrets\n * @param subscriptionId Subscription ID used to pay for request (FunctionsConsumer contract address must first be added to the subscription)\n * @param args String arguments passed into the source code and accessible via the global variable `args`\n * @param bytesArgs Bytes arguments passed into the source code and accessible via the global variable `bytesArgs` as hex strings\n * @param encryptedSecretsReference Reference pointing to encrypted secrets\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external onlyRole(CLIENT_ROLE) returns (bytes32 requestId) {\n CCGRequest storage request = _requests[subscriptionId];\n if (bytes(request.name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n\n FunctionsRequest.Request memory req = request.config;\n req.initializeRequest(req.codeLocation, FunctionsRequest.CodeLanguage.JavaScript, req.source);\n if (encryptedSecretsReference.length > 0) {req.encryptedSecretsReference = encryptedSecretsReference;}\n\n if (args.length > 0) {\n req.setArgs(args);\n }\n if (bytesArgs.length > 0) {\n req.setBytesArgs(bytesArgs);\n }\n\n requestId = _sendRequest(req.encodeCBOR(), subscriptionId, request.callbackGasLimit, _donId);\n unprocessed_responses[requestId].state = ICCGatewayClient.CCGResponseState.Sent;\n unprocessed_responses[requestId].source = _msgSender();\n }\n\n /**\n * @notice Store latest result/error\n * @param requestId The request ID, returned by sendRequest()\n * @param response Aggregated response from the user code\n * @param err Aggregated error from the user code or from the execution pipeline\n * Either response or error parameter will be set, but never both\n */\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal override {\n ICCGatewayClient.CCGResponse storage resp = unprocessed_responses[requestId];\n if (resp.state != ICCGatewayClient.CCGResponseState.Sent) {revert CCGRequestAlreadyFulfilled(requestId);}\n\n unprocessed_responses[requestId].state = err.length > 0 ? ICCGatewayClient.CCGResponseState.Error : ICCGatewayClient.CCGResponseState.Success;\n unprocessed_responses[requestId].data = response;\n unprocessed_responses[requestId].error = err;\n\n ICCGatewayClient(resp.source).callback(requestId);\n }\n\n /**\n * @dev Get the response data\n * @param requestId The request ID, returned by sendRequest()\n * @return response CCGResponse\n */\n function getResponse(bytes32 requestId, bool remove) external onlySource(requestId) returns (ICCGatewayClient.CCGResponse memory response) {\n response = unprocessed_responses[requestId];\n if (remove) {delete unprocessed_responses[requestId];}\n }\n}" + }, + "contracts/interfaces/ICCGateway.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\";\n\ninterface ICCGateway {\n struct CCGRequest {\n string name;\n uint32 callbackGasLimit;\n FunctionsRequest.Request config;\n }\n\n /**\n * @dev Can't register a request with an empty name\n */\n error CCGRequestNameEmpty();\n\n /**\n * @dev Only the same source of the requestId is allowed to call the function\n */\n error CCGOnlySameSourceAllowed(bytes32 requestId);\n\n /**\n * @dev Only a registered subscriptionId is allowed to call the function\n */\n error CCGRequestNotRegistered(uint64 subscriptionId);\n\n /**\n * @dev Can't fulfill a request that has already been fulfilled\n */\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\n\n /**\n * @dev Only A manager can call the function\n */\n error CCGOnlyManagerAllowed();\n\n /**\n * @dev Send a request to the Functions DON\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external returns (bytes32 requestId);\n\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\n}\n" + }, + "contracts/interfaces/ICCGatewayClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\ninterface ICCGatewayClient {\n enum CCGResponseState {Sent, Success, Error}\n\n struct CCGResponse {\n uint64 subscriptionId;\n address source;\n CCGResponseState state;\n bytes data;\n bytes error;\n }\n\n function callback(bytes32 requestId) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/polygonAmoy/solcInputs/da2f6e6d8541f69733b0b28912d4a325.json b/packages/hardhat/deployments/polygonAmoy/solcInputs/da2f6e6d8541f69733b0b28912d4a325.json new file mode 100644 index 0000000..0910532 --- /dev/null +++ b/packages/hardhat/deployments/polygonAmoy/solcInputs/da2f6e6d8541f69733b0b28912d4a325.json @@ -0,0 +1,66 @@ +{ + "language": "Solidity", + "sources": { + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Chainlink Functions client interface.\ninterface IFunctionsClient {\n /// @notice Chainlink Functions response handler called by the Functions Router\n /// during fullilment from the designated transmitter node in an OCR round.\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\n /// @param response Aggregated response from the request's source code.\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\n /// @dev Either response or error parameter will be set, but never both.\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {FunctionsResponse} from \"../libraries/FunctionsResponse.sol\";\n\n/// @title Chainlink Functions Router interface.\ninterface IFunctionsRouter {\n /// @notice The identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n /// @return id - bytes32 id that can be passed to the \"getContractById\" of the Router\n function getAllowListId() external view returns (bytes32);\n\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n function setAllowListId(bytes32 allowListId) external;\n\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\n /// @return adminFee\n function getAdminFee() external view returns (uint72 adminFee);\n\n /// @notice Sends a request using the provided subscriptionId\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequest(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Sends a request to the proposed contracts\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequestToProposed(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Fulfill the request by:\n /// - calling back the data that the Oracle returned to the client contract\n /// - pay the DON for processing the request\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\n /// @param response response data from DON consensus\n /// @param err error from DON consensus\n /// @param juelsPerGas - current rate of juels/gas\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\n /// @param transmitter - The Node that transmitted the OCR report\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\n /// @return fulfillResult -\n /// @return callbackGasCostJuels -\n function fulfill(\n bytes memory response,\n bytes memory err,\n uint96 juelsPerGas,\n uint96 costWithoutFulfillment,\n address transmitter,\n FunctionsResponse.Commitment memory commitment\n ) external returns (FunctionsResponse.FulfillResult, uint96);\n\n /// @notice Validate requested gas limit is below the subscription max.\n /// @param subscriptionId subscription ID\n /// @param callbackGasLimit desired callback gas limit\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\n\n /// @notice Get the current contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current contract address\n function getContractById(bytes32 id) external view returns (address);\n\n /// @notice Get the proposed next contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current or proposed contract address\n function getProposedContractById(bytes32 id) external view returns (address);\n\n /// @notice Return the latest proprosal set\n /// @return ids The identifiers of the contracts to update\n /// @return to The addresses of the contracts that will be updated to\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\n\n /// @notice Proposes one or more updates to the contract routes\n /// @dev Only callable by owner\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\n\n /// @notice Updates the current contract routes to the proposed contracts\n /// @dev Only callable by owner\n function updateContracts() external;\n\n /// @dev Puts the system into an emergency stopped state.\n /// @dev Only callable by owner\n function pause() external;\n\n /// @dev Takes the system out of an emergency stopped state.\n /// @dev Only callable by owner\n function unpause() external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {CBOR} from \"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\";\n\n/// @title Library for encoding the input data of a Functions request into CBOR\nlibrary FunctionsRequest {\n using CBOR for CBOR.CBORBuffer;\n\n uint16 public constant REQUEST_DATA_VERSION = 1;\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\n\n enum Location {\n Inline, // Provided within the Request\n Remote, // Hosted through remote location that can be accessed through a provided URL\n DONHosted // Hosted on the DON's storage\n }\n\n enum CodeLanguage {\n JavaScript\n // In future version we may add other languages\n }\n\n struct Request {\n Location codeLocation; // ════════════╸ The location of the source code that will be executed on each node in the DON\n Location secretsLocation; // ═════════╸ The location of secrets that will be passed into the source code. *Only Remote secrets are supported\n CodeLanguage language; // ════════════╸ The coding language that the source code is written in\n string source; // ════════════════════╸ Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\n bytes encryptedSecretsReference; // ══╸ Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\n string[] args; // ════════════════════╸ String arguments that will be passed into the source code\n bytes[] bytesArgs; // ════════════════╸ Bytes arguments that will be passed into the source code\n }\n\n error EmptySource();\n error EmptySecrets();\n error EmptyArgs();\n error NoInlineSecrets();\n\n /// @notice Encodes a Request to CBOR encoded bytes\n /// @param self The request to encode\n /// @return CBOR encoded bytes\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"codeLocation\");\n buffer.writeUInt256(uint256(self.codeLocation));\n\n buffer.writeString(\"language\");\n buffer.writeUInt256(uint256(self.language));\n\n buffer.writeString(\"source\");\n buffer.writeString(self.source);\n\n if (self.args.length > 0) {\n buffer.writeString(\"args\");\n buffer.startArray();\n for (uint256 i = 0; i < self.args.length; ++i) {\n buffer.writeString(self.args[i]);\n }\n buffer.endSequence();\n }\n\n if (self.encryptedSecretsReference.length > 0) {\n if (self.secretsLocation == Location.Inline) {\n revert NoInlineSecrets();\n }\n buffer.writeString(\"secretsLocation\");\n buffer.writeUInt256(uint256(self.secretsLocation));\n buffer.writeString(\"secrets\");\n buffer.writeBytes(self.encryptedSecretsReference);\n }\n\n if (self.bytesArgs.length > 0) {\n buffer.writeString(\"bytesArgs\");\n buffer.startArray();\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\n buffer.writeBytes(self.bytesArgs[i]);\n }\n buffer.endSequence();\n }\n\n return buffer.buf.buf;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Sets the codeLocation and code on the request\n /// @param self The uninitialized request\n /// @param codeLocation The user provided source code location\n /// @param language The programming language of the user code\n /// @param source The user provided source code or a url\n function initializeRequest(\n Request memory self,\n Location codeLocation,\n CodeLanguage language,\n string memory source\n ) internal pure {\n if (bytes(source).length == 0) revert EmptySource();\n\n self.codeLocation = codeLocation;\n self.language = language;\n self.source = source;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Simplified version of initializeRequest for PoC\n /// @param self The uninitialized request\n /// @param javaScriptSource The user provided JS code (must not be empty)\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\n }\n\n /// @notice Adds Remote user encrypted secrets to a Request\n /// @param self The initialized request\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\n\n self.secretsLocation = Location.Remote;\n self.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n /// @notice Adds DON-hosted secrets reference to a Request\n /// @param self The initialized request\n /// @param slotID Slot ID of the user's secrets hosted on DON\n /// @param version User data version (for the slotID)\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"slotID\");\n buffer.writeUInt64(slotID);\n buffer.writeString(\"version\");\n buffer.writeUInt64(version);\n\n self.secretsLocation = Location.DONHosted;\n self.encryptedSecretsReference = buffer.buf.buf;\n }\n\n /// @notice Sets args for the user run function\n /// @param self The initialized request\n /// @param args The array of string args (must not be empty)\n function setArgs(Request memory self, string[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.args = args;\n }\n\n /// @notice Sets bytes args for the user run function\n /// @param self The initialized request\n /// @param args The array of bytes args (must not be empty)\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.bytesArgs = args;\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Library of types that are used for fulfillment of a Functions request\nlibrary FunctionsResponse {\n // Used to send request information from the Router to the Coordinator\n struct RequestMeta {\n bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\n bytes32 flags; // ═══════════════╸ Per-subscription flags\n address requestingContract; // ══╗ The client contract that is sending the request\n uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\n uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint64 initiatedRequests; // β•‘ The number of requests that have been started\n uint32 callbackGasLimit; // β•‘ The amount of gas that the callback to the consuming contract will be given\n uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data\n uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out\n address subscriptionOwner; // ═══╝ The owner of the billing subscription\n }\n\n enum FulfillResult {\n FULFILLED, // 0\n USER_CALLBACK_ERROR, // 1\n INVALID_REQUEST_ID, // 2\n COST_EXCEEDS_COMMITMENT, // 3\n INSUFFICIENT_GAS_PROVIDED, // 4\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\n INVALID_COMMITMENT // 6\n }\n\n struct Commitment {\n bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request\n address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request\n uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\n address client; // ════════════════════╗ The client contract that sent the request\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given\n uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint72 donFee; // β•‘ Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\n uint40 gasOverheadBeforeCallback; // β•‘ Represents the average gas execution cost before the fulfillment callback.\n uint40 gasOverheadAfterCallback; // β•‘ Represents the average gas execution cost after the fulfillment callback.\n uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"../v1_0_0/interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"../v1_0_0/interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"../v1_0_0/libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_functionsRouter;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_functionsRouter = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_functionsRouter.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_functionsRouter)) {\n revert OnlyRouterCanFulfill();\n }\n _fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}" + }, + "@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../@ensdomains/buffer/v0.1.0/Buffer.sol\";\n\n/**\n* @dev A library for populating CBOR encoded payload in Solidity.\n*\n* https://datatracker.ietf.org/doc/html/rfc7049\n*\n* The library offers various write* and start* methods to encode values of different types.\n* The resulted buffer can be obtained with data() method.\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\n* in an invalid CBOR if start/write/end flow is violated.\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\n* except for nested start/end pairs.\n*/\n\nlibrary CBOR {\n using Buffer for Buffer.buffer;\n\n struct CBORBuffer {\n Buffer.buffer buf;\n uint256 depth;\n }\n\n uint8 private constant MAJOR_TYPE_INT = 0;\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\n uint8 private constant MAJOR_TYPE_BYTES = 2;\n uint8 private constant MAJOR_TYPE_STRING = 3;\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\n uint8 private constant MAJOR_TYPE_MAP = 5;\n uint8 private constant MAJOR_TYPE_TAG = 6;\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\n\n uint8 private constant TAG_TYPE_BIGNUM = 2;\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\n\n uint8 private constant CBOR_FALSE = 20;\n uint8 private constant CBOR_TRUE = 21;\n uint8 private constant CBOR_NULL = 22;\n uint8 private constant CBOR_UNDEFINED = 23;\n\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\n Buffer.init(cbor.buf, capacity);\n cbor.depth = 0;\n return cbor;\n }\n\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\n require(buf.depth == 0, \"Invalid CBOR\");\n return buf.buf.buf;\n }\n\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\n writeBytes(buf, abi.encode(value));\n }\n\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\n if (value < 0) {\n buf.buf.appendUint8(\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\n );\n writeBytes(buf, abi.encode(uint256(-1 - value)));\n } else {\n writeUInt256(buf, uint256(value));\n }\n }\n\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\n }\n\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\n if(value >= 0) {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\n } else{\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\n }\n }\n\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\n buf.buf.append(value);\n }\n\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\n buf.buf.append(bytes(value));\n }\n\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\n }\n\n function writeNull(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_NULL);\n }\n\n function writeUndefined(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_UNDEFINED);\n }\n\n function startArray(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\n buf.depth += 1;\n }\n\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\n }\n\n function startMap(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\n buf.depth += 1;\n }\n\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\n }\n\n function endSequence(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\n buf.depth -= 1;\n }\n\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\n writeString(buf, key);\n writeString(buf, value);\n }\n\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\n writeString(buf, key);\n writeBytes(buf, value);\n }\n\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\n writeString(buf, key);\n writeUInt256(buf, value);\n }\n\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\n writeString(buf, key);\n writeInt256(buf, value);\n }\n\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\n writeString(buf, key);\n writeUInt64(buf, value);\n }\n\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\n writeString(buf, key);\n writeInt64(buf, value);\n }\n\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\n writeString(buf, key);\n writeBool(buf, value);\n }\n\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeNull(buf);\n }\n\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeUndefined(buf);\n }\n\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startMap(buf);\n }\n\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startArray(buf);\n }\n\n function writeFixedNumeric(\n CBORBuffer memory buf,\n uint8 major,\n uint64 value\n ) private pure {\n if (value <= 23) {\n buf.buf.appendUint8(uint8((major << 5) | value));\n } else if (value <= 0xFF) {\n buf.buf.appendUint8(uint8((major << 5) | 24));\n buf.buf.appendInt(value, 1);\n } else if (value <= 0xFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 25));\n buf.buf.appendInt(value, 2);\n } else if (value <= 0xFFFFFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 26));\n buf.buf.appendInt(value, 4);\n } else {\n buf.buf.appendUint8(uint8((major << 5) | 27));\n buf.buf.appendInt(value, 8);\n }\n }\n\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\n private\n pure\n {\n buf.buf.appendUint8(uint8((major << 5) | 31));\n }\n\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\n private\n pure\n {\n writeFixedNumeric(buf, major, length);\n }\n\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\n }\n}" + }, + "contracts/CCExampleClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from \"./interfaces/ICCGatewayClient.sol\";\nimport {ICCGateway} from \"./interfaces/ICCGateway.sol\";\n\ncontract CCExampleClient is ICCGatewayClient {\n ICCGateway private immutable gateway;\n\n uint64 public subscriptionId = 0;\n bytes public encryptedSecretsReference = \"\";\n\n event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response);\n event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error);\n\n constructor(address gatewayAddress) {\n gateway = ICCGateway(gatewayAddress);\n }\n\n function updateSubscriptionId(uint64 _subscriptionId) external {\n subscriptionId = _subscriptionId;\n }\n\n function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external {\n encryptedSecretsReference = _encryptedSecretsReference;\n }\n\n function request(string[] calldata args, bytes[] calldata bytesArgs) external {\n require(subscriptionId != 0, \"Subscription ID not set\");\n\n gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference);\n }\n\n function callback(bytes32 requestId) external override {\n ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true);\n\n if (response.state == ICCGatewayClient.CCGResponseState.Success) {\n emit ResponseReceived(response.subscriptionId, requestId, string(response.data));\n } else {\n emit ErrorReceived(response.subscriptionId, requestId, string(response.error));\n }\n }\n}\n" + }, + "contracts/CCNotificationClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {CCExampleClient} from \"./CCExampleClient.sol\";\n\ncontract CCNotificationClient is CCExampleClient {\n constructor(address gatewayAddress) CCExampleClient(gatewayAddress) {}\n}\n" + }, + "contracts/interfaces/ICCGateway.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\";\n\ninterface ICCGateway {\n struct CCGRequest {\n string name;\n uint32 callbackGasLimit;\n FunctionsRequest.Request config;\n }\n\n /**\n * @dev Can't register a request with an empty name\n */\n error CCGRequestNameEmpty();\n\n /**\n * @dev Only the same source of the requestId is allowed to call the function\n */\n error CCGOnlySameSourceAllowed(bytes32 requestId);\n\n /**\n * @dev Only a registered subscriptionId is allowed to call the function\n */\n error CCGRequestNotRegistered(uint64 subscriptionId);\n\n /**\n * @dev Can't fulfill a request that has already been fulfilled\n */\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\n\n /**\n * @dev Only A manager can call the function\n */\n error CCGOnlyManagerAllowed();\n\n /**\n * @dev Send a request to the Functions DON\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external returns (bytes32 requestId);\n\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\n}\n" + }, + "contracts/interfaces/ICCGatewayClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\ninterface ICCGatewayClient {\n enum CCGResponseState {Sent, Success, Error}\n\n struct CCGResponse {\n uint64 subscriptionId;\n address source;\n CCGResponseState state;\n bytes data;\n bytes error;\n }\n\n function callback(bytes32 requestId) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/polygonAmoy/solcInputs/fc0de00091a2e0264aed2d3e71476d4f.json b/packages/hardhat/deployments/polygonAmoy/solcInputs/fc0de00091a2e0264aed2d3e71476d4f.json new file mode 100644 index 0000000..0b0fb2b --- /dev/null +++ b/packages/hardhat/deployments/polygonAmoy/solcInputs/fc0de00091a2e0264aed2d3e71476d4f.json @@ -0,0 +1,63 @@ +{ + "language": "Solidity", + "sources": { + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Chainlink Functions client interface.\ninterface IFunctionsClient {\n /// @notice Chainlink Functions response handler called by the Functions Router\n /// during fullilment from the designated transmitter node in an OCR round.\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\n /// @param response Aggregated response from the request's source code.\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\n /// @dev Either response or error parameter will be set, but never both.\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {FunctionsResponse} from \"../libraries/FunctionsResponse.sol\";\n\n/// @title Chainlink Functions Router interface.\ninterface IFunctionsRouter {\n /// @notice The identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n /// @return id - bytes32 id that can be passed to the \"getContractById\" of the Router\n function getAllowListId() external view returns (bytes32);\n\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n function setAllowListId(bytes32 allowListId) external;\n\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\n /// @return adminFee\n function getAdminFee() external view returns (uint72 adminFee);\n\n /// @notice Sends a request using the provided subscriptionId\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequest(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Sends a request to the proposed contracts\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequestToProposed(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Fulfill the request by:\n /// - calling back the data that the Oracle returned to the client contract\n /// - pay the DON for processing the request\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\n /// @param response response data from DON consensus\n /// @param err error from DON consensus\n /// @param juelsPerGas - current rate of juels/gas\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\n /// @param transmitter - The Node that transmitted the OCR report\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\n /// @return fulfillResult -\n /// @return callbackGasCostJuels -\n function fulfill(\n bytes memory response,\n bytes memory err,\n uint96 juelsPerGas,\n uint96 costWithoutFulfillment,\n address transmitter,\n FunctionsResponse.Commitment memory commitment\n ) external returns (FunctionsResponse.FulfillResult, uint96);\n\n /// @notice Validate requested gas limit is below the subscription max.\n /// @param subscriptionId subscription ID\n /// @param callbackGasLimit desired callback gas limit\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\n\n /// @notice Get the current contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current contract address\n function getContractById(bytes32 id) external view returns (address);\n\n /// @notice Get the proposed next contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current or proposed contract address\n function getProposedContractById(bytes32 id) external view returns (address);\n\n /// @notice Return the latest proprosal set\n /// @return ids The identifiers of the contracts to update\n /// @return to The addresses of the contracts that will be updated to\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\n\n /// @notice Proposes one or more updates to the contract routes\n /// @dev Only callable by owner\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\n\n /// @notice Updates the current contract routes to the proposed contracts\n /// @dev Only callable by owner\n function updateContracts() external;\n\n /// @dev Puts the system into an emergency stopped state.\n /// @dev Only callable by owner\n function pause() external;\n\n /// @dev Takes the system out of an emergency stopped state.\n /// @dev Only callable by owner\n function unpause() external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {CBOR} from \"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\";\n\n/// @title Library for encoding the input data of a Functions request into CBOR\nlibrary FunctionsRequest {\n using CBOR for CBOR.CBORBuffer;\n\n uint16 public constant REQUEST_DATA_VERSION = 1;\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\n\n enum Location {\n Inline, // Provided within the Request\n Remote, // Hosted through remote location that can be accessed through a provided URL\n DONHosted // Hosted on the DON's storage\n }\n\n enum CodeLanguage {\n JavaScript\n // In future version we may add other languages\n }\n\n struct Request {\n Location codeLocation; // ════════════╸ The location of the source code that will be executed on each node in the DON\n Location secretsLocation; // ═════════╸ The location of secrets that will be passed into the source code. *Only Remote secrets are supported\n CodeLanguage language; // ════════════╸ The coding language that the source code is written in\n string source; // ════════════════════╸ Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\n bytes encryptedSecretsReference; // ══╸ Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\n string[] args; // ════════════════════╸ String arguments that will be passed into the source code\n bytes[] bytesArgs; // ════════════════╸ Bytes arguments that will be passed into the source code\n }\n\n error EmptySource();\n error EmptySecrets();\n error EmptyArgs();\n error NoInlineSecrets();\n\n /// @notice Encodes a Request to CBOR encoded bytes\n /// @param self The request to encode\n /// @return CBOR encoded bytes\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"codeLocation\");\n buffer.writeUInt256(uint256(self.codeLocation));\n\n buffer.writeString(\"language\");\n buffer.writeUInt256(uint256(self.language));\n\n buffer.writeString(\"source\");\n buffer.writeString(self.source);\n\n if (self.args.length > 0) {\n buffer.writeString(\"args\");\n buffer.startArray();\n for (uint256 i = 0; i < self.args.length; ++i) {\n buffer.writeString(self.args[i]);\n }\n buffer.endSequence();\n }\n\n if (self.encryptedSecretsReference.length > 0) {\n if (self.secretsLocation == Location.Inline) {\n revert NoInlineSecrets();\n }\n buffer.writeString(\"secretsLocation\");\n buffer.writeUInt256(uint256(self.secretsLocation));\n buffer.writeString(\"secrets\");\n buffer.writeBytes(self.encryptedSecretsReference);\n }\n\n if (self.bytesArgs.length > 0) {\n buffer.writeString(\"bytesArgs\");\n buffer.startArray();\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\n buffer.writeBytes(self.bytesArgs[i]);\n }\n buffer.endSequence();\n }\n\n return buffer.buf.buf;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Sets the codeLocation and code on the request\n /// @param self The uninitialized request\n /// @param codeLocation The user provided source code location\n /// @param language The programming language of the user code\n /// @param source The user provided source code or a url\n function initializeRequest(\n Request memory self,\n Location codeLocation,\n CodeLanguage language,\n string memory source\n ) internal pure {\n if (bytes(source).length == 0) revert EmptySource();\n\n self.codeLocation = codeLocation;\n self.language = language;\n self.source = source;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Simplified version of initializeRequest for PoC\n /// @param self The uninitialized request\n /// @param javaScriptSource The user provided JS code (must not be empty)\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\n }\n\n /// @notice Adds Remote user encrypted secrets to a Request\n /// @param self The initialized request\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\n\n self.secretsLocation = Location.Remote;\n self.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n /// @notice Adds DON-hosted secrets reference to a Request\n /// @param self The initialized request\n /// @param slotID Slot ID of the user's secrets hosted on DON\n /// @param version User data version (for the slotID)\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"slotID\");\n buffer.writeUInt64(slotID);\n buffer.writeString(\"version\");\n buffer.writeUInt64(version);\n\n self.secretsLocation = Location.DONHosted;\n self.encryptedSecretsReference = buffer.buf.buf;\n }\n\n /// @notice Sets args for the user run function\n /// @param self The initialized request\n /// @param args The array of string args (must not be empty)\n function setArgs(Request memory self, string[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.args = args;\n }\n\n /// @notice Sets bytes args for the user run function\n /// @param self The initialized request\n /// @param args The array of bytes args (must not be empty)\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.bytesArgs = args;\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Library of types that are used for fulfillment of a Functions request\nlibrary FunctionsResponse {\n // Used to send request information from the Router to the Coordinator\n struct RequestMeta {\n bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\n bytes32 flags; // ═══════════════╸ Per-subscription flags\n address requestingContract; // ══╗ The client contract that is sending the request\n uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\n uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint64 initiatedRequests; // β•‘ The number of requests that have been started\n uint32 callbackGasLimit; // β•‘ The amount of gas that the callback to the consuming contract will be given\n uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data\n uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out\n address subscriptionOwner; // ═══╝ The owner of the billing subscription\n }\n\n enum FulfillResult {\n FULFILLED, // 0\n USER_CALLBACK_ERROR, // 1\n INVALID_REQUEST_ID, // 2\n COST_EXCEEDS_COMMITMENT, // 3\n INSUFFICIENT_GAS_PROVIDED, // 4\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\n INVALID_COMMITMENT // 6\n }\n\n struct Commitment {\n bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request\n address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request\n uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\n address client; // ════════════════════╗ The client contract that sent the request\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given\n uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint72 donFee; // β•‘ Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\n uint40 gasOverheadBeforeCallback; // β•‘ Represents the average gas execution cost before the fulfillment callback.\n uint40 gasOverheadAfterCallback; // β•‘ Represents the average gas execution cost after the fulfillment callback.\n uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"../v1_0_0/interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"../v1_0_0/interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"../v1_0_0/libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_functionsRouter;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_functionsRouter = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_functionsRouter.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_functionsRouter)) {\n revert OnlyRouterCanFulfill();\n }\n _fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}" + }, + "@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../@ensdomains/buffer/v0.1.0/Buffer.sol\";\n\n/**\n* @dev A library for populating CBOR encoded payload in Solidity.\n*\n* https://datatracker.ietf.org/doc/html/rfc7049\n*\n* The library offers various write* and start* methods to encode values of different types.\n* The resulted buffer can be obtained with data() method.\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\n* in an invalid CBOR if start/write/end flow is violated.\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\n* except for nested start/end pairs.\n*/\n\nlibrary CBOR {\n using Buffer for Buffer.buffer;\n\n struct CBORBuffer {\n Buffer.buffer buf;\n uint256 depth;\n }\n\n uint8 private constant MAJOR_TYPE_INT = 0;\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\n uint8 private constant MAJOR_TYPE_BYTES = 2;\n uint8 private constant MAJOR_TYPE_STRING = 3;\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\n uint8 private constant MAJOR_TYPE_MAP = 5;\n uint8 private constant MAJOR_TYPE_TAG = 6;\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\n\n uint8 private constant TAG_TYPE_BIGNUM = 2;\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\n\n uint8 private constant CBOR_FALSE = 20;\n uint8 private constant CBOR_TRUE = 21;\n uint8 private constant CBOR_NULL = 22;\n uint8 private constant CBOR_UNDEFINED = 23;\n\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\n Buffer.init(cbor.buf, capacity);\n cbor.depth = 0;\n return cbor;\n }\n\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\n require(buf.depth == 0, \"Invalid CBOR\");\n return buf.buf.buf;\n }\n\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\n writeBytes(buf, abi.encode(value));\n }\n\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\n if (value < 0) {\n buf.buf.appendUint8(\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\n );\n writeBytes(buf, abi.encode(uint256(-1 - value)));\n } else {\n writeUInt256(buf, uint256(value));\n }\n }\n\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\n }\n\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\n if(value >= 0) {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\n } else{\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\n }\n }\n\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\n buf.buf.append(value);\n }\n\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\n buf.buf.append(bytes(value));\n }\n\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\n }\n\n function writeNull(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_NULL);\n }\n\n function writeUndefined(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_UNDEFINED);\n }\n\n function startArray(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\n buf.depth += 1;\n }\n\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\n }\n\n function startMap(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\n buf.depth += 1;\n }\n\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\n }\n\n function endSequence(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\n buf.depth -= 1;\n }\n\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\n writeString(buf, key);\n writeString(buf, value);\n }\n\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\n writeString(buf, key);\n writeBytes(buf, value);\n }\n\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\n writeString(buf, key);\n writeUInt256(buf, value);\n }\n\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\n writeString(buf, key);\n writeInt256(buf, value);\n }\n\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\n writeString(buf, key);\n writeUInt64(buf, value);\n }\n\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\n writeString(buf, key);\n writeInt64(buf, value);\n }\n\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\n writeString(buf, key);\n writeBool(buf, value);\n }\n\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeNull(buf);\n }\n\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeUndefined(buf);\n }\n\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startMap(buf);\n }\n\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startArray(buf);\n }\n\n function writeFixedNumeric(\n CBORBuffer memory buf,\n uint8 major,\n uint64 value\n ) private pure {\n if (value <= 23) {\n buf.buf.appendUint8(uint8((major << 5) | value));\n } else if (value <= 0xFF) {\n buf.buf.appendUint8(uint8((major << 5) | 24));\n buf.buf.appendInt(value, 1);\n } else if (value <= 0xFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 25));\n buf.buf.appendInt(value, 2);\n } else if (value <= 0xFFFFFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 26));\n buf.buf.appendInt(value, 4);\n } else {\n buf.buf.appendUint8(uint8((major << 5) | 27));\n buf.buf.appendInt(value, 8);\n }\n }\n\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\n private\n pure\n {\n buf.buf.appendUint8(uint8((major << 5) | 31));\n }\n\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\n private\n pure\n {\n writeFixedNumeric(buf, major, length);\n }\n\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\n }\n}" + }, + "contracts/CCExampleClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from \"./interfaces/ICCGatewayClient.sol\";\nimport {ICCGateway} from \"./interfaces/ICCGateway.sol\";\n\ncontract CCExampleClient is ICCGatewayClient {\n ICCGateway private immutable gateway;\n\n uint64 public subscriptionId = 0;\n bytes public encryptedSecretsReference = \"\";\n\n event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response);\n event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error);\n\n constructor(address gatewayAddress) {\n gateway = ICCGateway(gatewayAddress);\n }\n\n function updateSubscriptionId(uint64 _subscriptionId) external {\n subscriptionId = _subscriptionId;\n }\n\n function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external {\n encryptedSecretsReference = _encryptedSecretsReference;\n }\n\n function request(string[] calldata args, bytes[] calldata bytesArgs) external {\n require(subscriptionId != 0, \"Subscription ID not set\");\n\n gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference);\n }\n\n function callback(bytes32 requestId) external override {\n ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true);\n\n if (response.state == ICCGatewayClient.CCGResponseState.Success) {\n emit ResponseReceived(response.subscriptionId, requestId, string(response.data));\n } else {\n emit ErrorReceived(response.subscriptionId, requestId, string(response.error));\n }\n }\n}\n" + }, + "contracts/interfaces/ICCGateway.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\";\n\ninterface ICCGateway {\n struct CCGRequest {\n string name;\n uint32 callbackGasLimit;\n FunctionsRequest.Request config;\n }\n\n /**\n * @dev Can't register a request with an empty name\n */\n error CCGRequestNameEmpty();\n\n /**\n * @dev Only the same source of the requestId is allowed to call the function\n */\n error CCGOnlySameSourceAllowed(bytes32 requestId);\n\n /**\n * @dev Only a registered subscriptionId is allowed to call the function\n */\n error CCGRequestNotRegistered(uint64 subscriptionId);\n\n /**\n * @dev Can't fulfill a request that has already been fulfilled\n */\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\n\n /**\n * @dev Only A manager can call the function\n */\n error CCGOnlyManagerAllowed();\n\n /**\n * @dev Send a request to the Functions DON\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external returns (bytes32 requestId);\n\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\n}\n" + }, + "contracts/interfaces/ICCGatewayClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\ninterface ICCGatewayClient {\n enum CCGResponseState {Sent, Success, Error}\n\n struct CCGResponse {\n uint64 subscriptionId;\n address source;\n CCGResponseState state;\n bytes data;\n bytes error;\n }\n\n function callback(bytes32 requestId) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/sepolia/.chainId b/packages/hardhat/deployments/sepolia/.chainId new file mode 100644 index 0000000..bd8d1cd --- /dev/null +++ b/packages/hardhat/deployments/sepolia/.chainId @@ -0,0 +1 @@ +11155111 \ No newline at end of file diff --git a/packages/hardhat/deployments/sepolia/CCExampleClient.json b/packages/hardhat/deployments/sepolia/CCExampleClient.json new file mode 100644 index 0000000..1181f46 --- /dev/null +++ b/packages/hardhat/deployments/sepolia/CCExampleClient.json @@ -0,0 +1,215 @@ +{ + "address": "0xDfE66B41946f857656f7FfdF1fa0eeC3ef8945a9", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "gatewayAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "error", + "type": "string" + } + ], + "name": "ErrorReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "response", + "type": "string" + } + ], + "name": "ResponseReceived", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + } + ], + "name": "callback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "encryptedSecretsReference", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "args", + "type": "string[]" + }, + { + "internalType": "bytes[]", + "name": "bytesArgs", + "type": "bytes[]" + } + ], + "name": "request", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "subscriptionId", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_encryptedSecretsReference", + "type": "bytes" + } + ], + "name": "updateEncryptedSecretsReference", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "_subscriptionId", + "type": "uint64" + } + ], + "name": "updateSubscriptionId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xb0c05d8df35918d99b7ea50f09b06dd6fefc0aeaaa10bbc749748a95c1c3f672", + "receipt": { + "to": null, + "from": "0xD10F43A0aa00D244DAcFBE3C49b9B918B717Ff2c", + "contractAddress": "0xDfE66B41946f857656f7FfdF1fa0eeC3ef8945a9", + "transactionIndex": 64, + "gasUsed": "686011", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x55a0326a789605967564ce1f66a4bf446950b568749ac4e8c414ebf21a0d2c36", + "transactionHash": "0xb0c05d8df35918d99b7ea50f09b06dd6fefc0aeaaa10bbc749748a95c1c3f672", + "logs": [], + "blockNumber": 6028203, + "cumulativeGasUsed": "8387344", + "status": 1, + "byzantium": true + }, + "args": [ + "0xe1fA8f43D89afE8fcBA4FABbd3e6e6a4C3360409" + ], + "numDeployments": 2, + "solcInputHash": "fc0de00091a2e0264aed2d3e71476d4f", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"gatewayAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"error\",\"type\":\"string\"}],\"name\":\"ErrorReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"response\",\"type\":\"string\"}],\"name\":\"ResponseReceived\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"callback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"encryptedSecretsReference\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"args\",\"type\":\"string[]\"},{\"internalType\":\"bytes[]\",\"name\":\"bytesArgs\",\"type\":\"bytes[]\"}],\"name\":\"request\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"subscriptionId\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_encryptedSecretsReference\",\"type\":\"bytes\"}],\"name\":\"updateEncryptedSecretsReference\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_subscriptionId\",\"type\":\"uint64\"}],\"name\":\"updateSubscriptionId\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/CCExampleClient.sol\":\"CCExampleClient\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\n/// @title Chainlink Functions client interface.\\ninterface IFunctionsClient {\\n /// @notice Chainlink Functions response handler called by the Functions Router\\n /// during fullilment from the designated transmitter node in an OCR round.\\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\\n /// @param response Aggregated response from the request's source code.\\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\\n /// @dev Either response or error parameter will be set, but never both.\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\\n}\\n\",\"keccak256\":\"0x6117b82e7c4eec44ce557b0fc8bc1ac5f49e5d160ac6d4485452d6aafdd762ff\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {FunctionsResponse} from \\\"../libraries/FunctionsResponse.sol\\\";\\n\\n/// @title Chainlink Functions Router interface.\\ninterface IFunctionsRouter {\\n /// @notice The identifier of the route to retrieve the address of the access control contract\\n /// The access control contract controls which accounts can manage subscriptions\\n /// @return id - bytes32 id that can be passed to the \\\"getContractById\\\" of the Router\\n function getAllowListId() external view returns (bytes32);\\n\\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\\n /// The access control contract controls which accounts can manage subscriptions\\n function setAllowListId(bytes32 allowListId) external;\\n\\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\\n /// @return adminFee\\n function getAdminFee() external view returns (uint72 adminFee);\\n\\n /// @notice Sends a request using the provided subscriptionId\\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\\n /// a client can make requests from different contracts referencing the same subscription\\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\\n /// @param dataVersion - Gas limit for the fulfillment callback\\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\\n /// @param donId - An identifier used to determine which route to send the request along\\n /// @return requestId - A unique request identifier\\n function sendRequest(\\n uint64 subscriptionId,\\n bytes calldata data,\\n uint16 dataVersion,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) external returns (bytes32);\\n\\n /// @notice Sends a request to the proposed contracts\\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\\n /// a client can make requests from different contracts referencing the same subscription\\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\\n /// @param dataVersion - Gas limit for the fulfillment callback\\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\\n /// @param donId - An identifier used to determine which route to send the request along\\n /// @return requestId - A unique request identifier\\n function sendRequestToProposed(\\n uint64 subscriptionId,\\n bytes calldata data,\\n uint16 dataVersion,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) external returns (bytes32);\\n\\n /// @notice Fulfill the request by:\\n /// - calling back the data that the Oracle returned to the client contract\\n /// - pay the DON for processing the request\\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\\n /// @param response response data from DON consensus\\n /// @param err error from DON consensus\\n /// @param juelsPerGas - current rate of juels/gas\\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\\n /// @param transmitter - The Node that transmitted the OCR report\\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\\n /// @return fulfillResult -\\n /// @return callbackGasCostJuels -\\n function fulfill(\\n bytes memory response,\\n bytes memory err,\\n uint96 juelsPerGas,\\n uint96 costWithoutFulfillment,\\n address transmitter,\\n FunctionsResponse.Commitment memory commitment\\n ) external returns (FunctionsResponse.FulfillResult, uint96);\\n\\n /// @notice Validate requested gas limit is below the subscription max.\\n /// @param subscriptionId subscription ID\\n /// @param callbackGasLimit desired callback gas limit\\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\\n\\n /// @notice Get the current contract given an ID\\n /// @param id A bytes32 identifier for the route\\n /// @return contract The current contract address\\n function getContractById(bytes32 id) external view returns (address);\\n\\n /// @notice Get the proposed next contract given an ID\\n /// @param id A bytes32 identifier for the route\\n /// @return contract The current or proposed contract address\\n function getProposedContractById(bytes32 id) external view returns (address);\\n\\n /// @notice Return the latest proprosal set\\n /// @return ids The identifiers of the contracts to update\\n /// @return to The addresses of the contracts that will be updated to\\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\\n\\n /// @notice Proposes one or more updates to the contract routes\\n /// @dev Only callable by owner\\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\\n\\n /// @notice Updates the current contract routes to the proposed contracts\\n /// @dev Only callable by owner\\n function updateContracts() external;\\n\\n /// @dev Puts the system into an emergency stopped state.\\n /// @dev Only callable by owner\\n function pause() external;\\n\\n /// @dev Takes the system out of an emergency stopped state.\\n /// @dev Only callable by owner\\n function unpause() external;\\n}\\n\",\"keccak256\":\"0x44db41e8ff90c2828ca0ada125abc4b411921a86514a4a047fd9fd43ba9d7e08\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {CBOR} from \\\"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\\\";\\n\\n/// @title Library for encoding the input data of a Functions request into CBOR\\nlibrary FunctionsRequest {\\n using CBOR for CBOR.CBORBuffer;\\n\\n uint16 public constant REQUEST_DATA_VERSION = 1;\\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\\n\\n enum Location {\\n Inline, // Provided within the Request\\n Remote, // Hosted through remote location that can be accessed through a provided URL\\n DONHosted // Hosted on the DON's storage\\n }\\n\\n enum CodeLanguage {\\n JavaScript\\n // In future version we may add other languages\\n }\\n\\n struct Request {\\n Location codeLocation; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The location of the source code that will be executed on each node in the DON\\n Location secretsLocation; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The location of secrets that will be passed into the source code. *Only Remote secrets are supported\\n CodeLanguage language; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The coding language that the source code is written in\\n string source; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\\n bytes encryptedSecretsReference; // \\u2550\\u2550\\u2578 Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\\n string[] args; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 String arguments that will be passed into the source code\\n bytes[] bytesArgs; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Bytes arguments that will be passed into the source code\\n }\\n\\n error EmptySource();\\n error EmptySecrets();\\n error EmptyArgs();\\n error NoInlineSecrets();\\n\\n /// @notice Encodes a Request to CBOR encoded bytes\\n /// @param self The request to encode\\n /// @return CBOR encoded bytes\\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\\n\\n buffer.writeString(\\\"codeLocation\\\");\\n buffer.writeUInt256(uint256(self.codeLocation));\\n\\n buffer.writeString(\\\"language\\\");\\n buffer.writeUInt256(uint256(self.language));\\n\\n buffer.writeString(\\\"source\\\");\\n buffer.writeString(self.source);\\n\\n if (self.args.length > 0) {\\n buffer.writeString(\\\"args\\\");\\n buffer.startArray();\\n for (uint256 i = 0; i < self.args.length; ++i) {\\n buffer.writeString(self.args[i]);\\n }\\n buffer.endSequence();\\n }\\n\\n if (self.encryptedSecretsReference.length > 0) {\\n if (self.secretsLocation == Location.Inline) {\\n revert NoInlineSecrets();\\n }\\n buffer.writeString(\\\"secretsLocation\\\");\\n buffer.writeUInt256(uint256(self.secretsLocation));\\n buffer.writeString(\\\"secrets\\\");\\n buffer.writeBytes(self.encryptedSecretsReference);\\n }\\n\\n if (self.bytesArgs.length > 0) {\\n buffer.writeString(\\\"bytesArgs\\\");\\n buffer.startArray();\\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\\n buffer.writeBytes(self.bytesArgs[i]);\\n }\\n buffer.endSequence();\\n }\\n\\n return buffer.buf.buf;\\n }\\n\\n /// @notice Initializes a Chainlink Functions Request\\n /// @dev Sets the codeLocation and code on the request\\n /// @param self The uninitialized request\\n /// @param codeLocation The user provided source code location\\n /// @param language The programming language of the user code\\n /// @param source The user provided source code or a url\\n function initializeRequest(\\n Request memory self,\\n Location codeLocation,\\n CodeLanguage language,\\n string memory source\\n ) internal pure {\\n if (bytes(source).length == 0) revert EmptySource();\\n\\n self.codeLocation = codeLocation;\\n self.language = language;\\n self.source = source;\\n }\\n\\n /// @notice Initializes a Chainlink Functions Request\\n /// @dev Simplified version of initializeRequest for PoC\\n /// @param self The uninitialized request\\n /// @param javaScriptSource The user provided JS code (must not be empty)\\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\\n }\\n\\n /// @notice Adds Remote user encrypted secrets to a Request\\n /// @param self The initialized request\\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\\n\\n self.secretsLocation = Location.Remote;\\n self.encryptedSecretsReference = encryptedSecretsReference;\\n }\\n\\n /// @notice Adds DON-hosted secrets reference to a Request\\n /// @param self The initialized request\\n /// @param slotID Slot ID of the user's secrets hosted on DON\\n /// @param version User data version (for the slotID)\\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\\n\\n buffer.writeString(\\\"slotID\\\");\\n buffer.writeUInt64(slotID);\\n buffer.writeString(\\\"version\\\");\\n buffer.writeUInt64(version);\\n\\n self.secretsLocation = Location.DONHosted;\\n self.encryptedSecretsReference = buffer.buf.buf;\\n }\\n\\n /// @notice Sets args for the user run function\\n /// @param self The initialized request\\n /// @param args The array of string args (must not be empty)\\n function setArgs(Request memory self, string[] memory args) internal pure {\\n if (args.length == 0) revert EmptyArgs();\\n\\n self.args = args;\\n }\\n\\n /// @notice Sets bytes args for the user run function\\n /// @param self The initialized request\\n /// @param args The array of bytes args (must not be empty)\\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\\n if (args.length == 0) revert EmptyArgs();\\n\\n self.bytesArgs = args;\\n }\\n}\\n\",\"keccak256\":\"0xed75be0eaba358d468f1fe18adc377d5044f57eff0070081f884a1f212d0adc2\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\n/// @title Library of types that are used for fulfillment of a Functions request\\nlibrary FunctionsResponse {\\n // Used to send request information from the Router to the Coordinator\\n struct RequestMeta {\\n bytes data; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\\n bytes32 flags; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Per-subscription flags\\n address requestingContract; // \\u2550\\u2550\\u2557 The client contract that is sending the request\\n uint96 availableBalance; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u255d Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\\n uint72 adminFee; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\\n uint64 subscriptionId; // \\u2551 Identifier of the billing subscription that will be charged for the request\\n uint64 initiatedRequests; // \\u2551 The number of requests that have been started\\n uint32 callbackGasLimit; // \\u2551 The amount of gas that the callback to the consuming contract will be given\\n uint16 dataVersion; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The version of the structure of the CBOR encoded request data\\n uint64 completedRequests; // \\u2550\\u2550\\u2550\\u2550\\u2557 The number of requests that have successfully completed or timed out\\n address subscriptionOwner; // \\u2550\\u2550\\u2550\\u255d The owner of the billing subscription\\n }\\n\\n enum FulfillResult {\\n FULFILLED, // 0\\n USER_CALLBACK_ERROR, // 1\\n INVALID_REQUEST_ID, // 2\\n COST_EXCEEDS_COMMITMENT, // 3\\n INSUFFICIENT_GAS_PROVIDED, // 4\\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\\n INVALID_COMMITMENT // 6\\n }\\n\\n struct Commitment {\\n bytes32 requestId; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 A unique identifier for a Chainlink Functions request\\n address coordinator; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 The Coordinator contract that manages the DON that is servicing a request\\n uint96 estimatedTotalCostJuels; // \\u2550\\u2550\\u2550\\u2550\\u255d The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\\n address client; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 The client contract that sent the request\\n uint64 subscriptionId; // \\u2551 Identifier of the billing subscription that will be charged for the request\\n uint32 callbackGasLimit; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The amount of gas that the callback to the consuming contract will be given\\n uint72 adminFee; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\\n uint72 donFee; // \\u2551 Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\\n uint40 gasOverheadBeforeCallback; // \\u2551 Represents the average gas execution cost before the fulfillment callback.\\n uint40 gasOverheadAfterCallback; // \\u2551 Represents the average gas execution cost after the fulfillment callback.\\n uint32 timeoutTimestamp; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The timestamp at which a request will be eligible to be timed out\\n }\\n}\\n\",\"keccak256\":\"0xc72eb037effef32146f7cd4086af00f44f28c8649d891e5e404fec5fda7e802b\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {IFunctionsRouter} from \\\"../v1_0_0/interfaces/IFunctionsRouter.sol\\\";\\nimport {IFunctionsClient} from \\\"../v1_0_0/interfaces/IFunctionsClient.sol\\\";\\n\\nimport {FunctionsRequest} from \\\"../v1_0_0/libraries/FunctionsRequest.sol\\\";\\n\\n/// @title The Chainlink Functions client contract\\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\\nabstract contract FunctionsClient is IFunctionsClient {\\n using FunctionsRequest for FunctionsRequest.Request;\\n\\n IFunctionsRouter internal immutable i_functionsRouter;\\n\\n event RequestSent(bytes32 indexed id);\\n event RequestFulfilled(bytes32 indexed id);\\n\\n error OnlyRouterCanFulfill();\\n\\n constructor(address router) {\\n i_functionsRouter = IFunctionsRouter(router);\\n }\\n\\n /// @notice Sends a Chainlink Functions request\\n /// @param data The CBOR encoded bytes data for a Functions request\\n /// @param subscriptionId The subscription ID that will be charged to service the request\\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\\n /// @return requestId The generated request ID for this request\\n function _sendRequest(\\n bytes memory data,\\n uint64 subscriptionId,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) internal returns (bytes32) {\\n bytes32 requestId = i_functionsRouter.sendRequest(\\n subscriptionId,\\n data,\\n FunctionsRequest.REQUEST_DATA_VERSION,\\n callbackGasLimit,\\n donId\\n );\\n emit RequestSent(requestId);\\n return requestId;\\n }\\n\\n /// @notice User defined function to handle a response from the DON\\n /// @param requestId The request ID, returned by sendRequest()\\n /// @param response Aggregated response from the execution of the user's source code\\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\\n /// @dev Either response or error parameter will be set, but never both\\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\\n\\n /// @inheritdoc IFunctionsClient\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\\n if (msg.sender != address(i_functionsRouter)) {\\n revert OnlyRouterCanFulfill();\\n }\\n _fulfillRequest(requestId, response, err);\\n emit RequestFulfilled(requestId);\\n }\\n}\\n\",\"keccak256\":\"0xdc40f1e9dea8a572d43d310afa68e978c35218d16097b9cfd9d1b6137df3cd0a\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-2-Clause\\npragma solidity ^0.8.4;\\n\\n/**\\n* @dev A library for working with mutable byte buffers in Solidity.\\n*\\n* Byte buffers are mutable and expandable, and provide a variety of primitives\\n* for appending to them. At any time you can fetch a bytes object containing the\\n* current contents of the buffer. The bytes object should not be stored between\\n* operations, as it may change due to resizing of the buffer.\\n*/\\nlibrary Buffer {\\n /**\\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\\n * a capacity. The capacity may be longer than the current value, in\\n * which case it can be extended without the need to allocate more memory.\\n */\\n struct buffer {\\n bytes buf;\\n uint capacity;\\n }\\n\\n /**\\n * @dev Initializes a buffer with an initial capacity.\\n * @param buf The buffer to initialize.\\n * @param capacity The number of bytes of space to allocate the buffer.\\n * @return The buffer, for chaining.\\n */\\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\\n if (capacity % 32 != 0) {\\n capacity += 32 - (capacity % 32);\\n }\\n // Allocate space for the buffer data\\n buf.capacity = capacity;\\n assembly {\\n let ptr := mload(0x40)\\n mstore(buf, ptr)\\n mstore(ptr, 0)\\n let fpm := add(32, add(ptr, capacity))\\n if lt(fpm, ptr) {\\n revert(0, 0)\\n }\\n mstore(0x40, fpm)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Initializes a new buffer from an existing bytes object.\\n * Changes to the buffer may mutate the original value.\\n * @param b The bytes object to initialize the buffer with.\\n * @return A new buffer.\\n */\\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\\n buffer memory buf;\\n buf.buf = b;\\n buf.capacity = b.length;\\n return buf;\\n }\\n\\n function resize(buffer memory buf, uint capacity) private pure {\\n bytes memory oldbuf = buf.buf;\\n init(buf, capacity);\\n append(buf, oldbuf);\\n }\\n\\n /**\\n * @dev Sets buffer length to 0.\\n * @param buf The buffer to truncate.\\n * @return The original buffer, for chaining..\\n */\\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\\n assembly {\\n let bufptr := mload(buf)\\n mstore(bufptr, 0)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to copy.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\\n require(len <= data.length);\\n\\n uint off = buf.buf.length;\\n uint newCapacity = off + len;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint dest;\\n uint src;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Length of existing buffer data\\n let buflen := mload(bufptr)\\n // Start address = buffer address + offset + sizeof(buffer length)\\n dest := add(add(bufptr, 32), off)\\n // Update buffer length if we're extending it\\n if gt(newCapacity, buflen) {\\n mstore(bufptr, newCapacity)\\n }\\n src := add(data, 32)\\n }\\n\\n // Copy word-length chunks while possible\\n for (; len >= 32; len -= 32) {\\n assembly {\\n mstore(dest, mload(src))\\n }\\n dest += 32;\\n src += 32;\\n }\\n\\n // Copy remaining bytes\\n unchecked {\\n uint mask = (256 ** (32 - len)) - 1;\\n assembly {\\n let srcpart := and(mload(src), not(mask))\\n let destpart := and(mload(dest), mask)\\n mstore(dest, or(destpart, srcpart))\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\\n return append(buf, data, data.length);\\n }\\n\\n /**\\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\\n * capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint offPlusOne = off + 1;\\n if (off >= buf.capacity) {\\n resize(buf, offPlusOne * 2);\\n }\\n\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + off\\n let dest := add(add(bufptr, off), 32)\\n mstore8(dest, data)\\n // Update buffer length if we extended it\\n if gt(offPlusOne, mload(bufptr)) {\\n mstore(bufptr, offPlusOne)\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (left-aligned).\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n unchecked {\\n uint mask = (256 ** len) - 1;\\n // Right-align data\\n data = data >> (8 * (32 - len));\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chhaining.\\n */\\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\\n return append(buf, bytes32(data), 20);\\n }\\n\\n /**\\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\\n return append(buf, data, 32);\\n }\\n\\n /**\\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (right-aligned).\\n * @return The original buffer.\\n */\\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint mask = (256 ** len) - 1;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n return buf;\\n }\\n}\",\"keccak256\":\"0x0d86b367813922094e02594a406ba89f5e97d3d74ec2ce3c4032566840e302b0\",\"license\":\"BSD-2-Clause\"},\"@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.4;\\n\\nimport \\\"../../@ensdomains/buffer/v0.1.0/Buffer.sol\\\";\\n\\n/**\\n* @dev A library for populating CBOR encoded payload in Solidity.\\n*\\n* https://datatracker.ietf.org/doc/html/rfc7049\\n*\\n* The library offers various write* and start* methods to encode values of different types.\\n* The resulted buffer can be obtained with data() method.\\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\\n* in an invalid CBOR if start/write/end flow is violated.\\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\\n* except for nested start/end pairs.\\n*/\\n\\nlibrary CBOR {\\n using Buffer for Buffer.buffer;\\n\\n struct CBORBuffer {\\n Buffer.buffer buf;\\n uint256 depth;\\n }\\n\\n uint8 private constant MAJOR_TYPE_INT = 0;\\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\\n uint8 private constant MAJOR_TYPE_BYTES = 2;\\n uint8 private constant MAJOR_TYPE_STRING = 3;\\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\\n uint8 private constant MAJOR_TYPE_MAP = 5;\\n uint8 private constant MAJOR_TYPE_TAG = 6;\\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\\n\\n uint8 private constant TAG_TYPE_BIGNUM = 2;\\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\\n\\n uint8 private constant CBOR_FALSE = 20;\\n uint8 private constant CBOR_TRUE = 21;\\n uint8 private constant CBOR_NULL = 22;\\n uint8 private constant CBOR_UNDEFINED = 23;\\n\\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\\n Buffer.init(cbor.buf, capacity);\\n cbor.depth = 0;\\n return cbor;\\n }\\n\\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\\n require(buf.depth == 0, \\\"Invalid CBOR\\\");\\n return buf.buf.buf;\\n }\\n\\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\\n writeBytes(buf, abi.encode(value));\\n }\\n\\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\\n if (value < 0) {\\n buf.buf.appendUint8(\\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\\n );\\n writeBytes(buf, abi.encode(uint256(-1 - value)));\\n } else {\\n writeUInt256(buf, uint256(value));\\n }\\n }\\n\\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\\n }\\n\\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\\n if(value >= 0) {\\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\\n } else{\\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\\n }\\n }\\n\\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\\n buf.buf.append(value);\\n }\\n\\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\\n buf.buf.append(bytes(value));\\n }\\n\\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\\n }\\n\\n function writeNull(CBORBuffer memory buf) internal pure {\\n writeContentFree(buf, CBOR_NULL);\\n }\\n\\n function writeUndefined(CBORBuffer memory buf) internal pure {\\n writeContentFree(buf, CBOR_UNDEFINED);\\n }\\n\\n function startArray(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\\n buf.depth += 1;\\n }\\n\\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\\n }\\n\\n function startMap(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\\n buf.depth += 1;\\n }\\n\\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\\n }\\n\\n function endSequence(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\\n buf.depth -= 1;\\n }\\n\\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\\n writeString(buf, key);\\n writeString(buf, value);\\n }\\n\\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\\n writeString(buf, key);\\n writeBytes(buf, value);\\n }\\n\\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\\n writeString(buf, key);\\n writeUInt256(buf, value);\\n }\\n\\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\\n writeString(buf, key);\\n writeInt256(buf, value);\\n }\\n\\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\\n writeString(buf, key);\\n writeUInt64(buf, value);\\n }\\n\\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\\n writeString(buf, key);\\n writeInt64(buf, value);\\n }\\n\\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\\n writeString(buf, key);\\n writeBool(buf, value);\\n }\\n\\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n writeNull(buf);\\n }\\n\\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n writeUndefined(buf);\\n }\\n\\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n startMap(buf);\\n }\\n\\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n startArray(buf);\\n }\\n\\n function writeFixedNumeric(\\n CBORBuffer memory buf,\\n uint8 major,\\n uint64 value\\n ) private pure {\\n if (value <= 23) {\\n buf.buf.appendUint8(uint8((major << 5) | value));\\n } else if (value <= 0xFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 24));\\n buf.buf.appendInt(value, 1);\\n } else if (value <= 0xFFFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 25));\\n buf.buf.appendInt(value, 2);\\n } else if (value <= 0xFFFFFFFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 26));\\n buf.buf.appendInt(value, 4);\\n } else {\\n buf.buf.appendUint8(uint8((major << 5) | 27));\\n buf.buf.appendInt(value, 8);\\n }\\n }\\n\\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\\n private\\n pure\\n {\\n buf.buf.appendUint8(uint8((major << 5) | 31));\\n }\\n\\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\\n private\\n pure\\n {\\n writeFixedNumeric(buf, major, length);\\n }\\n\\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\\n }\\n}\",\"keccak256\":\"0xdecf04203502670ac72ba466c75e4f87f4419907365005f0d73e7d07ee3e5715\",\"license\":\"MIT\"},\"contracts/CCExampleClient.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {ICCGatewayClient} from \\\"./interfaces/ICCGatewayClient.sol\\\";\\nimport {ICCGateway} from \\\"./interfaces/ICCGateway.sol\\\";\\n\\ncontract CCExampleClient is ICCGatewayClient {\\n ICCGateway private immutable gateway;\\n\\n uint64 public subscriptionId = 0;\\n bytes public encryptedSecretsReference = \\\"\\\";\\n\\n event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response);\\n event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error);\\n\\n constructor(address gatewayAddress) {\\n gateway = ICCGateway(gatewayAddress);\\n }\\n\\n function updateSubscriptionId(uint64 _subscriptionId) external {\\n subscriptionId = _subscriptionId;\\n }\\n\\n function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external {\\n encryptedSecretsReference = _encryptedSecretsReference;\\n }\\n\\n function request(string[] calldata args, bytes[] calldata bytesArgs) external {\\n require(subscriptionId != 0, \\\"Subscription ID not set\\\");\\n\\n gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference);\\n }\\n\\n function callback(bytes32 requestId) external override {\\n ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true);\\n\\n if (response.state == ICCGatewayClient.CCGResponseState.Success) {\\n emit ResponseReceived(response.subscriptionId, requestId, string(response.data));\\n } else {\\n emit ErrorReceived(response.subscriptionId, requestId, string(response.error));\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf905275976390214962167d4896d9c0eab670fce2b5f5cfd213b1ae2d776347a\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/ICCGateway.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\\nimport {FunctionsRequest} from \\\"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\\\";\\n\\ninterface ICCGateway {\\n struct CCGRequest {\\n string name;\\n uint32 callbackGasLimit;\\n FunctionsRequest.Request config;\\n }\\n\\n /**\\n * @dev Can't register a request with an empty name\\n */\\n error CCGRequestNameEmpty();\\n\\n /**\\n * @dev Only the same source of the requestId is allowed to call the function\\n */\\n error CCGOnlySameSourceAllowed(bytes32 requestId);\\n\\n /**\\n * @dev Only a registered subscriptionId is allowed to call the function\\n */\\n error CCGRequestNotRegistered(uint64 subscriptionId);\\n\\n /**\\n * @dev Can't fulfill a request that has already been fulfilled\\n */\\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\\n\\n /**\\n * @dev Only A manager can call the function\\n */\\n error CCGOnlyManagerAllowed();\\n\\n /**\\n * @dev Send a request to the Functions DON\\n */\\n function sendRequest(\\n uint64 subscriptionId,\\n string[] calldata args,\\n bytes[] calldata bytesArgs,\\n bytes calldata encryptedSecretsReference\\n ) external returns (bytes32 requestId);\\n\\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\\n}\\n\",\"keccak256\":\"0xbc7d92f8db240767c8636e8df9b818cc1f5abfde22b8c49eee50f418fb0dbea5\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/ICCGatewayClient.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\ninterface ICCGatewayClient {\\n enum CCGResponseState {Sent, Success, Error}\\n\\n struct CCGResponse {\\n uint64 subscriptionId;\\n address source;\\n CCGResponseState state;\\n bytes data;\\n bytes error;\\n }\\n\\n function callback(bytes32 requestId) external;\\n}\\n\",\"keccak256\":\"0xb69320aa2152f374dec4cfc70b73f46e0db9774a1411d2acff1481ee3295f86a\",\"license\":\"UNLICENSED\"}},\"version\":1}", + "bytecode": "0x600080546001600160401b031916815560c060405260a090815260019062000028908262000110565b503480156200003657600080fd5b5060405162000d6a38038062000d6a8339810160408190526200005991620001dc565b6001600160a01b03166080526200020e565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200009657607f821691505b602082108103620000b757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200010b57600081815260208120601f850160051c81016020861015620000e65750805b601f850160051c820191505b818110156200010757828155600101620000f2565b5050505b505050565b81516001600160401b038111156200012c576200012c6200006b565b62000144816200013d845462000081565b84620000bd565b602080601f8311600181146200017c5760008415620001635750858301515b600019600386901b1c1916600185901b17855562000107565b600085815260208120601f198616915b82811015620001ad578886015182559484019460019091019084016200018c565b5085821015620001cc5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215620001ef57600080fd5b81516001600160a01b03811681146200020757600080fd5b9392505050565b608051610b39620002316000396000818161023101526102e30152610b396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806309c1ba2e1461006757806314b1dd1b146100975780634ce64f0e146100ca578063cdc634f1146100dd578063cfd58386146100f2578063df13994e14610105575b600080fd5b60005461007a906001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b6100c86100a5366004610415565b6000805467ffffffffffffffff19166001600160401b0392909216919091179055565b005b6100c86100d8366004610439565b610118565b6100e561012a565b60405161008e91906104fa565b6100c8610100366004610558565b6101b8565b6100c86101133660046105c3565b6102c3565b600161012582848361067a565b505050565b60018054610137906105f2565b80601f0160208091040260200160405190810160405280929190818152602001828054610163906105f2565b80156101b05780601f10610185576101008083540402835291602001916101b0565b820191906000526020600020905b81548152906001019060200180831161019357829003601f168201915b505050505081565b600080546001600160401b031690036102175760405162461bcd60e51b815260206004820152601760248201527f537562736372697074696f6e204944206e6f7420736574000000000000000000604482015260640160405180910390fd5b600054604051634b60ac1760e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916396c1582e91610279916001600160401b0316908890889088908890600190600401610824565b6020604051808303816000875af1158015610298573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bc919061090d565b5050505050565b6040516315b851d160e01b815260048101829052600160248201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906315b851d1906044016000604051808303816000875af1158015610334573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261035c91908101906109e9565b905060018160400151600281111561037657610376610abc565b036103c2577fa5522492de1ed169e1e5e76f6cb2ceb5f045ca7f7ea5da3137c573d996cc4b9f81600001518383606001516040516103b693929190610ad2565b60405180910390a15050565b7f331e0adccd60eab7ca94cf49c60a45549ce9dc1281139656a13bdf73774d179c81600001518383608001516040516103b693929190610ad2565b6001600160401b038116811461041257600080fd5b50565b60006020828403121561042757600080fd5b8135610432816103fd565b9392505050565b6000806020838503121561044c57600080fd5b82356001600160401b038082111561046357600080fd5b818501915085601f83011261047757600080fd5b81358181111561048657600080fd5b86602082850101111561049857600080fd5b60209290920196919550909350505050565b60005b838110156104c55781810151838201526020016104ad565b50506000910152565b600081518084526104e68160208601602086016104aa565b601f01601f19169290920160200192915050565b60208152600061043260208301846104ce565b60008083601f84011261051f57600080fd5b5081356001600160401b0381111561053657600080fd5b6020830191508360208260051b850101111561055157600080fd5b9250929050565b6000806000806040858703121561056e57600080fd5b84356001600160401b038082111561058557600080fd5b6105918883890161050d565b909650945060208701359150808211156105aa57600080fd5b506105b78782880161050d565b95989497509550505050565b6000602082840312156105d557600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061060657607f821691505b60208210810361062657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561012557600081815260208120601f850160051c810160208610156106535750805b601f850160051c820191505b818110156106725782815560010161065f565b505050505050565b6001600160401b03831115610691576106916105dc565b6106a58361069f83546105f2565b8361062c565b6000601f8411600181146106d957600085156106c15750838201355b600019600387901b1c1916600186901b1783556102bc565b600083815260209020601f19861690835b8281101561070a57868501358255602094850194600190920191016106ea565b50868210156107275760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000808335601e1984360301811261077957600080fd5b83016020810192503590506001600160401b0381111561079857600080fd5b80360382131561055157600080fd5b600081546107b4816105f2565b8085526020600183811680156107d157600181146107eb57610819565b60ff1985168884015283151560051b880183019550610819565b866000528260002060005b858110156108115781548a82018601529083019084016107f6565b890184019650505b505050505092915050565b6000608082016001600160401b038916835260206080818501528188835260a08501905060a08960051b86010192508960005b8a81101561089157868503609f19018352610872828d610762565b61087d878284610739565b965050509183019190830190600101610857565b5050508382036040850152858252808201600587901b830182018860005b898110156108e957858303601f190184526108ca828c610762565b6108d5858284610739565b9587019594505050908401906001016108af565b505085810360608701526108fd81886107a7565b9c9b505050505050505050505050565b60006020828403121561091f57600080fd5b5051919050565b60405160a081016001600160401b0381118282101715610948576109486105dc565b60405290565b80516003811061095d57600080fd5b919050565b600082601f83011261097357600080fd5b81516001600160401b038082111561098d5761098d6105dc565b604051601f8301601f19908116603f011681019082821181831017156109b5576109b56105dc565b816040528381528660208588010111156109ce57600080fd5b6109df8460208301602089016104aa565b9695505050505050565b6000602082840312156109fb57600080fd5b81516001600160401b0380821115610a1257600080fd5b9083019060a08286031215610a2657600080fd5b610a2e610926565b8251610a39816103fd565b815260208301516001600160a01b0381168114610a5557600080fd5b6020820152610a666040840161094e565b6040820152606083015182811115610a7d57600080fd5b610a8987828601610962565b606083015250608083015182811115610aa157600080fd5b610aad87828601610962565b60808301525095945050505050565b634e487b7160e01b600052602160045260246000fd5b6001600160401b0384168152826020820152606060408201526000610afa60608301846104ce565b9594505050505056fea26469706673582212209c23a4aa128701447d0247b6e250fc1aeb5f0bdf6334f1ef0fdcdc125482ae6a64736f6c63430008140033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100625760003560e01c806309c1ba2e1461006757806314b1dd1b146100975780634ce64f0e146100ca578063cdc634f1146100dd578063cfd58386146100f2578063df13994e14610105575b600080fd5b60005461007a906001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b6100c86100a5366004610415565b6000805467ffffffffffffffff19166001600160401b0392909216919091179055565b005b6100c86100d8366004610439565b610118565b6100e561012a565b60405161008e91906104fa565b6100c8610100366004610558565b6101b8565b6100c86101133660046105c3565b6102c3565b600161012582848361067a565b505050565b60018054610137906105f2565b80601f0160208091040260200160405190810160405280929190818152602001828054610163906105f2565b80156101b05780601f10610185576101008083540402835291602001916101b0565b820191906000526020600020905b81548152906001019060200180831161019357829003601f168201915b505050505081565b600080546001600160401b031690036102175760405162461bcd60e51b815260206004820152601760248201527f537562736372697074696f6e204944206e6f7420736574000000000000000000604482015260640160405180910390fd5b600054604051634b60ac1760e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916396c1582e91610279916001600160401b0316908890889088908890600190600401610824565b6020604051808303816000875af1158015610298573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bc919061090d565b5050505050565b6040516315b851d160e01b815260048101829052600160248201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906315b851d1906044016000604051808303816000875af1158015610334573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261035c91908101906109e9565b905060018160400151600281111561037657610376610abc565b036103c2577fa5522492de1ed169e1e5e76f6cb2ceb5f045ca7f7ea5da3137c573d996cc4b9f81600001518383606001516040516103b693929190610ad2565b60405180910390a15050565b7f331e0adccd60eab7ca94cf49c60a45549ce9dc1281139656a13bdf73774d179c81600001518383608001516040516103b693929190610ad2565b6001600160401b038116811461041257600080fd5b50565b60006020828403121561042757600080fd5b8135610432816103fd565b9392505050565b6000806020838503121561044c57600080fd5b82356001600160401b038082111561046357600080fd5b818501915085601f83011261047757600080fd5b81358181111561048657600080fd5b86602082850101111561049857600080fd5b60209290920196919550909350505050565b60005b838110156104c55781810151838201526020016104ad565b50506000910152565b600081518084526104e68160208601602086016104aa565b601f01601f19169290920160200192915050565b60208152600061043260208301846104ce565b60008083601f84011261051f57600080fd5b5081356001600160401b0381111561053657600080fd5b6020830191508360208260051b850101111561055157600080fd5b9250929050565b6000806000806040858703121561056e57600080fd5b84356001600160401b038082111561058557600080fd5b6105918883890161050d565b909650945060208701359150808211156105aa57600080fd5b506105b78782880161050d565b95989497509550505050565b6000602082840312156105d557600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061060657607f821691505b60208210810361062657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561012557600081815260208120601f850160051c810160208610156106535750805b601f850160051c820191505b818110156106725782815560010161065f565b505050505050565b6001600160401b03831115610691576106916105dc565b6106a58361069f83546105f2565b8361062c565b6000601f8411600181146106d957600085156106c15750838201355b600019600387901b1c1916600186901b1783556102bc565b600083815260209020601f19861690835b8281101561070a57868501358255602094850194600190920191016106ea565b50868210156107275760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000808335601e1984360301811261077957600080fd5b83016020810192503590506001600160401b0381111561079857600080fd5b80360382131561055157600080fd5b600081546107b4816105f2565b8085526020600183811680156107d157600181146107eb57610819565b60ff1985168884015283151560051b880183019550610819565b866000528260002060005b858110156108115781548a82018601529083019084016107f6565b890184019650505b505050505092915050565b6000608082016001600160401b038916835260206080818501528188835260a08501905060a08960051b86010192508960005b8a81101561089157868503609f19018352610872828d610762565b61087d878284610739565b965050509183019190830190600101610857565b5050508382036040850152858252808201600587901b830182018860005b898110156108e957858303601f190184526108ca828c610762565b6108d5858284610739565b9587019594505050908401906001016108af565b505085810360608701526108fd81886107a7565b9c9b505050505050505050505050565b60006020828403121561091f57600080fd5b5051919050565b60405160a081016001600160401b0381118282101715610948576109486105dc565b60405290565b80516003811061095d57600080fd5b919050565b600082601f83011261097357600080fd5b81516001600160401b038082111561098d5761098d6105dc565b604051601f8301601f19908116603f011681019082821181831017156109b5576109b56105dc565b816040528381528660208588010111156109ce57600080fd5b6109df8460208301602089016104aa565b9695505050505050565b6000602082840312156109fb57600080fd5b81516001600160401b0380821115610a1257600080fd5b9083019060a08286031215610a2657600080fd5b610a2e610926565b8251610a39816103fd565b815260208301516001600160a01b0381168114610a5557600080fd5b6020820152610a666040840161094e565b6040820152606083015182811115610a7d57600080fd5b610a8987828601610962565b606083015250608083015182811115610aa157600080fd5b610aad87828601610962565b60808301525095945050505050565b634e487b7160e01b600052602160045260246000fd5b6001600160401b0384168152826020820152606060408201526000610afa60608301846104ce565b9594505050505056fea26469706673582212209c23a4aa128701447d0247b6e250fc1aeb5f0bdf6334f1ef0fdcdc125482ae6a64736f6c63430008140033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 2081, + "contract": "contracts/CCExampleClient.sol:CCExampleClient", + "label": "subscriptionId", + "offset": 0, + "slot": "0", + "type": "t_uint64" + }, + { + "astId": 2084, + "contract": "contracts/CCExampleClient.sol:CCExampleClient", + "label": "encryptedSecretsReference", + "offset": 0, + "slot": "1", + "type": "t_bytes_storage" + } + ], + "types": { + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_uint64": { + "encoding": "inplace", + "label": "uint64", + "numberOfBytes": "8" + } + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/sepolia/CCGateway.json b/packages/hardhat/deployments/sepolia/CCGateway.json new file mode 100644 index 0000000..2d009e2 --- /dev/null +++ b/packages/hardhat/deployments/sepolia/CCGateway.json @@ -0,0 +1,1132 @@ +{ + "address": "0xe1fA8f43D89afE8fcBA4FABbd3e6e6a4C3360409", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "router", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "initialDonId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AccessControlBadConfirmation", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "neededRole", + "type": "bytes32" + } + ], + "name": "AccessControlUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [], + "name": "CCGOnlyManagerAllowed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + } + ], + "name": "CCGOnlySameSourceAllowed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + } + ], + "name": "CCGRequestAlreadyFulfilled", + "type": "error" + }, + { + "inputs": [], + "name": "CCGRequestNameEmpty", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + } + ], + "name": "CCGRequestNotRegistered", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyArgs", + "type": "error" + }, + { + "inputs": [], + "name": "EmptySource", + "type": "error" + }, + { + "inputs": [], + "name": "NoInlineSecrets", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyRouterCanFulfill", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "RequestFulfilled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "RequestSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "CLIENT_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MANAGER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "donId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + } + ], + "name": "getRequest", + "outputs": [ + { + "components": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "uint32", + "name": "callbackGasLimit", + "type": "uint32" + }, + { + "components": [ + { + "internalType": "enum FunctionsRequest.Location", + "name": "codeLocation", + "type": "uint8" + }, + { + "internalType": "enum FunctionsRequest.Location", + "name": "secretsLocation", + "type": "uint8" + }, + { + "internalType": "enum FunctionsRequest.CodeLanguage", + "name": "language", + "type": "uint8" + }, + { + "internalType": "string", + "name": "source", + "type": "string" + }, + { + "internalType": "bytes", + "name": "encryptedSecretsReference", + "type": "bytes" + }, + { + "internalType": "string[]", + "name": "args", + "type": "string[]" + }, + { + "internalType": "bytes[]", + "name": "bytesArgs", + "type": "bytes[]" + } + ], + "internalType": "struct FunctionsRequest.Request", + "name": "config", + "type": "tuple" + } + ], + "internalType": "struct ICCGateway.CCGRequest", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "remove", + "type": "bool" + } + ], + "name": "getResponse", + "outputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "internalType": "address", + "name": "source", + "type": "address" + }, + { + "internalType": "enum ICCGatewayClient.CCGResponseState", + "name": "state", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "error", + "type": "bytes" + } + ], + "internalType": "struct ICCGatewayClient.CCGResponse", + "name": "response", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "response", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "err", + "type": "bytes" + } + ], + "name": "handleOracleFulfillment", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "internalType": "enum FunctionsRequest.Location", + "name": "codeLocation", + "type": "uint8" + }, + { + "internalType": "string", + "name": "source", + "type": "string" + }, + { + "internalType": "enum FunctionsRequest.Location", + "name": "secretsLocation", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "encryptedSecretsReference", + "type": "bytes" + }, + { + "internalType": "uint32", + "name": "callbackGasLimit", + "type": "uint32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "registerRequest", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + } + ], + "name": "removeRequest", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "callerConfirmation", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "internalType": "string[]", + "name": "args", + "type": "string[]" + }, + { + "internalType": "bytes[]", + "name": "bytesArgs", + "type": "bytes[]" + }, + { + "internalType": "bytes", + "name": "encryptedSecretsReference", + "type": "bytes" + } + ], + "name": "sendRequest", + "outputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "newDonId", + "type": "bytes32" + } + ], + "name": "setDonId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "subscriptions", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0xba187970efc23ad056b0cd3b13ec5269ae46b4ed4f127c207bf2510a15cdc1f2", + "receipt": { + "to": null, + "from": "0xD10F43A0aa00D244DAcFBE3C49b9B918B717Ff2c", + "contractAddress": "0xe1fA8f43D89afE8fcBA4FABbd3e6e6a4C3360409", + "transactionIndex": 177, + "gasUsed": "2640011", + "logsBloom": "0x00000004000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000020000000004000008000800000000000000000000800000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000020000000000000000000080000100000000000020000000010000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x8743234a10f5adf30000c71f803523a5f0ce2aaae4b0a16ea4526c35bf2b8d37", + "transactionHash": "0xba187970efc23ad056b0cd3b13ec5269ae46b4ed4f127c207bf2510a15cdc1f2", + "logs": [ + { + "transactionIndex": 177, + "blockNumber": 6028201, + "transactionHash": "0xba187970efc23ad056b0cd3b13ec5269ae46b4ed4f127c207bf2510a15cdc1f2", + "address": "0xe1fA8f43D89afE8fcBA4FABbd3e6e6a4C3360409", + "topics": [ + "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000d10f43a0aa00d244dacfbe3c49b9b918b717ff2c", + "0x000000000000000000000000d10f43a0aa00d244dacfbe3c49b9b918b717ff2c" + ], + "data": "0x", + "logIndex": 444, + "blockHash": "0x8743234a10f5adf30000c71f803523a5f0ce2aaae4b0a16ea4526c35bf2b8d37" + }, + { + "transactionIndex": 177, + "blockNumber": 6028201, + "transactionHash": "0xba187970efc23ad056b0cd3b13ec5269ae46b4ed4f127c207bf2510a15cdc1f2", + "address": "0xe1fA8f43D89afE8fcBA4FABbd3e6e6a4C3360409", + "topics": [ + "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", + "0x241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08", + "0x000000000000000000000000d10f43a0aa00d244dacfbe3c49b9b918b717ff2c", + "0x000000000000000000000000d10f43a0aa00d244dacfbe3c49b9b918b717ff2c" + ], + "data": "0x", + "logIndex": 445, + "blockHash": "0x8743234a10f5adf30000c71f803523a5f0ce2aaae4b0a16ea4526c35bf2b8d37" + } + ], + "blockNumber": 6028201, + "cumulativeGasUsed": "21045631", + "status": 1, + "byzantium": true + }, + "args": [ + "0xb83E47C2bC239B3bf370bc41e1459A34b41238D0", + "0x66756e2d657468657265756d2d7365706f6c69612d3100000000000000000000", + "0xD10F43A0aa00D244DAcFBE3C49b9B918B717Ff2c" + ], + "numDeployments": 2, + "solcInputHash": "be18bfdeea6869d68a166c8869814257", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"initialDonId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"initialOwner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AccessControlBadConfirmation\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"neededRole\",\"type\":\"bytes32\"}],\"name\":\"AccessControlUnauthorizedAccount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CCGOnlyManagerAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"CCGOnlySameSourceAllowed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"CCGRequestAlreadyFulfilled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CCGRequestNameEmpty\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"}],\"name\":\"CCGRequestNotRegistered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EmptyArgs\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"EmptySource\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoInlineSecrets\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyRouterCanFulfill\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"RequestFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"RequestSent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"CLIENT_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MANAGER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"donId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"}],\"name\":\"getRequest\",\"outputs\":[{\"components\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"components\":[{\"internalType\":\"enum FunctionsRequest.Location\",\"name\":\"codeLocation\",\"type\":\"uint8\"},{\"internalType\":\"enum FunctionsRequest.Location\",\"name\":\"secretsLocation\",\"type\":\"uint8\"},{\"internalType\":\"enum FunctionsRequest.CodeLanguage\",\"name\":\"language\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"source\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"encryptedSecretsReference\",\"type\":\"bytes\"},{\"internalType\":\"string[]\",\"name\":\"args\",\"type\":\"string[]\"},{\"internalType\":\"bytes[]\",\"name\":\"bytesArgs\",\"type\":\"bytes[]\"}],\"internalType\":\"struct FunctionsRequest.Request\",\"name\":\"config\",\"type\":\"tuple\"}],\"internalType\":\"struct ICCGateway.CCGRequest\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"remove\",\"type\":\"bool\"}],\"name\":\"getResponse\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"source\",\"type\":\"address\"},{\"internalType\":\"enum ICCGatewayClient.CCGResponseState\",\"name\":\"state\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"error\",\"type\":\"bytes\"}],\"internalType\":\"struct ICCGatewayClient.CCGResponse\",\"name\":\"response\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"response\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"err\",\"type\":\"bytes\"}],\"name\":\"handleOracleFulfillment\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"internalType\":\"enum FunctionsRequest.Location\",\"name\":\"codeLocation\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"source\",\"type\":\"string\"},{\"internalType\":\"enum FunctionsRequest.Location\",\"name\":\"secretsLocation\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"encryptedSecretsReference\",\"type\":\"bytes\"},{\"internalType\":\"uint32\",\"name\":\"callbackGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"registerRequest\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"}],\"name\":\"removeRequest\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"callerConfirmation\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"internalType\":\"string[]\",\"name\":\"args\",\"type\":\"string[]\"},{\"internalType\":\"bytes[]\",\"name\":\"bytesArgs\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"encryptedSecretsReference\",\"type\":\"bytes\"}],\"name\":\"sendRequest\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"newDonId\",\"type\":\"bytes32\"}],\"name\":\"setDonId\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"subscriptions\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"AccessControlBadConfirmation()\":[{\"details\":\"The caller of a function is not the expected one. NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\"}],\"AccessControlUnauthorizedAccount(address,bytes32)\":[{\"details\":\"The `account` is missing a role.\"}],\"CCGOnlyManagerAllowed()\":[{\"details\":\"Only A manager can call the function\"}],\"CCGOnlySameSourceAllowed(bytes32)\":[{\"details\":\"Only the same source of the requestId is allowed to call the function\"}],\"CCGRequestAlreadyFulfilled(bytes32)\":[{\"details\":\"Can't fulfill a request that has already been fulfilled\"}],\"CCGRequestNameEmpty()\":[{\"details\":\"Can't register a request with an empty name\"}],\"CCGRequestNotRegistered(uint64)\":[{\"details\":\"Only a registered subscriptionId is allowed to call the function\"}]},\"events\":{\"RoleAdminChanged(bytes32,bytes32,bytes32)\":{\"details\":\"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this.\"},\"RoleGranted(bytes32,address,address)\":{\"details\":\"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.\"},\"RoleRevoked(bytes32,address,address)\":{\"details\":\"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)\"}},\"kind\":\"dev\",\"methods\":{\"donId()\":{\"details\":\"Get the DON ID\",\"returns\":{\"_0\":\"DON ID\"}},\"getResponse(bytes32,bool)\":{\"details\":\"Get the response data\",\"params\":{\"requestId\":\"The request ID, returned by sendRequest()\"},\"returns\":{\"response\":\"CCGResponse\"}},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"handleOracleFulfillment(bytes32,bytes,bytes)\":{\"details\":\"Either response or error parameter will be set, but never both.\",\"params\":{\"err\":\"Aggregated error either from the request's source code or from the execution pipeline.\",\"requestId\":\"The requestId returned by FunctionsClient.sendRequest().\",\"response\":\"Aggregated response from the request's source code.\"}},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `callerConfirmation`. May emit a {RoleRevoked} event.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"sendRequest(uint64,string[],bytes[],bytes)\":{\"params\":{\"args\":\"String arguments passed into the source code and accessible via the global variable `args`\",\"bytesArgs\":\"Bytes arguments passed into the source code and accessible via the global variable `bytesArgs` as hex strings\",\"encryptedSecretsReference\":\"Reference pointing to encrypted secrets\",\"subscriptionId\":\"Subscription ID used to pay for request (FunctionsConsumer contract address must first be added to the subscription)\"}},\"setDonId(bytes32)\":{\"details\":\"Set the DON ID\",\"params\":{\"newDonId\":\"New DON ID\"}},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"handleOracleFulfillment(bytes32,bytes,bytes)\":{\"notice\":\"Chainlink Functions response handler called by the Functions Router during fullilment from the designated transmitter node in an OCR round.\"},\"sendRequest(uint64,string[],bytes[],bytes)\":{\"notice\":\"Triggers an on-demand Functions request using remote encrypted secrets\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/CCGateway.sol\":\"CCGateway\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {IFunctionsRouter} from \\\"./interfaces/IFunctionsRouter.sol\\\";\\nimport {IFunctionsClient} from \\\"./interfaces/IFunctionsClient.sol\\\";\\n\\nimport {FunctionsRequest} from \\\"./libraries/FunctionsRequest.sol\\\";\\n\\n/// @title The Chainlink Functions client contract\\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\\nabstract contract FunctionsClient is IFunctionsClient {\\n using FunctionsRequest for FunctionsRequest.Request;\\n\\n IFunctionsRouter internal immutable i_router;\\n\\n event RequestSent(bytes32 indexed id);\\n event RequestFulfilled(bytes32 indexed id);\\n\\n error OnlyRouterCanFulfill();\\n\\n constructor(address router) {\\n i_router = IFunctionsRouter(router);\\n }\\n\\n /// @notice Sends a Chainlink Functions request\\n /// @param data The CBOR encoded bytes data for a Functions request\\n /// @param subscriptionId The subscription ID that will be charged to service the request\\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\\n /// @return requestId The generated request ID for this request\\n function _sendRequest(\\n bytes memory data,\\n uint64 subscriptionId,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) internal returns (bytes32) {\\n bytes32 requestId = i_router.sendRequest(\\n subscriptionId,\\n data,\\n FunctionsRequest.REQUEST_DATA_VERSION,\\n callbackGasLimit,\\n donId\\n );\\n emit RequestSent(requestId);\\n return requestId;\\n }\\n\\n /// @notice User defined function to handle a response from the DON\\n /// @param requestId The request ID, returned by sendRequest()\\n /// @param response Aggregated response from the execution of the user's source code\\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\\n /// @dev Either response or error parameter will be set, but never both\\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\\n\\n /// @inheritdoc IFunctionsClient\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\\n if (msg.sender != address(i_router)) {\\n revert OnlyRouterCanFulfill();\\n }\\n fulfillRequest(requestId, response, err);\\n emit RequestFulfilled(requestId);\\n }\\n}\\n\",\"keccak256\":\"0x40224641403cb9fa03d4f060296d7420a9ff11b46abadc958ae048459205e397\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\n/// @title Chainlink Functions client interface.\\ninterface IFunctionsClient {\\n /// @notice Chainlink Functions response handler called by the Functions Router\\n /// during fullilment from the designated transmitter node in an OCR round.\\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\\n /// @param response Aggregated response from the request's source code.\\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\\n /// @dev Either response or error parameter will be set, but never both.\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\\n}\\n\",\"keccak256\":\"0x6117b82e7c4eec44ce557b0fc8bc1ac5f49e5d160ac6d4485452d6aafdd762ff\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {FunctionsResponse} from \\\"../libraries/FunctionsResponse.sol\\\";\\n\\n/// @title Chainlink Functions Router interface.\\ninterface IFunctionsRouter {\\n /// @notice The identifier of the route to retrieve the address of the access control contract\\n /// The access control contract controls which accounts can manage subscriptions\\n /// @return id - bytes32 id that can be passed to the \\\"getContractById\\\" of the Router\\n function getAllowListId() external view returns (bytes32);\\n\\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\\n /// The access control contract controls which accounts can manage subscriptions\\n function setAllowListId(bytes32 allowListId) external;\\n\\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\\n /// @return adminFee\\n function getAdminFee() external view returns (uint72 adminFee);\\n\\n /// @notice Sends a request using the provided subscriptionId\\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\\n /// a client can make requests from different contracts referencing the same subscription\\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\\n /// @param dataVersion - Gas limit for the fulfillment callback\\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\\n /// @param donId - An identifier used to determine which route to send the request along\\n /// @return requestId - A unique request identifier\\n function sendRequest(\\n uint64 subscriptionId,\\n bytes calldata data,\\n uint16 dataVersion,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) external returns (bytes32);\\n\\n /// @notice Sends a request to the proposed contracts\\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\\n /// a client can make requests from different contracts referencing the same subscription\\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\\n /// @param dataVersion - Gas limit for the fulfillment callback\\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\\n /// @param donId - An identifier used to determine which route to send the request along\\n /// @return requestId - A unique request identifier\\n function sendRequestToProposed(\\n uint64 subscriptionId,\\n bytes calldata data,\\n uint16 dataVersion,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) external returns (bytes32);\\n\\n /// @notice Fulfill the request by:\\n /// - calling back the data that the Oracle returned to the client contract\\n /// - pay the DON for processing the request\\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\\n /// @param response response data from DON consensus\\n /// @param err error from DON consensus\\n /// @param juelsPerGas - current rate of juels/gas\\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\\n /// @param transmitter - The Node that transmitted the OCR report\\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\\n /// @return fulfillResult -\\n /// @return callbackGasCostJuels -\\n function fulfill(\\n bytes memory response,\\n bytes memory err,\\n uint96 juelsPerGas,\\n uint96 costWithoutFulfillment,\\n address transmitter,\\n FunctionsResponse.Commitment memory commitment\\n ) external returns (FunctionsResponse.FulfillResult, uint96);\\n\\n /// @notice Validate requested gas limit is below the subscription max.\\n /// @param subscriptionId subscription ID\\n /// @param callbackGasLimit desired callback gas limit\\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\\n\\n /// @notice Get the current contract given an ID\\n /// @param id A bytes32 identifier for the route\\n /// @return contract The current contract address\\n function getContractById(bytes32 id) external view returns (address);\\n\\n /// @notice Get the proposed next contract given an ID\\n /// @param id A bytes32 identifier for the route\\n /// @return contract The current or proposed contract address\\n function getProposedContractById(bytes32 id) external view returns (address);\\n\\n /// @notice Return the latest proprosal set\\n /// @return ids The identifiers of the contracts to update\\n /// @return to The addresses of the contracts that will be updated to\\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\\n\\n /// @notice Proposes one or more updates to the contract routes\\n /// @dev Only callable by owner\\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\\n\\n /// @notice Updates the current contract routes to the proposed contracts\\n /// @dev Only callable by owner\\n function updateContracts() external;\\n\\n /// @dev Puts the system into an emergency stopped state.\\n /// @dev Only callable by owner\\n function pause() external;\\n\\n /// @dev Takes the system out of an emergency stopped state.\\n /// @dev Only callable by owner\\n function unpause() external;\\n}\\n\",\"keccak256\":\"0x44db41e8ff90c2828ca0ada125abc4b411921a86514a4a047fd9fd43ba9d7e08\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {CBOR} from \\\"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\\\";\\n\\n/// @title Library for encoding the input data of a Functions request into CBOR\\nlibrary FunctionsRequest {\\n using CBOR for CBOR.CBORBuffer;\\n\\n uint16 public constant REQUEST_DATA_VERSION = 1;\\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\\n\\n enum Location {\\n Inline, // Provided within the Request\\n Remote, // Hosted through remote location that can be accessed through a provided URL\\n DONHosted // Hosted on the DON's storage\\n }\\n\\n enum CodeLanguage {\\n JavaScript\\n // In future version we may add other languages\\n }\\n\\n struct Request {\\n Location codeLocation; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The location of the source code that will be executed on each node in the DON\\n Location secretsLocation; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The location of secrets that will be passed into the source code. *Only Remote secrets are supported\\n CodeLanguage language; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The coding language that the source code is written in\\n string source; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\\n bytes encryptedSecretsReference; // \\u2550\\u2550\\u2578 Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\\n string[] args; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 String arguments that will be passed into the source code\\n bytes[] bytesArgs; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Bytes arguments that will be passed into the source code\\n }\\n\\n error EmptySource();\\n error EmptySecrets();\\n error EmptyArgs();\\n error NoInlineSecrets();\\n\\n /// @notice Encodes a Request to CBOR encoded bytes\\n /// @param self The request to encode\\n /// @return CBOR encoded bytes\\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\\n\\n buffer.writeString(\\\"codeLocation\\\");\\n buffer.writeUInt256(uint256(self.codeLocation));\\n\\n buffer.writeString(\\\"language\\\");\\n buffer.writeUInt256(uint256(self.language));\\n\\n buffer.writeString(\\\"source\\\");\\n buffer.writeString(self.source);\\n\\n if (self.args.length > 0) {\\n buffer.writeString(\\\"args\\\");\\n buffer.startArray();\\n for (uint256 i = 0; i < self.args.length; ++i) {\\n buffer.writeString(self.args[i]);\\n }\\n buffer.endSequence();\\n }\\n\\n if (self.encryptedSecretsReference.length > 0) {\\n if (self.secretsLocation == Location.Inline) {\\n revert NoInlineSecrets();\\n }\\n buffer.writeString(\\\"secretsLocation\\\");\\n buffer.writeUInt256(uint256(self.secretsLocation));\\n buffer.writeString(\\\"secrets\\\");\\n buffer.writeBytes(self.encryptedSecretsReference);\\n }\\n\\n if (self.bytesArgs.length > 0) {\\n buffer.writeString(\\\"bytesArgs\\\");\\n buffer.startArray();\\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\\n buffer.writeBytes(self.bytesArgs[i]);\\n }\\n buffer.endSequence();\\n }\\n\\n return buffer.buf.buf;\\n }\\n\\n /// @notice Initializes a Chainlink Functions Request\\n /// @dev Sets the codeLocation and code on the request\\n /// @param self The uninitialized request\\n /// @param codeLocation The user provided source code location\\n /// @param language The programming language of the user code\\n /// @param source The user provided source code or a url\\n function initializeRequest(\\n Request memory self,\\n Location codeLocation,\\n CodeLanguage language,\\n string memory source\\n ) internal pure {\\n if (bytes(source).length == 0) revert EmptySource();\\n\\n self.codeLocation = codeLocation;\\n self.language = language;\\n self.source = source;\\n }\\n\\n /// @notice Initializes a Chainlink Functions Request\\n /// @dev Simplified version of initializeRequest for PoC\\n /// @param self The uninitialized request\\n /// @param javaScriptSource The user provided JS code (must not be empty)\\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\\n }\\n\\n /// @notice Adds Remote user encrypted secrets to a Request\\n /// @param self The initialized request\\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\\n\\n self.secretsLocation = Location.Remote;\\n self.encryptedSecretsReference = encryptedSecretsReference;\\n }\\n\\n /// @notice Adds DON-hosted secrets reference to a Request\\n /// @param self The initialized request\\n /// @param slotID Slot ID of the user's secrets hosted on DON\\n /// @param version User data version (for the slotID)\\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\\n\\n buffer.writeString(\\\"slotID\\\");\\n buffer.writeUInt64(slotID);\\n buffer.writeString(\\\"version\\\");\\n buffer.writeUInt64(version);\\n\\n self.secretsLocation = Location.DONHosted;\\n self.encryptedSecretsReference = buffer.buf.buf;\\n }\\n\\n /// @notice Sets args for the user run function\\n /// @param self The initialized request\\n /// @param args The array of string args (must not be empty)\\n function setArgs(Request memory self, string[] memory args) internal pure {\\n if (args.length == 0) revert EmptyArgs();\\n\\n self.args = args;\\n }\\n\\n /// @notice Sets bytes args for the user run function\\n /// @param self The initialized request\\n /// @param args The array of bytes args (must not be empty)\\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\\n if (args.length == 0) revert EmptyArgs();\\n\\n self.bytesArgs = args;\\n }\\n}\\n\",\"keccak256\":\"0xed75be0eaba358d468f1fe18adc377d5044f57eff0070081f884a1f212d0adc2\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\n/// @title Library of types that are used for fulfillment of a Functions request\\nlibrary FunctionsResponse {\\n // Used to send request information from the Router to the Coordinator\\n struct RequestMeta {\\n bytes data; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\\n bytes32 flags; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Per-subscription flags\\n address requestingContract; // \\u2550\\u2550\\u2557 The client contract that is sending the request\\n uint96 availableBalance; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u255d Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\\n uint72 adminFee; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\\n uint64 subscriptionId; // \\u2551 Identifier of the billing subscription that will be charged for the request\\n uint64 initiatedRequests; // \\u2551 The number of requests that have been started\\n uint32 callbackGasLimit; // \\u2551 The amount of gas that the callback to the consuming contract will be given\\n uint16 dataVersion; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The version of the structure of the CBOR encoded request data\\n uint64 completedRequests; // \\u2550\\u2550\\u2550\\u2550\\u2557 The number of requests that have successfully completed or timed out\\n address subscriptionOwner; // \\u2550\\u2550\\u2550\\u255d The owner of the billing subscription\\n }\\n\\n enum FulfillResult {\\n FULFILLED, // 0\\n USER_CALLBACK_ERROR, // 1\\n INVALID_REQUEST_ID, // 2\\n COST_EXCEEDS_COMMITMENT, // 3\\n INSUFFICIENT_GAS_PROVIDED, // 4\\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\\n INVALID_COMMITMENT // 6\\n }\\n\\n struct Commitment {\\n bytes32 requestId; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 A unique identifier for a Chainlink Functions request\\n address coordinator; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 The Coordinator contract that manages the DON that is servicing a request\\n uint96 estimatedTotalCostJuels; // \\u2550\\u2550\\u2550\\u2550\\u255d The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\\n address client; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 The client contract that sent the request\\n uint64 subscriptionId; // \\u2551 Identifier of the billing subscription that will be charged for the request\\n uint32 callbackGasLimit; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The amount of gas that the callback to the consuming contract will be given\\n uint72 adminFee; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\\n uint72 donFee; // \\u2551 Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\\n uint40 gasOverheadBeforeCallback; // \\u2551 Represents the average gas execution cost before the fulfillment callback.\\n uint40 gasOverheadAfterCallback; // \\u2551 Represents the average gas execution cost after the fulfillment callback.\\n uint32 timeoutTimestamp; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The timestamp at which a request will be eligible to be timed out\\n }\\n}\\n\",\"keccak256\":\"0xc72eb037effef32146f7cd4086af00f44f28c8649d891e5e404fec5fda7e802b\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {IFunctionsRouter} from \\\"../v1_0_0/interfaces/IFunctionsRouter.sol\\\";\\nimport {IFunctionsClient} from \\\"../v1_0_0/interfaces/IFunctionsClient.sol\\\";\\n\\nimport {FunctionsRequest} from \\\"../v1_0_0/libraries/FunctionsRequest.sol\\\";\\n\\n/// @title The Chainlink Functions client contract\\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\\nabstract contract FunctionsClient is IFunctionsClient {\\n using FunctionsRequest for FunctionsRequest.Request;\\n\\n IFunctionsRouter internal immutable i_functionsRouter;\\n\\n event RequestSent(bytes32 indexed id);\\n event RequestFulfilled(bytes32 indexed id);\\n\\n error OnlyRouterCanFulfill();\\n\\n constructor(address router) {\\n i_functionsRouter = IFunctionsRouter(router);\\n }\\n\\n /// @notice Sends a Chainlink Functions request\\n /// @param data The CBOR encoded bytes data for a Functions request\\n /// @param subscriptionId The subscription ID that will be charged to service the request\\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\\n /// @return requestId The generated request ID for this request\\n function _sendRequest(\\n bytes memory data,\\n uint64 subscriptionId,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) internal returns (bytes32) {\\n bytes32 requestId = i_functionsRouter.sendRequest(\\n subscriptionId,\\n data,\\n FunctionsRequest.REQUEST_DATA_VERSION,\\n callbackGasLimit,\\n donId\\n );\\n emit RequestSent(requestId);\\n return requestId;\\n }\\n\\n /// @notice User defined function to handle a response from the DON\\n /// @param requestId The request ID, returned by sendRequest()\\n /// @param response Aggregated response from the execution of the user's source code\\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\\n /// @dev Either response or error parameter will be set, but never both\\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\\n\\n /// @inheritdoc IFunctionsClient\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\\n if (msg.sender != address(i_functionsRouter)) {\\n revert OnlyRouterCanFulfill();\\n }\\n _fulfillRequest(requestId, response, err);\\n emit RequestFulfilled(requestId);\\n }\\n}\\n\",\"keccak256\":\"0xdc40f1e9dea8a572d43d310afa68e978c35218d16097b9cfd9d1b6137df3cd0a\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-2-Clause\\npragma solidity ^0.8.4;\\n\\n/**\\n* @dev A library for working with mutable byte buffers in Solidity.\\n*\\n* Byte buffers are mutable and expandable, and provide a variety of primitives\\n* for appending to them. At any time you can fetch a bytes object containing the\\n* current contents of the buffer. The bytes object should not be stored between\\n* operations, as it may change due to resizing of the buffer.\\n*/\\nlibrary Buffer {\\n /**\\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\\n * a capacity. The capacity may be longer than the current value, in\\n * which case it can be extended without the need to allocate more memory.\\n */\\n struct buffer {\\n bytes buf;\\n uint capacity;\\n }\\n\\n /**\\n * @dev Initializes a buffer with an initial capacity.\\n * @param buf The buffer to initialize.\\n * @param capacity The number of bytes of space to allocate the buffer.\\n * @return The buffer, for chaining.\\n */\\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\\n if (capacity % 32 != 0) {\\n capacity += 32 - (capacity % 32);\\n }\\n // Allocate space for the buffer data\\n buf.capacity = capacity;\\n assembly {\\n let ptr := mload(0x40)\\n mstore(buf, ptr)\\n mstore(ptr, 0)\\n let fpm := add(32, add(ptr, capacity))\\n if lt(fpm, ptr) {\\n revert(0, 0)\\n }\\n mstore(0x40, fpm)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Initializes a new buffer from an existing bytes object.\\n * Changes to the buffer may mutate the original value.\\n * @param b The bytes object to initialize the buffer with.\\n * @return A new buffer.\\n */\\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\\n buffer memory buf;\\n buf.buf = b;\\n buf.capacity = b.length;\\n return buf;\\n }\\n\\n function resize(buffer memory buf, uint capacity) private pure {\\n bytes memory oldbuf = buf.buf;\\n init(buf, capacity);\\n append(buf, oldbuf);\\n }\\n\\n /**\\n * @dev Sets buffer length to 0.\\n * @param buf The buffer to truncate.\\n * @return The original buffer, for chaining..\\n */\\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\\n assembly {\\n let bufptr := mload(buf)\\n mstore(bufptr, 0)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to copy.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\\n require(len <= data.length);\\n\\n uint off = buf.buf.length;\\n uint newCapacity = off + len;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint dest;\\n uint src;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Length of existing buffer data\\n let buflen := mload(bufptr)\\n // Start address = buffer address + offset + sizeof(buffer length)\\n dest := add(add(bufptr, 32), off)\\n // Update buffer length if we're extending it\\n if gt(newCapacity, buflen) {\\n mstore(bufptr, newCapacity)\\n }\\n src := add(data, 32)\\n }\\n\\n // Copy word-length chunks while possible\\n for (; len >= 32; len -= 32) {\\n assembly {\\n mstore(dest, mload(src))\\n }\\n dest += 32;\\n src += 32;\\n }\\n\\n // Copy remaining bytes\\n unchecked {\\n uint mask = (256 ** (32 - len)) - 1;\\n assembly {\\n let srcpart := and(mload(src), not(mask))\\n let destpart := and(mload(dest), mask)\\n mstore(dest, or(destpart, srcpart))\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\\n return append(buf, data, data.length);\\n }\\n\\n /**\\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\\n * capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint offPlusOne = off + 1;\\n if (off >= buf.capacity) {\\n resize(buf, offPlusOne * 2);\\n }\\n\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + off\\n let dest := add(add(bufptr, off), 32)\\n mstore8(dest, data)\\n // Update buffer length if we extended it\\n if gt(offPlusOne, mload(bufptr)) {\\n mstore(bufptr, offPlusOne)\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (left-aligned).\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n unchecked {\\n uint mask = (256 ** len) - 1;\\n // Right-align data\\n data = data >> (8 * (32 - len));\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chhaining.\\n */\\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\\n return append(buf, bytes32(data), 20);\\n }\\n\\n /**\\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\\n return append(buf, data, 32);\\n }\\n\\n /**\\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (right-aligned).\\n * @return The original buffer.\\n */\\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint mask = (256 ** len) - 1;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n return buf;\\n }\\n}\",\"keccak256\":\"0x0d86b367813922094e02594a406ba89f5e97d3d74ec2ce3c4032566840e302b0\",\"license\":\"BSD-2-Clause\"},\"@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.4;\\n\\nimport \\\"../../@ensdomains/buffer/v0.1.0/Buffer.sol\\\";\\n\\n/**\\n* @dev A library for populating CBOR encoded payload in Solidity.\\n*\\n* https://datatracker.ietf.org/doc/html/rfc7049\\n*\\n* The library offers various write* and start* methods to encode values of different types.\\n* The resulted buffer can be obtained with data() method.\\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\\n* in an invalid CBOR if start/write/end flow is violated.\\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\\n* except for nested start/end pairs.\\n*/\\n\\nlibrary CBOR {\\n using Buffer for Buffer.buffer;\\n\\n struct CBORBuffer {\\n Buffer.buffer buf;\\n uint256 depth;\\n }\\n\\n uint8 private constant MAJOR_TYPE_INT = 0;\\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\\n uint8 private constant MAJOR_TYPE_BYTES = 2;\\n uint8 private constant MAJOR_TYPE_STRING = 3;\\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\\n uint8 private constant MAJOR_TYPE_MAP = 5;\\n uint8 private constant MAJOR_TYPE_TAG = 6;\\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\\n\\n uint8 private constant TAG_TYPE_BIGNUM = 2;\\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\\n\\n uint8 private constant CBOR_FALSE = 20;\\n uint8 private constant CBOR_TRUE = 21;\\n uint8 private constant CBOR_NULL = 22;\\n uint8 private constant CBOR_UNDEFINED = 23;\\n\\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\\n Buffer.init(cbor.buf, capacity);\\n cbor.depth = 0;\\n return cbor;\\n }\\n\\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\\n require(buf.depth == 0, \\\"Invalid CBOR\\\");\\n return buf.buf.buf;\\n }\\n\\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\\n writeBytes(buf, abi.encode(value));\\n }\\n\\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\\n if (value < 0) {\\n buf.buf.appendUint8(\\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\\n );\\n writeBytes(buf, abi.encode(uint256(-1 - value)));\\n } else {\\n writeUInt256(buf, uint256(value));\\n }\\n }\\n\\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\\n }\\n\\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\\n if(value >= 0) {\\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\\n } else{\\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\\n }\\n }\\n\\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\\n buf.buf.append(value);\\n }\\n\\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\\n buf.buf.append(bytes(value));\\n }\\n\\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\\n }\\n\\n function writeNull(CBORBuffer memory buf) internal pure {\\n writeContentFree(buf, CBOR_NULL);\\n }\\n\\n function writeUndefined(CBORBuffer memory buf) internal pure {\\n writeContentFree(buf, CBOR_UNDEFINED);\\n }\\n\\n function startArray(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\\n buf.depth += 1;\\n }\\n\\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\\n }\\n\\n function startMap(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\\n buf.depth += 1;\\n }\\n\\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\\n }\\n\\n function endSequence(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\\n buf.depth -= 1;\\n }\\n\\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\\n writeString(buf, key);\\n writeString(buf, value);\\n }\\n\\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\\n writeString(buf, key);\\n writeBytes(buf, value);\\n }\\n\\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\\n writeString(buf, key);\\n writeUInt256(buf, value);\\n }\\n\\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\\n writeString(buf, key);\\n writeInt256(buf, value);\\n }\\n\\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\\n writeString(buf, key);\\n writeUInt64(buf, value);\\n }\\n\\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\\n writeString(buf, key);\\n writeInt64(buf, value);\\n }\\n\\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\\n writeString(buf, key);\\n writeBool(buf, value);\\n }\\n\\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n writeNull(buf);\\n }\\n\\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n writeUndefined(buf);\\n }\\n\\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n startMap(buf);\\n }\\n\\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n startArray(buf);\\n }\\n\\n function writeFixedNumeric(\\n CBORBuffer memory buf,\\n uint8 major,\\n uint64 value\\n ) private pure {\\n if (value <= 23) {\\n buf.buf.appendUint8(uint8((major << 5) | value));\\n } else if (value <= 0xFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 24));\\n buf.buf.appendInt(value, 1);\\n } else if (value <= 0xFFFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 25));\\n buf.buf.appendInt(value, 2);\\n } else if (value <= 0xFFFFFFFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 26));\\n buf.buf.appendInt(value, 4);\\n } else {\\n buf.buf.appendUint8(uint8((major << 5) | 27));\\n buf.buf.appendInt(value, 8);\\n }\\n }\\n\\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\\n private\\n pure\\n {\\n buf.buf.appendUint8(uint8((major << 5) | 31));\\n }\\n\\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\\n private\\n pure\\n {\\n writeFixedNumeric(buf, major, length);\\n }\\n\\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\\n }\\n}\",\"keccak256\":\"0xdecf04203502670ac72ba466c75e4f87f4419907365005f0d73e7d07ee3e5715\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/AccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IAccessControl} from \\\"./IAccessControl.sol\\\";\\nimport {Context} from \\\"../utils/Context.sol\\\";\\nimport {ERC165} from \\\"../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```solidity\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```solidity\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\\n * to enforce additional security measures for this role.\\n */\\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\\n struct RoleData {\\n mapping(address account => bool) hasRole;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 role => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with an {AccessControlUnauthorizedAccount} error including the required role.\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role);\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\\n return _roles[role].hasRole[account];\\n }\\n\\n /**\\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\\n */\\n function _checkRole(bytes32 role) internal view virtual {\\n _checkRole(role, _msgSender());\\n }\\n\\n /**\\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\\n * is missing `role`.\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert AccessControlUnauthorizedAccount(account, role);\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `callerConfirmation`.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\\n if (callerConfirmation != _msgSender()) {\\n revert AccessControlBadConfirmation();\\n }\\n\\n _revokeRole(role, callerConfirmation);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\\n if (!hasRole(role, account)) {\\n _roles[role].hasRole[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\\n if (hasRole(role, account)) {\\n _roles[role].hasRole[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa0e92d42942f4f57c5be50568dac11e9d00c93efcb458026e18d2d9b9b2e7308\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev The `account` is missing a role.\\n */\\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\\n\\n /**\\n * @dev The caller of a function is not the expected one.\\n *\\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\\n */\\n error AccessControlBadConfirmation();\\n\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `callerConfirmation`.\\n */\\n function renounceRole(bytes32 role, address callerConfirmation) external;\\n}\\n\",\"keccak256\":\"0xb6b36edd6a2999fd243ff226d6cbf84bd71af2432bbd0dfe19392996a1d9cb41\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n function _contextSuffixLength() internal view virtual returns (uint256) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0x9e8778b14317ba9e256c30a76fd6c32b960af621987f56069e1e819c77c6a133\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x4296879f55019b23e135000eb36896057e7101fb7fb859c5ef690cf14643757b\",\"license\":\"MIT\"},\"contracts/CCGateway.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport './interfaces/ICCGateway.sol';\\nimport {ICCGatewayClient} from './interfaces/ICCGatewayClient.sol';\\n\\nimport {FunctionsClient} from \\\"@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol\\\";\\nimport {AccessControl} from \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport {FunctionsRequest} from \\\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\\\";\\n\\ncontract CCGateway is ICCGateway, FunctionsClient, AccessControl {\\n using FunctionsRequest for FunctionsRequest.Request;\\n\\n bytes32 public constant MANAGER_ROLE = keccak256(\\\"MANAGER_ROLE\\\");\\n bytes32 public constant CLIENT_ROLE = keccak256(\\\"CLIENT_ROLE\\\");\\n bytes32 private _donId; // DON ID for the Functions DON to which the requests are sent\\n\\n mapping(uint64 subscriptionId => CCGRequest) private _requests; // Each subscription can only handle one kind of request\\n mapping(bytes32 requestId => ICCGatewayClient.CCGResponse) private unprocessed_responses; // Responses that have not been processed yet\\n\\n // array of registered subscriptions\\n uint64[] public subscriptions;\\n\\n constructor(address router, bytes32 initialDonId, address initialOwner) FunctionsClient(router) {\\n _donId = initialDonId;\\n\\n address to = address(0) == initialOwner ? _msgSender() : initialOwner;\\n _grantRole(DEFAULT_ADMIN_ROLE, to);\\n _grantRole(MANAGER_ROLE, to);\\n }\\n\\n /**\\n * @dev Set the DON ID\\n * @param newDonId New DON ID\\n */\\n function setDonId(bytes32 newDonId) external onlyRole(getRoleAdmin(MANAGER_ROLE)) {\\n _donId = newDonId;\\n }\\n\\n /**\\n * @dev Get the DON ID\\n * @return DON ID\\n */\\n function donId() external view returns (bytes32) {\\n return _donId;\\n }\\n\\n function registerRequest(\\n uint64 subscriptionId,\\n FunctionsRequest.Location codeLocation,\\n string calldata source,\\n FunctionsRequest.Location secretsLocation,\\n bytes calldata encryptedSecretsReference,\\n uint32 callbackGasLimit,\\n string calldata name\\n ) external onlyManager {\\n if (bytes(name).length == 0) {revert CCGRequestNameEmpty();}\\n\\n CCGRequest storage req = _requests[subscriptionId];\\n if(bytes(req.name).length == 0) {subscriptions.push(subscriptionId);}\\n\\n req.name = name;\\n req.callbackGasLimit = callbackGasLimit;\\n\\n // Only JavaScript is supported for now\\n req.config.language = FunctionsRequest.CodeLanguage.JavaScript;\\n req.config.codeLocation = codeLocation;\\n req.config.source = source;\\n req.config.secretsLocation = secretsLocation;\\n req.config.encryptedSecretsReference = encryptedSecretsReference;\\n }\\n\\n function removeRequest(uint64 subscriptionId) external onlyManager {\\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\\n delete _requests[subscriptionId];\\n\\n // Find the index of the subscriptionId in the subscriptions array\\n uint256 index = subscriptions.length;\\n for (uint256 i = 0; i < subscriptions.length; i++) {\\n if (index == subscriptions.length && subscriptions[i] == subscriptionId) index = i;\\n if (index != subscriptions.length && i + 1 < subscriptions.length) subscriptions[i] = subscriptions[i + 1];\\n }\\n\\n subscriptions.pop();\\n }\\n\\n function getRequest(uint64 subscriptionId) external view returns (CCGRequest memory) {\\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\\n return _requests[subscriptionId];\\n }\\n// ---------------------------------------------------------------------------------------------------------------------\\n modifier onlySource(bytes32 requestId) {\\n if (unprocessed_responses[requestId].source != _msgSender()) {revert CCGOnlySameSourceAllowed(requestId);}\\n _;\\n }\\n\\n modifier onlyManager() {\\n if (!hasRole(MANAGER_ROLE, tx.origin)) {revert CCGOnlyManagerAllowed();}\\n _;\\n }\\n// ---------------------------------------------------------------------------------------------------------------------\\n /**\\n * @notice Triggers an on-demand Functions request using remote encrypted secrets\\n * @param subscriptionId Subscription ID used to pay for request (FunctionsConsumer contract address must first be added to the subscription)\\n * @param args String arguments passed into the source code and accessible via the global variable `args`\\n * @param bytesArgs Bytes arguments passed into the source code and accessible via the global variable `bytesArgs` as hex strings\\n * @param encryptedSecretsReference Reference pointing to encrypted secrets\\n */\\n function sendRequest(\\n uint64 subscriptionId,\\n string[] calldata args,\\n bytes[] calldata bytesArgs,\\n bytes calldata encryptedSecretsReference\\n ) external onlyRole(CLIENT_ROLE) returns (bytes32 requestId) {\\n CCGRequest storage request = _requests[subscriptionId];\\n if (bytes(request.name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\\n\\n FunctionsRequest.Request memory req = request.config;\\n req.initializeRequest(req.codeLocation, FunctionsRequest.CodeLanguage.JavaScript, req.source);\\n if (encryptedSecretsReference.length > 0) {req.encryptedSecretsReference = encryptedSecretsReference;}\\n\\n if (args.length > 0) {\\n req.setArgs(args);\\n }\\n if (bytesArgs.length > 0) {\\n req.setBytesArgs(bytesArgs);\\n }\\n\\n requestId = _sendRequest(req.encodeCBOR(), subscriptionId, request.callbackGasLimit, _donId);\\n unprocessed_responses[requestId].state = ICCGatewayClient.CCGResponseState.Sent;\\n unprocessed_responses[requestId].source = _msgSender();\\n }\\n\\n /**\\n * @notice Store latest result/error\\n * @param requestId The request ID, returned by sendRequest()\\n * @param response Aggregated response from the user code\\n * @param err Aggregated error from the user code or from the execution pipeline\\n * Either response or error parameter will be set, but never both\\n */\\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal override {\\n ICCGatewayClient.CCGResponse storage resp = unprocessed_responses[requestId];\\n if (resp.state != ICCGatewayClient.CCGResponseState.Sent) {revert CCGRequestAlreadyFulfilled(requestId);}\\n\\n unprocessed_responses[requestId].state = err.length > 0 ? ICCGatewayClient.CCGResponseState.Error : ICCGatewayClient.CCGResponseState.Success;\\n unprocessed_responses[requestId].data = response;\\n unprocessed_responses[requestId].error = err;\\n\\n ICCGatewayClient(resp.source).callback(requestId);\\n }\\n\\n /**\\n * @dev Get the response data\\n * @param requestId The request ID, returned by sendRequest()\\n * @return response CCGResponse\\n */\\n function getResponse(bytes32 requestId, bool remove) external onlySource(requestId) returns (ICCGatewayClient.CCGResponse memory response) {\\n response = unprocessed_responses[requestId];\\n if (remove) {delete unprocessed_responses[requestId];}\\n }\\n}\",\"keccak256\":\"0x30020047512e69e37da4ab97917f13615bb96d65506baf5856aac3a25f8414af\",\"license\":\"MIT\"},\"contracts/interfaces/ICCGateway.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\\nimport {FunctionsRequest} from \\\"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\\\";\\n\\ninterface ICCGateway {\\n struct CCGRequest {\\n string name;\\n uint32 callbackGasLimit;\\n FunctionsRequest.Request config;\\n }\\n\\n /**\\n * @dev Can't register a request with an empty name\\n */\\n error CCGRequestNameEmpty();\\n\\n /**\\n * @dev Only the same source of the requestId is allowed to call the function\\n */\\n error CCGOnlySameSourceAllowed(bytes32 requestId);\\n\\n /**\\n * @dev Only a registered subscriptionId is allowed to call the function\\n */\\n error CCGRequestNotRegistered(uint64 subscriptionId);\\n\\n /**\\n * @dev Can't fulfill a request that has already been fulfilled\\n */\\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\\n\\n /**\\n * @dev Only A manager can call the function\\n */\\n error CCGOnlyManagerAllowed();\\n\\n /**\\n * @dev Send a request to the Functions DON\\n */\\n function sendRequest(\\n uint64 subscriptionId,\\n string[] calldata args,\\n bytes[] calldata bytesArgs,\\n bytes calldata encryptedSecretsReference\\n ) external returns (bytes32 requestId);\\n\\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\\n}\\n\",\"keccak256\":\"0xbc7d92f8db240767c8636e8df9b818cc1f5abfde22b8c49eee50f418fb0dbea5\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/ICCGatewayClient.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\ninterface ICCGatewayClient {\\n enum CCGResponseState {Sent, Success, Error}\\n\\n struct CCGResponse {\\n uint64 subscriptionId;\\n address source;\\n CCGResponseState state;\\n bytes data;\\n bytes error;\\n }\\n\\n function callback(bytes32 requestId) external;\\n}\\n\",\"keccak256\":\"0xb69320aa2152f374dec4cfc70b73f46e0db9774a1411d2acff1481ee3295f86a\",\"license\":\"UNLICENSED\"}},\"version\":1}", + "bytecode": "0x60a06040523480156200001157600080fd5b5060405162002f2f38038062002f2f83398101604081905262000034916200016e565b6001600160a01b0380841660805260018390556000908216156200005957816200005b565b335b90506200006a600082620000a2565b50620000977f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0882620000a2565b5050505050620001af565b6000828152602081815260408083206001600160a01b038516845290915281205460ff1662000147576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055620000fe3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016200014b565b5060005b92915050565b80516001600160a01b03811681146200016957600080fd5b919050565b6000806000606084860312156200018457600080fd5b6200018f8462000151565b925060208401519150620001a66040850162000151565b90509250925092565b608051612d5d620001d26000396000818161031a0152611a9f0152612d5d6000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c80638dbe7b9d116100a2578063c8ab5f2211610071578063c8ab5f2214610256578063cbbf67ec14610269578063d547741f14610289578063eae6f6521461029c578063ec87621c146102c357600080fd5b80638dbe7b9d1461022057806391d148541461022857806396c1582e1461023b578063a217fddf1461024e57600080fd5b80632d5bbf60116100e95780632d5bbf60146101a95780632f2ff15d146101d457806334d2afd9146101e757806336568abe146101fa57806378ca5de71461020d57600080fd5b806301ffc9a71461011b5780630ca761751461014357806315b851d114610158578063248a9ca314610178575b600080fd5b61012e61012936600461216b565b6102d8565b60405190151581526020015b60405180910390f35b610156610151366004612252565b61030f565b005b61016b6101663660046122be565b610393565b60405161013a919061235f565b61019b6101863660046123db565b60009081526020819052604090206001015490565b60405190815260200161013a565b6101bc6101b73660046123db565b6105ea565b6040516001600160401b03909116815260200161013a565b6101566101e23660046123f4565b610627565b6101566101f5366004612441565b610652565b6101566102083660046123f4565b6108cf565b61015661021b3660046123db565b610907565b60015461019b565b61012e6102363660046123f4565b61094f565b61019b6102493660046124e8565b610978565b61019b600081565b6101566102643660046125a1565b610e5a565b61027c610277366004612441565b610fee565b60405161013a91906126f8565b6101566102973660046123f4565b61148e565b61019b7fa5ff3ec7a96cdbba4d2d5172d66bbc73c6db3885f29b21be5da9fa7a7c02523281565b61019b600080516020612d0883398151915281565b60006001600160e01b03198216637965db0b60e01b148061030957506301ffc9a760e01b6001600160e01b03198316145b92915050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103585760405163c6829f8360e01b815260040160405180910390fd5b6103638383836114b3565b60405183907f85e1543bf2f84fe80c6badbce3648c8539ad1df4d2b3d822938ca0538be727e690600090a2505050565b6040805160a081018252600080825260208201819052918101919091526060808201819052608082015260008381526003602052604090205483906001600160a01b03600160401b9091041633146104065760405163949aaf2d60e01b8152600481018290526024015b60405180910390fd5b600084815260036020908152604091829020825160a08101845281546001600160401b0381168252600160401b81046001600160a01b03169382019390935292909190830190600160e01b900460ff166002811115610467576104676122f3565b6002811115610478576104786122f3565b815260200160018201805461048c906127de565b80601f01602080910402602001604051908101604052809291908181526020018280546104b8906127de565b80156105055780601f106104da57610100808354040283529160200191610505565b820191906000526020600020905b8154815290600101906020018083116104e857829003601f168201915b5050505050815260200160028201805461051e906127de565b80601f016020809104026020016040519081016040528092919081815260200182805461054a906127de565b80156105975780601f1061056c57610100808354040283529160200191610597565b820191906000526020600020905b81548152906001019060200180831161057a57829003601f168201915b505050505081525050915082156105e357600084815260036020526040812080546001600160e81b0319168155906105d26001830182612010565b6105e0600283016000612010565b50505b5092915050565b600481815481106105fa57600080fd5b9060005260206000209060049182820401919006600802915054906101000a90046001600160401b031681565b600082815260208190526040902060010154610642816115e6565b61064c83836115f3565b50505050565b61066a600080516020612d088339815191523261094f565b6106875760405163129d730760e01b815260040160405180910390fd5b6001600160401b038116600090815260026020526040902080546106aa906127de565b90506000036106d757604051630601bb0160e21b81526001600160401b03821660048201526024016103fd565b6001600160401b0381166000908152600260205260408120906106fa8282612010565b60018201805463ffffffff1916905560028201805462ffffff1916815560006107266003850182612010565b610734600283016000612010565b61074260038301600061204a565b610750600483016000612068565b50506004549150600090505b60045481101561088857600454821480156107b85750826001600160401b03166004828154811061078f5761078f612818565b6000918252602090912060048204015460039091166008026101000a90046001600160401b0316145b156107c1578091505b60045482148015906107de57506004546107dc826001612844565b105b156108765760046107f0826001612844565b8154811061080057610800612818565b90600052602060002090600491828204019190066008029054906101000a90046001600160401b03166004828154811061083c5761083c612818565b90600052602060002090600491828204019190066008026101000a8154816001600160401b0302191690836001600160401b031602179055505b8061088081612857565b91505061075c565b50600480548061089a5761089a612870565b60008281526020902060046000199092019182040180546001600160401b03600860038516026101000a021916905590555050565b6001600160a01b03811633146108f85760405163334bd91960e11b815260040160405180910390fd5b6109028282611685565b505050565b600080516020612d0883398151915260009081526020527fe84508f2c7fa9c351146748b3025cb78b45df37d868e48c6a75102fecdeee64654610949816115e6565b50600155565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60007fa5ff3ec7a96cdbba4d2d5172d66bbc73c6db3885f29b21be5da9fa7a7c0252326109a4816115e6565b6001600160401b0389166000908152600260205260409020805481906109c9906127de565b90506000036109f657604051630601bb0160e21b81526001600160401b038b1660048201526024016103fd565b6040805160e081019091526002808301805460009392839160ff1690811115610a2157610a216122f3565b6002811115610a3257610a326122f3565b81528154602090910190610100900460ff166002811115610a5557610a556122f3565b6002811115610a6657610a666122f3565b8152815460209091019062010000900460ff168015610a8757610a876122f3565b8015610a9557610a956122f3565b8152602001600182018054610aa9906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610ad5906127de565b8015610b225780601f10610af757610100808354040283529160200191610b22565b820191906000526020600020905b815481529060010190602001808311610b0557829003601f168201915b50505050508152602001600282018054610b3b906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610b67906127de565b8015610bb45780601f10610b8957610100808354040283529160200191610bb4565b820191906000526020600020905b815481529060010190602001808311610b9757829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b82821015610c8e578382906000526020600020018054610c01906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610c2d906127de565b8015610c7a5780601f10610c4f57610100808354040283529160200191610c7a565b820191906000526020600020905b815481529060010190602001808311610c5d57829003601f168201915b505050505081526020019060010190610be2565b50505050815260200160048201805480602002602001604051908101604052809291908181526020016000905b82821015610d67578382906000526020600020018054610cda906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610d06906127de565b8015610d535780601f10610d2857610100808354040283529160200191610d53565b820191906000526020600020905b815481529060010190602001808311610d3657829003601f168201915b505050505081526020019060010190610cbb565b5050509152505080516060820151919250610d87918391906000906116f0565b8415610dc95785858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050505060808201525b8815610de357610de3610ddc8a8c6128a9565b829061176e565b8615610dfd57610dfd610df6888a612935565b8290611798565b610e1f610e09826117c2565b60018085015490548e9163ffffffff1690611a9a565b6000818152600360205260409020805468010000000000000000600160e81b031916600160401b33021790559b9a5050505050505050505050565b610e72600080516020612d088339815191523261094f565b610e8f5760405163129d730760e01b815260040160405180910390fd5b6000819003610eb15760405163281b14ab60e01b815260040160405180910390fd5b6001600160401b038a16600090815260026020526040902080548190610ed6906127de565b9050600003610f3d576004805460018101825560008290529081047f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160401b03808f1660086003909516949094026101000a938402930219169190911790555b80610f498385836129ea565b506001818101805463ffffffff191663ffffffff87161790556002808301805462ff000019811682558d93919262ff00ff1990911691908490811115610f9157610f916122f3565b021790555060038101610fa5898b836129ea565b5060028082018054899261ff001990911690610100908490811115610fcc57610fcc6122f3565b021790555060048101610fe08688836129ea565b505050505050505050505050565b610ff6612086565b6001600160401b03821660009081526002602052604090208054611019906127de565b905060000361104657604051630601bb0160e21b81526001600160401b03831660048201526024016103fd565b6001600160401b03821660009081526002602052604090819020815160608101909252805482908290611078906127de565b80601f01602080910402602001604051908101604052809291908181526020018280546110a4906127de565b80156110f15780601f106110c6576101008083540402835291602001916110f1565b820191906000526020600020905b8154815290600101906020018083116110d457829003601f168201915b5050509183525050600182015463ffffffff1660208201526040805160e0810182526002808501805493909401939192839160ff90911690811115611138576111386122f3565b6002811115611149576111496122f3565b81528154602090910190610100900460ff16600281111561116c5761116c6122f3565b600281111561117d5761117d6122f3565b8152815460209091019062010000900460ff16801561119e5761119e6122f3565b80156111ac576111ac6122f3565b81526020016001820180546111c0906127de565b80601f01602080910402602001604051908101604052809291908181526020018280546111ec906127de565b80156112395780601f1061120e57610100808354040283529160200191611239565b820191906000526020600020905b81548152906001019060200180831161121c57829003601f168201915b50505050508152602001600282018054611252906127de565b80601f016020809104026020016040519081016040528092919081815260200182805461127e906127de565b80156112cb5780601f106112a0576101008083540402835291602001916112cb565b820191906000526020600020905b8154815290600101906020018083116112ae57829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b828210156113a5578382906000526020600020018054611318906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054611344906127de565b80156113915780601f1061136657610100808354040283529160200191611391565b820191906000526020600020905b81548152906001019060200180831161137457829003601f168201915b5050505050815260200190600101906112f9565b50505050815260200160048201805480602002602001604051908101604052809291908181526020016000905b8282101561147e5783829060005260206000200180546113f1906127de565b80601f016020809104026020016040519081016040528092919081815260200182805461141d906127de565b801561146a5780601f1061143f5761010080835404028352916020019161146a565b820191906000526020600020905b81548152906001019060200180831161144d57829003601f168201915b5050505050815260200190600101906113d2565b5050509152505090525092915050565b6000828152602081905260409020600101546114a9816115e6565b61064c8383611685565b6000838152600360205260408120908154600160e01b900460ff1660028111156114df576114df6122f3565b146114ff576040516287aa6360e01b8152600481018590526024016103fd565b600082511161150f576001611512565b60025b6000858152600360205260409020805460ff60e01b1916600160e01b836002811115611540576115406122f3565b021790555060008481526003602052604090206001016115608482612aaa565b50600084815260036020526040902060020161157c8382612aaa565b508054604051636f89cca760e11b815260048101869052600160401b9091046001600160a01b03169063df13994e90602401600060405180830381600087803b1580156115c857600080fd5b505af11580156115dc573d6000803e3d6000fd5b5050505050505050565b6115f08133611b6c565b50565b60006115ff838361094f565b61167d576000838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556116353390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610309565b506000610309565b6000611691838361094f565b1561167d576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610309565b8051600003611712576040516322ce3edd60e01b815260040160405180910390fd5b83836002811115611725576117256122f3565b90816002811115611738576117386122f3565b9052506040840182801561174e5761174e6122f3565b9081801561175e5761175e6122f3565b9052506060909301929092525050565b80516000036117905760405163fe936cb760e01b815260040160405180910390fd5b60a090910152565b80516000036117ba5760405163fe936cb760e01b815260040160405180910390fd5b60c090910152565b606060006117d1610100611ba9565b905061180a6040518060400160405280600c81526020016b31b7b232a637b1b0ba34b7b760a11b81525082611bca90919063ffffffff16565b8251611828906002811115611821576118216122f3565b8290611be3565b6040805180820190915260088152676c616e677561676560c01b6020820152611852908290611bca565b6040830151611869908015611821576118216122f3565b604080518082019091526006815265736f7572636560d01b6020820152611891908290611bca565b60608301516118a1908290611bca565b60a08301515115611935576040805180820190915260048152636172677360e01b60208201526118d2908290611bca565b6118db81611c1c565b60005b8360a001515181101561192b5761191b8460a00151828151811061190457611904612818565b602002602001015183611bca90919063ffffffff16565b61192481612857565b90506118de565b5061193581611c40565b608083015151156119f957600083602001516002811115611958576119586122f3565b036119765760405163a80d31f760e01b815260040160405180910390fd5b60408051808201909152600f81526e39b2b1b932ba39a637b1b0ba34b7b760891b60208201526119a7908290611bca565b6119c083602001516002811115611821576118216122f3565b6040805180820190915260078152667365637265747360c81b60208201526119e9908290611bca565b60808301516119f9908290611c5e565b60c08301515115611a925760408051808201909152600981526862797465734172677360b81b6020820152611a2f908290611bca565b611a3881611c1c565b60005b8360c0015151811015611a8857611a788460c001518281518110611a6157611a61612818565b602002602001015183611c5e90919063ffffffff16565b611a8181612857565b9050611a3b565b50611a9281611c40565b515192915050565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663461d27628688600188886040518663ffffffff1660e01b8152600401611af2959493929190612b69565b6020604051808303816000875af1158015611b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b359190612bb2565b60405190915081907f1131472297a800fee664d1d89cfa8f7676ff07189ecc53f80bbb5f4969099db890600090a295945050505050565b611b76828261094f565b611ba55760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016103fd565b5050565b611bb16120e3565b8051611bbd9083611c6b565b5060006020820152919050565b611bd78260038351611ce2565b81516109029082611dfb565b8151611bf09060c2611e23565b50611ba58282604051602001611c0891815260200190565b604051602081830303815290604052611c5e565b611c27816004611e8c565b600181602001818151611c3a9190612844565b90525050565b611c4b816007611e8c565b600181602001818151611c3a9190612bcb565b611bd78260028351611ce2565b604080518082019091526060815260006020820152611c8b602083612bde565b15611cb357611c9b602083612bde565b611ca6906020612bcb565b611cb09083612844565b91505b602080840183905260405180855260008152908184010181811015611cd757600080fd5b604052509192915050565b6017816001600160401b031611611d0857825161064c9060e0600585901b168317611e23565b60ff816001600160401b031611611d48578251611d30906018611fe0600586901b1617611e23565b50825161064c906001600160401b0383166001611ea3565b61ffff816001600160401b031611611d89578251611d71906019611fe0600586901b1617611e23565b50825161064c906001600160401b0383166002611ea3565b63ffffffff816001600160401b031611611dcc578251611db490601a611fe0600586901b1617611e23565b50825161064c906001600160401b0383166004611ea3565b8251611de390601b611fe0600586901b1617611e23565b50825161064c906001600160401b0383166008611ea3565b604080518082019091526060815260006020820152611e1c83838451611f28565b9392505050565b6040805180820190915260608152600060208201528251516000611e48826001612844565b905084602001518210611e6957611e6985611e64836002612c00565b611ff9565b8451602083820101858153508051821115611e82578181525b5093949350505050565b815161090290601f611fe0600585901b1617611e23565b6040805180820190915260608152600060208201528351516000611ec78285612844565b90508560200151811115611ee457611ee486611e64836002612c00565b60006001611ef486610100612cfb565b611efe9190612bcb565b90508651828101878319825116178152508051831115611f1c578281525b50959695505050505050565b6040805180820190915260608152600060208201528251821115611f4b57600080fd5b8351516000611f5a8483612844565b90508560200151811115611f7757611f7786611e64836002612c00565b855180518382016020019160009180851115611f91578482525b505050602086015b60208610611fd15780518252611fb0602083612844565b9150611fbd602082612844565b9050611fca602087612bcb565b9550611f99565b51815160001960208890036101000a0190811690199190911617905250849150509392505050565b81516120058383611c6b565b5061064c8382611dfb565b50805461201c906127de565b6000825580601f1061202c575050565b601f0160209004906000526020600020908101906115f09190612118565b50805460008255906000526020600020908101906115f09190612131565b50805460008255906000526020600020908101906115f0919061214e565b60408051606080820183528152600060208201529081016120de6040805160e0810190915280600081526020016000815260200160008152602001606081526020016060815260200160608152602001606081525090565b905290565b604051806040016040528061210b604051806040016040528060608152602001600081525090565b8152602001600081525090565b5b8082111561212d5760008155600101612119565b5090565b8082111561212d5760006121458282612010565b50600101612131565b8082111561212d5760006121628282612010565b5060010161214e565b60006020828403121561217d57600080fd5b81356001600160e01b031981168114611e1c57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156121d3576121d3612195565b604052919050565b60006001600160401b038311156121f4576121f4612195565b612207601f8401601f19166020016121ab565b905082815283838301111561221b57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261224357600080fd5b611e1c838335602085016121db565b60008060006060848603121561226757600080fd5b8335925060208401356001600160401b038082111561228557600080fd5b61229187838801612232565b935060408601359150808211156122a757600080fd5b506122b486828701612232565b9150509250925092565b600080604083850312156122d157600080fd5b82359150602083013580151581146122e857600080fd5b809150509250929050565b634e487b7160e01b600052602160045260246000fd5b600381106115f0576115f06122f3565b6000815180845260005b8181101561233f57602081850181015186830182015201612323565b506000602082860101526020601f19601f83011685010191505092915050565b602081526001600160401b03825116602082015260018060a01b0360208301511660408201526000604083015161239581612309565b80606084015250606083015160a060808401526123b560c0840182612319565b90506080840151601f198483030160a08501526123d28282612319565b95945050505050565b6000602082840312156123ed57600080fd5b5035919050565b6000806040838503121561240757600080fd5b8235915060208301356001600160a01b03811681146122e857600080fd5b80356001600160401b038116811461243c57600080fd5b919050565b60006020828403121561245357600080fd5b611e1c82612425565b60008083601f84011261246e57600080fd5b5081356001600160401b0381111561248557600080fd5b6020830191508360208260051b85010111156124a057600080fd5b9250929050565b60008083601f8401126124b957600080fd5b5081356001600160401b038111156124d057600080fd5b6020830191508360208285010111156124a057600080fd5b60008060008060008060006080888a03121561250357600080fd5b61250c88612425565b965060208801356001600160401b038082111561252857600080fd5b6125348b838c0161245c565b909850965060408a013591508082111561254d57600080fd5b6125598b838c0161245c565b909650945060608a013591508082111561257257600080fd5b5061257f8a828b016124a7565b989b979a50959850939692959293505050565b80356003811061243c57600080fd5b60008060008060008060008060008060e08b8d0312156125c057600080fd5b6125c98b612425565b99506125d760208c01612592565b985060408b01356001600160401b03808211156125f357600080fd5b6125ff8e838f016124a7565b909a50985088915061261360608e01612592565b975060808d013591508082111561262957600080fd5b6126358e838f016124a7565b909750955060a08d0135915063ffffffff8216821461265357600080fd5b90935060c08c0135908082111561266957600080fd5b506126768d828e016124a7565b915080935050809150509295989b9194979a5092959850565b6001811061269f5761269f6122f3565b9052565b600081518084526020808501808196508360051b8101915082860160005b858110156126eb5782840389526126d9848351612319565b988501989350908401906001016126c1565b5091979650505050505050565b6020815260008251606060208401526127146080840182612319565b905063ffffffff60208501511660408401526040840151601f19848303016060850152805161274281612309565b8252602081015161275281612309565b80602084015250604081015161276b604084018261268f565b50606081015160e0606084015261278560e0840182612319565b90506080820151838203608085015261279e8282612319565b91505060a082015183820360a08501526127b882826126a3565b91505060c0820151915082810360c08401526127d481836126a3565b9695505050505050565b600181811c908216806127f257607f821691505b60208210810361281257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156103095761030961282e565b6000600182016128695761286961282e565b5060010190565b634e487b7160e01b600052603160045260246000fd5b60006001600160401b0382111561289f5761289f612195565b5060051b60200190565b60006128bc6128b784612886565b6121ab565b80848252602080830192508560051b8501368111156128da57600080fd5b855b818110156129295780356001600160401b038111156128fb5760008081fd5b870136601f82011261290d5760008081fd5b61291b3682358684016121db565b8652509382019382016128dc565b50919695505050505050565b60006129436128b784612886565b80848252602080830192508560051b85013681111561296157600080fd5b855b818110156129295780356001600160401b038111156129825760008081fd5b61298e36828a01612232565b865250938201938201612963565b601f82111561090257600081815260208120601f850160051c810160208610156129c35750805b601f850160051c820191505b818110156129e2578281556001016129cf565b505050505050565b6001600160401b03831115612a0157612a01612195565b612a1583612a0f83546127de565b8361299c565b6000601f841160018114612a495760008515612a315750838201355b600019600387901b1c1916600186901b178355612aa3565b600083815260209020601f19861690835b82811015612a7a5786850135825560209485019460019092019101612a5a565b5086821015612a975760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b81516001600160401b03811115612ac357612ac3612195565b612ad781612ad184546127de565b8461299c565b602080601f831160018114612b0c5760008415612af45750858301515b600019600386901b1c1916600185901b1785556129e2565b600085815260208120601f198616915b82811015612b3b57888601518255948401946001909101908401612b1c565b5085821015612b595787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160401b038616815260a060208201526000612b8b60a0830187612319565b61ffff9590951660408301525063ffffffff92909216606083015260809091015292915050565b600060208284031215612bc457600080fd5b5051919050565b818103818111156103095761030961282e565b600082612bfb57634e487b7160e01b600052601260045260246000fd5b500690565b80820281158282048414176103095761030961282e565b600181815b80851115612c52578160001904821115612c3857612c3861282e565b80851615612c4557918102915b93841c9390800290612c1c565b509250929050565b600082612c6957506001610309565b81612c7657506000610309565b8160018114612c8c5760028114612c9657612cb2565b6001915050610309565b60ff841115612ca757612ca761282e565b50506001821b610309565b5060208310610133831016604e8410600b8410161715612cd5575081810a610309565b612cdf8383612c17565b8060001904821115612cf357612cf361282e565b029392505050565b6000611e1c8383612c5a56fe241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08a2646970667358221220c853501b7d4e314864358724dac532054bd10ab5dc8600ff8db02415b54e281264736f6c63430008140033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101165760003560e01c80638dbe7b9d116100a2578063c8ab5f2211610071578063c8ab5f2214610256578063cbbf67ec14610269578063d547741f14610289578063eae6f6521461029c578063ec87621c146102c357600080fd5b80638dbe7b9d1461022057806391d148541461022857806396c1582e1461023b578063a217fddf1461024e57600080fd5b80632d5bbf60116100e95780632d5bbf60146101a95780632f2ff15d146101d457806334d2afd9146101e757806336568abe146101fa57806378ca5de71461020d57600080fd5b806301ffc9a71461011b5780630ca761751461014357806315b851d114610158578063248a9ca314610178575b600080fd5b61012e61012936600461216b565b6102d8565b60405190151581526020015b60405180910390f35b610156610151366004612252565b61030f565b005b61016b6101663660046122be565b610393565b60405161013a919061235f565b61019b6101863660046123db565b60009081526020819052604090206001015490565b60405190815260200161013a565b6101bc6101b73660046123db565b6105ea565b6040516001600160401b03909116815260200161013a565b6101566101e23660046123f4565b610627565b6101566101f5366004612441565b610652565b6101566102083660046123f4565b6108cf565b61015661021b3660046123db565b610907565b60015461019b565b61012e6102363660046123f4565b61094f565b61019b6102493660046124e8565b610978565b61019b600081565b6101566102643660046125a1565b610e5a565b61027c610277366004612441565b610fee565b60405161013a91906126f8565b6101566102973660046123f4565b61148e565b61019b7fa5ff3ec7a96cdbba4d2d5172d66bbc73c6db3885f29b21be5da9fa7a7c02523281565b61019b600080516020612d0883398151915281565b60006001600160e01b03198216637965db0b60e01b148061030957506301ffc9a760e01b6001600160e01b03198316145b92915050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103585760405163c6829f8360e01b815260040160405180910390fd5b6103638383836114b3565b60405183907f85e1543bf2f84fe80c6badbce3648c8539ad1df4d2b3d822938ca0538be727e690600090a2505050565b6040805160a081018252600080825260208201819052918101919091526060808201819052608082015260008381526003602052604090205483906001600160a01b03600160401b9091041633146104065760405163949aaf2d60e01b8152600481018290526024015b60405180910390fd5b600084815260036020908152604091829020825160a08101845281546001600160401b0381168252600160401b81046001600160a01b03169382019390935292909190830190600160e01b900460ff166002811115610467576104676122f3565b6002811115610478576104786122f3565b815260200160018201805461048c906127de565b80601f01602080910402602001604051908101604052809291908181526020018280546104b8906127de565b80156105055780601f106104da57610100808354040283529160200191610505565b820191906000526020600020905b8154815290600101906020018083116104e857829003601f168201915b5050505050815260200160028201805461051e906127de565b80601f016020809104026020016040519081016040528092919081815260200182805461054a906127de565b80156105975780601f1061056c57610100808354040283529160200191610597565b820191906000526020600020905b81548152906001019060200180831161057a57829003601f168201915b505050505081525050915082156105e357600084815260036020526040812080546001600160e81b0319168155906105d26001830182612010565b6105e0600283016000612010565b50505b5092915050565b600481815481106105fa57600080fd5b9060005260206000209060049182820401919006600802915054906101000a90046001600160401b031681565b600082815260208190526040902060010154610642816115e6565b61064c83836115f3565b50505050565b61066a600080516020612d088339815191523261094f565b6106875760405163129d730760e01b815260040160405180910390fd5b6001600160401b038116600090815260026020526040902080546106aa906127de565b90506000036106d757604051630601bb0160e21b81526001600160401b03821660048201526024016103fd565b6001600160401b0381166000908152600260205260408120906106fa8282612010565b60018201805463ffffffff1916905560028201805462ffffff1916815560006107266003850182612010565b610734600283016000612010565b61074260038301600061204a565b610750600483016000612068565b50506004549150600090505b60045481101561088857600454821480156107b85750826001600160401b03166004828154811061078f5761078f612818565b6000918252602090912060048204015460039091166008026101000a90046001600160401b0316145b156107c1578091505b60045482148015906107de57506004546107dc826001612844565b105b156108765760046107f0826001612844565b8154811061080057610800612818565b90600052602060002090600491828204019190066008029054906101000a90046001600160401b03166004828154811061083c5761083c612818565b90600052602060002090600491828204019190066008026101000a8154816001600160401b0302191690836001600160401b031602179055505b8061088081612857565b91505061075c565b50600480548061089a5761089a612870565b60008281526020902060046000199092019182040180546001600160401b03600860038516026101000a021916905590555050565b6001600160a01b03811633146108f85760405163334bd91960e11b815260040160405180910390fd5b6109028282611685565b505050565b600080516020612d0883398151915260009081526020527fe84508f2c7fa9c351146748b3025cb78b45df37d868e48c6a75102fecdeee64654610949816115e6565b50600155565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60007fa5ff3ec7a96cdbba4d2d5172d66bbc73c6db3885f29b21be5da9fa7a7c0252326109a4816115e6565b6001600160401b0389166000908152600260205260409020805481906109c9906127de565b90506000036109f657604051630601bb0160e21b81526001600160401b038b1660048201526024016103fd565b6040805160e081019091526002808301805460009392839160ff1690811115610a2157610a216122f3565b6002811115610a3257610a326122f3565b81528154602090910190610100900460ff166002811115610a5557610a556122f3565b6002811115610a6657610a666122f3565b8152815460209091019062010000900460ff168015610a8757610a876122f3565b8015610a9557610a956122f3565b8152602001600182018054610aa9906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610ad5906127de565b8015610b225780601f10610af757610100808354040283529160200191610b22565b820191906000526020600020905b815481529060010190602001808311610b0557829003601f168201915b50505050508152602001600282018054610b3b906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610b67906127de565b8015610bb45780601f10610b8957610100808354040283529160200191610bb4565b820191906000526020600020905b815481529060010190602001808311610b9757829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b82821015610c8e578382906000526020600020018054610c01906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610c2d906127de565b8015610c7a5780601f10610c4f57610100808354040283529160200191610c7a565b820191906000526020600020905b815481529060010190602001808311610c5d57829003601f168201915b505050505081526020019060010190610be2565b50505050815260200160048201805480602002602001604051908101604052809291908181526020016000905b82821015610d67578382906000526020600020018054610cda906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054610d06906127de565b8015610d535780601f10610d2857610100808354040283529160200191610d53565b820191906000526020600020905b815481529060010190602001808311610d3657829003601f168201915b505050505081526020019060010190610cbb565b5050509152505080516060820151919250610d87918391906000906116f0565b8415610dc95785858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050505060808201525b8815610de357610de3610ddc8a8c6128a9565b829061176e565b8615610dfd57610dfd610df6888a612935565b8290611798565b610e1f610e09826117c2565b60018085015490548e9163ffffffff1690611a9a565b6000818152600360205260409020805468010000000000000000600160e81b031916600160401b33021790559b9a5050505050505050505050565b610e72600080516020612d088339815191523261094f565b610e8f5760405163129d730760e01b815260040160405180910390fd5b6000819003610eb15760405163281b14ab60e01b815260040160405180910390fd5b6001600160401b038a16600090815260026020526040902080548190610ed6906127de565b9050600003610f3d576004805460018101825560008290529081047f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160401b03808f1660086003909516949094026101000a938402930219169190911790555b80610f498385836129ea565b506001818101805463ffffffff191663ffffffff87161790556002808301805462ff000019811682558d93919262ff00ff1990911691908490811115610f9157610f916122f3565b021790555060038101610fa5898b836129ea565b5060028082018054899261ff001990911690610100908490811115610fcc57610fcc6122f3565b021790555060048101610fe08688836129ea565b505050505050505050505050565b610ff6612086565b6001600160401b03821660009081526002602052604090208054611019906127de565b905060000361104657604051630601bb0160e21b81526001600160401b03831660048201526024016103fd565b6001600160401b03821660009081526002602052604090819020815160608101909252805482908290611078906127de565b80601f01602080910402602001604051908101604052809291908181526020018280546110a4906127de565b80156110f15780601f106110c6576101008083540402835291602001916110f1565b820191906000526020600020905b8154815290600101906020018083116110d457829003601f168201915b5050509183525050600182015463ffffffff1660208201526040805160e0810182526002808501805493909401939192839160ff90911690811115611138576111386122f3565b6002811115611149576111496122f3565b81528154602090910190610100900460ff16600281111561116c5761116c6122f3565b600281111561117d5761117d6122f3565b8152815460209091019062010000900460ff16801561119e5761119e6122f3565b80156111ac576111ac6122f3565b81526020016001820180546111c0906127de565b80601f01602080910402602001604051908101604052809291908181526020018280546111ec906127de565b80156112395780601f1061120e57610100808354040283529160200191611239565b820191906000526020600020905b81548152906001019060200180831161121c57829003601f168201915b50505050508152602001600282018054611252906127de565b80601f016020809104026020016040519081016040528092919081815260200182805461127e906127de565b80156112cb5780601f106112a0576101008083540402835291602001916112cb565b820191906000526020600020905b8154815290600101906020018083116112ae57829003601f168201915b5050505050815260200160038201805480602002602001604051908101604052809291908181526020016000905b828210156113a5578382906000526020600020018054611318906127de565b80601f0160208091040260200160405190810160405280929190818152602001828054611344906127de565b80156113915780601f1061136657610100808354040283529160200191611391565b820191906000526020600020905b81548152906001019060200180831161137457829003601f168201915b5050505050815260200190600101906112f9565b50505050815260200160048201805480602002602001604051908101604052809291908181526020016000905b8282101561147e5783829060005260206000200180546113f1906127de565b80601f016020809104026020016040519081016040528092919081815260200182805461141d906127de565b801561146a5780601f1061143f5761010080835404028352916020019161146a565b820191906000526020600020905b81548152906001019060200180831161144d57829003601f168201915b5050505050815260200190600101906113d2565b5050509152505090525092915050565b6000828152602081905260409020600101546114a9816115e6565b61064c8383611685565b6000838152600360205260408120908154600160e01b900460ff1660028111156114df576114df6122f3565b146114ff576040516287aa6360e01b8152600481018590526024016103fd565b600082511161150f576001611512565b60025b6000858152600360205260409020805460ff60e01b1916600160e01b836002811115611540576115406122f3565b021790555060008481526003602052604090206001016115608482612aaa565b50600084815260036020526040902060020161157c8382612aaa565b508054604051636f89cca760e11b815260048101869052600160401b9091046001600160a01b03169063df13994e90602401600060405180830381600087803b1580156115c857600080fd5b505af11580156115dc573d6000803e3d6000fd5b5050505050505050565b6115f08133611b6c565b50565b60006115ff838361094f565b61167d576000838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556116353390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610309565b506000610309565b6000611691838361094f565b1561167d576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610309565b8051600003611712576040516322ce3edd60e01b815260040160405180910390fd5b83836002811115611725576117256122f3565b90816002811115611738576117386122f3565b9052506040840182801561174e5761174e6122f3565b9081801561175e5761175e6122f3565b9052506060909301929092525050565b80516000036117905760405163fe936cb760e01b815260040160405180910390fd5b60a090910152565b80516000036117ba5760405163fe936cb760e01b815260040160405180910390fd5b60c090910152565b606060006117d1610100611ba9565b905061180a6040518060400160405280600c81526020016b31b7b232a637b1b0ba34b7b760a11b81525082611bca90919063ffffffff16565b8251611828906002811115611821576118216122f3565b8290611be3565b6040805180820190915260088152676c616e677561676560c01b6020820152611852908290611bca565b6040830151611869908015611821576118216122f3565b604080518082019091526006815265736f7572636560d01b6020820152611891908290611bca565b60608301516118a1908290611bca565b60a08301515115611935576040805180820190915260048152636172677360e01b60208201526118d2908290611bca565b6118db81611c1c565b60005b8360a001515181101561192b5761191b8460a00151828151811061190457611904612818565b602002602001015183611bca90919063ffffffff16565b61192481612857565b90506118de565b5061193581611c40565b608083015151156119f957600083602001516002811115611958576119586122f3565b036119765760405163a80d31f760e01b815260040160405180910390fd5b60408051808201909152600f81526e39b2b1b932ba39a637b1b0ba34b7b760891b60208201526119a7908290611bca565b6119c083602001516002811115611821576118216122f3565b6040805180820190915260078152667365637265747360c81b60208201526119e9908290611bca565b60808301516119f9908290611c5e565b60c08301515115611a925760408051808201909152600981526862797465734172677360b81b6020820152611a2f908290611bca565b611a3881611c1c565b60005b8360c0015151811015611a8857611a788460c001518281518110611a6157611a61612818565b602002602001015183611c5e90919063ffffffff16565b611a8181612857565b9050611a3b565b50611a9281611c40565b515192915050565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663461d27628688600188886040518663ffffffff1660e01b8152600401611af2959493929190612b69565b6020604051808303816000875af1158015611b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b359190612bb2565b60405190915081907f1131472297a800fee664d1d89cfa8f7676ff07189ecc53f80bbb5f4969099db890600090a295945050505050565b611b76828261094f565b611ba55760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016103fd565b5050565b611bb16120e3565b8051611bbd9083611c6b565b5060006020820152919050565b611bd78260038351611ce2565b81516109029082611dfb565b8151611bf09060c2611e23565b50611ba58282604051602001611c0891815260200190565b604051602081830303815290604052611c5e565b611c27816004611e8c565b600181602001818151611c3a9190612844565b90525050565b611c4b816007611e8c565b600181602001818151611c3a9190612bcb565b611bd78260028351611ce2565b604080518082019091526060815260006020820152611c8b602083612bde565b15611cb357611c9b602083612bde565b611ca6906020612bcb565b611cb09083612844565b91505b602080840183905260405180855260008152908184010181811015611cd757600080fd5b604052509192915050565b6017816001600160401b031611611d0857825161064c9060e0600585901b168317611e23565b60ff816001600160401b031611611d48578251611d30906018611fe0600586901b1617611e23565b50825161064c906001600160401b0383166001611ea3565b61ffff816001600160401b031611611d89578251611d71906019611fe0600586901b1617611e23565b50825161064c906001600160401b0383166002611ea3565b63ffffffff816001600160401b031611611dcc578251611db490601a611fe0600586901b1617611e23565b50825161064c906001600160401b0383166004611ea3565b8251611de390601b611fe0600586901b1617611e23565b50825161064c906001600160401b0383166008611ea3565b604080518082019091526060815260006020820152611e1c83838451611f28565b9392505050565b6040805180820190915260608152600060208201528251516000611e48826001612844565b905084602001518210611e6957611e6985611e64836002612c00565b611ff9565b8451602083820101858153508051821115611e82578181525b5093949350505050565b815161090290601f611fe0600585901b1617611e23565b6040805180820190915260608152600060208201528351516000611ec78285612844565b90508560200151811115611ee457611ee486611e64836002612c00565b60006001611ef486610100612cfb565b611efe9190612bcb565b90508651828101878319825116178152508051831115611f1c578281525b50959695505050505050565b6040805180820190915260608152600060208201528251821115611f4b57600080fd5b8351516000611f5a8483612844565b90508560200151811115611f7757611f7786611e64836002612c00565b855180518382016020019160009180851115611f91578482525b505050602086015b60208610611fd15780518252611fb0602083612844565b9150611fbd602082612844565b9050611fca602087612bcb565b9550611f99565b51815160001960208890036101000a0190811690199190911617905250849150509392505050565b81516120058383611c6b565b5061064c8382611dfb565b50805461201c906127de565b6000825580601f1061202c575050565b601f0160209004906000526020600020908101906115f09190612118565b50805460008255906000526020600020908101906115f09190612131565b50805460008255906000526020600020908101906115f0919061214e565b60408051606080820183528152600060208201529081016120de6040805160e0810190915280600081526020016000815260200160008152602001606081526020016060815260200160608152602001606081525090565b905290565b604051806040016040528061210b604051806040016040528060608152602001600081525090565b8152602001600081525090565b5b8082111561212d5760008155600101612119565b5090565b8082111561212d5760006121458282612010565b50600101612131565b8082111561212d5760006121628282612010565b5060010161214e565b60006020828403121561217d57600080fd5b81356001600160e01b031981168114611e1c57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156121d3576121d3612195565b604052919050565b60006001600160401b038311156121f4576121f4612195565b612207601f8401601f19166020016121ab565b905082815283838301111561221b57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261224357600080fd5b611e1c838335602085016121db565b60008060006060848603121561226757600080fd5b8335925060208401356001600160401b038082111561228557600080fd5b61229187838801612232565b935060408601359150808211156122a757600080fd5b506122b486828701612232565b9150509250925092565b600080604083850312156122d157600080fd5b82359150602083013580151581146122e857600080fd5b809150509250929050565b634e487b7160e01b600052602160045260246000fd5b600381106115f0576115f06122f3565b6000815180845260005b8181101561233f57602081850181015186830182015201612323565b506000602082860101526020601f19601f83011685010191505092915050565b602081526001600160401b03825116602082015260018060a01b0360208301511660408201526000604083015161239581612309565b80606084015250606083015160a060808401526123b560c0840182612319565b90506080840151601f198483030160a08501526123d28282612319565b95945050505050565b6000602082840312156123ed57600080fd5b5035919050565b6000806040838503121561240757600080fd5b8235915060208301356001600160a01b03811681146122e857600080fd5b80356001600160401b038116811461243c57600080fd5b919050565b60006020828403121561245357600080fd5b611e1c82612425565b60008083601f84011261246e57600080fd5b5081356001600160401b0381111561248557600080fd5b6020830191508360208260051b85010111156124a057600080fd5b9250929050565b60008083601f8401126124b957600080fd5b5081356001600160401b038111156124d057600080fd5b6020830191508360208285010111156124a057600080fd5b60008060008060008060006080888a03121561250357600080fd5b61250c88612425565b965060208801356001600160401b038082111561252857600080fd5b6125348b838c0161245c565b909850965060408a013591508082111561254d57600080fd5b6125598b838c0161245c565b909650945060608a013591508082111561257257600080fd5b5061257f8a828b016124a7565b989b979a50959850939692959293505050565b80356003811061243c57600080fd5b60008060008060008060008060008060e08b8d0312156125c057600080fd5b6125c98b612425565b99506125d760208c01612592565b985060408b01356001600160401b03808211156125f357600080fd5b6125ff8e838f016124a7565b909a50985088915061261360608e01612592565b975060808d013591508082111561262957600080fd5b6126358e838f016124a7565b909750955060a08d0135915063ffffffff8216821461265357600080fd5b90935060c08c0135908082111561266957600080fd5b506126768d828e016124a7565b915080935050809150509295989b9194979a5092959850565b6001811061269f5761269f6122f3565b9052565b600081518084526020808501808196508360051b8101915082860160005b858110156126eb5782840389526126d9848351612319565b988501989350908401906001016126c1565b5091979650505050505050565b6020815260008251606060208401526127146080840182612319565b905063ffffffff60208501511660408401526040840151601f19848303016060850152805161274281612309565b8252602081015161275281612309565b80602084015250604081015161276b604084018261268f565b50606081015160e0606084015261278560e0840182612319565b90506080820151838203608085015261279e8282612319565b91505060a082015183820360a08501526127b882826126a3565b91505060c0820151915082810360c08401526127d481836126a3565b9695505050505050565b600181811c908216806127f257607f821691505b60208210810361281257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156103095761030961282e565b6000600182016128695761286961282e565b5060010190565b634e487b7160e01b600052603160045260246000fd5b60006001600160401b0382111561289f5761289f612195565b5060051b60200190565b60006128bc6128b784612886565b6121ab565b80848252602080830192508560051b8501368111156128da57600080fd5b855b818110156129295780356001600160401b038111156128fb5760008081fd5b870136601f82011261290d5760008081fd5b61291b3682358684016121db565b8652509382019382016128dc565b50919695505050505050565b60006129436128b784612886565b80848252602080830192508560051b85013681111561296157600080fd5b855b818110156129295780356001600160401b038111156129825760008081fd5b61298e36828a01612232565b865250938201938201612963565b601f82111561090257600081815260208120601f850160051c810160208610156129c35750805b601f850160051c820191505b818110156129e2578281556001016129cf565b505050505050565b6001600160401b03831115612a0157612a01612195565b612a1583612a0f83546127de565b8361299c565b6000601f841160018114612a495760008515612a315750838201355b600019600387901b1c1916600186901b178355612aa3565b600083815260209020601f19861690835b82811015612a7a5786850135825560209485019460019092019101612a5a565b5086821015612a975760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b81516001600160401b03811115612ac357612ac3612195565b612ad781612ad184546127de565b8461299c565b602080601f831160018114612b0c5760008415612af45750858301515b600019600386901b1c1916600185901b1785556129e2565b600085815260208120601f198616915b82811015612b3b57888601518255948401946001909101908401612b1c565b5085821015612b595787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160401b038616815260a060208201526000612b8b60a0830187612319565b61ffff9590951660408301525063ffffffff92909216606083015260809091015292915050565b600060208284031215612bc457600080fd5b5051919050565b818103818111156103095761030961282e565b600082612bfb57634e487b7160e01b600052601260045260246000fd5b500690565b80820281158282048414176103095761030961282e565b600181815b80851115612c52578160001904821115612c3857612c3861282e565b80851615612c4557918102915b93841c9390800290612c1c565b509250929050565b600082612c6957506001610309565b81612c7657506000610309565b8160018114612c8c5760028114612c9657612cb2565b6001915050610309565b60ff841115612ca757612ca761282e565b50506001821b610309565b5060208310610133831016604e8410600b8410161715612cd5575081810a610309565b612cdf8383612c17565b8060001904821115612cf357612cf361282e565b029392505050565b6000611e1c8383612c5a56fe241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08a2646970667358221220c853501b7d4e314864358724dac532054bd10ab5dc8600ff8db02415b54e281264736f6c63430008140033", + "devdoc": { + "errors": { + "AccessControlBadConfirmation()": [ + { + "details": "The caller of a function is not the expected one. NOTE: Don't confuse with {AccessControlUnauthorizedAccount}." + } + ], + "AccessControlUnauthorizedAccount(address,bytes32)": [ + { + "details": "The `account` is missing a role." + } + ], + "CCGOnlyManagerAllowed()": [ + { + "details": "Only A manager can call the function" + } + ], + "CCGOnlySameSourceAllowed(bytes32)": [ + { + "details": "Only the same source of the requestId is allowed to call the function" + } + ], + "CCGRequestAlreadyFulfilled(bytes32)": [ + { + "details": "Can't fulfill a request that has already been fulfilled" + } + ], + "CCGRequestNameEmpty()": [ + { + "details": "Can't register a request with an empty name" + } + ], + "CCGRequestNotRegistered(uint64)": [ + { + "details": "Only a registered subscriptionId is allowed to call the function" + } + ] + }, + "events": { + "RoleAdminChanged(bytes32,bytes32,bytes32)": { + "details": "Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this." + }, + "RoleGranted(bytes32,address,address)": { + "details": "Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}." + }, + "RoleRevoked(bytes32,address,address)": { + "details": "Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)" + } + }, + "kind": "dev", + "methods": { + "donId()": { + "details": "Get the DON ID", + "returns": { + "_0": "DON ID" + } + }, + "getResponse(bytes32,bool)": { + "details": "Get the response data", + "params": { + "requestId": "The request ID, returned by sendRequest()" + }, + "returns": { + "response": "CCGResponse" + } + }, + "getRoleAdmin(bytes32)": { + "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." + }, + "grantRole(bytes32,address)": { + "details": "Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event." + }, + "handleOracleFulfillment(bytes32,bytes,bytes)": { + "details": "Either response or error parameter will be set, but never both.", + "params": { + "err": "Aggregated error either from the request's source code or from the execution pipeline.", + "requestId": "The requestId returned by FunctionsClient.sendRequest().", + "response": "Aggregated response from the request's source code." + } + }, + "hasRole(bytes32,address)": { + "details": "Returns `true` if `account` has been granted `role`." + }, + "renounceRole(bytes32,address)": { + "details": "Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `callerConfirmation`. May emit a {RoleRevoked} event." + }, + "revokeRole(bytes32,address)": { + "details": "Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event." + }, + "sendRequest(uint64,string[],bytes[],bytes)": { + "params": { + "args": "String arguments passed into the source code and accessible via the global variable `args`", + "bytesArgs": "Bytes arguments passed into the source code and accessible via the global variable `bytesArgs` as hex strings", + "encryptedSecretsReference": "Reference pointing to encrypted secrets", + "subscriptionId": "Subscription ID used to pay for request (FunctionsConsumer contract address must first be added to the subscription)" + } + }, + "setDonId(bytes32)": { + "details": "Set the DON ID", + "params": { + "newDonId": "New DON ID" + } + }, + "supportsInterface(bytes4)": { + "details": "See {IERC165-supportsInterface}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "handleOracleFulfillment(bytes32,bytes,bytes)": { + "notice": "Chainlink Functions response handler called by the Functions Router during fullilment from the designated transmitter node in an OCR round." + }, + "sendRequest(uint64,string[],bytes[],bytes)": { + "notice": "Triggers an on-demand Functions request using remote encrypted secrets" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 2212, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "_roles", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_struct(RoleData)2207_storage)" + }, + { + "astId": 2663, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "_donId", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + }, + { + "astId": 2668, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "_requests", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_uint64,t_struct(CCGRequest)3246_storage)" + }, + { + "astId": 2673, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "unprocessed_responses", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_bytes32,t_struct(CCGResponse)3312_storage)" + }, + { + "astId": 2676, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "subscriptions", + "offset": 0, + "slot": "4", + "type": "t_array(t_uint64)dyn_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes_storage)dyn_storage": { + "base": "t_bytes_storage", + "encoding": "dynamic_array", + "label": "bytes[]", + "numberOfBytes": "32" + }, + "t_array(t_string_storage)dyn_storage": { + "base": "t_string_storage", + "encoding": "dynamic_array", + "label": "string[]", + "numberOfBytes": "32" + }, + "t_array(t_uint64)dyn_storage": { + "base": "t_uint64", + "encoding": "dynamic_array", + "label": "uint64[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_enum(CCGResponseState)3300": { + "encoding": "inplace", + "label": "enum ICCGatewayClient.CCGResponseState", + "numberOfBytes": "1" + }, + "t_enum(CodeLanguage)286": { + "encoding": "inplace", + "label": "enum FunctionsRequest.CodeLanguage", + "numberOfBytes": "1" + }, + "t_enum(Location)284": { + "encoding": "inplace", + "label": "enum FunctionsRequest.Location", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_bytes32,t_struct(CCGResponse)3312_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct ICCGatewayClient.CCGResponse)", + "numberOfBytes": "32", + "value": "t_struct(CCGResponse)3312_storage" + }, + "t_mapping(t_bytes32,t_struct(RoleData)2207_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct AccessControl.RoleData)", + "numberOfBytes": "32", + "value": "t_struct(RoleData)2207_storage" + }, + "t_mapping(t_uint64,t_struct(CCGRequest)3246_storage)": { + "encoding": "mapping", + "key": "t_uint64", + "label": "mapping(uint64 => struct ICCGateway.CCGRequest)", + "numberOfBytes": "32", + "value": "t_struct(CCGRequest)3246_storage" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(CCGRequest)3246_storage": { + "encoding": "inplace", + "label": "struct ICCGateway.CCGRequest", + "members": [ + { + "astId": 3240, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "name", + "offset": 0, + "slot": "0", + "type": "t_string_storage" + }, + { + "astId": 3242, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "callbackGasLimit", + "offset": 0, + "slot": "1", + "type": "t_uint32" + }, + { + "astId": 3245, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "config", + "offset": 0, + "slot": "2", + "type": "t_struct(Request)306_storage" + } + ], + "numberOfBytes": "224" + }, + "t_struct(CCGResponse)3312_storage": { + "encoding": "inplace", + "label": "struct ICCGatewayClient.CCGResponse", + "members": [ + { + "astId": 3302, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "subscriptionId", + "offset": 0, + "slot": "0", + "type": "t_uint64" + }, + { + "astId": 3304, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "source", + "offset": 8, + "slot": "0", + "type": "t_address" + }, + { + "astId": 3307, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "state", + "offset": 28, + "slot": "0", + "type": "t_enum(CCGResponseState)3300" + }, + { + "astId": 3309, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "data", + "offset": 0, + "slot": "1", + "type": "t_bytes_storage" + }, + { + "astId": 3311, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "error", + "offset": 0, + "slot": "2", + "type": "t_bytes_storage" + } + ], + "numberOfBytes": "96" + }, + "t_struct(Request)306_storage": { + "encoding": "inplace", + "label": "struct FunctionsRequest.Request", + "members": [ + { + "astId": 289, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "codeLocation", + "offset": 0, + "slot": "0", + "type": "t_enum(Location)284" + }, + { + "astId": 292, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "secretsLocation", + "offset": 1, + "slot": "0", + "type": "t_enum(Location)284" + }, + { + "astId": 295, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "language", + "offset": 2, + "slot": "0", + "type": "t_enum(CodeLanguage)286" + }, + { + "astId": 297, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "source", + "offset": 0, + "slot": "1", + "type": "t_string_storage" + }, + { + "astId": 299, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "encryptedSecretsReference", + "offset": 0, + "slot": "2", + "type": "t_bytes_storage" + }, + { + "astId": 302, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "args", + "offset": 0, + "slot": "3", + "type": "t_array(t_string_storage)dyn_storage" + }, + { + "astId": 305, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "bytesArgs", + "offset": 0, + "slot": "4", + "type": "t_array(t_bytes_storage)dyn_storage" + } + ], + "numberOfBytes": "160" + }, + "t_struct(RoleData)2207_storage": { + "encoding": "inplace", + "label": "struct AccessControl.RoleData", + "members": [ + { + "astId": 2204, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "hasRole", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 2206, + "contract": "contracts/CCGateway.sol:CCGateway", + "label": "adminRole", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + } + ], + "numberOfBytes": "64" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint64": { + "encoding": "inplace", + "label": "uint64", + "numberOfBytes": "8" + } + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/sepolia/CCNotificationClient.json b/packages/hardhat/deployments/sepolia/CCNotificationClient.json new file mode 100644 index 0000000..54a419a --- /dev/null +++ b/packages/hardhat/deployments/sepolia/CCNotificationClient.json @@ -0,0 +1,215 @@ +{ + "address": "0xe4A0a4D27129c7559De4aE800820df509C07E83D", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "gatewayAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "error", + "type": "string" + } + ], + "name": "ErrorReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "subscriptionId", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "response", + "type": "string" + } + ], + "name": "ResponseReceived", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "requestId", + "type": "bytes32" + } + ], + "name": "callback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "encryptedSecretsReference", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "args", + "type": "string[]" + }, + { + "internalType": "bytes[]", + "name": "bytesArgs", + "type": "bytes[]" + } + ], + "name": "request", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "subscriptionId", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_encryptedSecretsReference", + "type": "bytes" + } + ], + "name": "updateEncryptedSecretsReference", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "_subscriptionId", + "type": "uint64" + } + ], + "name": "updateSubscriptionId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x7a9c54b831be9e17733fd1713f8298a276030baeecceb24674a63c45d724b61a", + "receipt": { + "to": null, + "from": "0xD10F43A0aa00D244DAcFBE3C49b9B918B717Ff2c", + "contractAddress": "0xe4A0a4D27129c7559De4aE800820df509C07E83D", + "transactionIndex": 122, + "gasUsed": "686011", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xee4b9b42270dee184119a36facc908be56cd90dd9b81beb028431b517a3d29c0", + "transactionHash": "0x7a9c54b831be9e17733fd1713f8298a276030baeecceb24674a63c45d724b61a", + "logs": [], + "blockNumber": 6028202, + "cumulativeGasUsed": "15296391", + "status": 1, + "byzantium": true + }, + "args": [ + "0xe1fA8f43D89afE8fcBA4FABbd3e6e6a4C3360409" + ], + "numDeployments": 2, + "solcInputHash": "da2f6e6d8541f69733b0b28912d4a325", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"gatewayAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"error\",\"type\":\"string\"}],\"name\":\"ErrorReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"subscriptionId\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"response\",\"type\":\"string\"}],\"name\":\"ResponseReceived\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"callback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"encryptedSecretsReference\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string[]\",\"name\":\"args\",\"type\":\"string[]\"},{\"internalType\":\"bytes[]\",\"name\":\"bytesArgs\",\"type\":\"bytes[]\"}],\"name\":\"request\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"subscriptionId\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_encryptedSecretsReference\",\"type\":\"bytes\"}],\"name\":\"updateEncryptedSecretsReference\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_subscriptionId\",\"type\":\"uint64\"}],\"name\":\"updateSubscriptionId\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/CCNotificationClient.sol\":\"CCNotificationClient\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\n/// @title Chainlink Functions client interface.\\ninterface IFunctionsClient {\\n /// @notice Chainlink Functions response handler called by the Functions Router\\n /// during fullilment from the designated transmitter node in an OCR round.\\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\\n /// @param response Aggregated response from the request's source code.\\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\\n /// @dev Either response or error parameter will be set, but never both.\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\\n}\\n\",\"keccak256\":\"0x6117b82e7c4eec44ce557b0fc8bc1ac5f49e5d160ac6d4485452d6aafdd762ff\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {FunctionsResponse} from \\\"../libraries/FunctionsResponse.sol\\\";\\n\\n/// @title Chainlink Functions Router interface.\\ninterface IFunctionsRouter {\\n /// @notice The identifier of the route to retrieve the address of the access control contract\\n /// The access control contract controls which accounts can manage subscriptions\\n /// @return id - bytes32 id that can be passed to the \\\"getContractById\\\" of the Router\\n function getAllowListId() external view returns (bytes32);\\n\\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\\n /// The access control contract controls which accounts can manage subscriptions\\n function setAllowListId(bytes32 allowListId) external;\\n\\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\\n /// @return adminFee\\n function getAdminFee() external view returns (uint72 adminFee);\\n\\n /// @notice Sends a request using the provided subscriptionId\\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\\n /// a client can make requests from different contracts referencing the same subscription\\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\\n /// @param dataVersion - Gas limit for the fulfillment callback\\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\\n /// @param donId - An identifier used to determine which route to send the request along\\n /// @return requestId - A unique request identifier\\n function sendRequest(\\n uint64 subscriptionId,\\n bytes calldata data,\\n uint16 dataVersion,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) external returns (bytes32);\\n\\n /// @notice Sends a request to the proposed contracts\\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\\n /// a client can make requests from different contracts referencing the same subscription\\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\\n /// @param dataVersion - Gas limit for the fulfillment callback\\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\\n /// @param donId - An identifier used to determine which route to send the request along\\n /// @return requestId - A unique request identifier\\n function sendRequestToProposed(\\n uint64 subscriptionId,\\n bytes calldata data,\\n uint16 dataVersion,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) external returns (bytes32);\\n\\n /// @notice Fulfill the request by:\\n /// - calling back the data that the Oracle returned to the client contract\\n /// - pay the DON for processing the request\\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\\n /// @param response response data from DON consensus\\n /// @param err error from DON consensus\\n /// @param juelsPerGas - current rate of juels/gas\\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\\n /// @param transmitter - The Node that transmitted the OCR report\\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\\n /// @return fulfillResult -\\n /// @return callbackGasCostJuels -\\n function fulfill(\\n bytes memory response,\\n bytes memory err,\\n uint96 juelsPerGas,\\n uint96 costWithoutFulfillment,\\n address transmitter,\\n FunctionsResponse.Commitment memory commitment\\n ) external returns (FunctionsResponse.FulfillResult, uint96);\\n\\n /// @notice Validate requested gas limit is below the subscription max.\\n /// @param subscriptionId subscription ID\\n /// @param callbackGasLimit desired callback gas limit\\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\\n\\n /// @notice Get the current contract given an ID\\n /// @param id A bytes32 identifier for the route\\n /// @return contract The current contract address\\n function getContractById(bytes32 id) external view returns (address);\\n\\n /// @notice Get the proposed next contract given an ID\\n /// @param id A bytes32 identifier for the route\\n /// @return contract The current or proposed contract address\\n function getProposedContractById(bytes32 id) external view returns (address);\\n\\n /// @notice Return the latest proprosal set\\n /// @return ids The identifiers of the contracts to update\\n /// @return to The addresses of the contracts that will be updated to\\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\\n\\n /// @notice Proposes one or more updates to the contract routes\\n /// @dev Only callable by owner\\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\\n\\n /// @notice Updates the current contract routes to the proposed contracts\\n /// @dev Only callable by owner\\n function updateContracts() external;\\n\\n /// @dev Puts the system into an emergency stopped state.\\n /// @dev Only callable by owner\\n function pause() external;\\n\\n /// @dev Takes the system out of an emergency stopped state.\\n /// @dev Only callable by owner\\n function unpause() external;\\n}\\n\",\"keccak256\":\"0x44db41e8ff90c2828ca0ada125abc4b411921a86514a4a047fd9fd43ba9d7e08\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {CBOR} from \\\"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\\\";\\n\\n/// @title Library for encoding the input data of a Functions request into CBOR\\nlibrary FunctionsRequest {\\n using CBOR for CBOR.CBORBuffer;\\n\\n uint16 public constant REQUEST_DATA_VERSION = 1;\\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\\n\\n enum Location {\\n Inline, // Provided within the Request\\n Remote, // Hosted through remote location that can be accessed through a provided URL\\n DONHosted // Hosted on the DON's storage\\n }\\n\\n enum CodeLanguage {\\n JavaScript\\n // In future version we may add other languages\\n }\\n\\n struct Request {\\n Location codeLocation; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The location of the source code that will be executed on each node in the DON\\n Location secretsLocation; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The location of secrets that will be passed into the source code. *Only Remote secrets are supported\\n CodeLanguage language; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 The coding language that the source code is written in\\n string source; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\\n bytes encryptedSecretsReference; // \\u2550\\u2550\\u2578 Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\\n string[] args; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 String arguments that will be passed into the source code\\n bytes[] bytesArgs; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Bytes arguments that will be passed into the source code\\n }\\n\\n error EmptySource();\\n error EmptySecrets();\\n error EmptyArgs();\\n error NoInlineSecrets();\\n\\n /// @notice Encodes a Request to CBOR encoded bytes\\n /// @param self The request to encode\\n /// @return CBOR encoded bytes\\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\\n\\n buffer.writeString(\\\"codeLocation\\\");\\n buffer.writeUInt256(uint256(self.codeLocation));\\n\\n buffer.writeString(\\\"language\\\");\\n buffer.writeUInt256(uint256(self.language));\\n\\n buffer.writeString(\\\"source\\\");\\n buffer.writeString(self.source);\\n\\n if (self.args.length > 0) {\\n buffer.writeString(\\\"args\\\");\\n buffer.startArray();\\n for (uint256 i = 0; i < self.args.length; ++i) {\\n buffer.writeString(self.args[i]);\\n }\\n buffer.endSequence();\\n }\\n\\n if (self.encryptedSecretsReference.length > 0) {\\n if (self.secretsLocation == Location.Inline) {\\n revert NoInlineSecrets();\\n }\\n buffer.writeString(\\\"secretsLocation\\\");\\n buffer.writeUInt256(uint256(self.secretsLocation));\\n buffer.writeString(\\\"secrets\\\");\\n buffer.writeBytes(self.encryptedSecretsReference);\\n }\\n\\n if (self.bytesArgs.length > 0) {\\n buffer.writeString(\\\"bytesArgs\\\");\\n buffer.startArray();\\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\\n buffer.writeBytes(self.bytesArgs[i]);\\n }\\n buffer.endSequence();\\n }\\n\\n return buffer.buf.buf;\\n }\\n\\n /// @notice Initializes a Chainlink Functions Request\\n /// @dev Sets the codeLocation and code on the request\\n /// @param self The uninitialized request\\n /// @param codeLocation The user provided source code location\\n /// @param language The programming language of the user code\\n /// @param source The user provided source code or a url\\n function initializeRequest(\\n Request memory self,\\n Location codeLocation,\\n CodeLanguage language,\\n string memory source\\n ) internal pure {\\n if (bytes(source).length == 0) revert EmptySource();\\n\\n self.codeLocation = codeLocation;\\n self.language = language;\\n self.source = source;\\n }\\n\\n /// @notice Initializes a Chainlink Functions Request\\n /// @dev Simplified version of initializeRequest for PoC\\n /// @param self The uninitialized request\\n /// @param javaScriptSource The user provided JS code (must not be empty)\\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\\n }\\n\\n /// @notice Adds Remote user encrypted secrets to a Request\\n /// @param self The initialized request\\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\\n\\n self.secretsLocation = Location.Remote;\\n self.encryptedSecretsReference = encryptedSecretsReference;\\n }\\n\\n /// @notice Adds DON-hosted secrets reference to a Request\\n /// @param self The initialized request\\n /// @param slotID Slot ID of the user's secrets hosted on DON\\n /// @param version User data version (for the slotID)\\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\\n\\n buffer.writeString(\\\"slotID\\\");\\n buffer.writeUInt64(slotID);\\n buffer.writeString(\\\"version\\\");\\n buffer.writeUInt64(version);\\n\\n self.secretsLocation = Location.DONHosted;\\n self.encryptedSecretsReference = buffer.buf.buf;\\n }\\n\\n /// @notice Sets args for the user run function\\n /// @param self The initialized request\\n /// @param args The array of string args (must not be empty)\\n function setArgs(Request memory self, string[] memory args) internal pure {\\n if (args.length == 0) revert EmptyArgs();\\n\\n self.args = args;\\n }\\n\\n /// @notice Sets bytes args for the user run function\\n /// @param self The initialized request\\n /// @param args The array of bytes args (must not be empty)\\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\\n if (args.length == 0) revert EmptyArgs();\\n\\n self.bytesArgs = args;\\n }\\n}\\n\",\"keccak256\":\"0xed75be0eaba358d468f1fe18adc377d5044f57eff0070081f884a1f212d0adc2\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\n/// @title Library of types that are used for fulfillment of a Functions request\\nlibrary FunctionsResponse {\\n // Used to send request information from the Router to the Coordinator\\n struct RequestMeta {\\n bytes data; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\\n bytes32 flags; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 Per-subscription flags\\n address requestingContract; // \\u2550\\u2550\\u2557 The client contract that is sending the request\\n uint96 availableBalance; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u255d Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\\n uint72 adminFee; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\\n uint64 subscriptionId; // \\u2551 Identifier of the billing subscription that will be charged for the request\\n uint64 initiatedRequests; // \\u2551 The number of requests that have been started\\n uint32 callbackGasLimit; // \\u2551 The amount of gas that the callback to the consuming contract will be given\\n uint16 dataVersion; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The version of the structure of the CBOR encoded request data\\n uint64 completedRequests; // \\u2550\\u2550\\u2550\\u2550\\u2557 The number of requests that have successfully completed or timed out\\n address subscriptionOwner; // \\u2550\\u2550\\u2550\\u255d The owner of the billing subscription\\n }\\n\\n enum FulfillResult {\\n FULFILLED, // 0\\n USER_CALLBACK_ERROR, // 1\\n INVALID_REQUEST_ID, // 2\\n COST_EXCEEDS_COMMITMENT, // 3\\n INSUFFICIENT_GAS_PROVIDED, // 4\\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\\n INVALID_COMMITMENT // 6\\n }\\n\\n struct Commitment {\\n bytes32 requestId; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2578 A unique identifier for a Chainlink Functions request\\n address coordinator; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 The Coordinator contract that manages the DON that is servicing a request\\n uint96 estimatedTotalCostJuels; // \\u2550\\u2550\\u2550\\u2550\\u255d The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\\n address client; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 The client contract that sent the request\\n uint64 subscriptionId; // \\u2551 Identifier of the billing subscription that will be charged for the request\\n uint32 callbackGasLimit; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The amount of gas that the callback to the consuming contract will be given\\n uint72 adminFee; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2557 Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\\n uint72 donFee; // \\u2551 Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\\n uint40 gasOverheadBeforeCallback; // \\u2551 Represents the average gas execution cost before the fulfillment callback.\\n uint40 gasOverheadAfterCallback; // \\u2551 Represents the average gas execution cost after the fulfillment callback.\\n uint32 timeoutTimestamp; // \\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d The timestamp at which a request will be eligible to be timed out\\n }\\n}\\n\",\"keccak256\":\"0xc72eb037effef32146f7cd4086af00f44f28c8649d891e5e404fec5fda7e802b\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.19;\\n\\nimport {IFunctionsRouter} from \\\"../v1_0_0/interfaces/IFunctionsRouter.sol\\\";\\nimport {IFunctionsClient} from \\\"../v1_0_0/interfaces/IFunctionsClient.sol\\\";\\n\\nimport {FunctionsRequest} from \\\"../v1_0_0/libraries/FunctionsRequest.sol\\\";\\n\\n/// @title The Chainlink Functions client contract\\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\\nabstract contract FunctionsClient is IFunctionsClient {\\n using FunctionsRequest for FunctionsRequest.Request;\\n\\n IFunctionsRouter internal immutable i_functionsRouter;\\n\\n event RequestSent(bytes32 indexed id);\\n event RequestFulfilled(bytes32 indexed id);\\n\\n error OnlyRouterCanFulfill();\\n\\n constructor(address router) {\\n i_functionsRouter = IFunctionsRouter(router);\\n }\\n\\n /// @notice Sends a Chainlink Functions request\\n /// @param data The CBOR encoded bytes data for a Functions request\\n /// @param subscriptionId The subscription ID that will be charged to service the request\\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\\n /// @return requestId The generated request ID for this request\\n function _sendRequest(\\n bytes memory data,\\n uint64 subscriptionId,\\n uint32 callbackGasLimit,\\n bytes32 donId\\n ) internal returns (bytes32) {\\n bytes32 requestId = i_functionsRouter.sendRequest(\\n subscriptionId,\\n data,\\n FunctionsRequest.REQUEST_DATA_VERSION,\\n callbackGasLimit,\\n donId\\n );\\n emit RequestSent(requestId);\\n return requestId;\\n }\\n\\n /// @notice User defined function to handle a response from the DON\\n /// @param requestId The request ID, returned by sendRequest()\\n /// @param response Aggregated response from the execution of the user's source code\\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\\n /// @dev Either response or error parameter will be set, but never both\\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\\n\\n /// @inheritdoc IFunctionsClient\\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\\n if (msg.sender != address(i_functionsRouter)) {\\n revert OnlyRouterCanFulfill();\\n }\\n _fulfillRequest(requestId, response, err);\\n emit RequestFulfilled(requestId);\\n }\\n}\\n\",\"keccak256\":\"0xdc40f1e9dea8a572d43d310afa68e978c35218d16097b9cfd9d1b6137df3cd0a\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-2-Clause\\npragma solidity ^0.8.4;\\n\\n/**\\n* @dev A library for working with mutable byte buffers in Solidity.\\n*\\n* Byte buffers are mutable and expandable, and provide a variety of primitives\\n* for appending to them. At any time you can fetch a bytes object containing the\\n* current contents of the buffer. The bytes object should not be stored between\\n* operations, as it may change due to resizing of the buffer.\\n*/\\nlibrary Buffer {\\n /**\\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\\n * a capacity. The capacity may be longer than the current value, in\\n * which case it can be extended without the need to allocate more memory.\\n */\\n struct buffer {\\n bytes buf;\\n uint capacity;\\n }\\n\\n /**\\n * @dev Initializes a buffer with an initial capacity.\\n * @param buf The buffer to initialize.\\n * @param capacity The number of bytes of space to allocate the buffer.\\n * @return The buffer, for chaining.\\n */\\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\\n if (capacity % 32 != 0) {\\n capacity += 32 - (capacity % 32);\\n }\\n // Allocate space for the buffer data\\n buf.capacity = capacity;\\n assembly {\\n let ptr := mload(0x40)\\n mstore(buf, ptr)\\n mstore(ptr, 0)\\n let fpm := add(32, add(ptr, capacity))\\n if lt(fpm, ptr) {\\n revert(0, 0)\\n }\\n mstore(0x40, fpm)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Initializes a new buffer from an existing bytes object.\\n * Changes to the buffer may mutate the original value.\\n * @param b The bytes object to initialize the buffer with.\\n * @return A new buffer.\\n */\\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\\n buffer memory buf;\\n buf.buf = b;\\n buf.capacity = b.length;\\n return buf;\\n }\\n\\n function resize(buffer memory buf, uint capacity) private pure {\\n bytes memory oldbuf = buf.buf;\\n init(buf, capacity);\\n append(buf, oldbuf);\\n }\\n\\n /**\\n * @dev Sets buffer length to 0.\\n * @param buf The buffer to truncate.\\n * @return The original buffer, for chaining..\\n */\\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\\n assembly {\\n let bufptr := mload(buf)\\n mstore(bufptr, 0)\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to copy.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\\n require(len <= data.length);\\n\\n uint off = buf.buf.length;\\n uint newCapacity = off + len;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint dest;\\n uint src;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Length of existing buffer data\\n let buflen := mload(bufptr)\\n // Start address = buffer address + offset + sizeof(buffer length)\\n dest := add(add(bufptr, 32), off)\\n // Update buffer length if we're extending it\\n if gt(newCapacity, buflen) {\\n mstore(bufptr, newCapacity)\\n }\\n src := add(data, 32)\\n }\\n\\n // Copy word-length chunks while possible\\n for (; len >= 32; len -= 32) {\\n assembly {\\n mstore(dest, mload(src))\\n }\\n dest += 32;\\n src += 32;\\n }\\n\\n // Copy remaining bytes\\n unchecked {\\n uint mask = (256 ** (32 - len)) - 1;\\n assembly {\\n let srcpart := and(mload(src), not(mask))\\n let destpart := and(mload(dest), mask)\\n mstore(dest, or(destpart, srcpart))\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\\n return append(buf, data, data.length);\\n }\\n\\n /**\\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\\n * capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint offPlusOne = off + 1;\\n if (off >= buf.capacity) {\\n resize(buf, offPlusOne * 2);\\n }\\n\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + off\\n let dest := add(add(bufptr, off), 32)\\n mstore8(dest, data)\\n // Update buffer length if we extended it\\n if gt(offPlusOne, mload(bufptr)) {\\n mstore(bufptr, offPlusOne)\\n }\\n }\\n\\n return buf;\\n }\\n\\n /**\\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (left-aligned).\\n * @return The original buffer, for chaining.\\n */\\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n unchecked {\\n uint mask = (256 ** len) - 1;\\n // Right-align data\\n data = data >> (8 * (32 - len));\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n }\\n return buf;\\n }\\n\\n /**\\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chhaining.\\n */\\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\\n return append(buf, bytes32(data), 20);\\n }\\n\\n /**\\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\\n * the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @return The original buffer, for chaining.\\n */\\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\\n return append(buf, data, 32);\\n }\\n\\n /**\\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\\n * exceed the capacity of the buffer.\\n * @param buf The buffer to append to.\\n * @param data The data to append.\\n * @param len The number of bytes to write (right-aligned).\\n * @return The original buffer.\\n */\\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\\n uint off = buf.buf.length;\\n uint newCapacity = len + off;\\n if (newCapacity > buf.capacity) {\\n resize(buf, newCapacity * 2);\\n }\\n\\n uint mask = (256 ** len) - 1;\\n assembly {\\n // Memory address of the buffer data\\n let bufptr := mload(buf)\\n // Address = buffer address + sizeof(buffer length) + newCapacity\\n let dest := add(bufptr, newCapacity)\\n mstore(dest, or(and(mload(dest), not(mask)), data))\\n // Update buffer length if we extended it\\n if gt(newCapacity, mload(bufptr)) {\\n mstore(bufptr, newCapacity)\\n }\\n }\\n return buf;\\n }\\n}\",\"keccak256\":\"0x0d86b367813922094e02594a406ba89f5e97d3d74ec2ce3c4032566840e302b0\",\"license\":\"BSD-2-Clause\"},\"@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.4;\\n\\nimport \\\"../../@ensdomains/buffer/v0.1.0/Buffer.sol\\\";\\n\\n/**\\n* @dev A library for populating CBOR encoded payload in Solidity.\\n*\\n* https://datatracker.ietf.org/doc/html/rfc7049\\n*\\n* The library offers various write* and start* methods to encode values of different types.\\n* The resulted buffer can be obtained with data() method.\\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\\n* in an invalid CBOR if start/write/end flow is violated.\\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\\n* except for nested start/end pairs.\\n*/\\n\\nlibrary CBOR {\\n using Buffer for Buffer.buffer;\\n\\n struct CBORBuffer {\\n Buffer.buffer buf;\\n uint256 depth;\\n }\\n\\n uint8 private constant MAJOR_TYPE_INT = 0;\\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\\n uint8 private constant MAJOR_TYPE_BYTES = 2;\\n uint8 private constant MAJOR_TYPE_STRING = 3;\\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\\n uint8 private constant MAJOR_TYPE_MAP = 5;\\n uint8 private constant MAJOR_TYPE_TAG = 6;\\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\\n\\n uint8 private constant TAG_TYPE_BIGNUM = 2;\\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\\n\\n uint8 private constant CBOR_FALSE = 20;\\n uint8 private constant CBOR_TRUE = 21;\\n uint8 private constant CBOR_NULL = 22;\\n uint8 private constant CBOR_UNDEFINED = 23;\\n\\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\\n Buffer.init(cbor.buf, capacity);\\n cbor.depth = 0;\\n return cbor;\\n }\\n\\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\\n require(buf.depth == 0, \\\"Invalid CBOR\\\");\\n return buf.buf.buf;\\n }\\n\\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\\n writeBytes(buf, abi.encode(value));\\n }\\n\\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\\n if (value < 0) {\\n buf.buf.appendUint8(\\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\\n );\\n writeBytes(buf, abi.encode(uint256(-1 - value)));\\n } else {\\n writeUInt256(buf, uint256(value));\\n }\\n }\\n\\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\\n }\\n\\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\\n if(value >= 0) {\\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\\n } else{\\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\\n }\\n }\\n\\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\\n buf.buf.append(value);\\n }\\n\\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\\n buf.buf.append(bytes(value));\\n }\\n\\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\\n }\\n\\n function writeNull(CBORBuffer memory buf) internal pure {\\n writeContentFree(buf, CBOR_NULL);\\n }\\n\\n function writeUndefined(CBORBuffer memory buf) internal pure {\\n writeContentFree(buf, CBOR_UNDEFINED);\\n }\\n\\n function startArray(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\\n buf.depth += 1;\\n }\\n\\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\\n }\\n\\n function startMap(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\\n buf.depth += 1;\\n }\\n\\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\\n }\\n\\n function endSequence(CBORBuffer memory buf) internal pure {\\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\\n buf.depth -= 1;\\n }\\n\\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\\n writeString(buf, key);\\n writeString(buf, value);\\n }\\n\\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\\n writeString(buf, key);\\n writeBytes(buf, value);\\n }\\n\\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\\n writeString(buf, key);\\n writeUInt256(buf, value);\\n }\\n\\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\\n writeString(buf, key);\\n writeInt256(buf, value);\\n }\\n\\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\\n writeString(buf, key);\\n writeUInt64(buf, value);\\n }\\n\\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\\n writeString(buf, key);\\n writeInt64(buf, value);\\n }\\n\\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\\n writeString(buf, key);\\n writeBool(buf, value);\\n }\\n\\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n writeNull(buf);\\n }\\n\\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n writeUndefined(buf);\\n }\\n\\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n startMap(buf);\\n }\\n\\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\\n writeString(buf, key);\\n startArray(buf);\\n }\\n\\n function writeFixedNumeric(\\n CBORBuffer memory buf,\\n uint8 major,\\n uint64 value\\n ) private pure {\\n if (value <= 23) {\\n buf.buf.appendUint8(uint8((major << 5) | value));\\n } else if (value <= 0xFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 24));\\n buf.buf.appendInt(value, 1);\\n } else if (value <= 0xFFFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 25));\\n buf.buf.appendInt(value, 2);\\n } else if (value <= 0xFFFFFFFF) {\\n buf.buf.appendUint8(uint8((major << 5) | 26));\\n buf.buf.appendInt(value, 4);\\n } else {\\n buf.buf.appendUint8(uint8((major << 5) | 27));\\n buf.buf.appendInt(value, 8);\\n }\\n }\\n\\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\\n private\\n pure\\n {\\n buf.buf.appendUint8(uint8((major << 5) | 31));\\n }\\n\\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\\n private\\n pure\\n {\\n writeFixedNumeric(buf, major, length);\\n }\\n\\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\\n }\\n}\",\"keccak256\":\"0xdecf04203502670ac72ba466c75e4f87f4419907365005f0d73e7d07ee3e5715\",\"license\":\"MIT\"},\"contracts/CCExampleClient.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {ICCGatewayClient} from \\\"./interfaces/ICCGatewayClient.sol\\\";\\nimport {ICCGateway} from \\\"./interfaces/ICCGateway.sol\\\";\\n\\ncontract CCExampleClient is ICCGatewayClient {\\n ICCGateway private immutable gateway;\\n\\n uint64 public subscriptionId = 0;\\n bytes public encryptedSecretsReference = \\\"\\\";\\n\\n event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response);\\n event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error);\\n\\n constructor(address gatewayAddress) {\\n gateway = ICCGateway(gatewayAddress);\\n }\\n\\n function updateSubscriptionId(uint64 _subscriptionId) external {\\n subscriptionId = _subscriptionId;\\n }\\n\\n function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external {\\n encryptedSecretsReference = _encryptedSecretsReference;\\n }\\n\\n function request(string[] calldata args, bytes[] calldata bytesArgs) external {\\n require(subscriptionId != 0, \\\"Subscription ID not set\\\");\\n\\n gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference);\\n }\\n\\n function callback(bytes32 requestId) external override {\\n ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true);\\n\\n if (response.state == ICCGatewayClient.CCGResponseState.Success) {\\n emit ResponseReceived(response.subscriptionId, requestId, string(response.data));\\n } else {\\n emit ErrorReceived(response.subscriptionId, requestId, string(response.error));\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf905275976390214962167d4896d9c0eab670fce2b5f5cfd213b1ae2d776347a\",\"license\":\"UNLICENSED\"},\"contracts/CCNotificationClient.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {CCExampleClient} from \\\"./CCExampleClient.sol\\\";\\n\\ncontract CCNotificationClient is CCExampleClient {\\n constructor(address gatewayAddress) CCExampleClient(gatewayAddress) {}\\n}\\n\",\"keccak256\":\"0xad7961e1ea78babecd98162342bf18b8ae44e34f6ea1d0f32533666659f68ef5\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/ICCGateway.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\\nimport {FunctionsRequest} from \\\"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\\\";\\n\\ninterface ICCGateway {\\n struct CCGRequest {\\n string name;\\n uint32 callbackGasLimit;\\n FunctionsRequest.Request config;\\n }\\n\\n /**\\n * @dev Can't register a request with an empty name\\n */\\n error CCGRequestNameEmpty();\\n\\n /**\\n * @dev Only the same source of the requestId is allowed to call the function\\n */\\n error CCGOnlySameSourceAllowed(bytes32 requestId);\\n\\n /**\\n * @dev Only a registered subscriptionId is allowed to call the function\\n */\\n error CCGRequestNotRegistered(uint64 subscriptionId);\\n\\n /**\\n * @dev Can't fulfill a request that has already been fulfilled\\n */\\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\\n\\n /**\\n * @dev Only A manager can call the function\\n */\\n error CCGOnlyManagerAllowed();\\n\\n /**\\n * @dev Send a request to the Functions DON\\n */\\n function sendRequest(\\n uint64 subscriptionId,\\n string[] calldata args,\\n bytes[] calldata bytesArgs,\\n bytes calldata encryptedSecretsReference\\n ) external returns (bytes32 requestId);\\n\\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\\n}\\n\",\"keccak256\":\"0xbc7d92f8db240767c8636e8df9b818cc1f5abfde22b8c49eee50f418fb0dbea5\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/ICCGatewayClient.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\ninterface ICCGatewayClient {\\n enum CCGResponseState {Sent, Success, Error}\\n\\n struct CCGResponse {\\n uint64 subscriptionId;\\n address source;\\n CCGResponseState state;\\n bytes data;\\n bytes error;\\n }\\n\\n function callback(bytes32 requestId) external;\\n}\\n\",\"keccak256\":\"0xb69320aa2152f374dec4cfc70b73f46e0db9774a1411d2acff1481ee3295f86a\",\"license\":\"UNLICENSED\"}},\"version\":1}", + "bytecode": "0x600080546001600160401b031916815560c060405260a090815260019062000028908262000110565b503480156200003657600080fd5b5060405162000d6a38038062000d6a8339810160408190526200005991620001dc565b6001600160a01b03166080526200020e565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200009657607f821691505b602082108103620000b757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200010b57600081815260208120601f850160051c81016020861015620000e65750805b601f850160051c820191505b818110156200010757828155600101620000f2565b5050505b505050565b81516001600160401b038111156200012c576200012c6200006b565b62000144816200013d845462000081565b84620000bd565b602080601f8311600181146200017c5760008415620001635750858301515b600019600386901b1c1916600185901b17855562000107565b600085815260208120601f198616915b82811015620001ad578886015182559484019460019091019084016200018c565b5085821015620001cc5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215620001ef57600080fd5b81516001600160a01b03811681146200020757600080fd5b9392505050565b608051610b39620002316000396000818161023101526102e30152610b396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806309c1ba2e1461006757806314b1dd1b146100975780634ce64f0e146100ca578063cdc634f1146100dd578063cfd58386146100f2578063df13994e14610105575b600080fd5b60005461007a906001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b6100c86100a5366004610415565b6000805467ffffffffffffffff19166001600160401b0392909216919091179055565b005b6100c86100d8366004610439565b610118565b6100e561012a565b60405161008e91906104fa565b6100c8610100366004610558565b6101b8565b6100c86101133660046105c3565b6102c3565b600161012582848361067a565b505050565b60018054610137906105f2565b80601f0160208091040260200160405190810160405280929190818152602001828054610163906105f2565b80156101b05780601f10610185576101008083540402835291602001916101b0565b820191906000526020600020905b81548152906001019060200180831161019357829003601f168201915b505050505081565b600080546001600160401b031690036102175760405162461bcd60e51b815260206004820152601760248201527f537562736372697074696f6e204944206e6f7420736574000000000000000000604482015260640160405180910390fd5b600054604051634b60ac1760e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916396c1582e91610279916001600160401b0316908890889088908890600190600401610824565b6020604051808303816000875af1158015610298573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bc919061090d565b5050505050565b6040516315b851d160e01b815260048101829052600160248201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906315b851d1906044016000604051808303816000875af1158015610334573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261035c91908101906109e9565b905060018160400151600281111561037657610376610abc565b036103c2577fa5522492de1ed169e1e5e76f6cb2ceb5f045ca7f7ea5da3137c573d996cc4b9f81600001518383606001516040516103b693929190610ad2565b60405180910390a15050565b7f331e0adccd60eab7ca94cf49c60a45549ce9dc1281139656a13bdf73774d179c81600001518383608001516040516103b693929190610ad2565b6001600160401b038116811461041257600080fd5b50565b60006020828403121561042757600080fd5b8135610432816103fd565b9392505050565b6000806020838503121561044c57600080fd5b82356001600160401b038082111561046357600080fd5b818501915085601f83011261047757600080fd5b81358181111561048657600080fd5b86602082850101111561049857600080fd5b60209290920196919550909350505050565b60005b838110156104c55781810151838201526020016104ad565b50506000910152565b600081518084526104e68160208601602086016104aa565b601f01601f19169290920160200192915050565b60208152600061043260208301846104ce565b60008083601f84011261051f57600080fd5b5081356001600160401b0381111561053657600080fd5b6020830191508360208260051b850101111561055157600080fd5b9250929050565b6000806000806040858703121561056e57600080fd5b84356001600160401b038082111561058557600080fd5b6105918883890161050d565b909650945060208701359150808211156105aa57600080fd5b506105b78782880161050d565b95989497509550505050565b6000602082840312156105d557600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061060657607f821691505b60208210810361062657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561012557600081815260208120601f850160051c810160208610156106535750805b601f850160051c820191505b818110156106725782815560010161065f565b505050505050565b6001600160401b03831115610691576106916105dc565b6106a58361069f83546105f2565b8361062c565b6000601f8411600181146106d957600085156106c15750838201355b600019600387901b1c1916600186901b1783556102bc565b600083815260209020601f19861690835b8281101561070a57868501358255602094850194600190920191016106ea565b50868210156107275760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000808335601e1984360301811261077957600080fd5b83016020810192503590506001600160401b0381111561079857600080fd5b80360382131561055157600080fd5b600081546107b4816105f2565b8085526020600183811680156107d157600181146107eb57610819565b60ff1985168884015283151560051b880183019550610819565b866000528260002060005b858110156108115781548a82018601529083019084016107f6565b890184019650505b505050505092915050565b6000608082016001600160401b038916835260206080818501528188835260a08501905060a08960051b86010192508960005b8a81101561089157868503609f19018352610872828d610762565b61087d878284610739565b965050509183019190830190600101610857565b5050508382036040850152858252808201600587901b830182018860005b898110156108e957858303601f190184526108ca828c610762565b6108d5858284610739565b9587019594505050908401906001016108af565b505085810360608701526108fd81886107a7565b9c9b505050505050505050505050565b60006020828403121561091f57600080fd5b5051919050565b60405160a081016001600160401b0381118282101715610948576109486105dc565b60405290565b80516003811061095d57600080fd5b919050565b600082601f83011261097357600080fd5b81516001600160401b038082111561098d5761098d6105dc565b604051601f8301601f19908116603f011681019082821181831017156109b5576109b56105dc565b816040528381528660208588010111156109ce57600080fd5b6109df8460208301602089016104aa565b9695505050505050565b6000602082840312156109fb57600080fd5b81516001600160401b0380821115610a1257600080fd5b9083019060a08286031215610a2657600080fd5b610a2e610926565b8251610a39816103fd565b815260208301516001600160a01b0381168114610a5557600080fd5b6020820152610a666040840161094e565b6040820152606083015182811115610a7d57600080fd5b610a8987828601610962565b606083015250608083015182811115610aa157600080fd5b610aad87828601610962565b60808301525095945050505050565b634e487b7160e01b600052602160045260246000fd5b6001600160401b0384168152826020820152606060408201526000610afa60608301846104ce565b9594505050505056fea26469706673582212205b5117b00ce65fae13c73e5fe55ef1d7583f0a364b1ac0a38e3f21e0d2c88f9a64736f6c63430008140033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100625760003560e01c806309c1ba2e1461006757806314b1dd1b146100975780634ce64f0e146100ca578063cdc634f1146100dd578063cfd58386146100f2578063df13994e14610105575b600080fd5b60005461007a906001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b6100c86100a5366004610415565b6000805467ffffffffffffffff19166001600160401b0392909216919091179055565b005b6100c86100d8366004610439565b610118565b6100e561012a565b60405161008e91906104fa565b6100c8610100366004610558565b6101b8565b6100c86101133660046105c3565b6102c3565b600161012582848361067a565b505050565b60018054610137906105f2565b80601f0160208091040260200160405190810160405280929190818152602001828054610163906105f2565b80156101b05780601f10610185576101008083540402835291602001916101b0565b820191906000526020600020905b81548152906001019060200180831161019357829003601f168201915b505050505081565b600080546001600160401b031690036102175760405162461bcd60e51b815260206004820152601760248201527f537562736372697074696f6e204944206e6f7420736574000000000000000000604482015260640160405180910390fd5b600054604051634b60ac1760e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916396c1582e91610279916001600160401b0316908890889088908890600190600401610824565b6020604051808303816000875af1158015610298573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bc919061090d565b5050505050565b6040516315b851d160e01b815260048101829052600160248201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906315b851d1906044016000604051808303816000875af1158015610334573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261035c91908101906109e9565b905060018160400151600281111561037657610376610abc565b036103c2577fa5522492de1ed169e1e5e76f6cb2ceb5f045ca7f7ea5da3137c573d996cc4b9f81600001518383606001516040516103b693929190610ad2565b60405180910390a15050565b7f331e0adccd60eab7ca94cf49c60a45549ce9dc1281139656a13bdf73774d179c81600001518383608001516040516103b693929190610ad2565b6001600160401b038116811461041257600080fd5b50565b60006020828403121561042757600080fd5b8135610432816103fd565b9392505050565b6000806020838503121561044c57600080fd5b82356001600160401b038082111561046357600080fd5b818501915085601f83011261047757600080fd5b81358181111561048657600080fd5b86602082850101111561049857600080fd5b60209290920196919550909350505050565b60005b838110156104c55781810151838201526020016104ad565b50506000910152565b600081518084526104e68160208601602086016104aa565b601f01601f19169290920160200192915050565b60208152600061043260208301846104ce565b60008083601f84011261051f57600080fd5b5081356001600160401b0381111561053657600080fd5b6020830191508360208260051b850101111561055157600080fd5b9250929050565b6000806000806040858703121561056e57600080fd5b84356001600160401b038082111561058557600080fd5b6105918883890161050d565b909650945060208701359150808211156105aa57600080fd5b506105b78782880161050d565b95989497509550505050565b6000602082840312156105d557600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061060657607f821691505b60208210810361062657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561012557600081815260208120601f850160051c810160208610156106535750805b601f850160051c820191505b818110156106725782815560010161065f565b505050505050565b6001600160401b03831115610691576106916105dc565b6106a58361069f83546105f2565b8361062c565b6000601f8411600181146106d957600085156106c15750838201355b600019600387901b1c1916600186901b1783556102bc565b600083815260209020601f19861690835b8281101561070a57868501358255602094850194600190920191016106ea565b50868210156107275760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000808335601e1984360301811261077957600080fd5b83016020810192503590506001600160401b0381111561079857600080fd5b80360382131561055157600080fd5b600081546107b4816105f2565b8085526020600183811680156107d157600181146107eb57610819565b60ff1985168884015283151560051b880183019550610819565b866000528260002060005b858110156108115781548a82018601529083019084016107f6565b890184019650505b505050505092915050565b6000608082016001600160401b038916835260206080818501528188835260a08501905060a08960051b86010192508960005b8a81101561089157868503609f19018352610872828d610762565b61087d878284610739565b965050509183019190830190600101610857565b5050508382036040850152858252808201600587901b830182018860005b898110156108e957858303601f190184526108ca828c610762565b6108d5858284610739565b9587019594505050908401906001016108af565b505085810360608701526108fd81886107a7565b9c9b505050505050505050505050565b60006020828403121561091f57600080fd5b5051919050565b60405160a081016001600160401b0381118282101715610948576109486105dc565b60405290565b80516003811061095d57600080fd5b919050565b600082601f83011261097357600080fd5b81516001600160401b038082111561098d5761098d6105dc565b604051601f8301601f19908116603f011681019082821181831017156109b5576109b56105dc565b816040528381528660208588010111156109ce57600080fd5b6109df8460208301602089016104aa565b9695505050505050565b6000602082840312156109fb57600080fd5b81516001600160401b0380821115610a1257600080fd5b9083019060a08286031215610a2657600080fd5b610a2e610926565b8251610a39816103fd565b815260208301516001600160a01b0381168114610a5557600080fd5b6020820152610a666040840161094e565b6040820152606083015182811115610a7d57600080fd5b610a8987828601610962565b606083015250608083015182811115610aa157600080fd5b610aad87828601610962565b60808301525095945050505050565b634e487b7160e01b600052602160045260246000fd5b6001600160401b0384168152826020820152606060408201526000610afa60608301846104ce565b9594505050505056fea26469706673582212205b5117b00ce65fae13c73e5fe55ef1d7583f0a364b1ac0a38e3f21e0d2c88f9a64736f6c63430008140033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 2081, + "contract": "contracts/CCNotificationClient.sol:CCNotificationClient", + "label": "subscriptionId", + "offset": 0, + "slot": "0", + "type": "t_uint64" + }, + { + "astId": 2084, + "contract": "contracts/CCNotificationClient.sol:CCNotificationClient", + "label": "encryptedSecretsReference", + "offset": 0, + "slot": "1", + "type": "t_bytes_storage" + } + ], + "types": { + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_uint64": { + "encoding": "inplace", + "label": "uint64", + "numberOfBytes": "8" + } + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/sepolia/solcInputs/25559d85330bc5b0765b476baa8c2030.json b/packages/hardhat/deployments/sepolia/solcInputs/25559d85330bc5b0765b476baa8c2030.json new file mode 100644 index 0000000..7827ec2 --- /dev/null +++ b/packages/hardhat/deployments/sepolia/solcInputs/25559d85330bc5b0765b476baa8c2030.json @@ -0,0 +1,63 @@ +{ + "language": "Solidity", + "sources": { + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Chainlink Functions client interface.\ninterface IFunctionsClient {\n /// @notice Chainlink Functions response handler called by the Functions Router\n /// during fullilment from the designated transmitter node in an OCR round.\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\n /// @param response Aggregated response from the request's source code.\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\n /// @dev Either response or error parameter will be set, but never both.\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {FunctionsResponse} from \"../libraries/FunctionsResponse.sol\";\n\n/// @title Chainlink Functions Router interface.\ninterface IFunctionsRouter {\n /// @notice The identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n /// @return id - bytes32 id that can be passed to the \"getContractById\" of the Router\n function getAllowListId() external view returns (bytes32);\n\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n function setAllowListId(bytes32 allowListId) external;\n\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\n /// @return adminFee\n function getAdminFee() external view returns (uint72 adminFee);\n\n /// @notice Sends a request using the provided subscriptionId\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequest(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Sends a request to the proposed contracts\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequestToProposed(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Fulfill the request by:\n /// - calling back the data that the Oracle returned to the client contract\n /// - pay the DON for processing the request\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\n /// @param response response data from DON consensus\n /// @param err error from DON consensus\n /// @param juelsPerGas - current rate of juels/gas\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\n /// @param transmitter - The Node that transmitted the OCR report\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\n /// @return fulfillResult -\n /// @return callbackGasCostJuels -\n function fulfill(\n bytes memory response,\n bytes memory err,\n uint96 juelsPerGas,\n uint96 costWithoutFulfillment,\n address transmitter,\n FunctionsResponse.Commitment memory commitment\n ) external returns (FunctionsResponse.FulfillResult, uint96);\n\n /// @notice Validate requested gas limit is below the subscription max.\n /// @param subscriptionId subscription ID\n /// @param callbackGasLimit desired callback gas limit\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\n\n /// @notice Get the current contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current contract address\n function getContractById(bytes32 id) external view returns (address);\n\n /// @notice Get the proposed next contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current or proposed contract address\n function getProposedContractById(bytes32 id) external view returns (address);\n\n /// @notice Return the latest proprosal set\n /// @return ids The identifiers of the contracts to update\n /// @return to The addresses of the contracts that will be updated to\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\n\n /// @notice Proposes one or more updates to the contract routes\n /// @dev Only callable by owner\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\n\n /// @notice Updates the current contract routes to the proposed contracts\n /// @dev Only callable by owner\n function updateContracts() external;\n\n /// @dev Puts the system into an emergency stopped state.\n /// @dev Only callable by owner\n function pause() external;\n\n /// @dev Takes the system out of an emergency stopped state.\n /// @dev Only callable by owner\n function unpause() external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {CBOR} from \"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\";\n\n/// @title Library for encoding the input data of a Functions request into CBOR\nlibrary FunctionsRequest {\n using CBOR for CBOR.CBORBuffer;\n\n uint16 public constant REQUEST_DATA_VERSION = 1;\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\n\n enum Location {\n Inline, // Provided within the Request\n Remote, // Hosted through remote location that can be accessed through a provided URL\n DONHosted // Hosted on the DON's storage\n }\n\n enum CodeLanguage {\n JavaScript\n // In future version we may add other languages\n }\n\n struct Request {\n Location codeLocation; // ════════════╸ The location of the source code that will be executed on each node in the DON\n Location secretsLocation; // ═════════╸ The location of secrets that will be passed into the source code. *Only Remote secrets are supported\n CodeLanguage language; // ════════════╸ The coding language that the source code is written in\n string source; // ════════════════════╸ Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\n bytes encryptedSecretsReference; // ══╸ Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\n string[] args; // ════════════════════╸ String arguments that will be passed into the source code\n bytes[] bytesArgs; // ════════════════╸ Bytes arguments that will be passed into the source code\n }\n\n error EmptySource();\n error EmptySecrets();\n error EmptyArgs();\n error NoInlineSecrets();\n\n /// @notice Encodes a Request to CBOR encoded bytes\n /// @param self The request to encode\n /// @return CBOR encoded bytes\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"codeLocation\");\n buffer.writeUInt256(uint256(self.codeLocation));\n\n buffer.writeString(\"language\");\n buffer.writeUInt256(uint256(self.language));\n\n buffer.writeString(\"source\");\n buffer.writeString(self.source);\n\n if (self.args.length > 0) {\n buffer.writeString(\"args\");\n buffer.startArray();\n for (uint256 i = 0; i < self.args.length; ++i) {\n buffer.writeString(self.args[i]);\n }\n buffer.endSequence();\n }\n\n if (self.encryptedSecretsReference.length > 0) {\n if (self.secretsLocation == Location.Inline) {\n revert NoInlineSecrets();\n }\n buffer.writeString(\"secretsLocation\");\n buffer.writeUInt256(uint256(self.secretsLocation));\n buffer.writeString(\"secrets\");\n buffer.writeBytes(self.encryptedSecretsReference);\n }\n\n if (self.bytesArgs.length > 0) {\n buffer.writeString(\"bytesArgs\");\n buffer.startArray();\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\n buffer.writeBytes(self.bytesArgs[i]);\n }\n buffer.endSequence();\n }\n\n return buffer.buf.buf;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Sets the codeLocation and code on the request\n /// @param self The uninitialized request\n /// @param codeLocation The user provided source code location\n /// @param language The programming language of the user code\n /// @param source The user provided source code or a url\n function initializeRequest(\n Request memory self,\n Location codeLocation,\n CodeLanguage language,\n string memory source\n ) internal pure {\n if (bytes(source).length == 0) revert EmptySource();\n\n self.codeLocation = codeLocation;\n self.language = language;\n self.source = source;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Simplified version of initializeRequest for PoC\n /// @param self The uninitialized request\n /// @param javaScriptSource The user provided JS code (must not be empty)\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\n }\n\n /// @notice Adds Remote user encrypted secrets to a Request\n /// @param self The initialized request\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\n\n self.secretsLocation = Location.Remote;\n self.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n /// @notice Adds DON-hosted secrets reference to a Request\n /// @param self The initialized request\n /// @param slotID Slot ID of the user's secrets hosted on DON\n /// @param version User data version (for the slotID)\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"slotID\");\n buffer.writeUInt64(slotID);\n buffer.writeString(\"version\");\n buffer.writeUInt64(version);\n\n self.secretsLocation = Location.DONHosted;\n self.encryptedSecretsReference = buffer.buf.buf;\n }\n\n /// @notice Sets args for the user run function\n /// @param self The initialized request\n /// @param args The array of string args (must not be empty)\n function setArgs(Request memory self, string[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.args = args;\n }\n\n /// @notice Sets bytes args for the user run function\n /// @param self The initialized request\n /// @param args The array of bytes args (must not be empty)\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.bytesArgs = args;\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Library of types that are used for fulfillment of a Functions request\nlibrary FunctionsResponse {\n // Used to send request information from the Router to the Coordinator\n struct RequestMeta {\n bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\n bytes32 flags; // ═══════════════╸ Per-subscription flags\n address requestingContract; // ══╗ The client contract that is sending the request\n uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\n uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint64 initiatedRequests; // β•‘ The number of requests that have been started\n uint32 callbackGasLimit; // β•‘ The amount of gas that the callback to the consuming contract will be given\n uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data\n uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out\n address subscriptionOwner; // ═══╝ The owner of the billing subscription\n }\n\n enum FulfillResult {\n FULFILLED, // 0\n USER_CALLBACK_ERROR, // 1\n INVALID_REQUEST_ID, // 2\n COST_EXCEEDS_COMMITMENT, // 3\n INSUFFICIENT_GAS_PROVIDED, // 4\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\n INVALID_COMMITMENT // 6\n }\n\n struct Commitment {\n bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request\n address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request\n uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\n address client; // ════════════════════╗ The client contract that sent the request\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given\n uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint72 donFee; // β•‘ Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\n uint40 gasOverheadBeforeCallback; // β•‘ Represents the average gas execution cost before the fulfillment callback.\n uint40 gasOverheadAfterCallback; // β•‘ Represents the average gas execution cost after the fulfillment callback.\n uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"../v1_0_0/interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"../v1_0_0/interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"../v1_0_0/libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_functionsRouter;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_functionsRouter = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_functionsRouter.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_functionsRouter)) {\n revert OnlyRouterCanFulfill();\n }\n _fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}" + }, + "@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../@ensdomains/buffer/v0.1.0/Buffer.sol\";\n\n/**\n* @dev A library for populating CBOR encoded payload in Solidity.\n*\n* https://datatracker.ietf.org/doc/html/rfc7049\n*\n* The library offers various write* and start* methods to encode values of different types.\n* The resulted buffer can be obtained with data() method.\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\n* in an invalid CBOR if start/write/end flow is violated.\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\n* except for nested start/end pairs.\n*/\n\nlibrary CBOR {\n using Buffer for Buffer.buffer;\n\n struct CBORBuffer {\n Buffer.buffer buf;\n uint256 depth;\n }\n\n uint8 private constant MAJOR_TYPE_INT = 0;\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\n uint8 private constant MAJOR_TYPE_BYTES = 2;\n uint8 private constant MAJOR_TYPE_STRING = 3;\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\n uint8 private constant MAJOR_TYPE_MAP = 5;\n uint8 private constant MAJOR_TYPE_TAG = 6;\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\n\n uint8 private constant TAG_TYPE_BIGNUM = 2;\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\n\n uint8 private constant CBOR_FALSE = 20;\n uint8 private constant CBOR_TRUE = 21;\n uint8 private constant CBOR_NULL = 22;\n uint8 private constant CBOR_UNDEFINED = 23;\n\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\n Buffer.init(cbor.buf, capacity);\n cbor.depth = 0;\n return cbor;\n }\n\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\n require(buf.depth == 0, \"Invalid CBOR\");\n return buf.buf.buf;\n }\n\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\n writeBytes(buf, abi.encode(value));\n }\n\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\n if (value < 0) {\n buf.buf.appendUint8(\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\n );\n writeBytes(buf, abi.encode(uint256(-1 - value)));\n } else {\n writeUInt256(buf, uint256(value));\n }\n }\n\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\n }\n\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\n if(value >= 0) {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\n } else{\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\n }\n }\n\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\n buf.buf.append(value);\n }\n\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\n buf.buf.append(bytes(value));\n }\n\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\n }\n\n function writeNull(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_NULL);\n }\n\n function writeUndefined(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_UNDEFINED);\n }\n\n function startArray(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\n buf.depth += 1;\n }\n\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\n }\n\n function startMap(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\n buf.depth += 1;\n }\n\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\n }\n\n function endSequence(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\n buf.depth -= 1;\n }\n\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\n writeString(buf, key);\n writeString(buf, value);\n }\n\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\n writeString(buf, key);\n writeBytes(buf, value);\n }\n\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\n writeString(buf, key);\n writeUInt256(buf, value);\n }\n\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\n writeString(buf, key);\n writeInt256(buf, value);\n }\n\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\n writeString(buf, key);\n writeUInt64(buf, value);\n }\n\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\n writeString(buf, key);\n writeInt64(buf, value);\n }\n\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\n writeString(buf, key);\n writeBool(buf, value);\n }\n\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeNull(buf);\n }\n\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeUndefined(buf);\n }\n\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startMap(buf);\n }\n\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startArray(buf);\n }\n\n function writeFixedNumeric(\n CBORBuffer memory buf,\n uint8 major,\n uint64 value\n ) private pure {\n if (value <= 23) {\n buf.buf.appendUint8(uint8((major << 5) | value));\n } else if (value <= 0xFF) {\n buf.buf.appendUint8(uint8((major << 5) | 24));\n buf.buf.appendInt(value, 1);\n } else if (value <= 0xFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 25));\n buf.buf.appendInt(value, 2);\n } else if (value <= 0xFFFFFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 26));\n buf.buf.appendInt(value, 4);\n } else {\n buf.buf.appendUint8(uint8((major << 5) | 27));\n buf.buf.appendInt(value, 8);\n }\n }\n\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\n private\n pure\n {\n buf.buf.appendUint8(uint8((major << 5) | 31));\n }\n\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\n private\n pure\n {\n writeFixedNumeric(buf, major, length);\n }\n\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\n }\n}" + }, + "contracts/CCNotificationClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from \"./interfaces/ICCGatewayClient.sol\";\nimport {ICCGateway} from \"./interfaces/ICCGateway.sol\";\n\ncontract CCNotificationClient is ICCGatewayClient {\n ICCGateway private immutable gateway;\n\n uint64 private subscriptionId = 0;\n bytes private encryptedSecretsReference = \"\";\n\n event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response);\n event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error);\n\n constructor(address gatewayAddress) {\n gateway = ICCGateway(gatewayAddress);\n }\n\n function updateSubscriptionId(uint64 _subscriptionId) external {\n subscriptionId = _subscriptionId;\n }\n\n function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external {\n encryptedSecretsReference = _encryptedSecretsReference;\n }\n\n function request(string[] calldata args, bytes[] calldata bytesArgs) external {\n require(subscriptionId != 0, \"Subscription ID not set\");\n\n gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference);\n }\n\n function callback(bytes32 requestId) external override {\n ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true);\n\n if (response.state == ICCGatewayClient.CCGResponseState.Success) {\n emit ResponseReceived(response.subscriptionId, requestId, string(response.data));\n } else {\n emit ErrorReceived(response.subscriptionId, requestId, string(response.error));\n }\n }\n}\n" + }, + "contracts/interfaces/ICCGateway.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\";\n\ninterface ICCGateway {\n struct CCGRequest {\n string name;\n uint32 callbackGasLimit;\n FunctionsRequest.Request config;\n }\n\n /**\n * @dev Can't register a request with an empty name\n */\n error CCGRequestNameEmpty();\n\n /**\n * @dev Only the same source of the requestId is allowed to call the function\n */\n error CCGOnlySameSourceAllowed(bytes32 requestId);\n\n /**\n * @dev Only a registered subscriptionId is allowed to call the function\n */\n error CCGRequestNotRegistered(uint64 subscriptionId);\n\n /**\n * @dev Can't fulfill a request that has already been fulfilled\n */\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\n\n /**\n * @dev Only A manager can call the function\n */\n error CCGOnlyManagerAllowed();\n\n /**\n * @dev Send a request to the Functions DON\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external returns (bytes32 requestId);\n\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\n}\n" + }, + "contracts/interfaces/ICCGatewayClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\ninterface ICCGatewayClient {\n enum CCGResponseState {Sent, Success, Error}\n\n struct CCGResponse {\n uint64 subscriptionId;\n address source;\n CCGResponseState state;\n bytes data;\n bytes error;\n }\n\n function callback(bytes32 requestId) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/sepolia/solcInputs/53149b43bdceb93f30f39d8cad0df810.json b/packages/hardhat/deployments/sepolia/solcInputs/53149b43bdceb93f30f39d8cad0df810.json new file mode 100644 index 0000000..9f9aa88 --- /dev/null +++ b/packages/hardhat/deployments/sepolia/solcInputs/53149b43bdceb93f30f39d8cad0df810.json @@ -0,0 +1,84 @@ +{ + "language": "Solidity", + "sources": { + "@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"./interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"./interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"./libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_router;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_router = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_router.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_router)) {\n revert OnlyRouterCanFulfill();\n }\n fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Chainlink Functions client interface.\ninterface IFunctionsClient {\n /// @notice Chainlink Functions response handler called by the Functions Router\n /// during fullilment from the designated transmitter node in an OCR round.\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\n /// @param response Aggregated response from the request's source code.\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\n /// @dev Either response or error parameter will be set, but never both.\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {FunctionsResponse} from \"../libraries/FunctionsResponse.sol\";\n\n/// @title Chainlink Functions Router interface.\ninterface IFunctionsRouter {\n /// @notice The identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n /// @return id - bytes32 id that can be passed to the \"getContractById\" of the Router\n function getAllowListId() external view returns (bytes32);\n\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n function setAllowListId(bytes32 allowListId) external;\n\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\n /// @return adminFee\n function getAdminFee() external view returns (uint72 adminFee);\n\n /// @notice Sends a request using the provided subscriptionId\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequest(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Sends a request to the proposed contracts\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequestToProposed(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Fulfill the request by:\n /// - calling back the data that the Oracle returned to the client contract\n /// - pay the DON for processing the request\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\n /// @param response response data from DON consensus\n /// @param err error from DON consensus\n /// @param juelsPerGas - current rate of juels/gas\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\n /// @param transmitter - The Node that transmitted the OCR report\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\n /// @return fulfillResult -\n /// @return callbackGasCostJuels -\n function fulfill(\n bytes memory response,\n bytes memory err,\n uint96 juelsPerGas,\n uint96 costWithoutFulfillment,\n address transmitter,\n FunctionsResponse.Commitment memory commitment\n ) external returns (FunctionsResponse.FulfillResult, uint96);\n\n /// @notice Validate requested gas limit is below the subscription max.\n /// @param subscriptionId subscription ID\n /// @param callbackGasLimit desired callback gas limit\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\n\n /// @notice Get the current contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current contract address\n function getContractById(bytes32 id) external view returns (address);\n\n /// @notice Get the proposed next contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current or proposed contract address\n function getProposedContractById(bytes32 id) external view returns (address);\n\n /// @notice Return the latest proprosal set\n /// @return ids The identifiers of the contracts to update\n /// @return to The addresses of the contracts that will be updated to\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\n\n /// @notice Proposes one or more updates to the contract routes\n /// @dev Only callable by owner\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\n\n /// @notice Updates the current contract routes to the proposed contracts\n /// @dev Only callable by owner\n function updateContracts() external;\n\n /// @dev Puts the system into an emergency stopped state.\n /// @dev Only callable by owner\n function pause() external;\n\n /// @dev Takes the system out of an emergency stopped state.\n /// @dev Only callable by owner\n function unpause() external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {CBOR} from \"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\";\n\n/// @title Library for encoding the input data of a Functions request into CBOR\nlibrary FunctionsRequest {\n using CBOR for CBOR.CBORBuffer;\n\n uint16 public constant REQUEST_DATA_VERSION = 1;\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\n\n enum Location {\n Inline, // Provided within the Request\n Remote, // Hosted through remote location that can be accessed through a provided URL\n DONHosted // Hosted on the DON's storage\n }\n\n enum CodeLanguage {\n JavaScript\n // In future version we may add other languages\n }\n\n struct Request {\n Location codeLocation; // ════════════╸ The location of the source code that will be executed on each node in the DON\n Location secretsLocation; // ═════════╸ The location of secrets that will be passed into the source code. *Only Remote secrets are supported\n CodeLanguage language; // ════════════╸ The coding language that the source code is written in\n string source; // ════════════════════╸ Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\n bytes encryptedSecretsReference; // ══╸ Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\n string[] args; // ════════════════════╸ String arguments that will be passed into the source code\n bytes[] bytesArgs; // ════════════════╸ Bytes arguments that will be passed into the source code\n }\n\n error EmptySource();\n error EmptySecrets();\n error EmptyArgs();\n error NoInlineSecrets();\n\n /// @notice Encodes a Request to CBOR encoded bytes\n /// @param self The request to encode\n /// @return CBOR encoded bytes\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"codeLocation\");\n buffer.writeUInt256(uint256(self.codeLocation));\n\n buffer.writeString(\"language\");\n buffer.writeUInt256(uint256(self.language));\n\n buffer.writeString(\"source\");\n buffer.writeString(self.source);\n\n if (self.args.length > 0) {\n buffer.writeString(\"args\");\n buffer.startArray();\n for (uint256 i = 0; i < self.args.length; ++i) {\n buffer.writeString(self.args[i]);\n }\n buffer.endSequence();\n }\n\n if (self.encryptedSecretsReference.length > 0) {\n if (self.secretsLocation == Location.Inline) {\n revert NoInlineSecrets();\n }\n buffer.writeString(\"secretsLocation\");\n buffer.writeUInt256(uint256(self.secretsLocation));\n buffer.writeString(\"secrets\");\n buffer.writeBytes(self.encryptedSecretsReference);\n }\n\n if (self.bytesArgs.length > 0) {\n buffer.writeString(\"bytesArgs\");\n buffer.startArray();\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\n buffer.writeBytes(self.bytesArgs[i]);\n }\n buffer.endSequence();\n }\n\n return buffer.buf.buf;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Sets the codeLocation and code on the request\n /// @param self The uninitialized request\n /// @param codeLocation The user provided source code location\n /// @param language The programming language of the user code\n /// @param source The user provided source code or a url\n function initializeRequest(\n Request memory self,\n Location codeLocation,\n CodeLanguage language,\n string memory source\n ) internal pure {\n if (bytes(source).length == 0) revert EmptySource();\n\n self.codeLocation = codeLocation;\n self.language = language;\n self.source = source;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Simplified version of initializeRequest for PoC\n /// @param self The uninitialized request\n /// @param javaScriptSource The user provided JS code (must not be empty)\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\n }\n\n /// @notice Adds Remote user encrypted secrets to a Request\n /// @param self The initialized request\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\n\n self.secretsLocation = Location.Remote;\n self.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n /// @notice Adds DON-hosted secrets reference to a Request\n /// @param self The initialized request\n /// @param slotID Slot ID of the user's secrets hosted on DON\n /// @param version User data version (for the slotID)\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"slotID\");\n buffer.writeUInt64(slotID);\n buffer.writeString(\"version\");\n buffer.writeUInt64(version);\n\n self.secretsLocation = Location.DONHosted;\n self.encryptedSecretsReference = buffer.buf.buf;\n }\n\n /// @notice Sets args for the user run function\n /// @param self The initialized request\n /// @param args The array of string args (must not be empty)\n function setArgs(Request memory self, string[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.args = args;\n }\n\n /// @notice Sets bytes args for the user run function\n /// @param self The initialized request\n /// @param args The array of bytes args (must not be empty)\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.bytesArgs = args;\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Library of types that are used for fulfillment of a Functions request\nlibrary FunctionsResponse {\n // Used to send request information from the Router to the Coordinator\n struct RequestMeta {\n bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\n bytes32 flags; // ═══════════════╸ Per-subscription flags\n address requestingContract; // ══╗ The client contract that is sending the request\n uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\n uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint64 initiatedRequests; // β•‘ The number of requests that have been started\n uint32 callbackGasLimit; // β•‘ The amount of gas that the callback to the consuming contract will be given\n uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data\n uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out\n address subscriptionOwner; // ═══╝ The owner of the billing subscription\n }\n\n enum FulfillResult {\n FULFILLED, // 0\n USER_CALLBACK_ERROR, // 1\n INVALID_REQUEST_ID, // 2\n COST_EXCEEDS_COMMITMENT, // 3\n INSUFFICIENT_GAS_PROVIDED, // 4\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\n INVALID_COMMITMENT // 6\n }\n\n struct Commitment {\n bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request\n address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request\n uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\n address client; // ════════════════════╗ The client contract that sent the request\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given\n uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint72 donFee; // β•‘ Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\n uint40 gasOverheadBeforeCallback; // β•‘ Represents the average gas execution cost before the fulfillment callback.\n uint40 gasOverheadAfterCallback; // β•‘ Represents the average gas execution cost after the fulfillment callback.\n uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"../v1_0_0/interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"../v1_0_0/interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"../v1_0_0/libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_functionsRouter;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_functionsRouter = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_functionsRouter.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_functionsRouter)) {\n revert OnlyRouterCanFulfill();\n }\n _fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}" + }, + "@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../@ensdomains/buffer/v0.1.0/Buffer.sol\";\n\n/**\n* @dev A library for populating CBOR encoded payload in Solidity.\n*\n* https://datatracker.ietf.org/doc/html/rfc7049\n*\n* The library offers various write* and start* methods to encode values of different types.\n* The resulted buffer can be obtained with data() method.\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\n* in an invalid CBOR if start/write/end flow is violated.\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\n* except for nested start/end pairs.\n*/\n\nlibrary CBOR {\n using Buffer for Buffer.buffer;\n\n struct CBORBuffer {\n Buffer.buffer buf;\n uint256 depth;\n }\n\n uint8 private constant MAJOR_TYPE_INT = 0;\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\n uint8 private constant MAJOR_TYPE_BYTES = 2;\n uint8 private constant MAJOR_TYPE_STRING = 3;\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\n uint8 private constant MAJOR_TYPE_MAP = 5;\n uint8 private constant MAJOR_TYPE_TAG = 6;\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\n\n uint8 private constant TAG_TYPE_BIGNUM = 2;\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\n\n uint8 private constant CBOR_FALSE = 20;\n uint8 private constant CBOR_TRUE = 21;\n uint8 private constant CBOR_NULL = 22;\n uint8 private constant CBOR_UNDEFINED = 23;\n\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\n Buffer.init(cbor.buf, capacity);\n cbor.depth = 0;\n return cbor;\n }\n\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\n require(buf.depth == 0, \"Invalid CBOR\");\n return buf.buf.buf;\n }\n\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\n writeBytes(buf, abi.encode(value));\n }\n\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\n if (value < 0) {\n buf.buf.appendUint8(\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\n );\n writeBytes(buf, abi.encode(uint256(-1 - value)));\n } else {\n writeUInt256(buf, uint256(value));\n }\n }\n\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\n }\n\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\n if(value >= 0) {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\n } else{\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\n }\n }\n\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\n buf.buf.append(value);\n }\n\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\n buf.buf.append(bytes(value));\n }\n\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\n }\n\n function writeNull(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_NULL);\n }\n\n function writeUndefined(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_UNDEFINED);\n }\n\n function startArray(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\n buf.depth += 1;\n }\n\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\n }\n\n function startMap(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\n buf.depth += 1;\n }\n\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\n }\n\n function endSequence(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\n buf.depth -= 1;\n }\n\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\n writeString(buf, key);\n writeString(buf, value);\n }\n\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\n writeString(buf, key);\n writeBytes(buf, value);\n }\n\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\n writeString(buf, key);\n writeUInt256(buf, value);\n }\n\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\n writeString(buf, key);\n writeInt256(buf, value);\n }\n\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\n writeString(buf, key);\n writeUInt64(buf, value);\n }\n\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\n writeString(buf, key);\n writeInt64(buf, value);\n }\n\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\n writeString(buf, key);\n writeBool(buf, value);\n }\n\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeNull(buf);\n }\n\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeUndefined(buf);\n }\n\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startMap(buf);\n }\n\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startArray(buf);\n }\n\n function writeFixedNumeric(\n CBORBuffer memory buf,\n uint8 major,\n uint64 value\n ) private pure {\n if (value <= 23) {\n buf.buf.appendUint8(uint8((major << 5) | value));\n } else if (value <= 0xFF) {\n buf.buf.appendUint8(uint8((major << 5) | 24));\n buf.buf.appendInt(value, 1);\n } else if (value <= 0xFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 25));\n buf.buf.appendInt(value, 2);\n } else if (value <= 0xFFFFFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 26));\n buf.buf.appendInt(value, 4);\n } else {\n buf.buf.appendUint8(uint8((major << 5) | 27));\n buf.buf.appendInt(value, 8);\n }\n }\n\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\n private\n pure\n {\n buf.buf.appendUint8(uint8((major << 5) | 31));\n }\n\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\n private\n pure\n {\n writeFixedNumeric(buf, major, length);\n }\n\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\n }\n}" + }, + "@openzeppelin/contracts/access/AccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.20;\n\nimport {IAccessControl} from \"./IAccessControl.sol\";\nimport {Context} from \"../utils/Context.sol\";\nimport {ERC165} from \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account => bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n" + }, + "@openzeppelin/contracts/access/IAccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "contracts/CCExampleClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from \"./interfaces/ICCGatewayClient.sol\";\nimport {ICCGateway} from \"./interfaces/ICCGateway.sol\";\n\ncontract CCExampleClient is ICCGatewayClient {\n ICCGateway private immutable gateway;\n\n uint64 private subscriptionId = 0;\n bytes private encryptedSecretsReference = \"\";\n\n event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response);\n event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error);\n\n constructor(address gatewayAddress) {\n gateway = ICCGateway(gatewayAddress);\n }\n\n function updateSubscriptionId(uint64 _subscriptionId) external {\n subscriptionId = _subscriptionId;\n }\n\n function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external {\n encryptedSecretsReference = _encryptedSecretsReference;\n }\n\n function request(string[] calldata args, bytes[] calldata bytesArgs) external {\n gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference);\n }\n\n function callback(bytes32 requestId) external override {\n ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true);\n\n if (response.state == ICCGatewayClient.CCGResponseState.Success) {\n emit ResponseReceived(response.subscriptionId, requestId, string(response.data));\n } else {\n emit ErrorReceived(response.subscriptionId, requestId, string(response.error));\n }\n }\n}\n" + }, + "contracts/CCGateway.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport './interfaces/ICCGateway.sol';\nimport {ICCGatewayClient} from './interfaces/ICCGatewayClient.sol';\n\nimport {FunctionsClient} from \"@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol\";\nimport {AccessControl} from \"@openzeppelin/contracts/access/AccessControl.sol\";\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\";\n\ncontract CCGateway is ICCGateway, FunctionsClient, AccessControl {\n using FunctionsRequest for FunctionsRequest.Request;\n\n bytes32 public constant MANAGER_ROLE = keccak256(\"MANAGER_ROLE\");\n bytes32 public constant CLIENT_ROLE = keccak256(\"CLIENT_ROLE\");\n bytes32 private _donId; // DON ID for the Functions DON to which the requests are sent\n\n mapping(uint64 subscriptionId => CCGRequest) private _requests; // Each subscription can only handle one kind of request\n mapping(bytes32 requestId => ICCGatewayClient.CCGResponse) private unprocessed_responses; // Responses that have not been processed yet\n\n constructor(address router, bytes32 initialDonId, address initialOwner) FunctionsClient(router) {\n _donId = initialDonId;\n\n address to = address(0) == initialOwner ? _msgSender() : initialOwner;\n _grantRole(DEFAULT_ADMIN_ROLE, to);\n _grantRole(MANAGER_ROLE, to);\n }\n\n /**\n * @dev Set the DON ID\n * @param newDonId New DON ID\n */\n function setDonId(bytes32 newDonId) external onlyRole(getRoleAdmin(MANAGER_ROLE)) {\n _donId = newDonId;\n }\n\n /**\n * @dev Get the DON ID\n * @return DON ID\n */\n function donId() external view returns (bytes32) {\n return _donId;\n }\n\n function registerRequest(\n uint64 subscriptionId,\n FunctionsRequest.Location codeLocation,\n string calldata source,\n FunctionsRequest.Location secretsLocation,\n bytes calldata encryptedSecretsReference,\n uint32 callbackGasLimit,\n string calldata name\n ) external onlyRole(MANAGER_ROLE) {\n if(bytes(name).length == 0) {revert CCGRequestNameEmpty();}\n\n CCGRequest storage req = _requests[subscriptionId];\n req.name = name;\n req.callbackGasLimit = callbackGasLimit;\n\n // Only JavaScript is supported for now\n req.config.language = FunctionsRequest.CodeLanguage.JavaScript;\n req.config.codeLocation = codeLocation;\n req.config.source = source;\n req.config.secretsLocation = secretsLocation;\n req.config.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n\n function getRequest(uint64 subscriptionId) external view onlyManager returns (CCGRequest memory) {\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n return _requests[subscriptionId];\n }\n// ---------------------------------------------------------------------------------------------------------------------\n modifier onlySource(bytes32 requestId) {\n if (unprocessed_responses[requestId].source != _msgSender()) {revert CCGOnlySameSourceAllowed(requestId);}\n _;\n }\n\n modifier onlyManager() {\n if (!hasRole(MANAGER_ROLE, tx.origin)) {revert CCGOnlyManagerAllowed();}\n _;\n }\n// ---------------------------------------------------------------------------------------------------------------------\n /**\n * @notice Triggers an on-demand Functions request using remote encrypted secrets\n * @param subscriptionId Subscription ID used to pay for request (FunctionsConsumer contract address must first be added to the subscription)\n * @param args String arguments passed into the source code and accessible via the global variable `args`\n * @param bytesArgs Bytes arguments passed into the source code and accessible via the global variable `bytesArgs` as hex strings\n * @param encryptedSecretsReference Reference pointing to encrypted secrets\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external onlyRole(CLIENT_ROLE) returns (bytes32 requestId) {\n CCGRequest storage request = _requests[subscriptionId];\n if (bytes(request.name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n\n FunctionsRequest.Request memory req = request.config;\n req.initializeRequest(req.codeLocation, FunctionsRequest.CodeLanguage.JavaScript, req.source);\n if(encryptedSecretsReference.length > 0) {req.encryptedSecretsReference = encryptedSecretsReference;}\n\n if (args.length > 0) {\n req.setArgs(args);\n }\n if (bytesArgs.length > 0) {\n req.setBytesArgs(bytesArgs);\n }\n\n requestId = _sendRequest(req.encodeCBOR(), subscriptionId, request.callbackGasLimit, _donId);\n unprocessed_responses[requestId].state = ICCGatewayClient.CCGResponseState.Sent;\n unprocessed_responses[requestId].source = _msgSender();\n }\n\n /**\n * @notice Store latest result/error\n * @param requestId The request ID, returned by sendRequest()\n * @param response Aggregated response from the user code\n * @param err Aggregated error from the user code or from the execution pipeline\n * Either response or error parameter will be set, but never both\n */\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal override {\n ICCGatewayClient.CCGResponse storage resp = unprocessed_responses[requestId];\n if (resp.state != ICCGatewayClient.CCGResponseState.Sent) {revert CCGRequestAlreadyFulfilled(requestId);}\n\n unprocessed_responses[requestId].state = err.length > 0 ? ICCGatewayClient.CCGResponseState.Error : ICCGatewayClient.CCGResponseState.Success;\n unprocessed_responses[requestId].data = response;\n unprocessed_responses[requestId].error = err;\n\n // TODO: Call the client's callback function.\n ICCGatewayClient(resp.source).callback(requestId);\n }\n\n /**\n * @dev Get the response data\n * @param requestId The request ID, returned by sendRequest()\n * @return response CCGResponse\n */\n function getResponse(bytes32 requestId, bool remove) external onlySource(requestId) returns (ICCGatewayClient.CCGResponse memory response) {\n response = unprocessed_responses[requestId];\n if (remove) {delete unprocessed_responses[requestId];}\n }\n}" + }, + "contracts/interfaces/ICCGateway.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\";\n\ninterface ICCGateway {\n struct CCGRequest {\n string name;\n uint32 callbackGasLimit;\n FunctionsRequest.Request config;\n }\n\n /**\n * @dev Can't register a request with an empty name\n */\n error CCGRequestNameEmpty();\n\n /**\n * @dev Only the same source of the requestId is allowed to call the function\n */\n error CCGOnlySameSourceAllowed(bytes32 requestId);\n\n /**\n * @dev Only a registered subscriptionId is allowed to call the function\n */\n error CCGRequestNotRegistered(uint64 subscriptionId);\n\n /**\n * @dev Can't fulfill a request that has already been fulfilled\n */\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\n\n /**\n * @dev Only A manager can call the function\n */\n error CCGOnlyManagerAllowed();\n\n /**\n * @dev Send a request to the Functions DON\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external returns (bytes32 requestId);\n\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\n}\n" + }, + "contracts/interfaces/ICCGatewayClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\ninterface ICCGatewayClient {\n enum CCGResponseState {Sent, Success, Error}\n\n struct CCGResponse {\n uint64 subscriptionId;\n address source;\n CCGResponseState state;\n bytes data;\n bytes error;\n }\n\n function callback(bytes32 requestId) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/sepolia/solcInputs/55f420078970def91f71afecffd6ca9e.json b/packages/hardhat/deployments/sepolia/solcInputs/55f420078970def91f71afecffd6ca9e.json new file mode 100644 index 0000000..48227cb --- /dev/null +++ b/packages/hardhat/deployments/sepolia/solcInputs/55f420078970def91f71afecffd6ca9e.json @@ -0,0 +1,63 @@ +{ + "language": "Solidity", + "sources": { + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Chainlink Functions client interface.\ninterface IFunctionsClient {\n /// @notice Chainlink Functions response handler called by the Functions Router\n /// during fullilment from the designated transmitter node in an OCR round.\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\n /// @param response Aggregated response from the request's source code.\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\n /// @dev Either response or error parameter will be set, but never both.\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {FunctionsResponse} from \"../libraries/FunctionsResponse.sol\";\n\n/// @title Chainlink Functions Router interface.\ninterface IFunctionsRouter {\n /// @notice The identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n /// @return id - bytes32 id that can be passed to the \"getContractById\" of the Router\n function getAllowListId() external view returns (bytes32);\n\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n function setAllowListId(bytes32 allowListId) external;\n\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\n /// @return adminFee\n function getAdminFee() external view returns (uint72 adminFee);\n\n /// @notice Sends a request using the provided subscriptionId\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequest(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Sends a request to the proposed contracts\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequestToProposed(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Fulfill the request by:\n /// - calling back the data that the Oracle returned to the client contract\n /// - pay the DON for processing the request\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\n /// @param response response data from DON consensus\n /// @param err error from DON consensus\n /// @param juelsPerGas - current rate of juels/gas\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\n /// @param transmitter - The Node that transmitted the OCR report\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\n /// @return fulfillResult -\n /// @return callbackGasCostJuels -\n function fulfill(\n bytes memory response,\n bytes memory err,\n uint96 juelsPerGas,\n uint96 costWithoutFulfillment,\n address transmitter,\n FunctionsResponse.Commitment memory commitment\n ) external returns (FunctionsResponse.FulfillResult, uint96);\n\n /// @notice Validate requested gas limit is below the subscription max.\n /// @param subscriptionId subscription ID\n /// @param callbackGasLimit desired callback gas limit\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\n\n /// @notice Get the current contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current contract address\n function getContractById(bytes32 id) external view returns (address);\n\n /// @notice Get the proposed next contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current or proposed contract address\n function getProposedContractById(bytes32 id) external view returns (address);\n\n /// @notice Return the latest proprosal set\n /// @return ids The identifiers of the contracts to update\n /// @return to The addresses of the contracts that will be updated to\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\n\n /// @notice Proposes one or more updates to the contract routes\n /// @dev Only callable by owner\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\n\n /// @notice Updates the current contract routes to the proposed contracts\n /// @dev Only callable by owner\n function updateContracts() external;\n\n /// @dev Puts the system into an emergency stopped state.\n /// @dev Only callable by owner\n function pause() external;\n\n /// @dev Takes the system out of an emergency stopped state.\n /// @dev Only callable by owner\n function unpause() external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {CBOR} from \"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\";\n\n/// @title Library for encoding the input data of a Functions request into CBOR\nlibrary FunctionsRequest {\n using CBOR for CBOR.CBORBuffer;\n\n uint16 public constant REQUEST_DATA_VERSION = 1;\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\n\n enum Location {\n Inline, // Provided within the Request\n Remote, // Hosted through remote location that can be accessed through a provided URL\n DONHosted // Hosted on the DON's storage\n }\n\n enum CodeLanguage {\n JavaScript\n // In future version we may add other languages\n }\n\n struct Request {\n Location codeLocation; // ════════════╸ The location of the source code that will be executed on each node in the DON\n Location secretsLocation; // ═════════╸ The location of secrets that will be passed into the source code. *Only Remote secrets are supported\n CodeLanguage language; // ════════════╸ The coding language that the source code is written in\n string source; // ════════════════════╸ Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\n bytes encryptedSecretsReference; // ══╸ Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\n string[] args; // ════════════════════╸ String arguments that will be passed into the source code\n bytes[] bytesArgs; // ════════════════╸ Bytes arguments that will be passed into the source code\n }\n\n error EmptySource();\n error EmptySecrets();\n error EmptyArgs();\n error NoInlineSecrets();\n\n /// @notice Encodes a Request to CBOR encoded bytes\n /// @param self The request to encode\n /// @return CBOR encoded bytes\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"codeLocation\");\n buffer.writeUInt256(uint256(self.codeLocation));\n\n buffer.writeString(\"language\");\n buffer.writeUInt256(uint256(self.language));\n\n buffer.writeString(\"source\");\n buffer.writeString(self.source);\n\n if (self.args.length > 0) {\n buffer.writeString(\"args\");\n buffer.startArray();\n for (uint256 i = 0; i < self.args.length; ++i) {\n buffer.writeString(self.args[i]);\n }\n buffer.endSequence();\n }\n\n if (self.encryptedSecretsReference.length > 0) {\n if (self.secretsLocation == Location.Inline) {\n revert NoInlineSecrets();\n }\n buffer.writeString(\"secretsLocation\");\n buffer.writeUInt256(uint256(self.secretsLocation));\n buffer.writeString(\"secrets\");\n buffer.writeBytes(self.encryptedSecretsReference);\n }\n\n if (self.bytesArgs.length > 0) {\n buffer.writeString(\"bytesArgs\");\n buffer.startArray();\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\n buffer.writeBytes(self.bytesArgs[i]);\n }\n buffer.endSequence();\n }\n\n return buffer.buf.buf;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Sets the codeLocation and code on the request\n /// @param self The uninitialized request\n /// @param codeLocation The user provided source code location\n /// @param language The programming language of the user code\n /// @param source The user provided source code or a url\n function initializeRequest(\n Request memory self,\n Location codeLocation,\n CodeLanguage language,\n string memory source\n ) internal pure {\n if (bytes(source).length == 0) revert EmptySource();\n\n self.codeLocation = codeLocation;\n self.language = language;\n self.source = source;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Simplified version of initializeRequest for PoC\n /// @param self The uninitialized request\n /// @param javaScriptSource The user provided JS code (must not be empty)\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\n }\n\n /// @notice Adds Remote user encrypted secrets to a Request\n /// @param self The initialized request\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\n\n self.secretsLocation = Location.Remote;\n self.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n /// @notice Adds DON-hosted secrets reference to a Request\n /// @param self The initialized request\n /// @param slotID Slot ID of the user's secrets hosted on DON\n /// @param version User data version (for the slotID)\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"slotID\");\n buffer.writeUInt64(slotID);\n buffer.writeString(\"version\");\n buffer.writeUInt64(version);\n\n self.secretsLocation = Location.DONHosted;\n self.encryptedSecretsReference = buffer.buf.buf;\n }\n\n /// @notice Sets args for the user run function\n /// @param self The initialized request\n /// @param args The array of string args (must not be empty)\n function setArgs(Request memory self, string[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.args = args;\n }\n\n /// @notice Sets bytes args for the user run function\n /// @param self The initialized request\n /// @param args The array of bytes args (must not be empty)\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.bytesArgs = args;\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Library of types that are used for fulfillment of a Functions request\nlibrary FunctionsResponse {\n // Used to send request information from the Router to the Coordinator\n struct RequestMeta {\n bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\n bytes32 flags; // ═══════════════╸ Per-subscription flags\n address requestingContract; // ══╗ The client contract that is sending the request\n uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\n uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint64 initiatedRequests; // β•‘ The number of requests that have been started\n uint32 callbackGasLimit; // β•‘ The amount of gas that the callback to the consuming contract will be given\n uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data\n uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out\n address subscriptionOwner; // ═══╝ The owner of the billing subscription\n }\n\n enum FulfillResult {\n FULFILLED, // 0\n USER_CALLBACK_ERROR, // 1\n INVALID_REQUEST_ID, // 2\n COST_EXCEEDS_COMMITMENT, // 3\n INSUFFICIENT_GAS_PROVIDED, // 4\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\n INVALID_COMMITMENT // 6\n }\n\n struct Commitment {\n bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request\n address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request\n uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\n address client; // ════════════════════╗ The client contract that sent the request\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given\n uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint72 donFee; // β•‘ Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\n uint40 gasOverheadBeforeCallback; // β•‘ Represents the average gas execution cost before the fulfillment callback.\n uint40 gasOverheadAfterCallback; // β•‘ Represents the average gas execution cost after the fulfillment callback.\n uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"../v1_0_0/interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"../v1_0_0/interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"../v1_0_0/libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_functionsRouter;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_functionsRouter = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_functionsRouter.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_functionsRouter)) {\n revert OnlyRouterCanFulfill();\n }\n _fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}" + }, + "@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../@ensdomains/buffer/v0.1.0/Buffer.sol\";\n\n/**\n* @dev A library for populating CBOR encoded payload in Solidity.\n*\n* https://datatracker.ietf.org/doc/html/rfc7049\n*\n* The library offers various write* and start* methods to encode values of different types.\n* The resulted buffer can be obtained with data() method.\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\n* in an invalid CBOR if start/write/end flow is violated.\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\n* except for nested start/end pairs.\n*/\n\nlibrary CBOR {\n using Buffer for Buffer.buffer;\n\n struct CBORBuffer {\n Buffer.buffer buf;\n uint256 depth;\n }\n\n uint8 private constant MAJOR_TYPE_INT = 0;\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\n uint8 private constant MAJOR_TYPE_BYTES = 2;\n uint8 private constant MAJOR_TYPE_STRING = 3;\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\n uint8 private constant MAJOR_TYPE_MAP = 5;\n uint8 private constant MAJOR_TYPE_TAG = 6;\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\n\n uint8 private constant TAG_TYPE_BIGNUM = 2;\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\n\n uint8 private constant CBOR_FALSE = 20;\n uint8 private constant CBOR_TRUE = 21;\n uint8 private constant CBOR_NULL = 22;\n uint8 private constant CBOR_UNDEFINED = 23;\n\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\n Buffer.init(cbor.buf, capacity);\n cbor.depth = 0;\n return cbor;\n }\n\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\n require(buf.depth == 0, \"Invalid CBOR\");\n return buf.buf.buf;\n }\n\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\n writeBytes(buf, abi.encode(value));\n }\n\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\n if (value < 0) {\n buf.buf.appendUint8(\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\n );\n writeBytes(buf, abi.encode(uint256(-1 - value)));\n } else {\n writeUInt256(buf, uint256(value));\n }\n }\n\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\n }\n\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\n if(value >= 0) {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\n } else{\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\n }\n }\n\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\n buf.buf.append(value);\n }\n\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\n buf.buf.append(bytes(value));\n }\n\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\n }\n\n function writeNull(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_NULL);\n }\n\n function writeUndefined(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_UNDEFINED);\n }\n\n function startArray(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\n buf.depth += 1;\n }\n\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\n }\n\n function startMap(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\n buf.depth += 1;\n }\n\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\n }\n\n function endSequence(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\n buf.depth -= 1;\n }\n\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\n writeString(buf, key);\n writeString(buf, value);\n }\n\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\n writeString(buf, key);\n writeBytes(buf, value);\n }\n\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\n writeString(buf, key);\n writeUInt256(buf, value);\n }\n\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\n writeString(buf, key);\n writeInt256(buf, value);\n }\n\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\n writeString(buf, key);\n writeUInt64(buf, value);\n }\n\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\n writeString(buf, key);\n writeInt64(buf, value);\n }\n\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\n writeString(buf, key);\n writeBool(buf, value);\n }\n\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeNull(buf);\n }\n\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeUndefined(buf);\n }\n\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startMap(buf);\n }\n\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startArray(buf);\n }\n\n function writeFixedNumeric(\n CBORBuffer memory buf,\n uint8 major,\n uint64 value\n ) private pure {\n if (value <= 23) {\n buf.buf.appendUint8(uint8((major << 5) | value));\n } else if (value <= 0xFF) {\n buf.buf.appendUint8(uint8((major << 5) | 24));\n buf.buf.appendInt(value, 1);\n } else if (value <= 0xFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 25));\n buf.buf.appendInt(value, 2);\n } else if (value <= 0xFFFFFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 26));\n buf.buf.appendInt(value, 4);\n } else {\n buf.buf.appendUint8(uint8((major << 5) | 27));\n buf.buf.appendInt(value, 8);\n }\n }\n\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\n private\n pure\n {\n buf.buf.appendUint8(uint8((major << 5) | 31));\n }\n\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\n private\n pure\n {\n writeFixedNumeric(buf, major, length);\n }\n\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\n }\n}" + }, + "contracts/CCExampleClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from \"./interfaces/ICCGatewayClient.sol\";\nimport {ICCGateway} from \"./interfaces/ICCGateway.sol\";\n\ncontract CCExampleClient is ICCGatewayClient {\n ICCGateway private immutable gateway;\n\n uint64 private subscriptionId = 0;\n bytes private encryptedSecretsReference = \"\";\n\n event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response);\n event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error);\n\n constructor(address gatewayAddress) {\n gateway = ICCGateway(gatewayAddress);\n }\n\n function updateSubscriptionId(uint64 _subscriptionId) external {\n subscriptionId = _subscriptionId;\n }\n\n function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external {\n encryptedSecretsReference = _encryptedSecretsReference;\n }\n\n function request(string[] calldata args, bytes[] calldata bytesArgs) external {\n require(subscriptionId != 0, \"Subscription ID not set\");\n\n gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference);\n }\n\n function callback(bytes32 requestId) external override {\n ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true);\n\n if (response.state == ICCGatewayClient.CCGResponseState.Success) {\n emit ResponseReceived(response.subscriptionId, requestId, string(response.data));\n } else {\n emit ErrorReceived(response.subscriptionId, requestId, string(response.error));\n }\n }\n}\n" + }, + "contracts/interfaces/ICCGateway.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\";\n\ninterface ICCGateway {\n struct CCGRequest {\n string name;\n uint32 callbackGasLimit;\n FunctionsRequest.Request config;\n }\n\n /**\n * @dev Can't register a request with an empty name\n */\n error CCGRequestNameEmpty();\n\n /**\n * @dev Only the same source of the requestId is allowed to call the function\n */\n error CCGOnlySameSourceAllowed(bytes32 requestId);\n\n /**\n * @dev Only a registered subscriptionId is allowed to call the function\n */\n error CCGRequestNotRegistered(uint64 subscriptionId);\n\n /**\n * @dev Can't fulfill a request that has already been fulfilled\n */\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\n\n /**\n * @dev Only A manager can call the function\n */\n error CCGOnlyManagerAllowed();\n\n /**\n * @dev Send a request to the Functions DON\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external returns (bytes32 requestId);\n\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\n}\n" + }, + "contracts/interfaces/ICCGatewayClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\ninterface ICCGatewayClient {\n enum CCGResponseState {Sent, Success, Error}\n\n struct CCGResponse {\n uint64 subscriptionId;\n address source;\n CCGResponseState state;\n bytes data;\n bytes error;\n }\n\n function callback(bytes32 requestId) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/sepolia/solcInputs/be18bfdeea6869d68a166c8869814257.json b/packages/hardhat/deployments/sepolia/solcInputs/be18bfdeea6869d68a166c8869814257.json new file mode 100644 index 0000000..b29947d --- /dev/null +++ b/packages/hardhat/deployments/sepolia/solcInputs/be18bfdeea6869d68a166c8869814257.json @@ -0,0 +1,81 @@ +{ + "language": "Solidity", + "sources": { + "@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"./interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"./interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"./libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_router;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_router = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_router.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_router)) {\n revert OnlyRouterCanFulfill();\n }\n fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Chainlink Functions client interface.\ninterface IFunctionsClient {\n /// @notice Chainlink Functions response handler called by the Functions Router\n /// during fullilment from the designated transmitter node in an OCR round.\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\n /// @param response Aggregated response from the request's source code.\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\n /// @dev Either response or error parameter will be set, but never both.\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {FunctionsResponse} from \"../libraries/FunctionsResponse.sol\";\n\n/// @title Chainlink Functions Router interface.\ninterface IFunctionsRouter {\n /// @notice The identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n /// @return id - bytes32 id that can be passed to the \"getContractById\" of the Router\n function getAllowListId() external view returns (bytes32);\n\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n function setAllowListId(bytes32 allowListId) external;\n\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\n /// @return adminFee\n function getAdminFee() external view returns (uint72 adminFee);\n\n /// @notice Sends a request using the provided subscriptionId\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequest(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Sends a request to the proposed contracts\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequestToProposed(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Fulfill the request by:\n /// - calling back the data that the Oracle returned to the client contract\n /// - pay the DON for processing the request\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\n /// @param response response data from DON consensus\n /// @param err error from DON consensus\n /// @param juelsPerGas - current rate of juels/gas\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\n /// @param transmitter - The Node that transmitted the OCR report\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\n /// @return fulfillResult -\n /// @return callbackGasCostJuels -\n function fulfill(\n bytes memory response,\n bytes memory err,\n uint96 juelsPerGas,\n uint96 costWithoutFulfillment,\n address transmitter,\n FunctionsResponse.Commitment memory commitment\n ) external returns (FunctionsResponse.FulfillResult, uint96);\n\n /// @notice Validate requested gas limit is below the subscription max.\n /// @param subscriptionId subscription ID\n /// @param callbackGasLimit desired callback gas limit\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\n\n /// @notice Get the current contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current contract address\n function getContractById(bytes32 id) external view returns (address);\n\n /// @notice Get the proposed next contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current or proposed contract address\n function getProposedContractById(bytes32 id) external view returns (address);\n\n /// @notice Return the latest proprosal set\n /// @return ids The identifiers of the contracts to update\n /// @return to The addresses of the contracts that will be updated to\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\n\n /// @notice Proposes one or more updates to the contract routes\n /// @dev Only callable by owner\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\n\n /// @notice Updates the current contract routes to the proposed contracts\n /// @dev Only callable by owner\n function updateContracts() external;\n\n /// @dev Puts the system into an emergency stopped state.\n /// @dev Only callable by owner\n function pause() external;\n\n /// @dev Takes the system out of an emergency stopped state.\n /// @dev Only callable by owner\n function unpause() external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {CBOR} from \"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\";\n\n/// @title Library for encoding the input data of a Functions request into CBOR\nlibrary FunctionsRequest {\n using CBOR for CBOR.CBORBuffer;\n\n uint16 public constant REQUEST_DATA_VERSION = 1;\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\n\n enum Location {\n Inline, // Provided within the Request\n Remote, // Hosted through remote location that can be accessed through a provided URL\n DONHosted // Hosted on the DON's storage\n }\n\n enum CodeLanguage {\n JavaScript\n // In future version we may add other languages\n }\n\n struct Request {\n Location codeLocation; // ════════════╸ The location of the source code that will be executed on each node in the DON\n Location secretsLocation; // ═════════╸ The location of secrets that will be passed into the source code. *Only Remote secrets are supported\n CodeLanguage language; // ════════════╸ The coding language that the source code is written in\n string source; // ════════════════════╸ Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\n bytes encryptedSecretsReference; // ══╸ Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\n string[] args; // ════════════════════╸ String arguments that will be passed into the source code\n bytes[] bytesArgs; // ════════════════╸ Bytes arguments that will be passed into the source code\n }\n\n error EmptySource();\n error EmptySecrets();\n error EmptyArgs();\n error NoInlineSecrets();\n\n /// @notice Encodes a Request to CBOR encoded bytes\n /// @param self The request to encode\n /// @return CBOR encoded bytes\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"codeLocation\");\n buffer.writeUInt256(uint256(self.codeLocation));\n\n buffer.writeString(\"language\");\n buffer.writeUInt256(uint256(self.language));\n\n buffer.writeString(\"source\");\n buffer.writeString(self.source);\n\n if (self.args.length > 0) {\n buffer.writeString(\"args\");\n buffer.startArray();\n for (uint256 i = 0; i < self.args.length; ++i) {\n buffer.writeString(self.args[i]);\n }\n buffer.endSequence();\n }\n\n if (self.encryptedSecretsReference.length > 0) {\n if (self.secretsLocation == Location.Inline) {\n revert NoInlineSecrets();\n }\n buffer.writeString(\"secretsLocation\");\n buffer.writeUInt256(uint256(self.secretsLocation));\n buffer.writeString(\"secrets\");\n buffer.writeBytes(self.encryptedSecretsReference);\n }\n\n if (self.bytesArgs.length > 0) {\n buffer.writeString(\"bytesArgs\");\n buffer.startArray();\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\n buffer.writeBytes(self.bytesArgs[i]);\n }\n buffer.endSequence();\n }\n\n return buffer.buf.buf;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Sets the codeLocation and code on the request\n /// @param self The uninitialized request\n /// @param codeLocation The user provided source code location\n /// @param language The programming language of the user code\n /// @param source The user provided source code or a url\n function initializeRequest(\n Request memory self,\n Location codeLocation,\n CodeLanguage language,\n string memory source\n ) internal pure {\n if (bytes(source).length == 0) revert EmptySource();\n\n self.codeLocation = codeLocation;\n self.language = language;\n self.source = source;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Simplified version of initializeRequest for PoC\n /// @param self The uninitialized request\n /// @param javaScriptSource The user provided JS code (must not be empty)\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\n }\n\n /// @notice Adds Remote user encrypted secrets to a Request\n /// @param self The initialized request\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\n\n self.secretsLocation = Location.Remote;\n self.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n /// @notice Adds DON-hosted secrets reference to a Request\n /// @param self The initialized request\n /// @param slotID Slot ID of the user's secrets hosted on DON\n /// @param version User data version (for the slotID)\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"slotID\");\n buffer.writeUInt64(slotID);\n buffer.writeString(\"version\");\n buffer.writeUInt64(version);\n\n self.secretsLocation = Location.DONHosted;\n self.encryptedSecretsReference = buffer.buf.buf;\n }\n\n /// @notice Sets args for the user run function\n /// @param self The initialized request\n /// @param args The array of string args (must not be empty)\n function setArgs(Request memory self, string[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.args = args;\n }\n\n /// @notice Sets bytes args for the user run function\n /// @param self The initialized request\n /// @param args The array of bytes args (must not be empty)\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.bytesArgs = args;\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Library of types that are used for fulfillment of a Functions request\nlibrary FunctionsResponse {\n // Used to send request information from the Router to the Coordinator\n struct RequestMeta {\n bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\n bytes32 flags; // ═══════════════╸ Per-subscription flags\n address requestingContract; // ══╗ The client contract that is sending the request\n uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\n uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint64 initiatedRequests; // β•‘ The number of requests that have been started\n uint32 callbackGasLimit; // β•‘ The amount of gas that the callback to the consuming contract will be given\n uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data\n uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out\n address subscriptionOwner; // ═══╝ The owner of the billing subscription\n }\n\n enum FulfillResult {\n FULFILLED, // 0\n USER_CALLBACK_ERROR, // 1\n INVALID_REQUEST_ID, // 2\n COST_EXCEEDS_COMMITMENT, // 3\n INSUFFICIENT_GAS_PROVIDED, // 4\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\n INVALID_COMMITMENT // 6\n }\n\n struct Commitment {\n bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request\n address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request\n uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\n address client; // ════════════════════╗ The client contract that sent the request\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given\n uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint72 donFee; // β•‘ Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\n uint40 gasOverheadBeforeCallback; // β•‘ Represents the average gas execution cost before the fulfillment callback.\n uint40 gasOverheadAfterCallback; // β•‘ Represents the average gas execution cost after the fulfillment callback.\n uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"../v1_0_0/interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"../v1_0_0/interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"../v1_0_0/libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_functionsRouter;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_functionsRouter = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_functionsRouter.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_functionsRouter)) {\n revert OnlyRouterCanFulfill();\n }\n _fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}" + }, + "@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../@ensdomains/buffer/v0.1.0/Buffer.sol\";\n\n/**\n* @dev A library for populating CBOR encoded payload in Solidity.\n*\n* https://datatracker.ietf.org/doc/html/rfc7049\n*\n* The library offers various write* and start* methods to encode values of different types.\n* The resulted buffer can be obtained with data() method.\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\n* in an invalid CBOR if start/write/end flow is violated.\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\n* except for nested start/end pairs.\n*/\n\nlibrary CBOR {\n using Buffer for Buffer.buffer;\n\n struct CBORBuffer {\n Buffer.buffer buf;\n uint256 depth;\n }\n\n uint8 private constant MAJOR_TYPE_INT = 0;\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\n uint8 private constant MAJOR_TYPE_BYTES = 2;\n uint8 private constant MAJOR_TYPE_STRING = 3;\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\n uint8 private constant MAJOR_TYPE_MAP = 5;\n uint8 private constant MAJOR_TYPE_TAG = 6;\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\n\n uint8 private constant TAG_TYPE_BIGNUM = 2;\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\n\n uint8 private constant CBOR_FALSE = 20;\n uint8 private constant CBOR_TRUE = 21;\n uint8 private constant CBOR_NULL = 22;\n uint8 private constant CBOR_UNDEFINED = 23;\n\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\n Buffer.init(cbor.buf, capacity);\n cbor.depth = 0;\n return cbor;\n }\n\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\n require(buf.depth == 0, \"Invalid CBOR\");\n return buf.buf.buf;\n }\n\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\n writeBytes(buf, abi.encode(value));\n }\n\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\n if (value < 0) {\n buf.buf.appendUint8(\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\n );\n writeBytes(buf, abi.encode(uint256(-1 - value)));\n } else {\n writeUInt256(buf, uint256(value));\n }\n }\n\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\n }\n\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\n if(value >= 0) {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\n } else{\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\n }\n }\n\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\n buf.buf.append(value);\n }\n\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\n buf.buf.append(bytes(value));\n }\n\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\n }\n\n function writeNull(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_NULL);\n }\n\n function writeUndefined(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_UNDEFINED);\n }\n\n function startArray(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\n buf.depth += 1;\n }\n\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\n }\n\n function startMap(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\n buf.depth += 1;\n }\n\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\n }\n\n function endSequence(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\n buf.depth -= 1;\n }\n\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\n writeString(buf, key);\n writeString(buf, value);\n }\n\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\n writeString(buf, key);\n writeBytes(buf, value);\n }\n\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\n writeString(buf, key);\n writeUInt256(buf, value);\n }\n\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\n writeString(buf, key);\n writeInt256(buf, value);\n }\n\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\n writeString(buf, key);\n writeUInt64(buf, value);\n }\n\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\n writeString(buf, key);\n writeInt64(buf, value);\n }\n\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\n writeString(buf, key);\n writeBool(buf, value);\n }\n\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeNull(buf);\n }\n\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeUndefined(buf);\n }\n\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startMap(buf);\n }\n\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startArray(buf);\n }\n\n function writeFixedNumeric(\n CBORBuffer memory buf,\n uint8 major,\n uint64 value\n ) private pure {\n if (value <= 23) {\n buf.buf.appendUint8(uint8((major << 5) | value));\n } else if (value <= 0xFF) {\n buf.buf.appendUint8(uint8((major << 5) | 24));\n buf.buf.appendInt(value, 1);\n } else if (value <= 0xFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 25));\n buf.buf.appendInt(value, 2);\n } else if (value <= 0xFFFFFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 26));\n buf.buf.appendInt(value, 4);\n } else {\n buf.buf.appendUint8(uint8((major << 5) | 27));\n buf.buf.appendInt(value, 8);\n }\n }\n\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\n private\n pure\n {\n buf.buf.appendUint8(uint8((major << 5) | 31));\n }\n\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\n private\n pure\n {\n writeFixedNumeric(buf, major, length);\n }\n\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\n }\n}" + }, + "@openzeppelin/contracts/access/AccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.20;\n\nimport {IAccessControl} from \"./IAccessControl.sol\";\nimport {Context} from \"../utils/Context.sol\";\nimport {ERC165} from \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account => bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n" + }, + "@openzeppelin/contracts/access/IAccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "contracts/CCGateway.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport './interfaces/ICCGateway.sol';\nimport {ICCGatewayClient} from './interfaces/ICCGatewayClient.sol';\n\nimport {FunctionsClient} from \"@chainlink/contracts/src/v0.8/functions/v1_0_0/FunctionsClient.sol\";\nimport {AccessControl} from \"@openzeppelin/contracts/access/AccessControl.sol\";\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol\";\n\ncontract CCGateway is ICCGateway, FunctionsClient, AccessControl {\n using FunctionsRequest for FunctionsRequest.Request;\n\n bytes32 public constant MANAGER_ROLE = keccak256(\"MANAGER_ROLE\");\n bytes32 public constant CLIENT_ROLE = keccak256(\"CLIENT_ROLE\");\n bytes32 private _donId; // DON ID for the Functions DON to which the requests are sent\n\n mapping(uint64 subscriptionId => CCGRequest) private _requests; // Each subscription can only handle one kind of request\n mapping(bytes32 requestId => ICCGatewayClient.CCGResponse) private unprocessed_responses; // Responses that have not been processed yet\n\n // array of registered subscriptions\n uint64[] public subscriptions;\n\n constructor(address router, bytes32 initialDonId, address initialOwner) FunctionsClient(router) {\n _donId = initialDonId;\n\n address to = address(0) == initialOwner ? _msgSender() : initialOwner;\n _grantRole(DEFAULT_ADMIN_ROLE, to);\n _grantRole(MANAGER_ROLE, to);\n }\n\n /**\n * @dev Set the DON ID\n * @param newDonId New DON ID\n */\n function setDonId(bytes32 newDonId) external onlyRole(getRoleAdmin(MANAGER_ROLE)) {\n _donId = newDonId;\n }\n\n /**\n * @dev Get the DON ID\n * @return DON ID\n */\n function donId() external view returns (bytes32) {\n return _donId;\n }\n\n function registerRequest(\n uint64 subscriptionId,\n FunctionsRequest.Location codeLocation,\n string calldata source,\n FunctionsRequest.Location secretsLocation,\n bytes calldata encryptedSecretsReference,\n uint32 callbackGasLimit,\n string calldata name\n ) external onlyManager {\n if (bytes(name).length == 0) {revert CCGRequestNameEmpty();}\n\n CCGRequest storage req = _requests[subscriptionId];\n if(bytes(req.name).length == 0) {subscriptions.push(subscriptionId);}\n\n req.name = name;\n req.callbackGasLimit = callbackGasLimit;\n\n // Only JavaScript is supported for now\n req.config.language = FunctionsRequest.CodeLanguage.JavaScript;\n req.config.codeLocation = codeLocation;\n req.config.source = source;\n req.config.secretsLocation = secretsLocation;\n req.config.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n function removeRequest(uint64 subscriptionId) external onlyManager {\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n delete _requests[subscriptionId];\n\n // Find the index of the subscriptionId in the subscriptions array\n uint256 index = subscriptions.length;\n for (uint256 i = 0; i < subscriptions.length; i++) {\n if (index == subscriptions.length && subscriptions[i] == subscriptionId) index = i;\n if (index != subscriptions.length && i + 1 < subscriptions.length) subscriptions[i] = subscriptions[i + 1];\n }\n\n subscriptions.pop();\n }\n\n function getRequest(uint64 subscriptionId) external view returns (CCGRequest memory) {\n if (bytes(_requests[subscriptionId].name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n return _requests[subscriptionId];\n }\n// ---------------------------------------------------------------------------------------------------------------------\n modifier onlySource(bytes32 requestId) {\n if (unprocessed_responses[requestId].source != _msgSender()) {revert CCGOnlySameSourceAllowed(requestId);}\n _;\n }\n\n modifier onlyManager() {\n if (!hasRole(MANAGER_ROLE, tx.origin)) {revert CCGOnlyManagerAllowed();}\n _;\n }\n// ---------------------------------------------------------------------------------------------------------------------\n /**\n * @notice Triggers an on-demand Functions request using remote encrypted secrets\n * @param subscriptionId Subscription ID used to pay for request (FunctionsConsumer contract address must first be added to the subscription)\n * @param args String arguments passed into the source code and accessible via the global variable `args`\n * @param bytesArgs Bytes arguments passed into the source code and accessible via the global variable `bytesArgs` as hex strings\n * @param encryptedSecretsReference Reference pointing to encrypted secrets\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external onlyRole(CLIENT_ROLE) returns (bytes32 requestId) {\n CCGRequest storage request = _requests[subscriptionId];\n if (bytes(request.name).length == 0) {revert CCGRequestNotRegistered(subscriptionId);}\n\n FunctionsRequest.Request memory req = request.config;\n req.initializeRequest(req.codeLocation, FunctionsRequest.CodeLanguage.JavaScript, req.source);\n if (encryptedSecretsReference.length > 0) {req.encryptedSecretsReference = encryptedSecretsReference;}\n\n if (args.length > 0) {\n req.setArgs(args);\n }\n if (bytesArgs.length > 0) {\n req.setBytesArgs(bytesArgs);\n }\n\n requestId = _sendRequest(req.encodeCBOR(), subscriptionId, request.callbackGasLimit, _donId);\n unprocessed_responses[requestId].state = ICCGatewayClient.CCGResponseState.Sent;\n unprocessed_responses[requestId].source = _msgSender();\n }\n\n /**\n * @notice Store latest result/error\n * @param requestId The request ID, returned by sendRequest()\n * @param response Aggregated response from the user code\n * @param err Aggregated error from the user code or from the execution pipeline\n * Either response or error parameter will be set, but never both\n */\n function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal override {\n ICCGatewayClient.CCGResponse storage resp = unprocessed_responses[requestId];\n if (resp.state != ICCGatewayClient.CCGResponseState.Sent) {revert CCGRequestAlreadyFulfilled(requestId);}\n\n unprocessed_responses[requestId].state = err.length > 0 ? ICCGatewayClient.CCGResponseState.Error : ICCGatewayClient.CCGResponseState.Success;\n unprocessed_responses[requestId].data = response;\n unprocessed_responses[requestId].error = err;\n\n ICCGatewayClient(resp.source).callback(requestId);\n }\n\n /**\n * @dev Get the response data\n * @param requestId The request ID, returned by sendRequest()\n * @return response CCGResponse\n */\n function getResponse(bytes32 requestId, bool remove) external onlySource(requestId) returns (ICCGatewayClient.CCGResponse memory response) {\n response = unprocessed_responses[requestId];\n if (remove) {delete unprocessed_responses[requestId];}\n }\n}" + }, + "contracts/interfaces/ICCGateway.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\";\n\ninterface ICCGateway {\n struct CCGRequest {\n string name;\n uint32 callbackGasLimit;\n FunctionsRequest.Request config;\n }\n\n /**\n * @dev Can't register a request with an empty name\n */\n error CCGRequestNameEmpty();\n\n /**\n * @dev Only the same source of the requestId is allowed to call the function\n */\n error CCGOnlySameSourceAllowed(bytes32 requestId);\n\n /**\n * @dev Only a registered subscriptionId is allowed to call the function\n */\n error CCGRequestNotRegistered(uint64 subscriptionId);\n\n /**\n * @dev Can't fulfill a request that has already been fulfilled\n */\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\n\n /**\n * @dev Only A manager can call the function\n */\n error CCGOnlyManagerAllowed();\n\n /**\n * @dev Send a request to the Functions DON\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external returns (bytes32 requestId);\n\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\n}\n" + }, + "contracts/interfaces/ICCGatewayClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\ninterface ICCGatewayClient {\n enum CCGResponseState {Sent, Success, Error}\n\n struct CCGResponse {\n uint64 subscriptionId;\n address source;\n CCGResponseState state;\n bytes data;\n bytes error;\n }\n\n function callback(bytes32 requestId) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/sepolia/solcInputs/da2f6e6d8541f69733b0b28912d4a325.json b/packages/hardhat/deployments/sepolia/solcInputs/da2f6e6d8541f69733b0b28912d4a325.json new file mode 100644 index 0000000..0910532 --- /dev/null +++ b/packages/hardhat/deployments/sepolia/solcInputs/da2f6e6d8541f69733b0b28912d4a325.json @@ -0,0 +1,66 @@ +{ + "language": "Solidity", + "sources": { + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Chainlink Functions client interface.\ninterface IFunctionsClient {\n /// @notice Chainlink Functions response handler called by the Functions Router\n /// during fullilment from the designated transmitter node in an OCR round.\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\n /// @param response Aggregated response from the request's source code.\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\n /// @dev Either response or error parameter will be set, but never both.\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {FunctionsResponse} from \"../libraries/FunctionsResponse.sol\";\n\n/// @title Chainlink Functions Router interface.\ninterface IFunctionsRouter {\n /// @notice The identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n /// @return id - bytes32 id that can be passed to the \"getContractById\" of the Router\n function getAllowListId() external view returns (bytes32);\n\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n function setAllowListId(bytes32 allowListId) external;\n\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\n /// @return adminFee\n function getAdminFee() external view returns (uint72 adminFee);\n\n /// @notice Sends a request using the provided subscriptionId\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequest(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Sends a request to the proposed contracts\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequestToProposed(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Fulfill the request by:\n /// - calling back the data that the Oracle returned to the client contract\n /// - pay the DON for processing the request\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\n /// @param response response data from DON consensus\n /// @param err error from DON consensus\n /// @param juelsPerGas - current rate of juels/gas\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\n /// @param transmitter - The Node that transmitted the OCR report\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\n /// @return fulfillResult -\n /// @return callbackGasCostJuels -\n function fulfill(\n bytes memory response,\n bytes memory err,\n uint96 juelsPerGas,\n uint96 costWithoutFulfillment,\n address transmitter,\n FunctionsResponse.Commitment memory commitment\n ) external returns (FunctionsResponse.FulfillResult, uint96);\n\n /// @notice Validate requested gas limit is below the subscription max.\n /// @param subscriptionId subscription ID\n /// @param callbackGasLimit desired callback gas limit\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\n\n /// @notice Get the current contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current contract address\n function getContractById(bytes32 id) external view returns (address);\n\n /// @notice Get the proposed next contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current or proposed contract address\n function getProposedContractById(bytes32 id) external view returns (address);\n\n /// @notice Return the latest proprosal set\n /// @return ids The identifiers of the contracts to update\n /// @return to The addresses of the contracts that will be updated to\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\n\n /// @notice Proposes one or more updates to the contract routes\n /// @dev Only callable by owner\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\n\n /// @notice Updates the current contract routes to the proposed contracts\n /// @dev Only callable by owner\n function updateContracts() external;\n\n /// @dev Puts the system into an emergency stopped state.\n /// @dev Only callable by owner\n function pause() external;\n\n /// @dev Takes the system out of an emergency stopped state.\n /// @dev Only callable by owner\n function unpause() external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {CBOR} from \"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\";\n\n/// @title Library for encoding the input data of a Functions request into CBOR\nlibrary FunctionsRequest {\n using CBOR for CBOR.CBORBuffer;\n\n uint16 public constant REQUEST_DATA_VERSION = 1;\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\n\n enum Location {\n Inline, // Provided within the Request\n Remote, // Hosted through remote location that can be accessed through a provided URL\n DONHosted // Hosted on the DON's storage\n }\n\n enum CodeLanguage {\n JavaScript\n // In future version we may add other languages\n }\n\n struct Request {\n Location codeLocation; // ════════════╸ The location of the source code that will be executed on each node in the DON\n Location secretsLocation; // ═════════╸ The location of secrets that will be passed into the source code. *Only Remote secrets are supported\n CodeLanguage language; // ════════════╸ The coding language that the source code is written in\n string source; // ════════════════════╸ Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\n bytes encryptedSecretsReference; // ══╸ Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\n string[] args; // ════════════════════╸ String arguments that will be passed into the source code\n bytes[] bytesArgs; // ════════════════╸ Bytes arguments that will be passed into the source code\n }\n\n error EmptySource();\n error EmptySecrets();\n error EmptyArgs();\n error NoInlineSecrets();\n\n /// @notice Encodes a Request to CBOR encoded bytes\n /// @param self The request to encode\n /// @return CBOR encoded bytes\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"codeLocation\");\n buffer.writeUInt256(uint256(self.codeLocation));\n\n buffer.writeString(\"language\");\n buffer.writeUInt256(uint256(self.language));\n\n buffer.writeString(\"source\");\n buffer.writeString(self.source);\n\n if (self.args.length > 0) {\n buffer.writeString(\"args\");\n buffer.startArray();\n for (uint256 i = 0; i < self.args.length; ++i) {\n buffer.writeString(self.args[i]);\n }\n buffer.endSequence();\n }\n\n if (self.encryptedSecretsReference.length > 0) {\n if (self.secretsLocation == Location.Inline) {\n revert NoInlineSecrets();\n }\n buffer.writeString(\"secretsLocation\");\n buffer.writeUInt256(uint256(self.secretsLocation));\n buffer.writeString(\"secrets\");\n buffer.writeBytes(self.encryptedSecretsReference);\n }\n\n if (self.bytesArgs.length > 0) {\n buffer.writeString(\"bytesArgs\");\n buffer.startArray();\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\n buffer.writeBytes(self.bytesArgs[i]);\n }\n buffer.endSequence();\n }\n\n return buffer.buf.buf;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Sets the codeLocation and code on the request\n /// @param self The uninitialized request\n /// @param codeLocation The user provided source code location\n /// @param language The programming language of the user code\n /// @param source The user provided source code or a url\n function initializeRequest(\n Request memory self,\n Location codeLocation,\n CodeLanguage language,\n string memory source\n ) internal pure {\n if (bytes(source).length == 0) revert EmptySource();\n\n self.codeLocation = codeLocation;\n self.language = language;\n self.source = source;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Simplified version of initializeRequest for PoC\n /// @param self The uninitialized request\n /// @param javaScriptSource The user provided JS code (must not be empty)\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\n }\n\n /// @notice Adds Remote user encrypted secrets to a Request\n /// @param self The initialized request\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\n\n self.secretsLocation = Location.Remote;\n self.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n /// @notice Adds DON-hosted secrets reference to a Request\n /// @param self The initialized request\n /// @param slotID Slot ID of the user's secrets hosted on DON\n /// @param version User data version (for the slotID)\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"slotID\");\n buffer.writeUInt64(slotID);\n buffer.writeString(\"version\");\n buffer.writeUInt64(version);\n\n self.secretsLocation = Location.DONHosted;\n self.encryptedSecretsReference = buffer.buf.buf;\n }\n\n /// @notice Sets args for the user run function\n /// @param self The initialized request\n /// @param args The array of string args (must not be empty)\n function setArgs(Request memory self, string[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.args = args;\n }\n\n /// @notice Sets bytes args for the user run function\n /// @param self The initialized request\n /// @param args The array of bytes args (must not be empty)\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.bytesArgs = args;\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Library of types that are used for fulfillment of a Functions request\nlibrary FunctionsResponse {\n // Used to send request information from the Router to the Coordinator\n struct RequestMeta {\n bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\n bytes32 flags; // ═══════════════╸ Per-subscription flags\n address requestingContract; // ══╗ The client contract that is sending the request\n uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\n uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint64 initiatedRequests; // β•‘ The number of requests that have been started\n uint32 callbackGasLimit; // β•‘ The amount of gas that the callback to the consuming contract will be given\n uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data\n uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out\n address subscriptionOwner; // ═══╝ The owner of the billing subscription\n }\n\n enum FulfillResult {\n FULFILLED, // 0\n USER_CALLBACK_ERROR, // 1\n INVALID_REQUEST_ID, // 2\n COST_EXCEEDS_COMMITMENT, // 3\n INSUFFICIENT_GAS_PROVIDED, // 4\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\n INVALID_COMMITMENT // 6\n }\n\n struct Commitment {\n bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request\n address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request\n uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\n address client; // ════════════════════╗ The client contract that sent the request\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given\n uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint72 donFee; // β•‘ Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\n uint40 gasOverheadBeforeCallback; // β•‘ Represents the average gas execution cost before the fulfillment callback.\n uint40 gasOverheadAfterCallback; // β•‘ Represents the average gas execution cost after the fulfillment callback.\n uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"../v1_0_0/interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"../v1_0_0/interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"../v1_0_0/libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_functionsRouter;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_functionsRouter = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_functionsRouter.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_functionsRouter)) {\n revert OnlyRouterCanFulfill();\n }\n _fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}" + }, + "@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../@ensdomains/buffer/v0.1.0/Buffer.sol\";\n\n/**\n* @dev A library for populating CBOR encoded payload in Solidity.\n*\n* https://datatracker.ietf.org/doc/html/rfc7049\n*\n* The library offers various write* and start* methods to encode values of different types.\n* The resulted buffer can be obtained with data() method.\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\n* in an invalid CBOR if start/write/end flow is violated.\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\n* except for nested start/end pairs.\n*/\n\nlibrary CBOR {\n using Buffer for Buffer.buffer;\n\n struct CBORBuffer {\n Buffer.buffer buf;\n uint256 depth;\n }\n\n uint8 private constant MAJOR_TYPE_INT = 0;\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\n uint8 private constant MAJOR_TYPE_BYTES = 2;\n uint8 private constant MAJOR_TYPE_STRING = 3;\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\n uint8 private constant MAJOR_TYPE_MAP = 5;\n uint8 private constant MAJOR_TYPE_TAG = 6;\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\n\n uint8 private constant TAG_TYPE_BIGNUM = 2;\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\n\n uint8 private constant CBOR_FALSE = 20;\n uint8 private constant CBOR_TRUE = 21;\n uint8 private constant CBOR_NULL = 22;\n uint8 private constant CBOR_UNDEFINED = 23;\n\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\n Buffer.init(cbor.buf, capacity);\n cbor.depth = 0;\n return cbor;\n }\n\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\n require(buf.depth == 0, \"Invalid CBOR\");\n return buf.buf.buf;\n }\n\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\n writeBytes(buf, abi.encode(value));\n }\n\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\n if (value < 0) {\n buf.buf.appendUint8(\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\n );\n writeBytes(buf, abi.encode(uint256(-1 - value)));\n } else {\n writeUInt256(buf, uint256(value));\n }\n }\n\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\n }\n\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\n if(value >= 0) {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\n } else{\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\n }\n }\n\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\n buf.buf.append(value);\n }\n\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\n buf.buf.append(bytes(value));\n }\n\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\n }\n\n function writeNull(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_NULL);\n }\n\n function writeUndefined(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_UNDEFINED);\n }\n\n function startArray(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\n buf.depth += 1;\n }\n\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\n }\n\n function startMap(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\n buf.depth += 1;\n }\n\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\n }\n\n function endSequence(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\n buf.depth -= 1;\n }\n\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\n writeString(buf, key);\n writeString(buf, value);\n }\n\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\n writeString(buf, key);\n writeBytes(buf, value);\n }\n\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\n writeString(buf, key);\n writeUInt256(buf, value);\n }\n\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\n writeString(buf, key);\n writeInt256(buf, value);\n }\n\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\n writeString(buf, key);\n writeUInt64(buf, value);\n }\n\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\n writeString(buf, key);\n writeInt64(buf, value);\n }\n\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\n writeString(buf, key);\n writeBool(buf, value);\n }\n\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeNull(buf);\n }\n\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeUndefined(buf);\n }\n\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startMap(buf);\n }\n\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startArray(buf);\n }\n\n function writeFixedNumeric(\n CBORBuffer memory buf,\n uint8 major,\n uint64 value\n ) private pure {\n if (value <= 23) {\n buf.buf.appendUint8(uint8((major << 5) | value));\n } else if (value <= 0xFF) {\n buf.buf.appendUint8(uint8((major << 5) | 24));\n buf.buf.appendInt(value, 1);\n } else if (value <= 0xFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 25));\n buf.buf.appendInt(value, 2);\n } else if (value <= 0xFFFFFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 26));\n buf.buf.appendInt(value, 4);\n } else {\n buf.buf.appendUint8(uint8((major << 5) | 27));\n buf.buf.appendInt(value, 8);\n }\n }\n\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\n private\n pure\n {\n buf.buf.appendUint8(uint8((major << 5) | 31));\n }\n\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\n private\n pure\n {\n writeFixedNumeric(buf, major, length);\n }\n\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\n }\n}" + }, + "contracts/CCExampleClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from \"./interfaces/ICCGatewayClient.sol\";\nimport {ICCGateway} from \"./interfaces/ICCGateway.sol\";\n\ncontract CCExampleClient is ICCGatewayClient {\n ICCGateway private immutable gateway;\n\n uint64 public subscriptionId = 0;\n bytes public encryptedSecretsReference = \"\";\n\n event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response);\n event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error);\n\n constructor(address gatewayAddress) {\n gateway = ICCGateway(gatewayAddress);\n }\n\n function updateSubscriptionId(uint64 _subscriptionId) external {\n subscriptionId = _subscriptionId;\n }\n\n function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external {\n encryptedSecretsReference = _encryptedSecretsReference;\n }\n\n function request(string[] calldata args, bytes[] calldata bytesArgs) external {\n require(subscriptionId != 0, \"Subscription ID not set\");\n\n gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference);\n }\n\n function callback(bytes32 requestId) external override {\n ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true);\n\n if (response.state == ICCGatewayClient.CCGResponseState.Success) {\n emit ResponseReceived(response.subscriptionId, requestId, string(response.data));\n } else {\n emit ErrorReceived(response.subscriptionId, requestId, string(response.error));\n }\n }\n}\n" + }, + "contracts/CCNotificationClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {CCExampleClient} from \"./CCExampleClient.sol\";\n\ncontract CCNotificationClient is CCExampleClient {\n constructor(address gatewayAddress) CCExampleClient(gatewayAddress) {}\n}\n" + }, + "contracts/interfaces/ICCGateway.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\";\n\ninterface ICCGateway {\n struct CCGRequest {\n string name;\n uint32 callbackGasLimit;\n FunctionsRequest.Request config;\n }\n\n /**\n * @dev Can't register a request with an empty name\n */\n error CCGRequestNameEmpty();\n\n /**\n * @dev Only the same source of the requestId is allowed to call the function\n */\n error CCGOnlySameSourceAllowed(bytes32 requestId);\n\n /**\n * @dev Only a registered subscriptionId is allowed to call the function\n */\n error CCGRequestNotRegistered(uint64 subscriptionId);\n\n /**\n * @dev Can't fulfill a request that has already been fulfilled\n */\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\n\n /**\n * @dev Only A manager can call the function\n */\n error CCGOnlyManagerAllowed();\n\n /**\n * @dev Send a request to the Functions DON\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external returns (bytes32 requestId);\n\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\n}\n" + }, + "contracts/interfaces/ICCGatewayClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\ninterface ICCGatewayClient {\n enum CCGResponseState {Sent, Success, Error}\n\n struct CCGResponse {\n uint64 subscriptionId;\n address source;\n CCGResponseState state;\n bytes data;\n bytes error;\n }\n\n function callback(bytes32 requestId) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/hardhat/deployments/sepolia/solcInputs/fc0de00091a2e0264aed2d3e71476d4f.json b/packages/hardhat/deployments/sepolia/solcInputs/fc0de00091a2e0264aed2d3e71476d4f.json new file mode 100644 index 0000000..0b0fb2b --- /dev/null +++ b/packages/hardhat/deployments/sepolia/solcInputs/fc0de00091a2e0264aed2d3e71476d4f.json @@ -0,0 +1,63 @@ +{ + "language": "Solidity", + "sources": { + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Chainlink Functions client interface.\ninterface IFunctionsClient {\n /// @notice Chainlink Functions response handler called by the Functions Router\n /// during fullilment from the designated transmitter node in an OCR round.\n /// @param requestId The requestId returned by FunctionsClient.sendRequest().\n /// @param response Aggregated response from the request's source code.\n /// @param err Aggregated error either from the request's source code or from the execution pipeline.\n /// @dev Either response or error parameter will be set, but never both.\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/interfaces/IFunctionsRouter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {FunctionsResponse} from \"../libraries/FunctionsResponse.sol\";\n\n/// @title Chainlink Functions Router interface.\ninterface IFunctionsRouter {\n /// @notice The identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n /// @return id - bytes32 id that can be passed to the \"getContractById\" of the Router\n function getAllowListId() external view returns (bytes32);\n\n /// @notice Set the identifier of the route to retrieve the address of the access control contract\n /// The access control contract controls which accounts can manage subscriptions\n function setAllowListId(bytes32 allowListId) external;\n\n /// @notice Get the flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network\n /// @return adminFee\n function getAdminFee() external view returns (uint72 adminFee);\n\n /// @notice Sends a request using the provided subscriptionId\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequest(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Sends a request to the proposed contracts\n /// @param subscriptionId - A unique subscription ID allocated by billing system,\n /// a client can make requests from different contracts referencing the same subscription\n /// @param data - CBOR encoded Chainlink Functions request data, use FunctionsClient API to encode a request\n /// @param dataVersion - Gas limit for the fulfillment callback\n /// @param callbackGasLimit - Gas limit for the fulfillment callback\n /// @param donId - An identifier used to determine which route to send the request along\n /// @return requestId - A unique request identifier\n function sendRequestToProposed(\n uint64 subscriptionId,\n bytes calldata data,\n uint16 dataVersion,\n uint32 callbackGasLimit,\n bytes32 donId\n ) external returns (bytes32);\n\n /// @notice Fulfill the request by:\n /// - calling back the data that the Oracle returned to the client contract\n /// - pay the DON for processing the request\n /// @dev Only callable by the Coordinator contract that is saved in the commitment\n /// @param response response data from DON consensus\n /// @param err error from DON consensus\n /// @param juelsPerGas - current rate of juels/gas\n /// @param costWithoutFulfillment - The cost of processing the request (in Juels of LINK ), without fulfillment\n /// @param transmitter - The Node that transmitted the OCR report\n /// @param commitment - The parameters of the request that must be held consistent between request and response time\n /// @return fulfillResult -\n /// @return callbackGasCostJuels -\n function fulfill(\n bytes memory response,\n bytes memory err,\n uint96 juelsPerGas,\n uint96 costWithoutFulfillment,\n address transmitter,\n FunctionsResponse.Commitment memory commitment\n ) external returns (FunctionsResponse.FulfillResult, uint96);\n\n /// @notice Validate requested gas limit is below the subscription max.\n /// @param subscriptionId subscription ID\n /// @param callbackGasLimit desired callback gas limit\n function isValidCallbackGasLimit(uint64 subscriptionId, uint32 callbackGasLimit) external view;\n\n /// @notice Get the current contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current contract address\n function getContractById(bytes32 id) external view returns (address);\n\n /// @notice Get the proposed next contract given an ID\n /// @param id A bytes32 identifier for the route\n /// @return contract The current or proposed contract address\n function getProposedContractById(bytes32 id) external view returns (address);\n\n /// @notice Return the latest proprosal set\n /// @return ids The identifiers of the contracts to update\n /// @return to The addresses of the contracts that will be updated to\n function getProposedContractSet() external view returns (bytes32[] memory, address[] memory);\n\n /// @notice Proposes one or more updates to the contract routes\n /// @dev Only callable by owner\n function proposeContractsUpdate(bytes32[] memory proposalSetIds, address[] memory proposalSetAddresses) external;\n\n /// @notice Updates the current contract routes to the proposed contracts\n /// @dev Only callable by owner\n function updateContracts() external;\n\n /// @dev Puts the system into an emergency stopped state.\n /// @dev Only callable by owner\n function pause() external;\n\n /// @dev Takes the system out of an emergency stopped state.\n /// @dev Only callable by owner\n function unpause() external;\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsRequest.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {CBOR} from \"../../../vendor/solidity-cborutils/v2.0.0/CBOR.sol\";\n\n/// @title Library for encoding the input data of a Functions request into CBOR\nlibrary FunctionsRequest {\n using CBOR for CBOR.CBORBuffer;\n\n uint16 public constant REQUEST_DATA_VERSION = 1;\n uint256 internal constant DEFAULT_BUFFER_SIZE = 256;\n\n enum Location {\n Inline, // Provided within the Request\n Remote, // Hosted through remote location that can be accessed through a provided URL\n DONHosted // Hosted on the DON's storage\n }\n\n enum CodeLanguage {\n JavaScript\n // In future version we may add other languages\n }\n\n struct Request {\n Location codeLocation; // ════════════╸ The location of the source code that will be executed on each node in the DON\n Location secretsLocation; // ═════════╸ The location of secrets that will be passed into the source code. *Only Remote secrets are supported\n CodeLanguage language; // ════════════╸ The coding language that the source code is written in\n string source; // ════════════════════╸ Raw source code for Request.codeLocation of Location.Inline, URL for Request.codeLocation of Location.Remote, or slot decimal number for Request.codeLocation of Location.DONHosted\n bytes encryptedSecretsReference; // ══╸ Encrypted URLs for Request.secretsLocation of Location.Remote (use addSecretsReference()), or CBOR encoded slotid+version for Request.secretsLocation of Location.DONHosted (use addDONHostedSecrets())\n string[] args; // ════════════════════╸ String arguments that will be passed into the source code\n bytes[] bytesArgs; // ════════════════╸ Bytes arguments that will be passed into the source code\n }\n\n error EmptySource();\n error EmptySecrets();\n error EmptyArgs();\n error NoInlineSecrets();\n\n /// @notice Encodes a Request to CBOR encoded bytes\n /// @param self The request to encode\n /// @return CBOR encoded bytes\n function encodeCBOR(Request memory self) internal pure returns (bytes memory) {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"codeLocation\");\n buffer.writeUInt256(uint256(self.codeLocation));\n\n buffer.writeString(\"language\");\n buffer.writeUInt256(uint256(self.language));\n\n buffer.writeString(\"source\");\n buffer.writeString(self.source);\n\n if (self.args.length > 0) {\n buffer.writeString(\"args\");\n buffer.startArray();\n for (uint256 i = 0; i < self.args.length; ++i) {\n buffer.writeString(self.args[i]);\n }\n buffer.endSequence();\n }\n\n if (self.encryptedSecretsReference.length > 0) {\n if (self.secretsLocation == Location.Inline) {\n revert NoInlineSecrets();\n }\n buffer.writeString(\"secretsLocation\");\n buffer.writeUInt256(uint256(self.secretsLocation));\n buffer.writeString(\"secrets\");\n buffer.writeBytes(self.encryptedSecretsReference);\n }\n\n if (self.bytesArgs.length > 0) {\n buffer.writeString(\"bytesArgs\");\n buffer.startArray();\n for (uint256 i = 0; i < self.bytesArgs.length; ++i) {\n buffer.writeBytes(self.bytesArgs[i]);\n }\n buffer.endSequence();\n }\n\n return buffer.buf.buf;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Sets the codeLocation and code on the request\n /// @param self The uninitialized request\n /// @param codeLocation The user provided source code location\n /// @param language The programming language of the user code\n /// @param source The user provided source code or a url\n function initializeRequest(\n Request memory self,\n Location codeLocation,\n CodeLanguage language,\n string memory source\n ) internal pure {\n if (bytes(source).length == 0) revert EmptySource();\n\n self.codeLocation = codeLocation;\n self.language = language;\n self.source = source;\n }\n\n /// @notice Initializes a Chainlink Functions Request\n /// @dev Simplified version of initializeRequest for PoC\n /// @param self The uninitialized request\n /// @param javaScriptSource The user provided JS code (must not be empty)\n function initializeRequestForInlineJavaScript(Request memory self, string memory javaScriptSource) internal pure {\n initializeRequest(self, Location.Inline, CodeLanguage.JavaScript, javaScriptSource);\n }\n\n /// @notice Adds Remote user encrypted secrets to a Request\n /// @param self The initialized request\n /// @param encryptedSecretsReference Encrypted comma-separated string of URLs pointing to off-chain secrets\n function addSecretsReference(Request memory self, bytes memory encryptedSecretsReference) internal pure {\n if (encryptedSecretsReference.length == 0) revert EmptySecrets();\n\n self.secretsLocation = Location.Remote;\n self.encryptedSecretsReference = encryptedSecretsReference;\n }\n\n /// @notice Adds DON-hosted secrets reference to a Request\n /// @param self The initialized request\n /// @param slotID Slot ID of the user's secrets hosted on DON\n /// @param version User data version (for the slotID)\n function addDONHostedSecrets(Request memory self, uint8 slotID, uint64 version) internal pure {\n CBOR.CBORBuffer memory buffer = CBOR.create(DEFAULT_BUFFER_SIZE);\n\n buffer.writeString(\"slotID\");\n buffer.writeUInt64(slotID);\n buffer.writeString(\"version\");\n buffer.writeUInt64(version);\n\n self.secretsLocation = Location.DONHosted;\n self.encryptedSecretsReference = buffer.buf.buf;\n }\n\n /// @notice Sets args for the user run function\n /// @param self The initialized request\n /// @param args The array of string args (must not be empty)\n function setArgs(Request memory self, string[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.args = args;\n }\n\n /// @notice Sets bytes args for the user run function\n /// @param self The initialized request\n /// @param args The array of bytes args (must not be empty)\n function setBytesArgs(Request memory self, bytes[] memory args) internal pure {\n if (args.length == 0) revert EmptyArgs();\n\n self.bytesArgs = args;\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_0_0/libraries/FunctionsResponse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title Library of types that are used for fulfillment of a Functions request\nlibrary FunctionsResponse {\n // Used to send request information from the Router to the Coordinator\n struct RequestMeta {\n bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request data, use FunctionsRequest library to encode a request\n bytes32 flags; // ═══════════════╸ Per-subscription flags\n address requestingContract; // ══╗ The client contract that is sending the request\n uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the Router to be used for all consumer requests.\n uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint64 initiatedRequests; // β•‘ The number of requests that have been started\n uint32 callbackGasLimit; // β•‘ The amount of gas that the callback to the consuming contract will be given\n uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data\n uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out\n address subscriptionOwner; // ═══╝ The owner of the billing subscription\n }\n\n enum FulfillResult {\n FULFILLED, // 0\n USER_CALLBACK_ERROR, // 1\n INVALID_REQUEST_ID, // 2\n COST_EXCEEDS_COMMITMENT, // 3\n INSUFFICIENT_GAS_PROVIDED, // 4\n SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5\n INVALID_COMMITMENT // 6\n }\n\n struct Commitment {\n bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request\n address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request\n uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to fulfill a request\n address client; // ════════════════════╗ The client contract that sent the request\n uint64 subscriptionId; // β•‘ Identifier of the billing subscription that will be charged for the request\n uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given\n uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that will be paid to the Router Owner for operation of the network\n uint72 donFee; // β•‘ Fee (in Juels of LINK) that will be split between Node Operators for servicing a request\n uint40 gasOverheadBeforeCallback; // β•‘ Represents the average gas execution cost before the fulfillment callback.\n uint40 gasOverheadAfterCallback; // β•‘ Represents the average gas execution cost after the fulfillment callback.\n uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\nimport {IFunctionsRouter} from \"../v1_0_0/interfaces/IFunctionsRouter.sol\";\nimport {IFunctionsClient} from \"../v1_0_0/interfaces/IFunctionsClient.sol\";\n\nimport {FunctionsRequest} from \"../v1_0_0/libraries/FunctionsRequest.sol\";\n\n/// @title The Chainlink Functions client contract\n/// @notice Contract developers can inherit this contract in order to make Chainlink Functions requests\nabstract contract FunctionsClient is IFunctionsClient {\n using FunctionsRequest for FunctionsRequest.Request;\n\n IFunctionsRouter internal immutable i_functionsRouter;\n\n event RequestSent(bytes32 indexed id);\n event RequestFulfilled(bytes32 indexed id);\n\n error OnlyRouterCanFulfill();\n\n constructor(address router) {\n i_functionsRouter = IFunctionsRouter(router);\n }\n\n /// @notice Sends a Chainlink Functions request\n /// @param data The CBOR encoded bytes data for a Functions request\n /// @param subscriptionId The subscription ID that will be charged to service the request\n /// @param callbackGasLimit the amount of gas that will be available for the fulfillment callback\n /// @return requestId The generated request ID for this request\n function _sendRequest(\n bytes memory data,\n uint64 subscriptionId,\n uint32 callbackGasLimit,\n bytes32 donId\n ) internal returns (bytes32) {\n bytes32 requestId = i_functionsRouter.sendRequest(\n subscriptionId,\n data,\n FunctionsRequest.REQUEST_DATA_VERSION,\n callbackGasLimit,\n donId\n );\n emit RequestSent(requestId);\n return requestId;\n }\n\n /// @notice User defined function to handle a response from the DON\n /// @param requestId The request ID, returned by sendRequest()\n /// @param response Aggregated response from the execution of the user's source code\n /// @param err Aggregated error from the execution of the user code or from the execution pipeline\n /// @dev Either response or error parameter will be set, but never both\n function _fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal virtual;\n\n /// @inheritdoc IFunctionsClient\n function handleOracleFulfillment(bytes32 requestId, bytes memory response, bytes memory err) external override {\n if (msg.sender != address(i_functionsRouter)) {\n revert OnlyRouterCanFulfill();\n }\n _fulfillRequest(requestId, response, err);\n emit RequestFulfilled(requestId);\n }\n}\n" + }, + "@chainlink/contracts/src/v0.8/vendor/@ensdomains/buffer/v0.1.0/Buffer.sol": { + "content": "// SPDX-License-Identifier: BSD-2-Clause\npragma solidity ^0.8.4;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for appending to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n /**\n * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n * a capacity. The capacity may be longer than the current value, in\n * which case it can be extended without the need to allocate more memory.\n */\n struct buffer {\n bytes buf;\n uint capacity;\n }\n\n /**\n * @dev Initializes a buffer with an initial capacity.\n * @param buf The buffer to initialize.\n * @param capacity The number of bytes of space to allocate the buffer.\n * @return The buffer, for chaining.\n */\n function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n if (capacity % 32 != 0) {\n capacity += 32 - (capacity % 32);\n }\n // Allocate space for the buffer data\n buf.capacity = capacity;\n assembly {\n let ptr := mload(0x40)\n mstore(buf, ptr)\n mstore(ptr, 0)\n let fpm := add(32, add(ptr, capacity))\n if lt(fpm, ptr) {\n revert(0, 0)\n }\n mstore(0x40, fpm)\n }\n return buf;\n }\n\n /**\n * @dev Initializes a new buffer from an existing bytes object.\n * Changes to the buffer may mutate the original value.\n * @param b The bytes object to initialize the buffer with.\n * @return A new buffer.\n */\n function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n buffer memory buf;\n buf.buf = b;\n buf.capacity = b.length;\n return buf;\n }\n\n function resize(buffer memory buf, uint capacity) private pure {\n bytes memory oldbuf = buf.buf;\n init(buf, capacity);\n append(buf, oldbuf);\n }\n\n /**\n * @dev Sets buffer length to 0.\n * @param buf The buffer to truncate.\n * @return The original buffer, for chaining..\n */\n function truncate(buffer memory buf) internal pure returns (buffer memory) {\n assembly {\n let bufptr := mload(buf)\n mstore(bufptr, 0)\n }\n return buf;\n }\n\n /**\n * @dev Appends len bytes of a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to copy.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data, uint len) internal pure returns(buffer memory) {\n require(len <= data.length);\n\n uint off = buf.buf.length;\n uint newCapacity = off + len;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint dest;\n uint src;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Length of existing buffer data\n let buflen := mload(bufptr)\n // Start address = buffer address + offset + sizeof(buffer length)\n dest := add(add(bufptr, 32), off)\n // Update buffer length if we're extending it\n if gt(newCapacity, buflen) {\n mstore(bufptr, newCapacity)\n }\n src := add(data, 32)\n }\n\n // Copy word-length chunks while possible\n for (; len >= 32; len -= 32) {\n assembly {\n mstore(dest, mload(src))\n }\n dest += 32;\n src += 32;\n }\n\n // Copy remaining bytes\n unchecked {\n uint mask = (256 ** (32 - len)) - 1;\n assembly {\n let srcpart := and(mload(src), not(mask))\n let destpart := and(mload(dest), mask)\n mstore(dest, or(destpart, srcpart))\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n return append(buf, data, data.length);\n }\n\n /**\n * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n * capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint offPlusOne = off + 1;\n if (off >= buf.capacity) {\n resize(buf, offPlusOne * 2);\n }\n\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + off\n let dest := add(add(bufptr, off), 32)\n mstore8(dest, data)\n // Update buffer length if we extended it\n if gt(offPlusOne, mload(bufptr)) {\n mstore(bufptr, offPlusOne)\n }\n }\n\n return buf;\n }\n\n /**\n * @dev Appends len bytes of bytes32 to a buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (left-aligned).\n * @return The original buffer, for chaining.\n */\n function append(buffer memory buf, bytes32 data, uint len) private pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n unchecked {\n uint mask = (256 ** len) - 1;\n // Right-align data\n data = data >> (8 * (32 - len));\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n }\n return buf;\n }\n\n /**\n * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chhaining.\n */\n function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n return append(buf, bytes32(data), 20);\n }\n\n /**\n * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n * the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @return The original buffer, for chaining.\n */\n function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n return append(buf, data, 32);\n }\n\n /**\n * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n * exceed the capacity of the buffer.\n * @param buf The buffer to append to.\n * @param data The data to append.\n * @param len The number of bytes to write (right-aligned).\n * @return The original buffer.\n */\n function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n uint off = buf.buf.length;\n uint newCapacity = len + off;\n if (newCapacity > buf.capacity) {\n resize(buf, newCapacity * 2);\n }\n\n uint mask = (256 ** len) - 1;\n assembly {\n // Memory address of the buffer data\n let bufptr := mload(buf)\n // Address = buffer address + sizeof(buffer length) + newCapacity\n let dest := add(bufptr, newCapacity)\n mstore(dest, or(and(mload(dest), not(mask)), data))\n // Update buffer length if we extended it\n if gt(newCapacity, mload(bufptr)) {\n mstore(bufptr, newCapacity)\n }\n }\n return buf;\n }\n}" + }, + "@chainlink/contracts/src/v0.8/vendor/solidity-cborutils/v2.0.0/CBOR.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../@ensdomains/buffer/v0.1.0/Buffer.sol\";\n\n/**\n* @dev A library for populating CBOR encoded payload in Solidity.\n*\n* https://datatracker.ietf.org/doc/html/rfc7049\n*\n* The library offers various write* and start* methods to encode values of different types.\n* The resulted buffer can be obtained with data() method.\n* Encoding of primitive types is staightforward, whereas encoding of sequences can result\n* in an invalid CBOR if start/write/end flow is violated.\n* For the purpose of gas saving, the library does not verify start/write/end flow internally,\n* except for nested start/end pairs.\n*/\n\nlibrary CBOR {\n using Buffer for Buffer.buffer;\n\n struct CBORBuffer {\n Buffer.buffer buf;\n uint256 depth;\n }\n\n uint8 private constant MAJOR_TYPE_INT = 0;\n uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;\n uint8 private constant MAJOR_TYPE_BYTES = 2;\n uint8 private constant MAJOR_TYPE_STRING = 3;\n uint8 private constant MAJOR_TYPE_ARRAY = 4;\n uint8 private constant MAJOR_TYPE_MAP = 5;\n uint8 private constant MAJOR_TYPE_TAG = 6;\n uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;\n\n uint8 private constant TAG_TYPE_BIGNUM = 2;\n uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;\n\n uint8 private constant CBOR_FALSE = 20;\n uint8 private constant CBOR_TRUE = 21;\n uint8 private constant CBOR_NULL = 22;\n uint8 private constant CBOR_UNDEFINED = 23;\n\n function create(uint256 capacity) internal pure returns(CBORBuffer memory cbor) {\n Buffer.init(cbor.buf, capacity);\n cbor.depth = 0;\n return cbor;\n }\n\n function data(CBORBuffer memory buf) internal pure returns(bytes memory) {\n require(buf.depth == 0, \"Invalid CBOR\");\n return buf.buf.buf;\n }\n\n function writeUInt256(CBORBuffer memory buf, uint256 value) internal pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));\n writeBytes(buf, abi.encode(value));\n }\n\n function writeInt256(CBORBuffer memory buf, int256 value) internal pure {\n if (value < 0) {\n buf.buf.appendUint8(\n uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM)\n );\n writeBytes(buf, abi.encode(uint256(-1 - value)));\n } else {\n writeUInt256(buf, uint256(value));\n }\n }\n\n function writeUInt64(CBORBuffer memory buf, uint64 value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, value);\n }\n\n function writeInt64(CBORBuffer memory buf, int64 value) internal pure {\n if(value >= 0) {\n writeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));\n } else{\n writeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(-1 - value));\n }\n }\n\n function writeBytes(CBORBuffer memory buf, bytes memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));\n buf.buf.append(value);\n }\n\n function writeString(CBORBuffer memory buf, string memory value) internal pure {\n writeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));\n buf.buf.append(bytes(value));\n }\n\n function writeBool(CBORBuffer memory buf, bool value) internal pure {\n writeContentFree(buf, value ? CBOR_TRUE : CBOR_FALSE);\n }\n\n function writeNull(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_NULL);\n }\n\n function writeUndefined(CBORBuffer memory buf) internal pure {\n writeContentFree(buf, CBOR_UNDEFINED);\n }\n\n function startArray(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);\n buf.depth += 1;\n }\n\n function startFixedArray(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_ARRAY, length);\n }\n\n function startMap(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);\n buf.depth += 1;\n }\n\n function startFixedMap(CBORBuffer memory buf, uint64 length) internal pure {\n writeDefiniteLengthType(buf, MAJOR_TYPE_MAP, length);\n }\n\n function endSequence(CBORBuffer memory buf) internal pure {\n writeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);\n buf.depth -= 1;\n }\n\n function writeKVString(CBORBuffer memory buf, string memory key, string memory value) internal pure {\n writeString(buf, key);\n writeString(buf, value);\n }\n\n function writeKVBytes(CBORBuffer memory buf, string memory key, bytes memory value) internal pure {\n writeString(buf, key);\n writeBytes(buf, value);\n }\n\n function writeKVUInt256(CBORBuffer memory buf, string memory key, uint256 value) internal pure {\n writeString(buf, key);\n writeUInt256(buf, value);\n }\n\n function writeKVInt256(CBORBuffer memory buf, string memory key, int256 value) internal pure {\n writeString(buf, key);\n writeInt256(buf, value);\n }\n\n function writeKVUInt64(CBORBuffer memory buf, string memory key, uint64 value) internal pure {\n writeString(buf, key);\n writeUInt64(buf, value);\n }\n\n function writeKVInt64(CBORBuffer memory buf, string memory key, int64 value) internal pure {\n writeString(buf, key);\n writeInt64(buf, value);\n }\n\n function writeKVBool(CBORBuffer memory buf, string memory key, bool value) internal pure {\n writeString(buf, key);\n writeBool(buf, value);\n }\n\n function writeKVNull(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeNull(buf);\n }\n\n function writeKVUndefined(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n writeUndefined(buf);\n }\n\n function writeKVMap(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startMap(buf);\n }\n\n function writeKVArray(CBORBuffer memory buf, string memory key) internal pure {\n writeString(buf, key);\n startArray(buf);\n }\n\n function writeFixedNumeric(\n CBORBuffer memory buf,\n uint8 major,\n uint64 value\n ) private pure {\n if (value <= 23) {\n buf.buf.appendUint8(uint8((major << 5) | value));\n } else if (value <= 0xFF) {\n buf.buf.appendUint8(uint8((major << 5) | 24));\n buf.buf.appendInt(value, 1);\n } else if (value <= 0xFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 25));\n buf.buf.appendInt(value, 2);\n } else if (value <= 0xFFFFFFFF) {\n buf.buf.appendUint8(uint8((major << 5) | 26));\n buf.buf.appendInt(value, 4);\n } else {\n buf.buf.appendUint8(uint8((major << 5) | 27));\n buf.buf.appendInt(value, 8);\n }\n }\n\n function writeIndefiniteLengthType(CBORBuffer memory buf, uint8 major)\n private\n pure\n {\n buf.buf.appendUint8(uint8((major << 5) | 31));\n }\n\n function writeDefiniteLengthType(CBORBuffer memory buf, uint8 major, uint64 length)\n private\n pure\n {\n writeFixedNumeric(buf, major, length);\n }\n\n function writeContentFree(CBORBuffer memory buf, uint8 value) private pure {\n buf.buf.appendUint8(uint8((MAJOR_TYPE_CONTENT_FREE << 5) | value));\n }\n}" + }, + "contracts/CCExampleClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from \"./interfaces/ICCGatewayClient.sol\";\nimport {ICCGateway} from \"./interfaces/ICCGateway.sol\";\n\ncontract CCExampleClient is ICCGatewayClient {\n ICCGateway private immutable gateway;\n\n uint64 public subscriptionId = 0;\n bytes public encryptedSecretsReference = \"\";\n\n event ResponseReceived(uint64 subscriptionId, bytes32 requestId, string response);\n event ErrorReceived(uint64 subscriptionId, bytes32 requestId, string error);\n\n constructor(address gatewayAddress) {\n gateway = ICCGateway(gatewayAddress);\n }\n\n function updateSubscriptionId(uint64 _subscriptionId) external {\n subscriptionId = _subscriptionId;\n }\n\n function updateEncryptedSecretsReference(bytes calldata _encryptedSecretsReference) external {\n encryptedSecretsReference = _encryptedSecretsReference;\n }\n\n function request(string[] calldata args, bytes[] calldata bytesArgs) external {\n require(subscriptionId != 0, \"Subscription ID not set\");\n\n gateway.sendRequest(subscriptionId, args, bytesArgs, encryptedSecretsReference);\n }\n\n function callback(bytes32 requestId) external override {\n ICCGatewayClient.CCGResponse memory response = gateway.getResponse(requestId, true);\n\n if (response.state == ICCGatewayClient.CCGResponseState.Success) {\n emit ResponseReceived(response.subscriptionId, requestId, string(response.data));\n } else {\n emit ErrorReceived(response.subscriptionId, requestId, string(response.error));\n }\n }\n}\n" + }, + "contracts/interfaces/ICCGateway.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport {ICCGatewayClient} from './ICCGatewayClient.sol';\nimport {FunctionsRequest} from \"@chainlink/contracts/src/v0.8/functions/v1_3_0/FunctionsClient.sol\";\n\ninterface ICCGateway {\n struct CCGRequest {\n string name;\n uint32 callbackGasLimit;\n FunctionsRequest.Request config;\n }\n\n /**\n * @dev Can't register a request with an empty name\n */\n error CCGRequestNameEmpty();\n\n /**\n * @dev Only the same source of the requestId is allowed to call the function\n */\n error CCGOnlySameSourceAllowed(bytes32 requestId);\n\n /**\n * @dev Only a registered subscriptionId is allowed to call the function\n */\n error CCGRequestNotRegistered(uint64 subscriptionId);\n\n /**\n * @dev Can't fulfill a request that has already been fulfilled\n */\n error CCGRequestAlreadyFulfilled(bytes32 requestId);\n\n /**\n * @dev Only A manager can call the function\n */\n error CCGOnlyManagerAllowed();\n\n /**\n * @dev Send a request to the Functions DON\n */\n function sendRequest(\n uint64 subscriptionId,\n string[] calldata args,\n bytes[] calldata bytesArgs,\n bytes calldata encryptedSecretsReference\n ) external returns (bytes32 requestId);\n\n function getResponse(bytes32 requestId, bool remove) external returns (ICCGatewayClient.CCGResponse memory resp);\n}\n" + }, + "contracts/interfaces/ICCGatewayClient.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\ninterface ICCGatewayClient {\n enum CCGResponseState {Sent, Success, Error}\n\n struct CCGResponse {\n uint64 subscriptionId;\n address source;\n CCGResponseState state;\n bytes data;\n bytes error;\n }\n\n function callback(bytes32 requestId) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/hardhat/errors/chainlink/functions.ts b/packages/hardhat/errors/chainlink/functions.ts new file mode 100644 index 0000000..24df616 --- /dev/null +++ b/packages/hardhat/errors/chainlink/functions.ts @@ -0,0 +1,33 @@ +import { type BigNumberish, formatEther } from "ethers"; + +export class MissingFunctionsConfig extends Error { + constructor(network: string) { + super(`Missing DON 'functions' config in hardhat.config.ts for network: ${network}`); + this.name = "ErrorMissingFunctionsConfig"; + } +} + +export class MissingContractsConfig extends Error { + constructor(network: string) { + super(`Missing DON 'contracts' config in hardhat.config.ts for network: ${network}`); + this.name = "ErrorMissingContractsConfig"; + } +} + +export class WrongFunctionsConfig extends Error { + constructor(network: string) { + super(`Missing router or donId in hardhat.config.ts for network: ${network}`); + this.name = "ErrorWrongFunctionsConfig"; + } +} + +export class NotEnoughFundsToDistribute extends Error { + constructor(balance: BigNumberish, required: BigNumberish) { + super( + `Not enough funds to distribute | Balance: ${formatEther(balance)} LINK | required: ${formatEther( + required, + )} LINK.`, + ); + this.name = "NotEnoughFundsToDistribute"; + } +} diff --git a/packages/hardhat/functions/00_backstory_gpt.ts b/packages/hardhat/functions/00_backstory_gpt.ts new file mode 100644 index 0000000..2b4c327 --- /dev/null +++ b/packages/hardhat/functions/00_backstory_gpt.ts @@ -0,0 +1,49 @@ +// [1] ARGUMENT DECLARATION // + +// gets: character class for the backstory. +const CHARACTER_CLASS = args[0]; // --------------> | Wizard + +// gets: character race for the backstory. +const CHARACTER_RACE = args[1]; // --------------> | Elf + +const CHARACTER_NAME = args[2]; // --------------> | Eldon +// [2] PROMPT ENGINEERING // + +const prompt = `Generate a D&D 5e backstory for ${CHARACTER_NAME}, a Level 1 ${CHARACTER_CLASS} who is a ${CHARACTER_RACE}. The backstory should be extremely short, dense, powerful, engaging, coherent, and suitable for a fantasy RPG setting. Just reply with the one paragraph backstory and nothing else.`; + +// [3] AI DATA REQUEST // + +// requests: OpenAI API using Functions +const openAIRequest = await Functions.makeHttpRequest({ + url: `https://api.openai.com/v1/chat/completions`, + method: "POST", + headers: { + "Content-Type": "application/json", + Authorization: `Bearer ${secrets.apiKey}`, + }, + data: { + model: "gpt-3.5-turbo", + messages: [ + { + role: "system", + content: "You are generating a character backstory. Make sure to only use 256 characters or less.", + }, + { + role: "user", + content: prompt, + }, + ], + max_tokens: 50, + }, + timeout: 10_000, + responseType: "json", +}); + +if (openAIRequest.error) throw new Error("OpenAI API request failed."); + +// finds: the response and returns the result (as a string). +const backstory = openAIRequest.data.choices[0].message.content; + +console.log(backstory); + +return Functions.encodeString(backstory || "Failed"); diff --git a/packages/hardhat/functions/01_onboarding_notification.ts b/packages/hardhat/functions/01_onboarding_notification.ts new file mode 100644 index 0000000..1500119 --- /dev/null +++ b/packages/hardhat/functions/01_onboarding_notification.ts @@ -0,0 +1,108 @@ +async function main(batch, url, auth) { + const msgs = await receive(batch, url, auth); + for (const i in msgs) { + const msg = JSON.parse(msgs[i].payload); + const url = msg.url; + const apiKey = msg.apiKey; + const from = msg.from; + const to = msg.to; + const username = msg.username; + console.log(`url ${url} apiKey ${apiKey}`); + await notify(url, apiKey, from, to, username); + } +} + +async function receive(batch, url, auth) { + const data = { + count: batch, + ackmode: "ack_requeue_false", + encoding: "auto", + }; + + const request = Functions.makeHttpRequest({ + url: url, + method: "POST", + headers: { + Authorization: `Basic ${auth}`, + "Content-Type": "application/json", + }, + data: data, + timeout: 10_000, + responseType: "json", + }); + + const response = await request; + if (response.error) { + console.error(`receive msg error: ${response.code} ${response.message}`); + throw Error("Request failed"); + } + + return response.data; +} + +async function notify(url, apiKey, from, to, username) { + const content = ` + Hi, ${username}: + + Welcome to join the Ceptor Club, + + We are a worldwide party of role-players who came together to make an app that would make the process of playing a fantasy RPG together easier and more visually engaging. + Learn more: https://ceptor.club/. + + Please join our discord https://discord.gg/EYZwc7De. + `.trim(); + const msg = { + personalizations: [ + { + to: [{ email: to }], + }, + ], + from: { email: from }, + subject: "Ceptor Club onboarding", + content: [ + { + type: "text/plain", + value: content, + }, + ], + }; + + const request = Functions.makeHttpRequest({ + url: url, + method: "POST", + headers: { + Authorization: `Bearer ${apiKey}`, + "Content-Type": "application/json", + }, + data: msg, + timeout: 20_000, + responseType: "json", + }); + + const response = await request; + if (response.error && response.message !== "SyntaxError: Unexpected end of JSON input") { + console.error(`notify error: ${response.message}`); + throw Error("Request failed"); + } else { + console.log(`notify: ${response.statusText} ${response.data}`); + } +} + +const batch = args[0]; +if (!batch) { + throw Error("batch is missing."); +} + +const url = args[1]; +if (!url) { + throw Error("url is missing."); +} + +const auth = secrets.auth; +if (!auth) { + throw Error("auth is missing."); +} + +await main(parseInt(batch), url, auth); + +return Functions.encodeString("Succeed"); diff --git a/packages/hardhat/functions/02_alt_text_for_art.ts b/packages/hardhat/functions/02_alt_text_for_art.ts new file mode 100644 index 0000000..49e6933 --- /dev/null +++ b/packages/hardhat/functions/02_alt_text_for_art.ts @@ -0,0 +1,79 @@ +// [1] ARGUMENT DECLARATION // + +// gets: character class for the backstory. +const CHARACTER_CLASS = args[0]; // --------------> | Wizard + +// gets: character race for the backstory. +const CHARACTER_RACE = args[1]; // --------------> | Elf + +const CHARACTER_NAME = args[2]; // --------------> | Eldon + +// gets: character alignment for the backstory. +const CHARACTER_ALIGNMENT = args[3]; // --------------> | Lawful Good + +// gets: character background for the backstory. +const CHARACTER_BACKGROUND = args[4]; // --------------> | Noble + +// gets: character traits for the backstory. +const CHARACTER_TRAITS = args[5]; // --------------> | Brave and kind-hearted + +// gets: character ideals for the backstory. +const CHARACTER_IDEALS = args[6]; // --------------> | Protect the weak + +// gets: character bonds for the backstory. +const CHARACTER_BONDS = args[7]; // --------------> | Family + +// gets: character flaws for the backstory. +const CHARACTER_FLAWS = args[8]; // --------------> | Trusts too easily + +// [2] PROMPT ENGINEERING // + +const prompt = `Generate a descriptive alt text for AI art generation based on the following D&D character details: +- Name: ${CHARACTER_NAME} +- Class: ${CHARACTER_CLASS} +- Race: ${CHARACTER_RACE} +- Alignment: ${CHARACTER_ALIGNMENT} +- Background: ${CHARACTER_BACKGROUND} +- Traits: ${CHARACTER_TRAITS} +- Ideals: ${CHARACTER_IDEALS} +- Bonds: ${CHARACTER_BONDS} +- Flaws: ${CHARACTER_FLAWS} + +The alt text should be detailed, engaging, and suitable for generating AI art. Just reply with the alt text and nothing else.`; + +// [3] AI DATA REQUEST // + +// requests: OpenAI API using Functions +const openAIRequest = await Functions.makeHttpRequest({ + url: `https://api.openai.com/v1/chat/completions`, + method: "POST", + headers: { + "Content-Type": "application/json", + Authorization: `Bearer ${secrets.apiKey}`, + }, + data: { + model: "gpt-3.5-turbo", + messages: [ + { + role: "system", + content: "You are generating alt text for AI art based on character details.", + }, + { + role: "user", + content: prompt, + }, + ], + }, + timeout: 10_000, + maxTokens: 150, + responseType: "json", +}); + +const response = await openAIRequest; + +// finds: the response and returns the result (as a string). +const altText = response.data?.choices[0].message.content; + +console.log(`Generated alt text: %s`, altText); + +return Functions.encodeString(altText || "Failed"); diff --git a/packages/hardhat/functions/02_alt_text_for_art_gen.ts b/packages/hardhat/functions/02_alt_text_for_art_gen.ts new file mode 100644 index 0000000..40f2f2c --- /dev/null +++ b/packages/hardhat/functions/02_alt_text_for_art_gen.ts @@ -0,0 +1,78 @@ +// [1] ARGUMENT DECLARATION // + +// gets: character class for the backstory. +const CHARACTER_CLASS = args[0]; // --------------> | Wizard + +// gets: character race for the backstory. +const CHARACTER_RACE = args[1]; // --------------> | Elf + +const CHARACTER_NAME = args[2]; // --------------> | Eldon + +// gets: character alignment for the backstory. +const CHARACTER_ALIGNMENT = args[3]; // --------------> | Lawful Good + +// gets: character background for the backstory. +const CHARACTER_BACKGROUND = args[4]; // --------------> | Noble + +// gets: character traits for the backstory. +const CHARACTER_TRAITS = args[5]; // --------------> | Brave and kind-hearted + +// gets: character ideals for the backstory. +const CHARACTER_IDEALS = args[6]; // --------------> | Protect the weak + +// gets: character bonds for the backstory. +const CHARACTER_BONDS = args[7]; // --------------> | Family + +// gets: character flaws for the backstory. +const CHARACTER_FLAWS = args[8]; // --------------> | Trusts too easily + +// [2] PROMPT ENGINEERING // + +const prompt = `Generate a descriptive alt text for AI art generation based on the following D&D character details: +- Name: ${CHARACTER_NAME} +- Class: ${CHARACTER_CLASS} +- Race: ${CHARACTER_RACE} +- Alignment: ${CHARACTER_ALIGNMENT} +- Background: ${CHARACTER_BACKGROUND} +- Traits: ${CHARACTER_TRAITS} +- Ideals: ${CHARACTER_IDEALS} +- Bonds: ${CHARACTER_BONDS} +- Flaws: ${CHARACTER_FLAWS} + +The alt text should be detailed, engaging, and suitable for generating AI art. Just reply with the alt text and nothing else.`; + +// [3] AI DATA REQUEST // + +// requests: OpenAI API using Functions +const openAIRequest = await Functions.makeHttpRequest({ + url: `https://api.openai.com/v1/chat/completions`, + method: "POST", + headers: { + "Content-Type": "application/json", + Authorization: `Bearer ${secrets.apiKey}`, + }, + data: { + model: "gpt-3.5-turbo", + messages: [ + { + role: "system", + content: "You are generating alt text for AI art based on character details.", + }, + { + role: "user", + content: prompt, + }, + ], + max_tokens: 50, + }, + timeout: 10_000, + responseType: "json", +}); + +if (openAIRequest.error) throw new Error("OpenAI API request failed."); +// finds: the response and returns the result (as a string). +const altText = openAIRequest.data?.choices[0].message.content; + +console.log(`Generated alt text: %s`, altText); + +return Functions.encodeString(altText || "Failed"); diff --git a/packages/hardhat/functions/index.ts b/packages/hardhat/functions/index.ts new file mode 100644 index 0000000..eea5420 --- /dev/null +++ b/packages/hardhat/functions/index.ts @@ -0,0 +1,123 @@ +import { readdir, readFile, writeFile } from "node:fs/promises"; +import { join } from "node:path"; +import crypto from "node:crypto"; +import type { Address } from "hardhat-deploy/dist/types"; + +const FUNCTIONS_FOLDER = __dirname; +const FUNCTIONS_PATTERN = /(\d+)_(\w+)(\.[jt]s)/; +const MAP_NAME = "link_functions_map.json"; + +type SourceCode = string; +type ScriptName = string; +type ChainId = string | number; +export type ScriptsMap = Record; +export type ChainMap = Record; +export interface Script { + name: ScriptName; + path: string; + source: SourceCode; + checksum: string; + subscriptionId?: number; + secret?: { reference: string; validUntil: number }; + consumerAddress?: Address; +} + +let _scripts: Array