Do deploy scripts cost ETH? #2563
-
If I have a forge deploy script that stores its own state (such as an array), does this increase my deploy cost? Or is it only for the transactions that actually call the contract? I am basically deploying a contract and uploading data to it. And I am using a cheat code to read from file and store that in an array in the deploy script before uploading that array, and I'm wondering if this costs money. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The script itself is run on an in-process EVM. The only thing that incur transaction fees are transactions that are broadcasted, so any external call or deployment affected by So no, internal state such as arrays or mappings in your script do not affect transaction costs :) |
Beta Was this translation helpful? Give feedback.
The script itself is run on an in-process EVM. The only thing that incur transaction fees are transactions that are broadcasted, so any external call or deployment affected by
vm.broadcast
orvm.startBroadcast
So no, internal state such as arrays or mappings in your script do not affect transaction costs :)