Clean up code

pull/2260/head
David Disu 3 years ago
parent c62756251c
commit 735bfce8a2
  1. 91
      libs/remix-core-plugin/src/lib/constants/uups.ts
  2. 100
      libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts
  3. 1
      libs/remix-lib/src/execution/txFormat.ts
  4. 1
      libs/remix-ui/run-tab/src/lib/actions/deploy.ts
  5. 6
      libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx
  6. 6
      libs/remix-ui/run-tab/src/lib/components/deployButton.tsx
  7. 1
      libs/remix-ui/run-tab/src/lib/components/mainnet.tsx
  8. 7
      libs/remix-ui/run-tab/src/lib/components/multiDeployInput.tsx

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -94,7 +94,6 @@ export function encodeParams (params, funAbi, callback) {
* @param {Function} callback - callback
*/
export function encodeFunctionCall (params, funAbi, callback) {
console.log('params: ', params)
encodeParams(params, funAbi, (error, encodedParam) => {
if (error) return callback(error)
callback(null, { dataHex: encodeFunctionId(funAbi) + encodedParam.dataHex, funAbi, funArgs: encodedParam.funArgs })

@ -160,7 +160,6 @@ export const createInstance = async (
if (isProxyDeployment) {
const initABI = contractObject.abi.find(abi => abi.name === 'initialize')
console.log('args: ', args)
plugin.call('openzeppelin-proxy', 'execute', addressToString(address), args, initABI, contractObject)
}
}

@ -1,9 +1,8 @@
// eslint-disable-next-line no-use-before-define
import React, { Ref, useEffect, useRef, useState } from 'react'
import React, { useEffect, useRef, useState } from 'react'
import * as remixLib from '@remix-project/remix-lib'
import { ContractGUIProps } from '../types'
import { CopyToClipboard } from '@remix-ui/clipboard'
import { DeployButton } from './deployButton'
import { MultiDeployInput } from './multiDeployInput'
import { DeployInput } from './deployInput'
@ -158,7 +157,6 @@ export function ContractGUI (props: ContractGUIProps) {
const getMultiValsString = (fields: HTMLInputElement[]) => {
const valArray = fields
console.log('valArray: ', valArray)
let ret = ''
const valArrayTest = []
@ -208,7 +206,6 @@ export function ContractGUI (props: ContractGUIProps) {
const handleActionClick = () => {
const deployMode = selectedDeployIndex !== null ? [props.deployOption[selectedDeployIndex].title] : []
console.log('basicInput: ', basicInput)
props.clickCallBack(props.funcABI.inputs, basicInput, deployMode)
}
@ -219,7 +216,6 @@ export function ContractGUI (props: ContractGUIProps) {
}
const handleMultiValsSubmit = (fields: HTMLInputElement[]) => {
console.log('fields: ', fields)
const valsString = getMultiValsString(fields)
const deployMode = selectedDeployIndex !== null ? [props.deployOption[selectedDeployIndex].title] : []

@ -12,9 +12,9 @@ export function DeployButton (props: DeployButtonProps) {
return (
<>
{ props.deployOptions && (props.deployOptions || []).length > 0 ?
<Dropdown as={ButtonGroup} show={showOptions}>
<button onClick={props.handleActionClick} title={props.buttonOptions.title} className={`udapp_instanceButton ${props.buttonOptions.widthClass} btn btn-sm ${props.buttonOptions.classList}`} data-id={props.buttonOptions.dataId}>Deploy</button>
<Dropdown.Toggle split id="dropdown-split-basic" className={`btn btn-sm dropdown-toggle dropdown-toggle-split ${props.buttonOptions.classList}`} style={{ maxWidth: 25, minWidth: 0, height: 32 }} onClick={toggleOptions} />
<Dropdown as={ButtonGroup} autoClose="outside">
<button onClick={props.handleActionClick} title={props.buttonOptions.title} className={`udapp_instanceButton ${props.buttonOptions.widthClass} btn btn-sm ${props.buttonOptions.classList}`} data-id={props.buttonOptions.dataId}>{ props.deployOptions[props.selectedIndex] ? props.deployOptions[props.selectedIndex].title : 'Deploy' }</button>
<Dropdown.Toggle split id="dropdown-split-basic" className={`btn btn-sm dropdown-toggle dropdown-toggle-split ${props.buttonOptions.classList}`} style={{ maxWidth: 25, minWidth: 0, height: 32 }} />
<Dropdown.Menu className="deploy-items border-0">
{
(props.deployOptions).map(({ title, active }, index) => <Dropdown.Item onClick={() => {

@ -22,7 +22,6 @@ export function MainnetPrompt (props: MainnetProps) {
}, [])
const onMaxFeeChange = (value: string) => {
console.log('value: ', value)
const maxFee = value
// @ts-ignore
if (parseInt(props.network.lastBlock.baseFeePerGas, 16) > Web3.utils.toWei(maxFee, 'Gwei')) {

@ -3,14 +3,7 @@ import { MultiDeployInputProps } from '../types'
import { DeployButton } from './deployButton'
export function MultiDeployInput (props: MultiDeployInputProps) {
const [showOptions, setShowOptions] = useState<boolean>(false)
const multiFields = useRef<Array<HTMLInputElement | null>>([])
const toggleOptions = () => {
setShowOptions(!showOptions)
}
// TODO: Clear multiFields after deployment.
return (
<div className="udapp_contractActionsContainerMulti" style={{ display: 'flex' }}>

Loading…
Cancel
Save