The Credit for this code goes to Block Explorer
In this contract, I built a simple vending machine with just a few features. This was a very simple contract, but it was nice to refresh my knowledge of mappings and contract logic.
- You can view the current balance in the vending machine
- Restocking the vending machine
- Limiting the restocking feature to only the contract owner
- Revert transaction when there is not enough stock and when less than 2 ether is paid for an item in the vending machine
To build this application in development, I used the following dependencies:
OpenZeppelin: Library for building reliable contracts on Ethereum
Remix IDE
Metamask: Identity to interact with the Blockchain
Etherscan: Block explorer for verifying/exploring transactions and contracts on Ethereum
Contributions are always welcome!
See contributing.md
for ways to get started.
Please adhere to this project's code of conduct
.
What optimizations did you make in your code? E.g. refactors, performance improvements, accessibility