A collection of projects and resources to learn about creating and deploying smart contracts on Ethereum using Solidity.
It also covers how to communicate with smart contracts from Node.js and browsers, as well as more advanced concepts such as memory layout, delegate calls, and fallback functions.
Additionally, the repository provides an implementation of the diamond pattern, which enables you to create smart contracts of arbitrary size.
The first Hello World contract with basics of creating and deploying a smart contract on the Ethereum blockchain using Solidity.
A counter contract that can be incremented and decremented. Unlike the hello world example, this contract changes state. The change in state creates a new block and triggers a gas fee.
A basic RPG game, the contract uses the enum type to manage the different player types, uses a mapping to store the heroes generated by the user, uses a random number generator to select a player attribute and assign a value. The payment modifier is added to any function that requires a monetary payment to be included with the function call.
The Diamond Pattern helps address contracts that are too large and scenarios where a contract needs to be updated. An external fallback method is created to handle any calls to methods that do not exist. In order for the fallback to work, non-existent methods should be defined in an interface.