thirdweb is redesigning its smart contracts so that developers can use only and exactly what onchain infrastructure they need for their use case.

Our new architecture, called the “hooks architecture,” introduces lightweight with the option to add and remove contract functionality through external calls referred to as “hooks.”

<aside> 🚧 Call for feedback: This design and its contracts are currently NOT AUDITED. This design update is WIP and we encourage giving us your feedback.

</aside>

Architecture

Developers deploy non-upgradeable contracts called core contracts. These contracts contain minimal, immutable code that governs critical state of the contract.

Developers can extend the functionality of their core contract by installing hooks into them.

Hooks are external calls made to hook functions implemented by a hook contract. These calls are made at fixed, pre-defined points in the execution of functions in the core contract.

Untitled

Upgradeability

thirdweb enables three different trust models when upgrading contracts within our hooks architecture. Each model provides security that fits the needs of your development team:

Managed upgradeable contracts

thirdweb is authorized to upgrade developer contracts, which can now receive security patches and feature updates.

Developers can opt-out of thirdweb managed upgrades. Alternatively, developers can authorize platforms other than thirdweb to manage their contract upgrades.

How it works:

Developers use hook smart contracts that are upgradeable by thirdweb.

This means that one upgrade (applied by thirdweb) to a hook contract is propagated to all n number of developer contracts using that hook contract.

Untitled

Self-managed upgradeable contracts

Only the developer is authorized to upgrade their contracts.