CRYPTO NEWS

Why is solidity asking me to restrict state modifier function to view?

Version 0.8.7

Solidity is complaining that several state modifier functions can be restricted to view, such as:

function updateStruct(     uint256 dummyParam ) public onlyOwner {     DummyStruct memory dummy = dummyStructArray[dummyParam];     dummy.something = 1; } 

Basically, any function that is modifying struct has "function state mutability can be restricted to view" warning.

hardhat shorthand plugin not showing custom tasks

I installed hardhat’s shorthand plugin and when I run hh and hit "tab" I get all the default autocomplete tasks but not the custom ones: check — Check whatever you need clean — Clears the cache and deletes all artifacts compile — Compiles the entire project, building all artifacts console — Opens a hardhat console::Listen

I installed hardhat’s shorthand plugin and when I run hh and hit "tab" I get all the default autocomplete tasks but not the custom ones:

check           -- Check whatever you need clean           -- Clears the cache and deletes all artifacts compile         -- Compiles the entire project, building all artifacts console         -- Opens a hardhat console coverage        -- Generates a code coverage report for tests flatten         -- Flattens and prints contracts and their dependencies help            -- Prints this message node            -- Starts a JSON-RPC server on top of Hardhat Network run             -- Runs a user-defined script after compiling the project size-contracts  -- Output the size of compiled contracts test            -- Runs mocha tests typechain       -- Generate Typechain typings for compiled contracts verify          -- Verifies contract on Etherscan 

Also to note: It’s also showing plugin scripts like size-contracts which is also a custom script. And my custom scripts are still working so they’re there!

I know it should work, cause when I first installed it it did work. I restarted my MacBook and then it disappeared. I also ran source ~/.zshrc and hh clean && hh compile but it didn’t make any difference.

Why is solidity asking me to restrict state modifier function to view?

Shopping cart
There are no products in the cart!
Continue shopping
0