|
|
@ -203,11 +203,6 @@ export const ContractSelection = (props: ContractSelectionProps) => { |
|
|
|
return copyContractProperty('bytecode') |
|
|
|
return copyContractProperty('bytecode') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Local property to hold flattend contract result |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
// let content4AST: string
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Take AST and generates a UML diagram of compiled contract as svg |
|
|
|
* Take AST and generates a UML diagram of compiled contract as svg |
|
|
|
* @returns void |
|
|
|
* @returns void |
|
|
@ -240,7 +235,12 @@ export const ContractSelection = (props: ContractSelectionProps) => { |
|
|
|
setContent4AST(concatSourceFiles(sorted, sources)) |
|
|
|
setContent4AST(concatSourceFiles(sorted, sources)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const showFlattener = () => { |
|
|
|
|
|
|
|
const confirmNodeType = api.getCompilationResult().data.sources[api.currentFile].ast.nodes.some(x => x.nodeType === 'ImportDirective') |
|
|
|
|
|
|
|
const currentFile = api.currentFile.split('/')[1] |
|
|
|
|
|
|
|
const contractListConfirm = contractList.some(x => x.file === currentFile) |
|
|
|
|
|
|
|
return confirmNodeType && contractListConfirm |
|
|
|
|
|
|
|
} |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
// define swarm logo
|
|
|
|
// define swarm logo
|
|
|
|
<> |
|
|
|
<> |
|
|
@ -254,16 +254,17 @@ export const ContractSelection = (props: ContractSelectionProps) => { |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<article className="mt-2 pb-0"> |
|
|
|
<article className="mt-2 pb-0"> |
|
|
|
<CustomTooltip |
|
|
|
{showFlattener() && <CustomTooltip |
|
|
|
placement="right-start" |
|
|
|
placement="right-start" |
|
|
|
tooltipId="flattenContractTooltip" |
|
|
|
tooltipId="flattenContractTooltip" |
|
|
|
tooltipClasses="text-nowrap" |
|
|
|
tooltipClasses="text-nowrap" |
|
|
|
tooltipText={`${intl.formatMessage({ id: 'solidity.flattenLabel' })}`} |
|
|
|
tooltipText={`${intl.formatMessage({ id: 'solidity.flattenLabel' })}`} |
|
|
|
> |
|
|
|
> |
|
|
|
<button id="contractFlattener" onClick={flattenContract} className="btn btn-secondary btn-block mt-2"> |
|
|
|
<button id="contractFlattener" onClick={flattenContract} className="btn btn-secondary btn-block mt-2"> |
|
|
|
<FormattedMessage id='solidity.flattenLabel' />{api.currentFile} |
|
|
|
<FormattedMessage id='solidity.flattenLabel' /> {api.currentFile} |
|
|
|
</button> |
|
|
|
</button> |
|
|
|
</CustomTooltip> |
|
|
|
</CustomTooltip> |
|
|
|
|
|
|
|
} |
|
|
|
<CustomTooltip |
|
|
|
<CustomTooltip |
|
|
|
placement="right-start" |
|
|
|
placement="right-start" |
|
|
|
tooltipId="generateUMLTooltip" |
|
|
|
tooltipId="generateUMLTooltip" |
|
|
|