
Invariant Testing WETH With Foundry
There's been a lot of interest recently in invariant testing, a new feature in the Foundry toolkit, but until recently, there hasn't been much documentation on getting started with this advanced testing technique. The Maple Finance invariant test repo, this example repo from Lucas Manuel, and a new chapter in the Foundry book are all great resources, but it's still tough to get up and running. In this short guide, we'll write invariant tests from the ground up for Wrapped ...

Invariant Testing WETH With Foundry
There's been a lot of interest recently in invariant testing, a new feature in the Foundry toolkit, but until recently, there hasn't been much documentation on getting started with this advanced testing technique. The Maple Finance invariant test repo, this example repo from Lucas Manuel, and a new chapter in the Foundry book are all great resources, but it's still tough to get up and running. In this short guide, we'll write invariant tests from the ground up for Wrapped ...

Seen on C4: Storage Structs
One of the best parts of competing on Code4rena is reading code from many different projects and seeing different styles, designs, and techniques in the wild. This is an occasional series about interesting patterns I've seen on C4. Seen in Astaria and Drips.The problemUpgradeable contracts are fragile: they have changeable bytecode, but immutable storage layouts. This means contract authors must stay keenly aware of any code changes that alter their implementation's storage layout. ...

Seen on C4: Storage Structs
One of the best parts of competing on Code4rena is reading code from many different projects and seeing different styles, designs, and techniques in the wild. This is an occasional series about interesting patterns I've seen on C4. Seen in Astaria and Drips.The problemUpgradeable contracts are fragile: they have changeable bytecode, but immutable storage layouts. This means contract authors must stay keenly aware of any code changes that alter their implementation's storage layout. ...

Seen on C4: The File Pattern
One of the best parts of competing on Code4rena is reading code from many different projects and seeing different styles, designs, and techniques in the wild. This is the first post in an occasional series about interesting patterns I've seen on C4. Seen in Astaria.The problemA contract stores several configuration values, all of which should be settable only by an authorized caller. One straightforward solution is to write a separate setter with an auth modifier for each storage variabl...

Seen on C4: The File Pattern
One of the best parts of competing on Code4rena is reading code from many different projects and seeing different styles, designs, and techniques in the wild. This is the first post in an occasional series about interesting patterns I've seen on C4. Seen in Astaria.The problemA contract stores several configuration values, all of which should be settable only by an authorized caller. One straightforward solution is to write a separate setter with an auth modifier for each storage variabl...