Categories
Cryptocurrency Ethereum Mastering Development

Solidity contract function encode / decode parameters for mapping states

If I was to want to migrate a contract with all the current mapping states of the current deployed contract would there be anyway to decrease my gas cost by being able to encode / decode values from javascript and pass them to the contract then store those values into the state data of my contract?

Specifically I have multiple mappings that will need to be restored. Currently with over 10k data entry point it seems it will cost me upwards of 200k in ethereum to do this. I’m hoping to find a way to decode / encode the data back into the contract without having to send multiple requests.

Leave a Reply

Your email address will not be published. Required fields are marked *