diff --git a/packages/govern-console/src/components/ActionBuilder/Screens/AbiForm.tsx b/packages/govern-console/src/components/ActionBuilder/Screens/AbiForm.tsx index 47016d08..a25a8759 100644 --- a/packages/govern-console/src/components/ActionBuilder/Screens/AbiForm.tsx +++ b/packages/govern-console/src/components/ActionBuilder/Screens/AbiForm.tsx @@ -21,6 +21,7 @@ import { constants } from 'ethers'; type FormInput = { contractAddress: string; + implementationAddress: string; abi: string; }; @@ -45,15 +46,17 @@ export const AbiForm: React.FC = () => { }, [getValues, gotoFunctionSelector]); const fetchAbi = useCallback(async () => { - const validationResult = await trigger('contractAddress'); + const validationResult = + (await trigger('contractAddress')) && (await trigger('implementationAddress')); if (validationResult === false) { // address is invalid return; } const address = getValues('contractAddress'); + const implementationAddress = getValues('implementationAddress'); const abiHandler = new AbiHandler(networkName); - const abi = await abiHandler.get(address); + const abi = await abiHandler.get(implementationAddress || address); if (abi) { gotoFunctionSelector(address, abi); } else { @@ -101,7 +104,29 @@ export const AbiForm: React.FC = () => { )} /> -
+
+ Implementation address (optional) + !value || (await validateContract(value, provider)), + }} + render={({ field: { onChange, value }, fieldState: { error } }) => ( + + )} + /> +
+
{!compact && formState.errors.contractAddress && (
filler