You are viewing a single comment's thread from:

RE: Solidity实用笔记

in #starnote5 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.21
TRX 0.20
JST 0.034
BTC 98129.50
ETH 3322.67
USDT 1.00
SBD 3.05