Skip to content

Comments

downgrade wagmi and viem version#1038

Merged
technophile-04 merged 1 commit intomainfrom
lower-wagmi-version
Jan 24, 2025
Merged

downgrade wagmi and viem version#1038
technophile-04 merged 1 commit intomainfrom
lower-wagmi-version

Conversation

@technophile-04
Copy link
Collaborator

@technophile-04 technophile-04 commented Jan 24, 2025

Description

Lowered the wagmi nd viem version. Because in latest wagmi/viem versions they stopped simulating the contract write function before giving wallet pop up.

I'm not sure if it was intended by them or by mistake. Created a detailed issue wevm/wagmi#4516

But for now lowered the wagmi nd viem version until they answer or fix it in latest version

This also will remove the blocker from this issue: BuidlGuidl/ctf.buidlguidl.com#7

Maybe we can release the create-eth latest version helpful for ctf after we merge this 🙌

To test:

Add this in externalContracts.tsand switch to sepolia.

externalContracts.ts
import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract";

/**
* @example
* const externalContracts = {
*   1: {
*     DAI: {
*       address: "0x...",
*       abi: [...],
*     },
*   },
* } as const;
*/
const externalContracts = {
 11155111: {
   YourContract: {
     address: "0x3A897AaAcFCdd13b6A5F2b9fb85F36AFFa49442c",
     abi: [
       {
         inputs: [
           {
             internalType: "address",
             name: "_owner",
             type: "address",
           },
         ],
         stateMutability: "nonpayable",
         type: "constructor",
       },
       {
         anonymous: false,
         inputs: [
           {
             indexed: true,
             internalType: "address",
             name: "greetingSetter",
             type: "address",
           },
           {
             indexed: false,
             internalType: "string",
             name: "newGreeting",
             type: "string",
           },
           {
             indexed: false,
             internalType: "bool",
             name: "premium",
             type: "bool",
           },
           {
             indexed: false,
             internalType: "uint256",
             name: "value",
             type: "uint256",
           },
         ],
         name: "GreetingChange",
         type: "event",
       },
       {
         inputs: [],
         name: "greeting",
         outputs: [
           {
             internalType: "string",
             name: "",
             type: "string",
           },
         ],
         stateMutability: "view",
         type: "function",
       },
       {
         inputs: [],
         name: "owner",
         outputs: [
           {
             internalType: "address",
             name: "",
             type: "address",
           },
         ],
         stateMutability: "view",
         type: "function",
       },
       {
         inputs: [],
         name: "premium",
         outputs: [
           {
             internalType: "bool",
             name: "",
             type: "bool",
           },
         ],
         stateMutability: "view",
         type: "function",
       },
       {
         inputs: [
           {
             internalType: "string",
             name: "_newGreeting",
             type: "string",
           },
         ],
         name: "setGreeting",
         outputs: [],
         stateMutability: "payable",
         type: "function",
       },
       {
         inputs: [],
         name: "totalCounter",
         outputs: [
           {
             internalType: "uint256",
             name: "",
             type: "uint256",
           },
         ],
         stateMutability: "view",
         type: "function",
       },
       {
         inputs: [
           {
             internalType: "address",
             name: "",
             type: "address",
           },
         ],
         name: "userGreetingCounter",
         outputs: [
           {
             internalType: "uint256",
             name: "",
             type: "uint256",
           },
         ],
         stateMutability: "view",
         type: "function",
       },
       {
         inputs: [],
         name: "withdraw",
         outputs: [],
         stateMutability: "nonpayable",
         type: "function",
       },
       {
         stateMutability: "payable",
         type: "receive",
       },
     ],
     inheritedFunctions: {},
   },
 },
} as const;

export default externalContracts satisfies GenericContractsDeclaration;

try clicking withdraw function on both main and this branch

Copy link
Member

@rin-st rin-st left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@technophile-04
Copy link
Collaborator Author

Thanks Rinat merghing this for now 🙌

@technophile-04 technophile-04 merged commit 576c94f into main Jan 24, 2025
1 check passed
@technophile-04 technophile-04 deleted the lower-wagmi-version branch January 24, 2025 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants