I have seen staking balances using s_balances in contracts.
However, I tried searching around and I could not find the answers.
what is the naming convention around s_ in solidity?
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.
Sign up to join this communitys_
for "storage".
The s_
is a convention that seems to have been first adopted by the Chainlink developers (example) to indicate that a given variable is a storage variable, and therefore care should be taken in its use.
From what I have seen in Patrick Collisions Videos, the s_
is to notify developers that the computation on this data structure is gas-intensive.
For example
// Account -> Token -> Amount
mapping(address => mapping(address => uint256))
public s_accountToTokenDeposits;
On such hashmaps, computations using them could be intensive, so devs would try to minimise changing the data in these datastructure.