What is the cheapest way for storing string in contract? I'm looking at this transaction https://etherscan.io/tx/0xb92d030c914254473b41af12309c6ccfaf8fe7388b0d0d8a0ac53545df3f773e and wonder that it used only 25851 gas. I have tried other datatypes like bytes, string and can't get same value.
If you need the contract to 'have access' to the variable, you will not manage a gas usage like the tx you included in your answer. However, if you need only a reference-type storage that will not have to be used from within the contract, use logs, they are much cheaper. As far as the transaction is concerned, just because a string is provided as input, doesn't mean it's stored inside the contract anywhere. In this case, it definitely isn't, as minimum storage cost is 5000 gas (+21k base tx cost = 26k).