官术网_书友最值得收藏!

  • Mastering Ethereum
  • Merunas Grincalaitis
  • 95字
  • 2021-06-24 15:01:06

Data location

In Solidity, you have the option to define where your variables will be stored. You can decide to store them in the following places:

  • Storage: This is a permanent place that gets written on the blockchain, therefore it's expensive to use
  • Memory: This is a non-permanent place where variables are held for only as long as the smart contract is running
  • Calldata: This is where the msg object data information is stored, a place dedicated to global variables

An example of this is in the following code:

uint256 memory myNumber;
string storage myText;
主站蜘蛛池模板: 托里县| 临沂市| 昆山市| 确山县| 乌鲁木齐县| 鹰潭市| 桦甸市| 仁布县| 黄骅市| 永济市| 金湖县| 祁阳县| 宜兴市| 巴中市| 杭锦后旗| 舟山市| 黄大仙区| 潞西市| 建水县| 兴山县| 紫云| 开阳县| 互助| 桐城市| 高雄市| 化德县| 溆浦县| 洪雅县| 博乐市| 崇仁县| 沙田区| 景宁| 纳雍县| 惠安县| 清苑县| 绥宁县| 关岭| 白银市| 孟村| 文化| 江孜县|