Debugging Smart Contracts with Foundry

Posted on Sun 24 November 2024 in tech • Tagged with programming, solidity, ethereum, foundry, forge, debugging, smart-contracts

Debugging in Foundry and Forge: Techniques for Solidity Developers

In this video, I walk through four essential debugging techniques in Foundry and Forge, as outlined in my YouTube video. These techniques include:

  1. Verbose Test Output
  2. Foundry Interactive Debugging
  3. Printf Debugging
  4. Event Logging

1. Verbose Test Output

Verbose test output is …


Continue reading

Dancing Cells

Posted on Mon 01 January 2024 in tech • Tagged with rust, programming, solidity, evm, blockchain

I found the discussion of "Dancing Cells" in Don Knuth's latest lecture (2023) extremely relevant to blockchain programming.

The reason is this method of memory allocation is very similar to the method required to organize data as a set in Solidity. See here

Here is a example implementation of some …


Continue reading

The Case for Solidity-Only Testing in Smart Contract Development

Posted on Mon 09 October 2023 in tech • Tagged with ethereum, solidity, foundry

The Case for Solidity-Only Testing in Smart Contract Development

If you're diving into the world of Solidity and smart contracts, you may have wrestled with the question: should I develop and test my project entirely in Solidity? For those unfamiliar with the debate, the alternative is often testing using TypeScript …


Continue reading

vm.mockCall in Solidity

Posted on Mon 24 July 2023 in tech • Tagged with solidity, ethereum, programming, tutorial

mocking calls to specific addresses in solidity

Mocking a specific address signature in Solidity is useful for simulating expected behavior from an existing address or instance of a contract. In mock testing dependencies are replaced with simulated implementations to isolate the behavior of the funtion under test.

Proxy contracts that …


Continue reading

UUPS ERC-1822 Proxy Contract Implementation

Posted on Fri 21 April 2023 in tech • Tagged with solidity, programming, tutorial

Universal Upgradeable Proxy Standard UUPS ERC-1822 Tutorial and Complete Working Example

The first time I had to implement a UUPS proxy I found no clear example anywhere on the Internet. There are many trial implementations and even builders that enable one to implement a proxy in the background. It is …


Continue reading

Collective Governance Deployment to Sepolia TestNet

Posted on Mon 17 April 2023 in tech • Tagged with solidity, programming, ethereum, web3, deployment

Collective Governance 0.9.8 is deployed on Sepolia TestNet.

Sepolia TestNet

Contract Ethereum Address Version
Constant 0xD5DA9B812806E080948476A801d2004f3305E63F 0.9.8
CommunityBuilder 0x4ba7E0dc43180Cb10EF53FF9Da923E02f459Ec9F 0.9.8
GovernanceBuilder 0xe1a13ea37F2BFE35B612799fcf9eBD43efA00B87 0.9.8

Collective Governance is a smart contract that allows communities to decide outcomes on-chain. Collective Governance is also designed to …


Continue reading