The Directory access manager guards the administrator calls of the global DALP contracts. With maker-checker on, one person requests a guarded call and a different person approves it before it can be sent. The four-eyes:* commands carry out that work from a terminal, one transaction per command. They add and remove people, write the rules, turn maker-checker on and off, open deploy windows and take every role from the key that set the chain up.
Each signing command prints the exact transaction and what it means in plain words, asks you to type yes, sends it, and stops. None of them takes a second step for you. four-eyes:status signs nothing and only reads.
Run the commands from the onchain/evm folder of the DALP release checkout, with bun run four-.
Who does what
The access manager knows three roles. The commands name them by what they do.
A person who holds both roles still cannot approve their own request: four-eyes:approve refuses it before it sends anything, and the access manager refuses it too.
Options every command takes
Without --signer, the signing commands read the key with op read, the 1Password command-line tool, at the moment they need it. The key never appears in the output: any text that would contain it prints [secret] instead. --help on any command prints its own options.
Sign with a hardware wallet
Every signing command can sign on a Ledger or a Trezor in place of a 1Password key. The private key stays on the device. The commands reach the device through cast, the Foundry tool that the release checkout's development environment installs.
Connect the device and unlock it. On a Ledger, open the Ethereum app, allow blind signing in its settings, and close other wallet apps that use the device. Then replace --key-ref with --signer:
bun run four-eyes:approve --proposal <request id> --from-block <request block> \
--rpc-url "$RPC_URL" --chain-id 47898 --signer ledgerThe command asks the device for the address of the account and signs with that account. To use another account, pass its derivation path with --hd-path. On Ledger Live, the second account is usually m/44'/60'/1'/0/0. Check the from line of the transaction block against the wallet you expect.
After you type yes, the command prints three values before the device asks you to confirm:
If your device shows a transaction hash, compare it with the signing hash, and reject on the device when they differ. A device screen does not show the short hash.
The command also checks what comes back from the device. It sends nothing when the signed transaction has no chain id or another chain id, carries other calldata, changes the target, nonce, gas, gas price or value, or comes from another account.
Read the setup
bun run four-eyes:status --rpc-url "$RPC_URL" --chain-id 47898four-eyes:status needs no key. It prints one section per check, and each line starts with ok, info or WARN. It exits with 1 when it printed any warning, so a pipeline can stop on it.
Under a warning that one command fixes, four-eyes:status prints close it: and that command, ready to run against the same chain. A listed person who lacks a role, or an approver whose wallet cannot request, gets an add-person line that names the same --people and --networks files you gave four-eyes:status. A role holder the network config does not list, other than the old key, gets a remove-person line, and an old key that still holds a role gets a remove-old-key line. A function with NO RULE gets one set-rules line after the Rules section, a difference between the chain's maker-checker switch and the network config gets an enable-maker-checker or disable-maker-checker line, and an approver seat warning repeats the add-person line for a listed person who lacks the role, or tells you to add a person to the network config when it lists too few. A warning no command closes, such as a longest-window difference or a Directory that names another access manager, stays as it is.
Every step command reads the committed Ignition record of the chain you name with --chain-id, the folder ignition/, even in the repo's devenv shell where IGNITION_DEPLOYMENT_ID names the local stack. Only the local chain, 31337, follows IGNITION_DEPLOYMENT_ID. --directory and --old-key still override the record.
The seat check also warns when fewer approvers hold the role than one to request, the approvals the strictest rule needs and one spare, and when any role a rule relies on has fewer than two holders, since one lost key would then lock it.
Hand the access manager from the setup key to people
On a chain that a single key set up, that key holds the approver, requester and recovery guardian roles on the access manager. These steps give the roles to named people, turn maker-checker on and then take every role from the setup key. Run four-eyes:status between steps: it shows what is left and prints the command for the next step.
- Each person adds a signed entry for their own wallet to the people list.
bun ignition/(orconfig/ four- eyes/ join. ts -- name <name> -- address <wallet> -- level approver --) prints a text to sign in that wallet. The same command withlevel requester --adds the entry. The change goes in through a pull request and grants nothing on any network.signature <signature> - The network config (
ignition/) names the approvers and requesters of each network. Add the people there in the same pull request.config/ four- eyes/ networks. json - While maker-checker is off, the setup key runs
four-for each person. It grants each approver the approver role and each requester the requester role. An approver who also requests gets the requester role from a second run witheyes:add- person -- name <name> --. Add at least two approvers, and three to keep a spare.role requester - The setup key runs
four-eyes:set-rulesto write the standard rule, one approval by an approver, on every guarded function. - The setup key runs
four-. From then on every guarded call needs a request and an approval.eyes:enable- maker- checker - Request, approve and open one deploy window, then close it, as described in Open a deploy window. This proves the approvers can work before the setup key loses its roles.
- For each role holder other than the setup key that
four-eyes:statusreports as not listed, requestremove-personwith its--addressand--role, have it approved, then sendfour-eyes:remove-personwith the same options. - Request
remove-old-key, have it approved, then sendfour-eyes:remove-old-key. Each run takes one role from the setup key, the approver role last, and prints the command for the next role. Repeat untilfour-eyes:statusprintsthe old key <address> holds no role on the access manager.
A holder account that lists the setup key as a recovery guardian keeps it after these steps, because only the account can change its own guardians. four-eyes:status lists each such account under Holder accounts guarded by the old key.
Commands that change people and rules
Each of these commands sends one call to the access manager. While maker-checker is off, the role alone is enough. While it is on, each call needs an approved request for exactly the same options, as in Open a deploy window: four-, then four-eyes:approve, then the command itself.
four-eyes:request takes open-window, extend-window, add-person, remove-person, set-rules, disable-maker-checker and remove-old-key. Turning maker-checker on needs no request, because the access manager waives approvals while it is off.
The access manager's own grantRole, revokeRole, setActionConfig, disableMakerChecker, upgradeToAndCall, openWindow and extendWindow must each have a rule of at least one approval before maker-checker turns on, and keep one while it is on. Without that, one person could turn the control off or give themselves a second role alone.
When these commands refuse
four-eyes:add-person refuses when:
- the people list has no entry with that name
- the entry's signature does not recover to its wallet: the person signs again with
join.ts - the person is listed as a requester and the role is approver or recovery guardian
- the network config does not list the person for that role on this network
- the wallet already holds the role
four-eyes:remove-person and four-eyes:remove-old-key refuse when the wallet holds no such role, and when taking the approver role would leave fewer approvers than the floor. They warn, and ask before going on, when it would leave fewer approvers than the advised count.
four-eyes:set-rules refuses when every rule it would write is already the standard rule, when the access manager has fewer than two approvers, and when --role-only names one of the access manager's own guarded functions.
four- refuses when maker-checker is already on, when it is given --access-manager instead of a Directory, because it then cannot check the next point, when the platform guardian, a factory or a global registry does not answer to this access manager, and when one of the access manager's own guarded functions has no rule of at least one approval. It warns when a guarded function has no rule (once maker-checker is on, every call to such a function is refused), and when the access manager has fewer approvers than the advised count.
four- refuses when maker-checker is already off.
Open a deploy window
A deploy window lets a fresh deploy key act as a requester for a short time, for one release commit. The window key must hold no role of its own, and the window cannot outlast the longest window the access manager allows. With maker-checker on, opening and extending a window each need an approved request for exactly the same arguments.
-
A requester asks for the window:
bun run four-eyes:request open-window --key 0xNewDeployKey --duration 4h --release <40-digit commit> \ --rpc-url "$RPC_URL" --chain-id 47898 --key-ref op://Deploy/requester/private-keyIt prints the propose transaction, the request id and the command to give an approver.
-
A different approver checks and approves it:
bun run four-eyes:approve --proposal <request id> --from-block <request block> \ --rpc-url "$RPC_URL" --chain-id 47898 --key-ref op://Deploy/approver/private-keyIt reads the request's calldata back from the chain, checks it against the stored hash, and shows what the request does and its short hash. Compare that short hash with the one the requester sees: the same call always gives the same short hash, and a different key, duration or commit gives a different one. The short hash is 20 hex digits in groups of four, too long for a requester to search out a different call that shows the same one.
-
Once the request has its approvals, the requester sends the step:
bun run four-eyes:open-window --key 0xNewDeployKey --duration 4h --release <40-digit commit> \ --rpc-url "$RPC_URL" --chain-id 47898 --key-ref op://Deploy/requester/private-key
A duration is a number of seconds, or a number followed by s, m, h or d. 4h and 240m are the same window and give the same short hash.
four- adds time to the open window. It follows the same three steps, with extend-window as the request.
Close the window
bun run four-eyes:close-window --rpc-url "$RPC_URL" --chain-id 47898 --key-ref op://Deploy/requester/private-keyClosing needs no approval. The window key, a requester or an approver may close it. Close it as soon as the deploy is done, then run four-eyes:status to see no deploy window is open.
Deploy a release inside a window
Once a chain's Directory links its access manager, a release upgrade (bun run upgrade:<network>) runs inside a deploy window by itself. The run that first installs the access manager still deploys with the deploy key it always used. A redeploy (bun run redeploy:<network>) builds a new system at new addresses and sends nothing to the old Directory, so it deploys with that same deploy key, which becomes the first administrator of the new system.
bun run upgrade:staging --window-vault Deploy --key-ref op://Deploy/requester/private-keyThe run:
- Makes a fresh deploy key for the release and keeps it in the 1Password vault you name, with the release's commit beside it. A run that stopped halfway resumes with the key it kept, also from a later commit with the same
onchain/evmoutsideignition/deployments. A kept key made for another release is retired first: the run closes its window, sends its gas back to the gas wallet and deletes it, then makes a new key for this release. - Opens the window for that key and this checkout's commit. With maker-checker off the requester sends it. With maker-checker on the run sends nothing itself: it prints the
four-command, and goes on once a requester and an approver have opened the window (it waits up toeyes:request open- window --approval-timeout, 2 hours by default). With maker-checker on it deploys only inside a window a second approver opened after maker-checker was last turned on, for this checkout's commit or for an earlier commit with the sameonchain/evmoutsideignition/deployments. It refuses any other window before it sends anything, so a window opened while maker-checker was off has to be closed and opened again with approval. The run also refuses a checkout with uncommitted changes inonchain/evmoutsideignition/deployments, even with--allow-unmerged-sources, because the window names only the commit. - On a chain that charges gas, tops the key up from the gas wallet (
--gas-wallet-ref) to at most--gas-capwei. The cap must cover at least one transfer's fee, so the key can always send what it holds over the cap back, and the run refuses a smaller cap before it sends anything. A kept key that holds more, for example after--gas-capwas lowered, sends the excess back to the gas wallet instead. The gas wallet must hold no role on the access manager. The run refuses one that does before it sends anything. - Deploys the release from the deploy key. Before each of its transactions it reads the window, and once less than
--window-margin(15 minutes by default) is left it stops without sending, so no step fails. The window, the key and its gas stay as they are: extend the window withfour-eyes:extend-windowand run the same command again. A run that started with maker-checker off also stops this way once maker-checker is turned on, because no second approver opened its window. Close the window withfour-eyes:close-window, have a window for the same key requested and approved, and run the same command again. The run also stops before its next transaction when a window is opened, or maker-checker is turned on, after it checked its window, because that check no longer covers the window that is open. Run the same command again: it checks the open window before it sends anything. The transactions the run already sent, up to one batch of steps it sends together, can still be mined after maker-checker turns on, so turn maker-checker on only whilefour-eyes:statusshowsno deploy window is open. A rerun from a latermainthat only adds the journal lines the run wrote keeps the approved window, because the contracts and modules it deploys are unchanged. - Closes the window, sends the key's remaining gas back to the gas wallet, and deletes the key from the vault only once every step of the release has finished. A remainder smaller than one transfer's fee cannot be sent back, so it stays at the key's address and the run prints the amount and the address.
The deploy key can upgrade the access manager itself without a request, so a release that upgrades the access manager also finishes inside the one approved window, with no approver online.
On-prem: the contract-deployment Job
The Helm contract-deployment Job signs with the key in its Conjur variable or Secret. To run a release inside a window:
- Make a fresh key that holds no role, and open a window for it with the steps in Open a deploy window. Pass
--releasethe commit the Job's image was built from: the image carries it asGIT_SHA(docker image inspect <image> --), and the Job prints it when it starts.format '{{json . Config. Env}}' - Put the key in the Conjur variable the Job maps to
PRIVATE_KEYfor this run. - Run the Job. It reads the window first and stops before the window closes, leaving every step unfailed. Extend the window and run the Job again to resume. When maker-checker is turned on while the Job runs, it stops the same way: close the window, have an approved window opened for the same key, and run the Job again. It also stops when a window is opened, or maker-checker is turned on, after it checked its window: run the Job again, and it checks the open window before it sends anything. The transactions the Job already sent, up to one batch of steps it sends together, can still be mined after maker-checker turns on, so turn it on only while no deploy window is open. With maker-checker on, the Job stops before it sends anything when its key holds no open window or when the window was approved for another commit than its image's.
- After the Job finishes, close the window and remove the key from Conjur.
Cancel a request
bun run four-eyes:cancel --proposal <request id> --from-block <request block> \
--rpc-url "$RPC_URL" --chain-id 47898 --key-ref op://Deploy/requester/private-keyThe requester or an approver may cancel an open request, an expired one, or one whose rule changed after it was made.
When a command refuses
A refusal prints Refused: with the reason, then Nothing was sent., and exits with 1. four-eyes:approve refuses before asking you to confirm when:
- you made the request yourself
- you already approved it
- the request expired: the requester must request it again
- the rule changed after the request was made, so the request no longer counts
- the calldata on chain does not match the request's stored hash
- you hold none of the approver roles the request needs
Answering anything other than yes prints Not sent. Nothing changed on chain. A sent transaction prints its hash, block and status, then Stopped. This command takes no further step. A transaction that reverts exits with 1.