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

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;
主站蜘蛛池模板: 澳门| 凯里市| 淮北市| 张家川| 富锦市| 大田县| 分宜县| 杭锦后旗| 获嘉县| 仁化县| 巴南区| 米易县| 宿迁市| 营山县| 安义县| 玛沁县| 达州市| 寿光市| 军事| 临洮县| 开阳县| 高平市| 闽侯县| 邵武市| 阳原县| 岳池县| 车致| 沙洋县| 嵊泗县| 大厂| 福州市| 稻城县| 休宁县| 山东省| 昌江| 海林市| 青神县| 富顺县| 潢川县| 乌兰浩特市| 甘泉县|