You are viewing a single comment's thread from:

RE: Solidity实用笔记

in #starnote4 years ago (edited)

memory storage
memory 存储在EVM内存中,主要有局部变量,函数参数
storage 存储在区块链中,主要有状态变量,复杂变量,数组

pragma solidity >0.4.23 <0.7.0;

contract MyStorage{
    int[] arr;
    string tt;
    function fun1(uint m, string memory s) public returns(string memory) {
        uint n = m;
        string memory str = s;
        tt = s;
        
        string memory s1 = 'abc';
        string memory s2 = s1;
        
        int[] storage abc = arr;
        return tt;
    }
}

Coin Marketplace

STEEM 0.26
TRX 0.11
JST 0.033
BTC 63851.10
ETH 3059.36
USDT 1.00
SBD 3.85