diff --git a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx index c5f6f394ce..20965b644f 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx @@ -5,6 +5,7 @@ import { ContractGUIProps } from '../types' import { CopyToClipboard } from '@remix-ui/clipboard' const txFormat = remixLib.execution.txFormat +const txHelper = remixLib.execution.txHelper export function ContractGUI (props: ContractGUIProps) { const [title, setTitle] = useState('') const [basicInput, setBasicInput] = useState('') @@ -74,7 +75,7 @@ export function ContractGUI (props: ContractGUIProps) { } }, [props.lookupOnly, props.funcABI, title]) - const getContentOnCTC = () => { + const getEncodedCall = () => { const multiString = getMultiValsString(multiFields.current) // copy-to-clipboard icon is only visible for method requiring input params if (!multiString) { @@ -95,6 +96,20 @@ export function ContractGUI (props: ContractGUIProps) { } } + const getEncodedParams = () => { + try { + const multiString = getMultiValsString(multiFields.current) + // copy-to-clipboard icon is only visible for method requiring input params + if (!multiString) { + return 'cannot encode empty arguments' + } + const multiJSON = JSON.parse('[' + multiString + ']') + return txHelper.encodeParams(props.funcABI, multiJSON) + } catch (e) { + console.error(e) + } + } + const switchMethodViewOn = () => { setToggleContainer(true) makeMultiVal() @@ -250,9 +265,28 @@ export function ContractGUI (props: ContractGUIProps) { ) })} -
- - +
+ + + + + + +
diff --git a/libs/remix-ui/run-tab/src/lib/components/multiDeployInput.tsx b/libs/remix-ui/run-tab/src/lib/components/multiDeployInput.tsx index cec20b223c..6f3d355852 100644 --- a/libs/remix-ui/run-tab/src/lib/components/multiDeployInput.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/multiDeployInput.tsx @@ -2,13 +2,13 @@ import React, { useRef, useState } from 'react' import { MultiDeployInputProps } from '../types' import { DeployButton } from './deployButton' -export function MultiDeployInput (props: MultiDeployInputProps) { +export function MultiDeployInput(props: MultiDeployInputProps) { const multiFields = useRef>([]) - - return ( + + return (
-
+
Deploy
diff --git a/libs/remix-ui/run-tab/src/lib/css/run-tab.css b/libs/remix-ui/run-tab/src/lib/css/run-tab.css index 2921381007..1c9cd7fe5b 100644 --- a/libs/remix-ui/run-tab/src/lib/css/run-tab.css +++ b/libs/remix-ui/run-tab/src/lib/css/run-tab.css @@ -357,7 +357,7 @@ border-bottom-left-radius: 0; } .udapp_contractProperty button { - min-width: 100px; + min-width: 80px; width: 100px; margin:0; word-break: inherit;