2021-08-12 09:58:13 +00:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0
|
2021-05-31 05:37:11 +00:00
|
|
|
pragma solidity ^0.7.0;
|
|
|
|
|
|
|
|
contract TestAddress {
|
2021-06-02 05:53:33 +00:00
|
|
|
// Address type need 20 bytes for storage.
|
2021-05-31 05:37:11 +00:00
|
|
|
address address1;
|
|
|
|
|
2021-06-02 05:53:33 +00:00
|
|
|
// Address type uses the next slot as there is not enough space in previous slot.
|
2021-05-31 05:37:11 +00:00
|
|
|
address payable address2;
|
|
|
|
|
|
|
|
// Set variable address1.
|
|
|
|
function setAddress1(address value) external {
|
|
|
|
address1 = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Set variable address2.
|
|
|
|
function setAddress2(address payable value) external {
|
|
|
|
address2 = value;
|
|
|
|
}
|
|
|
|
}
|