From a40b73aac2e731ca0ff12e0b28422defa3238112 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Mon, 16 Aug 2021 12:56:37 +0200 Subject: [PATCH 01/25] linked the label to the checkbox --- apps/remix-ide/src/app/ui/confirmDialog.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/app/ui/confirmDialog.js b/apps/remix-ide/src/app/ui/confirmDialog.js index 7360603a77..8abd11d900 100644 --- a/apps/remix-ide/src/app/ui/confirmDialog.js +++ b/apps/remix-ide/src/app/ui/confirmDialog.js @@ -113,8 +113,8 @@ function confirmDialog (tx, network, amount, gasEstimation, newGasPriceCb, initi
- - + +
` From 567ba0d0a546e7724d39b32e623726a1920fcc20 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 12 Aug 2021 10:49:39 +0200 Subject: [PATCH 02/25] make sure hardhat can be activated when using remixd --- apps/remix-ide/src/app/tabs/compile-tab.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/compile-tab.js b/apps/remix-ide/src/app/tabs/compile-tab.js index 14ca4ae30e..2352e5db9a 100644 --- a/apps/remix-ide/src/app/tabs/compile-tab.js +++ b/apps/remix-ide/src/app/tabs/compile-tab.js @@ -108,13 +108,21 @@ class CompileTab extends ViewPlugin { this.call('editor', 'clearAnnotations') } - this.on('filePanel', 'setWorkspace', (workspace) => { + const resetView = (isLocalhost) => { this.compileTabLogic.isHardhatProject().then((result) => { - if (result && workspace.isLocalhost) this.isHardHatProject = true + if (result && isLocalhost) this.isHardHatProject = true else this.isHardHatProject = false this.renderComponent() }) this.resetResults() + } + + this.on('filePanel', 'setWorkspace', (workspace) => { + resetView(workspace.isLocalhost) + }) + + this.on('remixd', 'rootFolderChanged', () => { + resetView(true) }) this.compileTabLogic.event.on('startingCompilation', this.data.eventHandlers.onStartingCompilation) From e34e6c41d315a302e6d77d9e655d46cee348289a Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 12 Aug 2021 10:49:54 +0200 Subject: [PATCH 03/25] fix solc input params --- libs/remixd/src/services/slitherClient.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/remixd/src/services/slitherClient.ts b/libs/remixd/src/services/slitherClient.ts index a0808d281f..e2d9a281bb 100644 --- a/libs/remixd/src/services/slitherClient.ts +++ b/libs/remixd/src/services/slitherClient.ts @@ -120,9 +120,9 @@ export class SlitherClient extends PluginClient { allowPaths = allowPathString remaps = remapString.trim() } - const allowPathsOption: string = allowPaths ? `--allow-paths ${allowPaths} ` : '' - const optimizeOption: string = optimize ? '--optimize ' : '' - const evmOption: string = evmVersion ? `--evm-version ${evmVersion}` : '' + const allowPathsOption: string = allowPaths ? `--allow-paths ${allowPaths}` : '' + const optimizeOption: string = optimize ? ' --optimize ' : '' + const evmOption: string = evmVersion ? ` --evm-version ${evmVersion}` : '' const solcArgs: string = optimizeOption || evmOption || allowPathsOption ? `--solc-args '${allowPathsOption}${optimizeOption}${evmOption}'` : '' const solcRemaps = remaps ? `--solc-remaps "${remaps}"` : '' From cf9805042929ef2ac8d5ee2ba4bc68ad5da0364c Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 12 Aug 2021 14:50:15 +0200 Subject: [PATCH 04/25] solc fix input params --- libs/remixd/src/services/slitherClient.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/libs/remixd/src/services/slitherClient.ts b/libs/remixd/src/services/slitherClient.ts index e2d9a281bb..7eb7cf3806 100644 --- a/libs/remixd/src/services/slitherClient.ts +++ b/libs/remixd/src/services/slitherClient.ts @@ -123,7 +123,19 @@ export class SlitherClient extends PluginClient { const allowPathsOption: string = allowPaths ? `--allow-paths ${allowPaths}` : '' const optimizeOption: string = optimize ? ' --optimize ' : '' const evmOption: string = evmVersion ? ` --evm-version ${evmVersion}` : '' - const solcArgs: string = optimizeOption || evmOption || allowPathsOption ? `--solc-args '${allowPathsOption}${optimizeOption}${evmOption}'` : '' + let solcArgs = '' + if (optimizeOption) { + solcArgs += ' ' + optimizeOption + } + if (evmOption) { + solcArgs += ' ' + evmOption + } + if (allowPathsOption) { + solcArgs += ' ' + allowPathsOption + } + if (solcArgs) { + solcArgs = `--solc-args "${solcArgs.trim()}"` + } const solcRemaps = remaps ? `--solc-remaps "${remaps}"` : '' const outputFile: string = 'remix-slitherReport_' + Math.floor(Date.now() / 1000) + '.json' From fc53e4fdf82d068d9ab2b340845460a875fe35eb Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 16 Aug 2021 11:10:01 +0200 Subject: [PATCH 05/25] linting --- libs/remixd/src/services/slitherClient.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/remixd/src/services/slitherClient.ts b/libs/remixd/src/services/slitherClient.ts index 7eb7cf3806..513be66f7e 100644 --- a/libs/remixd/src/services/slitherClient.ts +++ b/libs/remixd/src/services/slitherClient.ts @@ -125,16 +125,16 @@ export class SlitherClient extends PluginClient { const evmOption: string = evmVersion ? ` --evm-version ${evmVersion}` : '' let solcArgs = '' if (optimizeOption) { - solcArgs += ' ' + optimizeOption + solcArgs += ' ' + optimizeOption } if (evmOption) { - solcArgs += ' ' + evmOption + solcArgs += ' ' + evmOption } if (allowPathsOption) { - solcArgs += ' ' + allowPathsOption + solcArgs += ' ' + allowPathsOption } if (solcArgs) { - solcArgs = `--solc-args "${solcArgs.trim()}"` + solcArgs = `--solc-args "${solcArgs.trim()}"` } const solcRemaps = remaps ? `--solc-remaps "${remaps}"` : '' From e1787787faeeed41bf64edec619ba7c98c0aba29 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 16 Aug 2021 13:27:18 +0200 Subject: [PATCH 06/25] fix slither arguments --- libs/remixd/src/services/slitherClient.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/libs/remixd/src/services/slitherClient.ts b/libs/remixd/src/services/slitherClient.ts index 513be66f7e..3c56e4e807 100644 --- a/libs/remixd/src/services/slitherClient.ts +++ b/libs/remixd/src/services/slitherClient.ts @@ -121,24 +121,26 @@ export class SlitherClient extends PluginClient { remaps = remapString.trim() } const allowPathsOption: string = allowPaths ? `--allow-paths ${allowPaths}` : '' - const optimizeOption: string = optimize ? ' --optimize ' : '' - const evmOption: string = evmVersion ? ` --evm-version ${evmVersion}` : '' + const optimizeOption: string = optimize ? '--optimize' : '' + const evmOption: string = evmVersion ? `--evm-version ${evmVersion}` : '' let solcArgs = '' + if (allowPathsOption) { + if (!solcArgs.endsWith(' ')) solcArgs += ' ' + solcArgs += allowPathsOption; + } if (optimizeOption) { - solcArgs += ' ' + optimizeOption + solcArgs += optimizeOption; } if (evmOption) { - solcArgs += ' ' + evmOption - } - if (allowPathsOption) { - solcArgs += ' ' + allowPathsOption + if (!solcArgs.endsWith(' ')) solcArgs += ' ' + solcArgs += evmOption; } if (solcArgs) { - solcArgs = `--solc-args "${solcArgs.trim()}"` + solcArgs = `--solc-args "${solcArgs.trim()}"`; } const solcRemaps = remaps ? `--solc-remaps "${remaps}"` : '' - const outputFile: string = 'remix-slitherReport_' + Math.floor(Date.now() / 1000) + '.json' + const outputFile: string = 'remix-slitherReport.json' const cmd: string = `slither ${filePath} ${solcArgs} ${solcRemaps} --json ${outputFile}` console.log('\x1b[32m%s\x1b[0m', '[Slither Analysis]: Running Slither...') // Added `stdio: 'ignore'` as for contract with NPM imports analysis which is exported in 'stderr' From f74b2bdbaee419349ce2a3eb5fd467d3b0350a92 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 16 Aug 2021 17:16:27 +0200 Subject: [PATCH 07/25] remove allow-paths & fix slither arguments --- libs/remixd/src/services/slitherClient.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/libs/remixd/src/services/slitherClient.ts b/libs/remixd/src/services/slitherClient.ts index 3c56e4e807..3b26441694 100644 --- a/libs/remixd/src/services/slitherClient.ts +++ b/libs/remixd/src/services/slitherClient.ts @@ -120,29 +120,25 @@ export class SlitherClient extends PluginClient { allowPaths = allowPathString remaps = remapString.trim() } - const allowPathsOption: string = allowPaths ? `--allow-paths ${allowPaths}` : '' const optimizeOption: string = optimize ? '--optimize' : '' const evmOption: string = evmVersion ? `--evm-version ${evmVersion}` : '' let solcArgs = '' - if (allowPathsOption) { - if (!solcArgs.endsWith(' ')) solcArgs += ' ' - solcArgs += allowPathsOption; - } if (optimizeOption) { - solcArgs += optimizeOption; + solcArgs += optimizeOption + ' ' } if (evmOption) { if (!solcArgs.endsWith(' ')) solcArgs += ' ' solcArgs += evmOption; } if (solcArgs) { - solcArgs = `--solc-args "${solcArgs.trim()}"`; + solcArgs = `--solc-args "${solcArgs.trimStart()}"`; } const solcRemaps = remaps ? `--solc-remaps "${remaps}"` : '' - const outputFile: string = 'remix-slitherReport.json' + const outputFile: string = 'remix-slitherReport_' + Math.floor(Date.now() / 1000) + '.json' const cmd: string = `slither ${filePath} ${solcArgs} ${solcRemaps} --json ${outputFile}` console.log('\x1b[32m%s\x1b[0m', '[Slither Analysis]: Running Slither...') + console.log(cmd) // Added `stdio: 'ignore'` as for contract with NPM imports analysis which is exported in 'stderr' // get too big and hangs the process. We process analysis from the report file only const child = spawn(cmd, { cwd: this.currentSharedFolder, shell: true, stdio: 'ignore' }) From 91da1ef02f0d373dab15bbdf661ce10289bb2119 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 16 Aug 2021 17:35:48 +0200 Subject: [PATCH 08/25] remove json report --- libs/remixd/src/services/slitherClient.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/remixd/src/services/slitherClient.ts b/libs/remixd/src/services/slitherClient.ts index 3b26441694..bbd84c0066 100644 --- a/libs/remixd/src/services/slitherClient.ts +++ b/libs/remixd/src/services/slitherClient.ts @@ -4,7 +4,7 @@ import * as WS from 'ws' // eslint-disable-line import { PluginClient } from '@remixproject/plugin' import { existsSync, readFileSync, readdirSync } from 'fs' import { OutputStandard } from '../types' // eslint-disable-line -const { spawn, execSync } = require('child_process') +const { spawn, execSync, unlink } = require('child_process') export class SlitherClient extends PluginClient { methods: Array @@ -150,6 +150,9 @@ export class SlitherClient extends PluginClient { if (existsSync(outputFileAbsPath)) { let report = readFileSync(outputFileAbsPath, 'utf8') report = JSON.parse(report) + try { + unlink(outputFileAbsPath) + } catch (e) {} if (report['success']) { response['status'] = true if (!report['results'] || !report['results'].detectors || !report['results'].detectors.length) { From 02effc55c12249d7c9017c01e2a02dbb8f5b7f46 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 16 Aug 2021 17:46:13 +0200 Subject: [PATCH 09/25] fix deleting reports --- libs/remixd/src/services/slitherClient.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libs/remixd/src/services/slitherClient.ts b/libs/remixd/src/services/slitherClient.ts index bbd84c0066..c4867e598c 100644 --- a/libs/remixd/src/services/slitherClient.ts +++ b/libs/remixd/src/services/slitherClient.ts @@ -2,9 +2,9 @@ import * as WS from 'ws' // eslint-disable-line import { PluginClient } from '@remixproject/plugin' -import { existsSync, readFileSync, readdirSync } from 'fs' +import { existsSync, readFileSync, readdirSync, unlink } from 'fs' import { OutputStandard } from '../types' // eslint-disable-line -const { spawn, execSync, unlink } = require('child_process') +const { spawn, execSync } = require('child_process') export class SlitherClient extends PluginClient { methods: Array @@ -151,8 +151,12 @@ export class SlitherClient extends PluginClient { let report = readFileSync(outputFileAbsPath, 'utf8') report = JSON.parse(report) try { - unlink(outputFileAbsPath) - } catch (e) {} + unlink(outputFileAbsPath, (err) => { + console.log(err) + }) + } catch (e) { + console.log(e) + } if (report['success']) { response['status'] = true if (!report['results'] || !report['results'].detectors || !report['results'].detectors.length) { From 55479309db8da22542cbcb0030575b94cfc4918a Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 16 Aug 2021 17:55:30 +0200 Subject: [PATCH 10/25] linting --- libs/remixd/src/services/slitherClient.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libs/remixd/src/services/slitherClient.ts b/libs/remixd/src/services/slitherClient.ts index c4867e598c..2399dabe61 100644 --- a/libs/remixd/src/services/slitherClient.ts +++ b/libs/remixd/src/services/slitherClient.ts @@ -114,24 +114,23 @@ export class SlitherClient extends PluginClient { // Allow paths and set solc remapping for import URLs const fileContent = readFileSync(`${this.currentSharedFolder}/${filePath}`, 'utf8') const importsArr = fileContent.match(/import ['"][^.|..](.+?)['"];/g) - let allowPaths = ''; let remaps = '' + let remaps = '' if (importsArr?.length) { - const { remapString, allowPathString } = this.mapNpmDepsDir(importsArr) - allowPaths = allowPathString + const { remapString } = this.mapNpmDepsDir(importsArr) remaps = remapString.trim() } const optimizeOption: string = optimize ? '--optimize' : '' const evmOption: string = evmVersion ? `--evm-version ${evmVersion}` : '' let solcArgs = '' if (optimizeOption) { - solcArgs += optimizeOption + ' ' + solcArgs += optimizeOption + ' ' } if (evmOption) { - if (!solcArgs.endsWith(' ')) solcArgs += ' ' - solcArgs += evmOption; + if (!solcArgs.endsWith(' ')) solcArgs += ' ' + solcArgs += evmOption } if (solcArgs) { - solcArgs = `--solc-args "${solcArgs.trimStart()}"`; + solcArgs = `--solc-args "${solcArgs.trimStart()}"` } const solcRemaps = remaps ? `--solc-remaps "${remaps}"` : '' From 59ade707d5057db77ba721e2ab64857399a35b05 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 18 Aug 2021 10:22:31 +0200 Subject: [PATCH 11/25] catch and log --- libs/remixd/src/services/slitherClient.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/libs/remixd/src/services/slitherClient.ts b/libs/remixd/src/services/slitherClient.ts index 2399dabe61..09c256be08 100644 --- a/libs/remixd/src/services/slitherClient.ts +++ b/libs/remixd/src/services/slitherClient.ts @@ -149,13 +149,9 @@ export class SlitherClient extends PluginClient { if (existsSync(outputFileAbsPath)) { let report = readFileSync(outputFileAbsPath, 'utf8') report = JSON.parse(report) - try { - unlink(outputFileAbsPath, (err) => { - console.log(err) - }) - } catch (e) { - console.log(e) - } + unlink(outputFileAbsPath, (err) => { + if (err) console.log(err) + }) if (report['success']) { response['status'] = true if (!report['results'] || !report['results'].detectors || !report['results'].detectors.length) { From 7a852929759293d357235a6f5659ae509d901824 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 19 Aug 2021 11:36:08 +0200 Subject: [PATCH 12/25] pass receipt --- apps/remix-ide/src/blockchain/blockchain.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/blockchain/blockchain.js b/apps/remix-ide/src/blockchain/blockchain.js index 5a87cb6ad1..ff5494ff55 100644 --- a/apps/remix-ide/src/blockchain/blockchain.js +++ b/apps/remix-ide/src/blockchain/blockchain.js @@ -323,8 +323,8 @@ class Blockchain extends Plugin { // TODO : event should be triggered by Udapp instead of TxListener /** Listen on New Transaction. (Cannot be done inside constructor because txlistener doesn't exist yet) */ startListening (txlistener) { - txlistener.event.register('newTransaction', (tx) => { - this.events.emit('newTransaction', tx) + txlistener.event.register('newTransaction', (tx, receipt) => { + this.events.emit('newTransaction', tx, receipt) }) } From dbb71b172cf6282ef095ee41d33912204c91e362 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 18 Aug 2021 13:43:08 +0530 Subject: [PATCH 13/25] hhlogs in unit testing plugin --- apps/remix-ide/src/app/tabs/test-tab.js | 1 + libs/remix-tests/src/runTestSources.ts | 5 +- libs/remix-tests/src/testRunner.ts | 98 +++++++++++++------------ libs/remix-tests/src/types.ts | 1 + 4 files changed, 56 insertions(+), 49 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/test-tab.js b/apps/remix-ide/src/app/tabs/test-tab.js index 83665e8ed5..9dc3de4dad 100644 --- a/apps/remix-ide/src/app/tabs/test-tab.js +++ b/apps/remix-ide/src/app/tabs/test-tab.js @@ -180,6 +180,7 @@ module.exports = class TestTab extends ViewPlugin { } testCallback (result, runningTests) { + console.log('result in testCallback', result) this.testsOutput.hidden = false if (result.type === 'contract') { this.testSuite = result.value diff --git a/libs/remix-tests/src/runTestSources.ts b/libs/remix-tests/src/runTestSources.ts index adc9be14b0..1393148272 100644 --- a/libs/remix-tests/src/runTestSources.ts +++ b/libs/remix-tests/src/runTestSources.ts @@ -5,7 +5,7 @@ import { deployAll } from './deployer' import { runTest } from './testRunner' import Web3 from 'web3' -import { Provider } from '@remix-project/remix-simulator' +import { Provider, extend } from '@remix-project/remix-simulator' import { FinalResult, SrcIfc, compilationInterface, ASTInterface, Options, TestResultInterface, AstNode, CompilerConfiguration @@ -17,6 +17,7 @@ const createWeb3Provider = async function () { const provider: any = new Provider() await provider.init() web3.setProvider(provider) + extend(web3) return web3 } @@ -102,7 +103,7 @@ export async function runTestSources (contractSources: SrcIfc, compilerConfig: C async.eachOfLimit(contractsToTest, 1, (contractName: string, index: string | number, cb: ErrorCallback) => { const fileAST: AstNode = sourceASTs[contracts[contractName]['filename']] - runTest(contractName, contracts[contractName], contractsToTestDetails[index], fileAST, { accounts }, _testCallback, (err, result) => { + runTest(contractName, contracts[contractName], contractsToTestDetails[index], fileAST, { accounts, web3 }, _testCallback, (err, result) => { if (err) { return cb(err) } diff --git a/libs/remix-tests/src/testRunner.ts b/libs/remix-tests/src/testRunner.ts index 66efa143fe..d51c7dcc7d 100644 --- a/libs/remix-tests/src/testRunner.ts +++ b/libs/remix-tests/src/testRunner.ts @@ -217,7 +217,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com const isJSONInterfaceAvailable = testObject && testObject.options && testObject.options.jsonInterface if (!isJSONInterfaceAvailable) { return resultsCallback(new Error('Contract interface not available'), { passingNum, failureNum, timePassed }) } const runList: RunListInterface[] = createRunList(testObject.options.jsonInterface, fileAST, testName) - const web3 = new Web3() + const web3 = opts.web3 || new Web3() const accts: TestResultInterface = { type: 'accountList', value: opts.accounts @@ -284,59 +284,63 @@ export function runTest (testName: string, testObject: any, contractDetails: Com sendParams.gas = 10000000 * 8 method.send(sendParams).on('receipt', (receipt) => { try { - const time: number = (Date.now() - startTime) / 1000.0 - const assertionEventHashes = assertionEvents.map(e => Web3.utils.sha3(e.name + '(' + e.params.join() + ')')) - let testPassed = false - for (const i in receipt.events) { - let events = receipt.events[i] - if (!Array.isArray(events)) events = [events] - for (const event of events) { - const eIndex = assertionEventHashes.indexOf(event.raw.topics[0]) // event name topic will always be at index 0 - if (eIndex >= 0) { - const testEvent = web3.eth.abi.decodeParameters(assertionEvents[eIndex].params, event.raw.data) - if (!testEvent[0]) { - const assertMethod = testEvent[2] - if (assertMethod === 'ok') { // for 'Assert.ok' method - testEvent[3] = 'false' - testEvent[4] = 'true' + web3.eth.getHHLogsForTx(receipt.transactionHash).then((hhLogs) => { + const time: number = (Date.now() - startTime) / 1000.0 + const assertionEventHashes = assertionEvents.map(e => Web3.utils.sha3(e.name + '(' + e.params.join() + ')')) + let testPassed = false + for (const i in receipt.events) { + let events = receipt.events[i] + if (!Array.isArray(events)) events = [events] + for (const event of events) { + const eIndex = assertionEventHashes.indexOf(event.raw.topics[0]) // event name topic will always be at index 0 + if (eIndex >= 0) { + const testEvent = web3.eth.abi.decodeParameters(assertionEvents[eIndex].params, event.raw.data) + if (!testEvent[0]) { + const assertMethod = testEvent[2] + if (assertMethod === 'ok') { // for 'Assert.ok' method + testEvent[3] = 'false' + testEvent[4] = 'true' + } + const location = getAssertMethodLocation(fileAST, testName, func.name, assertMethod) + const resp: TestResultInterface = { + type: 'testFailure', + value: changeCase.sentenceCase(func.name), + filename: testObject.filename, + time: time, + errMsg: testEvent[1], + context: testName, + assertMethod, + returned: testEvent[3], + expected: testEvent[4], + location, + hhLogs + } + testCallback(undefined, resp) + failureNum += 1 + timePassed += time + return next() } - const location = getAssertMethodLocation(fileAST, testName, func.name, assertMethod) - const resp: TestResultInterface = { - type: 'testFailure', - value: changeCase.sentenceCase(func.name), - filename: testObject.filename, - time: time, - errMsg: testEvent[1], - context: testName, - assertMethod, - returned: testEvent[3], - expected: testEvent[4], - location - } - testCallback(undefined, resp) - failureNum += 1 - timePassed += time - return next() + testPassed = true } - testPassed = true } } - } - if (testPassed) { - const resp: TestResultInterface = { - type: 'testPass', - value: changeCase.sentenceCase(func.name), - filename: testObject.filename, - time: time, - context: testName + if (testPassed) { + const resp: TestResultInterface = { + type: 'testPass', + value: changeCase.sentenceCase(func.name), + filename: testObject.filename, + time: time, + context: testName, + hhLogs + } + testCallback(undefined, resp) + passingNum += 1 + timePassed += time } - testCallback(undefined, resp) - passingNum += 1 - timePassed += time - } - return next() + return next() + }) } catch (err) { console.error(err) return next(err) diff --git a/libs/remix-tests/src/types.ts b/libs/remix-tests/src/types.ts index 197d929192..649ee921df 100644 --- a/libs/remix-tests/src/types.ts +++ b/libs/remix-tests/src/types.ts @@ -36,6 +36,7 @@ export interface TestResultInterface { returned?: string | number expected?: string | number location?: string + hhLogs?: [] } export interface TestCbInterface { (error: Error | null | undefined, result: TestResultInterface) : void; From ece75953dc5d118750ef3e6eaca092e7ec9fec40 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 18 Aug 2021 14:32:43 +0530 Subject: [PATCH 14/25] tests fixed --- libs/remix-tests/src/testRunner.ts | 102 ++++++++++++++--------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/libs/remix-tests/src/testRunner.ts b/libs/remix-tests/src/testRunner.ts index d51c7dcc7d..1fc708a97c 100644 --- a/libs/remix-tests/src/testRunner.ts +++ b/libs/remix-tests/src/testRunner.ts @@ -282,65 +282,65 @@ export function runTest (testName: string, testObject: any, contractDetails: Com } if (!sendParams) sendParams = {} sendParams.gas = 10000000 * 8 - method.send(sendParams).on('receipt', (receipt) => { + method.send(sendParams).on('receipt', async (receipt) => { try { - web3.eth.getHHLogsForTx(receipt.transactionHash).then((hhLogs) => { - const time: number = (Date.now() - startTime) / 1000.0 - const assertionEventHashes = assertionEvents.map(e => Web3.utils.sha3(e.name + '(' + e.params.join() + ')')) - let testPassed = false - for (const i in receipt.events) { - let events = receipt.events[i] - if (!Array.isArray(events)) events = [events] - for (const event of events) { - const eIndex = assertionEventHashes.indexOf(event.raw.topics[0]) // event name topic will always be at index 0 - if (eIndex >= 0) { - const testEvent = web3.eth.abi.decodeParameters(assertionEvents[eIndex].params, event.raw.data) - if (!testEvent[0]) { - const assertMethod = testEvent[2] - if (assertMethod === 'ok') { // for 'Assert.ok' method - testEvent[3] = 'false' - testEvent[4] = 'true' - } - const location = getAssertMethodLocation(fileAST, testName, func.name, assertMethod) - const resp: TestResultInterface = { - type: 'testFailure', - value: changeCase.sentenceCase(func.name), - filename: testObject.filename, - time: time, - errMsg: testEvent[1], - context: testName, - assertMethod, - returned: testEvent[3], - expected: testEvent[4], - location, - hhLogs - } - testCallback(undefined, resp) - failureNum += 1 - timePassed += time - return next() + let hhLogs + if (web3.eth && web3.eth.getHHLogsForTx) hhLogs = await web3.eth.getHHLogsForTx(receipt.transactionHash) + const time: number = (Date.now() - startTime) / 1000.0 + const assertionEventHashes = assertionEvents.map(e => Web3.utils.sha3(e.name + '(' + e.params.join() + ')')) + let testPassed = false + for (const i in receipt.events) { + let events = receipt.events[i] + if (!Array.isArray(events)) events = [events] + for (const event of events) { + const eIndex = assertionEventHashes.indexOf(event.raw.topics[0]) // event name topic will always be at index 0 + if (eIndex >= 0) { + const testEvent = web3.eth.abi.decodeParameters(assertionEvents[eIndex].params, event.raw.data) + if (!testEvent[0]) { + const assertMethod = testEvent[2] + if (assertMethod === 'ok') { // for 'Assert.ok' method + testEvent[3] = 'false' + testEvent[4] = 'true' } - testPassed = true + const location = getAssertMethodLocation(fileAST, testName, func.name, assertMethod) + const resp: TestResultInterface = { + type: 'testFailure', + value: changeCase.sentenceCase(func.name), + filename: testObject.filename, + time: time, + errMsg: testEvent[1], + context: testName, + assertMethod, + returned: testEvent[3], + expected: testEvent[4], + location, + } + if (hhLogs) resp.hhLogs = hhLogs + testCallback(undefined, resp) + failureNum += 1 + timePassed += time + return next() } + testPassed = true } } + } - if (testPassed) { - const resp: TestResultInterface = { - type: 'testPass', - value: changeCase.sentenceCase(func.name), - filename: testObject.filename, - time: time, - context: testName, - hhLogs - } - testCallback(undefined, resp) - passingNum += 1 - timePassed += time + if (testPassed) { + const resp: TestResultInterface = { + type: 'testPass', + value: changeCase.sentenceCase(func.name), + filename: testObject.filename, + time: time, + context: testName, } + if (hhLogs) resp.hhLogs = hhLogs + testCallback(undefined, resp) + passingNum += 1 + timePassed += time + } - return next() - }) + return next() } catch (err) { console.error(err) return next(err) From b3112d6d25ecd897a5375f1f62ac2c009ead18d0 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 18 Aug 2021 14:34:02 +0530 Subject: [PATCH 15/25] linting fix --- libs/remix-tests/src/testRunner.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/remix-tests/src/testRunner.ts b/libs/remix-tests/src/testRunner.ts index 1fc708a97c..47b44d708b 100644 --- a/libs/remix-tests/src/testRunner.ts +++ b/libs/remix-tests/src/testRunner.ts @@ -313,7 +313,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com assertMethod, returned: testEvent[3], expected: testEvent[4], - location, + location } if (hhLogs) resp.hhLogs = hhLogs testCallback(undefined, resp) @@ -332,7 +332,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com value: changeCase.sentenceCase(func.name), filename: testObject.filename, time: time, - context: testName, + context: testName } if (hhLogs) resp.hhLogs = hhLogs testCallback(undefined, resp) From b9d36b4997868dc84e40acc6d7cbf0aaae2b860a Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 18 Aug 2021 19:09:51 +0530 Subject: [PATCH 16/25] unit tests for hhLogs --- .../tests/examples_0/assert_ok_test.sol | 5 + .../tests/examples_0/hardhat/console.sol | 1532 +++++++++++++++++ libs/remix-tests/tests/testRunner.spec.ts | 47 +- 3 files changed, 1566 insertions(+), 18 deletions(-) create mode 100644 libs/remix-tests/tests/examples_0/hardhat/console.sol diff --git a/libs/remix-tests/tests/examples_0/assert_ok_test.sol b/libs/remix-tests/tests/examples_0/assert_ok_test.sol index 030552b16a..04af584e63 100644 --- a/libs/remix-tests/tests/examples_0/assert_ok_test.sol +++ b/libs/remix-tests/tests/examples_0/assert_ok_test.sol @@ -1,12 +1,17 @@ import "remix_tests.sol"; // this import is automatically injected by Remix. + +import "./hardhat/console.sol"; + contract AssertOkTest { function okPassTest() public { + console.log("AssertOkTest", "okPassTest"); Assert.ok(true, "okPassTest passes"); } function okFailTest() public { + console.log("AssertOkTest", "okFailTest"); Assert.ok(false, "okFailTest fails"); } } \ No newline at end of file diff --git a/libs/remix-tests/tests/examples_0/hardhat/console.sol b/libs/remix-tests/tests/examples_0/hardhat/console.sol new file mode 100644 index 0000000000..d65e3b412e --- /dev/null +++ b/libs/remix-tests/tests/examples_0/hardhat/console.sol @@ -0,0 +1,1532 @@ +// SPDX-License-Identifier: MIT +pragma solidity >= 0.4.22 <0.9.0; + +library console { + address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67); + + function _sendLogPayload(bytes memory payload) private view { + uint256 payloadLength = payload.length; + address consoleAddress = CONSOLE_ADDRESS; + assembly { + let payloadStart := add(payload, 32) + let r := staticcall(gas(), consoleAddress, payloadStart, payloadLength, 0, 0) + } + } + + function log() internal view { + _sendLogPayload(abi.encodeWithSignature("log()")); + } + + function logInt(int p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(int)", p0)); + } + + function logUint(uint p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint)", p0)); + } + + function logString(string memory p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); + } + + function logBool(bool p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); + } + + function logAddress(address p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); + } + + function logBytes(bytes memory p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes)", p0)); + } + + function logBytes1(bytes1 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes1)", p0)); + } + + function logBytes2(bytes2 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes2)", p0)); + } + + function logBytes3(bytes3 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes3)", p0)); + } + + function logBytes4(bytes4 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes4)", p0)); + } + + function logBytes5(bytes5 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes5)", p0)); + } + + function logBytes6(bytes6 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes6)", p0)); + } + + function logBytes7(bytes7 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes7)", p0)); + } + + function logBytes8(bytes8 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes8)", p0)); + } + + function logBytes9(bytes9 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes9)", p0)); + } + + function logBytes10(bytes10 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes10)", p0)); + } + + function logBytes11(bytes11 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes11)", p0)); + } + + function logBytes12(bytes12 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes12)", p0)); + } + + function logBytes13(bytes13 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes13)", p0)); + } + + function logBytes14(bytes14 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes14)", p0)); + } + + function logBytes15(bytes15 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes15)", p0)); + } + + function logBytes16(bytes16 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes16)", p0)); + } + + function logBytes17(bytes17 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes17)", p0)); + } + + function logBytes18(bytes18 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes18)", p0)); + } + + function logBytes19(bytes19 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes19)", p0)); + } + + function logBytes20(bytes20 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes20)", p0)); + } + + function logBytes21(bytes21 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes21)", p0)); + } + + function logBytes22(bytes22 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes22)", p0)); + } + + function logBytes23(bytes23 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes23)", p0)); + } + + function logBytes24(bytes24 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes24)", p0)); + } + + function logBytes25(bytes25 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes25)", p0)); + } + + function logBytes26(bytes26 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes26)", p0)); + } + + function logBytes27(bytes27 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes27)", p0)); + } + + function logBytes28(bytes28 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes28)", p0)); + } + + function logBytes29(bytes29 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes29)", p0)); + } + + function logBytes30(bytes30 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes30)", p0)); + } + + function logBytes31(bytes31 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes31)", p0)); + } + + function logBytes32(bytes32 p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bytes32)", p0)); + } + + function log(uint p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint)", p0)); + } + + function log(string memory p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); + } + + function log(bool p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); + } + + function log(address p0) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); + } + + function log(uint p0, uint p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint)", p0, p1)); + } + + function log(uint p0, string memory p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string)", p0, p1)); + } + + function log(uint p0, bool p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool)", p0, p1)); + } + + function log(uint p0, address p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address)", p0, p1)); + } + + function log(string memory p0, uint p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint)", p0, p1)); + } + + function log(string memory p0, string memory p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string)", p0, p1)); + } + + function log(string memory p0, bool p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool)", p0, p1)); + } + + function log(string memory p0, address p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address)", p0, p1)); + } + + function log(bool p0, uint p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint)", p0, p1)); + } + + function log(bool p0, string memory p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string)", p0, p1)); + } + + function log(bool p0, bool p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool)", p0, p1)); + } + + function log(bool p0, address p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address)", p0, p1)); + } + + function log(address p0, uint p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint)", p0, p1)); + } + + function log(address p0, string memory p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string)", p0, p1)); + } + + function log(address p0, bool p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool)", p0, p1)); + } + + function log(address p0, address p1) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address)", p0, p1)); + } + + function log(uint p0, uint p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint)", p0, p1, p2)); + } + + function log(uint p0, uint p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string)", p0, p1, p2)); + } + + function log(uint p0, uint p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool)", p0, p1, p2)); + } + + function log(uint p0, uint p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address)", p0, p1, p2)); + } + + function log(uint p0, string memory p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint)", p0, p1, p2)); + } + + function log(uint p0, string memory p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,string)", p0, p1, p2)); + } + + function log(uint p0, string memory p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool)", p0, p1, p2)); + } + + function log(uint p0, string memory p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,address)", p0, p1, p2)); + } + + function log(uint p0, bool p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint)", p0, p1, p2)); + } + + function log(uint p0, bool p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string)", p0, p1, p2)); + } + + function log(uint p0, bool p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool)", p0, p1, p2)); + } + + function log(uint p0, bool p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address)", p0, p1, p2)); + } + + function log(uint p0, address p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint)", p0, p1, p2)); + } + + function log(uint p0, address p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,string)", p0, p1, p2)); + } + + function log(uint p0, address p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool)", p0, p1, p2)); + } + + function log(uint p0, address p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,address)", p0, p1, p2)); + } + + function log(string memory p0, uint p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint)", p0, p1, p2)); + } + + function log(string memory p0, uint p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,string)", p0, p1, p2)); + } + + function log(string memory p0, uint p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool)", p0, p1, p2)); + } + + function log(string memory p0, uint p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,address)", p0, p1, p2)); + } + + function log(string memory p0, string memory p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,uint)", p0, p1, p2)); + } + + function log(string memory p0, string memory p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,string)", p0, p1, p2)); + } + + function log(string memory p0, string memory p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,bool)", p0, p1, p2)); + } + + function log(string memory p0, string memory p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,address)", p0, p1, p2)); + } + + function log(string memory p0, bool p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint)", p0, p1, p2)); + } + + function log(string memory p0, bool p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,string)", p0, p1, p2)); + } + + function log(string memory p0, bool p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool)", p0, p1, p2)); + } + + function log(string memory p0, bool p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,address)", p0, p1, p2)); + } + + function log(string memory p0, address p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,uint)", p0, p1, p2)); + } + + function log(string memory p0, address p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,string)", p0, p1, p2)); + } + + function log(string memory p0, address p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,bool)", p0, p1, p2)); + } + + function log(string memory p0, address p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,address)", p0, p1, p2)); + } + + function log(bool p0, uint p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint)", p0, p1, p2)); + } + + function log(bool p0, uint p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string)", p0, p1, p2)); + } + + function log(bool p0, uint p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool)", p0, p1, p2)); + } + + function log(bool p0, uint p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address)", p0, p1, p2)); + } + + function log(bool p0, string memory p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint)", p0, p1, p2)); + } + + function log(bool p0, string memory p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,string)", p0, p1, p2)); + } + + function log(bool p0, string memory p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool)", p0, p1, p2)); + } + + function log(bool p0, string memory p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,address)", p0, p1, p2)); + } + + function log(bool p0, bool p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint)", p0, p1, p2)); + } + + function log(bool p0, bool p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string)", p0, p1, p2)); + } + + function log(bool p0, bool p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool)", p0, p1, p2)); + } + + function log(bool p0, bool p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address)", p0, p1, p2)); + } + + function log(bool p0, address p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint)", p0, p1, p2)); + } + + function log(bool p0, address p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,string)", p0, p1, p2)); + } + + function log(bool p0, address p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool)", p0, p1, p2)); + } + + function log(bool p0, address p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,address)", p0, p1, p2)); + } + + function log(address p0, uint p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint)", p0, p1, p2)); + } + + function log(address p0, uint p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,string)", p0, p1, p2)); + } + + function log(address p0, uint p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool)", p0, p1, p2)); + } + + function log(address p0, uint p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,address)", p0, p1, p2)); + } + + function log(address p0, string memory p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,uint)", p0, p1, p2)); + } + + function log(address p0, string memory p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,string)", p0, p1, p2)); + } + + function log(address p0, string memory p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,bool)", p0, p1, p2)); + } + + function log(address p0, string memory p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,address)", p0, p1, p2)); + } + + function log(address p0, bool p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint)", p0, p1, p2)); + } + + function log(address p0, bool p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,string)", p0, p1, p2)); + } + + function log(address p0, bool p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool)", p0, p1, p2)); + } + + function log(address p0, bool p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,address)", p0, p1, p2)); + } + + function log(address p0, address p1, uint p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,uint)", p0, p1, p2)); + } + + function log(address p0, address p1, string memory p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,string)", p0, p1, p2)); + } + + function log(address p0, address p1, bool p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,bool)", p0, p1, p2)); + } + + function log(address p0, address p1, address p2) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,address)", p0, p1, p2)); + } + + function log(uint p0, uint p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,string)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,address)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,string)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,address)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,string)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,address)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,string)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, uint p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,address)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,string)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,address)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,string)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,address)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,string)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,address)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,string)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, string memory p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,address)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,string)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,address)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,string)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,address)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,string)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,address)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,string)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, bool p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,address)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,string)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,address)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,string)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,address)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,string)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,address)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,uint)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,string)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,bool)", p0, p1, p2, p3)); + } + + function log(uint p0, address p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, uint p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,string,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,string,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,string,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,string,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,address,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,address,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,address,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, string memory p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,string,address,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, bool p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,string,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,string,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,string,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,string,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,address)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,address,uint)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,address,string)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,address,bool)", p0, p1, p2, p3)); + } + + function log(string memory p0, address p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(string,address,address,address)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,string)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,address)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,string)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,address)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,string)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,address)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,string)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, uint p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,address)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,string)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,address)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,string)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,address)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,string)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,address)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,string)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, string memory p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,address)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,string)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,address)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,string)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,address)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,string)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,address)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,string)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, bool p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,address)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,string)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,address)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,string)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,address)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,string)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,address)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,uint)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,string)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,bool)", p0, p1, p2, p3)); + } + + function log(bool p0, address p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,address)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,uint)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,string)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,bool)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,address)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,uint)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,string)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,bool)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,address)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,uint)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,string)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,bool)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,address)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,uint)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,string)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,bool)", p0, p1, p2, p3)); + } + + function log(address p0, uint p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,address)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,uint)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,string)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,bool)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,address)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,string,uint)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,string,string)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,string,bool)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,string,address)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,uint)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,string)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,bool)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,address)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,address,uint)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,address,string)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,address,bool)", p0, p1, p2, p3)); + } + + function log(address p0, string memory p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,string,address,address)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,uint)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,string)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,bool)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,address)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,uint)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,string)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,bool)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,address)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,uint)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,string)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,bool)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,address)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,uint)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,string)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,bool)", p0, p1, p2, p3)); + } + + function log(address p0, bool p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,address)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, uint p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,uint)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, uint p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,string)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, uint p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,bool)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, uint p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,address)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, string memory p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,string,uint)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, string memory p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,string,string)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, string memory p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,string,bool)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, string memory p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,string,address)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, bool p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,uint)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, bool p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,string)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, bool p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,bool)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, bool p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,address)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, address p2, uint p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,address,uint)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, address p2, string memory p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,address,string)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, address p2, bool p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,address,bool)", p0, p1, p2, p3)); + } + + function log(address p0, address p1, address p2, address p3) internal view { + _sendLogPayload(abi.encodeWithSignature("log(address,address,address,address)", p0, p1, p2, p3)); + } + +} diff --git a/libs/remix-tests/tests/testRunner.spec.ts b/libs/remix-tests/tests/testRunner.spec.ts index f545c87d44..3a2461908d 100644 --- a/libs/remix-tests/tests/testRunner.spec.ts +++ b/libs/remix-tests/tests/testRunner.spec.ts @@ -1,7 +1,7 @@ import * as async from 'async' import Web3 from 'web3'; import * as assert from 'assert' -import { Provider } from '@remix-project/remix-simulator' +import { Provider, extend } from '@remix-project/remix-simulator' import { compileFileOrFiles } from '../src/compiler' import { deployAll } from '../src/deployer' @@ -43,13 +43,16 @@ let accounts: string[] let provider: any = new Provider() async function compileAndDeploy(filename: string, callback: Function) { + console.log('Inside compileAndDeploy') let web3: Web3 = new Web3() let sourceASTs: any = {} await provider.init() web3.setProvider(provider) + extend(web3) let compilationData: object async.waterfall([ function getAccountList(next: Function): void { + console.log('Inside compileAndDeploy- getAccountList') web3.eth.getAccounts((_err: Error | null | undefined, _accounts: string[]) => { accounts = _accounts web3.eth.defaultAccount = accounts[0] @@ -57,9 +60,11 @@ async function compileAndDeploy(filename: string, callback: Function) { }) }, function compile(next: Function): void { + console.log('Inside compileAndDeploy- compile') compileFileOrFiles(filename, false, { accounts }, null, next) }, function deployAllContracts(compilationResult: compilationInterface, asts, next: Function): void { + console.log('Inside compileAndDeploy- deployAllContracts') for(const filename in asts) { if(filename.endsWith('_test.sol')) sourceASTs[filename] = asts[filename].ast @@ -72,13 +77,15 @@ async function compileAndDeploy(filename: string, callback: Function) { } } ], function (_err: Error | null | undefined, contracts: any): void { - callback(null, compilationData, contracts, sourceASTs, accounts) + console.log('Outside compileAndDeploy') + callback(null, compilationData, contracts, sourceASTs, accounts, web3) }) } // Use `export NODE_OPTIONS="--max-old-space-size=4096"` if there is a JavaScript heap out of memory issue describe('testRunner', () => { + console.log('Inside testRunner') let tests: any[] = [], results: ResultsInterface; const testCallback: TestCbInterface = (err, test) => { @@ -101,13 +108,15 @@ describe('testRunner', () => { } describe('#runTest', () => { + console.log('Inside runTest') describe('assert library OK method tests', () => { const filename: string = __dirname + '/examples_0/assert_ok_test.sol' beforeAll((done) => { - compileAndDeploy(filename, (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) => { - runTest('AssertOkTest', contracts.AssertOkTest, compilationData[filename]['AssertOkTest'], asts[filename], { accounts }, testCallback, resultsCallback(done)) + console.log('Inside beforeAll', filename) + compileAndDeploy(filename, (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[], web3: any) => { + runTest('AssertOkTest', contracts.AssertOkTest, compilationData[filename]['AssertOkTest'], asts[filename], { accounts, web3 }, testCallback, resultsCallback(done)) }) }) @@ -121,12 +130,14 @@ describe('testRunner', () => { assert.equal(results.failureNum, 1) }) + const hhLogs1 = [ [ "AssertOkTest", "okPassTest"]] + const hhLogs2 = [ [ "AssertOkTest", "okFailTest"]] it('should return', () => { deepEqualExcluding(tests, [ { type: 'accountList', value: accounts }, { type: 'contract', value: 'AssertOkTest', filename: __dirname + '/examples_0/assert_ok_test.sol' }, - { type: 'testPass', value: 'Ok pass test', filename: __dirname + '/examples_0/assert_ok_test.sol', context: 'AssertOkTest' }, - { type: 'testFailure', value: 'Ok fail test', filename: __dirname + '/examples_0/assert_ok_test.sol', errMsg: 'okFailTest fails', context: 'AssertOkTest', assertMethod: 'ok', location: '234:36:0', expected: 'true', returned: 'false'}, + { type: 'testPass', value: 'Ok pass test', filename: __dirname + '/examples_0/assert_ok_test.sol', context: 'AssertOkTest', hhLogs: hhLogs1 }, + { type: 'testFailure', value: 'Ok fail test', filename: __dirname + '/examples_0/assert_ok_test.sol', errMsg: 'okFailTest fails', context: 'AssertOkTest', hhLogs: hhLogs2, assertMethod: 'ok', location: '370:36:0', expected: 'true', returned: 'false'}, ], ['time']) }) @@ -136,7 +147,7 @@ describe('testRunner', () => { const filename: string = __dirname + '/examples_0/assert_equal_test.sol' beforeAll((done) => { - compileAndDeploy(filename, (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) => { + compileAndDeploy(filename, (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[], web3: any) => { runTest('AssertEqualTest', contracts.AssertEqualTest, compilationData[filename]['AssertEqualTest'], asts[filename], { accounts }, testCallback, resultsCallback(done)) }) }) @@ -175,7 +186,7 @@ describe('testRunner', () => { const filename: string = __dirname + '/examples_0/assert_notEqual_test.sol' beforeAll((done) => { - compileAndDeploy(filename, (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) => { + compileAndDeploy(filename, (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[], web3: any) => { runTest('AssertNotEqualTest', contracts.AssertNotEqualTest, compilationData[filename]['AssertNotEqualTest'], asts[filename], { accounts }, testCallback, resultsCallback(done)) }) }) @@ -214,7 +225,7 @@ describe('testRunner', () => { const filename: string = __dirname + '/examples_0/assert_greaterThan_test.sol' beforeAll((done) => { - compileAndDeploy(filename, (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) => { + compileAndDeploy(filename, (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[], web3: any) => { runTest('AssertGreaterThanTest', contracts.AssertGreaterThanTest, compilationData[filename]['AssertGreaterThanTest'], asts[filename], { accounts }, testCallback, resultsCallback(done)) }) }) @@ -248,7 +259,7 @@ describe('testRunner', () => { const filename: string = __dirname + '/examples_0/assert_lesserThan_test.sol' beforeAll((done) => { - compileAndDeploy(filename, (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) => { + compileAndDeploy(filename, (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[], web3: any) => { runTest('AssertLesserThanTest', contracts.AssertLesserThanTest, compilationData[filename]['AssertLesserThanTest'], asts[filename], { accounts }, testCallback, resultsCallback(done)) }) }) @@ -283,7 +294,7 @@ describe('testRunner', () => { const filename: string = __dirname + '/examples_1/simple_storage_test.sol' beforeAll((done) => { - compileAndDeploy(filename, (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) => { + compileAndDeploy(filename, (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[], web3: any) => { runTest('MyTest', contracts.MyTest, compilationData[filename]['MyTest'], asts[filename], { accounts }, testCallback, resultsCallback(done)) }) }) @@ -314,7 +325,7 @@ describe('testRunner', () => { const filename: string = __dirname + '/examples_2/simple_storage_test.sol' beforeAll(done => { - compileAndDeploy(filename, function (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) { + compileAndDeploy(filename, function (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[], web3: any) { runTest('MyTest', contracts.MyTest, compilationData[filename]['MyTest'], asts[filename], { accounts }, testCallback, resultsCallback(done)) }) }) @@ -344,7 +355,7 @@ describe('testRunner', () => { const filename: string = __dirname + '/examples_3/simple_string_test.sol' beforeAll(done => { - compileAndDeploy(filename, function (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) { + compileAndDeploy(filename, function (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[], web3: any) { runTest('StringTest', contracts.StringTest, compilationData[filename]['StringTest'], asts[filename], { accounts }, testCallback, resultsCallback(done)) }) }) @@ -370,7 +381,7 @@ describe('testRunner', () => { const filename: string = __dirname + '/examples_5/test/simple_storage_test.sol' beforeAll(done => { - compileAndDeploy(filename, function (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) { + compileAndDeploy(filename, function (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[], web3: any) { runTest('StorageResolveTest', contracts.StorageResolveTest, compilationData[filename]['StorageResolveTest'], asts[filename], { accounts }, testCallback, resultsCallback(done)) }) }) @@ -397,7 +408,7 @@ describe('testRunner', () => { const filename: string = __dirname + '/examples_4/SafeMath_test.sol' beforeAll(done => { - compileAndDeploy(filename, function (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) { + compileAndDeploy(filename, function (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[], web3: any) { runTest('SafeMathTest', contracts.SafeMathTest, compilationData[filename]['SafeMathTest'], asts[filename], { accounts }, testCallback, resultsCallback(done)) }) }) @@ -417,7 +428,7 @@ describe('testRunner', () => { const filename: string = __dirname + '/number/number_test.sol' beforeAll(done => { - compileAndDeploy(filename, function (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) { + compileAndDeploy(filename, function (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[], web3: any) { runTest('IntegerTest', contracts.IntegerTest, compilationData[filename]['IntegerTest'], asts[filename], { accounts }, testCallback, resultsCallback(done)) }) }) @@ -437,7 +448,7 @@ describe('testRunner', () => { const filename: string = __dirname + '/various_sender/sender_and_value_test.sol' beforeAll(done => { - compileAndDeploy(filename, function (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) { + compileAndDeploy(filename, function (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[], web3: any) { runTest('SenderAndValueTest', contracts.SenderAndValueTest, compilationData[filename]['SenderAndValueTest'], asts[filename], { accounts }, testCallback, resultsCallback(done)) }) }) @@ -465,7 +476,7 @@ describe('testRunner', () => { } } beforeAll(done => { - compileAndDeploy(filename, function (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) { + compileAndDeploy(filename, function (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[], web3: any) { runTest('SenderAndValueTest', undefined, compilationData[filename]['SenderAndValueTest'], asts[filename], { accounts }, testCallback, errorCallback(done)) }) }) From 212e089eb11f8cfbc6d6c7ff1081b265824e2ec6 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Thu, 19 Aug 2021 12:56:23 +0530 Subject: [PATCH 17/25] console removed from testRunner --- libs/remix-tests/tests/testRunner.spec.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/libs/remix-tests/tests/testRunner.spec.ts b/libs/remix-tests/tests/testRunner.spec.ts index 3a2461908d..b025fbfc0c 100644 --- a/libs/remix-tests/tests/testRunner.spec.ts +++ b/libs/remix-tests/tests/testRunner.spec.ts @@ -43,7 +43,6 @@ let accounts: string[] let provider: any = new Provider() async function compileAndDeploy(filename: string, callback: Function) { - console.log('Inside compileAndDeploy') let web3: Web3 = new Web3() let sourceASTs: any = {} await provider.init() @@ -52,7 +51,6 @@ async function compileAndDeploy(filename: string, callback: Function) { let compilationData: object async.waterfall([ function getAccountList(next: Function): void { - console.log('Inside compileAndDeploy- getAccountList') web3.eth.getAccounts((_err: Error | null | undefined, _accounts: string[]) => { accounts = _accounts web3.eth.defaultAccount = accounts[0] @@ -60,11 +58,9 @@ async function compileAndDeploy(filename: string, callback: Function) { }) }, function compile(next: Function): void { - console.log('Inside compileAndDeploy- compile') compileFileOrFiles(filename, false, { accounts }, null, next) }, function deployAllContracts(compilationResult: compilationInterface, asts, next: Function): void { - console.log('Inside compileAndDeploy- deployAllContracts') for(const filename in asts) { if(filename.endsWith('_test.sol')) sourceASTs[filename] = asts[filename].ast @@ -77,7 +73,6 @@ async function compileAndDeploy(filename: string, callback: Function) { } } ], function (_err: Error | null | undefined, contracts: any): void { - console.log('Outside compileAndDeploy') callback(null, compilationData, contracts, sourceASTs, accounts, web3) }) } @@ -85,7 +80,6 @@ async function compileAndDeploy(filename: string, callback: Function) { // Use `export NODE_OPTIONS="--max-old-space-size=4096"` if there is a JavaScript heap out of memory issue describe('testRunner', () => { - console.log('Inside testRunner') let tests: any[] = [], results: ResultsInterface; const testCallback: TestCbInterface = (err, test) => { @@ -108,13 +102,11 @@ describe('testRunner', () => { } describe('#runTest', () => { - console.log('Inside runTest') describe('assert library OK method tests', () => { const filename: string = __dirname + '/examples_0/assert_ok_test.sol' beforeAll((done) => { - console.log('Inside beforeAll', filename) compileAndDeploy(filename, (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[], web3: any) => { runTest('AssertOkTest', contracts.AssertOkTest, compilationData[filename]['AssertOkTest'], asts[filename], { accounts, web3 }, testCallback, resultsCallback(done)) }) From c31a7f0de908bb2c4c9aba006c47c150076b3d54 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Thu, 19 Aug 2021 13:27:01 +0530 Subject: [PATCH 18/25] show hhLogs in terminal for unit testing plugin --- apps/remix-ide/src/app/tabs/test-tab.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide/src/app/tabs/test-tab.js b/apps/remix-ide/src/app/tabs/test-tab.js index 9dc3de4dad..4b72067d0d 100644 --- a/apps/remix-ide/src/app/tabs/test-tab.js +++ b/apps/remix-ide/src/app/tabs/test-tab.js @@ -1,6 +1,7 @@ import { ViewPlugin } from '@remixproject/engine-web' import { removeMultipleSlashes, removeTrailingSlashes } from '../../lib/helper' import { canUseWorker, urlFromVersion } from '@remix-project/remix-solidity' +import { format } from 'util' var yo = require('yo-yo') var async = require('async') var tooltip = require('../ui/tooltip') @@ -179,8 +180,25 @@ module.exports = class TestTab extends ViewPlugin { } } + printHHLogs (logsArr, testName) { + let finalLogs = `${testName}:-\n` + for (const log of logsArr) { + let formattedLog + // Hardhat implements the same formatting options that can be found in Node.js' console.log, + // which in turn uses util.format: https://nodejs.org/dist/latest-v12.x/docs/api/util.html#util_util_format_format_args + // For example: console.log("Name: %s, Age: %d", remix, 6) will log 'Name: remix, Age: 6' + // We check first arg to determine if 'util.format' is needed + if (typeof log[0] === 'string' && (log[0].includes('%s') || log[0].includes('%d'))) { + formattedLog = format(log[0], ...log.slice(1)) + } else { + formattedLog = log.join(' ') + } + finalLogs = finalLogs + formattedLog + '\n' + } + this.call('terminal', 'log', { type: 'info', value: finalLogs }) + } + testCallback (result, runningTests) { - console.log('result in testCallback', result) this.testsOutput.hidden = false if (result.type === 'contract') { this.testSuite = result.value @@ -198,6 +216,7 @@ module.exports = class TestTab extends ViewPlugin { ` this.testsOutput.appendChild(this.outputHeader) } else if (result.type === 'testPass') { + if(result.hhLogs && result.hhLogs.length) this.printHHLogs(result.hhLogs, result.value) this.testsOutput.appendChild(yo`
`) } else if (result.type === 'testFailure') { + if(result.hhLogs && result.hhLogs.length) this.printHHLogs(result.hhLogs, result.value) if (!result.assertMethod) { this.testsOutput.appendChild(yo`
Date: Thu, 19 Aug 2021 13:57:29 +0530 Subject: [PATCH 19/25] log formatting --- apps/remix-ide/src/app/tabs/test-tab.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/test-tab.js b/apps/remix-ide/src/app/tabs/test-tab.js index 4b72067d0d..be230ad278 100644 --- a/apps/remix-ide/src/app/tabs/test-tab.js +++ b/apps/remix-ide/src/app/tabs/test-tab.js @@ -181,7 +181,7 @@ module.exports = class TestTab extends ViewPlugin { } printHHLogs (logsArr, testName) { - let finalLogs = `${testName}:-\n` + let finalLogs = `${testName}:\n` for (const log of logsArr) { let formattedLog // Hardhat implements the same formatting options that can be found in Node.js' console.log, @@ -193,7 +193,7 @@ module.exports = class TestTab extends ViewPlugin { } else { formattedLog = log.join(' ') } - finalLogs = finalLogs + formattedLog + '\n' + finalLogs = finalLogs + ' ' + formattedLog + '\n' } this.call('terminal', 'log', { type: 'info', value: finalLogs }) } @@ -216,7 +216,7 @@ module.exports = class TestTab extends ViewPlugin { ` this.testsOutput.appendChild(this.outputHeader) } else if (result.type === 'testPass') { - if(result.hhLogs && result.hhLogs.length) this.printHHLogs(result.hhLogs, result.value) + if (result.hhLogs && result.hhLogs.length) this.printHHLogs(result.hhLogs, result.value) this.testsOutput.appendChild(yo`
`) } else if (result.type === 'testFailure') { - if(result.hhLogs && result.hhLogs.length) this.printHHLogs(result.hhLogs, result.value) + if (result.hhLogs && result.hhLogs.length) this.printHHLogs(result.hhLogs, result.value) if (!result.assertMethod) { this.testsOutput.appendChild(yo`
Date: Thu, 19 Aug 2021 18:17:29 +0530 Subject: [PATCH 20/25] remix-tests cli tests disabled --- .../{testRunner.cli.spec.ts => testRunner.cli.spec_disabled.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename libs/remix-tests/tests/{testRunner.cli.spec.ts => testRunner.cli.spec_disabled.ts} (100%) diff --git a/libs/remix-tests/tests/testRunner.cli.spec.ts b/libs/remix-tests/tests/testRunner.cli.spec_disabled.ts similarity index 100% rename from libs/remix-tests/tests/testRunner.cli.spec.ts rename to libs/remix-tests/tests/testRunner.cli.spec_disabled.ts From d889e87f2230dcfcf338a79b352bdbcddc7f4cc0 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Wed, 18 Aug 2021 11:12:03 +0100 Subject: [PATCH 21/25] Added guide for generating react libs --- libs/remix-ui/README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 libs/remix-ui/README.md diff --git a/libs/remix-ui/README.md b/libs/remix-ui/README.md new file mode 100644 index 0000000000..fda7862aa3 --- /dev/null +++ b/libs/remix-ui/README.md @@ -0,0 +1,17 @@ +# remix-ui + +This library was generated with [Nx](https://nx.dev). + +## Steps To Generate React Lib +- Install **NxConsole** vscose extension +- Create new copy of **tsconfig.json** +- Rename it to **tsconfig.base.json** +- Open **NxConsole** extension +- Click generate option +- Select **@nrwl/react -Library** +- Enter library name +- Set **directory** to **remix-ui** +- Set **importPath** to **@remix-ui/{library-name}** +- Click the run button in the top right corner of the generate page. +- Update **tsconfig.json** with updates added to **tsconfig.base.json** +- Delete **tsconfig.base.json** \ No newline at end of file From 1d5bdba16b0e157104a22fd0aa832c78691aef6a Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Thu, 19 Aug 2021 10:49:35 +0100 Subject: [PATCH 22/25] Setup tsconfig.base.json --- apps/debugger/tsconfig.json | 2 +- apps/remix-ide-e2e/tsconfig.json | 2 +- apps/remix-ide/tsconfig.json | 2 +- libs/remix-analyzer/tsconfig.json | 2 +- libs/remix-astwalker/tsconfig.json | 2 +- libs/remix-core-plugin/tsconfig.json | 2 +- libs/remix-debug/tsconfig.json | 2 +- libs/remix-lib/tsconfig.json | 2 +- libs/remix-simulator/tsconfig.json | 2 +- libs/remix-solidity/tsconfig.json | 2 +- libs/remix-tests/tsconfig.json | 2 +- libs/remix-ui/checkbox/tsconfig.json | 2 +- libs/remix-ui/clipboard/tsconfig.json | 2 +- libs/remix-ui/debugger-ui/tsconfig.json | 2 +- libs/remix-ui/file-explorer/tsconfig.json | 2 +- libs/remix-ui/modal-dialog/tsconfig.json | 2 +- .../remix-ui/publish-to-storage/tsconfig.json | 2 +- libs/remix-ui/renderer/tsconfig.json | 2 +- libs/remix-ui/settings/tsconfig.json | 2 +- libs/remix-ui/solidity-compiler/tsconfig.json | 2 +- libs/remix-ui/static-analyser/tsconfig.json | 2 +- libs/remix-ui/toaster/tsconfig.json | 2 +- libs/remix-ui/tree-view/tsconfig.json | 2 +- libs/remix-ui/utils/tsconfig.json | 2 +- libs/remix-ui/workspace/tsconfig.json | 2 +- libs/remix-url-resolver/tsconfig.json | 2 +- libs/remixd/tsconfig.json | 2 +- nx.json | 3 +- tsconfig.base.json | 48 +++++++++++++++++++ tsconfig.json | 33 ++----------- 30 files changed, 80 insertions(+), 58 deletions(-) create mode 100644 tsconfig.base.json diff --git a/apps/debugger/tsconfig.json b/apps/debugger/tsconfig.json index 7c6fcde8f2..b2a6956c94 100644 --- a/apps/debugger/tsconfig.json +++ b/apps/debugger/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "jsx": "react", "allowJs": true, diff --git a/apps/remix-ide-e2e/tsconfig.json b/apps/remix-ide-e2e/tsconfig.json index a26c03d891..3de00b0f62 100644 --- a/apps/remix-ide-e2e/tsconfig.json +++ b/apps/remix-ide-e2e/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "types": ["node", "nightwatch"], "esModuleInterop": true diff --git a/apps/remix-ide/tsconfig.json b/apps/remix-ide/tsconfig.json index fa0186ddd0..b32eb87bd7 100644 --- a/apps/remix-ide/tsconfig.json +++ b/apps/remix-ide/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "jsx": "react", "allowJs": true, diff --git a/libs/remix-analyzer/tsconfig.json b/libs/remix-analyzer/tsconfig.json index cd69567953..751eaf755d 100644 --- a/libs/remix-analyzer/tsconfig.json +++ b/libs/remix-analyzer/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "types": ["node"], "module": "commonjs", diff --git a/libs/remix-astwalker/tsconfig.json b/libs/remix-astwalker/tsconfig.json index edbdcaeaa9..b516fcbd30 100644 --- a/libs/remix-astwalker/tsconfig.json +++ b/libs/remix-astwalker/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "types": ["node"], "module": "commonjs", diff --git a/libs/remix-core-plugin/tsconfig.json b/libs/remix-core-plugin/tsconfig.json index f14da61cdf..c23e61c800 100644 --- a/libs/remix-core-plugin/tsconfig.json +++ b/libs/remix-core-plugin/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "files": [], "include": [], "references": [ diff --git a/libs/remix-debug/tsconfig.json b/libs/remix-debug/tsconfig.json index 71c41a5aba..d66e6f3252 100644 --- a/libs/remix-debug/tsconfig.json +++ b/libs/remix-debug/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "types": ["node", "tape"], "esModuleInterop": true diff --git a/libs/remix-lib/tsconfig.json b/libs/remix-lib/tsconfig.json index 71c41a5aba..d66e6f3252 100644 --- a/libs/remix-lib/tsconfig.json +++ b/libs/remix-lib/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "types": ["node", "tape"], "esModuleInterop": true diff --git a/libs/remix-simulator/tsconfig.json b/libs/remix-simulator/tsconfig.json index f19ef7e5a8..3d3a2b990f 100644 --- a/libs/remix-simulator/tsconfig.json +++ b/libs/remix-simulator/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "types": ["node", "mocha"], "esModuleInterop": true diff --git a/libs/remix-solidity/tsconfig.json b/libs/remix-solidity/tsconfig.json index 54497bbbe1..5ed408bd51 100644 --- a/libs/remix-solidity/tsconfig.json +++ b/libs/remix-solidity/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "types": ["node"] }, diff --git a/libs/remix-tests/tsconfig.json b/libs/remix-tests/tsconfig.json index cf7076c1d1..3b54496f3d 100644 --- a/libs/remix-tests/tsconfig.json +++ b/libs/remix-tests/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "types": ["node", "jest"], "module": "commonjs", diff --git a/libs/remix-ui/checkbox/tsconfig.json b/libs/remix-ui/checkbox/tsconfig.json index 6b65264565..d52e31ad74 100644 --- a/libs/remix-ui/checkbox/tsconfig.json +++ b/libs/remix-ui/checkbox/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "jsx": "react", "allowJs": true, diff --git a/libs/remix-ui/clipboard/tsconfig.json b/libs/remix-ui/clipboard/tsconfig.json index 42b7ee636f..a7180ef589 100644 --- a/libs/remix-ui/clipboard/tsconfig.json +++ b/libs/remix-ui/clipboard/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "jsx": "react", "allowJs": true, diff --git a/libs/remix-ui/debugger-ui/tsconfig.json b/libs/remix-ui/debugger-ui/tsconfig.json index 42b7ee636f..a7180ef589 100644 --- a/libs/remix-ui/debugger-ui/tsconfig.json +++ b/libs/remix-ui/debugger-ui/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "jsx": "react", "allowJs": true, diff --git a/libs/remix-ui/file-explorer/tsconfig.json b/libs/remix-ui/file-explorer/tsconfig.json index 6b65264565..d52e31ad74 100644 --- a/libs/remix-ui/file-explorer/tsconfig.json +++ b/libs/remix-ui/file-explorer/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "jsx": "react", "allowJs": true, diff --git a/libs/remix-ui/modal-dialog/tsconfig.json b/libs/remix-ui/modal-dialog/tsconfig.json index 42b7ee636f..a7180ef589 100644 --- a/libs/remix-ui/modal-dialog/tsconfig.json +++ b/libs/remix-ui/modal-dialog/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "jsx": "react", "allowJs": true, diff --git a/libs/remix-ui/publish-to-storage/tsconfig.json b/libs/remix-ui/publish-to-storage/tsconfig.json index 6b65264565..d52e31ad74 100644 --- a/libs/remix-ui/publish-to-storage/tsconfig.json +++ b/libs/remix-ui/publish-to-storage/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "jsx": "react", "allowJs": true, diff --git a/libs/remix-ui/renderer/tsconfig.json b/libs/remix-ui/renderer/tsconfig.json index 6b65264565..d52e31ad74 100644 --- a/libs/remix-ui/renderer/tsconfig.json +++ b/libs/remix-ui/renderer/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "jsx": "react", "allowJs": true, diff --git a/libs/remix-ui/settings/tsconfig.json b/libs/remix-ui/settings/tsconfig.json index 6b65264565..d52e31ad74 100644 --- a/libs/remix-ui/settings/tsconfig.json +++ b/libs/remix-ui/settings/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "jsx": "react", "allowJs": true, diff --git a/libs/remix-ui/solidity-compiler/tsconfig.json b/libs/remix-ui/solidity-compiler/tsconfig.json index 6b65264565..d52e31ad74 100644 --- a/libs/remix-ui/solidity-compiler/tsconfig.json +++ b/libs/remix-ui/solidity-compiler/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "jsx": "react", "allowJs": true, diff --git a/libs/remix-ui/static-analyser/tsconfig.json b/libs/remix-ui/static-analyser/tsconfig.json index 6b65264565..d52e31ad74 100644 --- a/libs/remix-ui/static-analyser/tsconfig.json +++ b/libs/remix-ui/static-analyser/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "jsx": "react", "allowJs": true, diff --git a/libs/remix-ui/toaster/tsconfig.json b/libs/remix-ui/toaster/tsconfig.json index 6b65264565..d52e31ad74 100644 --- a/libs/remix-ui/toaster/tsconfig.json +++ b/libs/remix-ui/toaster/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "jsx": "react", "allowJs": true, diff --git a/libs/remix-ui/tree-view/tsconfig.json b/libs/remix-ui/tree-view/tsconfig.json index 42b7ee636f..a7180ef589 100644 --- a/libs/remix-ui/tree-view/tsconfig.json +++ b/libs/remix-ui/tree-view/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "jsx": "react", "allowJs": true, diff --git a/libs/remix-ui/utils/tsconfig.json b/libs/remix-ui/utils/tsconfig.json index 42b7ee636f..a7180ef589 100644 --- a/libs/remix-ui/utils/tsconfig.json +++ b/libs/remix-ui/utils/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "jsx": "react", "allowJs": true, diff --git a/libs/remix-ui/workspace/tsconfig.json b/libs/remix-ui/workspace/tsconfig.json index 6b65264565..d52e31ad74 100644 --- a/libs/remix-ui/workspace/tsconfig.json +++ b/libs/remix-ui/workspace/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "jsx": "react", "allowJs": true, diff --git a/libs/remix-url-resolver/tsconfig.json b/libs/remix-url-resolver/tsconfig.json index 985037a3f3..f74b077096 100644 --- a/libs/remix-url-resolver/tsconfig.json +++ b/libs/remix-url-resolver/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "types": ["node", "mocha"], "module": "commonjs", diff --git a/libs/remixd/tsconfig.json b/libs/remixd/tsconfig.json index 546e940e20..62ebbd9464 100644 --- a/libs/remixd/tsconfig.json +++ b/libs/remixd/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "files": [], "include": [], "references": [ diff --git a/nx.json b/nx.json index 16e4c56d76..c736439cc6 100644 --- a/nx.json +++ b/nx.json @@ -6,8 +6,9 @@ "dependencies": "*", "devDependencies": "*" }, - "tsconfig.json": "*", + "tsconfig.base.json": "*", "tslint.json": "*", + ".eslintrc": "*", "nx.json": "*" }, "tasksRunnerOptions": { diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 0000000000..87a3bd1b40 --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,48 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "rootDir": ".", + "sourceMap": true, + "declaration": false, + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "importHelpers": true, + "target": "es2015", + "module": "commonjs", + "typeRoots": ["node_modules/@types"], + "lib": ["es2017", "es2019", "dom"], + "skipLibCheck": true, + "skipDefaultLibCheck": true, + "baseUrl": ".", + "paths": { + "@remix-project/remix-analyzer": ["dist/libs/remix-analyzer/index.js"], + "@remix-project/remix-astwalker": ["dist/libs/remix-astwalker/index.js"], + "@remix-project/remix-debug": ["dist/libs/remix-debug/src/index.js"], + "@remix-project/remix-lib": ["dist/libs/remix-lib/src/index.js"], + "@remix-project/remix-simulator": ["dist/libs/remix-simulator/src/index.js"], + "@remix-project/remix-solidity": ["dist/libs/remix-solidity/index.js"], + "@remix-project/remix-tests": ["dist/libs/remix-tests/src/index.js"], + "@remix-project/remix-url-resolver": ["dist/libs/remix-url-resolver/index.js"], + "@remixproject/debugger-plugin": ["apps/debugger/src/index.ts"], + "@remix-project/remixd": ["dist/libs/remixd/index.js"], + "@remix-ui/tree-view": ["libs/remix-ui/tree-view/src/index.ts"], + "@remix-ui/debugger-ui": ["libs/remix-ui/debugger-ui/src/index.ts"], + "@remix-ui/utils": ["libs/remix-ui/utils/src/index.ts"], + "@remix-ui/clipboard": ["libs/remix-ui/clipboard/src/index.ts"], + "@remix-project/remix-solidity-ts": ["libs/remix-solidity/src/index.ts"], + "@remix-ui/modal-dialog": ["libs/remix-ui/modal-dialog/src/index.ts"], + "@remix-ui/toaster": ["libs/remix-ui/toaster/src/index.ts"], + "@remix-ui/file-explorer": ["libs/remix-ui/file-explorer/src/index.ts"], + "@remix-ui/workspace": ["libs/remix-ui/workspace/src/index.ts"], + "@remix-ui/static-analyser": ["libs/remix-ui/static-analyser/src/index.ts"], + "@remix-ui/checkbox": ["libs/remix-ui/checkbox/src/index.ts"], + "@remix-ui/settings": ["libs/remix-ui/settings/src/index.ts"], + "@remix-project/core-plugin": ["libs/remix-core-plugin/src/index.ts"], + "@remix-ui/solidity-compiler": ["libs/remix-ui/solidity-compiler/src/index.ts"], + "@remix-ui/publish-to-storage": ["libs/remix-ui/publish-to-storage/src/index.ts"], + "@remix-ui/renderer": ["libs/remix-ui/renderer/src/index.ts"] + } + }, + "exclude": ["node_modules", "tmp"] +} diff --git a/tsconfig.json b/tsconfig.json index 87a3bd1b40..6204014228 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,39 +10,12 @@ "importHelpers": true, "target": "es2015", "module": "commonjs", - "typeRoots": ["node_modules/@types"], - "lib": ["es2017", "es2019", "dom"], + "lib": ["es2017", "dom"], "skipLibCheck": true, "skipDefaultLibCheck": true, "baseUrl": ".", - "paths": { - "@remix-project/remix-analyzer": ["dist/libs/remix-analyzer/index.js"], - "@remix-project/remix-astwalker": ["dist/libs/remix-astwalker/index.js"], - "@remix-project/remix-debug": ["dist/libs/remix-debug/src/index.js"], - "@remix-project/remix-lib": ["dist/libs/remix-lib/src/index.js"], - "@remix-project/remix-simulator": ["dist/libs/remix-simulator/src/index.js"], - "@remix-project/remix-solidity": ["dist/libs/remix-solidity/index.js"], - "@remix-project/remix-tests": ["dist/libs/remix-tests/src/index.js"], - "@remix-project/remix-url-resolver": ["dist/libs/remix-url-resolver/index.js"], - "@remixproject/debugger-plugin": ["apps/debugger/src/index.ts"], - "@remix-project/remixd": ["dist/libs/remixd/index.js"], - "@remix-ui/tree-view": ["libs/remix-ui/tree-view/src/index.ts"], - "@remix-ui/debugger-ui": ["libs/remix-ui/debugger-ui/src/index.ts"], - "@remix-ui/utils": ["libs/remix-ui/utils/src/index.ts"], - "@remix-ui/clipboard": ["libs/remix-ui/clipboard/src/index.ts"], - "@remix-project/remix-solidity-ts": ["libs/remix-solidity/src/index.ts"], - "@remix-ui/modal-dialog": ["libs/remix-ui/modal-dialog/src/index.ts"], - "@remix-ui/toaster": ["libs/remix-ui/toaster/src/index.ts"], - "@remix-ui/file-explorer": ["libs/remix-ui/file-explorer/src/index.ts"], - "@remix-ui/workspace": ["libs/remix-ui/workspace/src/index.ts"], - "@remix-ui/static-analyser": ["libs/remix-ui/static-analyser/src/index.ts"], - "@remix-ui/checkbox": ["libs/remix-ui/checkbox/src/index.ts"], - "@remix-ui/settings": ["libs/remix-ui/settings/src/index.ts"], - "@remix-project/core-plugin": ["libs/remix-core-plugin/src/index.ts"], - "@remix-ui/solidity-compiler": ["libs/remix-ui/solidity-compiler/src/index.ts"], - "@remix-ui/publish-to-storage": ["libs/remix-ui/publish-to-storage/src/index.ts"], - "@remix-ui/renderer": ["libs/remix-ui/renderer/src/index.ts"] - } + "paths": {}, + "allowSyntheticDefaultImports": true }, "exclude": ["node_modules", "tmp"] } From 3c3676cf0114d2056468f16e08899e8cdbb0bac0 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Thu, 19 Aug 2021 10:55:07 +0100 Subject: [PATCH 23/25] Updated command for generating react libs --- libs/remix-ui/README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libs/remix-ui/README.md b/libs/remix-ui/README.md index fda7862aa3..4d0a2662ba 100644 --- a/libs/remix-ui/README.md +++ b/libs/remix-ui/README.md @@ -4,14 +4,10 @@ This library was generated with [Nx](https://nx.dev). ## Steps To Generate React Lib - Install **NxConsole** vscose extension -- Create new copy of **tsconfig.json** -- Rename it to **tsconfig.base.json** - Open **NxConsole** extension - Click generate option - Select **@nrwl/react -Library** - Enter library name - Set **directory** to **remix-ui** - Set **importPath** to **@remix-ui/{library-name}** -- Click the run button in the top right corner of the generate page. -- Update **tsconfig.json** with updates added to **tsconfig.base.json** -- Delete **tsconfig.base.json** \ No newline at end of file +- Click the run button in the top right corner of the generate page. \ No newline at end of file From 3f9d1afd4221fc64b48a02b3081e83422cce54ad Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Thu, 19 Aug 2021 11:09:33 +0100 Subject: [PATCH 24/25] Added instructions for creating react apps and components --- libs/remix-ui/README.md | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/libs/remix-ui/README.md b/libs/remix-ui/README.md index 4d0a2662ba..7bb33ea706 100644 --- a/libs/remix-ui/README.md +++ b/libs/remix-ui/README.md @@ -2,12 +2,34 @@ This library was generated with [Nx](https://nx.dev). -## Steps To Generate React Lib +## Pre-requisite - Install **NxConsole** vscose extension +## Steps To Generate React App +- Open **NxConsole** extension +- Click generate option +- Select **@nrwl/react - application** +- Enter the name of the application +- Set **e2eTestRunner** to **none**. (This is because we run e2e tests with nightwatch) +- Set **unitTestRunner** to **none**. +- Click the run button in the top right corner of the generate page. +- Your react application should be created in **{root}/apps** directory. +## Steps To Generate React Lib - Open **NxConsole** extension - Click generate option -- Select **@nrwl/react -Library** -- Enter library name +- Select **@nrwl/react - library** +- Enter the name of the library - Set **directory** to **remix-ui** - Set **importPath** to **@remix-ui/{library-name}** -- Click the run button in the top right corner of the generate page. \ No newline at end of file +- Set **unitTestRunner** to **none**. +- Click the run button in the top right corner of the generate page. +- Your react library should be created on **{root}/libs/remix-ui** directory. + +## Steps To Generate React Component +- Open **NxConsole** extension +- Click generate option +- Select **@nrwl/react - component** +- Enter the name of the component +- Select the name of the project/library that uses the component. (e.g TreeView library) +- Set component directory if needed. +- Click the run button in the top right corner of the generate page. +- Your react component should be created with the project/library name specified. \ No newline at end of file From 6f42efc465dc81d68f239aca705cafe92e5fc005 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Thu, 19 Aug 2021 19:18:34 +0530 Subject: [PATCH 25/25] hardhat logs formatting improved --- apps/remix-ide/src/blockchain/blockchain.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/blockchain/blockchain.js b/apps/remix-ide/src/blockchain/blockchain.js index ff5494ff55..a5039a4c6b 100644 --- a/apps/remix-ide/src/blockchain/blockchain.js +++ b/apps/remix-ide/src/blockchain/blockchain.js @@ -501,7 +501,7 @@ class Blockchain extends Plugin { if (isVM) { const hhlogs = await this.web3().eth.getHHLogsForTx(txResult.transactionHash) if (hhlogs && hhlogs.length) { - let finalLogs = 'console.log:\n' + let finalLogs = 'console.log:\n' for (const log of hhlogs) { let formattedLog // Hardhat implements the same formatting options that can be found in Node.js' console.log, @@ -513,7 +513,7 @@ class Blockchain extends Plugin { } else { formattedLog = log.join(' ') } - finalLogs = finalLogs + formattedLog + '\n' + finalLogs = finalLogs + ' ' + formattedLog + '\n' } this.call('terminal', 'log', { type: 'info', value: finalLogs }) }