Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
スマートコントラクトと分散ファイナンス / Smart Contracts and Decen...
Search
Kenji Saito
PRO
June 26, 2023
Technology
0
170
スマートコントラクトと分散ファイナンス / Smart Contracts and Decentralized Finance
早稲田大学大学院経営管理研究科「フィンテック ─ 金融革新とインターネット」2023 夏クォーターの第7-8回で使用したスライドです。
Kenji Saito
PRO
June 26, 2023
Tweet
Share
More Decks by Kenji Saito
See All by Kenji Saito
市民科学にAI はどう活用できるか / How AI Can Be Used for Citizen Science
ks91
PRO
0
9
グリーンマイニングが Bitcoin プロトコルに及ぼす影響 / Impact of Green Mining on the Bitcoin Protocol
ks91
PRO
0
18
FinTech 13-14 : Ideathon, Presentations and Conclusions
ks91
PRO
0
55
デザイン相談会 / Design Consultation
ks91
PRO
0
13
FinTech 11-12 : Cyber-Physical Society and Future of Finance
ks91
PRO
0
52
メタ自然選択と製品トレーサビリティー / Meta-Natural Selection and Product Traceability
ks91
PRO
0
8
伝統的金融に呑まれる分散型金融 / Decentralised Finance Engulfed by Traditional Finance
ks91
PRO
0
15
ウェブサービスデザイン 2 / Web Service Design 2
ks91
PRO
0
25
生成AI による論文執筆サポートの手引き(ワークショップ) / A guide to supporting dissertation writing with generative AI (workshop)
ks91
PRO
0
250
Other Decks in Technology
See All in Technology
OCI Network Firewall 概要
oracle4engineer
PRO
0
4.2k
VideoMamba: State Space Model for Efficient Video Understanding
chou500
0
190
安心してください、日本語使えますよ―Ubuntu日本語Remix提供休止に寄せて― 2024-11-17
nobutomurata
1
1k
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
29
13k
Why App Signing Matters for Your Android Apps - Android Bangkok Conference 2024
akexorcist
0
130
FlutterアプリにおけるSLI/SLOを用いたユーザー体験の可視化と計測基盤構築
ostk0069
0
110
The Rise of LLMOps
asei
9
1.7k
Python(PYNQ)がテーマのAMD主催のFPGAコンテストに参加してきた
iotengineer22
0
540
iOSチームとAndroidチームでブランチ運用が違ったので整理してます
sansantech
PRO
0
150
B2B SaaSから見た最近のC#/.NETの進化
sansantech
PRO
0
910
開発生産性を上げながらビジネスも30倍成長させてきたチームの姿
kamina_zzz
2
1.7k
Application Development WG Intro at AppDeveloperCon
salaboy
0
200
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Docker and Python
trallard
40
3.1k
The Language of Interfaces
destraynor
154
24k
Optimizing for Happiness
mojombo
376
70k
The Pragmatic Product Professional
lauravandoore
31
6.3k
Writing Fast Ruby
sferik
627
61k
Visualization
eitanlees
145
15k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
430
Site-Speed That Sticks
csswizardry
0
33
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Transcript
Financial technology on the street. Generated by Stable Diffusion XL
Beta — 2023 7-8 (WBS) — 2023 7-8 — 2023-06-26 – p.1/78
https://speakerdeck.com/ks91 — 2023 7-8 — 2023-06-26 – p.2/78
( ) 1 6 5 (1) • 2 6 5
(2) • 3 6 12 Web3 (1) • 4 6 12 Web3 (2) • 5 6 19 (1) • 6 6 19 (2) • 7 6 26 (1) • 8 6 26 (2) • 9 7 3 (1) 10 7 3 (2) 11 7 10 (1) 12 7 10 (2) 13 7 24 (1) 14 7 24 (2) 12 — 2023 7-8 — 2023-06-26 – p.3/78
( 20 ) 1 2 3 4 (TCP/IP ) 5
6 7 8 9 10 World Wide Web 11 Web API 12 13 git GitHub 14 (6/19 ) / (2 ) OK / — 2023 7-8 — 2023-06-26 – p.4/78
( ) Web3 (1) — Web3 (2) — — 2023
7-8 — 2023-06-26 – p.5/78
( ) Ethereum Ethereum ← (DeFi) ( ) — 2023
7-8 — 2023-06-26 – p.6/78
— 2023 7-8 — 2023-06-26 – p.7/78
Bitcoin ϏοτίΠϯωοτϫʔΫ ɾ ճͷʮ࠾۷ʯྔ ຖʹݮ ɾ߹ܭ ສ
#5$ ·Ͱ औҾͷొ खྉ खྉ औҾͷঝೝ ϚΠχϯά࣌ ϚΠχϯά ࠾۷ ֬తաఔ ฏۉ ͓͖ʹޭ ૹۚࢦ֤͕ࣔࣗͭ ϓϥΠϕʔτΩʔͰ ແͨ͘͠Β࠶ൃߦෆՄ ϚΠφʔ ࠾۷ऀ ࢧ͍ɾ྆ସ ͳͲͷܦࡁ׆ಈ ར༻ऀ ϒϩοΫνΣʔϯ ݩா Πϯλʔωοτ্ͷԾωοτϫʔΫ ʜ ˞#5$ϏοτίΠϯͷ୯Ґ #5$ ରԠ ϒϩοΫ ϒϩοΫ ϒϩοΫ औҾ ૹۚ औҾͷه ΞυϨε Ѽઌ ϓϥΠϕʔτΩʔ ຊਓͷূ໌ — 2023 7-8 — 2023-06-26 – p.8/78
— 2023 7-8 — 2023-06-26 – p.9/78
(Bitcoin ) ϒϩοΫ൪߸O ϒϩοΫ൪߸O ϒϩοΫ൪߸O ϒϩοΫ൪߸O ϒϩοΫ൪߸O
ϒϩοΫ൪߸O ϒϩοΫ൪߸O ϒϩοΫ൪߸O ͍ͪΜهɾॻ͖͑ͷίετ͕ߴ͍ྺ࢙ ࠷վ͟Μ͠ʹ͍͘ྺ࢙ ͕༗ޮ ͻͱͭखલͷϒϩοΫͷ ʮμΠδΣετʯ σδλϧॺ໊͞Εͨ ʮτϥϯβΫγϣϯ औҾ ʯ ϒϩοΫΛ࡞ΔͨΊʹɺͦͷʮμΠδΣετʯ͕͋ΔҎԼͱ͍͏݅Λຬͨͨ͠Γ 1SPPGPG8PSL Ծ௨՟ͷ࣋ͪʹԠͨ͡ݖརΛͬͨථͰউͬͨΓ 1SPPGPG4UBLF ͢Δඞཁ͕͋Δ ίετ͕͔͔Δ ϒϩοΫΛ࡞ΔਓͦͷதʹࣗʹѼͯͨ Ծ௨՟ͰͷใुΛॻ͖ࠐΉ͜ͱ͕Ͱ͖ɺ ͦͷϒϩοΫ͕༗ޮͳྺ࢙ͷதʹ͋Δ߹ʹ ݶΓใु༗ޮͱͳΔ τϥϯβΫγϣϯͷଘࡏΛ֬ೝ͢Δ ͨΊͷޮతͳํ๏͕ఏڙ͞ΕΔ ਖ਼ੑ ଘࡏੑ །Ұੑ Proof of Work ( ) (Proof of Stake ) . . . → — 2023 7-8 — 2023-06-26 – p.10/78
∼ UTXO (= ) → UTXO : (= ); Unspent
TX(Transaction) Output — 2023 7-8 — 2023-06-26 – p.11/78
∼ ท൪߸O ท൪߸O ท൪߸O લทͷμΠδΣετ λʔήοτҎԼͰͳ͍ͱ͍͚ͳ͍ Έͩ͠ίʔφʔ μΠδΣετ͕λʔήοτҎԼʹͳΔΑ͏ʹೖΕΔదͳ༰
( ) → — 2023 7-8 — 2023-06-26 – p.12/78
∼ ϖʔδ൪߸O ϖʔδ൪߸O ϖʔδ൪߸O ϖʔδ൪߸O ϖʔδ൪߸O
ϖʔδ൪߸O ϖʔδ൪߸O ϖʔδ൪߸O ͬͪ͜ͷྺ࢙͕༗ޮ ( (= ) ) — 2023 7-8 — 2023-06-26 – p.13/78
0 and/or Bitcoin “The Times 03/Jan/2009 Chancellor on brink of
second bailout for banks” 2009 1 3 2 https://www.blockchain.com/explorer 0 BTC Block “Hex to ASCII Text Converter” — 2023 7-8 — 2023-06-26 – p.14/78
: ( ( ) ) ( ) — 2023 7-8
— 2023-06-26 – p.15/78
(Hyperledger (Linux Foundation) ) ( ) ( ) ( )
( ) IoT / / ( , ) — 2023 7-8 — 2023-06-26 – p.16/78
: Bitcoin . . . : Proof of Existence, Everledger,
. . . ( ) ( ) / × = ( ) NFT (Non Fungible Token) — 2023 7-8 — 2023-06-26 – p.17/78
( ) จ ॻ จ ॻ จ ॻ
จ ॻ จ ॻ O μΠδΣετ μΠδΣετ μΠδΣετ μΠδΣετ μΠδΣετ μΠδΣετ μΠδΣετ حͷ߹ ෳ͢Δ ɾจॻ ΛಘͨΫϥΠΞϯτɺಉ࣌ʹূ໌ཁૉͱͯ͠ɺϒϧʔͰࣔ͞ΕΔμΠδΣετͱ֤ʑ͕ࠨӈͷͲͪΒʹҐஔ͢Δ͔Λड͚औΔɻ ɾΫϥΠΞϯτจॻ ͷμΠδΣετ͔Β࢝Ίͯɺ࿈͖݁͢Ұ࿈ͷμΠδΣετΛΔ͜ͱʹͳΔͷͰɺϚʔΫϧϧʔτʹࢸΔ·Ͱͷ ɹܭࢉΛ࠶ݱͰ͖ɺಘΒΕͨϚʔΫϧϧʔτ͕ϒϩοΫνΣʔϯʹه͞Ε͍ͯΔͱҰக͢Δ͜ͱΛ֬ೝͰ͖Δɻ ɾͦͷܭࢉݪཧͷཧղͱඞཁͳใ͕͋Ε୭Ͱ࠶ݱͰ͖Δ จॻ ͷଘࡏͱͦͷ༰ূ໌͞ΕΔɻ ˞μΠδΣετݩͷσʔλ͕ ɹϏοτͰҟͳΔͱશ͘ҟͳΔ ɹͱͳΓɺ·ͨɺμΠδΣετ ɹ͔ΒݩͷσʔλΛਪଌ͢Δ͜ͱ ɹͰ͖ͳ͍ɻ ˞ઍɾສͷจॻΛϚʔΫϧʹͯ͠ ɹͦͷͷߴ͞ߴʑʙ ఔ ه͢Δ ಡΈग़ͤΔ ূ໌Λ ඞཁͱ͢Δऀʹ ։ࣔ͞ΕΔใ ެ։͞ΕΔใ ϚʔΫϧϧʔτ Ϛ ồ Ϋ ϧ γ ε ς Ϝ ͕ อ ͠ ֤ Ϣ ồ β ʹ ෦ త ʹ ͑ Δ ʜʜ ʜʜ ʜʜ ʜʜ ʜʜ μΠδΣετ μΠδΣετ μΠδΣετ μΠδΣετ μΠδΣετ μΠδΣετ ϒϩοΫνΣʔϯ ʜ ʜ — 2023 7-8 — 2023-06-26 – p.18/78
: ⇒ LINE → → ( ) ( ) ⇒
( ) → → → . . . — 2023 7-8 — 2023-06-26 – p.19/78
— 2023 7-8 — 2023-06-26 – p.20/78
(2009 1 ∼2023 6 ) 2 → 2 2 →
→ — 2023 7-8 — 2023-06-26 – p.21/78
10 ATM 1 ATM 1 : http://www.slideshare.net/yamaz2/ss-58813038 ⇒ ( (
) ) — 2023 7-8 — 2023-06-26 – p.22/78
— 2023 7-8 — 2023-06-26 – p.23/78
The DAO ( ) Ethereum The DAO Split ( )
360 ETH (50∼60 ) (2016/6/17) ( ) ( ; ) (2016/7/20 ) — 2023 7-8 — 2023-06-26 – p.24/78
( ) ( ) ( vs. ) ( ) (
) ( ) ⇒ ( : BBc-1, BBc-2) : : — 2023 7-8 — 2023-06-26 – p.25/78
: SF — 2023 7-8 — 2023-06-26 – p.26/78
3. SF Web3 2023 6 22 ( ) 23:59 JST
( ) Waseda Moodle — 2023 7-8 — 2023-06-26 – p.27/78
. . . . . . 37 30 (6/24( )
) ( ) SF ( ) (17) / (4) / (4) / ( ) (2) / (2) / (1) ( ) (19) / (5) / (3) / (1) / (1) / (1) — 2023 7-8 — 2023-06-26 – p.28/78
Y : EduContract 1 : EduContract Proof of Learning 2
: 3 3 : EduContract 4 : AI EduContract — 2023 7-8 — 2023-06-26 – p.29/78
Y — 5 : 6 : EduContract : : ⇒
= — 2023 7-8 — 2023-06-26 – p.30/78
N 20xx Gas Gas ⇒ — 2023 7-8 — 2023-06-26
– p.31/78
O ⇒ — 2023 7-8 — 2023-06-26 – p.32/78
F NFT ⇒ gas — 2023 7-8 — 2023-06-26 –
p.33/78
T 1 gas ID ⇒ gas ETH gas ( (
) + ( )) gas ETH ETH ETH — 2023 7-8 — 2023-06-26 – p.34/78
C ChatGPT ⇒ ( ) GPT-4 : OpenAI. 2023. “GPT-4
Technical Report”. Available at: https://doi.org/10.48550/arXiv.2303.08774. p.8 Figure 5 — 2023 7-8 — 2023-06-26 – p.35/78
C NFT Gas Price gwei JPY USD ⇒ https://www.cryps.info/ja/Gwei_ _JPY/
1 Gwei 0.00027071 JPY NFT 1,834,415 gas https://etherscan.io/gastracker gas 15 Gwei 1,834,415 (gas) × 15 (Gwei/gas) × 0.00027071 (JPY/Gwei) ≃ 7,449 JPY — 2023 7-8 — 2023-06-26 – p.36/78
N ⇒ . . . — 2023 7-8 — 2023-06-26
– p.37/78
K ⇒ ( ) ( ) ( ; ) —
2023 7-8 — 2023-06-26 – p.38/78
Ethereum Ethereum ( ) — 2023 7-8 — 2023-06-26 –
p.39/78
— 2023 7-8 — 2023-06-26 – p.40/78
Ethereum · → · → · → — 2023 7-8
— 2023-06-26 – p.41/78
↑ — 2023 7-8 — 2023-06-26 – p.42/78
(by ) 1. 2. ( ) ( ) . .
. cf. by McLuhan cf. by McLuhan → — 2023 7-8 — 2023-06-26 – p.43/78
by ⇒ ⇒ — 2023 7-8 — 2023-06-26 – p.44/78
by SNS AI AI ⇒ ( ) ⇒ — 2023
7-8 — 2023-06-26 – p.45/78
Ethereum EVM (Ethereum Virtual Machine) — 2023 7-8 — 2023-06-26
– p.46/78
Ethereum Vitalik Buterin, “Ethereum White Paper: A NEXT GENERATION SMART
CONTRACT & DECENTRALIZED APPLICATION PLATFORM” (Dec. 2013∼) 12 ( ) (= ) = = ( ) CPU ⇒ DApps DApps = / — 2023 7-8 — 2023-06-26 – p.47/78
= ( ) run = → — 2023 7-8 —
2023-06-26 – p.48/78
[Lamport 1984][Schneider 1990] ( ) (1) 0 ( ) (2)
(3) (4) ( ) ← — 2023 7-8 — 2023-06-26 – p.49/78
Ether (ETH) Ethereum EOA : Externally-Owned Account ( ) (
) ( ) ( ) ← Ether ( ) EVM EVM = Ethereum = — 2023 7-8 — 2023-06-26 – p.50/78
EVM : Ethereum Virtual Machine ঢ়ଶ ֎෦ΞΫλʔ ΞΧϯτ &7. ίʔυ
&UIFSˠ(BT ىಈ ίϯτϥΫτ ϝοηʔδ͔ɺ৽͍ࣗ͠ಈΦϒδΣΫτ ΞΧϯτؒͰΓऔΓ͞ΕΔσʔλ&UIFS ετϨʔδ ঢ়ଶ` τϥϯβΫγϣϯ ηοτ σδλϧॺ໊ &7. ਓؒͱ͔ ࣗಈ ΦϒδΣΫτ ( ) Gas ( EVM = ( burn)) — 2023 7-8 — 2023-06-26 – p.51/78
/ / (1) Ethereum Bitcoin ( OK) 1 — 2023
7-8 — 2023-06-26 – p.52/78
/ / (2) 3 ( ) · ( ) (
) 1 — 2023 7-8 — 2023-06-26 – p.53/78
/ / (3) ( ) ( ) 1 ( )
1,500 3,000 Ethereum 2022 9 — 2023 7-8 — 2023-06-26 – p.54/78
/ / (4) Gwei Gwei ETH 32 ETH ( )
ETH ETH · 32 ETH ( OK) · 16 ETH ( ) 12 ( ) ( ) 1 — 2023 7-8 — 2023-06-26 – p.55/78
/ / (5) 32 1 (384 ) ( ) (
) 2 3 ( ) 256 512 — 2023 7-8 — 2023-06-26 – p.56/78
/ / (6) ( ) 5 2 3 (36 )
— 2023 7-8 — 2023-06-26 – p.57/78
/ / (7) ( ) ( ) DAO (RANDAO) 1
— 2023 7-8 — 2023-06-26 – p.58/78
Ethereum ߹ҙ͞Εͨཤྺ ϩʔΧϧʹෳΛҡ࣋
ϒϩοΫ εϩοτ ඵִؒ εϩοτͰ ΤϙοΫ ҉߸ֶతμΠδΣετ ϒϩοΫνΣʔϯͷҡ࣋ࢀՃऀ͕ϩʔΧϧʹཧ͢Δσʔλۭؒ ࣌ؒ ΑΓ৽͍͠ه ΦϒδΣΫτ τʔΫϯγεςϜͷεϚʔτίϯτϥΫτ ֤Ϣʔβͷ ߴͷঢ়ଶ ঢ়ଶ` ঢ়ଶ`` τϥϯβΫγϣϯ ΦϒδΣΫτͷੜ ·ͨঢ়ଶભҠͷࢦࣔ ແޮͳཤྺ ω ỽ τ ϫ ồ Ϋ Λ ௨ ͠ ͯ ૹ ड ৴ ͞ Ε Δ ϩ ồ Χ ϧ ʹ ࣋ ͭ ܨ͙ͨΊʹ&5) Ͱͷσϙδοτͱ σϙδοτ૯ֹͷ ♤ ૬ͷϢʔβʹΑΔ ΤϙοΫͷূݴ͕ඞཁ શΦϒδΣΫτͷભҠޙͷঢ়ଶ ͕ϋογϡ˞ʹू͞Ε ͦͷ ϧʔτ͕ϒϩοΫʹॻ͔ΕΔ ঢ়ଶભҠ ˞ϋογϡσʔλ܈ͷ҉߸ֶతμΠδΣετ ϋογϡ ɹΛߏʹදݱͨ͠ͷͰ ෆ߹ͷݕग़ʹ༻͍ΒΕΔ ETH ( ) ⇒ ETH = Ethereum Virtual Machine (EVM) 2 3 ETH ⇒ ETH — 2023 7-8 — 2023-06-26 – p.59/78
Ethereum (ex. ) (ex. ) ⇒ → — 2023 7-8
— 2023-06-26 – p.60/78
— 2023 7-8 — 2023-06-26 – p.61/78
ERC-20 ERC (Ethereum Request for Comments) 20 https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md (EIP: Ethereum
Improvement Proposal) ← EIP ( ) contract ERC20 { function totalSupply() constant returns (uint totalSupply); function balanceOf(address _owner) constant returns (uint balance); function transfer(address _to, uint _value) returns (bool success); function transferFrom(address _from, address _to, uint _value) returns (bool success); function approve(address _spender, uint _value) returns (bool success); function allowance(address _owner, address _spender) constant returns (uint remaining); event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); } name/ , symbol/ , decimals/ approve allowance ERC-777 ( ) — 2023 7-8 — 2023-06-26 – p.62/78
ERC-20 ERC-20 ← ( ) ( ) ⇒ ERC-20 (
ERC-20 ) ERC-20 ⇒ — 2023 7-8 — 2023-06-26 – p.63/78
(fungible) ERC-20 → ERC-223 (draft) or ERC-777 ( )( )
(non-fungible) ERC-721 ( ) ( ) ERC-1155 ( ) ERC-3525 (SLOT ) — 2023 7-8 — 2023-06-26 – p.64/78
— τʔΫϯ ସ՟ฎ εϚʔτίϯτϥΫτ ݕূՄೳͳঢ়ଶϚγϯ ϓϩϏφϯε དྷྺূ໌ ସՄೳ ঈؐෆೳ
ସՄೳ ঈؐՄೳ ସෆೳ ঈؐՄೳ ସෆೳ ঈؐෆೳ ূ໌͢Δ ಉఆ͢Δ ࢧ͍ ࠷ॳͷԠ༻ *%Χʔυ ηΩϡϦςΟ τʔΫϯ ূ݊ ηϯαʔ ྲྀɾ Ҩݴॻ อݥਃ ͢Δ ײ͢Δ தԝۜߦ σδλϧ௨՟ ҭήʔϜ ൿີ伴Λ͑Δ͔Βຊਓʁ ෛ࠴ Ξηοτͷ දݱΛҠసͰ͖Δʁ ొ͞Εͨίʔυͱ ͦͷ࣮ߦϩάͱ݁Ռͷ ਅਖ਼ੑΛ୲อͰ͖Δʁ ݖҖ͕ Կ͔ͷ༰Λূ໌͢Δʁ ࣋ଓ͢Δଘࡏʹ͍ͭͯ هΛΞοϓσʔτՄʁ ओମ͕͍ͳ͘ͳͬͯ աڈͷσʔλ༗ޮʁ /'5 Ұൠతͳ ೝࣝ ػೳͷ ੳ݁Ռ — 2023 7-8 — 2023-06-26 – p.65/78
— 2023 7-8 — 2023-06-26 – p.66/78
transfer settle, retrieve asset, retrieve token 3 — 2023 7-8
— 2023-06-26 – p.67/78
( ( )) ( ) / / — 2023 7-8
— 2023-06-26 – p.68/78
— 1. ( ) 2. ( ) 3. ( )
— 2023 7-8 — 2023-06-26 – p.69/78
token (ERC-20 ) $ brownie bake token GitHub git clone
$ git clone https://github.com/ks91/sample-smart-contracts.git sample-smart-contracts contracts, scripts tests token Token — 2023 7-8 — 2023-06-26 – p.70/78
OneTimeEscrow settle() function settle() public returns (bool) { require(_token_.balanceOf(address(this)) >=
_price_); /* this */ require(_asset_.getOwner() == address(this)); _token_.transfer(_seller_ , _price_); _asset_.transfer(_buyer_); emit Settled(); /* */ return true; } settle() transfer $ brownie compile — 2023 7-8 — 2023-06-26 – p.71/78
(1) from brownie import * import pytest seller = accounts[0]
buyer = accounts[1] def test_deploy_and_settle(Token, IndivisibleAsset, OneTimeEscrow): asset = accounts[0].deploy(IndivisibleAsset, "5322 Endo", "mˆ2", 300) token = accounts[0].deploy(Token, "Test Token", "TEST", 18, "1000 ether") — 2023 7-8 — 2023-06-26 – p.72/78
(2) token.transfer(buyer, 300, {’from’: accounts[0]}) escrow = accounts[0].deploy(OneTimeEscrow, token, buyer,
asset, seller, 300) accounts[0]/seller accounts[1]/buyer 300 300 TX buyer seller 300 bake Token 300 ETH wei — 2023 7-8 — 2023-06-26 – p.73/78
(3) token.transfer(escrow, 300, {’from’: buyer}) asset.transfer(escrow, {’from’: seller}) assert token.balanceOf(seller)
== 999999999999999999700 assert token.balanceOf(buyer) == 0 assert token.balanceOf(escrow) == 300 assert asset.getOwner() == escrow buyer ( ) 300 seller ( ) — 2023 7-8 — 2023-06-26 – p.74/78
(4) escrow.settle({’from’: seller}) assert token.balanceOf(seller) == 1000000000000000000000 assert token.balanceOf(buyer) ==
0 assert token.balanceOf(escrow) == 0 assert asset.getOwner() == buyer settle() seller OK — 2023 7-8 — 2023-06-26 – p.75/78
— 2023 7-8 — 2023-06-26 – p.76/78
4. × OK Web3 2023 6 30 ( ) 23:59
JST ( ) Waseda Moodle — 2023 7-8 — 2023-06-26 – p.77/78
— 2023 7-8 — 2023-06-26 – p.78/78