watcher-ts/packages/solidity-mapper/test/contracts/TestBooleans.sol
Ashwin Phatak b243025ca8
Test cases in solidity-mapper for contract, fixed-size byte arrays and enum types (#26)
* Add tests for getStorageInfo and getEventNameTopics.

* Lint solidity-mapper package code.

* Add test for contract type.

* Add test for fixed size byte arrays.

* Add test for Enum types.

* Add tests for variables packed together and using single slot.

* Fix comments in test contracts.

Co-authored-by: nikugogoi <95nikass@gmail.com>
2021-06-02 11:23:33 +05:30

19 lines
423 B
Solidity

// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
contract TestBooleans {
// Boolean type variables are packed together in a slot as they occupy less than 32 bytes together.
bool bool1;
bool bool2;
// Set variable bool1.
function setBool1(bool value) external {
bool1 = value;
}
// Set variable bool2.
function setBool2(bool value) external {
bool2 = value;
}
}