This repository contains Solidity smart contract projects and CTF-like challenges for learning purposes.
Built and tested with Hardhat.
Some of the old projects were built and tested with now deprecated Truffle Suite using now deprecated Ganache local test network and Sepolia public test network.
Useful resources:
URL | Description |
---|---|
weekinethereumnews.com | Latest Ethereum blockchain and EVM news and updates. |
docs.soliditylang.org | Official Solidity documentation. |
consensys.github.io | Solidity best coding practices. |
solidity-by-example.org | Solidity smart contract xamples. |
docs.openzeppelin.com | Secure Solidity smart contracts. |
wizard.openzeppelin.com | Secure Solidity smart contract wizard. |
ethervm.io | EVM opcodes - Solidity assembly. |
hardhat.org | Offline Solidity IDE. |
remix.ethereum.org | Online Solidity IDE. |
infura.io | Sepolia - Ethereum public test network. |
docs.ethers.org | Front-end library to connect with blockchain. |
web3js.readthedocs.io | Front-end library to connect with blockchain. |
Work in progress...
- Ethernaut
- Upgradeable Contracts
- Fundraiser (old)
- Metamorphic Malware (old)
Web: ethernaut.openzeppelin.com
GitHub: OpenZeppelin/ethernaut
Built and tested with Hardhat. Work in progress...
From \Ethernauth\hardhat, run the unit tests:
npm install
npx hardhat compile
npx hardhat test --network localhost --parallel
Unit tests (Hardhat):
[Deprecated] Unit tests (Truffle):
Built and tested with Hardhat. Work in progress...
Smart contracts:
Unit tests:
Migrations:
Built and tested with now deprecated Truffle Suite using now deprecated Ganache local test network and Sepolia public test network.
Work in progress... Also, need to migrate to Hardhat.
Install Truffle:
npm install -g truffle
Make sure to start a local test network using Ganache on port 8545
.
Figure 1 - Ganache Setup
From \Fundraiser\truffle, run the unit tests:
npm install
truffle compile
truffle test --network development --show-events
From \Fundraiser\client, run the client web application:
npm install
npm start
Navigate to the client web application with your preferred web browser.
Figure 2 - GitHub Fundraiser
To run the unit tests on Sepolia public test network, do the following:
[1] Specify your Infura (Sepolia) API key and MetaMask wallet mnemonic inside \Fundraiser\truffle\example.env file.
[2] Rename the file from example.env
to .env
.
[3] In your MetaMask wallet, switch to the Sepolia public test network.
[4] Get some Sepolia ETH from infura.io/faucet/sepolia to your MetaMask wallet.
[5] Finally, run:
truffle test --network sepolia --show-events
Smart contracts:
Unit tests:
Migrations:
Client web application:
Built and tested with now deprecated Truffle Suite using now deprecated Ganache local test network and Sepolia public test network.
Work in progress... Also, need to migrate to Hardhat.
From \Metamorphic, run the unit tests:
npm install
truffle compile
truffle test --network development --show-events
Smart contracts:
Unit Tests:
Migrations: