Skip to content

Instantly share code, notes, and snippets.

@sepisoltani
Last active August 30, 2021 11:42
Show Gist options
  • Save sepisoltani/6b5e7998e2441c02d43704524418ee61 to your computer and use it in GitHub Desktop.
Save sepisoltani/6b5e7998e2441c02d43704524418ee61 to your computer and use it in GitHub Desktop.
solidity.sol
// SPDX-License-Identifier: MIT
pragma solidity >0.5.2;
contract Sepehr {
struct One {
uint256 a;
uint256 b;
uint256 c;
}
struct Two {
uint32 a;
uint32 b;
uint256 c;
}
// `Two` will cost less gas than `One` because of struct packing
One one = One(10, 20, 30);
Two two = Two(10, 20, 30);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment