|Title:||Optimization of Solidity Smart Contracts||Language:||English||Authors:||Brandstätter, Tamara||Keywords:||Blockchain; Solidity; Ethereum; Smart Contract; Optimierung; Blockchain; Solidity; Ethereum; Smart Contract; Optimization||Advisor:||Schulte, Stefan||Issue Date:||2020||Number of Pages:||99||Qualification level:||Diploma||Abstract:||
Smart contracts are computer programs that are deployed on the blockchain and can then be executed. Fees in form of gas have to be paid for deploying a smart contract on the blockchain, depending on the size of the byte code. Additional fees have to be paid, whenever a function of a smart contract is executed, depending on the needed computational steps and required storage space. On the Ethereum blockchain, millions of USD are paid in form of gas fees every single day. Since gas cost can increase if a contract is not well-implemented, there is a lot of incentive to reduce these gas cost in order to save money. We identified 19 optimization strategies from the field of software engineering, which can be applied to Solidity smart contracts in order to reduce the required gas cost. To show how these rules can be used to optimize smart contracts, we developed a prototype. The prototype detects rule violations from 9 of these rules and in addition automatically optimizes 6 of them. The prototype analyzed 3,018 verified open source smart contracts from etherscan.io. We found 471 rule violations in our test data set spread across 204 different contract files. That means, roundabout 6.8% of the data set violated at least one of the rules. We deployed the automatically optimized contracts in a test environment before and after the optimization, to compare the gas usage. We were on average able to save 1,213 gas for deploying an optimized contract version compared to the initial one. For calling an optimized function once, we were able to save on average 123 gas, compared to the initial function call.
|Library ID:||AC15624366||Organisation:||E194 - Institut für Information Systems Engineering||Publication Type:||Thesis
|Appears in Collections:||Hochschulschrift | Thesis|
Show full item record
Files in this item:
checked on Jul 2, 2020
Items in reposiTUm are protected by copyright, with all rights reserved, unless otherwise indicated.