Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
スマートコントラクトデザイン / Smart Contract Design
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Kenji Saito
PRO
October 27, 2025
Technology
71
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
スマートコントラクトデザイン / Smart Contract Design
慶應義塾大学大学院メディアデザイン研究科「サービスデザインプロジェクトB」2025秋 第4回にて使用したスライドです。
Kenji Saito
PRO
October 27, 2025
Transcript
30 slides
generated by Stable Image Ultra B 2025 4 ( )
B 2025 — 4 — 2025-10-27 – p.1/30
https://speakerdeck.com/ks91/collections/service-design-project-b-2025-fall ( ) ( ) Discord Discord ( / /
) Zoom URL ( ) B 2025 — 4 — 2025-10-27 – p.2/30
( ) 1 10 6 • 2 10 13 •
3 10 20 • 4 10 27 • 5 11 10 1 6 11 24 2 7 12 1 8 12 8 ( ) ( ) 4 ( 3 ) ↓ B 2025 — 4 — 2025-10-27 – p.3/30
( ) — (3) : Web3 B 2025 — 4
— 2025-10-27 – p.4/30
( ) — Ethereum Sepolia B 2025 — 4 —
2025-10-27 – p.5/30
infura.io Brownie https://infura.io SIGN UP PROJECT ID infura Ethereum API
infura . . . infura.io Amazon infura.io PROJECT ID WEB3_INFURA_PROJECT_ID PROJECT ID (∼/.bash_profile ) $ export WEB3_INFURA_PROJECT_ID= PROJECT ID B 2025 — 4 — 2025-10-27 – p.6/30
Sepolia ETH brownie console Sepolia >>> network.disconnect() >>> network.connect(’sepolia’) >>>
len(accounts) 0 >>> accounts.add() <LocalAccount object ’ 16 ’> >>> accounts[0].private_key 16 >>> quit() Sepolia Testnet ETH Faucet ETH https://sepoliafaucet.com ( ) ( ) . . . Ethereum 0.001 ETH 0.1 Sepolia ETH B 2025 — 4 — 2025-10-27 – p.7/30
Sepolia ETH brownie console Sepolia ETH >>> network.disconnect() >>> network.connect(’sepolia’)
>>> len(accounts) 0 >>> accounts.add( 16 ) <LocalAccount object ’ 16 ’> >>> accounts[0].balace() ETH >>> quit() ETH >>> accounts[0].transfer(accounts[1], "0.01 ether") B 2025 — 4 — 2025-10-27 – p.8/30
(3) : B 2025 — 4 — 2025-10-27 – p.9/30
transfer settle, retrieve asset, retrieve token 3 B 2025 —
4 — 2025-10-27 – p.10/30
1. ( ) 2. ( ) 3. ( ) B
2025 — 4 — 2025-10-27 – p.11/30
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 B 2025 — 4 — 2025-10-27 – p.12/30
(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") B 2025 — 4 — 2025-10-27 – p.13/30
(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 B 2025 — 4 — 2025-10-27 – p.14/30
(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 ( ) B 2025 — 4 — 2025-10-27 – p.15/30
(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 B 2025 — 4 — 2025-10-27 – p.16/30
$ pytest tests/test_one_time_escrow.py : settle() ⇒ Discord B 2025 —
4 — 2025-10-27 – p.17/30
B 2025 — 4 — 2025-10-27 – p.18/30
1. (1) (2) Ethereum 2025 10 25 ( ) 23:59
JST B 2025 — 4 — 2025-10-27 – p.19/30
. . . . . . 3 1 ( )
( ) ( ) B 2025 — 4 — 2025-10-27 – p.20/30
A ⇒ B 2025 — 4 — 2025-10-27 – p.21/30
A Ethereum NFT NFT NFT B 2025 — 4 —
2025-10-27 – p.22/30
A — NFT NFT NFT ⇒ ( ) B 2025
— 4 — 2025-10-27 – p.23/30
⇒ 20 Discord . . . ( ) B 2025
— 4 — 2025-10-27 – p.24/30
Web3 Web3 HTTPS B 2025 — 4 — 2025-10-27 –
p.25/30
B 2025 — 4 — 2025-10-27 – p.26/30
miro ( ) ( ) B 2025 — 4 —
2025-10-27 – p.27/30
B 2025 — 4 — 2025-10-27 – p.28/30
2. API (1) ( ) (2) Web API 2025 11
8 ( ) 23:59 JST B 2025 — 4 — 2025-10-27 – p.29/30
B 2025 — 4 — 2025-10-27 – p.30/30
More Decks by Kenji Saito
See All by Kenji Saito
NPO とは何か(を考えるワールドカフェ) / What Is an NPO? (A World Café Discussion)
ks91
PRO
0
15
講師自己紹介 / Lecturer's Self-Introduction
ks91
PRO
0
15
講師研究紹介 / Faculty Research Profile
ks91
PRO
0
10
FinTech 11-12 : Cyber-Physical Society and Future of Finance
ks91
PRO
0
61
サイバーフィジカル・セキュリティーと人間の安全保障 / Cyber-Physical Security and Human Security
ks91
PRO
0
32
ゼミ紹介 デジタルトランスフォーメーションと経済・金融の未来 / Zemi Introduction : Digital Transformation and the Future of the Economy and Finance
ks91
PRO
0
37
FinTech 9-10 : Smart Contracts and Decentralized Finance
ks91
PRO
0
81
FinTech 7-8 : Blockchain
ks91
PRO
0
84
Fall 2026: A Guide & Workshop on Using AI for Academic Paper Writing
ks91
PRO
1
130
Other Decks in Technology
See All in Technology
あの日、見つかっていなかったらどうなっていたか
kazzpapa3
2
240
市販IoT機器や自作IoT機器とHomeAssistantを駆使して家の電気代をできる限り見える化する方法の考案
harutiro
0
360
Where Should Platform Complexity Live? Lessons from a Cross-Team PR Preview Platform
taiki45
0
130
サーバーラックは作る時代! 3Dプリンターで作る10インチラックのススメ
jacopen
1
420
お風呂場をサーバルームにしよう
yusuke427
0
300
2026-11-16 JAWS-UG コンテナ支部 #31 ゆるLT大会 ECR のライフサイクルポリシーを いい感じに設定したい / ECR Lifecycle policy
masasuzu
2
410
AIネイティブ組織の作り方。1人のPOとAIから始める、自社での実験
ama_ch
2
1.1k
文書画像からの情報抽出を行うエージェントを、軌跡の正解データ無しで作れるか
sansantech
PRO
2
170
こんなに変わった! AWSネットワークの常識
shotashiratori
15
9.4k
Context parameters で作る!はじめての型クラス
kworkdev
PRO
1
150
契約書SaaSにAIエージェントを組み込む
sansantech
PRO
0
180
E2E Test というハーネス — AI時代の自動テスト民主化
daishukojima
10
5.1k
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
187
23k
Building Better People: How to give real-time feedback that sticks.
wjessup
371
20k
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
280
Done Done
chrislema
187
17k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
620
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
380
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
460
Designing for humans not robots
tammielis
254
26k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Leo the Paperboy
mayatellez
11
2.5k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.9k