1
1
'use strict'
2
- import { Plugin } from '@remixproject/engine'
3
- import { util } from '@remix-project/remix-lib'
4
- import { CompilerAbstract } from '@remix-project/remix-solidity'
2
+ import { Plugin } from '@remixproject/engine'
3
+ import { util } from '@remix-project/remix-lib'
4
+ import { CompilerAbstract } from '@remix-project/remix-solidity'
5
5
6
6
const profile = {
7
7
name : 'compilerArtefacts' ,
@@ -36,7 +36,7 @@ export class CompilerArtefacts extends Plugin {
36
36
const saveCompilationResult = ( file , source , languageVersion , data , input ?) => {
37
37
this . compilersArtefactsPerFile [ file ] = new CompilerAbstract ( languageVersion , data , source , input )
38
38
this . compilersArtefacts . __last = this . compilersArtefactsPerFile [ file ]
39
- this . emit ( 'compilationSaved' , { [ file ] : this . compilersArtefactsPerFile [ file ] } )
39
+ this . emit ( 'compilationSaved' , { [ file ] : this . compilersArtefactsPerFile [ file ] } )
40
40
}
41
41
42
42
this . on ( 'solidity' , 'compilationFinished' , saveCompilationResult )
@@ -156,7 +156,7 @@ export class CompilerArtefacts extends Plugin {
156
156
else {
157
157
const allContractsData = { }
158
158
await this . _populateAllContractArtefactsFromFE ( 'contracts' , contract , allContractsData )
159
- if ( allContractsData [ fullyQualifiedName ] ) return { fullyQualifiedName, artefact : allContractsData [ fullyQualifiedName ] }
159
+ if ( allContractsData [ fullyQualifiedName ] ) return { fullyQualifiedName, artefact : allContractsData [ fullyQualifiedName ] }
160
160
else throw new Error ( `Could not find artifacts for ${ fullyQualifiedName } . Compile contract to generate artifacts.` )
161
161
}
162
162
} else {
@@ -167,7 +167,7 @@ export class CompilerArtefacts extends Plugin {
167
167
await this . _populateAllContractArtefactsFromFE ( 'contracts' , contractName , contractArtefacts )
168
168
keys = Object . keys ( contractArtefacts )
169
169
}
170
- if ( keys . length === 1 ) return { fullyQualifiedName : keys [ 0 ] , artefact : contractArtefacts [ keys [ 0 ] ] }
170
+ if ( keys . length === 1 ) return { fullyQualifiedName : keys [ 0 ] , artefact : contractArtefacts [ keys [ 0 ] ] }
171
171
else if ( keys . length > 1 ) {
172
172
throw new Error ( `There are multiple artifacts for contract "${ contractName } ", please use a fully qualified name.\n
173
173
Please replace ${ contractName } for one of these options wherever you are trying to read its artifact: \n
@@ -216,7 +216,7 @@ export class CompilerArtefacts extends Plugin {
216
216
for ( const name of Object . keys ( contractsData ) ) {
217
217
const contract = contractsData [ name ]
218
218
if ( util . compareByteCode ( code , '0x' + contract . evm . deployedBytecode . object ) ) {
219
- found = { name, contract, file}
219
+ found = { name, contract, file }
220
220
return true
221
221
}
222
222
}
0 commit comments