I put IPFS on a Raspberry Pi and so should you!
- Raspberry Pi 3 B: $43
- Micro SD card: $11
- [Raspberry Pi charger](ht
# Ethereum helper methods | |
# source this in your .bashrc or .zshrc file with `. ~/.ethrc` | |
# --- Solidity sandbox --- | |
# https://github.com/maurelian/solidity-sandbox | |
scratch() { | |
dir=$(pwd) | |
cd ~/Documents/projects/solidity-sandbox || exit | |
bash newTest.sh $1 | |
cd "$dir" || exit |
Using newer compiler versions and the optimizer gives gas optimizations and additional safety checks for free!
The advantages of versions 0.8.*
over <0.8.0
are:
0.8.0
(can be more gas efficient than some
library based safemath).0.8.2
, leads to cheaper runtime gas.
Especially relevant when the contract has small functions. For// SPDX-License-Identifier: UNLICENSE | |
pragma solidity >=0.8.0 <0.9.0; | |
// NOT TESTED - USE AT YOUR OWN RISK | |
// Supports 32 byte word types. Could be easily extended to multiword types by | |
// passing in the size of the elements as well though | |
struct PushableArray { |
// SPDX-License-Identifier: AGPL-3.0-only | |
pragma solidity ^0.8.10; | |
import 'https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC20.sol'; | |
import 'https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC721.sol'; | |
/// @title lil superfluid nft | |
/// @author Miguel Piedrafita, Ross Campbell | |
/// modified from (https://github.com/m1guelpf/lil-web3/blob/main/src/LilSuperfluid.sol) | |
/// @notice A simple token streaming manager represented by NFTs |