Last active
August 30, 2021 11:42
-
-
Save sepisoltani/6b5e7998e2441c02d43704524418ee61 to your computer and use it in GitHub Desktop.
solidity.sol
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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