TS TSender UI (Read Contract Wagmi) Can't read allowance #103
Replies: 3 comments 10 replies
|
Did you follow the instructions on this page https://github.com/Cyfrin/ts-tsender-ui-cu/blob/main/CONTRIBUTING.md to spin up your local Anvil chain? |
|
Sure I did, using tsender-deployed.json node via anvil --load-state tsender-deployed.json. I followed instruction through and through. On importing the token on the anvil local chain, it showed 0 MT balance unlike 100 MT in Patrick's tut |
|
Hello EngrPips! First of all I really want to appreciate you immensely for your contribution so far, you are a gem bud! Well the good news is even though that did not work, I have been able to solve the major problem through the help of DeepSeek and errors are gone. First, I made a mistake on my part by spinning up Anvil instead of pnpm run anvil, I forgot I saved load state in package.json script, hence missing the major error I should have got after loading state. The second and major issue is that the state dump file (tsender-deployed.json) was created with an older version of Anvil that included detailed transaction tracing data (traces, decoded, ordering fields). While I am using a more recent Anvil version which uses a simpler, cleaner format without these fields, causing a version incompatibility. I will outline the issue and solution directly from DeepSeek for the sake of others that may encounter this same issue in future <Anvil State Dump Compatibility Issue - Solution Guide> The Problem Root Cause The Solution Step 1: Create a conversion script Step 2: Run the conversion script Step 3: Update your package.json Step 4: Run Anvil Why This Works
Alternative Solution (If you have the contract source code) Credits With this I was able to get pass the error and arrive at same answer with our tutor. I hope this helps. |





Hello EngrPips! First of all I really want to appreciate you immensely for your contribution so far, you are a gem bud!
So apparently I discovered that contract address does not work because when import, the MT token decimal defaults to 0 instead of 18 and MetaMask won't allow me edit it hence the zero balance I am getting indicating non existent contract. It never works and never will except the decimal changes to 18 like others, even at that, I can't send you address, remember it's the same default address for everyone where the token lives in so each user needs to spin up a deployed state on anvil for the import to work.
Well the good news is even though that did not work, I have been …