-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1196 from alleslabs/feature/vyper-contract-code
FRO-763: Verify Contract - Vyper - Contract Code
- Loading branch information
Showing
6 changed files
with
84 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 58 additions & 2 deletions
60
src/lib/pages/evm-contract-verify/components/vyper/EvmContractVerifyVyperContractCode.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,59 @@ | ||
export const EvmContractVerifyVyperContractCode = () => { | ||
return <div>TODO: EvmContractVerifyVyperContractCode</div>; | ||
import { Control, useController } from "react-hook-form"; | ||
import { EvmContractVerifyForm } from "../../types"; | ||
import { Heading, Stack } from "@chakra-ui/react"; | ||
import { ConstructorArgs } from "../ConstructorArgs"; | ||
import { EvmVersionToTarget } from "../EvmVersionToTarget"; | ||
import { ControllerInput, ControllerTextarea } from "lib/components/forms"; | ||
|
||
interface EvmContractVerifyVyperContractCodeProps { | ||
control: Control<EvmContractVerifyForm>; | ||
} | ||
|
||
export const EvmContractVerifyVyperContractCode = ({ | ||
control, | ||
}: EvmContractVerifyVyperContractCodeProps) => { | ||
const { | ||
fieldState: { error: contractNameError }, | ||
} = useController({ | ||
control, | ||
name: "verifyForm.form.contractName", | ||
}); | ||
|
||
const { | ||
fieldState: { error: contractCodeError }, | ||
} = useController({ | ||
control, | ||
name: "verifyForm.form.contractCode", | ||
}); | ||
|
||
return ( | ||
<Stack spacing={12}> | ||
<Stack spacing={6}> | ||
<Heading as="h6" variant="h6"> | ||
Provide Contract Code | ||
</Heading> | ||
<ControllerInput | ||
label="Contract Name" | ||
placeholder="Provide contract name" | ||
name="verifyForm.form.contractName" | ||
isRequired | ||
control={control} | ||
variant="fixed-floating" | ||
error={contractNameError?.message} | ||
/> | ||
<ControllerTextarea | ||
label="Contract Code" | ||
placeholder="Provide contract source code here" | ||
name="verifyForm.form.contractCode" | ||
isRequired | ||
control={control} | ||
variant="fixed-floating" | ||
error={contractCodeError?.message} | ||
height="400px" | ||
/> | ||
</Stack> | ||
<ConstructorArgs control={control} /> | ||
<EvmVersionToTarget control={control} /> | ||
</Stack> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters