From 78c3cdecf8ed12c8cba5cc6b915f7dfbec190016 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Sun, 11 Feb 2024 14:45:41 +0100 Subject: [PATCH] copy abi and bytecode markup and logic --- apps/vyper/src/app/components/VyperResult.tsx | 37 +++++++++++++++---- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/apps/vyper/src/app/components/VyperResult.tsx b/apps/vyper/src/app/components/VyperResult.tsx index 56c32702de..a1f799cfb0 100644 --- a/apps/vyper/src/app/components/VyperResult.tsx +++ b/apps/vyper/src/app/components/VyperResult.tsx @@ -1,16 +1,21 @@ import React, {useState} from 'react' -import {VyperCompilationOutput, isCompilationError} from '../utils' -import Tabs from 'react-bootstrap/Tabs' -import Tab from 'react-bootstrap/Tab' -import Button from 'react-bootstrap/Button' +import {isCompilationError} from '../utils' import {CopyToClipboard} from '@remix-ui/clipboard' -import { VyperCompilationResult } from '../utils/types' interface VyperResultProps { output?: any plugin?: any } +export type OutputType = { + contractName: string + abi: any + bytecode: any + runtimeBytecode: any + ir: string + methodIdentifiers: any +} + export type ExampleContract = { name: string address: string @@ -24,7 +29,6 @@ type TabContentMembers = { } function VyperResult({ output, plugin }: VyperResultProps) { - // const [active, setActive] = useState('abi') if (!output) return ( @@ -51,15 +55,34 @@ function VyperResult({ output, plugin }: VyperResultProps) { ) } + return ( <>
-
+
+
+
+
+ (Object.values(output)[0] as OutputType).abi} direction="bottom" icon="far fa-copy"> + + + (Object.values(output)[0] as OutputType).bytecode.object} direction="bottom" icon="far fa-copy"> + + +
+
+
)