Designing Secure Ethereum Smart Contracts: A Finite State Machine Based Approach
Anastasia Mavridou1 and Aron Laszka2
1 Vanderbilt University 2 University of Houston
Designing Secure Ethereum Smart Contracts: A Finite State Machine - - PowerPoint PPT Presentation
Designing Secure Ethereum Smart Contracts: A Finite State Machine Based Approach Anastasia Mavridou 1 and Aron Laszka 2 1 Vanderbilt University 2 University of Houston 2 Smart Contract Insecurity Smart contracts are riddled with bugs and
1 Vanderbilt University 2 University of Houston
2
3
Luu, Loi, Duc-Hiep Chu, Hrishi Olickel, Prateek Saxena, and Aquinas Hobor. "Making smart contracts smarter." In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, pp. 254-269. ACM, 2016.
4
5
6
7
T
8
T
dao.withdraw(dao.queryCredit(this)); } }
9
bank
bank
10
11
12
cancelABB withdraw bid reveal [values.length == secret.length] cancelRB close [now > creationTime + 5 days] unbid finish [now >= creationTime + 10 days]
C F RB ABB
C F RB ABB
cancelABB withdraw bid reveal [values.length == secret.length] cancelRB close [now > creationTime + 5 days] unbid finish [now >= creationTime + 10 days]
C F RB ABB
9/22/2017 demo / BIP_test https://editor.webgme.org/?project=demo%2BBIP_test&branch=master&node=%2Ff%2F1%2FD&visualizer=BIPEditor&tab=1&layout=DefaultLayout&selection= 1/1
cancelABB withdraw bid reveal [values.length == secret.length] cancelRB close [now > creationTime + 5 days] unbid finish [now >= creationTime + 10 days]
C F RB ABB
cancelABB withdraw bid reveal [values.length == secret.length] cancelRB close [now > creationTime + 5 days] unbid finish [now >= creationTime + 10 days]
C F RB ABB
9/22/2017 demo / BIP_test https://editor.webgme.org/?project=demo%2BBIP_test&branch=master&node=%2Ff%2F1%2FD&visualizer=BIPEditor&tab=1&layout=DefaultLayout&selection= 1/1
cancelABB withdraw bid reveal [values.length == secret.length] cancelRB close [now > creationTime + 5 days] unbid finish [now >= creationTime + 10 days]
C F RB ABB
cancelABB withdraw bid reveal [values.length == secret.length] cancelRB close [now > creationTime + 5 days] unbid finish [now >= creationTime + 10 days]
C F RB ABB
cancelABB withdraw bid reveal [values.length == secret.length] cancelRB close [now > creationTime + 5 days] unbid finish [now >= creationTime + 10 days]
C F RB ABB
13
cancelABB withdraw bid reveal [values.length == secret.length] cancelRB close [now > creationTime + 5 days] unbid finish [now >= creationTime + 10 days]
C F RB ABB
14
15
16
+= bool private locked = false; modifier locking { require(!locked); locked = true; _; locked = false; } += uint private transitionCounter = 0; modifier transitionCounting(uint nextTransitionNumber) { require(nextTransitionNumber == transitionCounter); transitionCounter += 1; _; }
17
+= bool private locked = false; modifier locking { require(!locked); locked = true; _; locked = false; } += uint private transitionCounter = 0; modifier transitionCounting(uint nextTransitionNumber) { require(nextTransitionNumber == transitionCounter); transitionCounter += 1; _; }
18
19
9/22/2017 demo / BIP_test https://editor.webgme.org/?project=demo%2BBIP_test&branch=master&node=%2Ff%2F1%2FD&visualizer=BIPEditor&tab=1&layout=DefaultLayout&selection= 1/1
cancelABB withdraw bid reveal [values.length == secret.length] cancelRB close [now > creationTime + 5 days] unbid finish [now >= creationTime + 10 days]
C F RB ABB
20
21