add etherscan plugin

pull/2620/head
yann300 2 years ago committed by Seth Samuel
parent cd9d89259a
commit 45d0852728
  1. 13
      apps/etherscan/src/app/app.tsx
  2. 3
      apps/etherscan/src/app/components/HeaderWithSettings.tsx
  3. 13
      apps/etherscan/src/app/components/SubmitButton.tsx
  4. 8
      apps/etherscan/src/app/hooks/useLocalStorage.tsx
  5. 4
      apps/etherscan/src/app/routes.tsx
  6. 10
      apps/etherscan/src/app/utils/utilities.ts
  7. 4
      apps/etherscan/src/app/views/CaptureKeyView.tsx
  8. 4
      apps/etherscan/src/app/views/ErrorView.tsx
  9. 12
      apps/etherscan/src/app/views/VerifyView.tsx

@ -43,11 +43,20 @@ const App = () => {
contractsRef.current = contracts
useEffect(() => {
<<<<<<< HEAD
=======
console.log("Remix Etherscan loading...")
>>>>>>> e02014ca4 (add etherscan plugin)
const client = new PluginClient()
createClient(client)
const loadClient = async () => {
await client.onload()
setClientInstance(client)
<<<<<<< HEAD
=======
console.log("Remix Etherscan Plugin has been loaded")
>>>>>>> e02014ca4 (add etherscan plugin)
client.on("solidity",
"compilationFinished",
(
@ -56,6 +65,10 @@ const App = () => {
languageVersion: string,
data: CompilationResult
) => {
<<<<<<< HEAD
=======
console.log("New compilation received")
>>>>>>> e02014ca4 (add etherscan plugin)
const newContractsNames = getNewContractNames(data)
const newContractsToSave: string[] = [

@ -18,7 +18,10 @@ interface IconProps {
const HomeIcon: React.FC<IconProps> = ({ from, themeType }: IconProps) => {
return (
<NavLink
<<<<<<< HEAD
data-id="home"
=======
>>>>>>> e02014ca4 (add etherscan plugin)
data-toggle="tooltip"
data-placement="top"
title="Home"

@ -3,17 +3,26 @@ import React from "react"
interface Props {
text: string
isSubmitting?: boolean
<<<<<<< HEAD
dataId?: string
=======
>>>>>>> e02014ca4 (add etherscan plugin)
}
export const SubmitButton: React.FC<Props> = ({
text,
<<<<<<< HEAD
dataId,
=======
>>>>>>> e02014ca4 (add etherscan plugin)
isSubmitting = false,
}) => {
return (
<button
<<<<<<< HEAD
data-id={dataId}
=======
>>>>>>> e02014ca4 (add etherscan plugin)
style={{ padding: "0.25rem 0.4rem", marginRight: "0.5em" }}
type="submit"
className="btn btn-primary"
@ -29,7 +38,11 @@ export const SubmitButton: React.FC<Props> = ({
aria-hidden="true"
style={{ marginRight: "0.3em" }}
/>
<<<<<<< HEAD
Verifying... Please wait
=======
Verifying...Please wait
>>>>>>> e02014ca4 (add etherscan plugin)
</div>
)}
</button>

@ -11,7 +11,11 @@ export function useLocalStorage(key: string, initialValue: any) {
return item ? JSON.parse(item) : initialValue
} catch (error) {
// If error also return initialValue
<<<<<<< HEAD
console.error(error)
=======
console.log(error)
>>>>>>> e02014ca4 (add etherscan plugin)
return initialValue
}
})
@ -29,7 +33,11 @@ export function useLocalStorage(key: string, initialValue: any) {
window.localStorage.setItem(key, JSON.stringify(valueToStore))
} catch (error) {
// A more advanced implementation would handle the error case
<<<<<<< HEAD
console.error(error)
=======
console.log(error)
>>>>>>> e02014ca4 (add etherscan plugin)
}
}

@ -1,6 +1,10 @@
import React from "react"
import {
<<<<<<< HEAD
HashRouter as Router,
=======
BrowserRouter as Router,
>>>>>>> e02014ca4 (add etherscan plugin)
Route,
Routes,
RouteProps,

@ -13,7 +13,13 @@ export const getNetworkName = async (client: RemixClient) => {
if (!network) {
throw new Error("no known network to verify against")
}
<<<<<<< HEAD
return network.name!.toLowerCase()
=======
const name = network.name!.toLowerCase()
// TODO : remove that when https://github.com/ethereum/remix-ide/issues/2017 is fixe
return name === "görli" ? "goerli" : name
>>>>>>> e02014ca4 (add etherscan plugin)
}
export const getReceiptStatus = async (
@ -27,6 +33,10 @@ export const getReceiptStatus = async (
const { result } = response.data
return result
} catch (error) {
<<<<<<< HEAD
console.error(error)
=======
console.log("Error", error)
>>>>>>> e02014ca4 (add etherscan plugin)
}
}

@ -48,7 +48,11 @@ export const CaptureKeyView: React.FC = () => {
</div>
<div>
<<<<<<< HEAD
<SubmitButton text="Save API key" dataId="save-api-key" />
=======
<SubmitButton text="Save API key" />
>>>>>>> e02014ca4 (add etherscan plugin)
</div>
</form>
)}

@ -21,7 +21,11 @@ export const ErrorView: React.FC = () => {
Please raise an issue:{" "}
<a
style={{ color: "red" }}
<<<<<<< HEAD
href="https://github.com/ethereum/remix-project/issues"
=======
href="https://github.com/machinalabs/remix-etherscan/issues"
>>>>>>> e02014ca4 (add etherscan plugin)
>
Here
</a>

@ -170,7 +170,11 @@ export const VerifyView: React.FC<Props> = ({
}
return result
} catch (error) {
<<<<<<< HEAD
console.error(error)
=======
console.log("Error, something wrong happened", error)
>>>>>>> e02014ca4 (add etherscan plugin)
setResults("Something wrong happened, try again")
}
}
@ -284,12 +288,20 @@ export const VerifyView: React.FC<Props> = ({
/>
</div>
<<<<<<< HEAD
<SubmitButton dataId="verify-contract" text="Verify Contract" isSubmitting={isSubmitting} />
=======
<SubmitButton text="Verify Contract" isSubmitting={isSubmitting} />
>>>>>>> e02014ca4 (add etherscan plugin)
</form>
)}
</Formik>
<<<<<<< HEAD
<div data-id="verify-result"
=======
<div
>>>>>>> e02014ca4 (add etherscan plugin)
style={{ marginTop: "2em", fontSize: "0.8em", textAlign: "center" }}
dangerouslySetInnerHTML={{ __html: results }}
/>

Loading…
Cancel
Save