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
| import { Cli } from 'incur' | |
| import { | |
| Client, | |
| HttpClient, | |
| MemoryClient, | |
| HttpTransport, | |
| MemoryTransport, | |
| } from 'incur/client' | |
| import type { Commands } from './generated/incur-client.js' |
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
| // TokenV1.sol | |
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.0; | |
| contract TokenV1 { | |
| error InsufficientBalance(); | |
| uint256 public totalSupply; | |
| mapping(address => uint256) public balances; |
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.8.0; | |
| contract SuboptimalStructLayout { | |
| struct Data { | |
| uint256 a; // takes a full storage slot (32 bytes) | |
| uint8 b; // takes only 1 byte but occupies a full storage slot (32 bytes reserved) | |
| uint256 c; // needs a new slot, takes a full storage slot (32 bytes) - explains the previous full slot | |
| uint8 d; // takes only 1 byte but occupies a full storage slot (32 bytes reserved) | |
| } |