(this is EVM emulator for my study)
自分が学習用に作成している(現在休止中)Ethereum Virtual Machine Emulatorです。 ゆえにバグが大量にあり、他人に見せられない酷いコードです.... コードが動かないことが多いですが、何卒ご容赦ください。
git clone してもらい、 run *.go を実行して貰えば、今のところ動きます(はずです....)
EVMコードを内部でOPCODEに変換し、stackやmemoryを更新してくれます。 こんな感じに表示されます。
------------------------------------
PUSH1 80
push => stack: [[80 00 00 00]]
------------------------------------
PUSH1 40
push => stack: [[80 00 00 00] [40 00 00 00]]
------------------------------------
MSTORE
pop => stack: [[80 00 00 00]]
pop => stack: []
------------------------------------
CALLVALUE
push => stack: [[00 00 00 00]]
------------------------------------
DUMP1
push => stack: [[00 00 00 00] [00 00 00 00]]
------------------------------------
ISZERO
pop => stack: [[00 00 00 00]]
push => stack: [[00 00 00 00] [01 00 00 00]]
・EVMコードによるstackやmemoryの状態遷移 ・任意のアカウントをデプロイ()
・実装しきれていないOPCODEの実装 ・パトリシアマークルツリーによるDB管理 ・EVMによるスマートコントラクトの実行
https://github.com/pokemium/ToyEVM <-かなりの部分を参考にさせています、ありがとうございました。