@ -42,23 +42,23 @@ export const ContractSelection = (props: ContractSelectionProps) => {
}
}
const copyABI = ( ) = > {
const copyABI = ( ) = > {
copyContractProperty ( 'abi' )
return copyContractProperty ( 'abi' )
}
}
const copyContractProperty = ( property ) = > {
const copyContractProperty = ( property ) = > {
let content = getContractProperty ( property )
let content = getContractProperty ( property )
// if (!content) {
if ( ! content ) {
// addTooltip('No content available for ' + property)
// addTooltip('No content available for ' + property)
// return
return
// }
}
// try {
try {
// if (typeof content !== 'string') {
if ( typeof content !== 'string' ) {
// content = JSON.stringify(content, null, '\t')
content = JSON . stringify ( content , null , '\t' )
// }
}
// } catch (e) {}
} catch ( e ) { }
// copy(content)
return content
// addTooltip('Copied value to clipboard')
// addTooltip('Copied value to clipboard')
}
}
@ -180,7 +180,7 @@ export const ContractSelection = (props: ContractSelectionProps) => {
}
}
const copyBytecode = ( ) = > {
const copyBytecode = ( ) = > {
copyContractProperty ( 'bytecode' )
return copyContractProperty ( 'bytecode' )
}
}
return (
return (
@ -211,14 +211,18 @@ export const ContractSelection = (props: ContractSelectionProps) => {
< div className = "remixui_contractHelperButtons" >
< div className = "remixui_contractHelperButtons" >
< div className = "input-group" >
< div className = "input-group" >
< div className = "btn-group" role = "group" aria - label = "Copy to Clipboard" >
< div className = "btn-group" role = "group" aria - label = "Copy to Clipboard" >
< button className = "btn copyButton" title = "Copy ABI to clipboard" onClick = { ( ) = > { copyABI ( ) } } >
< CopyToClipboard title = "Copy ABI to clipboard" content = { copyABI ( ) } direction = 'top' >
< i className = "remixui_copyIcon far fa-copy" aria - hidden = "true" > < / i >
< button className = "btn remixui_copyButton" title = "Copy ABI to clipboard" >
< span > ABI < / span >
< i className = "remixui_copyIcon far fa-copy" aria - hidden = "true" > < / i >
< / button >
< span > ABI < / span >
< button className = "btn remixui_copyButton" title = "Copy Bytecode to clipboard" onClick = { ( ) = > { copyBytecode ( ) } } >
< / button >
< i className = "remixui_copyIcon far fa-copy" aria - hidden = "true" > < / i >
< / CopyToClipboard >
< span > Bytecode < / span >
< CopyToClipboard title = "Copy ABI to clipboard" content = { copyBytecode ( ) } direction = 'top' >
< / button >
< button className = "btn remixui_copyButton" title = "Copy Bytecode to clipboard" >
< i className = "remixui_copyIcon far fa-copy" aria - hidden = "true" > < / i >
< span > Bytecode < / span >
< / button >
< / CopyToClipboard >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >