|
|
@ -1,15 +1,5 @@ |
|
|
|
import { Plugin } from '@remixproject/engine' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const packageJson = require('../../../../../../package.json') |
|
|
|
|
|
|
|
const Compiler = require('@remix-project/remix-solidity').Compiler |
|
|
|
const Compiler = require('@remix-project/remix-solidity').Compiler |
|
|
|
const EventEmitter = require('events') |
|
|
|
const EventEmitter = require('events') |
|
|
|
const profile = { |
|
|
|
|
|
|
|
name: 'solidity-logic', |
|
|
|
|
|
|
|
displayName: 'Solidity compiler logic', |
|
|
|
|
|
|
|
description: 'Compile solidity contracts - Logic', |
|
|
|
|
|
|
|
methods: ['getCompilerState'], |
|
|
|
|
|
|
|
version: packageJson.version |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
declare global { |
|
|
|
declare global { |
|
|
|
interface Window { |
|
|
|
interface Window { |
|
|
@ -18,7 +8,7 @@ declare global { |
|
|
|
} |
|
|
|
} |
|
|
|
const _paq = window._paq = window._paq || [] //eslint-disable-line
|
|
|
|
const _paq = window._paq = window._paq || [] //eslint-disable-line
|
|
|
|
|
|
|
|
|
|
|
|
export class CompileTab extends Plugin { |
|
|
|
export class CompileTab { |
|
|
|
public compiler |
|
|
|
public compiler |
|
|
|
public optimize |
|
|
|
public optimize |
|
|
|
public runs |
|
|
|
public runs |
|
|
@ -27,7 +17,6 @@ export class CompileTab extends Plugin { |
|
|
|
public event |
|
|
|
public event |
|
|
|
|
|
|
|
|
|
|
|
constructor (public api, public contentImport) { |
|
|
|
constructor (public api, public contentImport) { |
|
|
|
super(profile) |
|
|
|
|
|
|
|
this.event = new EventEmitter() |
|
|
|
this.event = new EventEmitter() |
|
|
|
this.compiler = new Compiler((url, cb) => api.resolveContentAndSave(url).then((result) => cb(null, result)).catch((error) => cb(error.message))) |
|
|
|
this.compiler = new Compiler((url, cb) => api.resolveContentAndSave(url).then((result) => cb(null, result)).catch((error) => cb(error.message))) |
|
|
|
} |
|
|
|
} |
|
|
|