Skip to content

Instantly share code, notes, and snippets.

@folex
Created January 30, 2019 17:14
Show Gist options
  • Save folex/1a5d9f926972e294fcc294a08b94c3c7 to your computer and use it in GitHub Desktop.
Save folex/1a5d9f926972e294fcc294a08b94c3c7 to your computer and use it in GitHub Desktop.
gas.sol
pragma solidity ^0.4.24;
contract Gas {
struct App {
uint256 id;
bytes32 something;
bytes32 andmore;
uint8 someSize;
address owner;
bytes32[] someArray;
Properties properties;
}
struct Properties {
uint timestamp;
bytes32[] someIDs;
uint16[] andMore;
}
mapping(uint256 => App) internal apps;
uint256 internal appsCount = 1;
function addApp(bytes32 something, bytes32 andmore, uint8 someSize, bytes32[] someIDs)
external
{
apps[appsCount] = App(
appsCount,
something,
andmore,
someSize,
msg.sender,
someIDs,
Properties(0, new bytes32[](0), new uint16[](0)) // TODO: this is awful
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment