Solidity
0001-1-1 | programming | | [reference]
A compilation of Solidity learnings in a journal format.
Resources
12/31/21
The OpenDAO token contract recently made headlines as it included some relatively esoteric intricacies. The code for the token/DAO can be found here, and here’s a great Twitter thread that dives into the code. Here’s the TLDR:
- It doesn’t have “traditional” exploits, but does have some peculiarities
Hardhat deployment verification:
- Generally, if verifying a contract deployed using multiple constructor arguments, it’s recommended you use the –constructor-args flag and a corresponding file with the constructor args. Forum discussion
Fallback functions
- https://medium.datadriveninvestor.com/fall-back-function-in-solidity-d618254efc8e
- https://ethereum.stackexchange.com/questions/81994/what-is-the-receive-keyword-in-solidity/81995
Random tips
- Convert address to string
- safeTransfer vs transfer
- erc20 decimals
- Interacting with contracts via hardhat
- Verifying contracts via Remix
- Virtual and override keywords
- Documenting Solidity
- Events in Solidity