Questions tagged [string]
https://docs.soliditylang.org/en/v0.8.12/types.html
221 questions
0 votes
1 answer
23 views
i keep getting an error with my string ,it shows a red line beneath it
ParserError: Expected ';' but got 'string' --> simplestorage.sol:9:5: | 9 | string favouriteNumberInText = "eighty eight"; //a string in solidity is written in words and it should be ...
0 votes
0 answers
39 views
Returning a string from a struct in an array gives opcode error
I have a following piece of code: contract Disp { struct Dispute { string title; string details; address defendant; address transaction; uint256 status; ...
1 vote
1 answer
135 views
How to parse SIWE on chain?
I have a complex nested struct which contains a field capabilites: capabilities: [{ "sig": "...
1 vote
1 answer
80 views
generate url in smart contract, based on block.chainid and address(this)
For the past few days I have been looking into creating a simple function to generate a url based on block.chainid (uint256) and address(this). The idea is as follows: function url() public view ...
0 votes
2 answers
508 views
How do i convert Boolean to String in Solidity?
The problem is pretty simple: I want to concatenate boolean values to string values. I order to do this, i assume they have to first be converted into strings and then concatenated. Could someone ...
0 votes
2 answers
44 views
Initializing string variables from mapping values doesnt work
I try something like this: mapping (uint256 =>string) public example; then i initialze 'example' in the constructor example[0]="apple"; example[1]="peach"; then i define a ...
0 votes
0 answers
32 views
string storage vs memory
i have a function in my smart contract which needs a string to work, and for this i have two options : OPTION 1 : Store my string in a state variable : contract A { string public immutable ...
0 votes
1 answer
126 views
Why isn't 'require' working?
In the create function, I need the _title to be required and the _description to be optional. But when calling create without _title & with _description, it executes without any errors, but the ...