Upgradeability
Smart contract code can't be modified after being deployed to the blockchain. In order to facilitate potential upgrades, bug fixes or security updates, Term Finance smart contracts adopt OpenZeppelin's implementation of the UUPS Proxy Pattern to facilitate necessary updates, with the intent to gradually remove upgradeability altogether over time.
Consistent with OpenZeppelin's recommendation for smart contracts that adopt the UUPS proxy pattern, the _authorizeUpgrade function is overridden to restrict access to an address set to the DEVOPS_ROLE. The DEVOPS_ROLE is reserved for the most sensitive Protocol admin actions (including upgrades) and is held only by the OwnerlessSafe. Actions reach the OwnerlessSafe through a 24-hour timelock, during which Term multisig holders and TERM token holders can veto them and a pause can halt execution. The architecture is detailed below.
DEVOPS_ROLE Governance Architecture
Execute path
The DevOps-Proposer Safe (5/11) queues a transaction on the Zodiac Delay Modifier. It is the Delay Modifier's only module, so it is the only account that can queue.
The transaction waits through a 24-hour cooldown, during which it can be vetoed or paused.
Once the cooldown has passed, anyone can execute the transaction during the following 24-hour window (between 24 and 48 hours after it was queued). After that it expires and must be queued again.
The Delay Modifier executes the transaction through the OwnerlessSafe, the only holder of DEVOPS_ROLE, which calls the protocol contract.
The OwnerlessSafe's own signers can also act directly, without the delay, but only with all 9 of 9 signatures.
Veto path
Vetoes cancel queued transactions by advancing the Delay Modifier's transaction nonce (setTxNonce). Only the Delay Modifier's owner, the DelayOwnerSafe (5/11), can do this. A veto can only cancel transactions; it cannot create one.
There are two ways to veto:
Term multisig holders sign a
setTxNoncetransaction on the DelayOwnerSafe. The DelayOwnerSafe has the same 11 signers as the DevOps-Proposer Safe.TERM token holders pass a vote on the TERM Governor. The Governor acts through a Zodiac Roles Modifier that is a module of the DelayOwnerSafe. The Roles Modifier has no owner, and its single permission lets the Governor call only
setTxNonceon the Delay Modifier. A SetTxNonceGuard on the Roles Modifier enforces the same restriction.
Voting token
Voting delay
0 (voting opens as soon as a proposal is created)
Voting period
22 hours
Proposal threshold
1,000 TERM
Quorum
1% of total supply (1,000,000 TERM), counting For and Abstain votes
Timelock
None
Because the voting period (22 hours) is shorter than the Delay Modifier's cooldown (24 hours), a veto proposal created shortly after a transaction is queued can pass before that transaction becomes executable.
Pause path
A PauseGuard is installed as the Delay Modifier's guard. While it is paused, no queued transaction can be executed. A transaction that expires while paused must be queued again.
DEFAULT_ADMIN_ROLE
None (address(0))
Nobody can grant or revoke ADMIN_ROLE
Like a veto, a pause can stop a queued transaction but cannot create one.
Configuration locks
The setup is protected against reconfiguration:
A ConfigLockGuard is installed on the DevOps-Proposer Safe, the OwnerlessSafe and the DelayOwnerSafe. On transactions signed by a Safe's owners, the Safe cannot change its own guard, modules or fallback handler, or make a delegate call. On the DelayOwnerSafe it also locks the Delay Modifier's owner, modules, guard and target.
The Roles Modifier's owner is
address(0), so its configuration, including the Governor's single permission, can never change.The Governor has no timelock, and its voting token, proposal threshold, voting threshold and quorum cannot be changed.
Signers of the DevOps-Proposer Safe
DevOps-Proposer Safe signers
Signers of the DelayOwnerSafe
DelayOwnerSafe signers
Signers of the OwnerlessSafe
OwnerlessSafe signers (9/9), or the DevOps-Proposer Safe through the execute path
Guard, modules and fallback handler of the OwnerlessSafe
The DevOps-Proposer Safe, only through the execute path (timelocked, vetoable and pausable)
Delay Modifier cooldown and expiration
DelayOwnerSafe signers
Guard, modules and fallback handler of the DevOps-Proposer Safe and DelayOwnerSafe
Nobody
Delay Modifier owner, target, modules and guard
Nobody
Roles Modifier configuration
Nobody
Governor voting token, proposal threshold, voting threshold and quorum
Nobody
Formal verification
The properties on this page are established in the Governance Configuration Proof (PDF), which combines two kinds of evidence:
Formal verification with the Certora Prover shows that, given the stated configuration, the Safes, modifiers, guards and Governor enforce these properties, including that there are no other execution paths. The specs are in
packages/evm/certora.On-chain reads at stated mainnet blocks show that the deployed contracts have that configuration.
The proof concludes:
Only Term multisig holders on the DevOps-Proposer Safe and on the OwnerlessSafe can execute DEVOPS_ROLE methods, provided the call is not vetoed.
Only TERM token holders and Term multisig holders can veto Delay Modifier transactions.
The Roles Modifier's configuration and the Governor's voting token, proposal threshold, voting threshold and quorum cannot be changed by anyone.
The remaining settings can be changed only by Term multisig holders, as listed in the table above.
Contract addresses (Ethereum)
OwnerlessSafe
Safe v1.3.0, 9 of 9 · holds DEVOPS_ROLE · module: Delay Modifier · guard: ConfigLockGuard
DevOps-Proposer Safe
Safe v1.3.0, 5 of 11 · no modules · guard: ConfigLockGuard
DelayOwnerSafe
Safe v1.4.1, 5 of 11 · module: Roles Modifier · guard: ConfigLockGuard
Admin Gnosis Safe
Safe v1.3.0, 4 of 10 · PauseGuard ADMIN_ROLE
Delay Modifier
24h cooldown, 24h expiration · owner: DelayOwnerSafe · module: DevOps-Proposer Safe · target: OwnerlessSafe · guard: PauseGuard
Roles Modifier
Owner: address(0) · module: Governor · target: DelayOwnerSafe · guard: SetTxNonceGuard
ConfigLockGuard
Guard on the OwnerlessSafe, DevOps-Proposer Safe and DelayOwnerSafe
Other chains
Chains other than Ethereum have no TERM token, so their DEVOPS_ROLE governance has no token veto. The Governance without TERM Token Veto Configuration Proof (PDF) is the proof for the governance setup these chains will have: each chain's existing DevOps-Proposer and Ownerless Safes with the 2.1.0 guards, a new DelayOwnerSafe and a new PauseSafe.
Last updated