mirror of
https://github.com/cerc-io/watcher-ts
synced 2025-01-09 21:08:06 +00:00
a7ec3d8da8
* Add license & copyright declarations for add-watcher. * Add copyright declarations for cache. * Add copyright declarations for erc20-watcher. * Add copyright declarations for ipld-eth-client. * Add copyright declarations for tracing-client. * Add copyright declarations for uni-watcher. * Add copyright declarations for solidity-mapper. * Add copyright declarations for uni-info-watcher. * Add copyright declarations for util. * Add copyright declarations for lighthouse-watcher. * Change license identifier in .sol files. Co-authored-by: prathamesh0 <prathamesh.musale0@gmail.com>
23 lines
704 B
Solidity
23 lines
704 B
Solidity
// SPDX-License-Identifier: AGPL-3.0
|
|
pragma solidity ^0.7.0;
|
|
|
|
contract TestStrings {
|
|
string string1;
|
|
|
|
// String type variable takes the next single slot.
|
|
// If data is 32 or more bytes, the main slot stores the value length * 2 + 1 and the data is stored in keccak256(slot).
|
|
// Else the main slot stores the data and value length * 2.
|
|
// https://docs.soliditylang.org/en/v0.7.4/internals/layout_in_storage.html#bytes-and-string
|
|
string string2;
|
|
|
|
// Set variable string1.
|
|
function setString1(string memory value) external {
|
|
string1 = value;
|
|
}
|
|
|
|
// Set variable string2.
|
|
function setString2(string memory value) external {
|
|
string2 = value;
|
|
}
|
|
}
|