{"_id":"@credora/on-chain-metrics-test","_rev":"9-2c5785f407fc2652923e4752519d295e","name":"@credora/on-chain-metrics-test","dist-tags":{"latest":"0.0.36"},"versions":{"0.0.1":{"name":"@credora/on-chain-metrics-test","version":"0.0.1","license":"MIT","_id":"@credora/on-chain-metrics-test@0.0.1","maintainers":[{"name":"gi0maz","email":"mazzeo.gio@gmail.com"},{"name":"credorainc","email":"suraj@credora.io"}],"dist":{"shasum":"f276f1634fd660cffe676961f3ecd20d1208d338","tarball":"https://registry.npmjs.org/@credora/on-chain-metrics-test/-/on-chain-metrics-test-0.0.1.tgz","fileCount":49,"integrity":"sha512-rUJzRD97rKJ7lib92CLXCS61DqL+Br9QLOlbfOH7D82f8RWpUKU9v9PJ89RyAS4rGzfC/W8aYYF+dA1MJmKgvw==","signatures":[{"sig":"MEYCIQC97DyBpGRJu/1nXp8pjvBeOV/PLEYBVV+zzO0m7FrMPgIhAJY7NbimTweKCeY85zSNQ3BGRr1zSxggZx5kLshw6TWT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157226},"gitHead":"5a93647d324a113577ff060ab1e2f988ecc7a5cf","scripts":{"lint":"npm run lint:contracts && npm run format:check","test":"npm run test:unit","listen":"nodemon scripts/listen.js","compile":"hardhat compile","lint:fix":"solhint 'contracts/**/*.sol' --fix","test:unit":"hardhat test test/test.js","format:fix":"prettier --write .","format:check":"prettier --check .","lint:contracts":"solhint 'contracts/*.sol'","lint:contracts:fix":"solhint 'contracts/**/*.sol' --fix","startLocalFunctionsTestnet":"node scripts/startLocalFunctionsTestnet.js"},"_npmUser":{"name":"gi0maz","email":"mazzeo.gio@gmail.com"},"prettier":{"semi":false,"tabWidth":2,"printWidth":120,"singleQuote":false,"trailingComma":"es5"},"_npmVersion":"10.2.4","description":"Contract for getting Credora Financial Metrics","directories":{},"lint-staged":{"*.sol":["prettier --write","solhint"],"*.{js,json,yml,yaml}":["prettier --write"]},"_nodeVersion":"20.11.1","dependencies":{"ora":"5.4.1","chai":"^4.3.6","axios":"^1.1.3","husky":"^8.0.1","ethers":"^5.7.2","hardhat":"^2.17.3","nodemon":"^3.0.1","solhint":"^3.3.7","prettier":"^2.7.1","readline":"^1.3.0","typechain":"^8.1.0","eth-crypto":"^2.4.0","lint-staged":"^13.0.3","solidity-coverage":"^0.8.2","@chainlink/env-enc":"^1.0.5","@ethersproject/abi":"^5.7.0","@typechain/hardhat":"^6.1.3","@chainlink/contracts":"^1.0.0","@typechain/ethers-v5":"^10.1.0","hardhat-contract-sizer":"^2.6.1","@openzeppelin/contracts":"^5.0.2","solhint-plugin-prettier":"^0.0.5","@ethersproject/providers":"^5.7.1","prettier-plugin-solidity":"^1.0.0-beta.24","@nomiclabs/hardhat-ethers":"^2.2.2","@chainlink/functions-toolkit":"^0.2.7","@nomicfoundation/hardhat-toolbox":"^2.0.0","@openzeppelin/contracts-upgradeable":"^4.9.3","@nomicfoundation/hardhat-chai-matchers":"^1.0.3","@nomicfoundation/hardhat-network-helpers":"^1.0.6"},"_hasShrinkwrap":false,"devDependencies":{"hardhat-gas-reporter":"^1.0.10","@nomicfoundation/hardhat-verify":"^2.0.5"},"_npmOperationalInternal":{"tmp":"tmp/on-chain-metrics-test_0.0.1_1720083530809_0.3930301326678658","host":"s3://npm-registry-packages"}},"0.0.11":{"name":"@credora/on-chain-metrics-test","version":"0.0.11","license":"MIT","_id":"@credora/on-chain-metrics-test@0.0.11","maintainers":[{"name":"gi0maz","email":"mazzeo.gio@gmail.com"},{"name":"credorainc","email":"suraj@credora.io"}],"dist":{"shasum":"e183aad8113405a38377468c8147f2077bd55f92","tarball":"https://registry.npmjs.org/@credora/on-chain-metrics-test/-/on-chain-metrics-test-0.0.11.tgz","fileCount":49,"integrity":"sha512-38BBHkX2bg1c2IWV0fuQsHxHHjYUGI/XolXCs3Sx9RLB2cVfUjhq9J0H4aG5+4xoEjONoCwcAezHjHetvtckQg==","signatures":[{"sig":"MEUCIDTXptn/d0wXDyx6y+S56qGwydi0yBfAc05BC7d/qphZAiEAkeyRqLPrOty5coD+/VnI5nkoGFV9keoTIFIDVqwh+9s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157612},"gitHead":"be6f25d166d1f5679067b86cc64d5ad47a718b2b","scripts":{"lint":"npm run lint:contracts && npm run format:check","test":"npm run test:unit","listen":"nodemon scripts/listen.js","compile":"hardhat compile","lint:fix":"solhint 'contracts/**/*.sol' --fix","test:unit":"hardhat test test/test.js","format:fix":"prettier --write .","format:check":"prettier --check .","lint:contracts":"solhint 'contracts/*.sol'","lint:contracts:fix":"solhint 'contracts/**/*.sol' --fix","startLocalFunctionsTestnet":"node scripts/startLocalFunctionsTestnet.js"},"_npmUser":{"name":"gi0maz","email":"mazzeo.gio@gmail.com"},"prettier":{"semi":false,"tabWidth":2,"printWidth":120,"singleQuote":false,"trailingComma":"es5"},"_npmVersion":"10.2.4","description":"Contract for getting Credora Financial Metrics","directories":{},"lint-staged":{"*.sol":["prettier --write","solhint"],"*.{js,json,yml,yaml}":["prettier --write"]},"_nodeVersion":"20.11.1","dependencies":{"ora":"5.4.1","chai":"^4.3.6","axios":"^1.1.3","husky":"^8.0.1","ethers":"^5.7.2","hardhat":"^2.17.3","nodemon":"^3.0.1","solhint":"^3.3.7","prettier":"^2.7.1","readline":"^1.3.0","typechain":"^8.1.0","eth-crypto":"^2.4.0","lint-staged":"^13.0.3","solidity-coverage":"^0.8.2","@chainlink/env-enc":"^1.0.5","@ethersproject/abi":"^5.7.0","@typechain/hardhat":"^6.1.3","@chainlink/contracts":"^1.0.0","@typechain/ethers-v5":"^10.1.0","hardhat-contract-sizer":"^2.6.1","@openzeppelin/contracts":"^5.0.2","solhint-plugin-prettier":"^0.0.5","@ethersproject/providers":"^5.7.1","prettier-plugin-solidity":"^1.0.0-beta.24","@nomiclabs/hardhat-ethers":"^2.2.2","@chainlink/functions-toolkit":"^0.2.7","@nomicfoundation/hardhat-toolbox":"^2.0.0","@openzeppelin/contracts-upgradeable":"^4.9.3","@nomicfoundation/hardhat-chai-matchers":"^1.0.3","@nomicfoundation/hardhat-network-helpers":"^1.0.6"},"_hasShrinkwrap":false,"devDependencies":{"hardhat-gas-reporter":"^1.0.10","@nomicfoundation/hardhat-verify":"^2.0.5"},"_npmOperationalInternal":{"tmp":"tmp/on-chain-metrics-test_0.0.11_1721054648001_0.018289209338207657","host":"s3://npm-registry-packages"}},"0.0.20":{"name":"@credora/on-chain-metrics-test","version":"0.0.20","license":"MIT","_id":"@credora/on-chain-metrics-test@0.0.20","maintainers":[{"name":"gi0maz","email":"mazzeo.gio@gmail.com"},{"name":"credorainc","email":"suraj@credora.io"}],"dist":{"shasum":"eee28a1f497bcea724254820545e0d92dcd2a3c0","tarball":"https://registry.npmjs.org/@credora/on-chain-metrics-test/-/on-chain-metrics-test-0.0.20.tgz","fileCount":47,"integrity":"sha512-sRchkkIQIKbQBa6GFl8fA2NCkQUhk61xWD0i7zjGtVQoXdXuZ5KGSvzYacrB9vBDzHGnux0hzol78Y9G1yxHFg==","signatures":[{"sig":"MEQCIF+6nCakWH4sWq1MNXiHPI3Ss7fKDePTf5p2MF7vh34NAiBp1aveN3YeEBlXVBfPViyba3vQbZ4ol5V97ZswKyMYMQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":193622},"gitHead":"272e9cec850ee17c84b22e765b42dcc562176fe0","scripts":{"lint":"npm run lint:contracts && npm run format:check","test":"npm run test:unit","listen":"nodemon scripts/listen.js","compile":"hardhat compile","lint:fix":"solhint 'contracts/**/*.sol' --fix","test:unit":"hardhat test test/test.js","format:fix":"prettier --write .","format:check":"prettier --check .","lint:contracts":"solhint 'contracts/*.sol'","lint:contracts:fix":"solhint 'contracts/**/*.sol' --fix","startLocalFunctionsTestnet":"node scripts/startLocalFunctionsTestnet.js"},"_npmUser":{"name":"gi0maz","email":"mazzeo.gio@gmail.com"},"prettier":{"semi":false,"tabWidth":2,"printWidth":120,"singleQuote":false,"trailingComma":"es5"},"_npmVersion":"10.2.4","description":"Contract for getting Credora Financial Metrics","directories":{},"lint-staged":{"*.sol":["prettier --write","solhint"],"*.{js,json,yml,yaml}":["prettier --write"]},"_nodeVersion":"20.11.1","dependencies":{"ora":"5.4.1","chai":"^4.3.6","axios":"^1.1.3","husky":"^8.0.1","ethers":"^5.7.2","hardhat":"^2.17.3","nodemon":"^3.0.1","solhint":"^3.3.7","prettier":"^2.7.1","readline":"^1.3.0","typechain":"^8.1.0","eth-crypto":"^2.4.0","hardhat-gui":"^0.0.14","lint-staged":"^13.0.3","solidity-coverage":"^0.8.2","@chainlink/env-enc":"^1.0.5","@ethersproject/abi":"^5.7.0","@typechain/hardhat":"^6.1.3","@chainlink/contracts":"^1.0.0","@typechain/ethers-v5":"^10.1.0","hardhat-contract-sizer":"^2.6.1","@openzeppelin/contracts":"4.9.3","solhint-plugin-prettier":"^0.0.5","@ethersproject/providers":"^5.7.1","prettier-plugin-solidity":"^1.0.0-beta.24","@nomiclabs/hardhat-ethers":"^2.2.2","@chainlink/functions-toolkit":"^0.2.7","@nomicfoundation/hardhat-toolbox":"^2.0.0","@openzeppelin/contracts-upgradeable":"^4.9.3","@ethereum-attestation-service/eas-sdk":"^2.5.0","@nomicfoundation/hardhat-chai-matchers":"^1.0.3","@nomicfoundation/hardhat-network-helpers":"^1.0.6"},"_hasShrinkwrap":false,"devDependencies":{"hardhat-deploy":"^0.12.4","hardhat-gas-reporter":"^1.0.10","@nomicfoundation/hardhat-verify":"^2.0.5"},"_npmOperationalInternal":{"tmp":"tmp/on-chain-metrics-test_0.0.20_1721467732448_0.657191113675361","host":"s3://npm-registry-packages"}},"0.0.21":{"name":"@credora/on-chain-metrics-test","version":"0.0.21","license":"MIT","_id":"@credora/on-chain-metrics-test@0.0.21","maintainers":[{"name":"gi0maz","email":"mazzeo.gio@gmail.com"},{"name":"credorainc","email":"suraj@credora.io"}],"dist":{"shasum":"9ad47c84e00d98d6974063503dc0dbcf65c9e8b6","tarball":"https://registry.npmjs.org/@credora/on-chain-metrics-test/-/on-chain-metrics-test-0.0.21.tgz","fileCount":47,"integrity":"sha512-OK5v5Bi8gYilMK5kOhekaazAOpmYQlsX2tr0//pSqC4gufKTI9ayh2JUAZKu5Euvv28BuXz/5UThjkTFhs4NCw==","signatures":[{"sig":"MEUCIQC9JNj3cO7arYkBdq+IRy6/BTBtL6YumPwC1SPxsublJwIgU6M/Vl/L+AB6akzaK/pCErWCApppC8MSqY24lYSsxfI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":193622},"gitHead":"272e9cec850ee17c84b22e765b42dcc562176fe0","scripts":{"lint":"npm run lint:contracts && npm run format:check","test":"npm run test:unit","listen":"nodemon scripts/listen.js","compile":"hardhat compile","lint:fix":"solhint 'contracts/**/*.sol' --fix","test:unit":"hardhat test test/test.js","format:fix":"prettier --write .","format:check":"prettier --check .","lint:contracts":"solhint 'contracts/*.sol'","lint:contracts:fix":"solhint 'contracts/**/*.sol' --fix","startLocalFunctionsTestnet":"node scripts/startLocalFunctionsTestnet.js"},"_npmUser":{"name":"gi0maz","email":"mazzeo.gio@gmail.com"},"prettier":{"semi":false,"tabWidth":2,"printWidth":120,"singleQuote":false,"trailingComma":"es5"},"_npmVersion":"10.2.4","description":"Contract for getting Credora Financial Metrics","directories":{},"lint-staged":{"*.sol":["prettier --write","solhint"],"*.{js,json,yml,yaml}":["prettier --write"]},"_nodeVersion":"20.11.1","dependencies":{"ora":"5.4.1","chai":"^4.3.6","axios":"^1.1.3","husky":"^8.0.1","ethers":"^5.7.2","hardhat":"^2.17.3","nodemon":"^3.0.1","solhint":"^3.3.7","prettier":"^2.7.1","readline":"^1.3.0","typechain":"^8.1.0","eth-crypto":"^2.4.0","hardhat-gui":"^0.0.14","lint-staged":"^13.0.3","solidity-coverage":"^0.8.2","@chainlink/env-enc":"^1.0.5","@ethersproject/abi":"^5.7.0","@typechain/hardhat":"^6.1.3","@chainlink/contracts":"^1.0.0","@typechain/ethers-v5":"^10.1.0","hardhat-contract-sizer":"^2.6.1","@openzeppelin/contracts":"4.9.3","solhint-plugin-prettier":"^0.0.5","@ethersproject/providers":"^5.7.1","prettier-plugin-solidity":"^1.0.0-beta.24","@nomiclabs/hardhat-ethers":"^2.2.2","@chainlink/functions-toolkit":"^0.2.7","@nomicfoundation/hardhat-toolbox":"^2.0.0","@openzeppelin/contracts-upgradeable":"^4.9.3","@ethereum-attestation-service/eas-sdk":"^2.5.0","@nomicfoundation/hardhat-chai-matchers":"^1.0.3","@nomicfoundation/hardhat-network-helpers":"^1.0.6"},"_hasShrinkwrap":false,"devDependencies":{"hardhat-deploy":"^0.12.4","hardhat-gas-reporter":"^1.0.10","@nomicfoundation/hardhat-verify":"^2.0.5"},"_npmOperationalInternal":{"tmp":"tmp/on-chain-metrics-test_0.0.21_1721467814953_0.7353281862357488","host":"s3://npm-registry-packages"}},"0.0.22":{"name":"@credora/on-chain-metrics-test","version":"0.0.22","license":"MIT","_id":"@credora/on-chain-metrics-test@0.0.22","maintainers":[{"name":"gi0maz","email":"mazzeo.gio@gmail.com"},{"name":"credorainc","email":"suraj@credora.io"}],"dist":{"shasum":"f451d2632264246771051bada96300e5218a09f8","tarball":"https://registry.npmjs.org/@credora/on-chain-metrics-test/-/on-chain-metrics-test-0.0.22.tgz","fileCount":57,"integrity":"sha512-/q1uSjKCcwM0gXrMb/uiE33J2hk91FX5lnuK0Mh0i0SlUkWvno4kOvaz8OxBtV2AFji31LEcdxHg9R07TMj8oQ==","signatures":[{"sig":"MEUCIBxbOS+LIdpLqRFakkn3GtMqQXZTvpBih2VM4xCmnwzlAiEA1V6VW+85SQLIjyA1LdGIJVdae/3oA/gJD/W1MDDcW7w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":199591},"gitHead":"8f0d6d346a736b66511c85c73456d8e11eaa47fc","scripts":{"lint":"npm run lint:contracts && npm run format:check","test":"npm run test:unit","listen":"nodemon scripts/listen.js","compile":"hardhat compile","lint:fix":"solhint 'contracts/**/*.sol' --fix","test:unit":"hardhat test test/test.js","format:fix":"prettier --write .","format:check":"prettier --check .","lint:contracts":"solhint 'contracts/*.sol'","lint:contracts:fix":"solhint 'contracts/**/*.sol' --fix","startLocalFunctionsTestnet":"node scripts/startLocalFunctionsTestnet.js"},"_npmUser":{"name":"gi0maz","email":"mazzeo.gio@gmail.com"},"prettier":{"semi":false,"tabWidth":2,"printWidth":120,"singleQuote":false,"trailingComma":"es5"},"_npmVersion":"10.2.4","description":"Contract for getting Credora Financial Metrics","directories":{},"lint-staged":{"*.sol":["prettier --write","solhint"],"*.{js,json,yml,yaml}":["prettier --write"]},"_nodeVersion":"20.11.1","dependencies":{"ora":"5.4.1","chai":"^4.3.6","axios":"^1.1.3","husky":"^8.0.1","ethers":"^6.13.2","nodemon":"^3.0.1","solhint":"^3.3.7","prettier":"^2.7.1","readline":"^1.3.0","typechain":"^8.1.0","eth-crypto":"^2.4.0","lint-staged":"^13.0.3","solidity-coverage":"^0.8.2","@chainlink/env-enc":"^1.0.5","@chainlink/contracts":"^1.0.0","@typechain/ethers-v6":"^0.5.1","hardhat-contract-sizer":"^2.6.1","@openzeppelin/contracts":"4.9.3","solhint-plugin-prettier":"^0.0.5","prettier-plugin-solidity":"^1.0.0-beta.24","@chainlink/functions-toolkit":"^0.2.7","@openzeppelin/contracts-upgradeable":"^4.9.3","@ethereum-attestation-service/eas-sdk":"^2.5.0"},"_hasShrinkwrap":false,"devDependencies":{"hardhat":"^2.22.7","hardhat-deploy":"^0.12.4","hardhat-gas-reporter":"^1.0.10","@nomicfoundation/hardhat-verify":"^2.0.5","@nomicfoundation/hardhat-toolbox":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/on-chain-metrics-test_0.0.22_1723363048434_0.9633315214898412","host":"s3://npm-registry-packages"}},"0.0.32":{"name":"@credora/on-chain-metrics-test","version":"0.0.32","license":"MIT","_id":"@credora/on-chain-metrics-test@0.0.32","maintainers":[{"name":"gi0maz","email":"mazzeo.gio@gmail.com"},{"name":"credorainc","email":"suraj@credora.io"}],"dist":{"shasum":"8c6f40b149d0c4448591ae9462e273f6c317a286","tarball":"https://registry.npmjs.org/@credora/on-chain-metrics-test/-/on-chain-metrics-test-0.0.32.tgz","fileCount":175,"integrity":"sha512-kuRQSHlyQ0TtZmcMAUuzz4/SzRTqAQ9LGhoTPi11yMV9TaIW1FBkTxpgbjBbnjw6M3UH+NqMYVuxdVCwXoSkwQ==","signatures":[{"sig":"MEUCIFZ+0s8ZqB3GXL0djXh9EJyJXyGbR3GPMGr3qDbT+NUpAiEAvU5Tv39C3MR3bPJZk6DRCaGjRU1oi+3XeWQI71P1Zvc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":854050},"gitHead":"a9816b5ec2985359cda2276778ddf2b92cc3e4f8","scripts":{"lint":"npm run lint:contracts && npm run format:check","test":"npm run test:unit","listen":"nodemon scripts/listen.js","compile":"hardhat compile","lint:fix":"solhint 'contracts/**/*.sol' --fix","test:unit":"hardhat test test/test.js","format:fix":"prettier --write .","format:check":"prettier --check .","lint:contracts":"solhint 'contracts/*.sol'","lint:contracts:fix":"solhint 'contracts/**/*.sol' --fix","startLocalFunctionsTestnet":"node scripts/startLocalFunctionsTestnet.js"},"_npmUser":{"name":"gi0maz","email":"mazzeo.gio@gmail.com"},"prettier":{"semi":false,"tabWidth":2,"printWidth":120,"singleQuote":false,"trailingComma":"es5"},"_npmVersion":"10.8.3","description":"Contract for getting Credora Financial Metrics","directories":{},"lint-staged":{"*.sol":["prettier --write","solhint"],"*.{js,json,yml,yaml}":["prettier --write"]},"_nodeVersion":"20.11.1","dependencies":{"ora":"5.4.1","chai":"^4.3.6","axios":"^1.1.3","husky":"^8.0.1","nodemon":"^3.0.1","solhint":"^3.3.7","prettier":"^2.7.1","readline":"^1.3.0","typechain":"^8.1.0","eth-crypto":"^2.4.0","lint-staged":"^13.0.3","solidity-coverage":"^0.8.2","@chainlink/env-enc":"^1.0.5","@chainlink/contracts":"^1.0.0","@typechain/ethers-v6":"^0.5.1","hardhat-contract-sizer":"^2.6.1","@openzeppelin/contracts":"4.9.3","solhint-plugin-prettier":"^0.0.5","prettier-plugin-solidity":"^1.0.0-beta.24","@chainlink/functions-toolkit":"^0.2.7","@openzeppelin/contracts-upgradeable":"^4.9.3","@ethereum-attestation-service/eas-sdk":"^2.5.0"},"_hasShrinkwrap":false,"devDependencies":{"ethers":"^6.13.2","hardhat":"^2.22.7","hardhat-deploy":"^0.12.4","hardhat-gas-reporter":"^1.0.10","@nomicfoundation/hardhat-ethers":"^3.0.7","@nomicfoundation/hardhat-verify":"^2.0.5","@nomicfoundation/hardhat-toolbox":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/on-chain-metrics-test_0.0.32_1726817616404_0.7373609431787027","host":"s3://npm-registry-packages"}},"0.0.33":{"name":"@credora/on-chain-metrics-test","version":"0.0.33","license":"MIT","_id":"@credora/on-chain-metrics-test@0.0.33","maintainers":[{"name":"gi0maz","email":"mazzeo.gio@gmail.com"},{"name":"credorainc","email":"suraj@credora.io"}],"dist":{"shasum":"46ea570a1665cfa7f11bda05940c94f41effa475","tarball":"https://registry.npmjs.org/@credora/on-chain-metrics-test/-/on-chain-metrics-test-0.0.33.tgz","fileCount":175,"integrity":"sha512-6b/6Zbkv+kQA96RILgiR0h7WoeQS2v4Ji1BTsmybMwopCjS12Z9EvDuN8KjRTE04CZ4gdE9ht/OmwEWY/s/Scg==","signatures":[{"sig":"MEYCIQDFIpmnxuIONn+ES/GR0LIrzKvsPP8J9HQN4vTlqr7oawIhANfdeYwviWShtZgDMyuYIINANnRmvRBAD7jE0exvy+Sn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853872},"gitHead":"0bc5339ef3b7a90fd23d8615e2a1ba433e390b85","scripts":{"lint":"npm run lint:contracts && npm run format:check","test":"npm run test:unit","listen":"nodemon scripts/listen.js","compile":"hardhat compile","lint:fix":"solhint 'contracts/**/*.sol' --fix","test:unit":"hardhat test test/test.js","format:fix":"prettier --write .","format:check":"prettier --check .","lint:contracts":"solhint 'contracts/*.sol'","lint:contracts:fix":"solhint 'contracts/**/*.sol' --fix","startLocalFunctionsTestnet":"node scripts/startLocalFunctionsTestnet.js"},"_npmUser":{"name":"gi0maz","email":"mazzeo.gio@gmail.com"},"prettier":{"semi":false,"tabWidth":2,"printWidth":120,"singleQuote":false,"trailingComma":"es5"},"_npmVersion":"10.8.3","description":"Contract for getting Credora Financial Metrics","directories":{},"lint-staged":{"*.sol":["prettier --write","solhint"],"*.{js,json,yml,yaml}":["prettier --write"]},"_nodeVersion":"20.11.1","dependencies":{"ora":"5.4.1","chai":"^4.3.6","axios":"^1.1.3","husky":"^8.0.1","nodemon":"^3.0.1","solhint":"^3.3.7","prettier":"^2.7.1","readline":"^1.3.0","typechain":"^8.1.0","eth-crypto":"^2.4.0","lint-staged":"^13.0.3","solidity-coverage":"^0.8.2","@chainlink/env-enc":"^1.0.5","@chainlink/contracts":"^1.0.0","@typechain/ethers-v6":"^0.5.1","hardhat-contract-sizer":"^2.6.1","@openzeppelin/contracts":"4.9.3","solhint-plugin-prettier":"^0.0.5","prettier-plugin-solidity":"^1.0.0-beta.24","@chainlink/functions-toolkit":"^0.2.7","@openzeppelin/contracts-upgradeable":"^4.9.3","@ethereum-attestation-service/eas-sdk":"^2.5.0"},"_hasShrinkwrap":false,"devDependencies":{"ethers":"^6.13.2","hardhat":"^2.22.7","hardhat-deploy":"^0.12.4","hardhat-gas-reporter":"^1.0.10","@nomicfoundation/hardhat-ethers":"^3.0.7","@nomicfoundation/hardhat-verify":"^2.0.5","@nomicfoundation/hardhat-toolbox":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/on-chain-metrics-test_0.0.33_1726817829731_0.363342016238968","host":"s3://npm-registry-packages"}},"0.0.34":{"name":"@credora/on-chain-metrics-test","version":"0.0.34","license":"MIT","_id":"@credora/on-chain-metrics-test@0.0.34","maintainers":[{"name":"gi0maz","email":"mazzeo.gio@gmail.com"},{"name":"credorainc","email":"suraj@credora.io"}],"dist":{"shasum":"65c06617dc6c226178f65088e9ef43ee6159e9bd","tarball":"https://registry.npmjs.org/@credora/on-chain-metrics-test/-/on-chain-metrics-test-0.0.34.tgz","fileCount":178,"integrity":"sha512-yXPgtCYVkra8RKX8M+ec6rVB+Pty4GBORNkDbzz0jQUY+oL3MAzL1fpCyhwyLVdBWgGmlZRSrZYQi6/HfqnQog==","signatures":[{"sig":"MEYCIQDdN6ymAiJj8R1MY5OemGM9UL79auRRUzI35hHdUJyZGAIhANriCfFJn5FTu8ZIaiTb8HTMQchjYy4W148fjlRTx1H6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":851539},"gitHead":"d269493222beff48ee3c69effcb832c308e31866","scripts":{"lint":"npm run lint:contracts && npm run format:check","test":"npm run test:unit","listen":"nodemon scripts/listen.js","compile":"hardhat compile","lint:fix":"solhint 'contracts/**/*.sol' --fix","test:unit":"hardhat test test/test.js","format:fix":"prettier --write .","format:check":"prettier --check .","lint:contracts":"solhint 'contracts/*.sol'","lint:contracts:fix":"solhint 'contracts/**/*.sol' --fix","startLocalFunctionsTestnet":"node scripts/startLocalFunctionsTestnet.js"},"_npmUser":{"name":"gi0maz","email":"mazzeo.gio@gmail.com"},"prettier":{"semi":false,"tabWidth":2,"printWidth":120,"singleQuote":false,"trailingComma":"es5"},"_npmVersion":"10.8.3","description":"Contract for getting Credora Financial Metrics","directories":{},"lint-staged":{"*.sol":["prettier --write","solhint"],"*.{js,json,yml,yaml}":["prettier --write"]},"_nodeVersion":"20.11.1","dependencies":{"ora":"5.4.1","chai":"^4.3.6","axios":"^1.1.3","husky":"^8.0.1","nodemon":"^3.0.1","solhint":"^3.3.7","prettier":"^2.7.1","readline":"^1.3.0","typechain":"^8.1.0","eth-crypto":"^2.4.0","lint-staged":"^13.0.3","solidity-coverage":"^0.8.2","@chainlink/env-enc":"^1.0.5","@chainlink/contracts":"^1.0.0","@typechain/ethers-v6":"^0.5.1","hardhat-contract-sizer":"^2.6.1","@openzeppelin/contracts":"4.9.3","solhint-plugin-prettier":"^0.0.5","prettier-plugin-solidity":"^1.0.0-beta.24","@chainlink/functions-toolkit":"^0.2.7","@openzeppelin/contracts-upgradeable":"^4.9.3","@ethereum-attestation-service/eas-sdk":"^2.5.0"},"_hasShrinkwrap":false,"devDependencies":{"ethers":"^6.13.2","hardhat":"^2.22.7","hardhat-deploy":"^0.12.4","hardhat-gas-reporter":"^1.0.10","@nomicfoundation/hardhat-ethers":"^3.0.7","@nomicfoundation/hardhat-verify":"^2.0.5","@nomicfoundation/hardhat-toolbox":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/on-chain-metrics-test_0.0.34_1727346233898_0.9373407310003778","host":"s3://npm-registry-packages"}},"0.0.35":{"name":"@credora/on-chain-metrics-test","version":"0.0.35","license":"MIT","_id":"@credora/on-chain-metrics-test@0.0.35","maintainers":[{"name":"gi0maz","email":"mazzeo.gio@gmail.com"},{"name":"credorainc","email":"suraj@credora.io"}],"dist":{"shasum":"598da755a7b952a1c34d87aa57059f2747dd6a44","tarball":"https://registry.npmjs.org/@credora/on-chain-metrics-test/-/on-chain-metrics-test-0.0.35.tgz","fileCount":178,"integrity":"sha512-bkf1XKfYJY3JqYytN1uXFeiHIGi9KEQxPxs1THm9Z/rxGHVHD6inHRES881kwWZQYq/pVtO8u3IUcT7vq9Rlvg==","signatures":[{"sig":"MEUCIQCjRvaPWtk3oA5u2/6Bx01YCLIjUvZPsAyImyAjyqE9EAIgX7RL67rKsmFHvOGSnEUsT/pb0YIMcOasiP21oYJxFRY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":853590},"gitHead":"ec2d3df5e72d04b1fea8856db7d5d0b89f299cfe","scripts":{"lint":"npm run lint:contracts && npm run format:check","test":"npm run test:unit","listen":"nodemon scripts/listen.js","compile":"hardhat compile","lint:fix":"solhint 'contracts/**/*.sol' --fix","test:unit":"hardhat test test/test.js","format:fix":"prettier --write .","format:check":"prettier --check .","lint:contracts":"solhint 'contracts/*.sol'","lint:contracts:fix":"solhint 'contracts/**/*.sol' --fix","startLocalFunctionsTestnet":"node scripts/startLocalFunctionsTestnet.js"},"_npmUser":{"name":"gi0maz","email":"mazzeo.gio@gmail.com"},"prettier":{"semi":false,"tabWidth":2,"printWidth":120,"singleQuote":false,"trailingComma":"es5"},"_npmVersion":"10.8.3","description":"Contract for getting Credora Financial Metrics","directories":{},"lint-staged":{"*.sol":["prettier --write","solhint"],"*.{js,json,yml,yaml}":["prettier --write"]},"_nodeVersion":"20.11.1","dependencies":{"ora":"5.4.1","chai":"^4.3.6","axios":"^1.1.3","husky":"^8.0.1","nodemon":"^3.0.1","solhint":"^3.3.7","prettier":"^2.7.1","readline":"^1.3.0","typechain":"^8.1.0","eth-crypto":"^2.4.0","lint-staged":"^13.0.3","solidity-coverage":"^0.8.2","@chainlink/env-enc":"^1.0.5","@chainlink/contracts":"^1.0.0","@typechain/ethers-v6":"^0.5.1","hardhat-contract-sizer":"^2.6.1","@openzeppelin/contracts":"4.9.3","solhint-plugin-prettier":"^0.0.5","prettier-plugin-solidity":"^1.0.0-beta.24","@chainlink/functions-toolkit":"^0.2.7","@openzeppelin/contracts-upgradeable":"^4.9.3","@ethereum-attestation-service/eas-sdk":"^2.5.0"},"_hasShrinkwrap":false,"devDependencies":{"ethers":"^6.13.2","hardhat":"^2.22.7","hardhat-deploy":"^0.12.4","hardhat-gas-reporter":"^1.0.10","@nomicfoundation/hardhat-ethers":"^3.0.7","@nomicfoundation/hardhat-verify":"^2.0.5","@nomicfoundation/hardhat-toolbox":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/on-chain-metrics-test_0.0.35_1727347548327_0.15463317486147843","host":"s3://npm-registry-packages"}},"0.0.36":{"name":"@credora/on-chain-metrics-test","license":"MIT","version":"0.0.36","description":"Contract for getting Credora Financial Metrics","scripts":{"compile":"hardhat compile","test":"npm run test:unit","test:unit":"hardhat test test/test.js","startLocalFunctionsTestnet":"node scripts/startLocalFunctionsTestnet.js","listen":"nodemon scripts/listen.js","lint":"npm run lint:contracts && npm run format:check","lint:fix":"solhint 'contracts/**/*.sol' --fix","lint:contracts":"solhint 'contracts/*.sol'","lint:contracts:fix":"solhint 'contracts/**/*.sol' --fix","format:check":"prettier --check .","format:fix":"prettier --write ."},"dependencies":{"@chainlink/contracts":"^1.0.0","@chainlink/env-enc":"^1.0.5","@chainlink/functions-toolkit":"^0.2.7","@ethereum-attestation-service/eas-sdk":"^2.5.0","@openzeppelin/contracts":"4.9.3","@openzeppelin/contracts-upgradeable":"^4.9.3","@typechain/ethers-v6":"^0.5.1","axios":"^1.1.3","chai":"^4.3.6","eth-crypto":"^2.4.0","hardhat-contract-sizer":"^2.6.1","husky":"^8.0.1","lint-staged":"^13.0.3","nodemon":"^3.0.1","ora":"5.4.1","prettier":"^2.7.1","prettier-plugin-solidity":"^1.0.0-beta.24","readline":"^1.3.0","solhint":"^3.3.7","solhint-plugin-prettier":"^0.0.5","solidity-coverage":"^0.8.2","typechain":"^8.1.0"},"lint-staged":{"*.{js,json,yml,yaml}":["prettier --write"],"*.sol":["prettier --write","solhint"]},"prettier":{"trailingComma":"es5","tabWidth":2,"semi":false,"singleQuote":false,"printWidth":120},"devDependencies":{"@nomicfoundation/hardhat-ethers":"^3.0.7","@nomicfoundation/hardhat-toolbox":"^5.0.0","@nomicfoundation/hardhat-verify":"^2.0.5","ethers":"^6.13.2","hardhat":"^2.22.7","hardhat-deploy":"^0.12.4","hardhat-gas-reporter":"^1.0.10"},"_id":"@credora/on-chain-metrics-test@0.0.36","gitHead":"5ecbb41a5c5c78c42de65a9a7cd422da79e1a038","_nodeVersion":"20.11.1","_npmVersion":"10.8.3","dist":{"integrity":"sha512-1/QK0OseKOy47CFttHnAO9Vcmibekpn13cXSbtLmhJOsGPQYHp1DM2J5HocNh9fRb0NteBYbfqGIsifTlQPnHQ==","shasum":"89001834ab974d2ccddc83c9c330186838c68de3","tarball":"https://registry.npmjs.org/@credora/on-chain-metrics-test/-/on-chain-metrics-test-0.0.36.tgz","fileCount":178,"unpackedSize":852613,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC8Zdmw6q6fGJCrwOJ80xuxQ+WT4x5Y2UuKKtp7lK+EvAiBH+OK7CoeWdr3PffpQKPARMJz+EpNkrAfzOvi90RQSDQ=="}]},"_npmUser":{"name":"gi0maz","email":"mazzeo.gio@gmail.com"},"directories":{},"maintainers":[{"name":"gi0maz","email":"mazzeo.gio@gmail.com"},{"name":"credorainc","email":"suraj@credora.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/on-chain-metrics-test_0.0.36_1727365618636_0.8769959817943822"},"_hasShrinkwrap":false}},"time":{"created":"2024-07-04T08:58:50.703Z","modified":"2024-09-26T15:46:59.038Z","0.0.1":"2024-07-04T08:58:50.949Z","0.0.11":"2024-07-15T14:44:08.147Z","0.0.20":"2024-07-20T09:28:52.636Z","0.0.21":"2024-07-20T09:30:15.136Z","0.0.22":"2024-08-11T07:57:28.603Z","0.0.32":"2024-09-20T07:33:36.628Z","0.0.33":"2024-09-20T07:37:09.941Z","0.0.34":"2024-09-26T10:23:54.088Z","0.0.35":"2024-09-26T10:45:48.665Z","0.0.36":"2024-09-26T15:46:58.859Z"},"license":"MIT","description":"Contract for getting Credora Financial Metrics","maintainers":[{"name":"gi0maz","email":"mazzeo.gio@gmail.com"},{"name":"credorainc","email":"suraj@credora.io"}],"readme":"# Credora On-Chain Metrics\n\nThrough the on-chain distribution of credit metrics, Credora enables DeFi applications to modify lending and borrowing parameters on the basis of a borrower’s credit information. This empowers borrowers to leverage their Credora credit assessment while engaging an expanding network of DeFi applications. Through on-chain credit metrics, Credora aims to further streamline the lending process, improve operational efficiency, and ensure transparency through the immutability of blockchain data.\n\nThis ReadMe presents the Credora Smart Contract describing the ways credit metrics can be relayed/retrieved to/from the blockchain. \n\n## Smart Contract Features\n- Credit Metrics Storage: On-chain storage of credit metrics associated with Credora clients.\n- Synchronous and Event-based Data Retrieval: Supports data retrieval using synchronous function calls or via event-based callbacks.\n- Permissioned Data Access: Controls who can access credit metrics based on roles and specific permissions.\n- ERC-20 Payment Compatibility: Allows payments with ERC-20 tokens for granting access to credit metrics or refreshing on-chain data.\n- Integration with Chainlink: Uses Chainlink to process requests that require off-chain computation.\n- Integration with Ethereum Attestation Service (EAS): Uses EAS to anchor credit metrics to an on-chain attestation and retrieve them. \n\n## Setup\nInstall dependencies by running:\n\n`npm install @credora/on-chain-metrics`\n\nSet the following environment variables either via `export`:\n\n```\nexport ETHEREUM_SEPOLIA_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/{ALCHEMY_APIKEY}\nexport PRIVATE_KEY=the wallet private key\n```\n\nor via a secure tool provided by Chainlink `npx env-enc` by first running:\n\n```\nnpx env-enc set-pw\n```\n\nand then set the ENVs using `npx env-enc set`.\n\n\n## Relaying Data to the Credora Smart Contract\n\nCredora holds its data off-chain in a decentralized data warehouse, namely Space&Time. This is then leveraged to relay data to the blockchain using three possible approaches:\n\n- Chainlink Functions\n- Direct RPC raw requests\n- Ethereum Attestation Service (EAS)\n\n### Chainlink Functions\nOracles such as Chainlink ensure reliable data feed thanks to a deep decentralized architecture. Such an architecture also guarantees high reliability of data sources. It is widely adopted in the DeFi ecosystem. Oracles provide answers to the following problems:\n- How do we verify that the injected information was extracted from the correct source or hasn’t been tampered with?\n- How do we ensure that this data is always available and updated regularly?\nThe smart contract is designed to interact with Chainlink nodes using the Decentralized Oracle Network (DON). It facilitates the secure and verifiable execution of off-chain computation tasks and retrieves the results for on-chain use. The smart contract leverages Chainlink Functions to get live metric data from the Space&Time decentralized data warehouse.  \n\nThe file `query-space-and-time.js` contains the Chainlink Function code and `Functions-request-config.js` the related configuration.\n\nA tutorial on how to kick off Chainlink Function requests using HardHat is available [here](https://github.com/smartcontractkit/functions-hardhat-starter-kit)\n\n\n### Direct RPC Raw Requests\nDirect RPC Raw requests are cheaper and allow to directly interact with blockchain nodes giving us full control over the data being pushed on-chain. In this case, there are some cons in terms of centralization and concerns in terms of security in particular with regard to the node endpoints and possible risks on vulnerabilities at the endpoint level. If the blockchain node receiving the RPC request is malicious, the data could get tampered. \n\nTo this end, the Credora Smart Contract exposes the `setData` external function. \nA usage example is in `tasks/Setters/setData.js`, whose command is reported below:\n\n```\nnpx hardhat setData --contract 0xEc97819AB80Aa06812B9C699403048BBc1826076 --entity credoraInc --score 64.65 --rae BB- --impliedpd 60 --nav 66 --network ethereumSepolia\n```\n\n### Ethereum Attestation Service (EAS)\n\nAlternatively, the last supported approach is based on the usage of the EAS attestation and retrieve the data from the attestation contract itself. In this case, we have the advantage of anchoring the data to a standardized attestation schema, which can be verified by third parties. Attestations provide a form of proof that can be independently verified, enhancing trust in the data. In terms of costs, the EAS solution lies in the middle between the Oracle and the Direct ones. \n\nTo do so:\n\n- Create an [EAS Attestation Schema](https://docs.attest.org/docs/core--concepts/schemas)\n  - The Credora EAS Schema is published on Ethereum Sepolia [here](0xbe3b27d672109965f81ba36e8b1048dea16b6cb5a13c4549e26c256035817100) and on the Mainnet [here]()\n\n- Make an on-chain attestation and get the related attestation UID: \n\n```JavaScript\nconst eas = new EAS(easContractAddress);\n\tconst provider = ethers.getDefaultProvider(\n\t\t\"sepolia\"\n\t);\n\tconst signer = new ethers.Wallet(privateKey, provider);\n\teas.connect(signer);\n\t\n\t// Initialize SchemaEncoder with the schema string\n\tconst schemaEncoder = new SchemaEncoder(\"bytes32 entity, uint256 score, uint256 nav, bytes8 rae, uint256 borrowCapacity, uint256 impliedPD, uint256 impliedPDTenor, string proofCommitment\");\n\tconst encodedData = schemaEncoder.encodeData([\n\t{ name: \"entity\", value: ethers.encodeBytes32String(\"credora-test\"), type: \"bytes32\" },\n\t{ name: \"score\", value: 39500000, type: \"uint256\" },\n\t{ name: \"nav\", value: 0, type: \"uint256\" },\n\t{ name: \"rae\", value: stringToBytes8(\"BB-\"), type: \"bytes8\" },\n\t{ name: \"borrowCapacity\", value: 2240000, type: \"uint256\" },\n\t{ name: \"impliedPD\", value: 0, type: \"uint256\" },\n\t{ name: \"impliedPDTenor\", value: 0, type: \"uint256\" },\n\t{ name: \"proofCommitment\", value: \"abcd\", type: \"string\" },\n\t]);\n\n\tconst tx = await eas.attest({\n\t\tschema: schemaUID,\n\t\tdata: {\n\t\t\trecipient: \"0x98ADc891Efc9Ce18cA4A63fb0DfbC2864566b5Ab\",\n\t\t\texpirationTime: 0,\n\t\t\trevocable: true, // Be aware that if your schema is not revocable, this MUST be false\n\t\t\tdata: encodedData,\n\t\t},\n\t});\n```\n\n- Refresh data in the Credora Smart Contract using the task under `tasks/EAS/refreshData.js` by passing in input the attestation UID and the contract address. The command is reported below:\n\n```\nnpx hardhat refreshData --contract 0xf5c5b572502374b2e48f8ED3B39062Cb5F7f2A36 --uid 0xcf2e6171372e61e5dc294732ddf2e0b321524352da95e7deba025984a1b2abe9 --network ethereumSepolia\n```\n\n## Retrieving Data from the Credora Smart Contract\n\nCredora provides support for accessing credit data using direct and synchronous function calls or via callbacks that will be invoked by the related initiator function if metrics change over time. \n\n\n### Polling-based Data Retrieval\nCredora allows to retrieve credit metrics stored on-chain by polling the contract and the related getter functions. \nTo do so, it is mandatory to be granted access permissions. Data consumers should share their wallet address with Credora, thus being able to read the stored data. \nAn example on how to get a credit metric is reported under `tasks/Getters/getScore.js`.\n\n```\nnpx hardhat getScore --contract 0xEc97819AB80Aa06812B9C699403048BBc1826076 --entity credoraInc  --network ethereumSepolia\n```\n\n\n### Event-based Data Retrieval\nCredora provides a robust mechanism for retrieving data using a callback-based solution. This feature allows external entities to request data and receive the results asynchronously through a callback function. \nThe consuming smart contract should implement the desired callback belonging to the `CredoraFunctions` abstract contract. \nCallbacks will be called if a valid subscription is active and if credit metrics change. \nCallbacks will be triggered only if the data consumer (e.g., a consumer contract) has been subscribed by Credora. \n\n```\nfulfillScore(bytes32 _entity, uint256 metric_data)\nfulfillNAV(bytes32 _entity, uint256 metric_data)\nfulfillRAE(bytes32 _entity, bytes8 metric_data)\nfulfillBorrowCapacity(bytes32 _entity, uint256 metric_data)\nfulfillImpliedPD(bytes32 _entity, uint256 metric_data)\nfulfillImpliedPDtenor(bytes32 _entity, uint256 metric_data)\n```\n\n\n## Available Credit Metrics\n\nThe credit metrics we hold in the smart contract are the following:\n- Credit Score: A score out of 1000, granularly differentiating the creditworthiness of borrowers. Credit scores are outputs for specific methodologies\n- RAE: A Rating Agency Equivalent is delivered as a Credit Assessment Metric, providing a way to compare Credora outputs to the big 3 US Credit Rating Agencies.  \n- Borrow Capacity: The output of a scenario analysis, considering the impact of additional unsecured debt in the context of the strategy, current leverage, and historical leverage.\n- Implied PD: Implied probability of default for the borrower over a specified tenor. This is derived using the Rating Agency Equivalent and corresponding historical default rates.\n- Implied PD Tenor: The tenor over which the borrower's Implied PD has been calculated, which is anchored to the average duration of their outstanding debt.\n- Total NAV:  NAV is typically calculated for investment funds. The formula is ((Total Assets - Total) / Outstanding Shares). Total NAV delivers the numerator for this equation. \n\n\n\n## Supported Networks and Addresses\n\nThe Credora Smart Contract is deployed and verified on ETHEREUM and SEPOLIA networks. It will also be available on other blockchains in the near future.\n\n\n\n## Usage Example\nIn the following, we report a usage example of the CredoraMetrics contract, showing a JavaScript sample code based on the HardHat development environment. \n\n### Prerequisites\nMust have an Ethereum or Sepolia wallet. You can fund your Sepolia wallet here.\nSufficient ETH for transaction fees.\nNode.js and npm installed.\n\n### Setup\nCreate a new app directory and install hardhat dependencies:\n\n```bash\nmkdir sample-consumer-app \ncd sample-consumer-app \nnpm init -y \nnpm install --save-dev hardhat\nnpm install --save-dev @nomicfoundation/hardhat-toolbox\nnpm install --save-dev hardhat-contract-sizer\nnpm install --save-dev @credora/on-chain-metrics\n```\n\nNow, configure the hardhat project as follows:\n\n```javascript\nrequire(\"@nomicfoundation/hardhat-toolbox\")\nrequire(\"hardhat-contract-sizer\")\n\nconst { BigNumber } = require('ethers');\nconst { ethers } = require('ethers');\n\nconst SOLC_SETTINGS = {\n  optimizer: {\n    enabled: true,\n    runs: 1_000,\n  },\n}\n// Set EVM private keys (required)\nconst PRIVATE_KEY = process.env.PRIVATE_KEY\nif (!PRIVATE_KEY) {\n  throw Error(\"Set the PRIVATE_KEY environment variable with your EVM wallet private key\")\n}\nconst accounts = []\nif (PRIVATE_KEY) {\n  accounts.push(PRIVATE_KEY)\n}\n\n/** @type import('hardhat/config').HardhatUserConfig */\nmodule.exports = {\n  defaultNetwork: \"localFunctionsTestnet\",\n  gas: 1000000, // Set the gas limit for transactions (in wei)\n  solidity: {\n    compilers: [\n      {\n        version: \"0.8.20\",\n        settings: SOLC_SETTINGS,\n      },\n    ],\n  },\n  networks: {\n    ethereum: {\n      url: process.env.ETHEREUM_RPC_URL || \"UNSET\",\n      gasPrice: undefined,\n      nonce: undefined,\n      accounts,\n      chainId: 1,\n      nativeCurrencySymbol: \"ETH\",\n    },\n    ethereumSepolia: {\n      url: process.env.ETHEREUM_SEPOLIA_RPC_URL || \"UNSET\",\n      gasPrice: undefined,\n      nonce: undefined,\n      accounts,\n      chainId: 11155111,\n      nativeCurrencySymbol: \"ETH\",\n      },\n    flowPreviewnet: {\n      url: process.env.FLOWPREVIEWNET_RPC_URL || \"UNSET\",,\n      gasPrice: undefined,\n      nonce: undefined,\n      accounts,\n      chainId: 646,\n      nativeCurrencySymbol: \"ETH\",\n    }\n  }\n}\n```\n\n### Get On-Chain Metrics Using Synchronous Getter Functions\n\n#### Step 1: Add a new Task to the Hardhat Script \nExtend the hardhat.config.js with a task that aims to fetch Credora data from the blockchain. \n\n```javascript\nconst divisionFactor = 18;\n\ntask(\"getScore\", \"Get Score data stored on-chain\")\n  .addParam(\"contract\", \"The contract address\")\n  .addParam(\"entity\", \"The entity name\")\n  .setAction(async (taskArgs, hre) => {\n    const fs = require(\"fs\");\n    const contractAddress = taskArgs.contract;\n    const entity = ethers.encodeBytes32String(taskArgs.entity);\n    const signer = (await hre.ethers.getSigners())[0];\n\n    // Get the ABI from the compiled JSON artifact\n    const artifactPath = \"build/artifacts/contracts/CredoraMetrics.sol/CredoraMetrics.json\";\n    const artifact = JSON.parse(fs.readFileSync(artifactPath, \"utf-8\"));\n    // Connect to the deployed contract\n    const contract = new ethers.Contract(contractAddress, artifact.abi, signer);    \n    const result = await contract.getScore(entity,{ gasLimit: 1000000 });    \n    \n    let decimalResult = ethers.formatUnits(result, divisionFactor);\n    console.log('Score:', decimalResult);\n    \n});\n```\n\nThe getScore task receives in input the entity name and the contract address to call the getScore smart contract function. \nThe returned value is an unsigned integer (uint256) and needs to be divided by a factor of 10^18 to convert it to its final floating-point format.\n\n#### Step 2: Configure Environment Variables\nExport the following environment variables:\n\n```\nETHEREUM_RPC_URL, ETHEREUM_SEPOLIA_RPC_URL, FLOWPREVIEWNET_RPC_URL (e.g. https://eth-sepolia.g.alchemy.com/v2/{ALCHEMY_APIKEY})\nPRIVATE_KEY of the wallet\n```\n\n#### Step 3: Run\nFrom the same directory, run the following by passing the address of the Credora contract and the name of the entity owning the data:\n\n```bash\nnpx hardhat getNAV \n    --network {ethereum/ethereumSepolia/flowPreviewnet} \n    --contract {address of the Credora contract} \n    --entity {entity name}\n```\n\n### Get On-Chain Metrics Using Callbacks\n\n#### Step 1: Write the Consumer Smart Contract\nNavigate to the contracts directory and create a new Solidity file, e.g., MetricsConsumer.sol\npragma solidity ^0.8.20;\n\n```solidity\n/**\n * @title Metrics Consumer Contract\n * @notice This contract implements the CredoraFunctions for managing financial asset metrics.\n */\nimport \"@credora/on-chain-metrics/contracts/CredoraFunctions.sol\";\n\ncontract MetricsConsumer is CredoraFunctions {\n\n    // Example storage for metrics\n    mapping(bytes32 => uint256) private scores;\n    mapping(bytes32 => uint256) private nav;\n    mapping(bytes32 => bytes8)  private rae;\n    mapping(bytes32 => uint256) private borrowCapacities;\n    mapping(bytes32 => uint256) private impliedPDs;\n    mapping(bytes32 => uint256) private impliedPDTenors;\n\n    // Implementations of fulfill functions that update the state and emit events\n    function fulfillScore(bytes32 _entity, uint256 _metric_data) external override {\n        scores[_entity] = _metric; // Update the metric\n    }\n\n    function fulfillNAV(bytes32 _entity, uint256 _metric_data) external override {\n        nav[_entity] = _metric; // Update the metric\n    }\n\n    function fulfillRAE(bytes32 _entity, bytes8 _metric_data) external override {\n        rae[_entity] = _metric; // Update the metric\n    }\n\n    function fulfillBorrowCapacity(bytes32 _entity, uint256 _metric_data) external override {\n        borrowCapacities[_entity] = _metric; // Update the metric\n    }\n\n    function fulfillImpliedPD(bytes32 _entity, uint256 _metric_data) external override {\n        impliedPDs[_entity] = _metric; // Update the metric\n    }\n\n    function fulfillImpliedPDtenor(bytes32 _entity, uint256 _metric_data) external override {\n        impliedPDTenors[_entity] = _metric; // Update the metric\n    }\n}\n```\n\n#### Step 2: Write a Deployment Script\n\nNavigate to the scripts directory and create a new deployment script, e.g., deploy.js:\n\n```javascript\nasync function main() {\n  const [deployer] = await ethers.getSigners();\n\n  console.log(\"Deploying contracts with the account:\", deployer.address);\n  \n  const MyContract = await ethers.getContractFactory(\"MetricsConsumer\");\n  const myContract = await MyContract.deploy();\n\n  console.log(\"Contract deployed to address:\", myContract.address);\n}\n\nmain()\n  .then(() => process.exit(0))\n  .catch((error) => {\n    console.error(error);\n    process.exit(1);\n  });\n\n```\n\n#### Step 3: Compile the Contract\n\nCompile the smart contract using Hardhat:\n```bash\nnpx hardhat compile\n```\n\n#### Step 4: Deploy the Contract\nDeploy the smart contract:\n\n```bash\nnpx hardhat run scripts/deploy.js \n    --network {ethereum/ethereumSepolia/flowPreviewnet}\n```\n\nYou should see output similar to:\n\n```\nDeploying contracts with the account: 0xYourAccountAddress\nContract deployed to address: 0xYourContractAddress\n```\n\n#### Step 5: Test the callbacks\nOnce Credora has subscribed your contract, the callbacks can be self-tested by calling the testTriggerCallbacks function (only available on Testnets) on the Credora Smart Contract. \nTo do so, you can move inside the Credora package and run the related hardhat task (available at node_modules/@credora/on-chain-metrics/tasks/Testers/testTriggerCallbacks.js), which provides a set of random metrics and triggers the callbacks of the subscribed contract.\n\n```bash\ncd node_modules/@credora/on-chain-metrics && \\\nnpx hardhat compile && \\\nnpx hardhat testTriggerCallbacks \n    --entity {subscribed entityname} \n    --contract {address of the Credora contract} \n    --thirdpartyaddr {address of the consuming contract} \n    --network {ethereum/ethereumSepolia/flowPreviewnet} \n```\n","readmeFilename":"README.md"}