|
|
@ -57,10 +57,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) { |
|
|
|
content: currentFile |
|
|
|
content: currentFile |
|
|
|
}) |
|
|
|
}) |
|
|
|
enableAtAddress(true) |
|
|
|
enableAtAddress(true) |
|
|
|
} else if (/.(.sol)$/.exec(currentFile) || |
|
|
|
} else if (isContractFile(currentFile)) { |
|
|
|
/.(.vy)$/.exec(currentFile) || // vyper
|
|
|
|
|
|
|
|
/.(.lex)$/.exec(currentFile) || // lexon
|
|
|
|
|
|
|
|
/.(.contract)$/.exec(currentFile)) { |
|
|
|
|
|
|
|
setAbiLabel({ |
|
|
|
setAbiLabel({ |
|
|
|
display: 'none', |
|
|
|
display: 'none', |
|
|
|
content: '' |
|
|
|
content: '' |
|
|
@ -115,6 +112,13 @@ export function ContractDropdownUI (props: ContractDropdownProps) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const isContractFile = (file) => { |
|
|
|
|
|
|
|
return /.(.sol)$/.exec(file) || |
|
|
|
|
|
|
|
/.(.vy)$/.exec(file) || // vyper
|
|
|
|
|
|
|
|
/.(.lex)$/.exec(file) || // lexon
|
|
|
|
|
|
|
|
/.(.contract)$/.exec(file) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const enableAtAddress = (enable: boolean) => { |
|
|
|
const enableAtAddress = (enable: boolean) => { |
|
|
|
if (enable) { |
|
|
|
if (enable) { |
|
|
|
setAtAddressOptions({ |
|
|
|
setAtAddressOptions({ |
|
|
@ -214,7 +218,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) { |
|
|
|
<div className="udapp_container" data-id="contractDropdownContainer"> |
|
|
|
<div className="udapp_container" data-id="contractDropdownContainer"> |
|
|
|
<label className="udapp_settingsLabel">Contract</label> |
|
|
|
<label className="udapp_settingsLabel">Contract</label> |
|
|
|
<div className="udapp_subcontainer"> |
|
|
|
<div className="udapp_subcontainer"> |
|
|
|
<select ref={contractsRef} value={currentContract} onChange={handleContractChange} className="udapp_contractNames custom-select" disabled={contractOptions.disabled} title={contractOptions.title} style={{ display: loadType === 'abi' ? 'none' : 'block' }}> |
|
|
|
<select ref={contractsRef} value={currentContract} onChange={handleContractChange} className="udapp_contractNames custom-select" disabled={contractOptions.disabled} title={contractOptions.title} style={{ display: loadType === 'abi' && !isContractFile(currentFile) ? 'none' : 'block' }}> |
|
|
|
{ (contractList[currentFile] || []).map((contract, index) => { |
|
|
|
{ (contractList[currentFile] || []).map((contract, index) => { |
|
|
|
return <option key={index} value={contract.alias}>{contract.alias} - {contract.file}</option> |
|
|
|
return <option key={index} value={contract.alias}>{contract.alias} - {contract.file}</option> |
|
|
|
}) } |
|
|
|
}) } |
|
|
@ -258,7 +262,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) { |
|
|
|
</div> : '' |
|
|
|
</div> : '' |
|
|
|
} |
|
|
|
} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className="udapp_orLabel mt-2" style={{ display: loadType === 'abi' ? 'none' : 'block' }}>or</div> |
|
|
|
<div className="udapp_orLabel mt-2" style={{ display: loadType === 'abi' && !isContractFile(currentFile) ? 'none' : 'block' }}>or</div> |
|
|
|
<div className="udapp_button udapp_atAddressSect"> |
|
|
|
<div className="udapp_button udapp_atAddressSect"> |
|
|
|
<button className="udapp_atAddress btn btn-sm btn-info" id="runAndDeployAtAdressButton" disabled={atAddressOptions.disabled} title={atAddressOptions.title} onClick={loadFromAddress}>At Address</button> |
|
|
|
<button className="udapp_atAddress btn btn-sm btn-info" id="runAndDeployAtAdressButton" disabled={atAddressOptions.disabled} title={atAddressOptions.title} onClick={loadFromAddress}>At Address</button> |
|
|
|
<input |
|
|
|
<input |
|
|
|