theexoticman/zodiac-delegatecall-guard(opens in a new tab)
Language: TypeScript
- stars
- 5
- watchers
- 1
- forks
- 2
- open issues
- 0
- Last updated
- 06/11/2026
Language: TypeScript
The DelegateCall Guard is a Zodiac Custom Guard that secures Safe Wallets by restricting delegatecall (and/or call) operations to pre-authorized contract addresses, preventing unintended or malicious code execution while preserving Safe’s flexibility.
Authorization can be managed by the Safe itself, a designated role within a modifier entity, or an external governance structure. The Guard also integrates with the Zodiac Delay Module, offering an optional timelock to allow stakeholders time to monitor, review, and counter potential threats such as phishing attacks (address poisoning, clipboard hijacking) or misconfigurations.
Since delegatecall enables Safe wallets to execute external contract logic within the Safe Account context, strict authorization is essential to prevent asset mismanagement, fund lockups, scams, or exploits.
The DelegateCall Guard is an ideal solution for DAOs and teams looking to enforce stricter delegatecall controls without sacrificing Safe’s flexibility. 🚀
Allowing unrestricted delegate calls exposes wallets to security risks, including:
delegatecall is executed as if the Safe itself performed it, inheriting the Safe’s address and permissions. This can also include emitting fake events, making malicious actions appear legitimate.By enforcing controlled access to delegatecall, the DelegateCall Guard mitigates these risks, ensuring only trusted contracts can execute code on behalf of the Safe.
This Guard ensures that the Safe can only execute delegatecall and/or call operations to contracts that have been explicitly authorized in advance.
Safe users can authorize multiple addresses in a single transaction, streamlining the setup process.
To choose which transactions should be verified, make sure to use the Authorization Mode that best suits your needs.
Users can fully customize the module, choosing:
delegatecall or extends to all call operations for broader protection.Flexibility to manage delegatecall authorizations with the user entity of choosing.
0x1.Seamlessly import all existing delegatecall modules currently used by your Safe, and authorize them in a single batch transaction — minimizing setup friction and simplifying the onboarding process.
The Delay Module enforces a mandatory timelock on new authorizations, giving Safe owners — through monitoring tools — the time to review and respond to any suspicious changes before they take effect.
This Guard is fully compatible with the latest version of Safe Wallet and integrates directly into the Zodiac framework, ensuring seamless adoption for DAOs and teams already using Safe.
Also Compatible with Metaguard.
To deploy the DelegateCall Guard, the following parameters are required:
Set the authorization mode to 1 if you only want delegate call operations to be checked against the authorization list.
Set the authorization mode to 2 if you only want call operations to be checked against the authorization list.
Set the authorization mode to 3 if you want both delegate call and call operations to be checked against the authorization list.
Users can configure timelocks for both authorization and deauthorization using the Zodiac Delay Module:
These delay modules can be configured independently:
address(1).⚠ Security Recommendation: It is strongly advised to use an authorization delay module to prevent immediate changes that could introduce risks.
To activate the Guard on an existing Safe, users must enable it by calling the setGuard function.
In case you decide to use one or more Delay Modules, you need to enable the guard on these contracts.
Additionally, the Delay Modules should be authorized in the Authorization Manager, as they execute transactions via the execTransactionFromModule function from the contract.
This Guard aims to balance security with simplicity, enabling DAOs and project teams to protect their Safes from high-impact delegatecall risks without introducing excessive constraints or operational complexity.
Contributions, feedback, and feature requests are warmly welcomed.
# Install dependencies npm install # Run tests npm test
All contracts are WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.