# ETH 5/4
use remix
https://remix.ethereum.org/#appVersion=0.7.7&optimize=false&version=soljson-v0.6.5+commit.f956cc89.js
```solidity=
pragma solidity >= 0.5.1;
contract Inbox{
string public message;
constructor(string memory initalMessage) public{
message = initalMessage;
}
function setMessage(string memory newMessage) public{
message = newMessage;
}
function getMessage() public view returns (string memory){
return message;
}
}
```



## function

`view` miner 更快驗證
## array
Dynamic array
byte[10] name :+1:
uint[10][10] num :-1:
## struct
```solidity=
struct Mystruct{
uint a;
biil b;
}
```
## delete
>> reset element. not real delete them
>>
```solidity=
contract Inbox2{
string public message;
uint[5] public myUintArray;
struct Mystruct{
uint counter;
bool isSet;
}
Mystruct public someV;
constructor(string memory initalMessage) public{
message = initalMessage;
myUintArray[0]=1;
someV.counter=1;
}
function increase() public{
someV.counter++;
}
}
```

## state variable
> state variable > store in bc
such as `string public message;`
> local variable > store in mem
## storage

speed faster while store variable in local


on bc, [1,2,3]
copy to local and change to [2,2,3]

## calling function
free, only read
## write function
need fee
## GAS
gas price, you can set the price and gas limit