{"id":19096753,"url":"https://github.com/makerdao/protego","last_synced_at":"2025-04-30T14:14:55.031Z","repository":{"id":149964096,"uuid":"585636941","full_name":"makerdao/protego","owner":"makerdao","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-14T19:01:33.000Z","size":548,"stargazers_count":10,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T19:28:19.093Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/makerdao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":"audits/ChainSecurity_MakerDAO_Protego_audit.pdf","citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-01-05T17:20:36.000Z","updated_at":"2025-04-11T00:23:00.000Z","dependencies_parsed_at":"2024-05-28T01:28:47.215Z","dependency_job_id":"e1a7dd42-e0b1-432f-971a-3da5c285fdc8","html_url":"https://github.com/makerdao/protego","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fprotego","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fprotego/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fprotego/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fprotego/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/makerdao","download_url":"https://codeload.github.com/makerdao/protego/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249514469,"owners_count":21284553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T03:37:39.857Z","updated_at":"2025-04-30T14:14:55.004Z","avatar_url":"https://github.com/makerdao.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Protego\n\nProtego is a tool to permissionlessly deploy a spell which can be used to drop a particular plan in the `MCD_PAUSE`\ncontract, or in extreme cases the `Protego` contract can itself be lifted to the hat, allowing any user to\npermissionlessly drop any scheduled plan.\n\n## Context\n\n- A `plan` is a scheduled `delegatecall` that exists in [`MCD_PAUSE`](https://github.com/makerdao/ds-pause) and can be\n  permissionlessly executed.\n- Plans in `MCD_PAUSE` are [identified by a unique 32 byte hash](https://github.com/makerdao/ds-pause/blob/master/src/pause.sol#L99).\n- A conforming spell here is one where the values returned by `action()`, `tag()`, `sig()` and `eta()` are equal to the\n  corresponding `plan`, `usr`, `tag`, `fax` and `eta` values respectively. Bad actors could potentially manipulate the\n  return values of these functions such that they are not equal, which would result in a non-conforming spell.\n- Users interacting with `Protego` should **always** assume the spell they want to drop is non-conforming and fetch the\n  parameters directly from the logs created by [`pause.plot()`](https://etherscan.deth.net/address/0xbe286431454714f511008713973d3b053a2d38f3#L189-L203)\n\n## Usage\n\n### 1. Create a single drop spell\n\n```solidity\ndeploy(address _usr, bytes32 _tag, bytes memory _fax, uint256 _eta)(address)\n```\n\nIf there is sufficient ecosystem interest to cancel (`drop`) a particular scheduled set of actions (the target `plan`),\nProtego contains a factory to permissionlessly create a spell (\"Emergency Drop Spell\"), which \u0026ndash; upon being given\nthe hat \u0026ndash; is able to drop the targeted plan in `MCD_PAUSE`.\n\n### 2. Enable permissionless dropping of a single or multiple plans \n\n\n```solidity\n/// @notice Permissionlessly drop anything that has been planned on the pause.\ndrop(address _usr, bytes32 _tag, bytes memory _fax, uint256 _eta)\n```\n\n```solidity\n/**\n * @notice A struct representing a plan.\n * @param usr The address of the scheduled spell.\n * @param tag The tag identifying the address.\n * @param fax The encoded call to be made in `usr`.\n * @param eta The expiration time.\n */\nstruct Plan {\n    address usr;\n    bytes32 tag;\n    bytes fax;\n    uint256 eta;\n}\n\n/// @notice Drop multiple plans in a single call.\ndrop(Plan[] calldata plans)\n```\n\nIn case of a governance attack, numerous spells could be created and planned by an attacker at a rate faster than a\nsingle hat spell can `drop` them. To mitigate this risk, the `Protego` contract itself can be given the hat, which\nallows any user to permissionlessly drop any plan. Protego may either cancel one plan per call, or cancel multiple plans in a single call by passing a `Plan[]` to the multi drop function.\n\nBoth functions will **immediately** drop one or many plans in `MCD_PAUSE` using the parameters provided.\n\n## Additional functions\n\n### `id()`\n\n```solidity\nid(address _usr, bytes32 _tag, bytes memory _fax, uint256 _eta)(bytes32)\n```\n\nReturns the `bytes32` id of a given plan using the same method that `hash` does in `MCD_PAUSE`.\n\n### `planned()`\n\n```solidity\nplanned(address _usr, bytes32 _tag, bytes memory _fax, uint256 _eta)(bool)\nplanned(bytes32 _id)(bool)\n```\n\nReturns `true` if a plan has been scheduled for execution.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakerdao%2Fprotego","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmakerdao%2Fprotego","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakerdao%2Fprotego/lists"}