I have multiple smart contracts that share a common structure, each containing two fields: destination and owner, which hold the same values. I would like to update the destination or owner values for all these contracts while minimizing gas fees. Are there any efficient methods?(such as batch processing or move these fields into another smart contract and using them or etc ...)
1 Answer
Multiple contracts point to the variables of a certain contract (access or modification, you can set a whitelist if you don’t want anyone to modify it). In this case, only modifying the state of a certain contract can effectively save gas compared with modifying the storage variable of multiple contracts.
-
Thanks, is this code for access control in some contract functions safe and save gas? address owner = PointedContract(address).getOwner(); require(msg.sender== owner);– softwengCommented Jun 26, 2023 at 4:35