From 40ad7996380fbaf377824212bc8cfa8650c23678 Mon Sep 17 00:00:00 2001 From: dqtkien Date: Mon, 22 Apr 2024 11:52:29 +0700 Subject: [PATCH 01/13] Misc: Add more testnet chain --- hardhat.config.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/hardhat.config.ts b/hardhat.config.ts index 4601d18..7ff68ca 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -101,6 +101,28 @@ const config: HardhatUserConfig = { mnemonic: env.OROCHI_MNEMONIC, }, }, + moonbeamTest: { + url: 'https://rpc.api.moonbase.moonbeam.network', + chainId: 1287, + accounts: { + mnemonic: env.OROCHI_MNEMONIC, + }, + }, + saakuruTest: { + url: 'https://rpc.testnet.oasys.games/', + chainId: 9372, + accounts: { + mnemonic: env.OROCHI_MNEMONIC, + }, + }, + zkFairTest: { + url: 'https://testnet-rpc.zkfair.io', + chainId: 43851, + accounts: { + mnemonic: env.OROCHI_MNEMONIC, + }, + }, + // Hard hat network hardhat: { chainId: 911, From 0a40629d47eb23bb2fe6fa30d215bf5b5f47e0b1 Mon Sep 17 00:00:00 2001 From: dqtkien Date: Mon, 6 May 2024 09:54:31 +0700 Subject: [PATCH 02/13] Remove console lib in hardhat --- contracts/multicast/MultiCast.sol | 1 - 1 file changed, 1 deletion(-) diff --git a/contracts/multicast/MultiCast.sol b/contracts/multicast/MultiCast.sol index 236b0a4..70fd2c1 100644 --- a/contracts/multicast/MultiCast.sol +++ b/contracts/multicast/MultiCast.sol @@ -2,7 +2,6 @@ pragma solidity 0.8.19; import '../libraries/Bytes.sol'; -import 'hardhat/console.sol'; error InvalidLength(); From 59fa2d92a4012f13c8b35a396a854bb570d29113 Mon Sep 17 00:00:00 2001 From: dqtkien Date: Fri, 10 May 2024 23:26:22 +0700 Subject: [PATCH 03/13] Add zircuit testnet info --- hardhat.config.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hardhat.config.ts b/hardhat.config.ts index 113fc32..6af7b58 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -129,6 +129,13 @@ const config: HardhatUserConfig = { mnemonic: env.OROCHI_MNEMONIC, }, }, + zircuitTest: { + url: `https://zircuit1.p2pify.com/`, + chainId: 48899, + accounts: { + mnemonic: env.OROCHI_MNEMONIC, + }, + }, // Hard hat network hardhat: { From 23021f95f9ab8178218f4a9a9a6d827e85008e6b Mon Sep 17 00:00:00 2001 From: dqtkien Date: Thu, 16 May 2024 01:09:32 +0700 Subject: [PATCH 04/13] Add zkContract compatible --- .gitignore | 7 +- env.ts | 1 + hardhat.config.ts | 24 +- package.json | 12 +- tasks/deploy-orochi-zk.ts | 129 ++++++ tasks/get-account.ts | 2 +- yarn.lock | 836 ++++++++++++++++++++++++++++++++++++-- 7 files changed, 979 insertions(+), 32 deletions(-) create mode 100644 tasks/deploy-orochi-zk.ts diff --git a/.gitignore b/.gitignore index 51abc33..6262de4 100644 --- a/.gitignore +++ b/.gitignore @@ -106,4 +106,9 @@ typechain-types/ artifacts/ cache/ flatten/ -.env* \ No newline at end of file +.env* +cache-zk +deployments-zk +artifacts-zk +.upgradable +.openzeppelin \ No newline at end of file diff --git a/env.ts b/env.ts index b43ddcc..9e55792 100644 --- a/env.ts +++ b/env.ts @@ -8,6 +8,7 @@ export interface IEnvironment { OROCHI_PUBLIC_KEY: string; OROCHI_OWNER: string; OROCHI_OPERATOR: string; + WALLET_PRIVATE_KEY: string; } function clean(config: any): any { diff --git a/hardhat.config.ts b/hardhat.config.ts index 175f439..5738553 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -3,6 +3,9 @@ import { HardhatUserConfig } from 'hardhat/types'; import { env } from './env'; import '@nomicfoundation/hardhat-toolbox'; import '@openzeppelin/hardhat-upgrades'; +import '@matterlabs/hardhat-zksync'; +import '@matterlabs/hardhat-zksync-deploy'; +import '@matterlabs/hardhat-zksync-solc'; if (fs.existsSync('./typechain-types')) { const dir = fs.opendirSync(`${__dirname}/tasks`); @@ -29,6 +32,10 @@ const config: HardhatUserConfig = { gasReporter: { enabled: true, }, + zksolc: { + version: 'latest', + settings: {}, + }, networks: { sepolia: { url: 'https://eth-sepolia.api.onfinality.io/public', @@ -96,7 +103,7 @@ const config: HardhatUserConfig = { accounts: { mnemonic: env.OROCHI_MNEMONIC }, }, bnbChainTest: { - url: 'https://data-seed-prebsc-1-s1.binance.org:8545', + url: 'https://bsc-testnet-rpc.publicnode.com', chainId: 97, accounts: { mnemonic: env.OROCHI_MNEMONIC, @@ -137,9 +144,24 @@ const config: HardhatUserConfig = { mnemonic: env.OROCHI_MNEMONIC, }, }, + xLayerTest: { + url: `https://testrpc.xlayer.tech/`, + chainId: 195, + accounts: { + mnemonic: env.OROCHI_MNEMONIC, + }, + }, + zkLinkTest: { + url: `https://sepolia.rpc.zklink.io`, + zksync: true, + ethNetwork: 'https://sepolia.rpc.zklink.io', + chainId: 810181, + accounts: [env.WALLET_PRIVATE_KEY], + }, // Hard hat network hardhat: { + zksync: true, chainId: 911, hardfork: 'london', blockGasLimit: 30000000, diff --git a/package.json b/package.json index 4463503..0b1bde7 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "node:local": "hardhat node", "deploy:orochi": "hardhat deploy:orochi", "test": "hardhat test", - "flatten": "mkdir -p flatten/ && npx hardhat flatten ./contracts/orocle-v1/OrocleV1.sol > ./flatten/OrocleV1.sol && npx hardhat flatten ./contracts/orand-v2/OrandProviderV2.sol > ./flatten/OrandProviderV2.sol && npx hardhat flatten ./contracts/orosign/OrosignV1.sol > ./flatten/OrosignV1.sol && npx hardhat flatten ./contracts/orosign/OrosignMasterV1.sol > ./flatten/OrosignMasterV1.sol && npx hardhat flatten ./contracts/examples/DiceGame.sol > ./flatten/DiceGame.sol" + "flatten": "mkdir -p flatten/ && npx hardhat flatten ./contracts/orocle-v1/OrocleV1.sol > ./flatten/OrocleV1.sol && npx hardhat flatten ./contracts/orand-v2/OrandProviderV2.sol > ./flatten/OrandProviderV2.sol && npx hardhat flatten ./contracts/orosign/OrosignV1.sol > ./flatten/OrosignV1.sol && npx hardhat flatten ./contracts/orosign/OrosignMasterV1.sol > ./flatten/OrosignMasterV1.sol && npx hardhat flatten ./contracts/examples/DiceGame.sol > ./flatten/DiceGame.sol && npx hardhat flatten ./contracts/orocle-v2/OrocleV2.sol > ./flatten/OrocleV2.sol && npx hardhat flatten ./contracts/orand-v3/OrandProviderV3.sol > ./flatten/OrandProviderV3.sol" }, "keywords": [ "vrf", @@ -29,6 +29,11 @@ "author": "chiro@orochi.network", "license": "MIT", "devDependencies": { + "@matterlabs/hardhat-zksync": "^1.0.0", + "@matterlabs/hardhat-zksync-deploy": "^1.3.0", + "@matterlabs/hardhat-zksync-solc": "^1.1.4", + "@matterlabs/hardhat-zksync-upgradable": "^1.4.1", + "@matterlabs/zksync-contracts": "^0.6.1", "@nomicfoundation/hardhat-chai-matchers": "^2.0.0", "@nomicfoundation/hardhat-ethers": "^3.0.5", "@nomicfoundation/hardhat-network-helpers": "^1.0.0", @@ -47,7 +52,8 @@ "solidity-coverage": "^0.8.0", "ts-node": "^10.9.2", "typechain": "^8.3.0", - "typescript": "^5.3.3" + "typescript": "^5.3.3", + "zksync-ethers": "^6.7.1" }, "dependencies": { "@openzeppelin/contracts": "4.9.6", @@ -57,4 +63,4 @@ "axios": "^1.6.5", "dotenv": "^16.3.1" } -} \ No newline at end of file +} diff --git a/tasks/deploy-orochi-zk.ts b/tasks/deploy-orochi-zk.ts new file mode 100644 index 0000000..a46df54 --- /dev/null +++ b/tasks/deploy-orochi-zk.ts @@ -0,0 +1,129 @@ +/* eslint-disable no-await-in-loop */ +import { Deployer } from '@matterlabs/hardhat-zksync'; +import '@matterlabs/hardhat-zksync-node/dist/type-extensions'; +import '@matterlabs/hardhat-zksync-upgradable'; +import '@matterlabs/hardhat-zksync-verify/dist/src/type-extensions'; +import '@nomicfoundation/hardhat-ethers'; +import { HexString, OrandEncoding } from '@orochi-network/utilities'; +import { getAddress, isAddress, keccak256 } from 'ethers'; +import { task } from 'hardhat/config'; +import { HardhatRuntimeEnvironment } from 'hardhat/types'; +import { Provider, Wallet } from 'zksync-ethers'; +import { env } from '../env'; + +const OPERATORS = env.OROCHI_OPERATOR.split(',').map((op) => op.trim()); + +task('deploy:zk', 'Deploy Orochi Network contracts').setAction( + async (_taskArgs: any, hre: HardhatRuntimeEnvironment) => { + const OWNER = env.OROCHI_OWNER.trim(); + const provider = new Provider('https://sepolia.rpc.zklink.io'); + + if (!env.WALLET_PRIVATE_KEY) { + throw new Error('Not found wallet private key'); + } + + const wallet = new Wallet(env.WALLET_PRIVATE_KEY, provider); + const deployer = new Deployer(hre, wallet); + console.log('Deployer:', deployer.zkWallet, deployer.ethWallet); + + let pk = env.OROCHI_PUBLIC_KEY.replace(/^0x/gi, '').trim(); + let correspondingAddress = getAddress(`0x${keccak256(`0x${pk.substring(2, 130)}`).substring(26, 66)}`); + + for (let i = 0; i < OPERATORS.length; i += 1) { + if (!isAddress(OPERATORS[i])) { + throw new Error(`Invalid operator address ${i}: ${OPERATORS[i]}`); + } + console.log(`Operator [${i}]:`, OPERATORS[i]); + } + + const orandECVRFV3Artifact = await deployer.loadArtifact('OrandECVRFV3'); + const orandProviderV3Artifact = await deployer.loadArtifact('OrandProviderV3'); + const orocleV2Artifact = await deployer.loadArtifact('OrocleV2'); + + // Deploy ECVRF + const orandECVRF = await deployer.deploy(orandECVRFV3Artifact); + await orandECVRF.waitForDeployment(); + console.log('orandECVRFContract: ', await orandECVRF.getAddress()); + + // Deploy Orocle + const orocleV2Proxy = await hre.zkUpgrades.deployProxy(deployer.zkWallet, orocleV2Artifact, [OPERATORS], { + initializer: 'initialize', + }); + await orocleV2Proxy.waitForDeployment(); + console.log('>> [Orocle V2] proxy contract address:', await orocleV2Proxy.getAddress()); + + /* + constructor( + uint256[2] memory publicKey, + address operator, + address ecvrfAddress, + address oracleAddress, + uint256 maxBatchingLimit + ) + */ + // Deploy Provider + // const orandProviderV3Proxy = await upgrades.deployProxy( + // orandProviderV3Factory, + // // We going to skip 0x04 -> Pubkey format from libsecp256k1 + // [ + // OrandEncoding.pubKeyToAffine(HexString.hexPrefixAdd(pk)), + // correspondingAddress, + // await orandECVRF.getAddress(), + // await orocleV2Proxy.getAddress(), + // 200, + // ], + // ); + const orandProviderV3Proxy = await hre.zkUpgrades.deployProxy( + deployer.zkWallet, + orandProviderV3Artifact, + [ + OrandEncoding.pubKeyToAffine(HexString.hexPrefixAdd(pk)), + correspondingAddress, + await orandECVRF.getAddress(), + await orocleV2Proxy.getAddress(), + 200, + ], + { + initializer: 'initialize', + }, + ); + await orandProviderV3Proxy.waitForDeployment(); + + console.log('>> [OrandProvider V3] proxy contract address:', await orandProviderV3Proxy.getAddress()); + + console.table({ + OrocleV2: await orocleV2Proxy.getAddress(), + OrandProviderV3: await orandProviderV3Proxy.getAddress(), + }); + + await orocleV2Proxy.transferOwnership(OWNER); + await hre.zkUpgrades.admin.changeProxyAdmin(await orocleV2Proxy.getAddress(), OWNER, deployer.zkWallet); + + await orandProviderV3Proxy.transferOwnership(OWNER); + await hre.zkUpgrades.admin.changeProxyAdmin(await orandProviderV3Proxy.getAddress(), OWNER, deployer.zkWallet); + + console.log( + `Corresponding address: ${correspondingAddress} , is valid publicKey?:`, + correspondingAddress === (await orandProviderV3Proxy.getOperator()), + ); + + console.log( + 'Is Oracle deployed correct?', + (await orocleV2Proxy.getAddress()) === (await orandProviderV3Proxy.getOracle()), + ); + console.log( + 'Is ECVRF verifier deployed correct?', + (await orandECVRF.getAddress()) === (await orandProviderV3Proxy.getECVRFVerifier()), + ); + console.log( + 'Is orand service operator correct?', + correspondingAddress === (await orandProviderV3Proxy.getOperator()), + ); + console.log('Is OrocleV1 operator correct?', await orocleV2Proxy.isOperator(OPERATORS[0])); + console.log('Is OrocleV1 operator correct?', await orocleV2Proxy.isOperator(OPERATORS[1])); + console.log('Is OrocleV1 owner correct?', OWNER === (await orocleV2Proxy.owner())); + console.log('Is OrandProviderV2 owner correct?', OWNER === (await orandProviderV3Proxy.owner())); + }, +); + +export default {}; diff --git a/tasks/get-account.ts b/tasks/get-account.ts index ea14ed5..45a87c1 100644 --- a/tasks/get-account.ts +++ b/tasks/get-account.ts @@ -5,7 +5,7 @@ import { HardhatRuntimeEnvironment } from 'hardhat/types'; import { getWallet } from '../helpers/wallet'; task('get:account', 'Get list of accounts').setAction(async (_taskArgs: any, hre: HardhatRuntimeEnvironment) => { - const chains = [1n, 56n, 888888888n, 39n, 97n]; + const chains = [1n, 56n, 888888888n, 39n, 97n, 2484n, 195n, 810181n]; for (let i = 0; i < chains.length; i += 1) { getWallet(hre, chains[i]); } diff --git a/yarn.lock b/yarn.lock index daa7d5b..1358d83 100644 --- a/yarn.lock +++ b/yarn.lock @@ -40,6 +40,11 @@ dependencies: tslib "^2.3.1" +"@balena/dockerignore@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@balena/dockerignore/-/dockerignore-1.0.2.tgz#9ffe4726915251e8eb69f44ef3547e0da2c03e0d" + integrity sha512-wMue2Sy4GAVTk6Ic4tJVcnfdau+gx2EnG7S+uAEe+TWJFqE4YoWN4/H8MSLj4eYJKxGg26lZwboEniNiNwZQ6Q== + "@chainsafe/as-sha256@^0.3.1": version "0.3.1" resolved "https://registry.npmjs.org/@chainsafe/as-sha256/-/as-sha256-0.3.1.tgz" @@ -439,6 +444,18 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" +"@isaacs/cliui@^8.0.2": + version "8.0.2" + resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" + integrity sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA== + dependencies: + string-width "^5.1.2" + string-width-cjs "npm:string-width@^4.2.0" + strip-ansi "^7.0.1" + strip-ansi-cjs "npm:strip-ansi@^6.0.1" + wrap-ansi "^8.1.0" + wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" + "@jridgewell/resolve-uri@^3.0.3": version "3.1.0" resolved "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz" @@ -457,6 +474,130 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" +"@matterlabs/hardhat-zksync-deploy@^1.1.2", "@matterlabs/hardhat-zksync-deploy@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-deploy/-/hardhat-zksync-deploy-1.3.0.tgz#5c2b723318ddf6c4d3929ec225401864ff54557a" + integrity sha512-4UHOgOwIBC4JA3W8DE9GHqbAuBhCPAjtM+Oew1aiYYGkIsPUAMYsH35+4I2FzJsYyE6mD6ATmoS/HfZweQHTlQ== + dependencies: + "@matterlabs/hardhat-zksync-solc" "^1.0.4" + chai "^4.3.6" + chalk "4.1.2" + fs-extra "^11.2.0" + glob "^10.3.10" + lodash "^4.17.21" + sinon "^17.0.1" + sinon-chai "^3.7.0" + ts-morph "^21.0.1" + +"@matterlabs/hardhat-zksync-ethers@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-ethers/-/hardhat-zksync-ethers-1.0.0.tgz#0b455b1434d8395b7ee8f475dbd5cd7e5877e358" + integrity sha512-+po8lqpFVKEwfjanhkUO+PLDmwf/GEBK21vd4X7Pn/g9RLLal1c5m+xhHIVWV99xWPnlHjHIPHZfBf8fN4UasA== + dependencies: + "@matterlabs/hardhat-zksync-deploy" "^1.1.2" + "@matterlabs/hardhat-zksync-solc" "^1.1.2" + chai "^4.2.0" + chalk "5.3.0" + hardhat "^2.19.4" + +"@matterlabs/hardhat-zksync-node@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-node/-/hardhat-zksync-node-1.0.3.tgz#54a8320f912e201ff00aa7aea8a7496a3480f323" + integrity sha512-NPJU8yjaM6OUNQSatEeRkd6gn5kfvv23BlNVuF1vWMfw0Vo5HWM3jx4josRbgzlx2byzNeXDyBHZXNsohOhSVw== + dependencies: + "@matterlabs/hardhat-zksync-solc" "^1.0.5" + axios "^1.6.2" + chai "^4.3.6" + chalk "4.1.2" + fs-extra "^11.1.1" + proxyquire "^2.1.3" + sinon "^17.0.1" + sinon-chai "^3.7.0" + undici "^5.14.0" + +"@matterlabs/hardhat-zksync-solc@^1.0.4", "@matterlabs/hardhat-zksync-solc@^1.0.5", "@matterlabs/hardhat-zksync-solc@^1.1.2", "@matterlabs/hardhat-zksync-solc@^1.1.4": + version "1.1.4" + resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-solc/-/hardhat-zksync-solc-1.1.4.tgz#04a2fad6fb6b6944c64ad969080ee65b9af3f617" + integrity sha512-4/usbogh9neewR2/v8Dn2OzqVblZMUuT/iH2MyPZgPRZYQlL4SlZtMvokU9UQjZT6iSoaKCbbdWESHDHSzfUjA== + dependencies: + "@nomiclabs/hardhat-docker" "^2.0.0" + chai "^4.3.6" + chalk "4.1.2" + debug "^4.3.4" + dockerode "^4.0.2" + fs-extra "^11.1.1" + proper-lockfile "^4.1.2" + semver "^7.5.1" + sinon "^17.0.1" + sinon-chai "^3.7.0" + undici "^5.14.0" + +"@matterlabs/hardhat-zksync-upgradable@^1.4.0", "@matterlabs/hardhat-zksync-upgradable@^1.4.1": + version "1.4.1" + resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-upgradable/-/hardhat-zksync-upgradable-1.4.1.tgz#c758d132b939a9397d73622cedbb9902cd3c2fd4" + integrity sha512-bx8yuR40cwV63YKmPQpCM1RJ/vYPgrVY2SXeknI4nVn3/uKSQ/xK4xCxXJ2RRS0zy5eaVlVpF5uWCFboxH9wKQ== + dependencies: + "@matterlabs/hardhat-zksync-deploy" "^1.3.0" + "@matterlabs/hardhat-zksync-solc" "^1.1.4" + "@openzeppelin/upgrades-core" "^1.31.3" + chalk "4.1.2" + compare-versions "^6.0.0" + ethereumjs-util "^7.1.5" + ethers "^6.7.1" + fs-extra "^7.0.1" + hardhat "^2.19.4" + proper-lockfile "^4.1.1" + solidity-ast "^0.4.51" + zksync-ethers "^6.0.0" + +"@matterlabs/hardhat-zksync-verify@^1.4.2": + version "1.4.3" + resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-verify/-/hardhat-zksync-verify-1.4.3.tgz#fc36d2ea385eab553ce0b3c3fbc9e216c607873f" + integrity sha512-TONID/+mG8KngZ9iI8yiOgC8VD+cus7M+ejCjF4bGNzsmmzsklGJwzry6bQpk8BXqzsMgbuV+4KjDT4JXiS/QA== + dependencies: + "@ethersproject/abi" "^5.1.2" + "@ethersproject/address" "5.7.0" + "@matterlabs/hardhat-zksync-solc" "^1.1.4" + "@nomicfoundation/hardhat-verify" "^2.0.0" + "@openzeppelin/contracts" "^4.9.2" + axios "^1.6.2" + cbor "^8.1.0" + chai "^4.3.6" + chalk "4.1.2" + debug "^4.1.1" + hardhat "^2.19.4" + sinon "^17.0.1" + sinon-chai "^3.7.0" + +"@matterlabs/hardhat-zksync@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync/-/hardhat-zksync-1.0.0.tgz#29b9f20bf895c74ca495f94adaf1b226613eb5d7" + integrity sha512-xxtOG7amWGv8hGadjZix5G33A1tWHSWd7mGprX0eQ3wO0BNJbCw+/QJhIfK+rAx3TTfsPbg3G8AZE9XPrrubTw== + dependencies: + "@matterlabs/hardhat-zksync-deploy" "^1.3.0" + "@matterlabs/hardhat-zksync-ethers" "^1.0.0" + "@matterlabs/hardhat-zksync-node" "^1.0.3" + "@matterlabs/hardhat-zksync-solc" "^1.1.4" + "@matterlabs/hardhat-zksync-upgradable" "^1.4.0" + "@matterlabs/hardhat-zksync-verify" "^1.4.2" + "@matterlabs/zksync-contracts" "^0.6.1" + "@nomicfoundation/hardhat-ethers" "^3.0.4" + "@nomicfoundation/hardhat-verify" "^2.0.0" + "@openzeppelin/contracts" "^4.9.2" + "@openzeppelin/contracts-upgradeable" "^4.9.2" + "@openzeppelin/upgrades-core" "^1.31.3" + chai "^4.3.7" + ethers "^6.7.1" + hardhat "^2.19.4" + sinon "^17.0.1" + sinon-chai "^3.7.0" + zksync-ethers "^6.0.0" + +"@matterlabs/zksync-contracts@^0.6.1": + version "0.6.1" + resolved "https://registry.yarnpkg.com/@matterlabs/zksync-contracts/-/zksync-contracts-0.6.1.tgz#39f061959d5890fd0043a2f1ae710f764b172230" + integrity sha512-+hucLw4DhGmTmQlXOTEtpboYCaOm/X2VJcWmnW4abNcOgQXEHX+mTxQrxEfPjIZT0ZE6z5FTUrOK9+RgUZwBMQ== + "@metamask/eth-sig-util@^4.0.0": version "4.0.1" resolved "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz" @@ -680,6 +821,14 @@ deep-eql "^4.0.1" ordinal "^1.0.3" +"@nomicfoundation/hardhat-ethers@^3.0.4": + version "3.0.6" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-ethers/-/hardhat-ethers-3.0.6.tgz#e8ba7f9719de360c03501b85dae4999bb3a7e1c5" + integrity sha512-/xzkFQAaHQhmIAYOQmvHBPwL+NkwLzT9gRZBsgWUYeV+E6pzXsBQsHfRYbAZ3XEYare+T7S+5Tg/1KDJgepSkA== + dependencies: + debug "^4.1.1" + lodash.isequal "^4.5.0" + "@nomicfoundation/hardhat-ethers@^3.0.5": version "3.0.5" resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-ethers/-/hardhat-ethers-3.0.5.tgz#0422c2123dec7c42e7fb2be8e1691f1d9708db56" @@ -781,12 +930,21 @@ "@nomicfoundation/solidity-analyzer-win32-ia32-msvc" "0.1.0" "@nomicfoundation/solidity-analyzer-win32-x64-msvc" "0.1.0" -"@openzeppelin/contracts-upgradeable@4.9.6": +"@nomiclabs/hardhat-docker@^2.0.0": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-docker/-/hardhat-docker-2.0.2.tgz#ae964be17951275a55859ff7358e9e7c77448846" + integrity sha512-XgGEpRT3wlA1VslyB57zyAHV+oll8KnV1TjwnxxC1tpAL04/lbdwpdO5KxInVN8irMSepqFpsiSkqlcnvbE7Ng== + dependencies: + dockerode "^2.5.8" + fs-extra "^7.0.1" + node-fetch "^2.6.0" + +"@openzeppelin/contracts-upgradeable@4.9.6", "@openzeppelin/contracts-upgradeable@^4.9.2": version "4.9.6" resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.9.6.tgz#38b21708a719da647de4bb0e4802ee235a0d24df" integrity sha512-m4iHazOsOCv1DgM7eD7GupTJ+NFVujRZt1wzddDPSVGpWdKq1SKkla5htKG7+IS4d2XOCtzkUNwRZ7Vq5aEUMA== -"@openzeppelin/contracts@4.9.6": +"@openzeppelin/contracts@4.9.6", "@openzeppelin/contracts@^4.9.2": version "4.9.6" resolved "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.9.6.tgz" integrity sha512-xSmezSupL+y9VkHZJGDoCBpmnB2ogM13ccaYDWqJTfS3dbuHkgjuwDFUmaFauBCboQMGB/S5UqUl2y54X99BmA== @@ -856,7 +1014,7 @@ proper-lockfile "^4.1.1" undici "^6.11.1" -"@openzeppelin/upgrades-core@^1.32.0": +"@openzeppelin/upgrades-core@^1.31.3", "@openzeppelin/upgrades-core@^1.32.0": version "1.33.1" resolved "https://registry.yarnpkg.com/@openzeppelin/upgrades-core/-/upgrades-core-1.33.1.tgz#2e129ce1ab7bd07d07e98822ca8bb8de1d3b008e" integrity sha512-YRxIRhTY1b+j7+NUUu8Uuem5ugxKexEMVd8dBRWNgWeoN1gS1OCrhgUg0ytL+54vzQ+SGWZDfNnzjVuI1Cj1Zw== @@ -882,6 +1040,11 @@ dependencies: safer-buffer "2.1.2" +"@pkgjs/parseargs@^0.11.0": + version "0.11.0" + resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" + integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== + "@scure/base@~1.1.0": version "1.1.1" resolved "https://registry.npmjs.org/@scure/base/-/base-1.1.1.tgz" @@ -989,6 +1152,41 @@ "@sentry/types" "5.30.0" tslib "^1.9.3" +"@sinonjs/commons@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-2.0.0.tgz#fd4ca5b063554307e8327b4564bd56d3b73924a3" + integrity sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg== + dependencies: + type-detect "4.0.8" + +"@sinonjs/commons@^3.0.0", "@sinonjs/commons@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-3.0.1.tgz#1029357e44ca901a615585f6d27738dbc89084cd" + integrity sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ== + dependencies: + type-detect "4.0.8" + +"@sinonjs/fake-timers@^11.2.2": + version "11.2.2" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-11.2.2.tgz#50063cc3574f4a27bd8453180a04171c85cc9699" + integrity sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw== + dependencies: + "@sinonjs/commons" "^3.0.0" + +"@sinonjs/samsam@^8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-8.0.0.tgz#0d488c91efb3fa1442e26abea81759dfc8b5ac60" + integrity sha512-Bp8KUVlLp8ibJZrnvq2foVhP0IVX2CIprMJPK0vqGqgrDa0OHVKeZyBykqskkrdxV6yKBPmGasO8LVjAKR3Gew== + dependencies: + "@sinonjs/commons" "^2.0.0" + lodash.get "^4.4.2" + type-detect "^4.0.8" + +"@sinonjs/text-encoding@^0.7.2": + version "0.7.2" + resolved "https://registry.yarnpkg.com/@sinonjs/text-encoding/-/text-encoding-0.7.2.tgz#5981a8db18b56ba38ef0efb7d995b12aa7b51918" + integrity sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ== + "@smithy/types@^3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@smithy/types/-/types-3.0.0.tgz#00231052945159c64ffd8b91e8909d8d3006cb7e" @@ -1010,6 +1208,16 @@ dependencies: antlr4ts "^0.5.0-alpha.4" +"@ts-morph/common@~0.22.0": + version "0.22.0" + resolved "https://registry.yarnpkg.com/@ts-morph/common/-/common-0.22.0.tgz#8951d451622a26472fbc3a227d6c3a90e687a683" + integrity sha512-HqNBuV/oIlMKdkLshXd1zKBqNQCsuPEsgQOkfFQ/eUKjRlwndXW1AjN9LVkBEIukm00gGXSRmfkl0Wv5VXLnlw== + dependencies: + fast-glob "^3.3.2" + minimatch "^9.0.3" + mkdirp "^3.0.1" + path-browserify "^1.0.1" + "@tsconfig/node10@^1.0.7": version "1.0.9" resolved "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz" @@ -1167,6 +1375,14 @@ dependencies: "@types/node" "*" +JSONStream@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.2.tgz#c102371b6ec3a7cf3b847ca00c20bb0fce4c6dea" + integrity sha512-mn0KSip7N4e0UDPZHnqDsHECo5uGQrixQKnAskOM1BIB8hd7QKbd6il8IPRPudPHOeHiECoCFqhyMaRO9+nWyA== + dependencies: + jsonparse "^1.2.0" + through ">=2.2.7 <3" + abbrev@1: version "1.1.1" resolved "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz" @@ -1308,6 +1524,11 @@ ansi-regex@^5.0.1: resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== +ansi-regex@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" + integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== + ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz" @@ -1322,6 +1543,11 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0: dependencies: color-convert "^2.0.1" +ansi-styles@^6.1.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" + integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== + antlr4ts@^0.5.0-alpha.4: version "0.5.0-alpha.4" resolved "https://registry.npmjs.org/antlr4ts/-/antlr4ts-0.5.0-alpha.4.tgz" @@ -1422,7 +1648,7 @@ asap@~2.0.6: resolved "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz" integrity sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA== -asn1@~0.2.3: +asn1@^0.2.6, asn1@~0.2.3: version "0.2.6" resolved "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz" integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== @@ -1488,7 +1714,7 @@ aws4@^1.8.0: resolved "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz" integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg== -axios@^1.4.0, axios@^1.6.7: +axios@^1.4.0, axios@^1.6.2, axios@^1.6.7: version "1.6.8" resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.8.tgz#66d294951f5d988a00e87a0ffb955316a619ea66" integrity sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ== @@ -1523,7 +1749,7 @@ base64-js@^1.0.2, base64-js@^1.3.1: resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== -bcrypt-pbkdf@^1.0.0: +bcrypt-pbkdf@^1.0.0, bcrypt-pbkdf@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz" integrity sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w== @@ -1552,6 +1778,23 @@ binary-extensions@^2.0.0: resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== +bl@^1.0.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.3.tgz#1e8dd80142eac80d7158c9dccc047fb620e035e7" + integrity sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww== + dependencies: + readable-stream "^2.3.5" + safe-buffer "^5.1.1" + +bl@^4.0.3: + version "4.1.0" + resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" + integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== + dependencies: + buffer "^5.5.0" + inherits "^2.0.4" + readable-stream "^3.4.0" + blakejs@^1.1.0: version "1.2.1" resolved "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz" @@ -1642,6 +1885,24 @@ bs58check@^2.1.2: create-hash "^1.1.0" safe-buffer "^5.1.2" +buffer-alloc-unsafe@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" + integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== + +buffer-alloc@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" + integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== + dependencies: + buffer-alloc-unsafe "^1.1.0" + buffer-fill "^1.0.0" + +buffer-fill@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" + integrity sha512-T7zexNBwiiaCOGDg9xNX9PBmjrubblRkENuptryuI64URkXDFum9il/JGL8Lm8wYfAXpredVXXZz7eMHilimiQ== + buffer-from@^1.0.0: version "1.1.2" resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz" @@ -1661,6 +1922,14 @@ buffer@4.9.2: ieee754 "^1.1.4" isarray "^1.0.0" +buffer@^5.5.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" + integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.1.13" + buffer@^6.0.3: version "6.0.3" resolved "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz" @@ -1669,6 +1938,11 @@ buffer@^6.0.3: base64-js "^1.3.1" ieee754 "^1.2.1" +buildcheck@~0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/buildcheck/-/buildcheck-0.0.6.tgz#89aa6e417cfd1e2196e3f8fe915eb709d2fe4238" + integrity sha512-8f9ZJCUXyT1M35Jx7MkBgmBMo3oHTTBIPLiY9xyL0pl3T5RwcPEY8cUHr5LBNfu/fk6c2T4DJZuVM/8ZZT2D2A== + busboy@^1.6.0: version "1.6.0" resolved "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz" @@ -1746,7 +2020,7 @@ chai-as-promised@^7.1.1: dependencies: check-error "^1.0.2" -chai@^4.2.0: +chai@^4.2.0, chai@^4.3.6, chai@^4.3.7: version "4.4.1" resolved "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz" integrity sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g== @@ -1759,6 +2033,19 @@ chai@^4.2.0: pathval "^1.1.1" type-detect "^4.0.8" +chalk@4.1.2, chalk@^4.1.0: + 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" + +chalk@5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" + integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== + chalk@^2.4.2: version "2.4.2" resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" @@ -1768,14 +2055,6 @@ chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.1.0: - 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" - "charenc@>= 0.0.1": version "0.0.2" resolved "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz" @@ -1823,6 +2102,11 @@ chokidar@3.5.3, chokidar@^3.4.0: optionalDependencies: fsevents "~2.3.2" +chownr@^1.0.1, chownr@^1.1.1: + version "1.1.4" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" + integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== + ci-info@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz" @@ -1880,6 +2164,11 @@ cliui@^7.0.2: strip-ansi "^6.0.0" wrap-ansi "^7.0.0" +code-block-writer@^12.0.0: + version "12.0.0" + resolved "https://registry.yarnpkg.com/code-block-writer/-/code-block-writer-12.0.0.tgz#4dd58946eb4234105aff7f0035977b2afdc2a770" + integrity sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w== + color-convert@^1.9.0: version "1.9.3" resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz" @@ -1956,7 +2245,7 @@ concat-map@0.0.1: resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -concat-stream@^1.6.0, concat-stream@^1.6.2: +concat-stream@^1.6.0, concat-stream@^1.6.2, concat-stream@~1.6.2: version "1.6.2" resolved "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz" integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== @@ -1981,6 +2270,14 @@ core-util-is@~1.0.0: resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz" integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== +cpu-features@~0.0.9: + version "0.0.10" + resolved "https://registry.yarnpkg.com/cpu-features/-/cpu-features-0.0.10.tgz#9aae536db2710c7254d7ed67cb3cbc7d29ad79c5" + integrity sha512-9IkYqtX3YHPCzoVg1Py+o9057a3i0fp7S530UWokCSaFVTc7CwXPRiOjRjBQQ18ZCNafx78YfnG+HALxtVmOGA== + dependencies: + buildcheck "~0.0.6" + nan "^2.19.0" + crc-32@^1.2.0: version "1.2.2" resolved "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz" @@ -2014,6 +2311,15 @@ create-require@^1.1.0: resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== +cross-spawn@^7.0.0: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + "crypt@>= 0.0.1": version "0.0.2" resolved "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz" @@ -2065,13 +2371,20 @@ debug@3.2.6: dependencies: ms "^2.1.1" -debug@4, debug@4.3.4, debug@^4.1.1, debug@^4.3.1, debug@^4.3.3: +debug@4, debug@4.3.4, debug@^4.1.1, debug@^4.3.1, debug@^4.3.3, debug@^4.3.4: version "4.3.4" resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" +debug@^3.2.6: + version "3.2.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" + integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== + dependencies: + ms "^2.1.1" + decamelize@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz" @@ -2158,6 +2471,11 @@ diff@^4.0.1: resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== +diff@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.2.0.tgz#26ded047cd1179b78b9537d5ef725503ce1ae531" + integrity sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A== + difflib@^0.2.4: version "0.2.4" resolved "https://registry.npmjs.org/difflib/-/difflib-0.2.4.tgz" @@ -2172,11 +2490,54 @@ dir-glob@^3.0.1: dependencies: path-type "^4.0.0" +docker-modem@^1.0.8: + version "1.0.9" + resolved "https://registry.yarnpkg.com/docker-modem/-/docker-modem-1.0.9.tgz#a1f13e50e6afb6cf3431b2d5e7aac589db6aaba8" + integrity sha512-lVjqCSCIAUDZPAZIeyM125HXfNvOmYYInciphNrLrylUtKyW66meAjSPXWchKVzoIYZx69TPnAepVSSkeawoIw== + dependencies: + JSONStream "1.3.2" + debug "^3.2.6" + readable-stream "~1.0.26-4" + split-ca "^1.0.0" + +docker-modem@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/docker-modem/-/docker-modem-5.0.3.tgz#50c06f11285289f58112b5c4c4d89824541c41d0" + integrity sha512-89zhop5YVhcPEt5FpUFGr3cDyceGhq/F9J+ZndQ4KfqNvfbJpPMfgeixFgUj5OjCYAboElqODxY5Z1EBsSa6sg== + dependencies: + debug "^4.1.1" + readable-stream "^3.5.0" + split-ca "^1.0.1" + ssh2 "^1.15.0" + +dockerode@^2.5.8: + version "2.5.8" + resolved "https://registry.yarnpkg.com/dockerode/-/dockerode-2.5.8.tgz#1b661e36e1e4f860e25f56e0deabe9f87f1d0acc" + integrity sha512-+7iOUYBeDTScmOmQqpUYQaE7F4vvIt6+gIZNHWhqAQEI887tiPFB9OvXI/HzQYqfUNvukMK+9myLW63oTJPZpw== + dependencies: + concat-stream "~1.6.2" + docker-modem "^1.0.8" + tar-fs "~1.16.3" + +dockerode@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/dockerode/-/dockerode-4.0.2.tgz#dedc8529a1db3ac46d186f5912389899bc309f7d" + integrity sha512-9wM1BVpVMFr2Pw3eJNXrYYt6DT9k0xMcsSCjtPvyQ+xa1iPg/Mo3T/gUcwI0B2cczqCeCYRPF8yFYDwtFXT0+w== + dependencies: + "@balena/dockerignore" "^1.0.2" + docker-modem "^5.0.3" + tar-fs "~2.0.1" + dotenv@^16.3.1: version "16.3.1" resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz" integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ== +eastasianwidth@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" + integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== + ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz" @@ -2208,6 +2569,18 @@ emoji-regex@^8.0.0: resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== +emoji-regex@^9.2.2: + version "9.2.2" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" + integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== + +end-of-stream@^1.0.0, end-of-stream@^1.1.0, end-of-stream@^1.4.1: + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== + dependencies: + once "^1.4.0" + enquirer@^2.3.0: version "2.3.6" resolved "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz" @@ -2568,7 +2941,7 @@ ethers@^5.7.1, ethers@^5.7.2: "@ethersproject/web" "5.7.1" "@ethersproject/wordlists" "5.7.0" -ethers@^6.12.1: +ethers@^6.12.1, ethers@^6.7.1: version "6.12.1" resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.12.1.tgz#517ff6d66d4fd5433e38e903051da3e57c87ff37" integrity sha512-j6wcVoZf06nqEcBbDWkKg8Fp895SS96dSnTCjiXT+8vt2o02raTn4Lo9ERUuIVU5bAjoPYeA+7ytQFexFmLuVw== @@ -2641,6 +3014,17 @@ fast-glob@^3.0.3: merge2 "^1.3.0" micromatch "^4.0.4" +fast-glob@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" + 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" + fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz" @@ -2658,6 +3042,14 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" +fill-keys@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/fill-keys/-/fill-keys-1.0.2.tgz#9a8fa36f4e8ad634e3bf6b4f3c8882551452eb20" + integrity sha512-tcgI872xXjwFF4xgQmLxi76GnwJG3g/3isB1l4/G5Z4zrbddGpBjqZCO9oEAcB5wX0Hj/5iQB3toxfO7in1hHA== + dependencies: + is-object "~1.0.1" + merge-descriptors "~1.0.0" + fill-range@^7.0.1: version "7.0.1" resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz" @@ -2728,6 +3120,14 @@ for-each@^0.3.3: dependencies: is-callable "^1.1.3" +foreground-child@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.1.1.tgz#1d173e776d75d2772fed08efe4a0de1ea1b12d0d" + integrity sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg== + dependencies: + cross-spawn "^7.0.0" + signal-exit "^4.0.1" + forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz" @@ -2770,6 +3170,11 @@ fp-ts@^1.0.0: resolved "https://registry.npmjs.org/fp-ts/-/fp-ts-1.19.5.tgz" integrity sha512-wDNqTimnzs8QqpldiId9OavWK2NptormjXnRJTQecNjzwfyp6P/8s/zG8e4h3ja3oqkKaY72UlTjQYt/1yXf9A== +fs-constants@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" + integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== + fs-extra@^0.30.0: version "0.30.0" resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz" @@ -2781,6 +3186,15 @@ fs-extra@^0.30.0: path-is-absolute "^1.0.0" rimraf "^2.2.8" +fs-extra@^11.1.1, fs-extra@^11.2.0: + version "11.2.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.2.0.tgz#e70e17dfad64232287d01929399e0ea7c86b0e5b" + integrity sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + fs-extra@^7.0.0, fs-extra@^7.0.1: version "7.0.1" resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz" @@ -2979,6 +3393,17 @@ glob@7.2.0: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^10.3.10: + version "10.3.15" + resolved "https://registry.yarnpkg.com/glob/-/glob-10.3.15.tgz#e72bc61bc3038c90605f5dd48543dc67aaf3b50d" + integrity sha512-0c6RlJt1TICLyvJYIApxb8GsXoai0KUP7AxKKAtsYXdgJR1mGEUa7DgwShbdk1nly0PYoZj01xd4hzbq3fsjpw== + dependencies: + foreground-child "^3.1.0" + jackspeak "^2.3.6" + minimatch "^9.0.1" + minipass "^7.0.4" + path-scurry "^1.11.0" + glob@^5.0.15: version "5.0.15" resolved "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz" @@ -3322,7 +3747,7 @@ iconv-lite@0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" -ieee754@^1.1.4, ieee754@^1.2.1: +ieee754@^1.1.13, ieee754@^1.1.4, ieee754@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== @@ -3350,7 +3775,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: +inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3: version "2.0.4" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -3439,6 +3864,13 @@ is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz" integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== +is-core-module@^2.13.0: + version "2.13.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.1.tgz#ad0d7532c6fea9da1ebdc82742d74525c6273384" + integrity sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw== + dependencies: + hasown "^2.0.0" + is-core-module@^2.9.0: version "2.11.0" resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz" @@ -3509,6 +3941,11 @@ is-number@^7.0.0: resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== +is-object@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.2.tgz#a56552e1c665c9e950b4a025461da87e72f86fcf" + integrity sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA== + is-plain-obj@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz" @@ -3585,6 +4022,11 @@ is-weakref@^1.0.2: dependencies: call-bind "^1.0.2" +isarray@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + integrity sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ== + isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" @@ -3613,6 +4055,15 @@ isstream@~0.1.2: resolved "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz" integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g== +jackspeak@^2.3.6: + version "2.3.6" + resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.3.6.tgz#647ecc472238aee4b06ac0e461acc21a8c505ca8" + integrity sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ== + dependencies: + "@isaacs/cliui" "^8.0.2" + optionalDependencies: + "@pkgjs/parseargs" "^0.11.0" + js-cookie@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/js-cookie/-/js-cookie-2.2.1.tgz#69e106dc5d5806894562902aa5baec3744e9b2b8" @@ -3704,6 +4155,11 @@ jsonfile@^6.0.1: optionalDependencies: graceful-fs "^4.1.6" +jsonparse@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== + jsonschema@^1.2.4: version "1.4.1" resolved "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.1.tgz" @@ -3719,6 +4175,11 @@ jsprim@^1.2.2: json-schema "0.4.0" verror "1.10.0" +just-extend@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/just-extend/-/just-extend-6.2.0.tgz#b816abfb3d67ee860482e7401564672558163947" + integrity sha512-cYofQu2Xpom82S6qD778jBDpwvvy39s1l/hrYij2u9AMdQcGRpaBu6kY4mVhuno5kJVi1DAz4aiphA2WI1/OAw== + keccak@^3.0.0, keccak@^3.0.2: version "3.0.3" resolved "https://registry.npmjs.org/keccak/-/keccak-3.0.3.tgz" @@ -3802,6 +4263,11 @@ lodash.clonedeep@^4.5.0: resolved "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz" integrity sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ== +lodash.get@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" + integrity sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ== + lodash.isequal@^4.5.0: version "4.5.0" resolved "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz" @@ -3839,6 +4305,11 @@ loupe@^2.3.6: dependencies: get-func-name "^2.0.1" +lru-cache@^10.2.0: + version "10.2.2" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.2.2.tgz#48206bc114c1252940c41b25b41af5b545aca878" + integrity sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ== + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz" @@ -3896,6 +4367,11 @@ memorystream@^0.3.1: resolved "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz" integrity sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw== +merge-descriptors@~1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.3.tgz#d80319a65f3c7935351e5cfdac8f9318504dbed5" + integrity sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ== + merge2@^1.2.3, merge2@^1.3.0: version "1.4.1" resolved "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz" @@ -3957,11 +4433,28 @@ minimatch@5.0.1: dependencies: brace-expansion "^2.0.1" +minimatch@^9.0.1, minimatch@^9.0.3: + version "9.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.4.tgz#8e49c731d1749cbec05050ee5145147b32496a51" + integrity sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw== + dependencies: + brace-expansion "^2.0.1" + minimist@^1.2.5, minimist@^1.2.6, minimist@^1.2.7: version "1.2.8" resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== +"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.0.4: + version "7.1.1" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.1.tgz#f7f85aff59aa22f110b20e27692465cf3bf89481" + integrity sha512-UZ7eQ+h8ywIRAW1hIEl2AqdwzJucU/Kp59+8kkZeSvafXhZjul247BvIJjEVFVeON6d7lM46XX1HXCduKAS8VA== + +mkdirp-classic@^0.5.2: + version "0.5.3" + resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" + integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== + mkdirp@0.5.5: version "0.5.5" resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz" @@ -3969,7 +4462,7 @@ mkdirp@0.5.5: dependencies: minimist "^1.2.5" -mkdirp@0.5.x: +mkdirp@0.5.x, mkdirp@^0.5.1: version "0.5.6" resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz" integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== @@ -3981,6 +4474,11 @@ mkdirp@^1.0.4: resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== +mkdirp@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-3.0.1.tgz#e44e4c5607fb279c168241713cc6e0fea9adcb50" + integrity sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg== + mnemonist@^0.38.0: version "0.38.5" resolved "https://registry.npmjs.org/mnemonist/-/mnemonist-0.38.5.tgz" @@ -4050,6 +4548,11 @@ module-error@^1.0.1, module-error@^1.0.2: resolved "https://registry.npmjs.org/module-error/-/module-error-1.0.2.tgz" integrity sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA== +module-not-found-error@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/module-not-found-error/-/module-not-found-error-1.0.1.tgz#cf8b4ff4f29640674d6cdd02b0e3bc523c2bbdc0" + integrity sha512-pEk4ECWQXV6z2zjhRZUongnLJNUeGQJ3w6OQ5ctGwD+i5o93qjRQUk2Rt6VdNeu3sEP0AB4LcfvdebpxBRVr4g== + ms@2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz" @@ -4065,6 +4568,11 @@ ms@2.1.3, ms@^2.1.1: resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== +nan@^2.18.0, nan@^2.19.0: + version "2.19.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.19.0.tgz#bb58122ad55a6c5bc973303908d5b16cfdd5a8c0" + integrity sha512-nO1xXxfh/RWNxfd/XPfbIfFk5vgLsAxUR9y5O0cHMJu/AW9U95JLXqthYHjEp+8gQ5p96K9jUp8nbVOxCdRbtw== + nanoid@3.3.3: version "3.3.3" resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz" @@ -4080,6 +4588,17 @@ neo-async@^2.6.0: resolved "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== +nise@^5.1.9: + version "5.1.9" + resolved "https://registry.yarnpkg.com/nise/-/nise-5.1.9.tgz#0cb73b5e4499d738231a473cd89bd8afbb618139" + integrity sha512-qOnoujW4SV6e40dYxJOb3uvuoPHtmLzIk4TFo+j0jPJoC+5Z9xja5qH5JZobEPsa8+YYphMrOSwnrshEhG2qww== + dependencies: + "@sinonjs/commons" "^3.0.0" + "@sinonjs/fake-timers" "^11.2.2" + "@sinonjs/text-encoding" "^0.7.2" + just-extend "^6.2.0" + path-to-regexp "^6.2.1" + node-addon-api@^2.0.0: version "2.0.2" resolved "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz" @@ -4207,7 +4726,7 @@ obliterator@^2.0.0: resolved "https://registry.npmjs.org/obliterator/-/obliterator-2.0.4.tgz" integrity sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ== -once@1.x, once@^1.3.0: +once@1.x, once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== @@ -4300,6 +4819,11 @@ parse-cache-control@^1.0.1: resolved "https://registry.npmjs.org/parse-cache-control/-/parse-cache-control-1.0.1.tgz" integrity sha512-60zvsJReQPX5/QP0Kzfd/VrpjScIQ7SHBW6bFCYfEP+fp0Eppr1SHhIO5nd1PjZtvclzSzES9D/p5nFJurwfWg== +path-browserify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" + integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== + path-exists@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz" @@ -4315,11 +4839,29 @@ path-is-absolute@^1.0.0: resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== +path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + path-parse@^1.0.6, path-parse@^1.0.7: version "1.0.7" resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== +path-scurry@^1.11.0: + version "1.11.1" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.11.1.tgz#7960a668888594a0720b12a911d1a742ab9f11d2" + integrity sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA== + dependencies: + lru-cache "^10.2.0" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + +path-to-regexp@^6.2.1: + version "6.2.2" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-6.2.2.tgz#324377a83e5049cbecadc5554d6a63a9a4866b36" + integrity sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw== + path-type@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz" @@ -4383,7 +4925,7 @@ promise@^8.0.0: dependencies: asap "~2.0.6" -proper-lockfile@^4.1.1: +proper-lockfile@^4.1.1, proper-lockfile@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/proper-lockfile/-/proper-lockfile-4.1.2.tgz#c8b9de2af6b2f1601067f98e01ac66baa223141f" integrity sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA== @@ -4397,11 +4939,36 @@ proxy-from-env@^1.1.0: resolved "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz" integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== +proxyquire@^2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/proxyquire/-/proxyquire-2.1.3.tgz#2049a7eefa10a9a953346a18e54aab2b4268df39" + integrity sha512-BQWfCqYM+QINd+yawJz23tbBM40VIGXOdDw3X344KcclI/gtBbdWF6SlQ4nK/bYhF9d27KYug9WzljHC6B9Ysg== + dependencies: + fill-keys "^1.0.2" + module-not-found-error "^1.0.1" + resolve "^1.11.1" + psl@^1.1.28: version "1.9.0" resolved "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz" integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== +pump@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/pump/-/pump-1.0.3.tgz#5dfe8311c33bbf6fc18261f9f34702c47c08a954" + integrity sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + punycode@^2.1.0, punycode@^2.1.1: version "2.3.0" resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz" @@ -4441,7 +5008,7 @@ raw-body@^2.4.1: iconv-lite "0.4.24" unpipe "1.0.0" -readable-stream@^2.2.2: +readable-stream@^2.2.2, readable-stream@^2.3.0, readable-stream@^2.3.5: version "2.3.8" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz" integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== @@ -4454,6 +5021,15 @@ readable-stream@^2.2.2: string_decoder "~1.1.1" util-deprecate "~1.0.1" +readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.5.0: + version "3.6.2" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" + integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + readable-stream@^3.6.0: version "3.6.1" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.1.tgz" @@ -4463,6 +5039,16 @@ readable-stream@^3.6.0: string_decoder "^1.1.1" util-deprecate "^1.0.1" +readable-stream@~1.0.26-4: + version "1.0.34" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" + integrity sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + readdirp@~3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz" @@ -4612,6 +5198,15 @@ resolve@^1.1.6: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" +resolve@^1.11.1: + version "1.22.8" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" + integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== + dependencies: + is-core-module "^2.13.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + retry@0.13.1: version "0.13.1" resolved "https://registry.yarnpkg.com/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" @@ -4767,6 +5362,11 @@ semver@^7.3.4: dependencies: lru-cache "^6.0.0" +semver@^7.5.1: + version "7.6.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13" + integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w== + serialize-javascript@6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz" @@ -4832,6 +5432,18 @@ sha1@^1.1.1: charenc ">= 0.0.1" crypt ">= 0.0.1" +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + shelljs@^0.8.3: version "0.8.5" resolved "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz" @@ -4855,6 +5467,28 @@ signal-exit@^3.0.2: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== +signal-exit@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== + +sinon-chai@^3.7.0: + version "3.7.0" + resolved "https://registry.yarnpkg.com/sinon-chai/-/sinon-chai-3.7.0.tgz#cfb7dec1c50990ed18c153f1840721cf13139783" + integrity sha512-mf5NURdUaSdnatJx3uhoBOrY9dtL19fiOtAdT1Azxg3+lNJFiuN0uzaU3xX1LeAfL17kHQhTAJgpsfhbMJMY2g== + +sinon@^17.0.1: + version "17.0.2" + resolved "https://registry.yarnpkg.com/sinon/-/sinon-17.0.2.tgz#470894bcc2d24b01bad539722ea46da949892405" + integrity sha512-uihLiaB9FhzesElPDFZA7hDcNABzsVHwr3YfmM9sBllVwab3l0ltGlRV1XhpNfIacNDLGD1QRZNLs5nU5+hTuA== + dependencies: + "@sinonjs/commons" "^3.0.1" + "@sinonjs/fake-timers" "^11.2.2" + "@sinonjs/samsam" "^8.0.0" + diff "^5.2.0" + nise "^5.1.9" + supports-color "^7" + slash@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz" @@ -4937,11 +5571,27 @@ source-map@~0.2.0: dependencies: amdefine ">=0.0.4" +split-ca@^1.0.0, split-ca@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/split-ca/-/split-ca-1.0.1.tgz#6c83aff3692fa61256e0cd197e05e9de157691a6" + integrity sha512-Q5thBSxp5t8WPTTJQS59LrGqOZqOsrhDGDVm8azCqIBjSBd7nd9o2PM+mDulQQkh8h//4U6hFZnc/mul8t5pWQ== + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== +ssh2@^1.15.0: + version "1.15.0" + resolved "https://registry.yarnpkg.com/ssh2/-/ssh2-1.15.0.tgz#2f998455036a7f89e0df5847efb5421748d9871b" + integrity sha512-C0PHgX4h6lBxYx7hcXwu3QWdh4tg6tZZsTfXcdvc5caW/EMxaB4H9dWsl7qk+F7LAW762hp8VbXOX7x4xUYvEw== + dependencies: + asn1 "^0.2.6" + bcrypt-pbkdf "^1.0.2" + optionalDependencies: + cpu-features "~0.0.9" + nan "^2.18.0" + sshpk@^1.7.0: version "1.17.0" resolved "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz" @@ -4984,6 +5634,15 @@ string-format@^2.0.0: resolved "https://registry.npmjs.org/string-format/-/string-format-2.0.0.tgz" integrity sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA== +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + 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" + "string-width@^1.0.2 || 2", string-width@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz" @@ -5010,6 +5669,15 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" +string-width@^5.0.1, string-width@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" + integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== + dependencies: + eastasianwidth "^0.2.0" + emoji-regex "^9.2.2" + strip-ansi "^7.0.1" + string.prototype.trim@^1.2.9: version "1.2.9" resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz#b6fa326d72d2c78b6df02f7759c73f8f6274faa4" @@ -5063,6 +5731,11 @@ string_decoder@^1.1.1: dependencies: safe-buffer "~5.2.0" +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + integrity sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ== + string_decoder@~1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" @@ -5070,6 +5743,13 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz" @@ -5091,6 +5771,13 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" +strip-ansi@^7.0.1: + version "7.1.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" + integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== + dependencies: + ansi-regex "^6.0.1" + strip-hex-prefix@1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz" @@ -5136,7 +5823,7 @@ supports-color@^5.3.0: dependencies: has-flag "^3.0.0" -supports-color@^7.1.0: +supports-color@^7, supports-color@^7.1.0: version "7.2.0" resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz" integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== @@ -5185,6 +5872,50 @@ table@^6.8.0: string-width "^4.2.3" strip-ansi "^6.0.1" +tar-fs@~1.16.3: + version "1.16.3" + resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-1.16.3.tgz#966a628841da2c4010406a82167cbd5e0c72d509" + integrity sha512-NvCeXpYx7OsmOh8zIOP/ebG55zZmxLE0etfWRbWok+q2Qo8x/vOR/IJT1taADXPe+jsiu9axDb3X4B+iIgNlKw== + dependencies: + chownr "^1.0.1" + mkdirp "^0.5.1" + pump "^1.0.0" + tar-stream "^1.1.2" + +tar-fs@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.0.1.tgz#e44086c1c60d31a4f0cf893b1c4e155dabfae9e2" + integrity sha512-6tzWDMeroL87uF/+lin46k+Q+46rAJ0SyPGz7OW7wTgblI273hsBqk2C1j0/xNadNLKDTUL9BukSjB7cwgmlPA== + dependencies: + chownr "^1.1.1" + mkdirp-classic "^0.5.2" + pump "^3.0.0" + tar-stream "^2.0.0" + +tar-stream@^1.1.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.2.tgz#8ea55dab37972253d9a9af90fdcd559ae435c555" + integrity sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A== + dependencies: + bl "^1.0.0" + buffer-alloc "^1.2.0" + end-of-stream "^1.0.0" + fs-constants "^1.0.0" + readable-stream "^2.3.0" + to-buffer "^1.1.1" + xtend "^4.0.0" + +tar-stream@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.2.0.tgz#acad84c284136b060dc3faa64474aa9aebd77287" + integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ== + dependencies: + bl "^4.0.3" + end-of-stream "^1.4.1" + fs-constants "^1.0.0" + inherits "^2.0.3" + readable-stream "^3.1.1" + then-request@^6.0.0: version "6.0.2" resolved "https://registry.npmjs.org/then-request/-/then-request-6.0.2.tgz" @@ -5202,6 +5933,11 @@ then-request@^6.0.0: promise "^8.0.0" qs "^6.4.0" +"through@>=2.2.7 <3": + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== + tmp@0.0.33: version "0.0.33" resolved "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz" @@ -5209,6 +5945,11 @@ tmp@0.0.33: dependencies: os-tmpdir "~1.0.2" +to-buffer@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" + integrity sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg== + to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz" @@ -5250,6 +5991,14 @@ ts-essentials@^7.0.1: resolved "https://registry.npmjs.org/ts-essentials/-/ts-essentials-7.0.3.tgz" integrity sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ== +ts-morph@^21.0.1: + version "21.0.1" + resolved "https://registry.yarnpkg.com/ts-morph/-/ts-morph-21.0.1.tgz#712302a0f6e9dbf1aa8d9cf33a4386c4b18c2006" + integrity sha512-dbDtVdEAncKctzrVZ+Nr7kHpHkv+0JDJb2MjjpBaj8bFeCkePU9rHfMklmhuLFnpeq/EJZk2IhStY6NzqgjOkg== + dependencies: + "@ts-morph/common" "~0.22.0" + code-block-writer "^12.0.0" + ts-node@^10.9.2: version "10.9.2" resolved "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz" @@ -5318,7 +6067,7 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" -type-detect@^4.0.0, type-detect@^4.0.8: +type-detect@4.0.8, type-detect@^4.0.0, type-detect@^4.0.8: 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== @@ -5598,6 +6347,13 @@ which@1.3.1, which@^1.1.1, which@^1.3.1: dependencies: isexe "^2.0.0" +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + wide-align@1.1.3: version "1.1.3" resolved "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz" @@ -5628,6 +6384,15 @@ workerpool@6.2.1: resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^5.1.0: version "5.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz" @@ -5646,6 +6411,15 @@ wrap-ansi@^7.0.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" + integrity sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ== + dependencies: + ansi-styles "^6.1.0" + string-width "^5.0.1" + strip-ansi "^7.0.1" + wrappy@1: version "1.0.2" resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" @@ -5671,6 +6445,11 @@ xmlhttprequest@1.8.0: resolved "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz" integrity sha512-58Im/U0mlVBLM38NdZjHyhuMtCqa61469k2YP/AaPbvCoV9aQGUpbJBj1QRm2ytRiVQBD/fsw7L2bJGDVQswBA== +xtend@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== + y18n@^4.0.0: version "4.0.3" resolved "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz" @@ -5766,3 +6545,8 @@ yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +zksync-ethers@^6.0.0, zksync-ethers@^6.7.1: + version "6.7.1" + resolved "https://registry.yarnpkg.com/zksync-ethers/-/zksync-ethers-6.7.1.tgz#ebfaa48b8467d6ee36f28e3f1e32f432ea953ac5" + integrity sha512-JBYxQLkA/jCFvZwjtKBecnlMy+0Mw3/q9xXjTfM4R6qspl/tKhCiKney61Q6hDkopm7x8SEq1gzH8HwzfZHHgw== From d3d918d5b610c2bec682ad99a3dea14e7dc8b0a4 Mon Sep 17 00:00:00 2001 From: dqtkien Date: Thu, 16 May 2024 01:51:17 +0700 Subject: [PATCH 05/13] Fix hardhat config to run with & without zkSolc --- hardhat.config.ts | 4 +++- package.json | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index 5738553..5676018 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -7,6 +7,8 @@ import '@matterlabs/hardhat-zksync'; import '@matterlabs/hardhat-zksync-deploy'; import '@matterlabs/hardhat-zksync-solc'; +const isZkSolc = process.env.USE_ZKSOLC === 'true'; + if (fs.existsSync('./typechain-types')) { const dir = fs.opendirSync(`${__dirname}/tasks`); for (let entry = dir.readSync(); entry !== null; entry = dir.readSync()) { @@ -161,7 +163,7 @@ const config: HardhatUserConfig = { // Hard hat network hardhat: { - zksync: true, + zksync: isZkSolc, chainId: 911, hardfork: 'london', blockGasLimit: 30000000, diff --git a/package.json b/package.json index 0b1bde7..09a22ff 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,8 @@ "scripts": { "compile": "rm -rf ./cache ./artifacts ./typechain-types ./flatten && hardhat compile", "build": "yarn run compile && hardhat typechain && yarn flatten", + "compile:zk": "rm -rf ./cache-zk ./artifacts-zk ./typechain-types ./flatten ./deployments-zk ./.upgradable && USE_ZKSOLC=true hardhat compile", + "build:zk": "yarn run compile:zk && hardhat typechain && yarn flatten", "prepack": "bash ./scripts/prepack.sh", "clean": "hardhat clean && rimraf build contracts/build", "release": "yarn build && yarn flatten", From c719c70b220e779449f4e3a52eb5de542a5be690 Mon Sep 17 00:00:00 2001 From: dqtkien Date: Fri, 17 May 2024 16:11:42 +0700 Subject: [PATCH 06/13] Add Dice game to test new smart contracts --- contracts/examples/DiceGameV3.sol | 161 ++++++ contracts/test/TestNFT.sol | 9 + package/IOrandConsumerV3.sol | 12 + package/IOrocleAggregatorV2.sol | 69 +++ package/devel.js | 17 +- package/package.json | 6 +- package/src/AbiOrandProviderV2.ts | 2 +- package/src/OrandProviderV2.ts | 10 +- package/src/OrandProviderV3.ts | 891 ++++++++++++++++++++++++++++++ package/src/OrocleV2.ts | 680 +++++++++++++++++++++++ package/src/index.ts | 6 +- tasks/deploy-dice-game-v3.ts | 23 + tasks/test-dice-game-v3.ts | 20 + 13 files changed, 1898 insertions(+), 8 deletions(-) create mode 100644 contracts/examples/DiceGameV3.sol create mode 100644 contracts/test/TestNFT.sol create mode 100644 package/IOrandConsumerV3.sol create mode 100644 package/IOrocleAggregatorV2.sol create mode 100644 package/src/OrandProviderV3.ts create mode 100644 package/src/OrocleV2.ts create mode 100644 tasks/deploy-dice-game-v3.ts create mode 100644 tasks/test-dice-game-v3.ts diff --git a/contracts/examples/DiceGameV3.sol b/contracts/examples/DiceGameV3.sol new file mode 100644 index 0000000..7234a11 --- /dev/null +++ b/contracts/examples/DiceGameV3.sol @@ -0,0 +1,161 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.0; +import '@openzeppelin/contracts/access/Ownable.sol'; +import '@orochi-network/contracts/IOrandConsumerV3.sol'; +import '@orochi-network/contracts/IOrocleAggregatorV2.sol'; + +error WrongGuessingValue(uint128 guessing); + +// Application should be an implement of IOrandConsumerV2 interface +contract DiceGameV3 is IOrandConsumerV3, Ownable { + // Set new provider + event SetProvider(address indexed oldProvider, address indexed newProvider); + + // Set new oracle + event SetOracle(address indexed oldProvider, address indexed newProvider); + + // Fulfill awaiting result + event Fulfilled(uint256 indexed gameId, uint256 guessed, uint256 indexed result); + + // New guess from player + event NewGuess(address indexed player, uint256 indexed gameId, uint128 indexed guessed); + + // Game structure + struct Game { + uint128 guessed; + uint128 result; + } + + // Provider address + address private orandProvider; + + // Orochi Network oracle + address private oracle; + + // Game result storage + mapping(uint256 => Game) private gameResult; + + // Total game + uint256 private totalGame; + + // Fulfiled randomness + uint256 private fulfilled; + + // We batching the radomness in one epoch + uint256 private maximumBatching; + + // Only allow Orand to submit result + modifier onlyOrandProvider() { + if (msg.sender != orandProvider) { + revert InvalidProvider(); + } + _; + } + + // Constructor + constructor(address provider, address oracleAddress) { + _setProvider(provider); + _setOracle(oracleAddress); + } + + //=======================[ Internal ]==================== + + // Set provider + function _setOracle(address oracleAddress) internal { + emit SetOracle(oracle, oracleAddress); + oracle = oracleAddress; + } + + // Set provider + function _getOracle() internal view returns (address) { + return oracle; + } + + // Set provider + function _setProvider(address provider) internal { + emit SetProvider(orandProvider, provider); + orandProvider = provider; + } + + // Set provider + function _getProvider() internal view returns (address) { + return orandProvider; + } + + //=======================[ Owner ]==================== + + // Set provider + function setProvider(address provider) external onlyOwner returns (bool) { + _setProvider(provider); + return true; + } + + // Set oracle + function setOracle(address oracleAddress) external onlyOwner returns (bool) { + _setOracle(oracleAddress); + return true; + } + + //=======================[ OrandProviderV2 ]==================== + + // Consume the result of Orand V2 with batching feature + function consumeRandomness(uint256 randomness) external override onlyOrandProvider returns (bool) { + // We keep batching < maximumBatching + if (fulfilled < totalGame) { + Game memory currentGame = gameResult[fulfilled]; + currentGame.result = uint128((randomness % 6) + 1); + gameResult[fulfilled] = currentGame; + emit Fulfilled(fulfilled, currentGame.guessed, currentGame.result); + fulfilled += 1; + return true; + } + // We will let the provider know that all are fulfilled + return false; + } + + //=======================[ External ]==================== + + // Player can guessing any number in range of 1-6 + function guessingDiceNumber(uint128 guessing) external returns (bool) { + // Player only able to guessing between 1-6 since it's dice number + if (guessing < 1 || guessing > 6) { + revert WrongGuessingValue(guessing); + } + gameResult[totalGame] = Game({ guessed: guessing, result: 0 }); + + // Request randomness from Orand + IOrocleAggregatorV2(oracle).request(0, '0x'); + + emit NewGuess(msg.sender, totalGame, guessing); + totalGame += 1; + return true; + } + + //=======================[ External View ]==================== + + // Get provider + function getProvider() external view returns (address) { + return _getProvider(); + } + + // Get oracle + function getOracle() external view returns (address) { + return _getOracle(); + } + + // Get result from smart contract + function getResult(uint256 gameId) external view returns (Game memory result) { + return gameResult[gameId]; + } + + function getStateOfGame() external view returns (uint256 fulfill, uint256 total) { + return (fulfilled, totalGame); + } + + function isFulfilled() external view returns (bool) { + if (fulfilled < totalGame){ + return false; + } + return true; + } +} diff --git a/contracts/test/TestNFT.sol b/contracts/test/TestNFT.sol new file mode 100644 index 0000000..4e0244a --- /dev/null +++ b/contracts/test/TestNFT.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.19; + +import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; + +// An ambition is hiding in the bush +contract TestNFT is ERC721 { + constructor() ERC721('TestBigO', 'TestO') {} +} diff --git a/package/IOrandConsumerV3.sol b/package/IOrandConsumerV3.sol new file mode 100644 index 0000000..ac62538 --- /dev/null +++ b/package/IOrandConsumerV3.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.0; + +error InvalidProvider(); + +interface IOrandConsumerV3 { + // Consume the verifiable randomness from Orand provider + // Return false if you want to stop batching + function consumeRandomness(uint256 randomness) external returns (bool); + // Return true if all requests are fulfilled otherwise return false + function isFulfilled() external returns (bool); +} diff --git a/package/IOrocleAggregatorV2.sol b/package/IOrocleAggregatorV2.sol new file mode 100644 index 0000000..f6a59a5 --- /dev/null +++ b/package/IOrocleAggregatorV2.sol @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.0; + +error ExistedApplication(uint32 appId); +error InvalidApplication(uint32 appId); +error InvalidApplicationName(bytes24 appName); +error InvalidRoundNumber(uint64 round, uint64 requiredRound); +error UndefinedRound(uint64 round); +error InvalidDataLength(uint256 length); +error UnableToPublishData(bytes data); +error DeactivatedUser(address user); + +interface IOrocleAggregatorV2 { + /** + * Emit event when a new request is created + * @param identifier Data identifier + * @param data Data + */ + function request(uint256 identifier, bytes calldata data) external returns (bool); + + /** + * Fulfill request + * @param identifier Data identifier + * @param data Data + */ + function fulfill(uint256 identifier, bytes calldata data) external returns (bool); + + /** + * Check if user is deactivated + * @param user User address + * @return status + */ + function isDeactivated(address user) external view returns (bool); + + /** + * Get round of a given application + * @param appId Application ID + * @return round + */ + function getMetadata(uint32 appId, bytes20 identifier) external view returns (uint64 round, uint64 lastUpdate); + + /** + * Get data of an application + * @param appId Application ID + * @param round Round number + * @param identifier Data identifier + * @return data Data + */ + function getData(uint32 appId, uint64 round, bytes20 identifier) external view returns (bytes32 data); + + /** + * Get latest data of an application + * @param appId Application ID + * @param identifier Data identifier + * @return data + */ + function getLatestData(uint32 appId, bytes20 identifier) external view returns (bytes32 data); + + /** + * Get latest data of an application + * @param appId Application ID + * @param identifier Data identifier + * @return round lastUpdate data + */ + function getLatestRound( + uint32 appId, + bytes20 identifier + ) external view returns (uint64 round, uint64 lastUpdate, bytes32 data); +} diff --git a/package/devel.js b/package/devel.js index a7bb925..868eede 100755 --- a/package/devel.js +++ b/package/devel.js @@ -63,6 +63,9 @@ cp('../typechain-types/common.ts', './src/common.ts'); cp('../contracts/orand-v2/interfaces/IOrandConsumerV2.sol', './IOrandConsumerV2.sol'); cp('../contracts/orocle-v1/interfaces/IOrocleAggregatorV1.sol', './IOrocleAggregatorV1.sol'); +cp('../contracts/orand-v3/interfaces/IOrandConsumerV3.sol', './IOrandConsumerV3.sol'); +cp('../contracts/orocle-v2/interfaces/IOrocleAggregatorV2.sol', './IOrocleAggregatorV2.sol'); + cpAbi('../artifacts/contracts/orosign/OrosignMasterV1.sol/OrosignMasterV1.json', './src/AbiOrosignMasterV1.ts'); cpAbi('../artifacts/contracts/orosign/OrosignV1.sol/OrosignV1.json', './src/AbiOrosignV1.ts'); cpAbi('../artifacts/contracts/multicast/MultiCast.sol/Multicast.json', './src/AbiMulticast.ts'); @@ -71,6 +74,9 @@ cpAbi('../artifacts/@openzeppelin/contracts/token/ERC721/ERC721.sol/ERC721.json' cpAbi('../artifacts/contracts/orocle-v1/OrocleV1.sol/OrocleV1.json', './src/AbiOrocleV1.ts'); cpAbi('../artifacts/contracts/orand-v2/OrandProviderV2.sol/OrandProviderV2.json', './src/AbiOrandProviderV2.ts'); +cpAbi('../artifacts/contracts/orocle-v2/OrocleV2.sol/OrocleV2.json', './src/OrocleV2.ts'); +cpAbi('../artifacts/contracts/orand-v3/OrandProviderV3.sol/OrandProviderV3.json', './src/OrandProviderV3.ts'); + cpTypes('../typechain-types/contracts/orosign/OrosignMasterV1.ts', './src/OrosignMasterV1.ts'); cpTypes('../typechain-types/contracts/orosign/OrosignV1.ts', './src/OrosignV1.ts'); cpTypes('../typechain-types/contracts/multicast/MultiCast.sol/Multicast.ts', './src/Multicast.ts'); @@ -78,6 +84,8 @@ cpTypes('../typechain-types/@openzeppelin/contracts/token/ERC20/ERC20.ts', './sr cpTypes('../typechain-types/@openzeppelin/contracts/token/ERC721/ERC721.ts', './src/ERC721.ts'); cpTypes('../typechain-types/contracts/orocle-v1/OrocleV1.ts', './src/OrocleV1.ts'); cpTypes('../typechain-types/contracts/orand-v2/OrandProviderV2.ts', './src/OrandProviderV2.ts'); +cpTypes('../typechain-types/contracts/orocle-v2/OrocleV2.ts', './src/OrocleV2.ts'); +cpTypes('../typechain-types/contracts/orand-v3/OrandProviderV3.ts', './src/OrandProviderV3.ts'); fs.writeFileSync( './src/index.ts', @@ -85,7 +93,14 @@ fs.writeFileSync( typesList .map((e) => `export { ${path.basename(e, '.ts')} } from '${e.replace('.ts', '').replace('./src/', './')}';`) .join('\n'), - tsFileList.map((e) => `export * from '${e.replace('.ts', '').replace('./src/', './')}';`).join('\n'), + tsFileList + .map((e) => { + if (e.includes('OrandProviderV3')) { + return `export * as OrandProviderV3Package from './OrandProviderV3';`; + } + return `export * from '${e.replace('.ts', '').replace('./src/', './')}';`; + }) + .join('\n'), ].join('\n'), ); diff --git a/package/package.json b/package/package.json index 63e1571..1c6bf1e 100644 --- a/package/package.json +++ b/package/package.json @@ -1,6 +1,6 @@ { "name": "@orochi-network/contracts", - "version": "1.3.4", + "version": "1.3.5", "description": "Orochi smart contracts for on-chain verification", "types": "./build/esm/index.d.ts", "module": "./build/esm/index.js", @@ -18,7 +18,7 @@ "exports": { ".": { "types": "./build/esm/index.d.ts", - "require": "./build/cjs/index.js", + "default": "./build/cjs/index.js", "import": "./build/esm/index.js" } }, @@ -33,4 +33,4 @@ "devDependencies": { "typescript": "^5.4.5" } -} \ No newline at end of file +} diff --git a/package/src/AbiOrandProviderV2.ts b/package/src/AbiOrandProviderV2.ts index 276246e..4cbf4e6 100644 --- a/package/src/AbiOrandProviderV2.ts +++ b/package/src/AbiOrandProviderV2.ts @@ -528,7 +528,7 @@ export const AbiOrandProviderV2 = [ "inputs": [ { "internalType": "address", - "name": "receiver", + "name": "receiverAddress", "type": "address" }, { diff --git a/package/src/OrandProviderV2.ts b/package/src/OrandProviderV2.ts index 0dcbe3e..6be1341 100644 --- a/package/src/OrandProviderV2.ts +++ b/package/src/OrandProviderV2.ts @@ -471,7 +471,10 @@ export interface OrandProviderV2 extends BaseContract { owner: TypedContractMethod<[], [string], "view">; publish: TypedContractMethod< - [receiver: AddressLike, ecvrfProof: IOrandProviderV2.ECVRFProofStruct], + [ + receiverAddress: AddressLike, + ecvrfProof: IOrandProviderV2.ECVRFProofStruct + ], [boolean], "nonpayable" >; @@ -594,7 +597,10 @@ export interface OrandProviderV2 extends BaseContract { getFunction( nameOrSignature: "publish" ): TypedContractMethod< - [receiver: AddressLike, ecvrfProof: IOrandProviderV2.ECVRFProofStruct], + [ + receiverAddress: AddressLike, + ecvrfProof: IOrandProviderV2.ECVRFProofStruct + ], [boolean], "nonpayable" >; diff --git a/package/src/OrandProviderV3.ts b/package/src/OrandProviderV3.ts new file mode 100644 index 0000000..212b0fe --- /dev/null +++ b/package/src/OrandProviderV3.ts @@ -0,0 +1,891 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "./common"; + +export declare namespace IOrandECDSAV3 { + export type OrandECDSAProofStruct = { + signer: AddressLike; + receiverAddress: AddressLike; + receiverEpoch: BigNumberish; + ecvrfProofDigest: BigNumberish; + }; + + export type OrandECDSAProofStructOutput = [ + signer: string, + receiverAddress: string, + receiverEpoch: bigint, + ecvrfProofDigest: bigint + ] & { + signer: string; + receiverAddress: string; + receiverEpoch: bigint; + ecvrfProofDigest: bigint; + }; +} + +export declare namespace IOrandProviderV3 { + export type ECVRFProofStruct = { + gamma: [BigNumberish, BigNumberish]; + c: BigNumberish; + s: BigNumberish; + alpha: BigNumberish; + uWitness: AddressLike; + cGammaWitness: [BigNumberish, BigNumberish]; + sHashWitness: [BigNumberish, BigNumberish]; + zInv: BigNumberish; + }; + + export type ECVRFProofStructOutput = [ + gamma: [bigint, bigint], + c: bigint, + s: bigint, + alpha: bigint, + uWitness: string, + cGammaWitness: [bigint, bigint], + sHashWitness: [bigint, bigint], + zInv: bigint + ] & { + gamma: [bigint, bigint]; + c: bigint; + s: bigint; + alpha: bigint; + uWitness: string; + cGammaWitness: [bigint, bigint]; + sHashWitness: [bigint, bigint]; + zInv: bigint; + }; +} + +export interface OrandProviderV3Interface extends Interface { + getFunction( + nameOrSignature: + | "decomposeProof" + | "genesis" + | "getCurrentEpoch" + | "getCurrentEpochResult" + | "getECVRFVerifier" + | "getEpochResult" + | "getMaximumBatching" + | "getOperator" + | "getOracle" + | "getPublicKey" + | "getPublicKeyDigest" + | "getTotalEpoch" + | "initialize" + | "owner" + | "publish" + | "publishFraudProof" + | "renounceOwnership" + | "setMaxBatching" + | "setNewECVRFVerifier" + | "setNewOracle" + | "setPublicKey" + | "transferOwnership" + | "verifyEpoch" + ): FunctionFragment; + + getEvent( + nameOrSignatureOrTopic: + | "ExternalError" + | "Initialized" + | "NewEpoch" + | "OwnershipTransferred" + | "SetBatchingLimit" + | "SetNewECVRFVerifier" + | "SetNewOperator" + | "SetNewOracle" + | "SetNewPublicKey" + ): EventFragment; + + encodeFunctionData( + functionFragment: "decomposeProof", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "genesis", + values: [BytesLike, IOrandProviderV3.ECVRFProofStruct] + ): string; + encodeFunctionData( + functionFragment: "getCurrentEpoch", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "getCurrentEpochResult", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "getECVRFVerifier", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getEpochResult", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getMaximumBatching", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getOperator", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "getOracle", values?: undefined): string; + encodeFunctionData( + functionFragment: "getPublicKey", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getPublicKeyDigest", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getTotalEpoch", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "initialize", + values: [ + [BigNumberish, BigNumberish], + AddressLike, + AddressLike, + AddressLike, + BigNumberish + ] + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "publish", + values: [AddressLike, IOrandProviderV3.ECVRFProofStruct] + ): string; + encodeFunctionData( + functionFragment: "publishFraudProof", + values: [BytesLike, IOrandProviderV3.ECVRFProofStruct] + ): string; + encodeFunctionData( + functionFragment: "renounceOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "setMaxBatching", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "setNewECVRFVerifier", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "setNewOracle", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "setPublicKey", + values: [[BigNumberish, BigNumberish]] + ): string; + encodeFunctionData( + functionFragment: "transferOwnership", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "verifyEpoch", + values: [BytesLike, IOrandProviderV3.ECVRFProofStruct] + ): string; + + decodeFunctionResult( + functionFragment: "decomposeProof", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "genesis", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getCurrentEpoch", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getCurrentEpochResult", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getECVRFVerifier", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getEpochResult", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getMaximumBatching", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getOperator", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "getOracle", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getPublicKey", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getPublicKeyDigest", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getTotalEpoch", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "publish", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "publishFraudProof", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "renounceOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMaxBatching", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setNewECVRFVerifier", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setNewOracle", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setPublicKey", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "verifyEpoch", + data: BytesLike + ): Result; +} + +export namespace ExternalErrorEvent { + export type InputTuple = [receiverAddress: AddressLike]; + export type OutputTuple = [receiverAddress: string]; + export interface OutputObject { + receiverAddress: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace InitializedEvent { + export type InputTuple = [version: BigNumberish]; + export type OutputTuple = [version: bigint]; + export interface OutputObject { + version: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace NewEpochEvent { + export type InputTuple = [ + receiverAddress: AddressLike, + receiverEpoch: BigNumberish, + randomness: BigNumberish + ]; + export type OutputTuple = [ + receiverAddress: string, + receiverEpoch: bigint, + randomness: bigint + ]; + export interface OutputObject { + receiverAddress: string; + receiverEpoch: bigint; + randomness: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace OwnershipTransferredEvent { + export type InputTuple = [previousOwner: AddressLike, newOwner: AddressLike]; + export type OutputTuple = [previousOwner: string, newOwner: string]; + export interface OutputObject { + previousOwner: string; + newOwner: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace SetBatchingLimitEvent { + export type InputTuple = [actor: AddressLike, maxBatching: BigNumberish]; + export type OutputTuple = [actor: string, maxBatching: bigint]; + export interface OutputObject { + actor: string; + maxBatching: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace SetNewECVRFVerifierEvent { + export type InputTuple = [actor: AddressLike, ecvrfAddress: AddressLike]; + export type OutputTuple = [actor: string, ecvrfAddress: string]; + export interface OutputObject { + actor: string; + ecvrfAddress: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace SetNewOperatorEvent { + export type InputTuple = [oldOperator: AddressLike, newOperator: AddressLike]; + export type OutputTuple = [oldOperator: string, newOperator: string]; + export interface OutputObject { + oldOperator: string; + newOperator: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace SetNewOracleEvent { + export type InputTuple = [actor: AddressLike, newOracle: AddressLike]; + export type OutputTuple = [actor: string, newOracle: string]; + export interface OutputObject { + actor: string; + newOracle: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace SetNewPublicKeyEvent { + export type InputTuple = [ + actor: AddressLike, + pkx: BigNumberish, + pky: BigNumberish + ]; + export type OutputTuple = [actor: string, pkx: bigint, pky: bigint]; + export interface OutputObject { + actor: string; + pkx: bigint; + pky: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface OrandProviderV3 extends BaseContract { + connect(runner?: ContractRunner | null): OrandProviderV3; + waitForDeployment(): Promise; + + interface: OrandProviderV3Interface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + decomposeProof: TypedContractMethod< + [proof: BytesLike], + [IOrandECDSAV3.OrandECDSAProofStructOutput], + "view" + >; + + genesis: TypedContractMethod< + [fraudProof: BytesLike, ecvrfProof: IOrandProviderV3.ECVRFProofStruct], + [boolean], + "nonpayable" + >; + + getCurrentEpoch: TypedContractMethod< + [receiver: AddressLike], + [bigint], + "view" + >; + + getCurrentEpochResult: TypedContractMethod< + [receiver: AddressLike], + [bigint], + "view" + >; + + getECVRFVerifier: TypedContractMethod<[], [string], "view">; + + getEpochResult: TypedContractMethod< + [receiver: AddressLike, epoch: BigNumberish], + [bigint], + "view" + >; + + getMaximumBatching: TypedContractMethod<[], [bigint], "view">; + + getOperator: TypedContractMethod<[], [string], "view">; + + getOracle: TypedContractMethod<[], [string], "view">; + + getPublicKey: TypedContractMethod<[], [[bigint, bigint]], "view">; + + getPublicKeyDigest: TypedContractMethod<[], [string], "view">; + + getTotalEpoch: TypedContractMethod<[receiver: AddressLike], [bigint], "view">; + + initialize: TypedContractMethod< + [ + publicKey: [BigNumberish, BigNumberish], + operator: AddressLike, + ecvrfAddress: AddressLike, + oracleAddress: AddressLike, + maxBatchingLimit: BigNumberish + ], + [void], + "nonpayable" + >; + + owner: TypedContractMethod<[], [string], "view">; + + publish: TypedContractMethod< + [ + receiverAddress: AddressLike, + ecvrfProof: IOrandProviderV3.ECVRFProofStruct + ], + [boolean], + "nonpayable" + >; + + publishFraudProof: TypedContractMethod< + [fraudProof: BytesLike, ecvrfProof: IOrandProviderV3.ECVRFProofStruct], + [boolean], + "nonpayable" + >; + + renounceOwnership: TypedContractMethod<[], [void], "nonpayable">; + + setMaxBatching: TypedContractMethod< + [maxBatchingLimit: BigNumberish], + [boolean], + "nonpayable" + >; + + setNewECVRFVerifier: TypedContractMethod< + [ecvrfAddress: AddressLike], + [boolean], + "nonpayable" + >; + + setNewOracle: TypedContractMethod< + [oracleAddress: AddressLike], + [boolean], + "nonpayable" + >; + + setPublicKey: TypedContractMethod< + [pk: [BigNumberish, BigNumberish]], + [boolean], + "nonpayable" + >; + + transferOwnership: TypedContractMethod< + [newOwner: AddressLike], + [void], + "nonpayable" + >; + + verifyEpoch: TypedContractMethod< + [fraudProof: BytesLike, ecvrfProof: IOrandProviderV3.ECVRFProofStruct], + [ + [ + IOrandECDSAV3.OrandECDSAProofStructOutput, + bigint, + boolean, + boolean, + bigint, + bigint + ] & { + ecdsaProof: IOrandECDSAV3.OrandECDSAProofStructOutput; + currentEpochNumber: bigint; + isEpochLinked: boolean; + isValidDualProof: boolean; + currentEpochResult: bigint; + verifiedEpochResult: bigint; + } + ], + "view" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "decomposeProof" + ): TypedContractMethod< + [proof: BytesLike], + [IOrandECDSAV3.OrandECDSAProofStructOutput], + "view" + >; + getFunction( + nameOrSignature: "genesis" + ): TypedContractMethod< + [fraudProof: BytesLike, ecvrfProof: IOrandProviderV3.ECVRFProofStruct], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "getCurrentEpoch" + ): TypedContractMethod<[receiver: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "getCurrentEpochResult" + ): TypedContractMethod<[receiver: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "getECVRFVerifier" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "getEpochResult" + ): TypedContractMethod< + [receiver: AddressLike, epoch: BigNumberish], + [bigint], + "view" + >; + getFunction( + nameOrSignature: "getMaximumBatching" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "getOperator" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "getOracle" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "getPublicKey" + ): TypedContractMethod<[], [[bigint, bigint]], "view">; + getFunction( + nameOrSignature: "getPublicKeyDigest" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "getTotalEpoch" + ): TypedContractMethod<[receiver: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "initialize" + ): TypedContractMethod< + [ + publicKey: [BigNumberish, BigNumberish], + operator: AddressLike, + ecvrfAddress: AddressLike, + oracleAddress: AddressLike, + maxBatchingLimit: BigNumberish + ], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "owner" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "publish" + ): TypedContractMethod< + [ + receiverAddress: AddressLike, + ecvrfProof: IOrandProviderV3.ECVRFProofStruct + ], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "publishFraudProof" + ): TypedContractMethod< + [fraudProof: BytesLike, ecvrfProof: IOrandProviderV3.ECVRFProofStruct], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "renounceOwnership" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "setMaxBatching" + ): TypedContractMethod< + [maxBatchingLimit: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "setNewECVRFVerifier" + ): TypedContractMethod<[ecvrfAddress: AddressLike], [boolean], "nonpayable">; + getFunction( + nameOrSignature: "setNewOracle" + ): TypedContractMethod<[oracleAddress: AddressLike], [boolean], "nonpayable">; + getFunction( + nameOrSignature: "setPublicKey" + ): TypedContractMethod< + [pk: [BigNumberish, BigNumberish]], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "transferOwnership" + ): TypedContractMethod<[newOwner: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "verifyEpoch" + ): TypedContractMethod< + [fraudProof: BytesLike, ecvrfProof: IOrandProviderV3.ECVRFProofStruct], + [ + [ + IOrandECDSAV3.OrandECDSAProofStructOutput, + bigint, + boolean, + boolean, + bigint, + bigint + ] & { + ecdsaProof: IOrandECDSAV3.OrandECDSAProofStructOutput; + currentEpochNumber: bigint; + isEpochLinked: boolean; + isValidDualProof: boolean; + currentEpochResult: bigint; + verifiedEpochResult: bigint; + } + ], + "view" + >; + + getEvent( + key: "ExternalError" + ): TypedContractEvent< + ExternalErrorEvent.InputTuple, + ExternalErrorEvent.OutputTuple, + ExternalErrorEvent.OutputObject + >; + getEvent( + key: "Initialized" + ): TypedContractEvent< + InitializedEvent.InputTuple, + InitializedEvent.OutputTuple, + InitializedEvent.OutputObject + >; + getEvent( + key: "NewEpoch" + ): TypedContractEvent< + NewEpochEvent.InputTuple, + NewEpochEvent.OutputTuple, + NewEpochEvent.OutputObject + >; + getEvent( + key: "OwnershipTransferred" + ): TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + getEvent( + key: "SetBatchingLimit" + ): TypedContractEvent< + SetBatchingLimitEvent.InputTuple, + SetBatchingLimitEvent.OutputTuple, + SetBatchingLimitEvent.OutputObject + >; + getEvent( + key: "SetNewECVRFVerifier" + ): TypedContractEvent< + SetNewECVRFVerifierEvent.InputTuple, + SetNewECVRFVerifierEvent.OutputTuple, + SetNewECVRFVerifierEvent.OutputObject + >; + getEvent( + key: "SetNewOperator" + ): TypedContractEvent< + SetNewOperatorEvent.InputTuple, + SetNewOperatorEvent.OutputTuple, + SetNewOperatorEvent.OutputObject + >; + getEvent( + key: "SetNewOracle" + ): TypedContractEvent< + SetNewOracleEvent.InputTuple, + SetNewOracleEvent.OutputTuple, + SetNewOracleEvent.OutputObject + >; + getEvent( + key: "SetNewPublicKey" + ): TypedContractEvent< + SetNewPublicKeyEvent.InputTuple, + SetNewPublicKeyEvent.OutputTuple, + SetNewPublicKeyEvent.OutputObject + >; + + filters: { + "ExternalError(address)": TypedContractEvent< + ExternalErrorEvent.InputTuple, + ExternalErrorEvent.OutputTuple, + ExternalErrorEvent.OutputObject + >; + ExternalError: TypedContractEvent< + ExternalErrorEvent.InputTuple, + ExternalErrorEvent.OutputTuple, + ExternalErrorEvent.OutputObject + >; + + "Initialized(uint8)": TypedContractEvent< + InitializedEvent.InputTuple, + InitializedEvent.OutputTuple, + InitializedEvent.OutputObject + >; + Initialized: TypedContractEvent< + InitializedEvent.InputTuple, + InitializedEvent.OutputTuple, + InitializedEvent.OutputObject + >; + + "NewEpoch(address,uint96,uint256)": TypedContractEvent< + NewEpochEvent.InputTuple, + NewEpochEvent.OutputTuple, + NewEpochEvent.OutputObject + >; + NewEpoch: TypedContractEvent< + NewEpochEvent.InputTuple, + NewEpochEvent.OutputTuple, + NewEpochEvent.OutputObject + >; + + "OwnershipTransferred(address,address)": TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + OwnershipTransferred: TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + + "SetBatchingLimit(address,uint256)": TypedContractEvent< + SetBatchingLimitEvent.InputTuple, + SetBatchingLimitEvent.OutputTuple, + SetBatchingLimitEvent.OutputObject + >; + SetBatchingLimit: TypedContractEvent< + SetBatchingLimitEvent.InputTuple, + SetBatchingLimitEvent.OutputTuple, + SetBatchingLimitEvent.OutputObject + >; + + "SetNewECVRFVerifier(address,address)": TypedContractEvent< + SetNewECVRFVerifierEvent.InputTuple, + SetNewECVRFVerifierEvent.OutputTuple, + SetNewECVRFVerifierEvent.OutputObject + >; + SetNewECVRFVerifier: TypedContractEvent< + SetNewECVRFVerifierEvent.InputTuple, + SetNewECVRFVerifierEvent.OutputTuple, + SetNewECVRFVerifierEvent.OutputObject + >; + + "SetNewOperator(address,address)": TypedContractEvent< + SetNewOperatorEvent.InputTuple, + SetNewOperatorEvent.OutputTuple, + SetNewOperatorEvent.OutputObject + >; + SetNewOperator: TypedContractEvent< + SetNewOperatorEvent.InputTuple, + SetNewOperatorEvent.OutputTuple, + SetNewOperatorEvent.OutputObject + >; + + "SetNewOracle(address,address)": TypedContractEvent< + SetNewOracleEvent.InputTuple, + SetNewOracleEvent.OutputTuple, + SetNewOracleEvent.OutputObject + >; + SetNewOracle: TypedContractEvent< + SetNewOracleEvent.InputTuple, + SetNewOracleEvent.OutputTuple, + SetNewOracleEvent.OutputObject + >; + + "SetNewPublicKey(address,uint256,uint256)": TypedContractEvent< + SetNewPublicKeyEvent.InputTuple, + SetNewPublicKeyEvent.OutputTuple, + SetNewPublicKeyEvent.OutputObject + >; + SetNewPublicKey: TypedContractEvent< + SetNewPublicKeyEvent.InputTuple, + SetNewPublicKeyEvent.OutputTuple, + SetNewPublicKeyEvent.OutputObject + >; + }; +} diff --git a/package/src/OrocleV2.ts b/package/src/OrocleV2.ts new file mode 100644 index 0000000..97c92b2 --- /dev/null +++ b/package/src/OrocleV2.ts @@ -0,0 +1,680 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "./common"; + +export interface OrocleV2Interface extends Interface { + getFunction( + nameOrSignature: + | "addOperator" + | "fulfill" + | "getData" + | "getLatestData" + | "getLatestRound" + | "getMetadata" + | "initialize" + | "isDeactivated" + | "isOperator" + | "owner" + | "publishData" + | "publishPrice" + | "removeOperator" + | "renounceOwnership" + | "request" + | "setDeactivatedStatus" + | "transferOwnership" + ): FunctionFragment; + + getEvent( + nameOrSignatureOrTopic: + | "AddOperator" + | "Deactivated" + | "FulFill" + | "Initialized" + | "OwnershipTransferred" + | "PublishData" + | "RemoveOperator" + | "Request" + ): EventFragment; + + encodeFunctionData( + functionFragment: "addOperator", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "fulfill", + values: [BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "getData", + values: [BigNumberish, BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "getLatestData", + values: [BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "getLatestRound", + values: [BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "getMetadata", + values: [BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "initialize", + values: [AddressLike[]] + ): string; + encodeFunctionData( + functionFragment: "isDeactivated", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "isOperator", + values: [AddressLike] + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "publishData", + values: [BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "publishPrice", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "removeOperator", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "renounceOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "request", + values: [BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "setDeactivatedStatus", + values: [AddressLike, boolean] + ): string; + encodeFunctionData( + functionFragment: "transferOwnership", + values: [AddressLike] + ): string; + + decodeFunctionResult( + functionFragment: "addOperator", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "fulfill", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "getData", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getLatestData", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getLatestRound", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getMetadata", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "isDeactivated", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "isOperator", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "publishData", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "publishPrice", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "removeOperator", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "renounceOwnership", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "request", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "setDeactivatedStatus", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferOwnership", + data: BytesLike + ): Result; +} + +export namespace AddOperatorEvent { + export type InputTuple = [newOperator: AddressLike]; + export type OutputTuple = [newOperator: string]; + export interface OutputObject { + newOperator: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace DeactivatedEvent { + export type InputTuple = [actor: AddressLike, status: boolean]; + export type OutputTuple = [actor: string, status: boolean]; + export interface OutputObject { + actor: string; + status: boolean; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace FulFillEvent { + export type InputTuple = [ + actor: AddressLike, + identifier: BigNumberish, + data: BytesLike + ]; + export type OutputTuple = [actor: string, identifier: bigint, data: string]; + export interface OutputObject { + actor: string; + identifier: bigint; + data: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace InitializedEvent { + export type InputTuple = [version: BigNumberish]; + export type OutputTuple = [version: bigint]; + export interface OutputObject { + version: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace OwnershipTransferredEvent { + export type InputTuple = [previousOwner: AddressLike, newOwner: AddressLike]; + export type OutputTuple = [previousOwner: string, newOwner: string]; + export interface OutputObject { + previousOwner: string; + newOwner: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace PublishDataEvent { + export type InputTuple = [ + application: BigNumberish, + round: BigNumberish, + identifier: BytesLike, + data: BytesLike + ]; + export type OutputTuple = [ + application: bigint, + round: bigint, + identifier: string, + data: string + ]; + export interface OutputObject { + application: bigint; + round: bigint; + identifier: string; + data: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace RemoveOperatorEvent { + export type InputTuple = [OldOperator: AddressLike]; + export type OutputTuple = [OldOperator: string]; + export interface OutputObject { + OldOperator: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace RequestEvent { + export type InputTuple = [ + actor: AddressLike, + identifier: BigNumberish, + data: BytesLike + ]; + export type OutputTuple = [actor: string, identifier: bigint, data: string]; + export interface OutputObject { + actor: string; + identifier: bigint; + data: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface OrocleV2 extends BaseContract { + connect(runner?: ContractRunner | null): OrocleV2; + waitForDeployment(): Promise; + + interface: OrocleV2Interface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + addOperator: TypedContractMethod< + [newOperator: AddressLike], + [boolean], + "nonpayable" + >; + + fulfill: TypedContractMethod< + [identifier: BigNumberish, data: BytesLike], + [boolean], + "nonpayable" + >; + + getData: TypedContractMethod< + [appId: BigNumberish, round: BigNumberish, identifier: BytesLike], + [string], + "view" + >; + + getLatestData: TypedContractMethod< + [appId: BigNumberish, identifier: BytesLike], + [string], + "view" + >; + + getLatestRound: TypedContractMethod< + [appId: BigNumberish, identifier: BytesLike], + [ + [bigint, bigint, string] & { + round: bigint; + lastUpdate: bigint; + data: string; + } + ], + "view" + >; + + getMetadata: TypedContractMethod< + [appId: BigNumberish, identifier: BytesLike], + [[bigint, bigint] & { round: bigint; lastUpdate: bigint }], + "view" + >; + + initialize: TypedContractMethod< + [operatorList: AddressLike[]], + [void], + "nonpayable" + >; + + isDeactivated: TypedContractMethod<[user: AddressLike], [boolean], "view">; + + isOperator: TypedContractMethod< + [checkAddress: AddressLike], + [boolean], + "view" + >; + + owner: TypedContractMethod<[], [string], "view">; + + publishData: TypedContractMethod< + [appId: BigNumberish, packedData: BytesLike], + [boolean], + "nonpayable" + >; + + publishPrice: TypedContractMethod< + [packedData: BytesLike], + [boolean], + "nonpayable" + >; + + removeOperator: TypedContractMethod< + [oldOperator: AddressLike], + [boolean], + "nonpayable" + >; + + renounceOwnership: TypedContractMethod<[], [void], "nonpayable">; + + request: TypedContractMethod< + [identifier: BigNumberish, data: BytesLike], + [boolean], + "nonpayable" + >; + + setDeactivatedStatus: TypedContractMethod< + [userAddress: AddressLike, status: boolean], + [boolean], + "nonpayable" + >; + + transferOwnership: TypedContractMethod< + [newOwner: AddressLike], + [void], + "nonpayable" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "addOperator" + ): TypedContractMethod<[newOperator: AddressLike], [boolean], "nonpayable">; + getFunction( + nameOrSignature: "fulfill" + ): TypedContractMethod< + [identifier: BigNumberish, data: BytesLike], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "getData" + ): TypedContractMethod< + [appId: BigNumberish, round: BigNumberish, identifier: BytesLike], + [string], + "view" + >; + getFunction( + nameOrSignature: "getLatestData" + ): TypedContractMethod< + [appId: BigNumberish, identifier: BytesLike], + [string], + "view" + >; + getFunction( + nameOrSignature: "getLatestRound" + ): TypedContractMethod< + [appId: BigNumberish, identifier: BytesLike], + [ + [bigint, bigint, string] & { + round: bigint; + lastUpdate: bigint; + data: string; + } + ], + "view" + >; + getFunction( + nameOrSignature: "getMetadata" + ): TypedContractMethod< + [appId: BigNumberish, identifier: BytesLike], + [[bigint, bigint] & { round: bigint; lastUpdate: bigint }], + "view" + >; + getFunction( + nameOrSignature: "initialize" + ): TypedContractMethod<[operatorList: AddressLike[]], [void], "nonpayable">; + getFunction( + nameOrSignature: "isDeactivated" + ): TypedContractMethod<[user: AddressLike], [boolean], "view">; + getFunction( + nameOrSignature: "isOperator" + ): TypedContractMethod<[checkAddress: AddressLike], [boolean], "view">; + getFunction( + nameOrSignature: "owner" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "publishData" + ): TypedContractMethod< + [appId: BigNumberish, packedData: BytesLike], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "publishPrice" + ): TypedContractMethod<[packedData: BytesLike], [boolean], "nonpayable">; + getFunction( + nameOrSignature: "removeOperator" + ): TypedContractMethod<[oldOperator: AddressLike], [boolean], "nonpayable">; + getFunction( + nameOrSignature: "renounceOwnership" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "request" + ): TypedContractMethod< + [identifier: BigNumberish, data: BytesLike], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "setDeactivatedStatus" + ): TypedContractMethod< + [userAddress: AddressLike, status: boolean], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "transferOwnership" + ): TypedContractMethod<[newOwner: AddressLike], [void], "nonpayable">; + + getEvent( + key: "AddOperator" + ): TypedContractEvent< + AddOperatorEvent.InputTuple, + AddOperatorEvent.OutputTuple, + AddOperatorEvent.OutputObject + >; + getEvent( + key: "Deactivated" + ): TypedContractEvent< + DeactivatedEvent.InputTuple, + DeactivatedEvent.OutputTuple, + DeactivatedEvent.OutputObject + >; + getEvent( + key: "FulFill" + ): TypedContractEvent< + FulFillEvent.InputTuple, + FulFillEvent.OutputTuple, + FulFillEvent.OutputObject + >; + getEvent( + key: "Initialized" + ): TypedContractEvent< + InitializedEvent.InputTuple, + InitializedEvent.OutputTuple, + InitializedEvent.OutputObject + >; + getEvent( + key: "OwnershipTransferred" + ): TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + getEvent( + key: "PublishData" + ): TypedContractEvent< + PublishDataEvent.InputTuple, + PublishDataEvent.OutputTuple, + PublishDataEvent.OutputObject + >; + getEvent( + key: "RemoveOperator" + ): TypedContractEvent< + RemoveOperatorEvent.InputTuple, + RemoveOperatorEvent.OutputTuple, + RemoveOperatorEvent.OutputObject + >; + getEvent( + key: "Request" + ): TypedContractEvent< + RequestEvent.InputTuple, + RequestEvent.OutputTuple, + RequestEvent.OutputObject + >; + + filters: { + "AddOperator(address)": TypedContractEvent< + AddOperatorEvent.InputTuple, + AddOperatorEvent.OutputTuple, + AddOperatorEvent.OutputObject + >; + AddOperator: TypedContractEvent< + AddOperatorEvent.InputTuple, + AddOperatorEvent.OutputTuple, + AddOperatorEvent.OutputObject + >; + + "Deactivated(address,bool)": TypedContractEvent< + DeactivatedEvent.InputTuple, + DeactivatedEvent.OutputTuple, + DeactivatedEvent.OutputObject + >; + Deactivated: TypedContractEvent< + DeactivatedEvent.InputTuple, + DeactivatedEvent.OutputTuple, + DeactivatedEvent.OutputObject + >; + + "FulFill(address,uint256,bytes)": TypedContractEvent< + FulFillEvent.InputTuple, + FulFillEvent.OutputTuple, + FulFillEvent.OutputObject + >; + FulFill: TypedContractEvent< + FulFillEvent.InputTuple, + FulFillEvent.OutputTuple, + FulFillEvent.OutputObject + >; + + "Initialized(uint8)": TypedContractEvent< + InitializedEvent.InputTuple, + InitializedEvent.OutputTuple, + InitializedEvent.OutputObject + >; + Initialized: TypedContractEvent< + InitializedEvent.InputTuple, + InitializedEvent.OutputTuple, + InitializedEvent.OutputObject + >; + + "OwnershipTransferred(address,address)": TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + OwnershipTransferred: TypedContractEvent< + OwnershipTransferredEvent.InputTuple, + OwnershipTransferredEvent.OutputTuple, + OwnershipTransferredEvent.OutputObject + >; + + "PublishData(uint32,uint64,bytes20,bytes32)": TypedContractEvent< + PublishDataEvent.InputTuple, + PublishDataEvent.OutputTuple, + PublishDataEvent.OutputObject + >; + PublishData: TypedContractEvent< + PublishDataEvent.InputTuple, + PublishDataEvent.OutputTuple, + PublishDataEvent.OutputObject + >; + + "RemoveOperator(address)": TypedContractEvent< + RemoveOperatorEvent.InputTuple, + RemoveOperatorEvent.OutputTuple, + RemoveOperatorEvent.OutputObject + >; + RemoveOperator: TypedContractEvent< + RemoveOperatorEvent.InputTuple, + RemoveOperatorEvent.OutputTuple, + RemoveOperatorEvent.OutputObject + >; + + "Request(address,uint256,bytes)": TypedContractEvent< + RequestEvent.InputTuple, + RequestEvent.OutputTuple, + RequestEvent.OutputObject + >; + Request: TypedContractEvent< + RequestEvent.InputTuple, + RequestEvent.OutputTuple, + RequestEvent.OutputObject + >; + }; +} diff --git a/package/src/index.ts b/package/src/index.ts index 033a83d..5dddeca 100644 --- a/package/src/index.ts +++ b/package/src/index.ts @@ -5,10 +5,14 @@ export { ERC20 } from './ERC20'; export { ERC721 } from './ERC721'; export { OrocleV1 } from './OrocleV1'; export { OrandProviderV2 } from './OrandProviderV2'; +export { OrocleV2 } from './OrocleV2'; +export { OrandProviderV3 } from './OrandProviderV3'; export * from './AbiOrosignMasterV1'; export * from './AbiOrosignV1'; export * from './AbiMulticast'; export * from './AbiERC20'; export * from './AbiERC721'; export * from './AbiOrocleV1'; -export * from './AbiOrandProviderV2'; \ No newline at end of file +export * from './AbiOrandProviderV2'; +export * from './OrocleV2'; +export * as OrandProviderV3Package from './OrandProviderV3'; \ No newline at end of file diff --git a/tasks/deploy-dice-game-v3.ts b/tasks/deploy-dice-game-v3.ts new file mode 100644 index 0000000..ce07805 --- /dev/null +++ b/tasks/deploy-dice-game-v3.ts @@ -0,0 +1,23 @@ +/* eslint-disable no-await-in-loop */ +import '@nomicfoundation/hardhat-ethers'; +import { task } from 'hardhat/config'; +import { HardhatRuntimeEnvironment } from 'hardhat/types'; +import { Deployer } from '../helpers'; +import { DiceGameV3 } from '../typechain-types'; + +task('deploy:dice-game-v3', 'Deploy dice game contracts').setAction( + async (_taskArgs: any, hre: HardhatRuntimeEnvironment) => { + const accounts = await hre.ethers.getSigners(); + //0x3ECb21f2c6A5a57C57634036777730bb6E87F281 + const deployer: Deployer = Deployer.getInstance(hre).connect(accounts[0]); + await deployer.contractDeploy( + 'orochi/DiceGameV3', + [], + '0x3eAF9da360dA944105599cdB7833712346af6DF1', + '0x70523434ee6a9870410960E2615406f8F9850676', + ); + await deployer.printReport(); + }, +); + +export default {}; diff --git a/tasks/test-dice-game-v3.ts b/tasks/test-dice-game-v3.ts new file mode 100644 index 0000000..8e5adca --- /dev/null +++ b/tasks/test-dice-game-v3.ts @@ -0,0 +1,20 @@ +/* eslint-disable no-await-in-loop */ +import '@nomicfoundation/hardhat-ethers'; +import { task } from 'hardhat/config'; +import { HardhatRuntimeEnvironment } from 'hardhat/types'; +import { DiceGameV3, OrandProviderV3 } from '../typechain-types'; +import { OrandProviderV2 } from '../package/src'; + +task('test:dice-game-v3', 'Test vault').setAction(async (_taskArgs: any, hre: HardhatRuntimeEnvironment) => { + const account = (await hre.ethers.getSigners())[0]; + const contract = (await hre.ethers.getContractAt( + 'DiceGameV3', + '0x57abA949de504cE2c1D55cBB919A5e8233b40c60', + )) as DiceGameV3; + // console.log('🚀 ~ task ~ contract:', contract); + + const tx = await contract.connect(account).guessingDiceNumber(2); + console.log('🚀 ~ task ~ tx:', tx); +}); + +export default {}; From 502232efb1aea85204bf0232b15d06c79518b9d9 Mon Sep 17 00:00:00 2001 From: dqtkien Date: Tue, 21 May 2024 10:24:28 +0700 Subject: [PATCH 07/13] Modify deployment script --- contracts/examples/DiceGameV3.sol | 12 ++-- hardhat.config.ts | 5 ++ tasks/check-orand-provider.ts | 16 +++++ tasks/deploy-dice-game-v3-zk.ts | 29 +++++++++ tasks/deploy-dice-game-v3.ts | 4 +- tasks/deploy-orochi-network.ts | 20 +++---- tasks/deploy-orochi-zk.ts | 29 ++++----- tasks/get-account.ts | 17 +++++- tasks/test-dice-game-v3.ts | 23 ++++---- tasks/transfer-orochi-owner.ts | 98 +++++++++++++++++++++++++++++++ 10 files changed, 204 insertions(+), 49 deletions(-) create mode 100644 tasks/check-orand-provider.ts create mode 100644 tasks/deploy-dice-game-v3-zk.ts create mode 100644 tasks/transfer-orochi-owner.ts diff --git a/contracts/examples/DiceGameV3.sol b/contracts/examples/DiceGameV3.sol index 7234a11..d1fd5f6 100644 --- a/contracts/examples/DiceGameV3.sol +++ b/contracts/examples/DiceGameV3.sol @@ -152,10 +152,10 @@ contract DiceGameV3 is IOrandConsumerV3, Ownable { return (fulfilled, totalGame); } - function isFulfilled() external view returns (bool) { - if (fulfilled < totalGame){ - return false; - } - return true; - } + function isFulfilled() external view returns (bool) { + if (fulfilled < totalGame) { + return false; + } + return true; + } } diff --git a/hardhat.config.ts b/hardhat.config.ts index 5676018..4840daa 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -84,6 +84,11 @@ const config: HardhatUserConfig = { chainId: 42161, accounts: { mnemonic: env.OROCHI_MNEMONIC }, }, + arbitrumTest: { + url: 'https://sepolia-rollup.arbitrum.io/rpc', + chainId: 421614, + accounts: { mnemonic: env.OROCHI_MNEMONIC }, + }, polygon: { url: 'https://rpc-mainnet.matic.quiknode.pro', chainId: 137, diff --git a/tasks/check-orand-provider.ts b/tasks/check-orand-provider.ts new file mode 100644 index 0000000..8b400dd --- /dev/null +++ b/tasks/check-orand-provider.ts @@ -0,0 +1,16 @@ +/* eslint-disable no-await-in-loop */ +import '@nomicfoundation/hardhat-ethers'; +import { task } from 'hardhat/config'; +import { HardhatRuntimeEnvironment } from 'hardhat/types'; +import { OrandProviderV3 } from '../typechain-types'; + +task('check:orand', 'Check orand provider public key').setAction( + async (_taskArgs: any, hre: HardhatRuntimeEnvironment) => { + const contract = (await hre.ethers.getContractAt( + 'OrandProviderV3', + '0x50C72F5bea0757c8052daa6402568d4bbf2336Fb', + )) as OrandProviderV3; + + console.log(await contract.getPublicKey()); + }, +); diff --git a/tasks/deploy-dice-game-v3-zk.ts b/tasks/deploy-dice-game-v3-zk.ts new file mode 100644 index 0000000..def4d68 --- /dev/null +++ b/tasks/deploy-dice-game-v3-zk.ts @@ -0,0 +1,29 @@ +/* eslint-disable no-await-in-loop */ +import '@nomicfoundation/hardhat-ethers'; +import { task } from 'hardhat/config'; +import { HardhatRuntimeEnvironment } from 'hardhat/types'; +import { env } from '../env'; +import { Provider, Wallet } from 'zksync-ethers'; +import { Deployer } from '@matterlabs/hardhat-zksync-deploy'; + +task('deploy:dice-game-v3-zk', 'Deploy dice game contracts with zkSolc').setAction( + async (_taskArgs: any, hre: HardhatRuntimeEnvironment) => { + const provider = new Provider(hre.network.config.url); + + if (!env.WALLET_PRIVATE_KEY) { + throw new Error('Not found wallet private key'); + } + const wallet = new Wallet(env.WALLET_PRIVATE_KEY, provider); + const deployer = new Deployer(hre, wallet); + const DiceGameV3Artifact = await deployer.loadArtifact('DiceGameV3'); + + const contract = await deployer.deploy(DiceGameV3Artifact, [ + '0xf9338096bb1bCdBDB83E5a237F198A60A48395a2', // Provider + '0xb0b5fFeF72c6ea620689CF947C0458fAD5cF58da', //Orocle + ]); + await contract.waitForDeployment(); + console.log('Dice game V3: ', await contract.getAddress()); + }, +); + +export default {}; diff --git a/tasks/deploy-dice-game-v3.ts b/tasks/deploy-dice-game-v3.ts index ce07805..16b60a1 100644 --- a/tasks/deploy-dice-game-v3.ts +++ b/tasks/deploy-dice-game-v3.ts @@ -13,8 +13,8 @@ task('deploy:dice-game-v3', 'Deploy dice game contracts').setAction( await deployer.contractDeploy( 'orochi/DiceGameV3', [], - '0x3eAF9da360dA944105599cdB7833712346af6DF1', - '0x70523434ee6a9870410960E2615406f8F9850676', + '0xD7a2643c1d9C3E6069f90DbAabd9D58825C7A2b9', // provider + '0xd26Ea014930305B498C5826cF0712F877CCAF93f', // orocle ); await deployer.printReport(); }, diff --git a/tasks/deploy-orochi-network.ts b/tasks/deploy-orochi-network.ts index 1cd102f..0e09c06 100644 --- a/tasks/deploy-orochi-network.ts +++ b/tasks/deploy-orochi-network.ts @@ -71,20 +71,20 @@ task('deploy:orochi', 'Deploy Orochi Network contracts').setAction( ], ); console.log('>> [OrandProvider V3] proxy contract address:', await orandProviderV3Proxy.getAddress()); - + await orandProviderV3Proxy.waitForDeployment(); console.table({ OrocleV2: await orocleV2Proxy.getAddress(), OrandProviderV3: await orandProviderV3Proxy.getAddress(), }); - await orocleV2Proxy.transferOwnership(OWNER); - await upgrades.admin.transferProxyAdminOwnership(await orocleV2Proxy.getAddress(), OWNER, account); + // await orocleV2Proxy.transferOwnership(OWNER); + // await upgrades.admin.transferProxyAdminOwnership(await orocleV2Proxy.getAddress(), OWNER, account); - await orandProviderV3Proxy.transferOwnership(OWNER); - await upgrades.admin.transferProxyAdminOwnership(await orandProviderV3Proxy.getAddress(), OWNER, account); + // await orandProviderV3Proxy.transferOwnership(OWNER); + // await upgrades.admin.transferProxyAdminOwnership(await orandProviderV3Proxy.getAddress(), OWNER, account); console.log( - `Corresponding address: ${correspondingAddress} , is valid publicKey?:`, + `Corresponding address: ${correspondingAddress}, is valid publicKey?:`, correspondingAddress === (await orandProviderV3Proxy.getOperator()), ); @@ -100,10 +100,10 @@ task('deploy:orochi', 'Deploy Orochi Network contracts').setAction( 'Is orand service operator correct?', correspondingAddress === (await orandProviderV3Proxy.getOperator()), ); - console.log('Is OrocleV1 operator correct?', await orocleV2Proxy.isOperator(OPERATORS[0])); - console.log('Is OrocleV1 operator correct?', await orocleV2Proxy.isOperator(OPERATORS[1])); - console.log('Is OrocleV1 owner correct?', OWNER === (await orocleV2Proxy.owner())); - console.log('Is OrandProviderV2 owner correct?', OWNER === (await orandProviderV3Proxy.owner())); + // console.log('Is OrocleV2 operator correct?', await orocleV2Proxy.isOperator(OPERATORS[0])); + // console.log('Is OrocleV2 operator correct?', await orocleV2Proxy.isOperator(OPERATORS[1])); + // console.log('Is OrocleV2 owner correct?', OWNER === (await orocleV2Proxy.owner())); + // console.log('Is OrandProviderV3 owner correct?', OWNER === (await orandProviderV3Proxy.owner())); }, ); diff --git a/tasks/deploy-orochi-zk.ts b/tasks/deploy-orochi-zk.ts index a46df54..6578ca1 100644 --- a/tasks/deploy-orochi-zk.ts +++ b/tasks/deploy-orochi-zk.ts @@ -11,12 +11,16 @@ import { HardhatRuntimeEnvironment } from 'hardhat/types'; import { Provider, Wallet } from 'zksync-ethers'; import { env } from '../env'; +const sleep = async (seconds: number) => { + return new Promise((resolve) => setTimeout(resolve, seconds * 1000)); +}; + const OPERATORS = env.OROCHI_OPERATOR.split(',').map((op) => op.trim()); -task('deploy:zk', 'Deploy Orochi Network contracts').setAction( +task('deploy:zk', 'Deploy Orochi Network contracts with zkSolc').setAction( async (_taskArgs: any, hre: HardhatRuntimeEnvironment) => { const OWNER = env.OROCHI_OWNER.trim(); - const provider = new Provider('https://sepolia.rpc.zklink.io'); + const provider = new Provider(hre.network.config.url); if (!env.WALLET_PRIVATE_KEY) { throw new Error('Not found wallet private key'); @@ -62,17 +66,6 @@ task('deploy:zk', 'Deploy Orochi Network contracts').setAction( ) */ // Deploy Provider - // const orandProviderV3Proxy = await upgrades.deployProxy( - // orandProviderV3Factory, - // // We going to skip 0x04 -> Pubkey format from libsecp256k1 - // [ - // OrandEncoding.pubKeyToAffine(HexString.hexPrefixAdd(pk)), - // correspondingAddress, - // await orandECVRF.getAddress(), - // await orocleV2Proxy.getAddress(), - // 200, - // ], - // ); const orandProviderV3Proxy = await hre.zkUpgrades.deployProxy( deployer.zkWallet, orandProviderV3Artifact, @@ -97,9 +90,11 @@ task('deploy:zk', 'Deploy Orochi Network contracts').setAction( }); await orocleV2Proxy.transferOwnership(OWNER); + await sleep(10); await hre.zkUpgrades.admin.changeProxyAdmin(await orocleV2Proxy.getAddress(), OWNER, deployer.zkWallet); - + await sleep(10); await orandProviderV3Proxy.transferOwnership(OWNER); + await sleep(10); await hre.zkUpgrades.admin.changeProxyAdmin(await orandProviderV3Proxy.getAddress(), OWNER, deployer.zkWallet); console.log( @@ -119,9 +114,9 @@ task('deploy:zk', 'Deploy Orochi Network contracts').setAction( 'Is orand service operator correct?', correspondingAddress === (await orandProviderV3Proxy.getOperator()), ); - console.log('Is OrocleV1 operator correct?', await orocleV2Proxy.isOperator(OPERATORS[0])); - console.log('Is OrocleV1 operator correct?', await orocleV2Proxy.isOperator(OPERATORS[1])); - console.log('Is OrocleV1 owner correct?', OWNER === (await orocleV2Proxy.owner())); + console.log('Is OrocleV2 operator correct?', await orocleV2Proxy.isOperator(OPERATORS[0])); + console.log('Is OrocleV2 operator correct?', await orocleV2Proxy.isOperator(OPERATORS[1])); + console.log('Is OrocleV2 owner correct?', OWNER === (await orocleV2Proxy.owner())); console.log('Is OrandProviderV2 owner correct?', OWNER === (await orandProviderV3Proxy.owner())); }, ); diff --git a/tasks/get-account.ts b/tasks/get-account.ts index 45a87c1..b136699 100644 --- a/tasks/get-account.ts +++ b/tasks/get-account.ts @@ -5,7 +5,22 @@ import { HardhatRuntimeEnvironment } from 'hardhat/types'; import { getWallet } from '../helpers/wallet'; task('get:account', 'Get list of accounts').setAction(async (_taskArgs: any, hre: HardhatRuntimeEnvironment) => { - const chains = [1n, 56n, 888888888n, 39n, 97n, 2484n, 195n, 810181n]; + const chains = [ + 1n, + 56n, + 888888888n, + 39n, + 97n, + 2484n, + 195n, + 810181n, + 421614n, + 9372n, + 48899n, + 43851n, + 713715n, + 28122024n, + ]; for (let i = 0; i < chains.length; i += 1) { getWallet(hre, chains[i]); } diff --git a/tasks/test-dice-game-v3.ts b/tasks/test-dice-game-v3.ts index 8e5adca..44325b4 100644 --- a/tasks/test-dice-game-v3.ts +++ b/tasks/test-dice-game-v3.ts @@ -1,20 +1,17 @@ -/* eslint-disable no-await-in-loop */ import '@nomicfoundation/hardhat-ethers'; import { task } from 'hardhat/config'; import { HardhatRuntimeEnvironment } from 'hardhat/types'; -import { DiceGameV3, OrandProviderV3 } from '../typechain-types'; -import { OrandProviderV2 } from '../package/src'; +import { DiceGameV3 } from '../typechain-types'; -task('test:dice-game-v3', 'Test vault').setAction(async (_taskArgs: any, hre: HardhatRuntimeEnvironment) => { - const account = (await hre.ethers.getSigners())[0]; - const contract = (await hre.ethers.getContractAt( - 'DiceGameV3', - '0x57abA949de504cE2c1D55cBB919A5e8233b40c60', - )) as DiceGameV3; - // console.log('🚀 ~ task ~ contract:', contract); +const DICE_GAME_CONTRACT_ADDRESS = '0x57abA949de504cE2c1D55cBB919A5e8233b40c60'; - const tx = await contract.connect(account).guessingDiceNumber(2); - console.log('🚀 ~ task ~ tx:', tx); -}); +task('test:dice-game-v3', 'Test dice game with OrandProviderV3').setAction( + async (_taskArgs: any, hre: HardhatRuntimeEnvironment) => { + const account = (await hre.ethers.getSigners())[0]; + const contract = (await hre.ethers.getContractAt('DiceGameV3', DICE_GAME_CONTRACT_ADDRESS)) as DiceGameV3; + const tx = await contract.connect(account).guessingDiceNumber(2); + console.log('Successful transaction', tx); + }, +); export default {}; diff --git a/tasks/transfer-orochi-owner.ts b/tasks/transfer-orochi-owner.ts new file mode 100644 index 0000000..4471fd7 --- /dev/null +++ b/tasks/transfer-orochi-owner.ts @@ -0,0 +1,98 @@ +/* eslint-disable no-await-in-loop */ +import '@nomicfoundation/hardhat-ethers'; +import { task } from 'hardhat/config'; +import { HardhatRuntimeEnvironment } from 'hardhat/types'; +import { env } from '../env'; +import { getAddress, isAddress, keccak256 } from 'ethers'; +import { getWallet } from '../helpers/wallet'; +import { OrandProviderV3, OrocleV2 } from '../typechain-types'; + +const OPERATORS = env.OROCHI_OPERATOR.split(',').map((op) => op.trim()); + +// CHANGE OROCLE & ORAND ADDRESS BEFORE RUN THIS TASK +const OROCLE_V2_ADDRESS = '0xd08b82d793025E4e210D40Dc2298Fd5204835ED7'; +const ORAND_PROVIDER_ADDRESS = '0x976b1E268D0b06540d3428b5970cA0c3e17eE315'; + +const sleep = async (seconds: number) => { + return new Promise((resolve) => setTimeout(resolve, seconds * 1000)); +}; + +task('transfer:orochi-owner', 'Transfer orocle & orand ownership').setAction( + async (_taskArgs: any, hre: HardhatRuntimeEnvironment) => { + let pk = env.OROCHI_PUBLIC_KEY.replace(/^0x/gi, '').trim(); + const { chainId } = await hre.ethers.provider.getNetwork(); + const account = await getWallet(hre, chainId); + let correspondingAddress = getAddress(`0x${keccak256(`0x${pk.substring(2, 130)}`).substring(26, 66)}`); + const { ethers, upgrades } = hre; + const OWNER = chainId === 911n ? account.address : env.OROCHI_OWNER.trim(); + + // Check owner and operators + if (!isAddress(OWNER)) { + throw new Error('Invalid owner address'); + } + console.log('Owner:', OWNER); + + const orocleV2Proxy = (await hre.ethers.getContractAt('OrocleV2', OROCLE_V2_ADDRESS)) as OrocleV2; + const orandProviderV3Proxy = (await hre.ethers.getContractAt( + 'OrandProviderV3', + ORAND_PROVIDER_ADDRESS, + )) as OrandProviderV3; + + console.log('Deployer:', account.address); + + /* + constructor( + uint256[2] memory publicKey, + address operator, + address ecvrfAddress, + address oracleAddress, + uint256 maxBatchingLimit + ) + */ + // Deploy Provider + + (await orocleV2Proxy.connect(account).transferOwnership(OWNER)).wait(); + await sleep(10); + + let nonce = await ethers.provider.getTransactionCount(account.address); + console.log('🚀 ~ nonce:', nonce); + await upgrades.admin + .transferProxyAdminOwnership(await orocleV2Proxy.getAddress(), OWNER, account, { + silent: false, + txOverrides: { + nonce: nonce + 1, + }, + }) + .then(); + nonce = nonce + 3; + await sleep(10); + (await orandProviderV3Proxy.connect(account).transferOwnership(OWNER)).wait(); + await sleep(10); + await upgrades.admin.transferProxyAdminOwnership(await orandProviderV3Proxy.getAddress(), OWNER, account, { + silent: false, + txOverrides: { + nonce, + }, + }); + + console.log( + `Corresponding address: ${correspondingAddress} , is valid publicKey?:`, + correspondingAddress === (await orandProviderV3Proxy.getOperator()), + ); + + console.log( + 'Is Oracle deployed correct?', + (await orocleV2Proxy.getAddress()) === (await orandProviderV3Proxy.getOracle()), + ); + console.log( + 'Is orand service operator correct?', + correspondingAddress === (await orandProviderV3Proxy.getOperator()), + ); + console.log('Is OrocleV2 operator correct?', await orocleV2Proxy.isOperator(OPERATORS[0])); + console.log('Is OrocleV2 operator correct?', await orocleV2Proxy.isOperator(OPERATORS[1])); + console.log('Is OrocleV2 owner correct?', OWNER === (await orocleV2Proxy.owner())); + console.log('Is OrandProviderV3 owner correct?', OWNER === (await orandProviderV3Proxy.owner())); + }, +); + +export default {}; From d3781d81eb0dc20e5731f07ef425dd04df8c836c Mon Sep 17 00:00:00 2001 From: dqtkien Date: Tue, 21 May 2024 10:33:30 +0700 Subject: [PATCH 08/13] Clean up --- tasks/check-orand-provider.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tasks/check-orand-provider.ts b/tasks/check-orand-provider.ts index 8b400dd..d89e45c 100644 --- a/tasks/check-orand-provider.ts +++ b/tasks/check-orand-provider.ts @@ -4,13 +4,11 @@ import { task } from 'hardhat/config'; import { HardhatRuntimeEnvironment } from 'hardhat/types'; import { OrandProviderV3 } from '../typechain-types'; +const ORAND_PROVIDER_ADDRESS = '0x50C72F5bea0757c8052daa6402568d4bbf2336Fb'; + task('check:orand', 'Check orand provider public key').setAction( async (_taskArgs: any, hre: HardhatRuntimeEnvironment) => { - const contract = (await hre.ethers.getContractAt( - 'OrandProviderV3', - '0x50C72F5bea0757c8052daa6402568d4bbf2336Fb', - )) as OrandProviderV3; - + const contract = (await hre.ethers.getContractAt('OrandProviderV3', ORAND_PROVIDER_ADDRESS)) as OrandProviderV3; console.log(await contract.getPublicKey()); }, ); From 4211103c6c36350d0860cd5441e34779f897bea4 Mon Sep 17 00:00:00 2001 From: dqtkien Date: Tue, 21 May 2024 15:52:36 +0700 Subject: [PATCH 09/13] Misc: Update IORandConsumer interface --- package/IOrandConsumerV3.sol | 15 ++++++++++++--- package/package.json | 4 ++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/package/IOrandConsumerV3.sol b/package/IOrandConsumerV3.sol index ac62538..962e336 100644 --- a/package/IOrandConsumerV3.sol +++ b/package/IOrandConsumerV3.sol @@ -3,10 +3,19 @@ pragma solidity ^0.8.0; error InvalidProvider(); +/** +* @dev IOrandConsumerV3 must be implemented for all service that use Orand +*/ interface IOrandConsumerV3 { - // Consume the verifiable randomness from Orand provider - // Return false if you want to stop batching + /** + * Consume the verifiable randomness from Orand provider + * @param randomness Randomness value + * @return return false if you want to stop batching otherwise return true + */ function consumeRandomness(uint256 randomness) external returns (bool); - // Return true if all requests are fulfilled otherwise return false + /** + * Check the fulfill status of randomness batching + * @return true if all requests are fulfilled otherwise return false + */ function isFulfilled() external returns (bool); } diff --git a/package/package.json b/package/package.json index 1c6bf1e..fff315c 100644 --- a/package/package.json +++ b/package/package.json @@ -1,6 +1,6 @@ { "name": "@orochi-network/contracts", - "version": "1.3.5", + "version": "1.3.6", "description": "Orochi smart contracts for on-chain verification", "types": "./build/esm/index.d.ts", "module": "./build/esm/index.js", @@ -33,4 +33,4 @@ "devDependencies": { "typescript": "^5.4.5" } -} +} \ No newline at end of file From 7b22e6aa20d9b1d48ecc066bb8daff4d3c4ea1cb Mon Sep 17 00:00:00 2001 From: dqtkien Date: Tue, 21 May 2024 15:53:49 +0700 Subject: [PATCH 10/13] Modify contract name --- contracts/test/{TestNFT.sol => TestERC721.sol} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename contracts/test/{TestNFT.sol => TestERC721.sol} (86%) diff --git a/contracts/test/TestNFT.sol b/contracts/test/TestERC721.sol similarity index 86% rename from contracts/test/TestNFT.sol rename to contracts/test/TestERC721.sol index 4e0244a..82b0984 100644 --- a/contracts/test/TestNFT.sol +++ b/contracts/test/TestERC721.sol @@ -4,6 +4,6 @@ pragma solidity 0.8.19; import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; // An ambition is hiding in the bush -contract TestNFT is ERC721 { +contract TestERC721 is ERC721 { constructor() ERC721('TestBigO', 'TestO') {} } From 3c5671872caa3f5a70ad4e84c3628a254bd8d97d Mon Sep 17 00:00:00 2001 From: dqtkien Date: Tue, 21 May 2024 16:59:04 +0700 Subject: [PATCH 11/13] Clean up --- env.ts | 1 - hardhat.config.ts | 4 +++- helpers/wallet.ts | 7 ++++++- tasks/deploy-orochi-network.ts | 10 ---------- tasks/deploy-orochi-zk.ts | 8 +++----- tasks/get-account.ts | 1 + 6 files changed, 13 insertions(+), 18 deletions(-) diff --git a/env.ts b/env.ts index 9e55792..b43ddcc 100644 --- a/env.ts +++ b/env.ts @@ -8,7 +8,6 @@ export interface IEnvironment { OROCHI_PUBLIC_KEY: string; OROCHI_OWNER: string; OROCHI_OPERATOR: string; - WALLET_PRIVATE_KEY: string; } function clean(config: any): any { diff --git a/hardhat.config.ts b/hardhat.config.ts index 4840daa..9d96b6e 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -163,7 +163,9 @@ const config: HardhatUserConfig = { zksync: true, ethNetwork: 'https://sepolia.rpc.zklink.io', chainId: 810181, - accounts: [env.WALLET_PRIVATE_KEY], + accounts: { + mnemonic: env.OROCHI_MNEMONIC, + }, }, // Hard hat network diff --git a/helpers/wallet.ts b/helpers/wallet.ts index c1f1d32..89e1712 100644 --- a/helpers/wallet.ts +++ b/helpers/wallet.ts @@ -1,9 +1,14 @@ /* eslint-disable no-await-in-loop */ import '@nomicfoundation/hardhat-ethers'; -import { Wallet, ethers } from 'ethers'; +import { HDNodeWallet, Wallet, ethers } from 'ethers'; import { HardhatRuntimeEnvironment } from 'hardhat/types'; +import { Wallet as zkSyncWallet, Provider } from 'zksync-ethers'; import { env } from '../env'; +export function getZkSyncWallet(wallet: HDNodeWallet, provider: Provider) { + return new zkSyncWallet(wallet.privateKey); +} + export async function getWallet(hre: HardhatRuntimeEnvironment, chainId: bigint): Promise { if (chainId === 911n) { const wallet = (await hre.ethers.getSigners())[0]; diff --git a/tasks/deploy-orochi-network.ts b/tasks/deploy-orochi-network.ts index 0e09c06..014881b 100644 --- a/tasks/deploy-orochi-network.ts +++ b/tasks/deploy-orochi-network.ts @@ -77,12 +77,6 @@ task('deploy:orochi', 'Deploy Orochi Network contracts').setAction( OrandProviderV3: await orandProviderV3Proxy.getAddress(), }); - // await orocleV2Proxy.transferOwnership(OWNER); - // await upgrades.admin.transferProxyAdminOwnership(await orocleV2Proxy.getAddress(), OWNER, account); - - // await orandProviderV3Proxy.transferOwnership(OWNER); - // await upgrades.admin.transferProxyAdminOwnership(await orandProviderV3Proxy.getAddress(), OWNER, account); - console.log( `Corresponding address: ${correspondingAddress}, is valid publicKey?:`, correspondingAddress === (await orandProviderV3Proxy.getOperator()), @@ -100,10 +94,6 @@ task('deploy:orochi', 'Deploy Orochi Network contracts').setAction( 'Is orand service operator correct?', correspondingAddress === (await orandProviderV3Proxy.getOperator()), ); - // console.log('Is OrocleV2 operator correct?', await orocleV2Proxy.isOperator(OPERATORS[0])); - // console.log('Is OrocleV2 operator correct?', await orocleV2Proxy.isOperator(OPERATORS[1])); - // console.log('Is OrocleV2 owner correct?', OWNER === (await orocleV2Proxy.owner())); - // console.log('Is OrandProviderV3 owner correct?', OWNER === (await orandProviderV3Proxy.owner())); }, ); diff --git a/tasks/deploy-orochi-zk.ts b/tasks/deploy-orochi-zk.ts index 6578ca1..7f06ae3 100644 --- a/tasks/deploy-orochi-zk.ts +++ b/tasks/deploy-orochi-zk.ts @@ -10,6 +10,7 @@ import { task } from 'hardhat/config'; import { HardhatRuntimeEnvironment } from 'hardhat/types'; import { Provider, Wallet } from 'zksync-ethers'; import { env } from '../env'; +import { getWallet, getZkSyncWallet } from '../helpers/wallet'; const sleep = async (seconds: number) => { return new Promise((resolve) => setTimeout(resolve, seconds * 1000)); @@ -21,12 +22,9 @@ task('deploy:zk', 'Deploy Orochi Network contracts with zkSolc').setAction( async (_taskArgs: any, hre: HardhatRuntimeEnvironment) => { const OWNER = env.OROCHI_OWNER.trim(); const provider = new Provider(hre.network.config.url); + const { chainId } = await provider.getNetwork(); - if (!env.WALLET_PRIVATE_KEY) { - throw new Error('Not found wallet private key'); - } - - const wallet = new Wallet(env.WALLET_PRIVATE_KEY, provider); + const wallet = getZkSyncWallet(await getWallet(hre, chainId), provider); const deployer = new Deployer(hre, wallet); console.log('Deployer:', deployer.zkWallet, deployer.ethWallet); diff --git a/tasks/get-account.ts b/tasks/get-account.ts index b136699..f9a4255 100644 --- a/tasks/get-account.ts +++ b/tasks/get-account.ts @@ -20,6 +20,7 @@ task('get:account', 'Get list of accounts').setAction(async (_taskArgs: any, hre 43851n, 713715n, 28122024n, + 810181n, ]; for (let i = 0; i < chains.length; i += 1) { getWallet(hre, chains[i]); From 6f47d40895b1ff2c3b04da8b1172eaf3383427c4 Mon Sep 17 00:00:00 2001 From: dqtkien Date: Thu, 23 May 2024 11:23:33 +0700 Subject: [PATCH 12/13] Add abi file & erc721 example --- contracts/test/TestERC721.sol | 14 +- hardhat.config.ts | 2 +- package/devel.js | 4 +- package/src/AbiOrandProviderV3.ts | 907 ++++++++++++++++++++++++++++++ package/src/AbiOrocleV2.ts | 584 +++++++++++++++++++ package/src/index.ts | 2 +- 6 files changed, 1508 insertions(+), 5 deletions(-) create mode 100644 package/src/AbiOrandProviderV3.ts create mode 100644 package/src/AbiOrocleV2.ts diff --git a/contracts/test/TestERC721.sol b/contracts/test/TestERC721.sol index 82b0984..81ad52d 100644 --- a/contracts/test/TestERC721.sol +++ b/contracts/test/TestERC721.sol @@ -2,8 +2,20 @@ pragma solidity 0.8.19; import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; +import '@openzeppelin/contracts/utils/Counters.sol'; +import '@openzeppelin/contracts/access/Ownable.sol'; // An ambition is hiding in the bush -contract TestERC721 is ERC721 { +contract TestERC721 is ERC721, Ownable { + using Counters for Counters.Counter; + Counters.Counter private _tokenIds; + constructor() ERC721('TestBigO', 'TestO') {} + + function mintNFT(address recipient) public returns (uint256) onlyOwner { + _tokenIds.increment(); + uint256 newTokenId = _tokenIds.current(); + _mint(recipient, newTokenId); + return newTokenId; + } } diff --git a/hardhat.config.ts b/hardhat.config.ts index 9d96b6e..9ef509c 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -35,7 +35,7 @@ const config: HardhatUserConfig = { enabled: true, }, zksolc: { - version: 'latest', + version: '1.4.1', settings: {}, }, networks: { diff --git a/package/devel.js b/package/devel.js index 868eede..94106aa 100755 --- a/package/devel.js +++ b/package/devel.js @@ -74,8 +74,8 @@ cpAbi('../artifacts/@openzeppelin/contracts/token/ERC721/ERC721.sol/ERC721.json' cpAbi('../artifacts/contracts/orocle-v1/OrocleV1.sol/OrocleV1.json', './src/AbiOrocleV1.ts'); cpAbi('../artifacts/contracts/orand-v2/OrandProviderV2.sol/OrandProviderV2.json', './src/AbiOrandProviderV2.ts'); -cpAbi('../artifacts/contracts/orocle-v2/OrocleV2.sol/OrocleV2.json', './src/OrocleV2.ts'); -cpAbi('../artifacts/contracts/orand-v3/OrandProviderV3.sol/OrandProviderV3.json', './src/OrandProviderV3.ts'); +cpAbi('../artifacts/contracts/orocle-v2/OrocleV2.sol/OrocleV2.json', './src/AbiOrocleV2.ts'); +cpAbi('../artifacts/contracts/orand-v3/OrandProviderV3.sol/OrandProviderV3.json', './src/AbiOrandProviderV3.ts'); cpTypes('../typechain-types/contracts/orosign/OrosignMasterV1.ts', './src/OrosignMasterV1.ts'); cpTypes('../typechain-types/contracts/orosign/OrosignV1.ts', './src/OrosignV1.ts'); diff --git a/package/src/AbiOrandProviderV3.ts b/package/src/AbiOrandProviderV3.ts new file mode 100644 index 0000000..38dd87a --- /dev/null +++ b/package/src/AbiOrandProviderV3.ts @@ -0,0 +1,907 @@ +export const AbiOrandProviderV3 = [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "expectedAlpha", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "givenAlpha", + "type": "uint256" + } + ], + "name": "InvalidAlphaValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signerAddress", + "type": "address" + } + ], + "name": "InvalidECDSAProof", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proofLength", + "type": "uint256" + } + ], + "name": "InvalidECDSAProofLength", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidECVRFProofDigest", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "currentEpoch", + "type": "uint256" + } + ], + "name": "InvalidGenesisEpoch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "proofSigner", + "type": "address" + } + ], + "name": "InvalidProofSigner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requiredLen", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxLen", + "type": "uint256" + } + ], + "name": "OutOfRange", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "receiverAddress", + "type": "address" + } + ], + "name": "ExternalError", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "receiverAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "receiverEpoch", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "randomness", + "type": "uint256" + } + ], + "name": "NewEpoch", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "actor", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "maxBatching", + "type": "uint256" + } + ], + "name": "SetBatchingLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "actor", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "ecvrfAddress", + "type": "address" + } + ], + "name": "SetNewECVRFVerifier", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldOperator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOperator", + "type": "address" + } + ], + "name": "SetNewOperator", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "actor", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOracle", + "type": "address" + } + ], + "name": "SetNewOracle", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "actor", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "pkx", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "pky", + "type": "uint256" + } + ], + "name": "SetNewPublicKey", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "proof", + "type": "bytes" + } + ], + "name": "decomposeProof", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "address", + "name": "receiverAddress", + "type": "address" + }, + { + "internalType": "uint96", + "name": "receiverEpoch", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "ecvrfProofDigest", + "type": "uint256" + } + ], + "internalType": "struct IOrandECDSAV3.OrandECDSAProof", + "name": "ecdsaProof", + "type": "tuple" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "fraudProof", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "uint256[2]", + "name": "gamma", + "type": "uint256[2]" + }, + { + "internalType": "uint256", + "name": "c", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "s", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "alpha", + "type": "uint256" + }, + { + "internalType": "address", + "name": "uWitness", + "type": "address" + }, + { + "internalType": "uint256[2]", + "name": "cGammaWitness", + "type": "uint256[2]" + }, + { + "internalType": "uint256[2]", + "name": "sHashWitness", + "type": "uint256[2]" + }, + { + "internalType": "uint256", + "name": "zInv", + "type": "uint256" + } + ], + "internalType": "struct IOrandProviderV3.ECVRFProof", + "name": "ecvrfProof", + "type": "tuple" + } + ], + "name": "genesis", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "getCurrentEpoch", + "outputs": [ + { + "internalType": "uint96", + "name": "epoch", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "getCurrentEpochResult", + "outputs": [ + { + "internalType": "uint256", + "name": "result", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getECVRFVerifier", + "outputs": [ + { + "internalType": "address", + "name": "ecvrfVerifier", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint96", + "name": "epoch", + "type": "uint96" + } + ], + "name": "getEpochResult", + "outputs": [ + { + "internalType": "uint256", + "name": "result", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMaximumBatching", + "outputs": [ + { + "internalType": "uint256", + "name": "maxBatchingLimit", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getOperator", + "outputs": [ + { + "internalType": "address", + "name": "operatorAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getOracle", + "outputs": [ + { + "internalType": "address", + "name": "oracleAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPublicKey", + "outputs": [ + { + "internalType": "uint256[2]", + "name": "pubKey", + "type": "uint256[2]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPublicKeyDigest", + "outputs": [ + { + "internalType": "bytes32", + "name": "operator", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "getTotalEpoch", + "outputs": [ + { + "internalType": "uint96", + "name": "epoch", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[2]", + "name": "publicKey", + "type": "uint256[2]" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "address", + "name": "ecvrfAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "oracleAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "maxBatchingLimit", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiverAddress", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256[2]", + "name": "gamma", + "type": "uint256[2]" + }, + { + "internalType": "uint256", + "name": "c", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "s", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "alpha", + "type": "uint256" + }, + { + "internalType": "address", + "name": "uWitness", + "type": "address" + }, + { + "internalType": "uint256[2]", + "name": "cGammaWitness", + "type": "uint256[2]" + }, + { + "internalType": "uint256[2]", + "name": "sHashWitness", + "type": "uint256[2]" + }, + { + "internalType": "uint256", + "name": "zInv", + "type": "uint256" + } + ], + "internalType": "struct IOrandProviderV3.ECVRFProof", + "name": "ecvrfProof", + "type": "tuple" + } + ], + "name": "publish", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "fraudProof", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "uint256[2]", + "name": "gamma", + "type": "uint256[2]" + }, + { + "internalType": "uint256", + "name": "c", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "s", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "alpha", + "type": "uint256" + }, + { + "internalType": "address", + "name": "uWitness", + "type": "address" + }, + { + "internalType": "uint256[2]", + "name": "cGammaWitness", + "type": "uint256[2]" + }, + { + "internalType": "uint256[2]", + "name": "sHashWitness", + "type": "uint256[2]" + }, + { + "internalType": "uint256", + "name": "zInv", + "type": "uint256" + } + ], + "internalType": "struct IOrandProviderV3.ECVRFProof", + "name": "ecvrfProof", + "type": "tuple" + } + ], + "name": "publishFraudProof", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "maxBatchingLimit", + "type": "uint256" + } + ], + "name": "setMaxBatching", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "ecvrfAddress", + "type": "address" + } + ], + "name": "setNewECVRFVerifier", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "oracleAddress", + "type": "address" + } + ], + "name": "setNewOracle", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[2]", + "name": "pk", + "type": "uint256[2]" + } + ], + "name": "setPublicKey", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "fraudProof", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "uint256[2]", + "name": "gamma", + "type": "uint256[2]" + }, + { + "internalType": "uint256", + "name": "c", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "s", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "alpha", + "type": "uint256" + }, + { + "internalType": "address", + "name": "uWitness", + "type": "address" + }, + { + "internalType": "uint256[2]", + "name": "cGammaWitness", + "type": "uint256[2]" + }, + { + "internalType": "uint256[2]", + "name": "sHashWitness", + "type": "uint256[2]" + }, + { + "internalType": "uint256", + "name": "zInv", + "type": "uint256" + } + ], + "internalType": "struct IOrandProviderV3.ECVRFProof", + "name": "ecvrfProof", + "type": "tuple" + } + ], + "name": "verifyEpoch", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "address", + "name": "receiverAddress", + "type": "address" + }, + { + "internalType": "uint96", + "name": "receiverEpoch", + "type": "uint96" + }, + { + "internalType": "uint256", + "name": "ecvrfProofDigest", + "type": "uint256" + } + ], + "internalType": "struct IOrandECDSAV3.OrandECDSAProof", + "name": "ecdsaProof", + "type": "tuple" + }, + { + "internalType": "uint96", + "name": "currentEpochNumber", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "isEpochLinked", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isValidDualProof", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "currentEpochResult", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "verifiedEpochResult", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } +]; \ No newline at end of file diff --git a/package/src/AbiOrocleV2.ts b/package/src/AbiOrocleV2.ts new file mode 100644 index 0000000..8f6daf9 --- /dev/null +++ b/package/src/AbiOrocleV2.ts @@ -0,0 +1,584 @@ +export const AbiOrocleV2 = [ + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "DeactivatedUser", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "InvalidDataLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "InvalidOperator", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requiredLen", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxLen", + "type": "uint256" + } + ], + "name": "OutOfRange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "UnableToPublishData", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "round", + "type": "uint64" + } + ], + "name": "UndefinedRound", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newOperator", + "type": "address" + } + ], + "name": "AddOperator", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "actor", + "type": "address" + }, + { + "indexed": true, + "internalType": "bool", + "name": "status", + "type": "bool" + } + ], + "name": "Deactivated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "actor", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "identifier", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "FulFill", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint32", + "name": "application", + "type": "uint32" + }, + { + "indexed": true, + "internalType": "uint64", + "name": "round", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "bytes20", + "name": "identifier", + "type": "bytes20" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "data", + "type": "bytes32" + } + ], + "name": "PublishData", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "OldOperator", + "type": "address" + } + ], + "name": "RemoveOperator", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "actor", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "identifier", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "Request", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOperator", + "type": "address" + } + ], + "name": "addOperator", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "identifier", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "fulfill", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "appId", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "round", + "type": "uint64" + }, + { + "internalType": "bytes20", + "name": "identifier", + "type": "bytes20" + } + ], + "name": "getData", + "outputs": [ + { + "internalType": "bytes32", + "name": "data", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "appId", + "type": "uint32" + }, + { + "internalType": "bytes20", + "name": "identifier", + "type": "bytes20" + } + ], + "name": "getLatestData", + "outputs": [ + { + "internalType": "bytes32", + "name": "data", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "appId", + "type": "uint32" + }, + { + "internalType": "bytes20", + "name": "identifier", + "type": "bytes20" + } + ], + "name": "getLatestRound", + "outputs": [ + { + "internalType": "uint64", + "name": "round", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "lastUpdate", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "data", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "appId", + "type": "uint32" + }, + { + "internalType": "bytes20", + "name": "identifier", + "type": "bytes20" + } + ], + "name": "getMetadata", + "outputs": [ + { + "internalType": "uint64", + "name": "round", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "lastUpdate", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "operatorList", + "type": "address[]" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "isDeactivated", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "checkAddress", + "type": "address" + } + ], + "name": "isOperator", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "appId", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "packedData", + "type": "bytes" + } + ], + "name": "publishData", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "packedData", + "type": "bytes" + } + ], + "name": "publishPrice", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "oldOperator", + "type": "address" + } + ], + "name": "removeOperator", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "identifier", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "request", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "userAddress", + "type": "address" + }, + { + "internalType": "bool", + "name": "status", + "type": "bool" + } + ], + "name": "setDeactivatedStatus", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +]; \ No newline at end of file diff --git a/package/src/index.ts b/package/src/index.ts index 5dddeca..ab6f211 100644 --- a/package/src/index.ts +++ b/package/src/index.ts @@ -14,5 +14,5 @@ export * from './AbiERC20'; export * from './AbiERC721'; export * from './AbiOrocleV1'; export * from './AbiOrandProviderV2'; -export * from './OrocleV2'; +export * from './AbiOrocleV2'; export * as OrandProviderV3Package from './OrandProviderV3'; \ No newline at end of file From 2ff218780132a674f2d94eb9e9b4b89d9faf01df Mon Sep 17 00:00:00 2001 From: dqtkien Date: Thu, 23 May 2024 11:29:56 +0700 Subject: [PATCH 13/13] Fix wrong export type --- package/devel.js | 3 --- package/src/index.ts | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/package/devel.js b/package/devel.js index 94106aa..a0826d6 100755 --- a/package/devel.js +++ b/package/devel.js @@ -95,9 +95,6 @@ fs.writeFileSync( .join('\n'), tsFileList .map((e) => { - if (e.includes('OrandProviderV3')) { - return `export * as OrandProviderV3Package from './OrandProviderV3';`; - } return `export * from '${e.replace('.ts', '').replace('./src/', './')}';`; }) .join('\n'), diff --git a/package/src/index.ts b/package/src/index.ts index ab6f211..a0e7df1 100644 --- a/package/src/index.ts +++ b/package/src/index.ts @@ -15,4 +15,4 @@ export * from './AbiERC721'; export * from './AbiOrocleV1'; export * from './AbiOrandProviderV2'; export * from './AbiOrocleV2'; -export * as OrandProviderV3Package from './OrandProviderV3'; \ No newline at end of file +export * from './AbiOrandProviderV3'; \ No newline at end of file