Hats-Protocol/hats-zodiac(新しいタブで開きます)
主要言語: Solidity
Hats Protocol-enabled Zodiac contracts
- star 数
- 23
- watcher 数
- 2
- fork 数
- 8
- issue 数
- 7
- 最終更新
- 2025/04/18
主要言語: Solidity
Hats Protocol-enabled Zodiac contracts
This repo holds a Hats Protocol-enabled Zodiac contract called Hats Signer Gate (HSG).
A contract that grants multisig signing rights to addresses wearing a given hats, enabling on-chain organizations (such as DAOs) to revocably delegate to individuals constrained authority and responsibility to operate an account (i.e. a Safe) owned by the organization.
HatsSignerGate.sol is a Zodiac module that...
Since Hat-wearing is dynamic — Hats can be programmatically revoked from wearers — this contract also services as a Zodiac guard to ensure that:
A) Only valid signers can execute transactions, i.e. only signatures made by accounts currently wearing a valid signer Hat count towards the threshold.
B) Signers cannot execute transactions that remove the constraint in (A). Specifically, this contract guards against signers...
Warning Protections against (3) and (4) above only hold if the Safe does not have any authority over the signer Hat(s). If it does — e.g. it wears an admin Hat of the signer Hat(s) or is an eligibility or toggle module on the signer Hat(s) — then in some cases the signers may be able to change the multisig threshold or owners.
Proceed with caution if granting such authority to a Safe attached to HatsSignerGate.
Hats Signer Gate provides several ways to manage Safe signers based on their hat-wearing status:
claimSigner()When enabled by the owner (claimableFor = true):
claimSignerFor() or claimSignersFor()removeSigner()The threshold (number of required signatures) is managed dynamically based on the ThresholdConfig:
ABSOLUTE
PROPORTIONAL
min: Minimum number of required signatures (must be > 0)target: Either fixed number (ABSOLUTE) or percentage in basis points (PROPORTIONAL)thresholdType: ABSOLUTE (0) or PROPORTIONAL (1)The Safe's threshold is automatically adjusted when:
HSG restricts delegatecalls to protect the Safe from unauthorized modifications. Only approved targets can receive delegatecalls.
The following MultiSend libraries are enabled by default:
| Address | Version | Type |
|---|---|---|
0x40A2aCCbd92BCA938b02010E17A5b8929b49130D |
v1.3.0 | canonical |
0xA1dabEF33b3B82c7814B6D82A79e50F4AC44102B |
v1.3.0 | eip155 |
0x9641d764fc13c8B624c04430C7356C1C7C8102e2 |
v1.4.1 | canonical |
See safe-deployments for more information.
detach() — the owner must trust that admin(s) of the signer Hat(s) will not front-run the detachment to add arbitrary signers. Since admins in Hats Protocol are already trusted (and can be revoked, held accountable, etc.) this is not an additional risk, but HSG owners should nonetheless be aware of this risk.The wearer of the ownerHat can make the following changes to Hats Signer Gate:
ownerHatclaimableFor)Instances of HSG can be created via the Zodiac module proxy factory.
Instances can be created for an existing Safe by passing the Safe address on initialization, or for a new Safe to be deployed from within HSG's initialization.
v1 of this project has received the following security audits. See the v1 audits directory for the detailed reports.
| Auditor | Report Date | Commit Hash | Notes |
|---|---|---|---|
| Trust Security | Feb 23, 2023 | b9b7fcf | Report also includes findings from Hats Protocol audit |
| Sherlock | May 3, 2023 | 9455c0 | Report also includes findings from Hats Protocol audit |
v2 — the present version — has received the following security audits. See the v2 audits directory for the detailed reports.
| Auditor | Report Date | Commit Hash | Notes |
|---|---|---|---|
| Sherlock | December 13, 2024 | a9e3f4f | 166 auditors participated |
Note Since this audit was completed, HSG code was updated to add a variable salt to the Safe proxy creation within the
SafeManagerLib.deploySafeAndAttachHSGfunction. This ensures that the address of the Safe proxy is unique to the HSG instance.
See Releases for deployments. Specific deployment parameters are stored here.