From 6df698722463aaf83e315a2153dff016d3381ed8 Mon Sep 17 00:00:00 2001 From: lianahus Date: Thu, 5 May 2022 14:09:30 +0200 Subject: [PATCH] updated the ui --- .../contracts/solidity_compiler_config.json | 24 +-- .../src/lib/compiler-container.tsx | 186 ++++++++---------- 2 files changed, 88 insertions(+), 122 deletions(-) diff --git a/apps/remix-ide/contracts/solidity_compiler_config.json b/apps/remix-ide/contracts/solidity_compiler_config.json index 7b93fa3532..88cb6ab548 100644 --- a/apps/remix-ide/contracts/solidity_compiler_config.json +++ b/apps/remix-ide/contracts/solidity_compiler_config.json @@ -1,24 +1,12 @@ { - "_comment": "for foll description visit https://docs.soliditylang.org/en/develop/using-the-compiler.html?highlight=standard%20json#input-description", + "_comment": "For more info please visit https://docs.soliditylang.org/en/develop/using-the-compiler.html?highlight=standard%20json#input-description", "language": "Solidity", - "sources": - { - "myFile.sol": - { - "keccak256": "0x123...", - "urls": [ - ] - }, - "destructible": - { - } - }, "settings": { "stopAfter": "parsing", "remappings": [ ":g=/dir" ], "optimizer": { - "enabled": true, + "enabled": false, "runs": 200, "details": { "peephole": true, @@ -31,10 +19,11 @@ "yul": false, "yulDetails": { "stackAllocation": true, + "optimizerSteps": "dhfoDgvulfnTUtnIf..." } } }, - "evmVersion": "london", + "evmVersion": "byzantium", "viaIR": true, "debug": { "revertStrings": "default", @@ -44,8 +33,6 @@ "useLiteralContent": true, "bytecodeHash": "ipfs" }, - "libraries": { - }, "outputSelection": { "*": { "*": [ @@ -62,9 +49,6 @@ }, "modelChecker": { - "contracts": - { - }, "divModNoSlacks": false, "engine": "chc", "invariants": ["contract", "reentrancy"], diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index 8fada2cb3a..15f9bb8a9f 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -156,8 +156,9 @@ export const CompilerContainer = (props: CompilerContainerProps) => { } const createNewConfigFile = async () => { - await api.writeFile(configFilePathInput.current.value, "") - setConfigFilePath(configFilePathInput.current.value) + const configFileContent = + await api.writeFile(configFilePathInput.current.value, "") + setConfigFilePath(configFilePathInput.current.value) } const handleConfigPathChange = async () => { if (await api.fileExists(configFilePathInput.current.value)) @@ -166,7 +167,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { modal( 'New configuration file', 'The file you entered does not exist. Do you want to create a new one?', 'Create', - async () => await createNewConfigFile, + async () => await createNewConfigFile(), 'Cancel', () => {} ) @@ -568,12 +569,29 @@ export const CompilerContainer = (props: CompilerContainerProps) => { return (
-
-
- - +
+
+ + +
+
+ { !showFilePathInput && {configFilePath} } + { + if (event.key === 'Enter') { + handleConfigPathChange() + } + }} + /> + { !showFilePathInput && }
-
+
+
+
-
-
-
- - -
-
-
- { handleOptimizeChange(e.target.checked) }} className="custom-control-input" id="optimize" type="checkbox" checked={state.optimize} /> - - onChangeRuns(e.target.value)} - disabled={!state.optimize} - /> -
-
-
- - -
+
+
+ { handleOptimizeChange(e.target.checked) }} className="custom-control-input" id="optimize" type="checkbox" checked={state.optimize} /> + + onChangeRuns(e.target.value)} + disabled={!state.optimize} + />
- { - isHardhatProject && - - }
-
- - + +
+ +
-
- { !showFilePathInput && {configFilePath} } - { showFilePathInput && { - if (event.key === 'Enter') { - handleConfigPathChange() - } - }} - /> } - { !showFilePathInput && } +
+ +
{ isHardhatProject && @@ -704,52 +686,52 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
}
- -
- - -
-
Choose the script to execute right after compilation by adding the `dev-run-script` natspec tag, as in:
-
-                      
-                      /**
- * @title ContractName
- * @dev ContractDescription
- * @custom:dev-run-script file_path
- */
- contract ContractName {'{}'}
-
-
- Click to know more + + +
+ + +
+
Choose the script to execute right after compilation by adding the `dev-run-script` natspec tag, as in:
+
+                    
+                    /**
+ * @title ContractName
+ * @dev ContractDescription
+ * @custom:dev-run-script file_path
+ */
+ contract ContractName {'{}'}
+
+
+ Click to know more +
+ + }>
'@custom:dev-run-script file_path'} direction='top'>