Abstract:
The key component of blockchain-technology is smart contract. When the predetermined
circumstances are met, smart contracts on the blockchain operate automatically.
For building decentralized applications Ethereum is a popular platform globally. Ether
is cryptocurrency which Ethereum uses a gas, to compensate miners for their resource
usage and smart contract execution. This gas cost is paid by the all the users participating
in the blockchain. If smart contract is not optimized, the cost exceeds the required
gas cost, leading to the excessive extra fees to the users, and this overcharging and
expensive gas costs demotivate the users from using smart contracts and blockchain.
Smart contracts are immutable, once deployed the code can’t be changed. This means
any bugs or logical errors that appear after deployment can’t be fixed. Therefore, before
deploying smart contracts onto the main chain, optimization techniques must be
applied to them to make blockchain and smart contracts scalable and cost-effective.
Our work contains 3 parts, (1) Designing pharmaceutical supply chain smart contract,
(2) Analyzing smart contract optimization techniques, (3) Smart contract development
on private chain using proof of authority as consensus mechanism on the Ethereum private
blockchain and comparison of gas cost between unoptimized and optimized smart
contract. We have tested our smart contract with 11 nodes on a private Ethereum
blockchain and we have achieved promising results for smart contract gas cost optimization with various optimization techniques.