Hello community, I am learning smart contracts development and in the video course I see that author created a scripts folder and write a scripts for some functions from the contract. First he runs a local node and then run these 2 scripts. I can't understand for what I need to write the scripts if I already wrote deploy scripts and unit+staging tests where I check the whole functionality of the contract ?

May 10, 2023, 6:47 PM
Share thee script?
May 10, 2023, 6:51 PM
You would need to write tests for each function to make sure it works. Otherwise you can manual test by deploying to testnet
You can call functions on the contract using scripts to interact with it
May 10, 2023, 6:51 PM
Yes I already wrote the tests both unit(for local network) and staging(for a testnet). So scripts are mostly used to interact with the contract and check how it works?
May 10, 2023, 6:53 PM
That too. I personally prefer using remix for manual testing it’s so much easier
May 10, 2023, 6:54 PM
Manual test is much weaker than a proper test suite
May 10, 2023, 6:56 PM
Right
May 10, 2023, 6:59 PM
Usually scripts are used to automate stuff, like idk, you might have a csv with a table of user/amount to be given and do an airdrop which issues all the txs for that, or you can write script that react on certain events etc.
May 10, 2023, 7:02 PM
Really interesting
May 10, 2023, 7:30 PM
scripts are used to alter the state of the target chain
tests are designed to test the contracts/interactions
May 10, 2023, 7:32 PM
Yes
Unless you need something like key<=255 and using uint8 you avoid that require
May 10, 2023, 7:43 PM
thx, makes sense
May 10, 2023, 7:44 PM
slot(m[k]) = keccak(k . slot(m)), where . is byte concatenation
May 10, 2023, 7:46 PM

© 2024 Draquery.com All rights reserved.