diff --git a/contracts/v0.1/.eslintrc b/contracts/v0.1/.eslintrc index cde4bd5f8..20ce89bbb 100644 --- a/contracts/v0.1/.eslintrc +++ b/contracts/v0.1/.eslintrc @@ -1,15 +1,9 @@ { "root": true, - "extends": [ - "prettier" - ], - "plugins": [ - "prettier" - ], + "extends": ["prettier"], + "plugins": ["prettier"], "rules": { - "prettier/prettier": [ - "error" - ] + "prettier/prettier": ["error"] }, "parserOptions": { "sourceType": "module", diff --git a/contracts/v0.1/.prettierrc b/contracts/v0.1/.prettierrc index e16c4955e..28510d066 100644 --- a/contracts/v0.1/.prettierrc +++ b/contracts/v0.1/.prettierrc @@ -2,7 +2,7 @@ "useTabs": false, "tabWidth": 2, "singleQuote": true, - "trailingComma": "none", + "trailingComma": "all", "printWidth": 100, "semi": false, "overrides": [ diff --git a/contracts/v0.1/.solhint.json b/contracts/v0.1/.solhint.json index e6eec16ea..1d4cbf446 100644 --- a/contracts/v0.1/.solhint.json +++ b/contracts/v0.1/.solhint.json @@ -4,7 +4,7 @@ "rules": { "avoid-throw": "off", "avoid-low-level-calls": "off", - "func-visibility": ["warn",{"ignoreConstructors": true}], + "func-visibility": ["warn", { "ignoreConstructors": true }], "avoid-suicide": "error", "avoid-sha3": "warn", "compiler-version": ["error", "^0.8.16"] diff --git a/contracts/v0.1/deploy/Aggregator/Aggregator.cjs b/contracts/v0.1/deploy/Aggregator/Aggregator.cjs index 236d22a53..b6f791b01 100644 --- a/contracts/v0.1/deploy/Aggregator/Aggregator.cjs +++ b/contracts/v0.1/deploy/Aggregator/Aggregator.cjs @@ -7,7 +7,7 @@ const { validateAggregatorDeployConfig, validateAggregatorChangeOraclesConfig, validateAggregatorRedirectProxyConfig, - getFormattedDate + getFormattedDate, } = require('../../scripts/utils.cjs') const func = async function (hre) { @@ -44,10 +44,10 @@ const func = async function (hre) { deployConfig.timeout, deployConfig.validator, deployConfig.decimals, - deployConfig.description + deployConfig.description, ], from: deployer, - log: true + log: true, }) aggregator = await ethers.getContractAt('Aggregator', aggregatorDeployment.address) deployedContracts[`Aggregator_${deployConfig.name}`] = aggregatorDeployment.address @@ -72,7 +72,7 @@ const func = async function (hre) { changeOraclesConfig.added, changeOraclesConfig.minSubmissionCount, changeOraclesConfig.maxSubmissionCount, - changeOraclesConfig.restartDelay + changeOraclesConfig.restartDelay, ) ).wait() } @@ -112,7 +112,7 @@ const func = async function (hre) { expect(confirmedAggregator).to.be.eq(proposedAggregator) console.log( - `Proxy Aggregator redirected from ${aggregatorAddress} to new ${confirmedAggregator}` + `Proxy Aggregator redirected from ${aggregatorAddress} to new ${confirmedAggregator}`, ) } else if (redirectProxyConfig.status == 'revert') { // Revert back to old Aggregator Address @@ -135,7 +135,7 @@ const func = async function (hre) { contract: 'AggregatorProxy', args: [aggregator.address], from: deployer, - log: true + log: true, }) // DataFeedConsumerMock @@ -143,7 +143,7 @@ const func = async function (hre) { await localhostDeployment({ deploy, aggregatorProxyDeployment, - name: deployConfig.name + name: deployConfig.name, }) } } @@ -164,7 +164,7 @@ async function localhostDeployment(args) { contract: 'DataFeedConsumerMock', args: [aggregatorProxyDeployment.address], from: consumer, - log: true + log: true, }) } diff --git a/contracts/v0.1/deploy/AggregatorRouter/AggregatorRouter.cjs b/contracts/v0.1/deploy/AggregatorRouter/AggregatorRouter.cjs index 64ea3ab27..ae7020bc3 100644 --- a/contracts/v0.1/deploy/AggregatorRouter/AggregatorRouter.cjs +++ b/contracts/v0.1/deploy/AggregatorRouter/AggregatorRouter.cjs @@ -3,7 +3,7 @@ const { loadJson, loadMigration, updateMigration, - loadDeployments + loadDeployments, } = require('../../scripts/utils.cjs') const func = async function (hre) { @@ -26,12 +26,12 @@ const func = async function (hre) { const aggregatorRouterDeployment = await deploy('AggregatorRouter', { args: [], from: deployer, - log: true + log: true, }) aggregatorRouter = await ethers.getContractAt( 'AggregatorRouter', - aggregatorRouterDeployment.address + aggregatorRouterDeployment.address, ) console.log('AggregatorRouter:', aggregatorRouterDeployment) @@ -50,7 +50,7 @@ const func = async function (hre) { if (updateProxiesConfig.updateAll) { const deployments = await loadDeployments(`./deployments/${network.name}`) - + for (const key in deployments) { if (key.includes('AggregatorProxy')) { const feedName = key.split('_')[1] @@ -66,7 +66,6 @@ const func = async function (hre) { feedNames.push(feedName) addresses.push(address) } - } if (feedNames.length == 0 || addresses.length == 0) { throw new Error('no proxies to update') diff --git a/contracts/v0.1/deploy/L1Endpoint/L1Endpoint.cjs b/contracts/v0.1/deploy/L1Endpoint/L1Endpoint.cjs index b49eabf1d..86c647eea 100644 --- a/contracts/v0.1/deploy/L1Endpoint/L1Endpoint.cjs +++ b/contracts/v0.1/deploy/L1Endpoint/L1Endpoint.cjs @@ -17,10 +17,10 @@ const func = async function (hre) { args: [ deployConfig.registry, deployConfig.vrfCoordinator, - deployConfig.requestResponseCoordinator + deployConfig.requestResponseCoordinator, ], from: deployer, - log: true + log: true, }) console.log('L1Endpoint:', l1Endpoint) diff --git a/contracts/v0.1/deploy/L2Endpoint/L2Endpoint.cjs b/contracts/v0.1/deploy/L2Endpoint/L2Endpoint.cjs index e7b30e3af..07df6d4db 100644 --- a/contracts/v0.1/deploy/L2Endpoint/L2Endpoint.cjs +++ b/contracts/v0.1/deploy/L2Endpoint/L2Endpoint.cjs @@ -15,7 +15,7 @@ const func = async function (hre) { const l2EndpointDeployment = await deploy('L2Endpoint', { args: [], from: deployer, - log: true + log: true, }) console.log('l2EndpointDeployment:', l2EndpointDeployment) diff --git a/contracts/v0.1/deploy/L2RequestResponseConsumerMock/L2RequestResponseConsumerMock.cjs b/contracts/v0.1/deploy/L2RequestResponseConsumerMock/L2RequestResponseConsumerMock.cjs index 8632bda92..7356a944d 100644 --- a/contracts/v0.1/deploy/L2RequestResponseConsumerMock/L2RequestResponseConsumerMock.cjs +++ b/contracts/v0.1/deploy/L2RequestResponseConsumerMock/L2RequestResponseConsumerMock.cjs @@ -15,7 +15,7 @@ const func = async function (hre) { const l2RequestResponseConsumerMock = await deploy('L2RequestResponseConsumerMock', { args: [deployConfig.l2EndpointAddress], from: deployer, - log: true + log: true, }) console.log('L2RequestResponseConsumerMock:', l2RequestResponseConsumerMock) diff --git a/contracts/v0.1/deploy/L2VRFConsumerMock/L2VRFConsumer.cjs b/contracts/v0.1/deploy/L2VRFConsumerMock/L2VRFConsumer.cjs index a970439e7..f1f7104b0 100644 --- a/contracts/v0.1/deploy/L2VRFConsumerMock/L2VRFConsumer.cjs +++ b/contracts/v0.1/deploy/L2VRFConsumerMock/L2VRFConsumer.cjs @@ -16,7 +16,7 @@ const func = async function (hre) { const l2VRFConsumerMock = await deploy('L2VRFConsumerMock', { args: [deployConfig.l2EndpointAddress], from: deployer, - log: true + log: true, }) console.log('L2VRFConsumerMock:', l2VRFConsumerMock) diff --git a/contracts/v0.1/deploy/POR/POR.cjs b/contracts/v0.1/deploy/POR/POR.cjs index 70f788a72..b4267648a 100644 --- a/contracts/v0.1/deploy/POR/POR.cjs +++ b/contracts/v0.1/deploy/POR/POR.cjs @@ -7,7 +7,7 @@ const { validateAggregatorDeployConfig, validateAggregatorChangeOraclesConfig, validateAggregatorRedirectProxyConfig, - getFormattedDate + getFormattedDate, } = require('../../scripts/utils.cjs') const func = async function (hre) { @@ -41,10 +41,10 @@ const func = async function (hre) { deployConfig.timeout, deployConfig.validator, deployConfig.decimals, - deployConfig.description + deployConfig.description, ], from: deployer, - log: true + log: true, }) aggregator = await ethers.getContractAt('Aggregator', aggregatorDeployment.address) } @@ -68,7 +68,7 @@ const func = async function (hre) { changeOraclesConfig.added, changeOraclesConfig.minSubmissionCount, changeOraclesConfig.maxSubmissionCount, - changeOraclesConfig.restartDelay + changeOraclesConfig.restartDelay, ) ).wait() } @@ -108,7 +108,7 @@ const func = async function (hre) { expect(confirmedAggregator).to.be.eq(proposedAggregator) console.log( - `Proxy POR address redirected from ${aggregatorAddress} to new ${confirmedAggregator}` + `Proxy POR address redirected from ${aggregatorAddress} to new ${confirmedAggregator}`, ) } else if (redirectProxyConfig.status == 'revert') { // Revert back to old POR contract address @@ -120,7 +120,7 @@ const func = async function (hre) { expect(revertedAggregator).to.be.eq(aggregatorAddress) console.log( - `Proxy POR address reverted from ${proposedAggregator} to ${revertedAggregator}` + `Proxy POR address reverted from ${proposedAggregator} to ${revertedAggregator}`, ) } else { console.log('Wrong proxyRedirect method') @@ -133,7 +133,7 @@ const func = async function (hre) { contract: 'AggregatorProxy', args: [aggregator.address], from: deployer, - log: true + log: true, }) // DataFeedConsumerMock @@ -141,7 +141,7 @@ const func = async function (hre) { await localhostDeployment({ deploy, aggregatorProxyDeployment, - name: deployConfig.name + name: deployConfig.name, }) } } @@ -160,7 +160,7 @@ async function localhostDeployment(args) { contract: 'DataFeedConsumerMock', args: [aggregatorProxyDeployment.address], from: consumer, - log: true + log: true, }) } diff --git a/contracts/v0.1/deploy/Prepayment/Prepayment.cjs b/contracts/v0.1/deploy/Prepayment/Prepayment.cjs index cc218df2d..ff7af64c8 100644 --- a/contracts/v0.1/deploy/Prepayment/Prepayment.cjs +++ b/contracts/v0.1/deploy/Prepayment/Prepayment.cjs @@ -3,7 +3,7 @@ const { loadJson, loadMigration, updateMigration, - validatePrepaymentDeployConfig + validatePrepaymentDeployConfig, } = require('../../scripts/utils.cjs') const func = async function (hre) { @@ -31,7 +31,7 @@ const func = async function (hre) { const prepaymentDeployment = await deploy('Prepayment', { args: [deployConfig.protocolFeeRecipient], from: deployer, - log: true + log: true, }) } diff --git a/contracts/v0.1/deploy/Registry/Registry.cjs b/contracts/v0.1/deploy/Registry/Registry.cjs index e4915f840..bc8627d46 100644 --- a/contracts/v0.1/deploy/Registry/Registry.cjs +++ b/contracts/v0.1/deploy/Registry/Registry.cjs @@ -6,7 +6,7 @@ const func = async function (hre) { const registryDeployment = await deploy('Registry', { args: [], from: deployer, - log: true + log: true, }) console.log('registeryDeployment:', registryDeployment) diff --git a/contracts/v0.1/deploy/RequestResponse/RequestResponseCoordinator.cjs b/contracts/v0.1/deploy/RequestResponse/RequestResponseCoordinator.cjs index 3a121edbd..3742fd496 100644 --- a/contracts/v0.1/deploy/RequestResponse/RequestResponseCoordinator.cjs +++ b/contracts/v0.1/deploy/RequestResponse/RequestResponseCoordinator.cjs @@ -4,7 +4,7 @@ const { loadMigration, updateMigration, validateCoordinatorDeployConfig, - validateSetConfig + validateSetConfig, } = require('../../scripts/utils.cjs') const func = async function (hre) { @@ -37,12 +37,12 @@ const func = async function (hre) { contract: 'RequestResponseCoordinator', args: [prepayment.address], from: deployer, - log: true + log: true, }) requestResponseCoordinator = await ethers.getContractAt( 'RequestResponseCoordinator', - requestResponseDeployment.address + requestResponseDeployment.address, ) // RequestResponseConsumerMock @@ -50,7 +50,7 @@ const func = async function (hre) { await localhostDeployment({ deploy, requestResponseCoordinator, - prepayment + prepayment, }) } } @@ -59,7 +59,7 @@ const func = async function (hre) { ? requestResponseCoordinator : await ethers.getContractAt( 'RequestResponseCoordinator', - config.requestResponseCoordinatorAddress + config.requestResponseCoordinatorAddress, ) // Register Oracle ////////////////////////////////////////////////////////// @@ -94,7 +94,7 @@ const func = async function (hre) { await requestResponseCoordinator.setConfig( setConfig.maxGasLimit, setConfig.gasAfterPaymentCalculation, - setConfig.feeConfig + setConfig.feeConfig, ) ).wait() } @@ -114,7 +114,7 @@ const func = async function (hre) { const prepaymentDeployerSigner = await ethers.getContractAt( 'Prepayment', prepayment.address, - deployer + deployer, ) await ( await prepaymentDeployerSigner.addCoordinator(requestResponseCoordinatorAddress) @@ -133,13 +133,13 @@ async function localhostDeployment(args) { contract: 'RequestResponseConsumerMock', args: [requestResponseCoordinator.address], from: consumer, - log: true + log: true, }) const prepaymentConsumerSigner = await ethers.getContractAt( 'Prepayment', prepayment.address, - consumer + consumer, ) // Create account diff --git a/contracts/v0.1/deploy/VRF/VRFCoordinator.cjs b/contracts/v0.1/deploy/VRF/VRFCoordinator.cjs index b17404458..c2aeaf5f3 100644 --- a/contracts/v0.1/deploy/VRF/VRFCoordinator.cjs +++ b/contracts/v0.1/deploy/VRF/VRFCoordinator.cjs @@ -6,7 +6,7 @@ const { validateCoordinatorDeployConfig, validateSetConfig, validateVrfDeregisterOracle, - validateVrfRegisterOracle + validateVrfRegisterOracle, } = require('../../scripts/utils.cjs') const func = async function (hre) { @@ -39,12 +39,12 @@ const func = async function (hre) { contract: 'VRFCoordinator', args: [prepayment.address], from: deployer, - log: true + log: true, }) vrfCoordinator = await ethers.getContractAt( 'VRFCoordinator', - vrfCoordinatorDeployment.address + vrfCoordinatorDeployment.address, ) // VRFConsumermock @@ -53,7 +53,7 @@ const func = async function (hre) { deploy, vrfCoordinator, prepayment, - name: deployConfig.version + name: deployConfig.version, }) } } @@ -75,7 +75,7 @@ const func = async function (hre) { await vrfCoordinator.registerOracle(oracle.address, oracle.publicProvingKey) ).wait() console.log( - `Oracle registered with address=${tx.events[0].args.oracle} and keyHash=${tx.events[0].args.keyHash}` + `Oracle registered with address=${tx.events[0].args.oracle} and keyHash=${tx.events[0].args.keyHash}`, ) } } @@ -91,7 +91,7 @@ const func = async function (hre) { for (const oracle of deregisterOracleConfig) { const tx = await (await vrfCoordinator.deregisterOracle(oracle.address)).wait() console.log( - `Oracle deregistered with address=${tx.events[0].args.oracle} and keyHash=${tx.events[0].args.keyHash}` + `Oracle deregistered with address=${tx.events[0].args.oracle} and keyHash=${tx.events[0].args.keyHash}`, ) } } @@ -108,7 +108,7 @@ const func = async function (hre) { await vrfCoordinator.setConfig( setConfig.maxGasLimit, setConfig.gasAfterPaymentCalculation, - setConfig.feeConfig + setConfig.feeConfig, ) ).wait() } @@ -128,7 +128,7 @@ const func = async function (hre) { const prepaymentDeployerSigner = await ethers.getContractAt( 'Prepayment', prepayment.address, - deployer + deployer, ) await (await prepaymentDeployerSigner.addCoordinator(vrfCoordinatorAddress)).wait() } @@ -143,13 +143,13 @@ async function localhostDeployment(args) { const vrfConsumerMockDeployment = await deploy('VRFConsumerMock', { args: [vrfCoordinator.address], from: consumer, - log: true + log: true, }) const prepaymentConsumerSigner = await ethers.getContractAt( 'Prepayment', prepayment.address, - consumer + consumer, ) // Create account diff --git a/contracts/v0.1/hardhat.config.cjs b/contracts/v0.1/hardhat.config.cjs index cae8c4c89..8acea2760 100644 --- a/contracts/v0.1/hardhat.config.cjs +++ b/contracts/v0.1/hardhat.config.cjs @@ -10,15 +10,15 @@ dotenv.config() const commonConfig = { gas: 5_000_000, accounts: { - mnemonic: process.env.MNEMONIC || '' - } + mnemonic: process.env.MNEMONIC || '', + }, } const _baobab = { url: 'https://public-en.kairos.node.kaia.io', chainId: 1001, ...commonConfig, - gasPrice: 250_000_000_000 + gasPrice: 250_000_000_000, } const config = { @@ -27,76 +27,76 @@ const config = { settings: { optimizer: { enabled: true, - runs: 1_000 - } - } + runs: 1_000, + }, + }, }, networks: { localhost: { - gasPrice: 250_000_000_000 + gasPrice: 250_000_000_000, }, hardhat: { - gasPrice: 250_000_000_000 + gasPrice: 250_000_000_000, }, baobab: { - ..._baobab + ..._baobab, }, baobab_test: { //same baobab network but used for test purposes - ..._baobab + ..._baobab, }, cypress: { url: 'https://public-en-cypress.klaytn.net', ...commonConfig, - gasPrice: 250_000_000_000 + gasPrice: 250_000_000_000, }, l2node: { url: process.env.L2_PROVIDER || '', ...commonConfig, - gasPrice: 250_000_000_000 - } + gasPrice: 250_000_000_000, + }, }, paths: { - sources: './src' + sources: './src', }, namedAccounts: { // migrations deployer: { - default: 0 + default: 0, }, consumer: { - default: 1 + default: 1, }, // tests account0: { - default: 2 + default: 2, }, account1: { - default: 3 + default: 3, }, account2: { - default: 4 + default: 4, }, account3: { - default: 5 + default: 5, }, account4: { - default: 6 + default: 6, }, account5: { - default: 7 + default: 7, }, account6: { - default: 8 + default: 8, }, account7: { - default: 9 + default: 9, }, account8: { - default: 10 - } - } + default: 10, + }, + }, } task('address', 'Convert mnemonic to address') @@ -124,7 +124,7 @@ task('read-data-feed', 'Read latest data from DataFeedConsumerMock') const dataFeedConsumerSigner = await ethers.getContractAt( 'DataFeedConsumerMock', dataFeedConsumerMock.address, - _consumer + _consumer, ) console.log('DataFeedConsumerMock', dataFeedConsumerMock.address) @@ -191,7 +191,7 @@ task('send-klay', 'Send $KLAY from faucet') const tx = { from: wallet.address, to: taskArgs.address, - value + value, } const txReceipt = await (await wallet.sendTransaction(tx)).wait() diff --git a/contracts/v0.1/lint-staged.config.js b/contracts/v0.1/lint-staged.config.js index 5e0033809..099815807 100644 --- a/contracts/v0.1/lint-staged.config.js +++ b/contracts/v0.1/lint-staged.config.js @@ -1,4 +1,4 @@ module.exports = { - "src/**/*": "yarn prettier-solidity-write", - "scripts/**/*": "yarn lint --fix", -} \ No newline at end of file + 'src/**/*': 'yarn prettier-solidity-write', + 'scripts/**/*': 'yarn lint --fix', +} diff --git a/contracts/v0.1/migration/baobab/Aggregator/20231102141119_BORA-KRW.json b/contracts/v0.1/migration/baobab/Aggregator/20231102141119_BORA-KRW.json index 7e916683f..dc5add511 100644 --- a/contracts/v0.1/migration/baobab/Aggregator/20231102141119_BORA-KRW.json +++ b/contracts/v0.1/migration/baobab/Aggregator/20231102141119_BORA-KRW.json @@ -1,18 +1,16 @@ { - "deploy": { - "name": "BORA-KRW", - "timeout": 0, - "validator": "0x0000000000000000000000000000000000000000", - "decimals": 8, - "description": "BORA-KRW" - }, - "changeOracles": { - "removed": [], - "added": [ - "0xBfF1B260584De3678F3c2AEd2b43dC4a2ea48D05" - ], - "minSubmissionCount": 1, - "maxSubmissionCount": 1, - "restartDelay": 0 - } -} \ No newline at end of file + "deploy": { + "name": "BORA-KRW", + "timeout": 0, + "validator": "0x0000000000000000000000000000000000000000", + "decimals": 8, + "description": "BORA-KRW" + }, + "changeOracles": { + "removed": [], + "added": ["0xBfF1B260584De3678F3c2AEd2b43dC4a2ea48D05"], + "minSubmissionCount": 1, + "maxSubmissionCount": 1, + "restartDelay": 0 + } +} diff --git a/contracts/v0.1/migration/baobab/Aggregator/20231102141119_KSP-KRW.json b/contracts/v0.1/migration/baobab/Aggregator/20231102141119_KSP-KRW.json index 5d660d5e4..f881d3636 100644 --- a/contracts/v0.1/migration/baobab/Aggregator/20231102141119_KSP-KRW.json +++ b/contracts/v0.1/migration/baobab/Aggregator/20231102141119_KSP-KRW.json @@ -1,18 +1,16 @@ { - "deploy": { - "name": "KSP-KRW", - "timeout": 0, - "validator": "0x0000000000000000000000000000000000000000", - "decimals": 8, - "description": "KSP-KRW" - }, - "changeOracles": { - "removed": [], - "added": [ - "0x60d690E4d5db4025F4781c6cF3bFf8669500823C" - ], - "minSubmissionCount": 1, - "maxSubmissionCount": 1, - "restartDelay": 0 - } -} \ No newline at end of file + "deploy": { + "name": "KSP-KRW", + "timeout": 0, + "validator": "0x0000000000000000000000000000000000000000", + "decimals": 8, + "description": "KSP-KRW" + }, + "changeOracles": { + "removed": [], + "added": ["0x60d690E4d5db4025F4781c6cF3bFf8669500823C"], + "minSubmissionCount": 1, + "maxSubmissionCount": 1, + "restartDelay": 0 + } +} diff --git a/contracts/v0.1/migration/baobab/Aggregator/20231102141119_MBX-KRW.json b/contracts/v0.1/migration/baobab/Aggregator/20231102141119_MBX-KRW.json index 50c422189..9d869b632 100644 --- a/contracts/v0.1/migration/baobab/Aggregator/20231102141119_MBX-KRW.json +++ b/contracts/v0.1/migration/baobab/Aggregator/20231102141119_MBX-KRW.json @@ -1,18 +1,16 @@ { - "deploy": { - "name": "MBX-KRW", - "timeout": 0, - "validator": "0x0000000000000000000000000000000000000000", - "decimals": 8, - "description": "MBX-KRW" - }, - "changeOracles": { - "removed": [], - "added": [ - "0x95B4cef2d1d6a0B22B339306cEA3aff74548CF83" - ], - "minSubmissionCount": 1, - "maxSubmissionCount": 1, - "restartDelay": 0 - } -} \ No newline at end of file + "deploy": { + "name": "MBX-KRW", + "timeout": 0, + "validator": "0x0000000000000000000000000000000000000000", + "decimals": 8, + "description": "MBX-KRW" + }, + "changeOracles": { + "removed": [], + "added": ["0x95B4cef2d1d6a0B22B339306cEA3aff74548CF83"], + "minSubmissionCount": 1, + "maxSubmissionCount": 1, + "restartDelay": 0 + } +} diff --git a/contracts/v0.1/migration/baobab/Aggregator/20231102141119_WEMIX-USDT.json b/contracts/v0.1/migration/baobab/Aggregator/20231102141119_WEMIX-USDT.json index 18fed101c..cdaba540a 100644 --- a/contracts/v0.1/migration/baobab/Aggregator/20231102141119_WEMIX-USDT.json +++ b/contracts/v0.1/migration/baobab/Aggregator/20231102141119_WEMIX-USDT.json @@ -1,18 +1,16 @@ { - "deploy": { - "name": "WEMIX-USDT", - "timeout": 0, - "validator": "0x0000000000000000000000000000000000000000", - "decimals": 8, - "description": "WEMIX-USDT" - }, - "changeOracles": { - "removed": [], - "added": [ - "0xf7EBa1510494206aeCd45E2c7C7370d40437Fb89" - ], - "minSubmissionCount": 1, - "maxSubmissionCount": 1, - "restartDelay": 0 - } -} \ No newline at end of file + "deploy": { + "name": "WEMIX-USDT", + "timeout": 0, + "validator": "0x0000000000000000000000000000000000000000", + "decimals": 8, + "description": "WEMIX-USDT" + }, + "changeOracles": { + "removed": [], + "added": ["0xf7EBa1510494206aeCd45E2c7C7370d40437Fb89"], + "minSubmissionCount": 1, + "maxSubmissionCount": 1, + "restartDelay": 0 + } +} diff --git a/contracts/v0.1/migration/baobab/Aggregator/20231114131186_CHF-USD.json b/contracts/v0.1/migration/baobab/Aggregator/20231114131186_CHF-USD.json index 28fd7e85e..488d38558 100644 --- a/contracts/v0.1/migration/baobab/Aggregator/20231114131186_CHF-USD.json +++ b/contracts/v0.1/migration/baobab/Aggregator/20231114131186_CHF-USD.json @@ -1,18 +1,16 @@ { - "deploy": { - "name": "CHF-USD", - "timeout": 0, - "validator": "0x0000000000000000000000000000000000000000", - "decimals": 8, - "description": "CHF-USD" - }, - "changeOracles": { - "removed": [], - "added": [ - "0xa68a486a654Ca02623e8A41f703A1b24A2cd666e" - ], - "minSubmissionCount": 1, - "maxSubmissionCount": 1, - "restartDelay": 0 - } -} \ No newline at end of file + "deploy": { + "name": "CHF-USD", + "timeout": 0, + "validator": "0x0000000000000000000000000000000000000000", + "decimals": 8, + "description": "CHF-USD" + }, + "changeOracles": { + "removed": [], + "added": ["0xa68a486a654Ca02623e8A41f703A1b24A2cd666e"], + "minSubmissionCount": 1, + "maxSubmissionCount": 1, + "restartDelay": 0 + } +} diff --git a/contracts/v0.1/migration/baobab/Aggregator/20231114131186_EUR-USD.json b/contracts/v0.1/migration/baobab/Aggregator/20231114131186_EUR-USD.json index f18f23248..548772a09 100644 --- a/contracts/v0.1/migration/baobab/Aggregator/20231114131186_EUR-USD.json +++ b/contracts/v0.1/migration/baobab/Aggregator/20231114131186_EUR-USD.json @@ -1,18 +1,16 @@ { - "deploy": { - "name": "EUR-USD", - "timeout": 0, - "validator": "0x0000000000000000000000000000000000000000", - "decimals": 8, - "description": "EUR-USD" - }, - "changeOracles": { - "removed": [], - "added": [ - "0xafF31EA948e85D19eB9ff197B1954A0A90A74E69" - ], - "minSubmissionCount": 1, - "maxSubmissionCount": 1, - "restartDelay": 0 - } -} \ No newline at end of file + "deploy": { + "name": "EUR-USD", + "timeout": 0, + "validator": "0x0000000000000000000000000000000000000000", + "decimals": 8, + "description": "EUR-USD" + }, + "changeOracles": { + "removed": [], + "added": ["0xafF31EA948e85D19eB9ff197B1954A0A90A74E69"], + "minSubmissionCount": 1, + "maxSubmissionCount": 1, + "restartDelay": 0 + } +} diff --git a/contracts/v0.1/migration/baobab/Aggregator/20231114131186_GBP-USD.json b/contracts/v0.1/migration/baobab/Aggregator/20231114131186_GBP-USD.json index 4e0c114d3..6eca22906 100644 --- a/contracts/v0.1/migration/baobab/Aggregator/20231114131186_GBP-USD.json +++ b/contracts/v0.1/migration/baobab/Aggregator/20231114131186_GBP-USD.json @@ -1,18 +1,16 @@ { - "deploy": { - "name": "GBP-USD", - "timeout": 0, - "validator": "0x0000000000000000000000000000000000000000", - "decimals": 8, - "description": "GBP-USD" - }, - "changeOracles": { - "removed": [], - "added": [ - "0xDe3bE8Bd48b1b5b049678Cc66A38F0D959087a69" - ], - "minSubmissionCount": 1, - "maxSubmissionCount": 1, - "restartDelay": 0 - } -} \ No newline at end of file + "deploy": { + "name": "GBP-USD", + "timeout": 0, + "validator": "0x0000000000000000000000000000000000000000", + "decimals": 8, + "description": "GBP-USD" + }, + "changeOracles": { + "removed": [], + "added": ["0xDe3bE8Bd48b1b5b049678Cc66A38F0D959087a69"], + "minSubmissionCount": 1, + "maxSubmissionCount": 1, + "restartDelay": 0 + } +} diff --git a/contracts/v0.1/migration/baobab/Aggregator/20231114131186_JPY-USD.json b/contracts/v0.1/migration/baobab/Aggregator/20231114131186_JPY-USD.json index 9bbb6b920..fc8e58bb3 100644 --- a/contracts/v0.1/migration/baobab/Aggregator/20231114131186_JPY-USD.json +++ b/contracts/v0.1/migration/baobab/Aggregator/20231114131186_JPY-USD.json @@ -1,18 +1,16 @@ { - "deploy": { - "name": "JPY-USD", - "timeout": 0, - "validator": "0x0000000000000000000000000000000000000000", - "decimals": 8, - "description": "JPY-USD" - }, - "changeOracles": { - "removed": [], - "added": [ - "0xe06715500bdBd5dafeF2415DC75A11bb1380bfb1" - ], - "minSubmissionCount": 1, - "maxSubmissionCount": 1, - "restartDelay": 0 - } -} \ No newline at end of file + "deploy": { + "name": "JPY-USD", + "timeout": 0, + "validator": "0x0000000000000000000000000000000000000000", + "decimals": 8, + "description": "JPY-USD" + }, + "changeOracles": { + "removed": [], + "added": ["0xe06715500bdBd5dafeF2415DC75A11bb1380bfb1"], + "minSubmissionCount": 1, + "maxSubmissionCount": 1, + "restartDelay": 0 + } +} diff --git a/contracts/v0.1/migration/baobab/Aggregator/20231114131186_KRW-USD.json b/contracts/v0.1/migration/baobab/Aggregator/20231114131186_KRW-USD.json index 7a61514cd..c4a4560ae 100644 --- a/contracts/v0.1/migration/baobab/Aggregator/20231114131186_KRW-USD.json +++ b/contracts/v0.1/migration/baobab/Aggregator/20231114131186_KRW-USD.json @@ -1,18 +1,16 @@ { - "deploy": { - "name": "KRW-USD", - "timeout": 0, - "validator": "0x0000000000000000000000000000000000000000", - "decimals": 8, - "description": "KRW-USD" - }, - "changeOracles": { - "removed": [], - "added": [ - "0x30167101c91dac2757e4F55e337f3aB6E23eC671" - ], - "minSubmissionCount": 1, - "maxSubmissionCount": 1, - "restartDelay": 0 - } -} \ No newline at end of file + "deploy": { + "name": "KRW-USD", + "timeout": 0, + "validator": "0x0000000000000000000000000000000000000000", + "decimals": 8, + "description": "KRW-USD" + }, + "changeOracles": { + "removed": [], + "added": ["0x30167101c91dac2757e4F55e337f3aB6E23eC671"], + "minSubmissionCount": 1, + "maxSubmissionCount": 1, + "restartDelay": 0 + } +} diff --git a/contracts/v0.1/migration/baobab/Aggregator/20240409170444_PER-KLAY.json b/contracts/v0.1/migration/baobab/Aggregator/20240409170444_PER-KLAY.json index d5dd468f5..80f8e4ee1 100644 --- a/contracts/v0.1/migration/baobab/Aggregator/20240409170444_PER-KLAY.json +++ b/contracts/v0.1/migration/baobab/Aggregator/20240409170444_PER-KLAY.json @@ -8,11 +8,9 @@ }, "changeOracles": { "removed": [], - "added": [ - "0xC971283bc5a7329f375B5DB19120Ba37051229fF" - ], + "added": ["0xC971283bc5a7329f375B5DB19120Ba37051229fF"], "minSubmissionCount": 1, "maxSubmissionCount": 1, "restartDelay": 0 } -} \ No newline at end of file +} diff --git a/contracts/v0.1/migration/cypress/Aggregator/20231102141113_BORA-KRW.json b/contracts/v0.1/migration/cypress/Aggregator/20231102141113_BORA-KRW.json index cc3655aef..7200a6a43 100644 --- a/contracts/v0.1/migration/cypress/Aggregator/20231102141113_BORA-KRW.json +++ b/contracts/v0.1/migration/cypress/Aggregator/20231102141113_BORA-KRW.json @@ -1,18 +1,16 @@ { - "deploy": { - "name": "BORA-KRW", - "timeout": 0, - "validator": "0x0000000000000000000000000000000000000000", - "decimals": 8, - "description": "BORA-KRW" - }, - "changeOracles": { - "removed": [], - "added": [ - "0x5147611E86AAb2C457A7e1ef5E4B1De4152a820b" - ], - "minSubmissionCount": 1, - "maxSubmissionCount": 1, - "restartDelay": 0 - } -} \ No newline at end of file + "deploy": { + "name": "BORA-KRW", + "timeout": 0, + "validator": "0x0000000000000000000000000000000000000000", + "decimals": 8, + "description": "BORA-KRW" + }, + "changeOracles": { + "removed": [], + "added": ["0x5147611E86AAb2C457A7e1ef5E4B1De4152a820b"], + "minSubmissionCount": 1, + "maxSubmissionCount": 1, + "restartDelay": 0 + } +} diff --git a/contracts/v0.1/migration/cypress/Aggregator/20231102141113_KSP-KRW.json b/contracts/v0.1/migration/cypress/Aggregator/20231102141113_KSP-KRW.json index 163a56741..18a500e98 100644 --- a/contracts/v0.1/migration/cypress/Aggregator/20231102141113_KSP-KRW.json +++ b/contracts/v0.1/migration/cypress/Aggregator/20231102141113_KSP-KRW.json @@ -1,18 +1,16 @@ { - "deploy": { - "name": "KSP-KRW", - "timeout": 0, - "validator": "0x0000000000000000000000000000000000000000", - "decimals": 8, - "description": "KSP-KRW" - }, - "changeOracles": { - "removed": [], - "added": [ - "0xcB276EF204A8C47D4031aC31B3f5C8Ff35Ee4f50" - ], - "minSubmissionCount": 1, - "maxSubmissionCount": 1, - "restartDelay": 0 - } -} \ No newline at end of file + "deploy": { + "name": "KSP-KRW", + "timeout": 0, + "validator": "0x0000000000000000000000000000000000000000", + "decimals": 8, + "description": "KSP-KRW" + }, + "changeOracles": { + "removed": [], + "added": ["0xcB276EF204A8C47D4031aC31B3f5C8Ff35Ee4f50"], + "minSubmissionCount": 1, + "maxSubmissionCount": 1, + "restartDelay": 0 + } +} diff --git a/contracts/v0.1/migration/cypress/Aggregator/20231102141113_MBX-KRW.json b/contracts/v0.1/migration/cypress/Aggregator/20231102141113_MBX-KRW.json index 3e052813f..d5c57a3b5 100644 --- a/contracts/v0.1/migration/cypress/Aggregator/20231102141113_MBX-KRW.json +++ b/contracts/v0.1/migration/cypress/Aggregator/20231102141113_MBX-KRW.json @@ -1,18 +1,16 @@ { - "deploy": { - "name": "MBX-KRW", - "timeout": 0, - "validator": "0x0000000000000000000000000000000000000000", - "decimals": 8, - "description": "MBX-KRW" - }, - "changeOracles": { - "removed": [], - "added": [ - "0x8884e649759b34364e2A8257d004A2f1a024205B" - ], - "minSubmissionCount": 1, - "maxSubmissionCount": 1, - "restartDelay": 0 - } -} \ No newline at end of file + "deploy": { + "name": "MBX-KRW", + "timeout": 0, + "validator": "0x0000000000000000000000000000000000000000", + "decimals": 8, + "description": "MBX-KRW" + }, + "changeOracles": { + "removed": [], + "added": ["0x8884e649759b34364e2A8257d004A2f1a024205B"], + "minSubmissionCount": 1, + "maxSubmissionCount": 1, + "restartDelay": 0 + } +} diff --git a/contracts/v0.1/migration/cypress/Aggregator/20231102141113_WEMIX-USDT.json b/contracts/v0.1/migration/cypress/Aggregator/20231102141113_WEMIX-USDT.json index 484322e37..87b601081 100644 --- a/contracts/v0.1/migration/cypress/Aggregator/20231102141113_WEMIX-USDT.json +++ b/contracts/v0.1/migration/cypress/Aggregator/20231102141113_WEMIX-USDT.json @@ -1,18 +1,16 @@ { - "deploy": { - "name": "WEMIX-USDT", - "timeout": 0, - "validator": "0x0000000000000000000000000000000000000000", - "decimals": 8, - "description": "WEMIX-USDT" - }, - "changeOracles": { - "removed": [], - "added": [ - "0xeB560be082c90250D73D827B47CaC786321F166e" - ], - "minSubmissionCount": 1, - "maxSubmissionCount": 1, - "restartDelay": 0 - } -} \ No newline at end of file + "deploy": { + "name": "WEMIX-USDT", + "timeout": 0, + "validator": "0x0000000000000000000000000000000000000000", + "decimals": 8, + "description": "WEMIX-USDT" + }, + "changeOracles": { + "removed": [], + "added": ["0xeB560be082c90250D73D827B47CaC786321F166e"], + "minSubmissionCount": 1, + "maxSubmissionCount": 1, + "restartDelay": 0 + } +} diff --git a/contracts/v0.1/migration/cypress/Aggregator/20231114131165_CHF-USD.json b/contracts/v0.1/migration/cypress/Aggregator/20231114131165_CHF-USD.json index 03f51f26a..a291fcc18 100644 --- a/contracts/v0.1/migration/cypress/Aggregator/20231114131165_CHF-USD.json +++ b/contracts/v0.1/migration/cypress/Aggregator/20231114131165_CHF-USD.json @@ -1,18 +1,16 @@ { - "deploy": { - "name": "CHF-USD", - "timeout": 0, - "validator": "0x0000000000000000000000000000000000000000", - "decimals": 8, - "description": "CHF-USD" - }, - "changeOracles": { - "removed": [], - "added": [ - "0x60e898B16E74B1367be5520195F5556A0b193fF5" - ], - "minSubmissionCount": 1, - "maxSubmissionCount": 1, - "restartDelay": 0 - } -} \ No newline at end of file + "deploy": { + "name": "CHF-USD", + "timeout": 0, + "validator": "0x0000000000000000000000000000000000000000", + "decimals": 8, + "description": "CHF-USD" + }, + "changeOracles": { + "removed": [], + "added": ["0x60e898B16E74B1367be5520195F5556A0b193fF5"], + "minSubmissionCount": 1, + "maxSubmissionCount": 1, + "restartDelay": 0 + } +} diff --git a/contracts/v0.1/migration/cypress/Aggregator/20231114131165_EUR-USD.json b/contracts/v0.1/migration/cypress/Aggregator/20231114131165_EUR-USD.json index f12aaca6c..5d06dc086 100644 --- a/contracts/v0.1/migration/cypress/Aggregator/20231114131165_EUR-USD.json +++ b/contracts/v0.1/migration/cypress/Aggregator/20231114131165_EUR-USD.json @@ -1,18 +1,16 @@ { - "deploy": { - "name": "EUR-USD", - "timeout": 0, - "validator": "0x0000000000000000000000000000000000000000", - "decimals": 8, - "description": "EUR-USD" - }, - "changeOracles": { - "removed": [], - "added": [ - "0xE505dd4Ff478b7CA2BF4cfCa1A116daD12E4eD71" - ], - "minSubmissionCount": 1, - "maxSubmissionCount": 1, - "restartDelay": 0 - } -} \ No newline at end of file + "deploy": { + "name": "EUR-USD", + "timeout": 0, + "validator": "0x0000000000000000000000000000000000000000", + "decimals": 8, + "description": "EUR-USD" + }, + "changeOracles": { + "removed": [], + "added": ["0xE505dd4Ff478b7CA2BF4cfCa1A116daD12E4eD71"], + "minSubmissionCount": 1, + "maxSubmissionCount": 1, + "restartDelay": 0 + } +} diff --git a/contracts/v0.1/migration/cypress/Aggregator/20231114131165_GBP-USD.json b/contracts/v0.1/migration/cypress/Aggregator/20231114131165_GBP-USD.json index 5d5bc3b02..84260a7b4 100644 --- a/contracts/v0.1/migration/cypress/Aggregator/20231114131165_GBP-USD.json +++ b/contracts/v0.1/migration/cypress/Aggregator/20231114131165_GBP-USD.json @@ -1,18 +1,16 @@ { - "deploy": { - "name": "GBP-USD", - "timeout": 0, - "validator": "0x0000000000000000000000000000000000000000", - "decimals": 8, - "description": "GBP-USD" - }, - "changeOracles": { - "removed": [], - "added": [ - "0x496Fb9Ab3BEc7eaFD2b66C227D197d4a5Fb634e7" - ], - "minSubmissionCount": 1, - "maxSubmissionCount": 1, - "restartDelay": 0 - } -} \ No newline at end of file + "deploy": { + "name": "GBP-USD", + "timeout": 0, + "validator": "0x0000000000000000000000000000000000000000", + "decimals": 8, + "description": "GBP-USD" + }, + "changeOracles": { + "removed": [], + "added": ["0x496Fb9Ab3BEc7eaFD2b66C227D197d4a5Fb634e7"], + "minSubmissionCount": 1, + "maxSubmissionCount": 1, + "restartDelay": 0 + } +} diff --git a/contracts/v0.1/migration/cypress/Aggregator/20231114131165_JPY-USD.json b/contracts/v0.1/migration/cypress/Aggregator/20231114131165_JPY-USD.json index 594400c41..d4937bd9d 100644 --- a/contracts/v0.1/migration/cypress/Aggregator/20231114131165_JPY-USD.json +++ b/contracts/v0.1/migration/cypress/Aggregator/20231114131165_JPY-USD.json @@ -1,18 +1,16 @@ { - "deploy": { - "name": "JPY-USD", - "timeout": 0, - "validator": "0x0000000000000000000000000000000000000000", - "decimals": 8, - "description": "JPY-USD" - }, - "changeOracles": { - "removed": [], - "added": [ - "0x5EBFdE0c96047a9ff4CC4FA4A07d934c2686877A" - ], - "minSubmissionCount": 1, - "maxSubmissionCount": 1, - "restartDelay": 0 - } -} \ No newline at end of file + "deploy": { + "name": "JPY-USD", + "timeout": 0, + "validator": "0x0000000000000000000000000000000000000000", + "decimals": 8, + "description": "JPY-USD" + }, + "changeOracles": { + "removed": [], + "added": ["0x5EBFdE0c96047a9ff4CC4FA4A07d934c2686877A"], + "minSubmissionCount": 1, + "maxSubmissionCount": 1, + "restartDelay": 0 + } +} diff --git a/contracts/v0.1/migration/cypress/Aggregator/20231114131165_KRW-USD.json b/contracts/v0.1/migration/cypress/Aggregator/20231114131165_KRW-USD.json index 78fdbb034..f298882fc 100644 --- a/contracts/v0.1/migration/cypress/Aggregator/20231114131165_KRW-USD.json +++ b/contracts/v0.1/migration/cypress/Aggregator/20231114131165_KRW-USD.json @@ -1,18 +1,16 @@ { - "deploy": { - "name": "KRW-USD", - "timeout": 0, - "validator": "0x0000000000000000000000000000000000000000", - "decimals": 8, - "description": "KRW-USD" - }, - "changeOracles": { - "removed": [], - "added": [ - "0x14d2B6C6515D9D99D8FCCFfAcA39979F077D6C9B" - ], - "minSubmissionCount": 1, - "maxSubmissionCount": 1, - "restartDelay": 0 - } -} \ No newline at end of file + "deploy": { + "name": "KRW-USD", + "timeout": 0, + "validator": "0x0000000000000000000000000000000000000000", + "decimals": 8, + "description": "KRW-USD" + }, + "changeOracles": { + "removed": [], + "added": ["0x14d2B6C6515D9D99D8FCCFfAcA39979F077D6C9B"], + "minSubmissionCount": 1, + "maxSubmissionCount": 1, + "restartDelay": 0 + } +} diff --git a/contracts/v0.1/migration/cypress/Aggregator/20240411160440_PER-KLAY.json b/contracts/v0.1/migration/cypress/Aggregator/20240411160440_PER-KLAY.json index 39851cddc..bcc1a2e49 100644 --- a/contracts/v0.1/migration/cypress/Aggregator/20240411160440_PER-KLAY.json +++ b/contracts/v0.1/migration/cypress/Aggregator/20240411160440_PER-KLAY.json @@ -8,11 +8,9 @@ }, "changeOracles": { "removed": [], - "added": [ - "0xD07bD0bcd3A8Fa1087430B1BE457E05c4A412A4B" - ], + "added": ["0xD07bD0bcd3A8Fa1087430B1BE457E05c4A412A4B"], "minSubmissionCount": 1, "maxSubmissionCount": 1, "restartDelay": 0 } -} \ No newline at end of file +} diff --git a/contracts/v0.1/migration/cypress/RequestResponse/20231031160004_fix-request-response-cypress.json b/contracts/v0.1/migration/cypress/RequestResponse/20231031160004_fix-request-response-cypress.json index 47cccb36e..36a0d9699 100644 --- a/contracts/v0.1/migration/cypress/RequestResponse/20231031160004_fix-request-response-cypress.json +++ b/contracts/v0.1/migration/cypress/RequestResponse/20231031160004_fix-request-response-cypress.json @@ -1,5 +1,5 @@ { - "requestResponseCoordinatorAddress": "0x159F3BB6609B4C709F15823F3544032942106042", - "registerOracle": ["0x3C8Be294c70418cF74A04092700FF56B124C6FcA"], - "deregisterOracle": ["0xc2C88492Cf7e5240C3EB49353539E75336960600"] -} \ No newline at end of file + "requestResponseCoordinatorAddress": "0x159F3BB6609B4C709F15823F3544032942106042", + "registerOracle": ["0x3C8Be294c70418cF74A04092700FF56B124C6FcA"], + "deregisterOracle": ["0xc2C88492Cf7e5240C3EB49353539E75336960600"] +} diff --git a/contracts/v0.1/migration/localhost/Prepayment/20230413094038_deploy.json b/contracts/v0.1/migration/localhost/Prepayment/20230413094038_deploy.json index 15fa9feb6..d5175bc34 100644 --- a/contracts/v0.1/migration/localhost/Prepayment/20230413094038_deploy.json +++ b/contracts/v0.1/migration/localhost/Prepayment/20230413094038_deploy.json @@ -1,5 +1,5 @@ { "deploy": { - "protocolFeeRecipient": "0xBcd4042DE499D14e55001CcbB24a551F3b954096" + "protocolFeeRecipient": "0xBcd4042DE499D14e55001CcbB24a551F3b954096" } } diff --git a/contracts/v0.1/migration/localhost/RequestResponse/20230321121337_init.json b/contracts/v0.1/migration/localhost/RequestResponse/20230321121337_init.json index fd9453ffa..e9d889117 100644 --- a/contracts/v0.1/migration/localhost/RequestResponse/20230321121337_init.json +++ b/contracts/v0.1/migration/localhost/RequestResponse/20230321121337_init.json @@ -3,9 +3,7 @@ "deploy": { "version": "0.1.0" }, - "registerOracle": [ - "0xdD2FD4581271e230360230F9337D5c0430Bf44C0" - ], + "registerOracle": ["0xdD2FD4581271e230360230F9337D5c0430Bf44C0"], "deregisterOracle": [], "setConfig": { "maxGasLimit": 2500000, diff --git a/contracts/v0.1/scripts/admin-aggregator/dataFeedSample.json b/contracts/v0.1/scripts/admin-aggregator/dataFeedSample.json index 27e97be0f..d2b0a3126 100644 --- a/contracts/v0.1/scripts/admin-aggregator/dataFeedSample.json +++ b/contracts/v0.1/scripts/admin-aggregator/dataFeedSample.json @@ -1,17 +1,16 @@ { - "deploy": { - "name": "", - "timeout": 0, - "validator": "0x0000000000000000000000000000000000000000", - "decimals": 8, - "description": "" - }, - "changeOracles": { - "removed": [], - "added": [], - "minSubmissionCount": 1, - "maxSubmissionCount": 1, - "restartDelay": 0 - } + "deploy": { + "name": "", + "timeout": 0, + "validator": "0x0000000000000000000000000000000000000000", + "decimals": 8, + "description": "" + }, + "changeOracles": { + "removed": [], + "added": [], + "minSubmissionCount": 1, + "maxSubmissionCount": 1, + "restartDelay": 0 } - \ No newline at end of file +} diff --git a/contracts/v0.1/scripts/admin-aggregator/generate-aggregator-deployments.cjs b/contracts/v0.1/scripts/admin-aggregator/generate-aggregator-deployments.cjs index c520cdaf5..271d431a5 100644 --- a/contracts/v0.1/scripts/admin-aggregator/generate-aggregator-deployments.cjs +++ b/contracts/v0.1/scripts/admin-aggregator/generate-aggregator-deployments.cjs @@ -13,11 +13,11 @@ const readArgs = async () => { const requiredArgs = ['--pairs', '--chain'] const options = { pairs: { - type: 'string' + type: 'string', }, chain: { - type: 'string' - } + type: 'string', + }, } const { values } = parseArgs({ requiredArgs, options }) values['pairs'] = JSON.parse(values['pairs']) @@ -54,7 +54,7 @@ async function main() { dataFeed: priceFeed, address: wallet.address, privateKey: wallet.privateKey, - mnemonic: wallet.mnemonic.phrase + mnemonic: wallet.mnemonic.phrase, } walletList.push(account) @@ -74,8 +74,8 @@ async function main() { aggregatorSource: `https://config.orakl.network/aggregator/${chain}/${priceFeed.toLowerCase()}.aggregator.json`, reporter: { walletAddress: wallet.address, - walletPrivateKey: wallet.privateKey - } + walletPrivateKey: wallet.privateKey, + }, }) } diff --git a/contracts/v0.1/scripts/admin-aggregator/update-oracles.ts b/contracts/v0.1/scripts/admin-aggregator/update-oracles.ts index 0006fa183..326a70412 100644 --- a/contracts/v0.1/scripts/admin-aggregator/update-oracles.ts +++ b/contracts/v0.1/scripts/admin-aggregator/update-oracles.ts @@ -24,7 +24,7 @@ async function main() { addedAdmins, minSubmissionCount, maxSubmissionCount, - restartDelay + restartDelay, ) ).wait() } diff --git a/contracts/v0.1/scripts/data-feed/oracle-round-state.cjs b/contracts/v0.1/scripts/data-feed/oracle-round-state.cjs index 1a82607f1..d3b401566 100644 --- a/contracts/v0.1/scripts/data-feed/oracle-round-state.cjs +++ b/contracts/v0.1/scripts/data-feed/oracle-round-state.cjs @@ -31,7 +31,7 @@ async function main() { _timeout, _availableFunds, _oracleCount, - _paymentAmount + _paymentAmount, } = await aggregator.connect(_consumer).oracleRoundState(_feedOracle0, 0) console.log(`_eligibleToSubmit ${_eligibleToSubmit}`) diff --git a/contracts/v0.1/scripts/generate-contract-addresses.js b/contracts/v0.1/scripts/generate-contract-addresses.js index cf5404e42..c332e1a0b 100644 --- a/contracts/v0.1/scripts/generate-contract-addresses.js +++ b/contracts/v0.1/scripts/generate-contract-addresses.js @@ -92,7 +92,7 @@ const readDeployments = async (folderPath, tags) => { others[network][contractName] = address } } - }) + }), ) } @@ -130,11 +130,11 @@ async function main() { const { dataFeeds, others } = await readDeployments(deploymentsPath, tags) await storeJson( path.join(deploymentsPath, 'datafeeds-addresses.json'), - JSON.stringify(dataFeeds, null, 2) + JSON.stringify(dataFeeds, null, 2), ) await storeJson( path.join(deploymentsPath, 'other-addresses.json'), - JSON.stringify(others, null, 2) + JSON.stringify(others, null, 2), ) } diff --git a/contracts/v0.1/scripts/prepayment/config.ts b/contracts/v0.1/scripts/prepayment/config.ts index be6e608e8..29e98b6fd 100644 --- a/contracts/v0.1/scripts/prepayment/config.ts +++ b/contracts/v0.1/scripts/prepayment/config.ts @@ -24,5 +24,5 @@ module.exports = { SUBSCRIPTION_PRICE, ACC_ID, PROVIDER_URL, - MNEMONIC + MNEMONIC, } diff --git a/contracts/v0.1/scripts/prepayment/create-fiat-subscription-account.cjs b/contracts/v0.1/scripts/prepayment/create-fiat-subscription-account.cjs index 55aac9477..30bf471e3 100644 --- a/contracts/v0.1/scripts/prepayment/create-fiat-subscription-account.cjs +++ b/contracts/v0.1/scripts/prepayment/create-fiat-subscription-account.cjs @@ -4,7 +4,7 @@ const { REQUEST_NUMBER, OWNER_ADDRESS, PROVIDER_URL, - MNEMONIC + MNEMONIC, } = require('./config.ts') const { ethers } = require('hardhat') diff --git a/contracts/v0.1/scripts/prepayment/create-klay-subscription-account.cjs b/contracts/v0.1/scripts/prepayment/create-klay-subscription-account.cjs index 8b776f299..62eb03df1 100644 --- a/contracts/v0.1/scripts/prepayment/create-klay-subscription-account.cjs +++ b/contracts/v0.1/scripts/prepayment/create-klay-subscription-account.cjs @@ -5,7 +5,7 @@ const { START_TIME, SUBSCRIPTION_PRICE, PROVIDER_URL, - MNEMONIC + MNEMONIC, } = require('./config.ts') const { ethers } = require('hardhat') @@ -45,7 +45,7 @@ async function main() { period, requestNumber, subscriptionPrice, - ownerAddress + ownerAddress, ) ).wait() @@ -64,7 +64,7 @@ async function main() { console.log(`Subscription Duration:\t\t${sPeriod / (60 * 60 * 24)} days`) console.log(`Periodic Request Count:\t\t${sPeriodReqCount}`) console.log( - `Subscription Price (KLAY):\t${ethers.utils.formatUnits(sSubscriptionPrice, 'ether')}` + `Subscription Price (KLAY):\t${ethers.utils.formatUnits(sSubscriptionPrice, 'ether')}`, ) console.log('Transaction Hash:\t\t', txReceipt.transactionHash) } diff --git a/contracts/v0.1/scripts/prepayment/update-account-detail.cjs b/contracts/v0.1/scripts/prepayment/update-account-detail.cjs index 4038ebb5b..441cb824e 100644 --- a/contracts/v0.1/scripts/prepayment/update-account-detail.cjs +++ b/contracts/v0.1/scripts/prepayment/update-account-detail.cjs @@ -5,7 +5,7 @@ const { START_TIME, SUBSCRIPTION_PRICE, PROVIDER_URL, - MNEMONIC + MNEMONIC, } = require('./config.ts') const { ethers } = require('hardhat') @@ -57,7 +57,7 @@ async function main() { console.log(`Subscription Duration:\t\t${sPeriod / (60 * 60 * 24)} days`) console.log(`Periodic Request Count:\t\t${sPeriodReqCount}`) console.log( - `Subscription Price (KLAY):\t${ethers.utils.formatUnits(sSubscriptionPrice, 'ether')}` + `Subscription Price (KLAY):\t${ethers.utils.formatUnits(sSubscriptionPrice, 'ether')}`, ) console.log('Transaction Hash:\t\t', txReceipt.transactionHash) } diff --git a/contracts/v0.1/scripts/registry/proposeChain.cjs b/contracts/v0.1/scripts/registry/proposeChain.cjs index 90b8e416e..a0c974e9b 100644 --- a/contracts/v0.1/scripts/registry/proposeChain.cjs +++ b/contracts/v0.1/scripts/registry/proposeChain.cjs @@ -29,7 +29,7 @@ async function main() { const tx = await ( await registry.proposeChain(pChainID, jsonRpc, endpoint, l1Aggregator, l2Aggregator, { - value: fee + value: fee, }) ).wait() console.log('Tx', tx) diff --git a/contracts/v0.1/scripts/request-response/integration/request-data.ts b/contracts/v0.1/scripts/request-response/integration/request-data.ts index a0c31d51a..4837f4f8b 100644 --- a/contracts/v0.1/scripts/request-response/integration/request-data.ts +++ b/contracts/v0.1/scripts/request-response/integration/request-data.ts @@ -8,7 +8,7 @@ async function main() { const requestResponseConsumerSigner = await ethers.getContractAt( 'RequestResponseConsumerMock', requestResponseConsumerMock.address, - consumer + consumer, ) const requestResponse = await ethers.getContract('RequestResponseCoordinator') diff --git a/contracts/v0.1/scripts/request-response/request-data-direct.cjs b/contracts/v0.1/scripts/request-response/request-data-direct.cjs index 1aa478773..3f2ad6461 100644 --- a/contracts/v0.1/scripts/request-response/request-data-direct.cjs +++ b/contracts/v0.1/scripts/request-response/request-data-direct.cjs @@ -8,7 +8,7 @@ async function main() { const requestResponseConsumerSigner = await ethers.getContractAt( 'RequestResponseConsumerMock', requestResponseConsumerMock.address, - consumer + consumer, ) const callbackGasLimit = 500_000 @@ -19,8 +19,8 @@ async function main() { numSubmission, refundRecipient, { - value: ethers.utils.parseEther('1.0') - } + value: ethers.utils.parseEther('1.0'), + }, ) } diff --git a/contracts/v0.1/scripts/request-response/request-data.cjs b/contracts/v0.1/scripts/request-response/request-data.cjs index 7fd33f554..bb71db765 100644 --- a/contracts/v0.1/scripts/request-response/request-data.cjs +++ b/contracts/v0.1/scripts/request-response/request-data.cjs @@ -8,7 +8,7 @@ async function main() { const requestResponseConsumerSigner = await ethers.getContractAt( 'RequestResponseConsumerMock', requestResponseConsumerMock.address, - consumer + consumer, ) const accId = 1 diff --git a/contracts/v0.1/scripts/sol-error-mappings/error-keccak-mapping.js b/contracts/v0.1/scripts/sol-error-mappings/error-keccak-mapping.js index c7d446197..a03beeafc 100644 --- a/contracts/v0.1/scripts/sol-error-mappings/error-keccak-mapping.js +++ b/contracts/v0.1/scripts/sol-error-mappings/error-keccak-mapping.js @@ -21,13 +21,13 @@ function processFile(filePath) { `${match .split(' ') .filter((_, idx) => idx % 2 === 0) - .join(',')})` + .join(',')})`, ) .replace(';', '') const hash = `0x${sha3.keccak256(processedLine)}` mapping[hash] = { file: filePath, - error: trimmedLine + error: trimmedLine, } } } diff --git a/contracts/v0.1/scripts/sol-error-mappings/errorMappings.json b/contracts/v0.1/scripts/sol-error-mappings/errorMappings.json index c016b4d76..1e6206d0f 100644 --- a/contracts/v0.1/scripts/sol-error-mappings/errorMappings.json +++ b/contracts/v0.1/scripts/sol-error-mappings/errorMappings.json @@ -275,4 +275,4 @@ "file": "src/mocks/VRFConsumerRevertFulfillmentMock.sol", "error": "error AnyError();" } -} \ No newline at end of file +} diff --git a/contracts/v0.1/scripts/utils.cjs b/contracts/v0.1/scripts/utils.cjs index 86d76f8cd..c9f143803 100644 --- a/contracts/v0.1/scripts/utils.cjs +++ b/contracts/v0.1/scripts/utils.cjs @@ -118,7 +118,7 @@ function validateAggregatorChangeOraclesConfig(config) { 'added', 'minSubmissionCount', 'maxSubmissionCount', - 'restartDelay' + 'restartDelay', ] if (!validateProperties(config, requiredProperties)) { @@ -262,5 +262,5 @@ module.exports = { validatePrepaymentDeployConfig, validateAggregatorRedirectProxyConfig, getFormattedDate, - loadDeployments + loadDeployments, } diff --git a/contracts/v0.1/scripts/vrf/integration/request-vrf.ts b/contracts/v0.1/scripts/vrf/integration/request-vrf.ts index e97feb106..6decba934 100644 --- a/contracts/v0.1/scripts/vrf/integration/request-vrf.ts +++ b/contracts/v0.1/scripts/vrf/integration/request-vrf.ts @@ -8,7 +8,7 @@ async function main() { const vrfConsumerSigner = await ethers.getContractAt( 'VRFConsumerMock', vrfConsumerMock.address, - consumer + consumer, ) const vrfCoordinator = await ethers.getContract('VRFCoordinator') const keyHash = '0x47ede773ef09e40658e643fe79f8d1a27c0aa6eb7251749b268f829ea49f2024' diff --git a/contracts/v0.1/scripts/vrf/request-vrf-direct.cjs b/contracts/v0.1/scripts/vrf/request-vrf-direct.cjs index d831d214e..8de9e0fe3 100644 --- a/contracts/v0.1/scripts/vrf/request-vrf-direct.cjs +++ b/contracts/v0.1/scripts/vrf/request-vrf-direct.cjs @@ -8,7 +8,7 @@ async function main() { const vrfConsumerSigner = await ethers.getContractAt( 'VRFConsumerMock', vrfConsumerMock.address, - consumer + consumer, ) const keyHash = '0x47ede773ef09e40658e643fe79f8d1a27c0aa6eb7251749b268f829ea49f2024' @@ -16,7 +16,7 @@ async function main() { const numWords = 1 await vrfConsumerSigner.requestRandomWordsDirectPayment(keyHash, callbackGasLimit, numWords, { - value: ethers.utils.parseEther('1.0') + value: ethers.utils.parseEther('1.0'), }) } diff --git a/contracts/v0.1/scripts/vrf/request-vrf.cjs b/contracts/v0.1/scripts/vrf/request-vrf.cjs index be1c874ba..3549bb7f3 100644 --- a/contracts/v0.1/scripts/vrf/request-vrf.cjs +++ b/contracts/v0.1/scripts/vrf/request-vrf.cjs @@ -8,7 +8,7 @@ async function main() { const vrfConsumerSigner = await ethers.getContractAt( 'VRFConsumerMock', vrfConsumerMock.address, - consumer + consumer, ) const keyHash = '0x47ede773ef09e40658e643fe79f8d1a27c0aa6eb7251749b268f829ea49f2024' diff --git a/contracts/v0.1/test/non-vrf/Account.test.cjs b/contracts/v0.1/test/non-vrf/Account.test.cjs index cfcb4a49f..99b6f8c61 100644 --- a/contracts/v0.1/test/non-vrf/Account.test.cjs +++ b/contracts/v0.1/test/non-vrf/Account.test.cjs @@ -10,16 +10,16 @@ async function deploy() { account0: deployerSigner, account1: consumerSigner, account2: protocolFeeRecipientSigner, - account3: accountBalanceRecipientSigner + account3: accountBalanceRecipientSigner, } = await createSigners() const prepaymentContract = await deployPrepayment( protocolFeeRecipientSigner.address, - deployerSigner + deployerSigner, ) const prepayment = { contract: prepaymentContract, - signer: deployerSigner + signer: deployerSigner, } return { consumerSigner, accountBalanceRecipientSigner, prepayment } @@ -47,7 +47,7 @@ describe('Account', function () { await expect(accountContract.setFeeRatio(50)).to.be.revertedWithCustomError( accountContract, - 'MustBePaymentSolution' + 'MustBePaymentSolution', ) const startTime = Math.round(new Date().getTime() / 1000) - 60 * 60 const period = 60 * 60 * 24 * 7 @@ -55,13 +55,13 @@ describe('Account', function () { const subscriptionPrice = parseKlay(100) await expect( - accountContract.updateAccountDetail(startTime, period, requestNumber, subscriptionPrice) + accountContract.updateAccountDetail(startTime, period, requestNumber, subscriptionPrice), ).to.be.revertedWithCustomError(accountContract, 'MustBePaymentSolution') // Cancel account /////////////////////////////////////////////////////////// // Account cannot be canceled directly await expect( - accountContract.cancelAccount(accountBalanceRecipientSigner.address) + accountContract.cancelAccount(accountBalanceRecipientSigner.address), ).to.be.revertedWithCustomError(accountContract, 'MustBePaymentSolution') // Account has to be canceled through payment solution (e.g. Prepayment) @@ -69,12 +69,12 @@ describe('Account', function () { prepayment.contract, consumerSigner, accId, - accountBalanceRecipientSigner.address + accountBalanceRecipientSigner.address, ) // Account was canceled, we cannot access it through account ID anymore await expect( - prepayment.contract.connect(consumerSigner).getAccount(accId) + prepayment.contract.connect(consumerSigner).getAccount(accId), ).to.be.revertedWithCustomError(prepayment.contract, 'InvalidAccount') }) }) diff --git a/contracts/v0.1/test/non-vrf/Account.utils.cjs b/contracts/v0.1/test/non-vrf/Account.utils.cjs index d062048e8..c0c775260 100644 --- a/contracts/v0.1/test/non-vrf/Account.utils.cjs +++ b/contracts/v0.1/test/non-vrf/Account.utils.cjs @@ -4,7 +4,7 @@ const AccountType = { FIAT_SUBSCRIPTION: 1, KLAY_SUBSCRIPTION: 2, KLAY_DISCOUNT: 3, - KLAY_REGULAR: 4 + KLAY_REGULAR: 4, } function parseAccountCreatedTx(prepayment, tx) { expect(tx.events.length).to.be.equal(1) diff --git a/contracts/v0.1/test/non-vrf/Aggregator.config.cjs b/contracts/v0.1/test/non-vrf/Aggregator.config.cjs index b04d04490..9f2419819 100644 --- a/contracts/v0.1/test/non-vrf/Aggregator.config.cjs +++ b/contracts/v0.1/test/non-vrf/Aggregator.config.cjs @@ -8,10 +8,10 @@ function aggregatorConfig() { timeout, validator, decimals, - description + description, } } module.exports = { - aggregatorConfig + aggregatorConfig, } diff --git a/contracts/v0.1/test/non-vrf/Aggregator.test.cjs b/contracts/v0.1/test/non-vrf/Aggregator.test.cjs index 5da1a6b6d..f030dea3f 100644 --- a/contracts/v0.1/test/non-vrf/Aggregator.test.cjs +++ b/contracts/v0.1/test/non-vrf/Aggregator.test.cjs @@ -6,7 +6,7 @@ const { deployAggregatorProxy, deployAggregator, parseSetRequesterPermissionsTx, - deployDataFeedConsumerMock + deployDataFeedConsumerMock, } = require('./Aggregator.utils.cjs') const { createSigners } = require('../utils.cjs') @@ -25,7 +25,7 @@ async function changeOracles(aggregator, removeOracles, addOracles) { added, minSubmissionCount, maxSubmissionCount, - restartDelay + restartDelay, ) ).wait() } @@ -37,24 +37,24 @@ async function deploy() { account2, account3, account4, - account5 + account5, } = await createSigners() // Aggregator ///////////////////////////////////////////////////////////////// const aggregatorContract = await deployAggregator(deployerSigner) const aggregator = { contract: aggregatorContract, - signer: deployerSigner + signer: deployerSigner, } // AggregatorProxy //////////////////////////////////////////////////////////// const aggregatorProxyContract = await deployAggregatorProxy( aggregator.contract.address, - deployerSigner + deployerSigner, ) const aggregatorProxy = { contract: aggregatorProxyContract, - signer: deployerSigner + signer: deployerSigner, } // Read configuration of Aggregator & AggregatorProxy @@ -65,11 +65,11 @@ async function deploy() { // DataFeedConsumerMock /////////////////////////////////////////////////////// const consumerContract = await deployDataFeedConsumerMock( aggregatorProxy.contract.address, - consumerSigner + consumerSigner, ) const consumer = { contract: consumerContract, - signer: consumerSigner + signer: consumerSigner, } return { @@ -79,7 +79,7 @@ async function deploy() { account2, account3, account4, - account5 + account5, } } @@ -89,7 +89,7 @@ describe('Aggregator', function () { aggregator, account2: oracle0, account3: oracle1, - account4: oracle2 + account4: oracle2, } = await loadFixture(deploy) // Add 2 Oracles //////////////////////////////////////////////////////////// @@ -98,7 +98,7 @@ describe('Aggregator', function () { // Remove Oracle ////////////////////////////////////////////////////////// // Cannot remove oracle that has not been added await expect( - aggregator.contract.changeOracles([oracle2.address], [], 1, 1, 0) + aggregator.contract.changeOracles([oracle2.address], [], 1, 1, 0), ).to.be.revertedWithCustomError(aggregator.contract, 'OracleNotEnabled') // Remove oracle that has been added before @@ -116,7 +116,7 @@ describe('Aggregator', function () { consumer, account2: oracle0, account3: oracle1, - account4: oracle2 + account4: oracle2, } = await loadFixture(deploy) // Change oracles ///////////////////////////////////////////////////////////// @@ -165,7 +165,7 @@ describe('Aggregator', function () { answer: pAnswer, startedAt: pStartedAt, updatedAt: pUpdatedAt, - answeredInRound: pAnsweredInRound + answeredInRound: pAnsweredInRound, } = await aggregatorProxy.contract.connect(consumer.signer).getRoundData(sId) expect(pId).to.be.equal(sId) expect(pAnswer).to.be.equal(sAnswer) @@ -186,7 +186,7 @@ describe('Aggregator', function () { // Cannot add the same oracle twice await expect( - aggregator.contract.changeOracles([], [oracle0.address], 1, 2, 0) + aggregator.contract.changeOracles([], [oracle0.address], 1, 2, 0), ).to.be.revertedWithCustomError(aggregator.contract, 'OracleAlreadyEnabled') }) @@ -197,7 +197,7 @@ describe('Aggregator', function () { consumer, account2: oracle0, account3: oracle1, - account4: invalidOracle + account4: invalidOracle, } = await loadFixture(deploy) // Aggregator ///////////////////////////////////////////////////////////////// @@ -209,7 +209,7 @@ describe('Aggregator', function () { // proposeAggregator //////////////////////////////////////////////////////// // Aggregator can be proposed only by owner await expect( - aggregatorProxy.contract.connect(consumer.signer).proposeAggregator(aggregator.address) + aggregatorProxy.contract.connect(consumer.signer).proposeAggregator(aggregator.address), ).to.be.revertedWith('Ownable: caller is not the owner') // Propose aggregator with contract owner @@ -218,7 +218,7 @@ describe('Aggregator', function () { ).wait() expect(proposeAggregatorTx.events.length).to.be.equal(1) const proposeAggregatorEvent = aggregatorProxy.contract.interface.parseLog( - proposeAggregatorTx.events[0] + proposeAggregatorTx.events[0], ) expect(proposeAggregatorEvent.name).to.be.equal('AggregatorProposed') const { current, proposed } = proposeAggregatorEvent.args @@ -228,7 +228,7 @@ describe('Aggregator', function () { // proposedLatestRoundData ////////////////////////////////////////////////// // If no data has been submitted to proposed yet, reading from proxy reverts await expect( - aggregatorProxy.contract.connect(consumer.signer).proposedLatestRoundData() + aggregatorProxy.contract.connect(consumer.signer).proposedLatestRoundData(), ).to.be.revertedWithCustomError(aggregator, 'NoDataPresent') await aggregator.connect(oracle0).submit(1, 10) await aggregator.connect(oracle1).submit(1, 10) @@ -246,7 +246,7 @@ describe('Aggregator', function () { answer: pAnswer, startedAt: pStartedAt, updatedAt: pUpdatedAt, - answeredInRound: pAnsweredInRound + answeredInRound: pAnsweredInRound, } = await aggregatorProxy.contract.connect(consumer.signer).proposedGetRoundData(id) expect(id).to.be.equal(pId) expect(answer).to.be.equal(pAnswer) @@ -257,12 +257,12 @@ describe('Aggregator', function () { // confirmAggregator //////////////////////////////////////////////////////// // Aggregator can be confirmed only by owner expect( - aggregatorProxy.contract.connect(consumer.signer).confirmAggregator(aggregator.address) + aggregatorProxy.contract.connect(consumer.signer).confirmAggregator(aggregator.address), ).to.be.revertedWith('Ownable: caller is not the owner') // Owner must pass proposed aggregator address, otherwise reverts await expect( - aggregatorProxy.contract.confirmAggregator(invalidOracle.address) + aggregatorProxy.contract.confirmAggregator(invalidOracle.address), ).to.be.revertedWithCustomError(aggregatorProxy.contract, 'InvalidProposedAggregator') // The initial `phaseId` is equal to 1 @@ -326,7 +326,7 @@ describe('Aggregator', function () { const { aggregator, account2: authorizedRequester, - account3: unauthorizedRequester + account3: unauthorizedRequester, } = await loadFixture(deploy) const requesterAddress = authorizedRequester.address @@ -340,7 +340,7 @@ describe('Aggregator', function () { ).wait() const { requester, authorized, delay } = parseSetRequesterPermissionsTx( aggregator.contract, - tx + tx, ) expect(requester).to.be.equal(authorizedRequester.address) expect(authorized).to.be.equal(_authorized) @@ -361,7 +361,7 @@ describe('Aggregator', function () { // Request NewRound ///////////////////////////////////////////////////////// // Only authorized requester can request new round, otherwise reverts await expect( - aggregator.contract.connect(unauthorizedRequester).requestNewRound() + aggregator.contract.connect(unauthorizedRequester).requestNewRound(), ).to.be.revertedWithCustomError(aggregator.contract, 'RequesterNotAuthorized') // Request with authorized requester @@ -387,12 +387,12 @@ describe('Aggregator', function () { await aggregator.contract.setRequesterPermissions( authorizedRequester.address, _authorized, - _delay + _delay, ) ).wait() const { requester, authorized, delay } = parseSetRequesterPermissionsTx( aggregator.contract, - tx + tx, ) expect(requester).to.be.equal(authorizedRequester.address) expect(authorized).to.be.equal(_authorized) @@ -415,7 +415,7 @@ describe('Aggregator', function () { const { address: oracle } = ethers.Wallet.createRandom() await expect( - aggregator.contract.changeOracles([], [oracle], i, i, 0) + aggregator.contract.changeOracles([], [oracle], i, i, 0), ).to.be.revertedWithCustomError(aggregator.contract, 'TooManyOracles') }) @@ -424,7 +424,7 @@ describe('Aggregator', function () { const minSubmissionCount = 1 const maxSubmissionCount = 0 await expect( - aggregator.contract.changeOracles([], [], minSubmissionCount, maxSubmissionCount, 0) + aggregator.contract.changeOracles([], [], minSubmissionCount, maxSubmissionCount, 0), ).to.be.revertedWithCustomError(aggregator.contract, 'MinSubmissionGtMaxSubmission') }) @@ -433,7 +433,7 @@ describe('Aggregator', function () { const minSubmissionCount = 0 const maxSubmissionCount = 1 await expect( - aggregator.contract.changeOracles([], [], minSubmissionCount, maxSubmissionCount, 0) + aggregator.contract.changeOracles([], [], minSubmissionCount, maxSubmissionCount, 0), ).to.be.revertedWithCustomError(aggregator.contract, 'MaxSubmissionGtOracleNum') }) @@ -449,8 +449,8 @@ describe('Aggregator', function () { [oracle], minSubmissionCount, maxSubmissionCount, - restartDelay - ) + restartDelay, + ), ).to.be.revertedWithCustomError(aggregator.contract, 'RestartDelayExceedOracleNum') }) @@ -466,8 +466,8 @@ describe('Aggregator', function () { [oracle], minSubmissionCount, maxSubmissionCount, - restartDelay - ) + restartDelay, + ), ).to.be.revertedWithCustomError(aggregator.contract, 'MinSubmissionZero') }) @@ -478,7 +478,7 @@ describe('Aggregator', function () { account2: requester, account3: oracle0, account4: oracle1, - account5: oracle2 + account5: oracle2, } = await loadFixture(deploy) const authorized = true const delay = 0 @@ -489,7 +489,7 @@ describe('Aggregator', function () { [oracle0.address, oracle1.address, oracle2.address], 2, 3, - 0 + 0, ) // First round @@ -497,7 +497,7 @@ describe('Aggregator', function () { // Only single oracle submitted, but did not compute answer (requires at least two submissions) await expect( - aggregator.contract.connect(requester).requestNewRound() + aggregator.contract.connect(requester).requestNewRound(), ).to.be.revertedWithCustomError(aggregator.contract, 'PrevRoundNotSupersedable') }) @@ -520,7 +520,7 @@ describe('Aggregator', function () { { const roundId = 1 await expect(aggregator.contract.connect(oracle0).submit(roundId, answer)).to.be.revertedWith( - 'not enabled oracle' + 'not enabled oracle', ) } @@ -529,7 +529,7 @@ describe('Aggregator', function () { { const roundId = 2 await expect(aggregator.contract.connect(oracle0).submit(roundId, answer)).to.be.revertedWith( - 'invalid round to report' + 'invalid round to report', ) } @@ -537,7 +537,7 @@ describe('Aggregator', function () { const roundId = 1 await aggregator.contract.connect(oracle0).submit(roundId, answer) await expect(aggregator.contract.connect(oracle0).submit(roundId, answer)).to.be.revertedWith( - 'cannot report on previous rounds' + 'cannot report on previous rounds', ) } @@ -547,7 +547,7 @@ describe('Aggregator', function () { const roundId = 2 await aggregator.contract.connect(oracle0).submit(roundId, answer) await expect( - aggregator.contract.connect(oracle0).submit(roundId + 1, answer) + aggregator.contract.connect(oracle0).submit(roundId + 1, answer), ).to.be.revertedWith('previous round not supersedable') } @@ -559,7 +559,7 @@ describe('Aggregator', function () { const roundId = 3 await aggregator.contract.connect(oracle1).submit(roundId, answer) await expect( - aggregator.contract.connect(oracle1).submit(roundId + 1, answer) + aggregator.contract.connect(oracle1).submit(roundId + 1, answer), ).to.be.revertedWith('no longer allowed oracle') } }) @@ -583,7 +583,7 @@ describe('Aggregator', function () { // round 2 const { _eligibleToSubmit, _roundId } = await aggregator.contract.oracleRoundState( oracle0.address, - 0 + 0, ) expect(_roundId).to.be.equal(2) await aggregator.contract.connect(oracle0).submit(_roundId, 123) @@ -594,7 +594,7 @@ describe('Aggregator', function () { // round 3 const { _eligibleToSubmit, _roundId } = await aggregator.contract.oracleRoundState( oracle0.address, - 0 + 0, ) expect(_roundId).to.be.equal(3) await aggregator.contract.connect(oracle0).submit(_roundId, 123) @@ -605,7 +605,7 @@ describe('Aggregator', function () { // skipping round 2, should submit to round 3 const { _eligibleToSubmit, _roundId } = await aggregator.contract.oracleRoundState( oracle1.address, - 0 + 0, ) expect(_roundId).to.be.equal(3) } diff --git a/contracts/v0.1/test/non-vrf/Aggregator.utils.cjs b/contracts/v0.1/test/non-vrf/Aggregator.utils.cjs index ae26f2544..0b7f56d58 100644 --- a/contracts/v0.1/test/non-vrf/Aggregator.utils.cjs +++ b/contracts/v0.1/test/non-vrf/Aggregator.utils.cjs @@ -11,7 +11,7 @@ async function deployAggregator(signer) { async function deployAggregatorProxy(aggregatorAddress, signer) { let contract = await ethers.getContractFactory('AggregatorProxy', { - signer + signer, }) contract = await contract.deploy(aggregatorAddress) await contract.deployed() @@ -20,7 +20,7 @@ async function deployAggregatorProxy(aggregatorAddress, signer) { async function deployDataFeedConsumerMock(aggregatorProxyAddress, signer) { let contract = await ethers.getContractFactory('DataFeedConsumerMock', { - signer + signer, }) contract = await contract.deploy(aggregatorProxyAddress) await contract.deployed() @@ -40,5 +40,5 @@ module.exports = { deployAggregator, parseSetRequesterPermissionsTx, deployAggregatorProxy, - deployDataFeedConsumerMock + deployDataFeedConsumerMock, } diff --git a/contracts/v0.1/test/non-vrf/L1Endpoint.test.cjs b/contracts/v0.1/test/non-vrf/L1Endpoint.test.cjs index f7b325953..b4d000a13 100644 --- a/contracts/v0.1/test/non-vrf/L1Endpoint.test.cjs +++ b/contracts/v0.1/test/non-vrf/L1Endpoint.test.cjs @@ -10,7 +10,7 @@ const { propose, confirm, createAccount, - addConsumer + addConsumer, } = require('./Registry.utils.cjs') const { deploy: deployCoordinator } = require('./RequestResponseCoordinator.utils.cjs') @@ -20,14 +20,14 @@ async function deploy() { account0: deployerSigner, account2, account3, - account4: protocolFeeRecipient + account4: protocolFeeRecipient, } = await createSigners() // Prepayment const prepaymentContract = await deployPrepayment(protocolFeeRecipient.address, deployerSigner) const prepayment = { contract: prepaymentContract, - signer: deployerSigner + signer: deployerSigner, } // VRFCoordinator @@ -36,7 +36,7 @@ async function deploy() { expect(await coordinatorContract.typeAndVersion()).to.be.equal('VRFCoordinator v0.1') const coordinator = { contract: coordinatorContract, - signer: deployerSigner + signer: deployerSigner, } await addCoordinator(prepayment.contract, prepayment.signer, coordinator.contract.address) @@ -47,7 +47,7 @@ async function deploy() { // registry let registryContract = await ethers.getContractFactory('Registry', { - signer: deployerSigner + signer: deployerSigner, }) registryContract = await registryContract.deploy() await registryContract.deployed() @@ -63,7 +63,7 @@ async function deploy() { pChainID, jsonRpc, L2Endpoint, - fee + fee, ) await confirm(registryContract, deployerSigner, chainID) const { accId: rAccId } = await createAccount(registryContract, deployerSigner, chainID) @@ -71,12 +71,12 @@ async function deploy() { await addConsumer(registryContract, deployerSigner, rAccId, deployerSigner.address) let endpointContract = await ethers.getContractFactory('L1Endpoint', { - signer: deployerSigner + signer: deployerSigner, }) endpointContract = await endpointContract.deploy( registryContract.address, coordinatorContract.address, - rRCoordinatorContract.address + rRCoordinatorContract.address, ) await endpointContract.deployed() await endpointContract.addOracle(deployerSigner.address) @@ -86,12 +86,12 @@ async function deploy() { const endpoint = { contract: endpointContract, - signer: deployerSigner + signer: deployerSigner, } const registry = { contract: registryContract, - signer: deployerSigner + signer: deployerSigner, } return { @@ -102,7 +102,7 @@ async function deploy() { registry, account2, account3, - registrAccount: rAccId + registrAccount: rAccId, } } diff --git a/contracts/v0.1/test/non-vrf/L1EndpointConsumer.test.cjs b/contracts/v0.1/test/non-vrf/L1EndpointConsumer.test.cjs index 51fce3a7f..e57c6d52e 100644 --- a/contracts/v0.1/test/non-vrf/L1EndpointConsumer.test.cjs +++ b/contracts/v0.1/test/non-vrf/L1EndpointConsumer.test.cjs @@ -6,7 +6,7 @@ const { parseKlay, createSigners, median, majorityVotingBool } = require('../uti const { setupOracle, generateVrf, - deploy: deployVrfCoordinator + deploy: deployVrfCoordinator, } = require('../vrf/VRFCoordinator.utils.cjs') const { deploy: deployPrepayment, addCoordinator } = require('./Prepayment.utils.cjs') @@ -15,7 +15,7 @@ const { propose, confirm, createAccount, addConsumer } = require('./Registry.uti const { requestResponseConfig } = require('./RequestResponse.config.cjs') const { deploy: deployCoordinator, - setupOracle: setupRROracle + setupOracle: setupRROracle, } = require('./RequestResponseCoordinator.utils.cjs') const SINGLE_WORD = 1 @@ -25,11 +25,11 @@ async function fulfillRandomWords( notRegisteredOracleSigner, pi, rc, - isDirectPayment + isDirectPayment, ) { // Random word request cannot be fulfilled by an unregistered oracle await expect( - coordinator.connect(notRegisteredOracleSigner).fulfillRandomWords(pi, rc, isDirectPayment) + coordinator.connect(notRegisteredOracleSigner).fulfillRandomWords(pi, rc, isDirectPayment), ).to.be.revertedWithCustomError(coordinator, 'NoSuchProvingKey') // Registered oracle can submit data back to chain @@ -39,7 +39,7 @@ async function fulfillRandomWords( // However even registered oracle cannot fulfill the request more than once await expect( - coordinator.connect(registeredOracleSigner).fulfillRandomWords(pi, rc, isDirectPayment) + coordinator.connect(registeredOracleSigner).fulfillRandomWords(pi, rc, isDirectPayment), ).to.be.revertedWithCustomError(coordinator, 'NoCorrespondingRequest') return tx @@ -53,7 +53,7 @@ function validateRandomWordsRequestedEvent( maxGasLimit, numWords, sender, - isDirectPayment + isDirectPayment, ) { let eventIndex = expect(tx.events.length).to.be.equal(5) eventIndex = 2 @@ -68,7 +68,7 @@ function validateRandomWordsRequestedEvent( callbackGasLimit: eCallbackGasLimit, numWords: eNumWords, sender: eSender, - isDirectPayment: eIsDirectPayment + isDirectPayment: eIsDirectPayment, } = event.args expect(eKeyHash).to.be.equal(keyHash) if (!isDirectPayment) { @@ -118,7 +118,7 @@ async function verifyFulfillment(prepayment, endpoint, txReceipt, accId, respons responseBool, responseString, responseBytes32, - responseBytes + responseBytes, } = endpointEvent.args switch (jobId) { case ethers.utils.keccak256(ethers.utils.toUtf8Bytes('uint128')): @@ -148,7 +148,7 @@ async function requestAndFulfill( fulfillValue, fulfillEventName, dataType, - numSubmission + numSubmission, ) { const { l1Endpoint, @@ -158,7 +158,7 @@ async function requestAndFulfill( registry, registrAccount, account2: rrOracle1, - account3: rrOracle2 + account3: rrOracle2, } = await loadFixture(deploy) const oracles = [rrOracle1, rrOracle2] const { maxGasLimit: callbackGasLimit } = requestResponseConfig() @@ -181,7 +181,7 @@ async function requestAndFulfill( registrAccount, callbackGasLimit, numSubmission, - l2RequestId + l2RequestId, ) ).wait() @@ -200,7 +200,7 @@ async function requestAndFulfill( numSubmission, sender, isDirectPayment, - jobId + jobId, } let fulfillReceipt @@ -223,14 +223,14 @@ async function deploy() { account0: deployerSigner, account2, account3, - account4: protocolFeeRecipient + account4: protocolFeeRecipient, } = await createSigners() // Prepayment const prepaymentContract = await deployPrepayment(protocolFeeRecipient.address, deployerSigner) const prepayment = { contract: prepaymentContract, - signer: deployerSigner + signer: deployerSigner, } // VRFCoordinator @@ -239,7 +239,7 @@ async function deploy() { expect(await coordinatorContract.typeAndVersion()).to.be.equal('VRFCoordinator v0.1') const coordinator = { contract: coordinatorContract, - signer: deployerSigner + signer: deployerSigner, } await addCoordinator(prepayment.contract, prepayment.signer, coordinator.contract.address) @@ -250,7 +250,7 @@ async function deploy() { // registry let registryContract = await ethers.getContractFactory('Registry', { - signer: deployerSigner + signer: deployerSigner, }) registryContract = await registryContract.deploy() await registryContract.deployed() @@ -266,7 +266,7 @@ async function deploy() { pChainID, jsonRpc, L2Endpoint, - fee + fee, ) await confirm(registryContract, deployerSigner, chainID) const { accId: rAccId } = await createAccount(registryContract, deployerSigner, chainID) @@ -274,12 +274,12 @@ async function deploy() { await addConsumer(registryContract, deployerSigner, rAccId, deployerSigner.address) let endpointContract = await ethers.getContractFactory('L1Endpoint', { - signer: deployerSigner + signer: deployerSigner, }) endpointContract = await endpointContract.deploy( registryContract.address, coordinatorContract.address, - rRCoordinatorContract.address + rRCoordinatorContract.address, ) await endpointContract.deployed() await endpointContract.addOracle(deployerSigner.address) @@ -289,24 +289,24 @@ async function deploy() { const l1Endpoint = { contract: endpointContract, - signer: deployerSigner + signer: deployerSigner, } const registry = { contract: registryContract, - signer: deployerSigner + signer: deployerSigner, } // consumer let consumerMock = await ethers.getContractFactory('L1EndpointConsumerMock', { - signer: deployerSigner + signer: deployerSigner, }) consumerMock = await consumerMock.deploy(endpointContract.address) await consumerMock.deployed() const consumer = { contract: consumerMock, - signer: deployerSigner + signer: deployerSigner, } await addConsumer(registryContract, deployerSigner, rAccId, consumerMock.address) @@ -321,7 +321,7 @@ async function deploy() { registry, account2, account3, - registrAccount: rAccId + registrAccount: rAccId, } } @@ -333,7 +333,7 @@ describe('L1Endpoint', function () { registry, account2: oracle, account3: unregisteredOracle, - registrAccount + registrAccount, } = await loadFixture(deploy) const { maxGasLimit: callbackGasLimit, keyHash } = vrfConfig() @@ -357,7 +357,7 @@ describe('L1Endpoint', function () { SINGLE_WORD, registrAccount, l1Endpoint.signer.address, // consumer - l2RequestId + l2RequestId, ) ).wait() expect(txRequestRandomWords.events.length).to.be.equal(5) @@ -374,7 +374,7 @@ describe('L1Endpoint', function () { callbackGasLimit, numWords, sender, - isDirectPayment + isDirectPayment, ) const { pi, rc } = await generateVrf( preSeed, @@ -383,7 +383,7 @@ describe('L1Endpoint', function () { accId, callbackGasLimit, sender, - numWords + numWords, ) const txFulfillRandomWords = await fulfillRandomWords( @@ -392,7 +392,7 @@ describe('L1Endpoint', function () { unregisteredOracle, pi, rc, - isDirectPayment + isDirectPayment, ) const fulfillEvent = l1Endpoint.contract.interface.parseLog(txFulfillRandomWords.events[0]) @@ -413,7 +413,7 @@ describe('L1Endpoint', function () { fulfillValue, fulfillEventName, dataType, - numSubmission + numSubmission, ) }) @@ -430,7 +430,7 @@ describe('L1Endpoint', function () { fulfillValue, fulfillEventName, dataType, - numSubmission + numSubmission, ) }) @@ -447,7 +447,7 @@ describe('L1Endpoint', function () { fulfillValue, fulfillEventName, dataType, - numSubmission + numSubmission, ) }) @@ -464,7 +464,7 @@ describe('L1Endpoint', function () { fulfillValue, fulfillEventName, dataType, - numSubmission + numSubmission, ) }) @@ -481,7 +481,7 @@ describe('L1Endpoint', function () { fulfillValue, fulfillEventName, dataType, - numSubmission + numSubmission, ) }) @@ -498,7 +498,7 @@ describe('L1Endpoint', function () { fulfillValue, fulfillEventName, dataType, - numSubmission + numSubmission, ) }) }) diff --git a/contracts/v0.1/test/non-vrf/L2Endpoint.test.cjs b/contracts/v0.1/test/non-vrf/L2Endpoint.test.cjs index b9f90696a..191087867 100644 --- a/contracts/v0.1/test/non-vrf/L2Endpoint.test.cjs +++ b/contracts/v0.1/test/non-vrf/L2Endpoint.test.cjs @@ -5,7 +5,7 @@ const { aggregatorConfig } = require('./Aggregator.config.cjs') const { deployAggregatorProxy, deployAggregator, - deployDataFeedConsumerMock + deployDataFeedConsumerMock, } = require('./Aggregator.utils.cjs') const { createSigners } = require('../utils.cjs') @@ -24,7 +24,7 @@ async function changeOracles(aggregator, removeOracles, addOracles) { added, minSubmissionCount, maxSubmissionCount, - restartDelay + restartDelay, ) ).wait() } @@ -36,24 +36,24 @@ async function deploy() { account2, account3, account4, - account5 + account5, } = await createSigners() // Aggregator ///////////////////////////////////////////////////////////////// const aggregatorContract = await deployAggregator(deployerSigner) const aggregator = { contract: aggregatorContract, - signer: deployerSigner + signer: deployerSigner, } // AggregatorProxy //////////////////////////////////////////////////////////// const aggregatorProxyContract = await deployAggregatorProxy( aggregator.contract.address, - deployerSigner + deployerSigner, ) const aggregatorProxy = { contract: aggregatorProxyContract, - signer: deployerSigner + signer: deployerSigner, } // Read configuration of Aggregator & AggregatorProxy @@ -64,11 +64,11 @@ async function deploy() { // DataFeedConsumerMock /////////////////////////////////////////////////////// const consumerContract = await deployDataFeedConsumerMock( aggregatorProxy.contract.address, - consumerSigner + consumerSigner, ) const consumer = { contract: consumerContract, - signer: consumerSigner + signer: consumerSigner, } // L2 endpoint @@ -78,7 +78,7 @@ async function deploy() { const endpoint = { contract: l2EndpointContract, - signer: deployerSigner + signer: deployerSigner, } return { @@ -89,7 +89,7 @@ async function deploy() { account2, account3, account4, - account5 + account5, } } @@ -119,12 +119,12 @@ describe('L2Endpoint', function () { const { aggregator, endpoint } = await loadFixture(deploy) await endpoint.contract.addAggregator(aggregator.contract.address) await expect( - endpoint.contract.addAggregator(aggregator.contract.address) + endpoint.contract.addAggregator(aggregator.contract.address), ).to.be.revertedWithCustomError(endpoint.contract, 'InvalidAggregator') await endpoint.contract.addSubmitter(endpoint.signer.address) await expect( - endpoint.contract.addSubmitter(endpoint.signer.address) + endpoint.contract.addSubmitter(endpoint.signer.address), ).to.be.revertedWithCustomError(endpoint.contract, 'InvalidSubmitter') let aggreatorCount = await endpoint.contract.sAggregatorCount() @@ -135,12 +135,12 @@ describe('L2Endpoint', function () { await endpoint.contract.removeAggregator(aggregator.contract.address) await expect( - endpoint.contract.removeAggregator(aggregator.contract.address) + endpoint.contract.removeAggregator(aggregator.contract.address), ).to.be.revertedWithCustomError(endpoint.contract, 'InvalidAggregator') await endpoint.contract.removeSubmitter(endpoint.signer.address) await expect( - endpoint.contract.removeSubmitter(endpoint.signer.address) + endpoint.contract.removeSubmitter(endpoint.signer.address), ).to.be.revertedWithCustomError(endpoint.contract, 'InvalidSubmitter') aggreatorCount = await endpoint.contract.sAggregatorCount() diff --git a/contracts/v0.1/test/non-vrf/L2RequestResponseConsumer.test.cjs b/contracts/v0.1/test/non-vrf/L2RequestResponseConsumer.test.cjs index f9bd2aafc..0d872b645 100644 --- a/contracts/v0.1/test/non-vrf/L2RequestResponseConsumer.test.cjs +++ b/contracts/v0.1/test/non-vrf/L2RequestResponseConsumer.test.cjs @@ -12,7 +12,7 @@ async function deploy() { account2, account3, account4, - account5 + account5, } = await createSigners() // L2 endpoint @@ -22,19 +22,19 @@ async function deploy() { const endpoint = { contract: l2EndpointContract, - signer: deployerSigner + signer: deployerSigner, } // L2 consumer let l2RRConsumerMock = await ethers.getContractFactory('L2RequestResponseConsumerMock', { - signer: deployerSigner + signer: deployerSigner, }) l2RRConsumerMock = await l2RRConsumerMock.deploy(l2EndpointContract.address) await l2RRConsumerMock.deployed() const consumer = { contract: l2RRConsumerMock, - signer: deployerSigner + signer: deployerSigner, } return { @@ -43,7 +43,7 @@ async function deploy() { account2, account3, account4, - account5 + account5, } } @@ -62,7 +62,7 @@ async function requestAndFulfill(requestFn, fulfillFn, dataResponseFn, dataRespo await expect(endpoint.contract[fulfillFn](requestId, dataResponse)).revertedWithCustomError( endpoint.contract, - 'InvalidSubmitter' + 'InvalidSubmitter', ) await (await endpoint.contract.addSubmitter(endpoint.signer.address)).wait() @@ -77,7 +77,7 @@ describe('L2 Request-Response', function () { 'requestDataUint128', 'fulfillDataRequestUint128', 'sResponseUint128', - 1 + 1, ) }) @@ -94,7 +94,7 @@ describe('L2 Request-Response', function () { 'requestDataString', 'fulfillDataRequestString', 'sResponseString', - 'hello' + 'hello', ) }) @@ -103,7 +103,7 @@ describe('L2 Request-Response', function () { 'requestDataBytes32', 'fulfillDataRequestBytes32', 'sResponseBytes32', - ethers.utils.formatBytes32String('hello') + ethers.utils.formatBytes32String('hello'), ) }) @@ -112,7 +112,7 @@ describe('L2 Request-Response', function () { 'requestDataBytes', 'fulfillDataRequestBytes', 'sResponseBytes', - ethers.utils.formatBytes32String('hello') + ethers.utils.formatBytes32String('hello'), ) }) }) diff --git a/contracts/v0.1/test/non-vrf/Median.test.cjs b/contracts/v0.1/test/non-vrf/Median.test.cjs index f2f3b7dd0..2809838fc 100644 --- a/contracts/v0.1/test/non-vrf/Median.test.cjs +++ b/contracts/v0.1/test/non-vrf/Median.test.cjs @@ -99,15 +99,15 @@ describe('Median', function () { '987234873429872359873252343', '982345897325867324175624194', '890129821971482484642397823', - '192978387212138712981287233' + '192978387212138712981287233', ], [ '987234873429872359873252342987234873429872359873252342', '982345897325867324175624194987234873429872359873252343', '890129821971482484642397823982345897325867324175624194', '192978387212138712981278923890129821971482484642397823', - '328923487231897219081298783192978387212138712981287233' - ] + '328923487231897219081298783192978387212138712981287233', + ], ] for (const A of arr) { diff --git a/contracts/v0.1/test/non-vrf/Prepayment.test.cjs b/contracts/v0.1/test/non-vrf/Prepayment.test.cjs index 4f7a1cb83..ca398755b 100644 --- a/contracts/v0.1/test/non-vrf/Prepayment.test.cjs +++ b/contracts/v0.1/test/non-vrf/Prepayment.test.cjs @@ -5,7 +5,7 @@ const { deploy: deployPrepayment, createAccount, deposit, - withdraw + withdraw, } = require('./Prepayment.utils.cjs') const { parseKlay, getBalance, createSigners } = require('../utils.cjs') @@ -21,12 +21,12 @@ async function deploy() { account2: protocolFeeRecipientSigner, account3, account4, - account5 + account5, } = await createSigners() const prepaymentContract = await deployPrepayment( protocolFeeRecipientSigner.address, - deployerSigner + deployerSigner, ) return { @@ -36,7 +36,7 @@ async function deploy() { account3, account4, account5, - prepaymentContract + prepaymentContract, } } @@ -60,7 +60,7 @@ describe('Prepayment', function () { const higherThresholdRatio = 100 await expect( - prepaymentContract.setBurnFeeRatio(higherThresholdRatio) + prepaymentContract.setBurnFeeRatio(higherThresholdRatio), ).to.be.revertedWithCustomError(prepaymentContract, 'TooHighFeeRatio') // 3. Set burnFee ratio with @@ -69,7 +69,7 @@ describe('Prepayment', function () { const ratioAboveThreshold = 101 await expect( - prepaymentContract.setBurnFeeRatio(ratioAboveThreshold) + prepaymentContract.setBurnFeeRatio(ratioAboveThreshold), ).to.be.revertedWithCustomError(prepaymentContract, 'RatioOutOfBounds') }) @@ -87,7 +87,7 @@ describe('Prepayment', function () { const higherThresholdRatio = 100 await expect( - prepaymentContract.setProtocolFeeRatio(higherThresholdRatio) + prepaymentContract.setProtocolFeeRatio(higherThresholdRatio), ).to.be.revertedWithCustomError(prepaymentContract, 'TooHighFeeRatio') // 3. Set burn ratio with @@ -96,7 +96,7 @@ describe('Prepayment', function () { const ratioAboveThreshold = 101 await expect( - prepaymentContract.setProtocolFeeRatio(ratioAboveThreshold) + prepaymentContract.setProtocolFeeRatio(ratioAboveThreshold), ).to.be.revertedWithCustomError(prepaymentContract, 'RatioOutOfBounds') }) @@ -121,7 +121,7 @@ describe('Prepayment', function () { const { prepaymentContract, protocolFeeRecipientSigner, - account4: newProtocolFeeRecipientSigner + account4: newProtocolFeeRecipientSigner, } = await loadFixture(deploy) const recipient = await prepaymentContract.getProtocolFeeRecipient() expect(recipient).to.be.equal(protocolFeeRecipientSigner.address) @@ -130,13 +130,13 @@ describe('Prepayment', function () { await expect( prepaymentContract .connect(newProtocolFeeRecipientSigner) - .setProtocolFeeRecipient(newProtocolFeeRecipientSigner.address) + .setProtocolFeeRecipient(newProtocolFeeRecipientSigner.address), ).to.be.rejected // update protocol fee recipient await prepaymentContract.setProtocolFeeRecipient(newProtocolFeeRecipientSigner.address) expect(await prepaymentContract.getProtocolFeeRecipient()).to.be.equal( - newProtocolFeeRecipientSigner.address + newProtocolFeeRecipientSigner.address, ) }) @@ -151,7 +151,7 @@ describe('Prepayment', function () { const { prepaymentContract, consumerSigner: accountOwner, - account3: nonOwner + account3: nonOwner, } = await loadFixture(deploy) const { accId, account } = await createAccount(prepaymentContract, accountOwner) @@ -167,7 +167,7 @@ describe('Prepayment', function () { prepaymentContract, accountOwner, accId, - amount + amount, ) // Read balance directly from Account contract @@ -182,7 +182,7 @@ describe('Prepayment', function () { // 2. Withdraw $KLAY //////////////////////////////////////////////////////// // Only account owner can withdraw await expect( - prepaymentContract.connect(nonOwner).withdraw(accId, amount) + prepaymentContract.connect(nonOwner).withdraw(accId, amount), ).to.be.revertedWithCustomError(prepaymentContract, 'MustBeAccountOwner') // Withdrawing using the account owner @@ -190,7 +190,7 @@ describe('Prepayment', function () { prepaymentContract, accountOwner, accId, - amount + amount, ) expect(balanceAfterDeposit).to.be.equal(oldBalanceWithdraw) expect(balanceBeforeDeposit).to.be.equal(newBalanceWithdraw) @@ -207,7 +207,7 @@ describe('Prepayment', function () { const accId = 123 const amount = parseKlay(10) await expect( - deposit(prepaymentContract, accountOwner, accId, amount) + deposit(prepaymentContract, accountOwner, accId, amount), ).to.be.revertedWithCustomError(prepaymentContract, 'InvalidAccount') }) @@ -218,8 +218,8 @@ describe('Prepayment', function () { /* const amount = parseKlay(10_001) */ await expect( prepaymentContract.connect(accountOwner).deposit(accId, { - value: amount - }) + value: amount, + }), ).to.be.rejected }) @@ -229,7 +229,7 @@ describe('Prepayment', function () { consumerSigner: accountOwner, account3: consumer, account4: nonOwner, - account5: unusedConsumer + account5: unusedConsumer, } = await loadFixture(deploy) const { accId, account } = await createAccount(prepaymentContract, accountOwner) @@ -240,7 +240,7 @@ describe('Prepayment', function () { // 1. Add consumer ////////////////////////////////////////////////////////// // Consumer can be added only by the account owner await expect( - prepaymentContract.connect(nonOwner).addConsumer(accId, consumer.address) + prepaymentContract.connect(nonOwner).addConsumer(accId, consumer.address), ).to.be.revertedWithCustomError(prepaymentContract, 'MustBeAccountOwner') // Add consumer with correct signer and parameters @@ -250,7 +250,7 @@ describe('Prepayment', function () { expect(txReceiptAddConsumer.events.length).to.be.equal(1) const accountConsumerAddedEvent = prepaymentContract.interface.parseLog( - txReceiptAddConsumer.events[0] + txReceiptAddConsumer.events[0], ) expect(accountConsumerAddedEvent.name).to.be.equal('AccountConsumerAdded') const { accId: consumerAddedAccId, consumer: consumerAddedConsumer } = @@ -271,12 +271,12 @@ describe('Prepayment', function () { // 2. Remove consumer /////////////////////////////////////////////////////// // We cannot remove consumer which is not there await expect( - prepaymentContract.connect(accountOwner).removeConsumer(accId, unusedConsumer.address) + prepaymentContract.connect(accountOwner).removeConsumer(accId, unusedConsumer.address), ).to.be.revertedWithCustomError(accountContract, 'InvalidConsumer') // Consumer can be removed only by the account owner await expect( - prepaymentContract.connect(nonOwner).removeConsumer(accId, consumer.address) + prepaymentContract.connect(nonOwner).removeConsumer(accId, consumer.address), ).to.be.revertedWithCustomError(prepaymentContract, 'MustBeAccountOwner') // Remove consumer with correct signer and paramters @@ -286,7 +286,7 @@ describe('Prepayment', function () { expect(txReceiptRemoveConsumer.events.length).to.be.equal(1) const accountConsumerRemovedEvent = prepaymentContract.interface.parseLog( - txReceiptRemoveConsumer.events[0] + txReceiptRemoveConsumer.events[0], ) expect(accountConsumerRemovedEvent.name).to.be.equal('AccountConsumerRemoved') const { accId: consumerRemovedAccId, consumer: consumerRemovedConsumer } = @@ -320,14 +320,14 @@ describe('Prepayment', function () { // The same coordinator cannot be added more than once await expect( - prepaymentContract.addCoordinator(coordinator.address) + prepaymentContract.addCoordinator(coordinator.address), ).to.be.revertedWithCustomError(prepaymentContract, 'CoordinatorExists') // Remove coordinator /////////////////////////////////////////////////////// // Non-existing coordinator cannot be removed await expect(prepaymentContract.removeCoordinator(NULL_ADDRESS)).to.be.revertedWithCustomError( prepaymentContract, - 'InvalidCoordinator' + 'InvalidCoordinator', ) // We can remove coordinator that has been previously added @@ -339,7 +339,7 @@ describe('Prepayment', function () { // Check the event information expect(txRemoveCoordinator.events.length).to.be.equal(1) const removeCoordinatorEvent = prepaymentContract.interface.parseLog( - txRemoveCoordinator.events[0] + txRemoveCoordinator.events[0], ) expect(removeCoordinatorEvent.name).to.be.equal('CoordinatorRemoved') const { coordinator: removeCoordinatorAddress } = removeCoordinatorEvent.args @@ -350,7 +350,7 @@ describe('Prepayment', function () { const { consumerSigner: fromConsumer, account3: toConsumer, - prepaymentContract + prepaymentContract, } = await loadFixture(deploy) const { accId, account } = await createAccount(prepaymentContract, fromConsumer) @@ -365,7 +365,7 @@ describe('Prepayment', function () { expect(requestTxReceipt.events.length).to.be.equal(1) const accountTransferRequestedEvent = prepaymentContract.interface.parseLog( - requestTxReceipt.events[0] + requestTxReceipt.events[0], ) expect(accountTransferRequestedEvent.name).to.be.equal('AccountOwnerTransferRequested') const { from: fromRequested, to: toRequested } = accountTransferRequestedEvent.args @@ -377,7 +377,7 @@ describe('Prepayment', function () { // 2.1 Cannot accept with wrong consumer await expect( - prepaymentContract.connect(fromConsumer).acceptAccountOwnerTransfer(accId) + prepaymentContract.connect(fromConsumer).acceptAccountOwnerTransfer(accId), ).to.be.revertedWithCustomError(accountContract, 'MustBeRequestedOwner') // 2. Accept Account Transfer @@ -401,7 +401,7 @@ describe('Prepayment', function () { const prepaymentContract = await deployPrepayment( protocolFeeRecipientSigner.address, - deployerSigner + deployerSigner, ) const { accId } = await createAccount(prepaymentContract, consumerSigner) @@ -411,7 +411,7 @@ describe('Prepayment', function () { const aboveBalance = initialAmount + parseKlay(1) const accountContract = await ethers.getContractFactory('Account') await expect( - prepaymentContract.connect(consumerSigner).withdraw(accId, aboveBalance) + prepaymentContract.connect(consumerSigner).withdraw(accId, aboveBalance), ).to.be.revertedWithCustomError(accountContract, 'InsufficientBalance') }) @@ -420,7 +420,7 @@ describe('Prepayment', function () { const prepaymentContract = await deployPrepayment( protocolFeeRecipientSigner.address, - deployerSigner + deployerSigner, ) const { accId, account } = await createAccount(prepaymentContract, consumerSigner) @@ -435,7 +435,7 @@ describe('Prepayment', function () { // There is a limit (MAX_CONSUMERS) on number of consumers that can be added const { address: consumer } = ethers.Wallet.createRandom() await expect( - prepaymentContract.connect(consumerSigner).addConsumer(accId, consumer) + prepaymentContract.connect(consumerSigner).addConsumer(accId, consumer), ).to.be.revertedWithCustomError(accountContract, 'TooManyConsumers') }) @@ -443,29 +443,29 @@ describe('Prepayment', function () { const { prepaymentContract, consumerSigner } = await loadFixture(deploy) await expect(prepaymentContract.connect(consumerSigner).setBurnFeeRatio(5)).to.be.revertedWith( - 'Ownable: caller is not the owner' + 'Ownable: caller is not the owner', ) await expect( - prepaymentContract.connect(consumerSigner).setProtocolFeeRatio(5) + prepaymentContract.connect(consumerSigner).setProtocolFeeRatio(5), ).to.be.revertedWith('Ownable: caller is not the owner') await expect( - prepaymentContract.connect(consumerSigner).setProtocolFeeRecipient(consumerSigner.address) + prepaymentContract.connect(consumerSigner).setProtocolFeeRecipient(consumerSigner.address), ).to.be.revertedWith('Ownable: caller is not the owner') await expect( - prepaymentContract.connect(consumerSigner).addCoordinator(consumerSigner.address) + prepaymentContract.connect(consumerSigner).addCoordinator(consumerSigner.address), ).to.be.revertedWith('Ownable: caller is not the owner') await expect( - prepaymentContract.connect(consumerSigner).removeCoordinator(consumerSigner.address) + prepaymentContract.connect(consumerSigner).removeCoordinator(consumerSigner.address), ).to.be.revertedWith('Ownable: caller is not the owner') const { accId } = await createAccount(prepaymentContract, consumerSigner) //set fee ratio for account await expect( - prepaymentContract.connect(consumerSigner).setFeeRatio(accId, 50) + prepaymentContract.connect(consumerSigner).setFeeRatio(accId, 50), ).to.be.revertedWith('Ownable: caller is not the owner') //update account detail @@ -478,14 +478,14 @@ describe('Prepayment', function () { await expect( prepaymentContract .connect(consumerSigner) - .updateAccountDetail(accId, startTime, period, requestNumber, subscriptionPrice) + .updateAccountDetail(accId, startTime, period, requestNumber, subscriptionPrice), ).to.be.revertedWith('Ownable: caller is not the owner') // create fiat, klay subscription and discount account await expect( prepaymentContract .connect(consumerSigner) - .createFiatSubscriptionAccount(startTime, period, requestNumber, consumerSigner.address) + .createFiatSubscriptionAccount(startTime, period, requestNumber, consumerSigner.address), ).to.be.revertedWith('Ownable: caller is not the owner') await expect( @@ -496,14 +496,14 @@ describe('Prepayment', function () { period, requestNumber, subscriptionPrice, - consumerSigner.address - ) + consumerSigner.address, + ), ).to.be.revertedWith('Ownable: caller is not the owner') await expect( prepaymentContract .connect(consumerSigner) - .createKlayDiscountAccount(feeRatio, consumerSigner.address) + .createKlayDiscountAccount(feeRatio, consumerSigner.address), ).to.be.revertedWith('Ownable: caller is not the owner') }) @@ -511,27 +511,29 @@ describe('Prepayment', function () { const { prepaymentContract, consumerSigner } = await loadFixture(deploy) await expect( - prepaymentContract.connect(consumerSigner).chargeFee(1, 1_000) + prepaymentContract.connect(consumerSigner).chargeFee(1, 1_000), ).to.be.revertedWithCustomError(prepaymentContract, 'InvalidCoordinator') await expect( - prepaymentContract.connect(consumerSigner).chargeFeeTemporary(1) + prepaymentContract.connect(consumerSigner).chargeFeeTemporary(1), ).to.be.revertedWithCustomError(prepaymentContract, 'InvalidCoordinator') await expect( - prepaymentContract.connect(consumerSigner).chargeOperatorFee(1, 1_000, consumerSigner.address) + prepaymentContract + .connect(consumerSigner) + .chargeOperatorFee(1, 1_000, consumerSigner.address), ).to.be.revertedWithCustomError(prepaymentContract, 'InvalidCoordinator') await expect( - prepaymentContract.connect(consumerSigner).increaseNonce(1, consumerSigner.address) + prepaymentContract.connect(consumerSigner).increaseNonce(1, consumerSigner.address), ).to.be.revertedWithCustomError(prepaymentContract, 'InvalidCoordinator') await expect( - prepaymentContract.connect(consumerSigner).increaseSubReqCount(1) + prepaymentContract.connect(consumerSigner).increaseSubReqCount(1), ).to.be.revertedWithCustomError(prepaymentContract, 'InvalidCoordinator') await expect( - prepaymentContract.connect(consumerSigner).setSubscriptionPaid(1) + prepaymentContract.connect(consumerSigner).setSubscriptionPaid(1), ).to.be.revertedWithCustomError(prepaymentContract, 'InvalidCoordinator') }) }) diff --git a/contracts/v0.1/test/non-vrf/Prepayment.utils.cjs b/contracts/v0.1/test/non-vrf/Prepayment.utils.cjs index 930a611ba..b388c5153 100644 --- a/contracts/v0.1/test/non-vrf/Prepayment.utils.cjs +++ b/contracts/v0.1/test/non-vrf/Prepayment.utils.cjs @@ -2,7 +2,7 @@ const { expect } = require('chai') const { AccountType } = require('./Account.utils.cjs') async function deploy(protocolFeeRecipientAddress, signer) { let contract = await ethers.getContractFactory('Prepayment', { - signer + signer, }) contract = await contract.deploy(protocolFeeRecipientAddress) await contract.deployed() @@ -27,7 +27,7 @@ async function createFiatSubscriptionAccount( period, reqPeriodCount, signer, - accountOwner + accountOwner, ) { const tx = await ( await prepayment @@ -49,7 +49,7 @@ async function createKlaySubscriptionAccount( reqPeriodCount, subscriptionPrice, signer, - accountOwner + accountOwner, ) { const tx = await ( await prepayment @@ -59,7 +59,7 @@ async function createKlaySubscriptionAccount( period, reqPeriodCount, subscriptionPrice, - accountOwner.address + accountOwner.address, ) ).wait() expect(tx.events.length).to.be.equal(1) @@ -88,7 +88,7 @@ async function addConsumer(prepayment, signer, accId, consumerAddress) { async function deposit(prepayment, signer, accId, value) { const tx = await ( await prepayment.connect(signer).deposit(accId, { - value + value, }) ).wait() expect(tx.events.length).to.be.equal(1) @@ -141,5 +141,5 @@ module.exports = { createFiatSubscriptionAccount, createKlaySubscriptionAccount, createKlayDiscountAccount, - getAccount + getAccount, } diff --git a/contracts/v0.1/test/non-vrf/Registry.test.cjs b/contracts/v0.1/test/non-vrf/Registry.test.cjs index 9a6170e97..7a673db2e 100644 --- a/contracts/v0.1/test/non-vrf/Registry.test.cjs +++ b/contracts/v0.1/test/non-vrf/Registry.test.cjs @@ -12,7 +12,7 @@ const { removeAggregator, createAccount, addConsumer, - removeConsumer + removeConsumer, } = require('./Registry.utils.cjs') const { parseKlay, getBalance, createSigners } = require('../utils.cjs') const { exp } = require('mathjs') @@ -24,7 +24,7 @@ async function deploy() { account2, account3, account4, - account5 + account5, } = await createSigners() const registryContract = await deployRegistry(deployerSigner) @@ -36,7 +36,7 @@ async function deploy() { account3, account4, account5, - registryContract + registryContract, } } describe('Registry', function () { @@ -49,7 +49,7 @@ describe('Registry', function () { it('propose & confirm', async function () { const { registryContract, deployerSigner, account1, account2, account3 } = await loadFixture( - deploy + deploy, ) const fee = parseKlay(1) const pChainID = '100001' @@ -61,7 +61,7 @@ describe('Registry', function () { pChainID, jsonRpc, endpoint, - fee + fee, ) expect(chainID).to.be.equal(pChainID) @@ -71,7 +71,7 @@ describe('Registry', function () { it('edit chain infor', async function () { const { registryContract, deployerSigner, account1, account2, account3 } = await loadFixture( - deploy + deploy, ) const fee = parseKlay(1) const pChainID = '100001' @@ -83,7 +83,7 @@ describe('Registry', function () { pChainID, jsonRpc, endpoint, - fee + fee, ) await confirm(registryContract, deployerSigner, chainID) jsonRpc = '345' @@ -94,14 +94,14 @@ describe('Registry', function () { chainID, jsonRpc, endpoint, - fee + fee, ) expect(chainInfor.rpc).to.be.equal(jsonRpc) }) it('add & remove aggregator', async function () { const { registryContract, deployerSigner, account1, account2, account3 } = await loadFixture( - deploy + deploy, ) const fee = parseKlay(1) const pChainID = '100001' @@ -116,7 +116,7 @@ describe('Registry', function () { pChainID, jsonRpc, endpoint, - fee + fee, ) await confirm(registryContract, deployerSigner, chainID) const { aggregatorID } = await addAggregator( @@ -124,7 +124,7 @@ describe('Registry', function () { deployerSigner, chainID, l1Aggregator, - l2Aggregator + l2Aggregator, ) await removeAggregator(registryContract, deployerSigner, chainID, aggregatorID) }) @@ -141,7 +141,7 @@ describe('Registry', function () { pChainID, jsonRpc, endpoint, - fee + fee, ) await confirm(registryContract, deployerSigner, chainID) const { accId, owner } = await createAccount(registryContract, deployerSigner, chainID) @@ -155,7 +155,7 @@ describe('Registry', function () { it('withdraw', async function () { const { registryContract, deployerSigner, account1, account2, account3 } = await loadFixture( - deploy + deploy, ) const fee = parseKlay(1) const pChainID = '100001' @@ -167,7 +167,7 @@ describe('Registry', function () { pChainID, jsonRpc, endpoint, - fee + fee, ) const beforeWithdraw = await getBalance(registryContract.address) await withdraw(registryContract, deployerSigner, fee) diff --git a/contracts/v0.1/test/non-vrf/Registry.utils.cjs b/contracts/v0.1/test/non-vrf/Registry.utils.cjs index c464e5351..c02343ceb 100644 --- a/contracts/v0.1/test/non-vrf/Registry.utils.cjs +++ b/contracts/v0.1/test/non-vrf/Registry.utils.cjs @@ -2,7 +2,7 @@ const { expect } = require('chai') async function deploy(signer) { let contract = await ethers.getContractFactory('Registry', { - signer + signer, }) contract = await contract.deploy() await contract.deployed() @@ -12,7 +12,7 @@ async function deploy(signer) { async function propose(registry, signer, pChainID, jsonRpc, endpoint, value) { const tx = await ( await registry.connect(signer).proposeNewChain(pChainID, jsonRpc, endpoint, { - value + value, }) ).wait() expect(tx.events.length).to.be.equal(1) @@ -25,7 +25,7 @@ async function propose(registry, signer, pChainID, jsonRpc, endpoint, value) { async function editChainInfor(registry, signer, pChainID, jsonRpc, pEndpoint, value) { const tx = await ( await registry.connect(signer).editChainInfo(pChainID, jsonRpc, pEndpoint, { - value + value, }) ).wait() expect(tx.events.length).to.be.equal(1) @@ -111,5 +111,5 @@ module.exports = { addAggregator, removeAggregator, addConsumer, - removeConsumer + removeConsumer, } diff --git a/contracts/v0.1/test/non-vrf/RequestResponse.config.cjs b/contracts/v0.1/test/non-vrf/RequestResponse.config.cjs index f75e80a71..91656eda1 100644 --- a/contracts/v0.1/test/non-vrf/RequestResponse.config.cjs +++ b/contracts/v0.1/test/non-vrf/RequestResponse.config.cjs @@ -10,16 +10,16 @@ function requestResponseConfig() { reqsForTier2: 0, reqsForTier3: 0, reqsForTier4: 0, - reqsForTier5: 0 + reqsForTier5: 0, } return { maxGasLimit, gasAfterPaymentCalculation, - feeConfig + feeConfig, } } module.exports = { - requestResponseConfig + requestResponseConfig, } diff --git a/contracts/v0.1/test/non-vrf/RequestResponseConsumerContract.test.cjs b/contracts/v0.1/test/non-vrf/RequestResponseConsumerContract.test.cjs index bf0f1619c..21b91ae4e 100644 --- a/contracts/v0.1/test/non-vrf/RequestResponseConsumerContract.test.cjs +++ b/contracts/v0.1/test/non-vrf/RequestResponseConsumerContract.test.cjs @@ -6,7 +6,7 @@ const { deploy: deployCoordinator, parseDataRequestedTx, DATA_REQUEST_EVENT_ARGS, - parseDataRequestFulfilledTx + parseDataRequestFulfilledTx, } = require('./RequestResponseCoordinator.utils.cjs') const { parseKlay } = require('../utils.cjs') const { median, majorityVotingBool, createSigners } = require('../utils.cjs') @@ -18,7 +18,7 @@ const { addCoordinator, createFiatSubscriptionAccount, createKlaySubscriptionAccount, - createKlayDiscountAccount + createKlayDiscountAccount, } = require('./Prepayment.utils.cjs') const { AccountType } = require('./Account.utils.cjs') @@ -40,7 +40,7 @@ async function deploy() { account5: rrOracle3, account6: rrOracle4, account7: rrOracle5, - account8: protocolFeeRecipient + account8: protocolFeeRecipient, } = await createSigners() const { maxGasLimit, gasAfterPaymentCalculation, feeConfig } = requestResponseConfig() @@ -55,7 +55,7 @@ async function deploy() { // RequestResponseConsumerMock let consumerContract = await ethers.getContractFactory('RequestResponseConsumerMock', { - signer: consumerSigner + signer: consumerSigner, }) consumerContract = await consumerContract.deploy(coordinatorContract.address) await consumerContract.deployed() @@ -72,7 +72,7 @@ async function deploy() { prepayment, coordinator, - consumer + consumer, } } @@ -121,7 +121,7 @@ async function verifyFulfillment( requestId, responseValue, responseFn, - fulfillEventName + fulfillEventName, ) { // AccountBalanceDecreased //////////////////////////////////////////////////// const prepaymentEvent = prepayment.contract.interface.parseLog(txReceipt.events[0]) @@ -132,7 +132,7 @@ async function verifyFulfillment( const { requestId: eventRequestId } = parseDataRequestFulfilledTx( coordinator.contract, txReceipt, - fulfillEventName + fulfillEventName, ) expect(await responseFn()).to.be.equal(responseValue) } @@ -145,7 +145,7 @@ async function verifyFulfillmentSubscriptionAccount( requestId, responseValue, responseFn, - fulfillEventName + fulfillEventName, ) { // AccountPeriodReqIncreased //////////////////////////////////////////////////// const prepaymentEvent = prepayment.contract.interface.parseLog(txReceipt.events[0]) @@ -156,7 +156,7 @@ async function verifyFulfillmentSubscriptionAccount( const { requestId: eventRequestId } = parseDataRequestFulfilledTx( coordinator.contract, txReceipt, - fulfillEventName + fulfillEventName, ) expect(await responseFn()).to.be.equal(responseValue) } @@ -171,7 +171,7 @@ async function requestAndFulfill( isDirectPayment, numSubmission, dataType, - accType = AccountType.KLAY_REGULAR + accType = AccountType.KLAY_REGULAR, ) { const { prepayment, coordinator, consumer } = await loadFixture(deploy) const { maxGasLimit: callbackGasLimit } = requestResponseConfig() @@ -184,7 +184,7 @@ async function requestAndFulfill( requestReceipt = await ( await requestFn(callbackGasLimit, numSubmission, consumer.signer.address, { gasLimit, - value: parseKlay(1) + value: parseKlay(1), }) ).wait() } else { @@ -200,7 +200,7 @@ async function requestAndFulfill( period, requestNumber, prepayment.signer, - consumer.signer + consumer.signer, ) accId = accountId } else if (accType == AccountType.KLAY_SUBSCRIPTION) { @@ -211,7 +211,7 @@ async function requestAndFulfill( requestNumber, subscriptionPrice, prepayment.signer, - consumer.signer + consumer.signer, ) accId = accountId } else if (accType == AccountType.KLAY_DISCOUNT) { @@ -220,7 +220,7 @@ async function requestAndFulfill( prepayment.contract, feeRatio, prepayment.signer, - consumer.signer + consumer.signer, ) accId = accountId } else { @@ -232,7 +232,7 @@ async function requestAndFulfill( await deposit(prepayment.contract, consumer.signer, accId, parseKlay(1)) requestReceipt = await ( await requestFn(accId, callbackGasLimit, numSubmission, { - gasLimit + gasLimit, }) ).wait() } @@ -245,7 +245,7 @@ async function requestAndFulfill( const { requestId, accId, jobId } = verifyRequestDirectPayment( prepayment.contract, coordinator.contract, - requestReceipt + requestReceipt, ) _requestId = requestId _accId = accId @@ -265,7 +265,7 @@ async function requestAndFulfill( numSubmission, sender: consumer.contract.address, isDirectPayment, - jobId: _jobId + jobId: _jobId, } let fulfillReceipt @@ -289,7 +289,7 @@ async function requestAndFulfill( _requestId, responseValue, getFulfillValueFn, - fulfillEventName + fulfillEventName, ) } else { await verifyFulfillment( @@ -300,7 +300,7 @@ async function requestAndFulfill( _requestId, responseValue, getFulfillValueFn, - fulfillEventName + fulfillEventName, ) } } @@ -314,8 +314,8 @@ describe('Request-Response user contract', function () { const numSubmission = 1 await expect( consumer.contract.requestDataUint128(accId, callbackGasLimit, numSubmission, { - gasLimit: 500_000 - }) + gasLimit: 500_000, + }), ).to.be.revertedWithCustomError(coordinator.contract, 'InsufficientPayment') }) @@ -331,7 +331,7 @@ describe('Request-Response user contract', function () { 'DataRequestFulfilledUint128', false, numSubmission, - 'Uint128' + 'Uint128', ) //fiat subscription account await requestAndFulfill( @@ -344,7 +344,7 @@ describe('Request-Response user contract', function () { false, numSubmission, 'Uint128', - AccountType.FIAT_SUBSCRIPTION + AccountType.FIAT_SUBSCRIPTION, ) //klay subscription account await requestAndFulfill( @@ -357,7 +357,7 @@ describe('Request-Response user contract', function () { false, numSubmission, 'Uint128', - AccountType.KLAY_SUBSCRIPTION + AccountType.KLAY_SUBSCRIPTION, ) //klay discount account await requestAndFulfill( @@ -370,7 +370,7 @@ describe('Request-Response user contract', function () { false, numSubmission, 'Uint128', - AccountType.KLAY_DISCOUNT + AccountType.KLAY_DISCOUNT, ) }) @@ -387,13 +387,13 @@ describe('Request-Response user contract', function () { 'DataRequestFulfilledUint128', true, numSubmission, - 'Uint128' + 'Uint128', ) }) it('Request & Fulfill Int256', async function () { const { consumer, rrOracle0, rrOracle1, rrOracle2, rrOracle3, rrOracle4 } = await loadFixture( - deploy + deploy, ) const numSubmission = 2 @@ -406,7 +406,7 @@ describe('Request-Response user contract', function () { 'DataRequestFulfilledInt256', false, numSubmission, - 'Int256' + 'Int256', ) //fiat subscription account await requestAndFulfill( @@ -419,7 +419,7 @@ describe('Request-Response user contract', function () { false, numSubmission, 'Uint128', - AccountType.FIAT_SUBSCRIPTION + AccountType.FIAT_SUBSCRIPTION, ) //klay subscription account await requestAndFulfill( @@ -432,7 +432,7 @@ describe('Request-Response user contract', function () { false, numSubmission, 'Uint128', - AccountType.KLAY_SUBSCRIPTION + AccountType.KLAY_SUBSCRIPTION, ) //klay discount account await requestAndFulfill( @@ -445,13 +445,13 @@ describe('Request-Response user contract', function () { false, numSubmission, 'Uint128', - AccountType.KLAY_DISCOUNT + AccountType.KLAY_DISCOUNT, ) }) it('Request & Fulfill Int256 Direct Payment', async function () { const { consumer, rrOracle0, rrOracle1, rrOracle2, rrOracle3, rrOracle4 } = await loadFixture( - deploy + deploy, ) const numSubmission = 2 @@ -464,7 +464,7 @@ describe('Request-Response user contract', function () { 'DataRequestFulfilledInt256', true, numSubmission, - 'Int256' + 'Int256', ) }) @@ -482,7 +482,7 @@ describe('Request-Response user contract', function () { 'DataRequestFulfilledBool', false, numSubmission, - 'Bool' + 'Bool', ) //fiat subscription account @@ -496,7 +496,7 @@ describe('Request-Response user contract', function () { false, numSubmission, 'Bool', - AccountType.FIAT_SUBSCRIPTION + AccountType.FIAT_SUBSCRIPTION, ) //klay subscription account await requestAndFulfill( @@ -509,7 +509,7 @@ describe('Request-Response user contract', function () { false, numSubmission, 'Bool', - AccountType.KLAY_SUBSCRIPTION + AccountType.KLAY_SUBSCRIPTION, ) //klay discount account await requestAndFulfill( @@ -522,7 +522,7 @@ describe('Request-Response user contract', function () { false, numSubmission, 'Bool', - AccountType.KLAY_DISCOUNT + AccountType.KLAY_DISCOUNT, ) }) @@ -540,7 +540,7 @@ describe('Request-Response user contract', function () { 'DataRequestFulfilledBool', true, numSubmission, - 'Bool' + 'Bool', ) }) @@ -557,7 +557,7 @@ describe('Request-Response user contract', function () { 'DataRequestFulfilledString', false, numSubmission, - 'String' + 'String', ) //fiat subscription account @@ -571,7 +571,7 @@ describe('Request-Response user contract', function () { false, numSubmission, 'String', - AccountType.FIAT_SUBSCRIPTION + AccountType.FIAT_SUBSCRIPTION, ) //klay subscription account await requestAndFulfill( @@ -584,7 +584,7 @@ describe('Request-Response user contract', function () { false, numSubmission, 'String', - AccountType.KLAY_SUBSCRIPTION + AccountType.KLAY_SUBSCRIPTION, ) //klay discount account await requestAndFulfill( @@ -597,7 +597,7 @@ describe('Request-Response user contract', function () { false, numSubmission, 'String', - AccountType.KLAY_DISCOUNT + AccountType.KLAY_DISCOUNT, ) }) @@ -614,7 +614,7 @@ describe('Request-Response user contract', function () { 'DataRequestFulfilledString', true, numSubmission, - 'String' + 'String', ) }) @@ -631,7 +631,7 @@ describe('Request-Response user contract', function () { 'DataRequestFulfilledBytes32', false, numSubmission, - 'Bytes32' + 'Bytes32', ) //fiat subscription account @@ -645,7 +645,7 @@ describe('Request-Response user contract', function () { false, numSubmission, 'Bytes32', - AccountType.FIAT_SUBSCRIPTION + AccountType.FIAT_SUBSCRIPTION, ) //klay subscription account await requestAndFulfill( @@ -658,7 +658,7 @@ describe('Request-Response user contract', function () { false, numSubmission, 'Bytes32', - AccountType.KLAY_SUBSCRIPTION + AccountType.KLAY_SUBSCRIPTION, ) //klay discount account await requestAndFulfill( @@ -671,7 +671,7 @@ describe('Request-Response user contract', function () { false, numSubmission, 'Bytes32', - AccountType.KLAY_DISCOUNT + AccountType.KLAY_DISCOUNT, ) }) @@ -688,7 +688,7 @@ describe('Request-Response user contract', function () { 'DataRequestFulfilledBytes32', true, numSubmission, - 'Bytes32' + 'Bytes32', ) }) @@ -705,7 +705,7 @@ describe('Request-Response user contract', function () { 'DataRequestFulfilledBytes', false, numSubmission, - 'Bytes' + 'Bytes', ) //fiat subscription account @@ -719,7 +719,7 @@ describe('Request-Response user contract', function () { false, numSubmission, 'Bytes', - AccountType.FIAT_SUBSCRIPTION + AccountType.FIAT_SUBSCRIPTION, ) //klay subscription account await requestAndFulfill( @@ -732,7 +732,7 @@ describe('Request-Response user contract', function () { false, numSubmission, 'Bytes', - AccountType.KLAY_SUBSCRIPTION + AccountType.KLAY_SUBSCRIPTION, ) //klay discount account await requestAndFulfill( @@ -745,7 +745,7 @@ describe('Request-Response user contract', function () { false, numSubmission, 'Bytes', - AccountType.KLAY_DISCOUNT + AccountType.KLAY_DISCOUNT, ) }) @@ -761,7 +761,7 @@ describe('Request-Response user contract', function () { 'DataRequestFulfilledBytes', true, numSubmission, - 'Bytes' + 'Bytes', ) }) @@ -788,7 +788,7 @@ describe('Request-Response user contract', function () { const txCancelRequest = await (await consumer.contract.cancelRequest(requestId)).wait() const dataRequestCancelledEvent = coordinator.contract.interface.parseLog( - txCancelRequest.events[0] + txCancelRequest.events[0], ) expect(dataRequestCancelledEvent.name).to.be.equal('RequestCanceled') @@ -847,7 +847,7 @@ describe('Request-Response user contract', function () { const { requestId, sender, blockNumber, isDirectPayment, jobId } = parseDataRequestedTx( coordinator.contract, - requestDataTx + requestDataTx, ) // The `reqCount` after the request does not change. It gets @@ -862,7 +862,7 @@ describe('Request-Response user contract', function () { numSubmission, sender, isDirectPayment, - jobId + jobId, } await coordinator.contract @@ -886,7 +886,7 @@ describe('Request-Response user contract', function () { const { address: oracle } = ethers.Wallet.createRandom() await expect(coordinator.contract.registerOracle(oracle)).to.be.revertedWithCustomError( coordinator.contract, - 'TooManyOracles' + 'TooManyOracles', ) }) @@ -907,7 +907,7 @@ describe('Request-Response user contract', function () { ).wait() const { requestId, sender, blockNumber, isDirectPayment, jobId } = parseDataRequestedTx( coordinator.contract, - tx + tx, ) // nonce 1 represents a valid account @@ -916,7 +916,7 @@ describe('Request-Response user contract', function () { expect( await coordinator.contract .connect(consumer.signer) - .pendingRequestExists(consumer.contract.address, accId, nonce) + .pendingRequestExists(consumer.contract.address, accId, nonce), ).to.be.equal(true) // After fulfillment, there are no pending requests @@ -927,7 +927,7 @@ describe('Request-Response user contract', function () { numSubmission, sender, isDirectPayment, - jobId + jobId, } const response = 123 coordinator.contract @@ -937,7 +937,7 @@ describe('Request-Response user contract', function () { expect( await coordinator.contract .connect(consumer.signer) - .pendingRequestExists(consumer.contract.address, accId, nonce) + .pendingRequestExists(consumer.contract.address, accId, nonce), ).to.be.equal(false) }) @@ -954,9 +954,9 @@ describe('Request-Response user contract', function () { numSubmission, consumer.signer.address, { - value: 0 - } - ) + value: 0, + }, + ), ).to.be.revertedWithCustomError(coordinator.contract, 'InsufficientPayment') }) @@ -973,7 +973,7 @@ describe('Request-Response user contract', function () { // Request const numSubmission = 1 await expect( - consumer.contract.requestDataInt256(accId, callbackGasLimit, numSubmission) + consumer.contract.requestDataInt256(accId, callbackGasLimit, numSubmission), ).to.be.revertedWithCustomError(coordinator.contract, 'InvalidConsumer') }) @@ -991,7 +991,7 @@ describe('Request-Response user contract', function () { const numSubmission = 1 const callbackGasLimit = maxGasLimit + 1 await expect( - consumer.contract.requestDataInt256(accId, callbackGasLimit, numSubmission) + consumer.contract.requestDataInt256(accId, callbackGasLimit, numSubmission), ).to.be.revertedWithCustomError(coordinator.contract, 'GasLimitTooBig') }) @@ -1001,7 +1001,7 @@ describe('Request-Response user contract', function () { await coordinator.contract.setConfig( maxGasLimit, gasAfterPaymentCalculation, - Object.values(feeConfig) + Object.values(feeConfig), ) // Prepare account @@ -1018,7 +1018,7 @@ describe('Request-Response user contract', function () { const { requestId, sender, blockNumber, isDirectPayment, jobId } = parseDataRequestedTx( coordinator.contract, - requestTx + requestTx, ) const requestCommitment = { @@ -1028,14 +1028,14 @@ describe('Request-Response user contract', function () { numSubmission, sender, isDirectPayment, - jobId + jobId, } const response = 123 await expect( coordinator.contract .connect(rrOracle0) - .fulfillDataRequestInt256(requestId, response, requestCommitment) + .fulfillDataRequestInt256(requestId, response, requestCommitment), ).to.be.revertedWithCustomError(coordinator.contract, 'UnregisteredOracleFulfillment') }) @@ -1058,7 +1058,7 @@ describe('Request-Response user contract', function () { const { requestId, sender, blockNumber, isDirectPayment, jobId } = parseDataRequestedTx( coordinator.contract, - requestTx + requestTx, ) const requestCommitment = { @@ -1068,7 +1068,7 @@ describe('Request-Response user contract', function () { numSubmission, sender, isDirectPayment, - jobId + jobId, } const response = 123 @@ -1079,7 +1079,7 @@ describe('Request-Response user contract', function () { await expect( coordinator.contract .connect(rrOracle0) - .fulfillDataRequestInt256(requestId, response, requestCommitment) + .fulfillDataRequestInt256(requestId, response, requestCommitment), ).to.be.revertedWithCustomError(coordinator.contract, 'OracleAlreadySubmitted') }) @@ -1101,7 +1101,7 @@ describe('Request-Response user contract', function () { const { sender, blockNumber, isDirectPayment, jobId } = parseDataRequestedTx( coordinator.contract, - requestTx + requestTx, ) const requestCommitment = { @@ -1111,7 +1111,7 @@ describe('Request-Response user contract', function () { numSubmission, sender, isDirectPayment, - jobId + jobId, } const response = 123 @@ -1119,7 +1119,7 @@ describe('Request-Response user contract', function () { await expect( coordinator.contract .connect(rrOracle0) - .fulfillDataRequestInt256(wrongRequestId, response, requestCommitment) + .fulfillDataRequestInt256(wrongRequestId, response, requestCommitment), ).to.be.revertedWithCustomError(coordinator.contract, 'NoCorrespondingRequest') }) @@ -1141,7 +1141,7 @@ describe('Request-Response user contract', function () { const { requestId, sender, blockNumber, isDirectPayment, jobId } = parseDataRequestedTx( coordinator.contract, - requestTx + requestTx, ) const requestCommitment = { @@ -1151,20 +1151,20 @@ describe('Request-Response user contract', function () { numSubmission: numSubmission + 1, // any information modified in requestCommitment will be detected sender, isDirectPayment, - jobId + jobId, } const response = 123 await expect( coordinator.contract .connect(rrOracle0) - .fulfillDataRequestInt256(requestId, response, requestCommitment) + .fulfillDataRequestInt256(requestId, response, requestCommitment), ).to.be.revertedWithCustomError(coordinator.contract, 'IncorrectCommitment') }) it('ValidateNumSubmission', async function () { const { coordinator, consumer, rrOracle0, rrOracle1, rrOracle2, rrOracle3 } = await loadFixture( - deploy + deploy, ) await setupOracle(coordinator.contract, [rrOracle0, rrOracle1, rrOracle2, rrOracle3]) @@ -1173,7 +1173,7 @@ describe('Request-Response user contract', function () { const jobId = ethers.utils.id('nonexistant-job') const numSubmission = 0 await expect( - coordinator.contract.connect(consumer.signer).validateNumSubmission(jobId, numSubmission) + coordinator.contract.connect(consumer.signer).validateNumSubmission(jobId, numSubmission), ).to.be.revertedWithCustomError(coordinator.contract, 'InvalidJobId') } @@ -1182,7 +1182,7 @@ describe('Request-Response user contract', function () { const jobId = ethers.utils.id('bool') const numSubmission = 3 await expect( - coordinator.contract.connect(consumer.signer).validateNumSubmission(jobId, numSubmission) + coordinator.contract.connect(consumer.signer).validateNumSubmission(jobId, numSubmission), ).to.be.revertedWithCustomError(coordinator.contract, 'InvalidNumSubmission') } @@ -1191,7 +1191,7 @@ describe('Request-Response user contract', function () { const jobId = ethers.utils.id('uint128') const numSubmission = 4 await expect( - coordinator.contract.connect(consumer.signer).validateNumSubmission(jobId, numSubmission) + coordinator.contract.connect(consumer.signer).validateNumSubmission(jobId, numSubmission), ).to.be.revertedWithCustomError(coordinator.contract, 'InvalidNumSubmission') } }) @@ -1214,7 +1214,7 @@ describe('Request-Response user contract', function () { const { sender, blockNumber, isDirectPayment, jobId } = parseDataRequestedTx( coordinator.contract, - requestTx + requestTx, ) const requestCommitment = { @@ -1224,7 +1224,7 @@ describe('Request-Response user contract', function () { numSubmission, sender, isDirectPayment, - jobId + jobId, } const response = 123 @@ -1232,7 +1232,7 @@ describe('Request-Response user contract', function () { await expect( coordinator.contract .connect(rrOracle0) - .fulfillDataRequestBytes(wrongRequestId, response, requestCommitment) // Should be fulfillDataRequestInt256 + .fulfillDataRequestBytes(wrongRequestId, response, requestCommitment), // Should be fulfillDataRequestInt256 ).to.be.revertedWithCustomError(coordinator.contract, 'IncompatibleJobId') }) }) diff --git a/contracts/v0.1/test/non-vrf/RequestResponseCoordinator.test.cjs b/contracts/v0.1/test/non-vrf/RequestResponseCoordinator.test.cjs index 7e45c6db4..04eba3651 100644 --- a/contracts/v0.1/test/non-vrf/RequestResponseCoordinator.test.cjs +++ b/contracts/v0.1/test/non-vrf/RequestResponseCoordinator.test.cjs @@ -4,7 +4,7 @@ const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers') const { deploy: deployPrepayment } = require('./Prepayment.utils.cjs') const { deploy: deployRrCoordinator, - parseOracleRegisterdTx + parseOracleRegisterdTx, } = require('./RequestResponseCoordinator.utils.cjs') const { createSigners } = require('../utils.cjs') @@ -12,7 +12,7 @@ async function deploy() { const { account0: deployerSigner, account1: protocolFeeRecipient, - account2: consumerSigner + account2: consumerSigner, } = await createSigners() // PREPAYMENT @@ -21,12 +21,12 @@ async function deploy() { // COORDINATOR const coordinatorContract = await deployRrCoordinator(prepaymentContract.address, deployerSigner) expect(await coordinatorContract.connect(consumerSigner).typeAndVersion()).to.be.equal( - 'RequestResponseCoordinator v0.1' + 'RequestResponseCoordinator v0.1', ) return { coordinatorContract, - consumerSigner + consumerSigner, } } @@ -39,7 +39,7 @@ describe('RequestResponseCoordinator', function () { // oracle 1 is not registered yet expect( - await coordinatorContract.connect(consumerSigner).isOracleRegistered(oracle1) + await coordinatorContract.connect(consumerSigner).isOracleRegistered(oracle1), ).to.be.equal(false) // Register oracle 1 @@ -51,7 +51,7 @@ describe('RequestResponseCoordinator', function () { // oracle 1 is now registered expect( - await coordinatorContract.connect(consumerSigner).isOracleRegistered(oracle1) + await coordinatorContract.connect(consumerSigner).isOracleRegistered(oracle1), ).to.be.equal(true) // Register oracle 2 @@ -69,7 +69,7 @@ describe('RequestResponseCoordinator', function () { await (await coordinatorContract.registerOracle(oracle)).wait() await expect(coordinatorContract.registerOracle(oracle)).to.be.revertedWithCustomError( coordinatorContract, - 'OracleAlreadyRegistered' + 'OracleAlreadyRegistered', ) }) @@ -80,7 +80,7 @@ describe('RequestResponseCoordinator', function () { // Cannot deregister underegistered oracle await expect(coordinatorContract.deregisterOracle(oracle)).to.be.revertedWithCustomError( coordinatorContract, - 'NoSuchOracle' + 'NoSuchOracle', ) // Registration diff --git a/contracts/v0.1/test/non-vrf/RequestResponseCoordinator.utils.cjs b/contracts/v0.1/test/non-vrf/RequestResponseCoordinator.utils.cjs index 61f786360..c1aa2f8bd 100644 --- a/contracts/v0.1/test/non-vrf/RequestResponseCoordinator.utils.cjs +++ b/contracts/v0.1/test/non-vrf/RequestResponseCoordinator.utils.cjs @@ -8,12 +8,12 @@ const DATA_REQUEST_EVENT_ARGS = [ 'callbackGasLimit', 'sender', 'isDirectPayment', - 'data' + 'data', ] async function deploy(prepaymentAddress, signer) { let contract = await ethers.getContractFactory('RequestResponseCoordinator', { - signer + signer, }) contract = await contract.deploy(prepaymentAddress) await contract.deployed() @@ -47,7 +47,7 @@ function parseDataRequestedTx(coordinator, tx) { isDirectPayment, data, blockNumber, - blockHash + blockHash, } } @@ -68,7 +68,7 @@ function parseDataRequestFulfilledTx(coordinator, tx, eventName) { blockHash, blockNumber, gasUsed, - cumulativeGasUsed + cumulativeGasUsed, } } @@ -86,5 +86,5 @@ module.exports = { parseDataRequestedTx, DATA_REQUEST_EVENT_ARGS, parseDataRequestFulfilledTx, - parseOracleRegisterdTx + parseOracleRegisterdTx, } diff --git a/contracts/v0.1/test/utils.cjs b/contracts/v0.1/test/utils.cjs index c89186691..b3a7b74d7 100644 --- a/contracts/v0.1/test/utils.cjs +++ b/contracts/v0.1/test/utils.cjs @@ -47,7 +47,7 @@ async function createSigners() { account5, account6, account7, - account8 + account8, } } @@ -57,5 +57,5 @@ module.exports = { remove0x, median, majorityVotingBool, - createSigners + createSigners, } diff --git a/contracts/v0.1/test/vrf/CoordinatorBase.test.cjs b/contracts/v0.1/test/vrf/CoordinatorBase.test.cjs index 1ee1e9d68..668a623f0 100644 --- a/contracts/v0.1/test/vrf/CoordinatorBase.test.cjs +++ b/contracts/v0.1/test/vrf/CoordinatorBase.test.cjs @@ -5,7 +5,7 @@ const { deploy: deployVrfConsumerMock } = require('./VRFConsumerMock.utils.cjs') const { deploy: deployVrfCoordinator, setupOracle: setupVrfOracle, - parseRandomWordsRequestedTx + parseRandomWordsRequestedTx, } = require('./VRFCoordinator.utils.cjs') const { createAccount, addConsumer, deposit } = require('../non-vrf/Prepayment.utils.cjs') const { vrfConfig } = require('./VRFCoordinator.config.cjs') @@ -19,25 +19,25 @@ async function deploy() { account1: consumerSigner, account2: vrfOracleSigner, account3: protocolFeeRecipientSigner, - account4: invalidConsumerSigner + account4: invalidConsumerSigner, } = await createSigners() // Prepayment const prepaymentContract = await deployPrepayment( protocolFeeRecipientSigner.address, - deployerSigner + deployerSigner, ) // VRFCoordinator const vrfCoordinatorContract = await deployVrfCoordinator( prepaymentContract.address, - deployerSigner + deployerSigner, ) // VRFConsumerMock const consumerContract = await deployVrfConsumerMock( vrfCoordinatorContract.address, - consumerSigner + consumerSigner, ) return { @@ -46,7 +46,7 @@ async function deploy() { prepaymentContract, vrfCoordinatorContract, consumerContract, - invalidConsumerSigner + invalidConsumerSigner, } } @@ -60,7 +60,7 @@ describe('CoordinatorBase', function () { const invalidRequestId = 123 await expect( - vrfCoordinatorContract.connect(consumerSigner).cancelRequest(invalidRequestId) + vrfCoordinatorContract.connect(consumerSigner).cancelRequest(invalidRequestId), ).to.be.revertedWithCustomError(vrfCoordinatorContract, 'NoCorrespondingRequest') }) @@ -70,7 +70,7 @@ describe('CoordinatorBase', function () { vrfCoordinatorContract, consumerContract, consumerSigner, - invalidConsumerSigner + invalidConsumerSigner, } = await loadFixture(deploy) // oracle setup @@ -93,7 +93,7 @@ describe('CoordinatorBase', function () { // cancel with wrong signer await expect( - vrfCoordinatorContract.connect(invalidConsumerSigner).cancelRequest(requestId) + vrfCoordinatorContract.connect(invalidConsumerSigner).cancelRequest(requestId), ).to.be.revertedWithCustomError(vrfCoordinatorContract, 'NotRequestOwner') // cancel with right signer diff --git a/contracts/v0.1/test/vrf/CoordinatorBase.utils.cjs b/contracts/v0.1/test/vrf/CoordinatorBase.utils.cjs index 332a7db19..ef29a8b50 100644 --- a/contracts/v0.1/test/vrf/CoordinatorBase.utils.cjs +++ b/contracts/v0.1/test/vrf/CoordinatorBase.utils.cjs @@ -8,5 +8,5 @@ function parseRequestCanceled(coordinator, tx) { } module.exports = { - parseRequestCanceled + parseRequestCanceled, } diff --git a/contracts/v0.1/test/vrf/CoordinatorBaseMock.test.cjs b/contracts/v0.1/test/vrf/CoordinatorBaseMock.test.cjs index 1a794c2f4..fa44d3246 100644 --- a/contracts/v0.1/test/vrf/CoordinatorBaseMock.test.cjs +++ b/contracts/v0.1/test/vrf/CoordinatorBaseMock.test.cjs @@ -11,13 +11,13 @@ async function deploy() { // CoordinatorBaseMock let contract = await ethers.getContractFactory('CoordinatorBaseMock', { - signer: deployerSigner + signer: deployerSigner, }) contract = await contract.deploy() await contract.deployed() return { - contract + contract, } } @@ -40,7 +40,7 @@ describe('CoordinatorBaseMock', function () { reqsForTier2: 0, reqsForTier3: 0, reqsForTier4: 0, - reqsForTier5: 0 + reqsForTier5: 0, } await contract.setConfig(MAX_GAS_LIMIT, GAS_AFTER_PAYMENT_CALCULATION, Object.values(feeConfig)) @@ -61,7 +61,7 @@ describe('CoordinatorBaseMock', function () { reqsForTier2: 10, reqsForTier3: 20, reqsForTier4: 30, - reqsForTier5: 40 + reqsForTier5: 40, } await contract.setConfig(MAX_GAS_LIMIT, GAS_AFTER_PAYMENT_CALCULATION, Object.values(feeConfig)) @@ -89,7 +89,7 @@ describe('CoordinatorBaseMock', function () { // reqCount > fc.reqsForTier5 expect(parseKlay('1')).to.be.equal(await contract.computeFee(feeConfig.reqsForTier5 + 1)) expect(parseKlay('1')).to.be.equal( - await contract.computeFee(feeConfig.reqsForTier4 + 1_000_000) + await contract.computeFee(feeConfig.reqsForTier4 + 1_000_000), ) }) }) diff --git a/contracts/v0.1/test/vrf/CoordinatorRevertFulfillment.test.cjs b/contracts/v0.1/test/vrf/CoordinatorRevertFulfillment.test.cjs index 147e1a3c7..f08233dd3 100644 --- a/contracts/v0.1/test/vrf/CoordinatorRevertFulfillment.test.cjs +++ b/contracts/v0.1/test/vrf/CoordinatorRevertFulfillment.test.cjs @@ -6,19 +6,19 @@ const { setupOracle: setupVrfCoordinator, parseRandomWordsRequestedTx, fulfillRandomWords, - parseRandomWordsFulfilledTx + parseRandomWordsFulfilledTx, } = require('./VRFCoordinator.utils.cjs') const { parseKlay } = require('../utils.cjs') const { deploy: deployRrCoordinator, setupOracle: setupRequestResponseCoordinator, parseDataRequestedTx, - parseDataRequestFulfilledTx + parseDataRequestFulfilledTx, } = require('../non-vrf/RequestResponseCoordinator.utils.cjs') const { deploy: deployPrepayment, createAccount, - deposit + deposit, } = require('../non-vrf/Prepayment.utils.cjs') const { vrfConfig } = require('./VRFCoordinator.config.cjs') const { requestResponseConfig } = require('../non-vrf/RequestResponse.config.cjs') @@ -31,27 +31,27 @@ async function deploy() { account1: consumerSigner, account2: vrfOracleSigner, account3: rrOracleSigner, - account4: protocolFeeRecipientSigner + account4: protocolFeeRecipientSigner, } = await createSigners() // Prepayment const prepaymentContract = await deployPrepayment( protocolFeeRecipientSigner.address, - deployerSigner + deployerSigner, ) const prepayment = { contract: prepaymentContract, - signer: deployerSigner + signer: deployerSigner, } // VRFCoordinator const vrfCoordinatorContract = await deployVrfCoordinator( prepaymentContract.address, - deployerSigner + deployerSigner, ) const vrfCoordinator = { contract: vrfCoordinatorContract, - signer: deployerSigner + signer: deployerSigner, } // VRFCoordinator setup @@ -61,11 +61,11 @@ async function deploy() { // RequestResponseCoordinator const rrCoordinatorContract = await deployRrCoordinator( prepaymentContract.address, - deployerSigner + deployerSigner, ) const rrCoordinator = { contract: rrCoordinatorContract, - signer: deployerSigner + signer: deployerSigner, } // RequestResponseCoordinator setup @@ -74,27 +74,27 @@ async function deploy() { // VRFConsumerRevertFulfillmentMock let vrfConsumerContract = await ethers.getContractFactory('VRFConsumerRevertFulfillmentMock', { - signer: consumerSigner + signer: consumerSigner, }) vrfConsumerContract = await vrfConsumerContract.deploy(vrfCoordinatorContract.address) await vrfConsumerContract.deployed() const vrfConsumer = { contract: vrfConsumerContract, - signer: consumerSigner + signer: consumerSigner, } // RequestResponseConsumerRevertFulfillmentMock let rrConsumerContract = await ethers.getContractFactory( 'RequestResponseConsumerRevertFulfillmentMock', { - signer: consumerSigner - } + signer: consumerSigner, + }, ) rrConsumerContract = await rrConsumerContract.deploy(rrCoordinatorContract.address) await rrConsumerContract.deployed() const rrConsumer = { contract: rrConsumerContract, - signer: consumerSigner + signer: consumerSigner, } const { accId } = await createAccount(prepaymentContract, consumerSigner) @@ -111,7 +111,7 @@ async function deploy() { vrfConsumer, rrCoordinator, rrConsumer, - accId + accId, } } @@ -142,7 +142,7 @@ describe('Revert Fulfillment Test', function () { callbackGasLimit, sender, isDirectPayment, - numWords + numWords, ) const { payment, success } = parseRandomWordsFulfilledTx(vrfCoordinator.contract, txFulfill) @@ -153,7 +153,7 @@ describe('Revert Fulfillment Test', function () { expect(protocolFeeRecipientBalanceAfter).to.be.gt(protocolFeeRecipientBalanceBefore) const protocolRecipientRevenue = protocolFeeRecipientBalanceAfter.sub( - protocolFeeRecipientBalanceBefore + protocolFeeRecipientBalanceBefore, ) const protocolFee = ethers.BigNumber.from('500000000000000') expect(protocolRecipientRevenue).to.be.equal(protocolFee) @@ -169,7 +169,7 @@ describe('Revert Fulfillment Test', function () { expect(extraGasRebate).to.be.gte(0) console.log( 'extraGasRebate', - extraGasRebate.div(hre.network.config.gasPrice.toString()).toString() + extraGasRebate.div(hre.network.config.gasPrice.toString()).toString(), ) }) @@ -184,7 +184,7 @@ describe('Revert Fulfillment Test', function () { ).wait() const { requestId, sender, blockNumber, jobId, isDirectPayment } = parseDataRequestedTx( rrCoordinator.contract, - tx + tx, ) const protocolFeeRecipientBalanceBefore = await getBalance(protocolFeeRecipientSigner.address) @@ -197,7 +197,7 @@ describe('Revert Fulfillment Test', function () { numSubmission, sender, isDirectPayment, - jobId + jobId, } const txFulfill = await ( @@ -209,7 +209,7 @@ describe('Revert Fulfillment Test', function () { const { payment, success } = parseDataRequestFulfilledTx( rrCoordinator.contract, txFulfill, - 'DataRequestFulfilledUint128' + 'DataRequestFulfilledUint128', ) expect(payment).to.be.above(0) expect(success).to.be.equal(false) @@ -218,7 +218,7 @@ describe('Revert Fulfillment Test', function () { expect(protocolFeeRecipientBalanceAfter).to.be.gt(protocolFeeRecipientBalanceBefore) const protocolRecipientRevenue = protocolFeeRecipientBalanceAfter.sub( - protocolFeeRecipientBalanceBefore + protocolFeeRecipientBalanceBefore, ) const protocolFee = ethers.BigNumber.from('500000000000000') expect(protocolRecipientRevenue).to.be.equal(protocolFee) @@ -234,7 +234,7 @@ describe('Revert Fulfillment Test', function () { expect(extraGasRebate).to.be.gte(0) console.log( 'extraGasRebate', - extraGasRebate.div(hre.network.config.gasPrice.toString()).toString() + extraGasRebate.div(hre.network.config.gasPrice.toString()).toString(), ) }) }) diff --git a/contracts/v0.1/test/vrf/EC-test-data/P256-aux.json b/contracts/v0.1/test/vrf/EC-test-data/P256-aux.json index 937344a17..5e36a0d94 100644 --- a/contracts/v0.1/test/vrf/EC-test-data/P256-aux.json +++ b/contracts/v0.1/test/vrf/EC-test-data/P256-aux.json @@ -158,4 +158,4 @@ } ] } -} \ No newline at end of file +} diff --git a/contracts/v0.1/test/vrf/EC-test-data/secp256k1-aux.json b/contracts/v0.1/test/vrf/EC-test-data/secp256k1-aux.json index 6cfea85d4..3cf1a34bb 100644 --- a/contracts/v0.1/test/vrf/EC-test-data/secp256k1-aux.json +++ b/contracts/v0.1/test/vrf/EC-test-data/secp256k1-aux.json @@ -196,4 +196,4 @@ } ] } -} \ No newline at end of file +} diff --git a/contracts/v0.1/test/vrf/EllipticCurve.test.cjs b/contracts/v0.1/test/vrf/EllipticCurve.test.cjs index fd5f0bbe5..a4ca284ee 100644 --- a/contracts/v0.1/test/vrf/EllipticCurve.test.cjs +++ b/contracts/v0.1/test/vrf/EllipticCurve.test.cjs @@ -8,7 +8,7 @@ async function deploy() { deployer = await ethers.getSigner(deployer) let contract = await ethers.getContractFactory('TestEllipticCurve', { - signer: deployer.address + signer: deployer.address, }) contract = await contract.deploy() await contract.deployed() @@ -55,7 +55,7 @@ for (const curve of auxCurves) { }`, async () => { const ecLib = await loadFixture(deploy) await expect(ecLib.invMod(test.input.k, test.input.mod)).to.be.rejectedWith( - test.output.error + test.output.error, ) }) } @@ -85,7 +85,7 @@ for (const curve of auxCurves) { }`, async () => { const ecLib = await loadFixture(deploy) expect(await ecLib.isOnCurve(test.input.x, test.input.y, aa, bb, pp)).to.be.equal( - test.output.isOnCurve + test.output.isOnCurve, ) }) } @@ -124,7 +124,7 @@ for (const curve of curves) { test.input.x2, test.input.y2, aa, - pp + pp, ) expect(res[0]).to.be.equal(test.output.x) @@ -142,7 +142,7 @@ for (const curve of curves) { test.input.x2, test.input.y2, aa, - pp + pp, ) expect(res[0]).to.be.equal(test.output.x) diff --git a/contracts/v0.1/test/vrf/L2VRFConsumerMock.cjs b/contracts/v0.1/test/vrf/L2VRFConsumerMock.cjs index 5e41b11cf..71c21efb2 100644 --- a/contracts/v0.1/test/vrf/L2VRFConsumerMock.cjs +++ b/contracts/v0.1/test/vrf/L2VRFConsumerMock.cjs @@ -12,7 +12,7 @@ async function deploy() { account2, account3, account4, - account5 + account5, } = await createSigners() // L2 endpoint @@ -22,19 +22,19 @@ async function deploy() { const endpoint = { contract: l2EndpointContract, - signer: deployerSigner + signer: deployerSigner, } // L2 consumer let l2VRFConsumerMock = await ethers.getContractFactory('L2VRFConsumerMock', { - signer: deployerSigner + signer: deployerSigner, }) l2VRFConsumerMock = await l2VRFConsumerMock.deploy(l2EndpointContract.address) await l2VRFConsumerMock.deployed() const consumer = { contract: l2VRFConsumerMock, - signer: deployerSigner + signer: deployerSigner, } return { @@ -43,7 +43,7 @@ async function deploy() { account2, account3, account4, - account5 + account5, } } @@ -62,7 +62,7 @@ describe('Consumer', function () { const randomWords = [1] await expect( - endpoint.contract.fulfillRandomWords(requestId, randomWords) + endpoint.contract.fulfillRandomWords(requestId, randomWords), ).revertedWithCustomError(endpoint.contract, 'InvalidSubmitter') await (await endpoint.contract.addSubmitter(endpoint.signer.address)).wait() diff --git a/contracts/v0.1/test/vrf/VRF-test-data/data.json b/contracts/v0.1/test/vrf/VRF-test-data/data.json index ec1ff7a54..0d2b72f40 100644 --- a/contracts/v0.1/test/vrf/VRF-test-data/data.json +++ b/contracts/v0.1/test/vrf/VRF-test-data/data.json @@ -160,14 +160,7 @@ "invalid": [ { "description": "wrong gamma sign", - "asserts": [ - true, - true, - true, - true, - true, - false - ], + "asserts": [true, true, true, true, true, false], "pi": "0x021f4dbca087a1972d04a07a779b7df1caa99e0f5db2aa21f3aecc4f9e10e85d0814faa89697b482daa377fb6b4a8b0191a65d34a6d90a8a2461e5db9205d4cf0bb4b2c31b5ef6997a585a9f1a72517b6f", "publicKey": { "x": "0x2c8c31fc9f990c6b55e3865a184a4ce50e09481f2eaeb3e60ec1cea13a6ae645", @@ -191,14 +184,7 @@ }, { "description": "wrong public key", - "asserts": [ - false, - false, - false, - false, - true, - true - ], + "asserts": [false, false, false, false, true, true], "pi": "0x031f4dbca087a1972d04a07a779b7df1caa99e0f5db2aa21f3aecc4f9e10e85d0814faa89697b482daa377fb6b4a8b0191a65d34a6d90a8a2461e5db9205d4cf0bb4b2c31b5ef6997a585a9f1a72517b6f", "publicKey": { "x": "0xe493dbf1c10d80f3581e4904930b1404cc6c13900ee0758474fa94abe8c4cd13", @@ -222,14 +208,7 @@ }, { "description": "wrong message", - "asserts": [ - false, - false, - false, - false, - true, - true - ], + "asserts": [false, false, false, false, true, true], "pi": "0x031f4dbca087a1972d04a07a779b7df1caa99e0f5db2aa21f3aecc4f9e10e85d0814faa89697b482daa377fb6b4a8b0191a65d34a6d90a8a2461e5db9205d4cf0bb4b2c31b5ef6997a585a9f1a72517b6f", "publicKey": { "x": "0xe493dbf1c10d80f3581e4904930b1404cc6c13900ee0758474fa94abe8c4cd13", diff --git a/contracts/v0.1/test/vrf/VRF.test.cjs b/contracts/v0.1/test/vrf/VRF.test.cjs index 07cf659c6..b6553eb12 100644 --- a/contracts/v0.1/test/vrf/VRF.test.cjs +++ b/contracts/v0.1/test/vrf/VRF.test.cjs @@ -9,7 +9,7 @@ async function deploy() { let { account0: deployer } = await hre.getNamedAccounts() deployer = await ethers.getSigner(deployer) let contract = await ethers.getContractFactory('TestHelperVRF', { - signer: deployer.address + signer: deployer.address, }) contract = await contract.deploy() await contract.deployed() @@ -86,12 +86,12 @@ describe('Auxiliary functions: ', () => { params[1][0].eq(test.vComponents.sH.x), params[1][1].eq(test.vComponents.sH.y), params[1][2].eq(test.vComponents.cGamma.x), - params[1][3].eq(test.vComponents.cGamma.y) + params[1][3].eq(test.vComponents.cGamma.y), ] expect( results.length === test.asserts.length && - results.every((value, index) => value === test.asserts[index]) + results.every((value, index) => value === test.asserts[index]), ).to.be.equal(true) }) } @@ -147,7 +147,7 @@ describe('Proof verification functions: ', () => { proof, message, [uPointX, uPointY], - [vProof1X, vProof1Y, vProof2X, vProof2Y] + [vProof1X, vProof1Y, vProof2X, vProof2Y], ) expect(result).to.be.equal(true) }) @@ -179,7 +179,7 @@ describe('Proof verification functions: ', () => { proof, message, [uPointX, uPointY], - [vProof1X, vProof1Y, vProof2X, vProof2Y] + [vProof1X, vProof1Y, vProof2X, vProof2Y], ) expect(result).to.be.equal(false) }) diff --git a/contracts/v0.1/test/vrf/VRFConsumerMock.utils.cjs b/contracts/v0.1/test/vrf/VRFConsumerMock.utils.cjs index 066341fd8..cb85c7055 100644 --- a/contracts/v0.1/test/vrf/VRFConsumerMock.utils.cjs +++ b/contracts/v0.1/test/vrf/VRFConsumerMock.utils.cjs @@ -1,6 +1,6 @@ async function deploy(coordinatorAddress, signer) { let contract = await ethers.getContractFactory('VRFConsumerMock', { - signer + signer, }) contract = await contract.deploy(coordinatorAddress) await contract.deployed() @@ -8,5 +8,5 @@ async function deploy(coordinatorAddress, signer) { } module.exports = { - deploy + deploy, } diff --git a/contracts/v0.1/test/vrf/VRFCoordinator.config.cjs b/contracts/v0.1/test/vrf/VRFCoordinator.config.cjs index 033f57435..d4401753c 100644 --- a/contracts/v0.1/test/vrf/VRFCoordinator.config.cjs +++ b/contracts/v0.1/test/vrf/VRFCoordinator.config.cjs @@ -10,7 +10,7 @@ function vrfConfig() { reqsForTier2: 0, reqsForTier3: 0, reqsForTier4: 0, - reqsForTier5: 0 + reqsForTier5: 0, } // The following settings were generate using `yarn cli vrf keygen` @@ -31,10 +31,10 @@ function vrfConfig() { pkX, pkY, publicProvingKey, - keyHash + keyHash, } } module.exports = { - vrfConfig + vrfConfig, } diff --git a/contracts/v0.1/test/vrf/VRFCoordinator.test.cjs b/contracts/v0.1/test/vrf/VRFCoordinator.test.cjs index c2520e9ee..b278ed7d0 100644 --- a/contracts/v0.1/test/vrf/VRFCoordinator.test.cjs +++ b/contracts/v0.1/test/vrf/VRFCoordinator.test.cjs @@ -10,7 +10,7 @@ const { deploy: deployVrfCoordinator, parseRandomWordsRequestedTx, parseRequestCanceledTx, - computeExactFee + computeExactFee, } = require('./VRFCoordinator.utils.cjs') const { deploy: deployVrfConsumerMock } = require('./VRFConsumerMock.utils.cjs') const { @@ -24,7 +24,7 @@ const { createFiatSubscriptionAccount, createKlaySubscriptionAccount, createKlayDiscountAccount, - getAccount + getAccount, } = require('../non-vrf/Prepayment.utils.cjs') const { AccountType } = require('../non-vrf/Account.utils.cjs') @@ -50,7 +50,7 @@ function validateRandomWordsRequestedEvent( maxGasLimit, numWords, sender, - isDirectPayment + isDirectPayment, ) { let eventIndex if (isDirectPayment) { @@ -71,7 +71,7 @@ function validateRandomWordsRequestedEvent( callbackGasLimit: eCallbackGasLimit, numWords: eNumWords, sender: eSender, - isDirectPayment: eIsDirectPayment + isDirectPayment: eIsDirectPayment, } = event.args expect(eKeyHash).to.be.equal(keyHash) if (!isDirectPayment) { @@ -108,11 +108,11 @@ async function fulfillRandomWords( notRegisteredOracleSigner, pi, rc, - isDirectPayment + isDirectPayment, ) { // Random word request cannot be fulfilled by an unregistered oracle await expect( - coordinator.connect(notRegisteredOracleSigner).fulfillRandomWords(pi, rc, isDirectPayment) + coordinator.connect(notRegisteredOracleSigner).fulfillRandomWords(pi, rc, isDirectPayment), ).to.be.revertedWithCustomError(coordinator, 'NoSuchProvingKey') // Registered oracle can submit data back to chain @@ -122,7 +122,7 @@ async function fulfillRandomWords( // However even registered oracle cannot fulfill the request more than once await expect( - coordinator.connect(registeredOracleSigner).fulfillRandomWords(pi, rc, isDirectPayment) + coordinator.connect(registeredOracleSigner).fulfillRandomWords(pi, rc, isDirectPayment), ).to.be.revertedWithCustomError(coordinator, 'NoCorrespondingRequest') return tx @@ -136,7 +136,7 @@ function validateRandomWordsFulfilledEvent( accId, isDirectPayment, accType = AccountType.KLAY_REGULAR, - serviceFee = 0 + serviceFee = 0, ) { let burnedFeeEventIdx let randomWordsFulfilledEventIdx @@ -164,7 +164,7 @@ function validateRandomWordsFulfilledEvent( const { accId: dAccId, oldBalance: dOldBalance, - newBalance: dNewBalance + newBalance: dNewBalance, } = accountBalanceDecreasedEvent.args expect(dAccId).to.be.equal(accId) expect(dOldBalance).to.be.above(dNewBalance) @@ -185,14 +185,14 @@ function validateRandomWordsFulfilledEvent( // Event: RandomWordsFulfilled const randomWordsFulfilledEvent = coordinator.interface.parseLog( - tx.events[randomWordsFulfilledEventIdx] + tx.events[randomWordsFulfilledEventIdx], ) expect(randomWordsFulfilledEvent.name).to.be.equal('RandomWordsFulfilled') const { requestId: fRequestId, // outputSeed: fOutputSeed, payment: fPayment, - success: fSuccess + success: fSuccess, } = randomWordsFulfilledEvent.args expect(fRequestId).to.be.equal(requestId) @@ -209,7 +209,7 @@ function validateRandomWordsFulfilledKlaySubEvent( prepayment, requestId, accId, - subPrice + subPrice, ) { let burnedFeeEventIdx let randomWordsFulfilledEventIdx @@ -231,7 +231,7 @@ function validateRandomWordsFulfilledKlaySubEvent( const { accId: dAccId, oldBalance: dOldBalance, - newBalance: dNewBalance + newBalance: dNewBalance, } = accountBalanceDecreasedEvent.args expect(dAccId).to.be.equal(accId) expect(dOldBalance).to.be.above(dNewBalance) @@ -247,13 +247,13 @@ function validateRandomWordsFulfilledKlaySubEvent( // Event: RandomWordsFulfilled const randomWordsFulfilledEvent = coordinator.interface.parseLog( - tx.events[randomWordsFulfilledEventIdx] + tx.events[randomWordsFulfilledEventIdx], ) expect(randomWordsFulfilledEvent.name).to.be.equal('RandomWordsFulfilled') const { requestId: fRequestId, payment: fPayment, - success: fSuccess + success: fSuccess, } = randomWordsFulfilledEvent.args expect(fRequestId).to.be.equal(requestId) @@ -267,14 +267,14 @@ async function deploy() { account1: consumerSigner, account2, account3, - account4: protocolFeeRecipient + account4: protocolFeeRecipient, } = await createSigners() // Prepayment const prepaymentContract = await deployPrepayment(protocolFeeRecipient.address, deployerSigner) const prepayment = { contract: prepaymentContract, - signer: deployerSigner + signer: deployerSigner, } // VRFCoordinator @@ -282,14 +282,14 @@ async function deploy() { expect(await coordinatorContract.typeAndVersion()).to.be.equal('VRFCoordinator v0.1') const coordinator = { contract: coordinatorContract, - signer: deployerSigner + signer: deployerSigner, } // VRFConsumerMock const consumerContract = await deployVrfConsumerMock(coordinatorContract.address, consumerSigner) const consumer = { contract: consumerContract, - signer: consumerSigner + signer: consumerSigner, } return { @@ -297,7 +297,7 @@ async function deploy() { coordinator, consumer, account2, - account3 + account3, } } @@ -340,12 +340,12 @@ describe('VRF contract', function () { await (await coordinator.contract.registerOracle(oracle1, publicProvingKey1)).wait() // Neither oracle or public proving key can be registered twice await expect( - coordinator.contract.registerOracle(oracle1, publicProvingKey1) + coordinator.contract.registerOracle(oracle1, publicProvingKey1), ).to.be.revertedWithCustomError(coordinator.contract, 'OracleAlreadyRegistered') // Oracle cannot be registered twice await expect( - coordinator.contract.registerOracle(oracle1, publicProvingKey2) + coordinator.contract.registerOracle(oracle1, publicProvingKey2), ).to.be.revertedWithCustomError(coordinator.contract, 'OracleAlreadyRegistered') // Public proving key can be registered twice @@ -379,7 +379,7 @@ describe('VRF contract', function () { // Cannot deregister underegistered oracle await expect(coordinator.contract.deregisterOracle(oracle)).to.be.revertedWithCustomError( coordinator.contract, - 'NoSuchOracle' + 'NoSuchOracle', ) // Registration @@ -403,7 +403,7 @@ describe('VRF contract', function () { // Cannot deregister the same oracle twice await expect(coordinator.contract.deregisterOracle(oracle)).to.be.revertedWithCustomError( coordinator.contract, - 'NoSuchOracle' + 'NoSuchOracle', ) }) @@ -412,7 +412,7 @@ describe('VRF contract', function () { const { maxGasLimit: callbackGasLimit } = vrfConfig() const { accId } = await createAccount(prepayment.contract, consumer.signer) await expect( - consumer.contract.requestRandomWords(DUMMY_KEY_HASH, accId, callbackGasLimit, SINGLE_WORD) + consumer.contract.requestRandomWords(DUMMY_KEY_HASH, accId, callbackGasLimit, SINGLE_WORD), ).to.be.revertedWithCustomError(coordinator.contract, 'InvalidKeyHash') }) @@ -426,9 +426,9 @@ describe('VRF contract', function () { SINGLE_WORD, consumer.signer.address, { - value: parseKlay(1) - } - ) + value: parseKlay(1), + }, + ), ).to.be.revertedWithCustomError(coordinator.contract, 'InvalidKeyHash') }) @@ -439,7 +439,7 @@ describe('VRF contract', function () { await expect( consumer.contract .connect(nonOwner) - .requestRandomWords(DUMMY_KEY_HASH, accId, callbackGasLimit, SINGLE_WORD) + .requestRandomWords(DUMMY_KEY_HASH, accId, callbackGasLimit, SINGLE_WORD), ).to.be.revertedWithCustomError(consumer.contract, 'OnlyOwner') }) @@ -453,7 +453,7 @@ describe('VRF contract', function () { account2: oracle, account3: unregisteredOracle, coordinator, - prepayment + prepayment, } = await loadFixture(deploy) // Prepare cordinator @@ -466,7 +466,7 @@ describe('VRF contract', function () { const { maxGasLimit: callbackGasLimit, keyHash } = vrfConfig() await expect( - consumer.contract.requestRandomWords(keyHash, accId, callbackGasLimit, SINGLE_WORD) + consumer.contract.requestRandomWords(keyHash, accId, callbackGasLimit, SINGLE_WORD), ).to.be.revertedWithCustomError(coordinator.contract, 'InsufficientPayment') // Deposit 2 $KLAY to account with zero balance @@ -479,7 +479,7 @@ describe('VRF contract', function () { SINGLE_WORD, callbackGasLimit, accId, - accType + accType, ) // After depositing minimum account to account, we are able to @@ -499,7 +499,7 @@ describe('VRF contract', function () { callbackGasLimit, numWords, sender, - isDirectPayment + isDirectPayment, ) await testCommitmentBeforeFulfillment(coordinator.contract, consumer.signer, requestId) @@ -510,7 +510,7 @@ describe('VRF contract', function () { accId, callbackGasLimit, sender, - numWords + numWords, ) const txFulfillRandomWords = await fulfillRandomWords( @@ -519,7 +519,7 @@ describe('VRF contract', function () { unregisteredOracle, pi, rc, - isDirectPayment + isDirectPayment, ) await testCommitmentAfterFulfillment(coordinator.contract, consumer.signer, requestId) @@ -532,7 +532,7 @@ describe('VRF contract', function () { accId, isDirectPayment, AccountType.KLAY_REGULAR, - serviceFee + serviceFee, ) }) @@ -542,7 +542,7 @@ describe('VRF contract', function () { coordinator, prepayment, account2: oracle, - account3: unregisteredOracle + account3: unregisteredOracle, } = await loadFixture(deploy) const { maxGasLimit: callbackGasLimit, keyHash } = vrfConfig() @@ -559,8 +559,8 @@ describe('VRF contract', function () { SINGLE_WORD, consumer.signer.address, { - value: parseKlay('1') - } + value: parseKlay('1'), + }, ) ).wait() @@ -575,7 +575,7 @@ describe('VRF contract', function () { callbackGasLimit, numWords, sender, - isDirectPayment + isDirectPayment, ) await testCommitmentBeforeFulfillment(coordinator.contract, consumer.signer, requestId) @@ -586,7 +586,7 @@ describe('VRF contract', function () { accId, callbackGasLimit, sender, - numWords + numWords, ) const txFulfillRandomWords = await fulfillRandomWords( @@ -595,7 +595,7 @@ describe('VRF contract', function () { unregisteredOracle, pi, rc, - isDirectPayment + isDirectPayment, ) return @@ -607,7 +607,7 @@ describe('VRF contract', function () { prepayment.contract, requestId, accId, - isDirectPayment + isDirectPayment, ) }) @@ -621,7 +621,7 @@ describe('VRF contract', function () { account2: oracle, account3: unregisteredOracle, coordinator, - prepayment + prepayment, } = await loadFixture(deploy) // Prepare cordinator @@ -638,7 +638,7 @@ describe('VRF contract', function () { period, requestNumber, prepayment.signer, - consumer.signer + consumer.signer, ) await addConsumer(prepayment.contract, consumer.signer, accId, consumer.contract.address) @@ -651,7 +651,7 @@ describe('VRF contract', function () { SINGLE_WORD, callbackGasLimit, accId, - accType + accType, ) // After depositing minimum account to account, we are able to @@ -671,7 +671,7 @@ describe('VRF contract', function () { callbackGasLimit, numWords, sender, - isDirectPayment + isDirectPayment, ) await testCommitmentBeforeFulfillment(coordinator.contract, consumer.signer, requestId) @@ -682,7 +682,7 @@ describe('VRF contract', function () { accId, callbackGasLimit, sender, - numWords + numWords, ) const txFulfillRandomWords = await fulfillRandomWords( @@ -691,7 +691,7 @@ describe('VRF contract', function () { unregisteredOracle, pi, rc, - isDirectPayment + isDirectPayment, ) await testCommitmentAfterFulfillment(coordinator.contract, consumer.signer, requestId) @@ -704,7 +704,7 @@ describe('VRF contract', function () { accId, isDirectPayment, accType, - serviceFee + serviceFee, ) }) @@ -718,7 +718,7 @@ describe('VRF contract', function () { account2: oracle, account3: unregisteredOracle, coordinator, - prepayment + prepayment, } = await loadFixture(deploy) // Prepare cordinator @@ -737,7 +737,7 @@ describe('VRF contract', function () { requestNumber, subscriptionPrice, prepayment.signer, - consumer.signer + consumer.signer, ) await addConsumer(prepayment.contract, consumer.signer, accId, consumer.contract.address) @@ -750,10 +750,10 @@ describe('VRF contract', function () { SINGLE_WORD, callbackGasLimit, accId, - accType + accType, ) await expect( - consumer.contract.requestRandomWords(keyHash, accId, callbackGasLimit, SINGLE_WORD) + consumer.contract.requestRandomWords(keyHash, accId, callbackGasLimit, SINGLE_WORD), ).to.be.revertedWithCustomError(coordinator.contract, 'InsufficientPayment') // Deposit 11 $KLAY to account with zero balance @@ -775,7 +775,7 @@ describe('VRF contract', function () { callbackGasLimit, numWords, sender, - isDirectPayment + isDirectPayment, ) await testCommitmentBeforeFulfillment(coordinator.contract, consumer.signer, requestId) @@ -786,7 +786,7 @@ describe('VRF contract', function () { accId, callbackGasLimit, sender, - numWords + numWords, ) const txFulfillRandomWords = await fulfillRandomWords( @@ -795,7 +795,7 @@ describe('VRF contract', function () { unregisteredOracle, pi, rc, - isDirectPayment + isDirectPayment, ) await testCommitmentAfterFulfillment(coordinator.contract, consumer.signer, requestId) @@ -805,7 +805,7 @@ describe('VRF contract', function () { prepayment.contract, requestId, accId, - serviceFee + serviceFee, ) }) @@ -819,7 +819,7 @@ describe('VRF contract', function () { account2: oracle, account3: unregisteredOracle, coordinator, - prepayment + prepayment, } = await loadFixture(deploy) // Prepare cordinator @@ -832,13 +832,13 @@ describe('VRF contract', function () { prepayment.contract, feeRatio, prepayment.signer, - consumer.signer + consumer.signer, ) await addConsumer(prepayment.contract, consumer.signer, accId, consumer.contract.address) const { maxGasLimit: callbackGasLimit, keyHash } = vrfConfig() await expect( - consumer.contract.requestRandomWords(keyHash, accId, callbackGasLimit, SINGLE_WORD) + consumer.contract.requestRandomWords(keyHash, accId, callbackGasLimit, SINGLE_WORD), ).to.be.revertedWithCustomError(coordinator.contract, 'InsufficientPayment') // Deposit 11 $KLAY to account with zero balance @@ -860,7 +860,7 @@ describe('VRF contract', function () { callbackGasLimit, numWords, sender, - isDirectPayment + isDirectPayment, ) await testCommitmentBeforeFulfillment(coordinator.contract, consumer.signer, requestId) @@ -871,7 +871,7 @@ describe('VRF contract', function () { accId, callbackGasLimit, sender, - numWords + numWords, ) const txFulfillRandomWords = await fulfillRandomWords( @@ -880,7 +880,7 @@ describe('VRF contract', function () { unregisteredOracle, pi, rc, - isDirectPayment + isDirectPayment, ) await testCommitmentAfterFulfillment(coordinator.contract, consumer.signer, requestId) @@ -890,7 +890,7 @@ describe('VRF contract', function () { prepayment.contract, requestId, accId, - isDirectPayment + isDirectPayment, ) }) @@ -913,7 +913,7 @@ describe('VRF contract', function () { ).wait() const requestedRandomWordsEvent = coordinator.contract.interface.parseLog( - txRequestRandomWords.events[0] + txRequestRandomWords.events[0], ) expect(requestedRandomWordsEvent.name).to.be.equal('RandomWordsRequested') @@ -1003,7 +1003,7 @@ describe('VRF contract', function () { callbackGasLimit, numWords, sender, - isDirectPayment + isDirectPayment, ) const { pi, rc } = await generateVrf( @@ -1013,7 +1013,7 @@ describe('VRF contract', function () { accId, callbackGasLimit, sender, - numWords + numWords, ) await coordinator.contract.connect(oracle).fulfillRandomWords(pi, rc, isDirectPayment) @@ -1045,12 +1045,12 @@ describe('VRF contract', function () { // Cannot withdraw when pending request exists await expect( - prepayment.contract.connect(consumer.signer).withdraw(accId, amount) + prepayment.contract.connect(consumer.signer).withdraw(accId, amount), ).to.be.revertedWithCustomError(prepayment.contract, 'PendingRequestExists') // Cannot cancel account when pending request exists await expect( - prepayment.contract.connect(consumer.signer).cancelAccount(accId, consumer.signer.address) + prepayment.contract.connect(consumer.signer).cancelAccount(accId, consumer.signer.address), ).to.be.revertedWithCustomError(prepayment.contract, 'PendingRequestExists') // Cancel request @@ -1062,7 +1062,7 @@ describe('VRF contract', function () { prepayment.contract, consumer.signer, accId, - amount + amount, ) expect(oldBalance).to.be.gt(newBalance) expect(newBalance).to.be.equal(0) @@ -1090,7 +1090,7 @@ describe('VRF contract', function () { ).wait() const { preSeed, blockHash, blockNumber, sender, numWords } = parseRandomWordsRequestedTx( coordinator.contract, - txRequest + txRequest, ) const { pi, rc } = await generateVrf( @@ -1100,12 +1100,12 @@ describe('VRF contract', function () { accId, callbackGasLimit, sender, - numWords + numWords, ) const isDirectPayment = false await expect( - coordinator.contract.connect(oracle).fulfillRandomWords(pi, rc, isDirectPayment) + coordinator.contract.connect(oracle).fulfillRandomWords(pi, rc, isDirectPayment), ).to.be.revertedWithCustomError(coordinator.contract, 'IncorrectCommitment') }) @@ -1115,7 +1115,7 @@ describe('VRF contract', function () { consumer, prepayment, account2: oracle, - account3: fakeConsumer + account3: fakeConsumer, } = await loadFixture(deploy) // Prepare coordinator @@ -1131,7 +1131,7 @@ describe('VRF contract', function () { // Request const { keyHash, maxGasLimit: callbackGasLimit } = vrfConfig() await expect( - consumer.contract.requestRandomWords(keyHash, accId, callbackGasLimit, SINGLE_WORD) + consumer.contract.requestRandomWords(keyHash, accId, callbackGasLimit, SINGLE_WORD), ).to.be.revertedWithCustomError(coordinator.contract, 'InvalidConsumer') }) @@ -1152,7 +1152,7 @@ describe('VRF contract', function () { const { keyHash, maxGasLimit } = vrfConfig() const tooBigCallbackGasLimit = maxGasLimit + 1 await expect( - consumer.contract.requestRandomWords(keyHash, accId, tooBigCallbackGasLimit, SINGLE_WORD) + consumer.contract.requestRandomWords(keyHash, accId, tooBigCallbackGasLimit, SINGLE_WORD), ).to.be.revertedWithCustomError(coordinator.contract, 'GasLimitTooBig') }) @@ -1173,7 +1173,7 @@ describe('VRF contract', function () { const { keyHash, maxGasLimit: callbackGasLimit } = vrfConfig() const numWordsOverLimit = (await coordinator.contract.MAX_NUM_WORDS()) + 1 await expect( - consumer.contract.requestRandomWords(keyHash, accId, callbackGasLimit, numWordsOverLimit) + consumer.contract.requestRandomWords(keyHash, accId, callbackGasLimit, numWordsOverLimit), ).to.be.revertedWithCustomError(coordinator.contract, 'NumWordsTooBig') }) @@ -1193,7 +1193,7 @@ describe('VRF contract', function () { consumer.signer, reqCount, numSubmission, - callbackGasLimit + callbackGasLimit, ) { @@ -1208,8 +1208,8 @@ describe('VRF contract', function () { SINGLE_WORD, consumer.signer.address, { - value - } + value, + }, ) { @@ -1234,7 +1234,7 @@ describe('VRF contract', function () { consumer.signer, reqCount, numSubmission, - callbackGasLimit + callbackGasLimit, ) const balanceBefore = await getBalance(consumer.signer.address) @@ -1249,8 +1249,8 @@ describe('VRF contract', function () { SINGLE_WORD, consumer.signer.address, { - value: parseKlay(1) - } + value: parseKlay(1), + }, ) ).wait() @@ -1267,7 +1267,7 @@ describe('VRF contract', function () { { const balance = await getBalance(consumer.signer.address) expect(balanceBefore).to.be.equal( - tx.cumulativeGasUsed.mul(tx.effectiveGasPrice).add(exactFee.add(balance)) + tx.cumulativeGasUsed.mul(tx.effectiveGasPrice).add(exactFee.add(balance)), ) } }) @@ -1278,7 +1278,7 @@ describe('VRF contract', function () { coordinator, prepayment, account2: oracle, - account3: unregisteredOracle + account3: unregisteredOracle, } = await loadFixture(deploy) const { maxGasLimit: callbackGasLimit, keyHash } = vrfConfig() @@ -1295,8 +1295,8 @@ describe('VRF contract', function () { SINGLE_WORD, consumer.signer.address, { - value: parseKlay('1') - } + value: parseKlay('1'), + }, ) ).wait() @@ -1315,7 +1315,7 @@ describe('VRF contract', function () { callbackGasLimit, SINGLE_WORD, // numWords consumer.contract.address, // sender - true // isDirectPayment + true, // isDirectPayment ) // Cancel request diff --git a/contracts/v0.1/test/vrf/VRFCoordinator.utils.cjs b/contracts/v0.1/test/vrf/VRFCoordinator.utils.cjs index d439e0f2d..46ae0bf33 100644 --- a/contracts/v0.1/test/vrf/VRFCoordinator.utils.cjs +++ b/contracts/v0.1/test/vrf/VRFCoordinator.utils.cjs @@ -6,7 +6,7 @@ const VRF = import('@bisonai/orakl-vrf') async function deploy(prepaymentAddress, signer) { let contract = await ethers.getContractFactory('VRFCoordinator', { - signer + signer, }) contract = await contract.deploy(prepaymentAddress) await contract.deployed() @@ -26,12 +26,12 @@ async function generateVrf( accId, callbackGasLimit, sender, - numWords + numWords, ) { const { sk, pk, pkX, pkY, publicProvingKey, keyHash } = vrfConfig() const alpha = remove0x( - ethers.utils.solidityKeccak256(['uint256', 'bytes32'], [preSeed, blockHash]) + ethers.utils.solidityKeccak256(['uint256', 'bytes32'], [preSeed, blockHash]), ) // Simulate off-chain proof generation @@ -41,7 +41,7 @@ async function generateVrf( pk, pkX, pkY, - keyHash + keyHash, }) const pi = [publicProvingKey, proof, preSeed, uPoint, vComponents] @@ -60,7 +60,7 @@ function parseRandomWordsRequestedTx(coordinator, tx) { callbackGasLimit, numWords, sender, - isDirectPayment + isDirectPayment, } = event.args const blockHash = tx.blockHash const blockNumber = tx.blockNumber @@ -75,7 +75,7 @@ function parseRandomWordsRequestedTx(coordinator, tx) { sender, isDirectPayment, blockHash, - blockNumber + blockNumber, } } @@ -99,7 +99,7 @@ async function fulfillRandomWords( callbackGasLimit, sender, isDirectPayment, - numWords + numWords, ) { const { pi, rc } = await generateVrf( preSeed, @@ -108,7 +108,7 @@ async function fulfillRandomWords( accId, callbackGasLimit, sender, - numWords + numWords, ) const tx = await ( @@ -130,7 +130,7 @@ async function computeExactFee( signer, reqCount, numSubmission, - callbackGasLimit + callbackGasLimit, ) { const serviceFee = await coordinatorContract .connect(signer) @@ -148,5 +148,5 @@ module.exports = { parseRandomWordsRequestedTx, parseRandomWordsFulfilledTx, parseRequestCanceledTx, - computeExactFee + computeExactFee, } diff --git a/contracts/v0.1/test/vrf/VRFInternal.test.cjs b/contracts/v0.1/test/vrf/VRFInternal.test.cjs index 8c03d3453..e82447177 100644 --- a/contracts/v0.1/test/vrf/VRFInternal.test.cjs +++ b/contracts/v0.1/test/vrf/VRFInternal.test.cjs @@ -9,7 +9,7 @@ async function deploy() { let { account0: deployer } = await hre.getNamedAccounts() deployer = await ethers.getSigner(deployer) let contract = await ethers.getContractFactory('TestHelperVRFInternals', { - signer: deployer.address + signer: deployer.address, }) contract = await contract.deploy() await contract.deployed() @@ -43,7 +43,7 @@ describe('VRF underlying algorithms: ', () => { test.uPoint.x, test.uPoint.y, test.vPoint.x, - test.vPoint.y + test.vPoint.y, ) expect(res).to.be.equal(test.hash) }) @@ -68,7 +68,7 @@ describe('VRF internal aux. functions: ', () => { test.a2, test.scalar2, test.b1, - test.b2 + test.b2, ) expect(res[0]).to.be.equal(test.output.x) expect(res[1]).to.be.equal(test.output.y) @@ -83,7 +83,7 @@ describe('VRF internal aux. functions: ', () => { test.x, test.y, test.output.x, - test.output.y + test.output.y, ) expect(res).to.be.equal(true) }) @@ -100,7 +100,7 @@ describe('VRF internal aux. functions: ', () => { test.x, test.y, test.output.x, - test.output.y + test.output.y, ) expect(res).to.be.equal(true) }) diff --git a/contracts/v0.1/utils/index.ts b/contracts/v0.1/utils/index.ts index 9492a53b9..223ec9dd5 100644 --- a/contracts/v0.1/utils/index.ts +++ b/contracts/v0.1/utils/index.ts @@ -52,7 +52,7 @@ const readDeployments = async (folderPath: string): Promise => { console.error(`Error parsing JSON file ${file}: ${error.message}`) } } - }) + }), ) } @@ -70,7 +70,7 @@ const _getContractAddressWithTokenPairs = async ( network: string, contractName: string, token_0: string, - token_1: string + token_1: string, ) => { const name = `${contractName}_${token_0.toUpperCase()}-${token_1.toUpperCase()}` return await getContractAddress(network, name) @@ -83,7 +83,7 @@ export const getAggregatorAddress = async (network: string, token_0: string, tok export const getAggregatorProxyAddress = async ( network: string, token_0: string, - token_1: string + token_1: string, ) => { return await _getContractAddressWithTokenPairs(network, 'AggregatorProxy', token_0, token_1) }