ethereum smart contract 基本

uint256 => 2^256 byte32 => 2^8^32 (byte=2^8) or 32個byte 放32字元(ascii) 0x => HEX 16進位 0x64 => 6 * (16^1) + 4 * (16^0) = 100 0x0164 => 1 * (16^2) + 6 * (16^1) + 4 * (16^0) = 365 0x HEX 16進位 最小0 最大F 回到最上面byte32 轉成 0x HEX 為了避免太長,2^8 = 256 => 16^2 => 16位元顯示要兩位 0256 => 00FF || FF => 15 * (16^1) + 15 * (16^0) 所以 0x0164,通常都是兩位處理 0x 01 64 ...

2019-05-30 · 2 min · 408 words · Me

[轉][Solidity] 壓縮智能合約的輸入資料

https://medium.com/joyso/solidity-%E5%A3%93%E7%B8%AE%E6%99%BA%E8%83%BD%E5%90%88%E7%B4%84%E7%9A%84%E8%BC%B8%E5%85%A5%E8%B3%87%E6%96%99-65a870d1f04e

2019-05-30 · 1 min · word · Me

ethereum smart contract private value not safe

https://hackernoon.com/your-private-solidity-variable-is-not-private-save-it-before-it-becomes-public-52a723f29f5e 上面範例中,play(100)被呼叫後,從transcation data內得知 0x6587f6ec0000000000000000000000000000000000000000000000000000000000000064 然後先取得play()這部份的data bytes4(keccak256(‘play(uint)’)) 然後得知 0000000000000000000000000000000000000000000000000000000000000064 就是 uint部份,得到的這個值是經過hex才顯示的 byte32:00 為1個byte(16 bits),共32個 64=> 6 * (16^1) + 4 * (16^0) = 100 uint256 => 2^256 => 8^32 => byte32

2019-05-30 · 1 min · 30 words · Me

ethereum blockscout

https://github.com/poanetwork/blockscout/tree/master/docker

2019-05-29 · 1 min · word · Me

ethereum dapp Embark Cockpit

https://embark.status.im/docs/cockpit_dashboard.html

2019-05-28 · 1 min · word · Me