File tree Expand file tree Collapse file tree 3 files changed +12
-8
lines changed
apps/contract-verification/src/app/Verifiers Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ export class BlockscoutVerifier extends EtherscanVerifier {
4040
4141 let targetFilePath
4242 if ( ! blockscoutSource . FileName . startsWith ( '..' ) ) targetFilePath = `${ filePrefix } /${ blockscoutSource . FileName } `
43+ else targetFilePath = `${ filePrefix } /targetFile.sol`
44+
4345 result . push ( { content : blockscoutSource . SourceCode , path : targetFilePath } )
4446
4547 for ( const additional of blockscoutSource . AdditionalSources ?? [ ] ) {
Original file line number Diff line number Diff line change @@ -277,14 +277,15 @@ export class EtherscanVerifier extends AbstractVerifier {
277277 const result : SourceFile [ ] = [ ]
278278 let targetFilePath = ''
279279 for ( const [ fileName , fileObj ] of Object . entries < any > ( parsedFiles ) ) {
280- if ( fileName . startsWith ( '..' ) ) continue
280+ if ( fileName . startsWith ( '..' ) ) {
281+ if ( fileName . endsWith ( `/${ source . ContractName } .sol` ) ) targetFilePath = `${ filePrefix } /targetFile.sol`
282+ else continue
283+ }
281284 const path = `${ filePrefix } /${ fileName } `
282285
283286 result . push ( { path, content : fileObj . content } )
284287
285- if ( path . endsWith ( `/${ source . ContractName } .sol` ) ) {
286- targetFilePath = path
287- }
288+ if ( path . endsWith ( `/${ source . ContractName } .sol` ) ) targetFilePath = path
288289 }
289290 return { sourceFiles : result , targetFilePath }
290291 }
Original file line number Diff line number Diff line change @@ -213,12 +213,13 @@ export class SourcifyVerifier extends AbstractVerifier {
213213 const splitIdentifier = fullyQualifiedName . split ( ':' )
214214 const contractPath = splitIdentifier . slice ( 0 , - 1 ) . join ( ':' )
215215 for ( const [ filePath , fileData ] of Object . entries ( sources ) ) {
216- if ( filePath . startsWith ( '..' ) ) continue
216+ if ( filePath . startsWith ( '..' ) ) {
217+ if ( filePath === contractPath ) targetFilePath = `${ filePrefix } /sources/targetFile.sol`
218+ else continue
219+ }
217220 const path = `${ filePrefix } /sources/${ filePath } `
218221 result . push ( { path, content : fileData . content } )
219- if ( filePath === contractPath ) {
220- targetFilePath = path
221- }
222+ if ( filePath === contractPath ) targetFilePath = path
222223 }
223224
224225 return { sourceFiles : result , targetFilePath }
You can’t perform that action at this time.
0 commit comments