アルゴリズムとかオーダーとか

仕事で勉強したことなどをまとめてます

Solidity v0.6.5で追加されたImmutable keywordについて

今回は、Solidityのv0.6.5で追加されたImmutable keywordについて紹介します。
なお、v0.6.5は2020/04/06にリリースされております。執筆時点での最新バージョンはv0.6.8となっています。

Immutable keywordについての公式の説明はこちらのブログを参照ください。
solidity.ethereum.org

  • Immutable Keywordについて
  • constantとimmutableの比較
  • immutableの動作概要
    • 基本的な流れ
    • デバッガーを使って確認してみる
    • コントラクトの初期化フェーズ時の動作
    • immutable変数を参照するときの動作
  • まとめ
続きを読む

web3.jsのmock方法

今回の記事では、DappsのUnit Testでweb3.jsをmockする方法について紹介します。
sinon.jsを用いた方法と、jestを用いた方法の2パターンを紹介します。

本記事で紹介している内容のサンプルプロジェクトも作りましたので参考にしてください。
github.com

  • テスト対象となるDapps
  • Unit Testのサンプル
  • web3.js のmocking方法
    • sinon.jsを使った方法
      • 利点
      • 欠点
    • jestを使った方法
      • 利点
      • 欠点
  • まとめ
続きを読む

Meta-Transactionのセキュリティを向上させるEIP-1344

今回はIstanbulアップデートで導入されたEIP-1344についてまとめたいと思います。EIP-1344の説明をする前にMeta-Transactionの仕組みとMeta-Transactionが抱える問題を簡単に説明します。その後に、EIP-1344で何が解決されたのかを説明します。

EIPの原文はこちら
github.com

  • Meta-Transactionとは
    • Meta-Transactionの処理の流れ
  • Meta-Transactionの適用シナリオ
  • Meta-Transactionが抱える問題
  • それぞれの解決作
  • まとめ
続きを読む

RLPとMerkle Patricia Tree(Trie)

今回はEthereumで用いられている2つのデータエンコード方式、RLP(Recursive Length Prefix)とPatricia Tree(Trie)について説明します。

  • RLP(Recursive Length Prefix)
    • 概要
    • 接頭辞の種別
    • 具体的な使用例
  • Merkle Patricia Tree(Trie)
    • 概要
    • 前提:基本的なRadix Trie(基数木)の定義
    • Merkle Patricia Treeのノードとprefixの種別
      • ノード種別
    • leafとextensionを区別するための識別子
    • Patricia Merkle Treeの各ノードのハッシュ値の求め方
    • 具体的な使用例
    • Merkle Patricia Treeの構造の具体例
  • まとめ
続きを読む

Devcon5 - Day 3 Rough Report

  • 1. Optimization techniques for EVM implementations
  • 2. (e)WASM Code Golfing - Below Par with Nim
  • 3. Yul, eWasm, Solidity: Progress and Future Plans
  • 4. Wasm Precompiles for Eth 1.x
  • 5. EVM Roundtable: Everything You Wanted to Ask, But Were Afraid To
  • 6. Monitoring an Ethereum infrastructure
  • 7. Pentesting Ethereum Contracts: Exploring a Honeypot Contract Using Ganache

1. Optimization techniques for EVM implementations

3日目の今日は朝からEVM関連セッションが連続であり、全てB7 Roomだったので朝一からB7に篭ってた。
で、最初はevmone作者のevm実相寺におけるoptimizationの話。

続きを読む

Devcon5 - Day 2 Rough Report

  • 1. Welcome Ceremony ~ key note sessions
  • 2. Eth 1.x Explained
  • 3. Eth 2.0 tldr
  • 4. Ewasm: Past, Present, Future
  • 5. Lightning Fast Light Clients for the Future of Ethereum
  • 6. Eth 2.0 Light Clients: How Light is Light?
  • 7. How Do We Make Dapps as Secure as the Underlying Ethereum
  • 8. ERC725 - The Future of On-Chain Interaction
  • 9. Not Safe for Work: Smart Contract Vulnerabilities and Getting Started with Vyper
  • 10. Ethereum And The Law
  • ad. マスタリング・イーサリアム(邦訳)発売

1. Welcome Ceremony ~ key note sessions


午前中はメインホール(?)のA2でウェルカムセレモニー〜Key note sessionを聞いた。ツイートにある通り、同時通訳を行われるので、レシーバーを受け取って会場へ。

続きを読む

Devcon5 - Day 1 Rough Report

  • 0. Registration
  • 1. State Channels Sumit: B10
  • 2. An EVM-Based Formal Rules Language: B3 (だとおもう。。)
  • 3. Japanese, Human-Readable Smart Contracts: B3
  • 4. Building a Formally-Verified DApp with the Reach DSL, today!: B3
  • 5. WASM and Rust: Building Blocks for Blockchain: B3
  • 6. Decentralized UX Problem Solving with Bounties Network and Rimble: B3

0. Registration


チケットは事前に準備してたので、registrationは難なく突破。

続きを読む