{"_id":"@0x/governance","_rev":"16-ba26bf503b7e9d88d35f13a11cad6cb1","name":"@0x/governance","dist-tags":{"latest":"1.0.5"},"versions":{"1.0.3":{"name":"@0x/governance","version":"1.0.3","license":"Apache-2.0","_id":"@0x/governance@1.0.3","maintainers":[{"name":"rhinodavid","email":"dawalsh@gmail.com"},{"name":"mwelche","email":"mathieuwelche@gmail.com"},{"name":"savdont","email":"sav.dontamsetti@gmail.com"},{"name":"eobbad","email":"eobbad@gmail.com"},{"name":"aeph4muh","email":"marcin@0xproject.com"},{"name":"idokleinman","email":"idokleinman@gmail.com"},{"name":"jadetran","email":"jadetxyz@gmail.com"},{"name":"kyuc","email":"kyuhyun217@gmail.com"},{"name":"henryzhu","email":"hz@henryzhu.me"},{"name":"tobernguyen","email":"tobernguyen@gmail.com"},{"name":"dex_tracker","email":"noah@0xproject.com"},{"name":"dekz","email":"jacob@dekz.net"},{"name":"amirbandeali","email":"abandeali1@gmail.com"},{"name":"phil-ociraptor","email":"philipliao@gmail.com"}],"homepage":"https://github.com/0xProject/protocol#readme","bugs":{"url":"https://github.com/0xProject/protocol/issues"},"dist":{"shasum":"d3ca8658c64a7ee95386480b0f8873a9919c9830","tarball":"https://registry.npmjs.org/@0x/governance/-/governance-1.0.3.tgz","fileCount":557,"integrity":"sha512-l4EW6nlCPEeTPg9Qwdtylzf4E3ZSxz/pskocx4DKl6hhFd3lbJweTJuJfzsalf57pa/T2QgJacu9d/UUVch9Ew==","signatures":[{"sig":"MEQCIAyyOoaCzsk6/51wduoqWNPlE2blztdzo2kHyy0GxCPhAiA1EiYXctn5UkqmIrHQm6RWrXVuYpamW2tMDFsoIgpEgA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":40468799,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPJ/sACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoEIQ/9GWTfClq+kIdqnyXfZbvh+VTsSii6yVJp8V98wZcRUIT6U0Ag\r\n3I7HCSGpmg0fkd+Wm02EQLWo3vnTpvgxKB7werjGCTkyQxNhWsgEv6zODMQq\r\n04GbgPz3jrjqgU1h8EdugR+PseUuHezrGsiSO0JDKJPj2HjhxSdExHdKrt9a\r\n0y0Fhm9cjxyPOU9yuW30bTqqjFlfYvjFsPf24r92AlgNnCUJ+s3NhewJjpOL\r\nrUdGoPneDTQbGf3AC1Pss8Ofn7lIt1J624yN7gufm6P9qvHGo91TeF+h1WtV\r\nvP6+tjLa0kvjEBlCyhl6rCqNVenomsDg8ra6ASaGDHk8CzHFrCEBv+den0HQ\r\nLzwz7/qROieOgBsztecMv+X9dGF1L1CVDxOFaortpxHrnOofGvQLF9D+2JAb\r\nKvGugPSP/GmsUPyRBUdJvBHs3iKVLm4au0sAzESwNKV26112tUQmkcdsJKNt\r\nHLgTO1/5IDrlPr/O8+FgunpGVhiH91otLYSa6BSkq+E3mqofbWZBqWg6b4XU\r\ne7oc/IXRfIM3FinxVOmf+D/5iHVv+8ESTOnVfQdjhiMD2eTWzI4drcrMv50v\r\n9kXTdILtEEE6EjuXtwO2/dDLd/lBtAzMrMjZaSIXYETiLseFuErjB4v3lXII\r\nxcI6e0hDf/bLvDHQgT24t//TAA9zepFVlfs=\r\n=3RDW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"484d9cafc41e7be07d7354ea446b9531143f0549","scripts":{"test":"forge test","build":"forge build","build:smt":"FOUNDRY_PROFILE=smt forge build","test:integration":"source .env && FOUNDRY_PROFILE=integration forge test --fork-url $MAINNET_RPC_URL --fork-block-number 16884148 -vvv","goerli:deploy:zrxtoken":"source .env && forge script script/DeployToken.s.sol:Deploy --rpc-url $GOERLI_RPC_URL --broadcast --slow -vvvv","goerli:deploy:governance":"source .env && forge script script/DeployGovernance.s.sol:Deploy --rpc-url $GOERLI_RPC_URL --broadcast --slow -vvvv","mainnet:deploy:governance":"source .env && forge script script/DeployGovernance.s.sol:Deploy --rpc-url $MAINNET_RPC_URL --broadcast --slow -vvvv"},"_npmUser":{"name":"tobernguyen","email":"tobernguyen@gmail.com"},"repository":{"url":"git+https://github.com/0xProject/protocol.git","type":"git"},"_npmVersion":"lerna/3.16.10/node@v16.20.0+x64 (linux)","description":"Governance implementation for the 0x protocol and treasury","directories":{"lib":"lib","test":"test"},"_nodeVersion":"16.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/governance_1.0.3_1681694700460_0.4104604348597469","host":"s3://npm-registry-packages"}},"1.0.4":{"name":"@0x/governance","version":"1.0.4","license":"Apache-2.0","_id":"@0x/governance@1.0.4","maintainers":[{"name":"rhinodavid","email":"dawalsh@gmail.com"},{"name":"mwelche","email":"mathieuwelche@gmail.com"},{"name":"savdont","email":"sav.dontamsetti@gmail.com"},{"name":"eobbad","email":"eobbad@gmail.com"},{"name":"aeph4muh","email":"marcin@0xproject.com"},{"name":"idokleinman","email":"idokleinman@gmail.com"},{"name":"jadetran","email":"jadetxyz@gmail.com"},{"name":"kyuc","email":"kyuhyun217@gmail.com"},{"name":"henryzhu","email":"hz@henryzhu.me"},{"name":"tobernguyen","email":"tobernguyen@gmail.com"},{"name":"dex_tracker","email":"noah@0xproject.com"},{"name":"dekz","email":"jacob@dekz.net"},{"name":"amirbandeali","email":"abandeali1@gmail.com"},{"name":"phil-ociraptor","email":"philipliao@gmail.com"}],"homepage":"https://github.com/0xProject/protocol#readme","bugs":{"url":"https://github.com/0xProject/protocol/issues"},"dist":{"shasum":"e2cde9d963e79cc0208ae098e838c03a6d2e1a9b","tarball":"https://registry.npmjs.org/@0x/governance/-/governance-1.0.4.tgz","fileCount":557,"integrity":"sha512-8F0OS2JPuEjJKp1dybqNEblBhPlQuW47HCjehXTfgo1jjaafvVUhnSb8afrIX49funwqKmfQDYU/Kb6/r4nRzA==","signatures":[{"sig":"MEUCIQCa+qA+Pg8D5v5YWDH8sONfTovdQtIqL4MV8/JSTS/Y+QIgFiAlm+qah7JIUSCR6fOT2X28tT4GntloP9Xs2IXnVRw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":40469037,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPZALACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpq2w//QB8atnXWoppXS6yLOnPzZq7kcwN5++UtSMzoGIp9XHYJoaTH\r\nBEWYTiiIMqnBSTSg3gtNYLoHGFDtM5HUJBfJ+QRFBWiHsEdTbYwOiK4rxTVT\r\nQKiQe9MOZEc7wxtqdGAnohVf7zSsJzOw636TUyR7BDX8K8cq9cf4Hf9SMo1M\r\njWYo0B/L6zV/POnRqMEZX9uFbYL4IxQVNVw2ZsMBM4EBmp97De9fGKHXCIUL\r\ngxeCBDHX0v47hKvYmTZRcMaEC675qdT7d+j+F7Tq7XlXbc4F83YhjEpDeXP0\r\npNPqM+FteaIyhQgIAbRo6UgyYdo8ojM9z31920bl8mpDvC4rPOq3TMMuS6X2\r\nkFw9BSUg5wqfsW0wShMFThJmjudlEvPRl/lj9TqSXj7Oo3FxniSBP0QY5MoW\r\nlnlMqZ2IRR3Hlg+rJrQH3vwVdbozFVuTn1yVXhAxrbnE4kk332RRc5Q3A1jd\r\nnz5LRaqv9mJ6XDOK85U3SMmlMdDBqfVFM+NhvpPzZEY9fIp1cKDgKI3nSkw6\r\nu47HYMuL4bFNqHZLAWJ4qKPzkLsyz1BRNU9SYQC67Xr0Zu/ZBVVkcAeBP49f\r\na6rOXtCbQt7Zpyhi4ktyMWENnXv4nn2LxwKWLCr0feb3rnzJOyo6h60ZWIHC\r\nl+7vgSn3iNniz8puPne4NdCrhuYw/aUPMaA=\r\n=m6wX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"ad2d41fd906a82119aefb3f7adb7c61c395e1dab","scripts":{"test":"forge test","build":"forge build","build:smt":"FOUNDRY_PROFILE=smt forge build","test:integration":"source .env && FOUNDRY_PROFILE=integration forge test --fork-url $MAINNET_RPC_URL --fork-block-number 16884148 -vvv","goerli:deploy:zrxtoken":"source .env && forge script script/DeployToken.s.sol:Deploy --rpc-url $GOERLI_RPC_URL --broadcast --slow -vvvv","goerli:deploy:governance":"source .env && forge script script/DeployGovernance.s.sol:Deploy --rpc-url $GOERLI_RPC_URL --broadcast --slow -vvvv","mainnet:deploy:governance":"source .env && forge script script/DeployGovernance.s.sol:Deploy --rpc-url $MAINNET_RPC_URL --broadcast --slow -vvvv"},"_npmUser":{"name":"tobernguyen","email":"tobernguyen@gmail.com"},"repository":{"url":"git+https://github.com/0xProject/protocol.git","type":"git"},"_npmVersion":"lerna/3.16.10/node@v16.20.0+x64 (linux)","description":"Governance implementation for the 0x protocol and treasury","directories":{"lib":"lib","test":"test"},"_nodeVersion":"16.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/governance_1.0.4_1681756171215_0.6708117494465544","host":"s3://npm-registry-packages"}},"1.0.5":{"name":"@0x/governance","version":"1.0.5","license":"Apache-2.0","_id":"@0x/governance@1.0.5","maintainers":[{"name":"rhinodavid","email":"dawalsh@gmail.com"},{"name":"mwelche","email":"mathieuwelche@gmail.com"},{"name":"savdont","email":"sav.dontamsetti@gmail.com"},{"name":"eobbad","email":"eobbad@gmail.com"},{"name":"aeph4muh","email":"marcin@0xproject.com"},{"name":"idokleinman","email":"idokleinman@gmail.com"},{"name":"jadetran","email":"jadetxyz@gmail.com"},{"name":"kyuc","email":"kyuhyun217@gmail.com"},{"name":"henryzhu","email":"hz@henryzhu.me"},{"name":"tobernguyen","email":"tobernguyen@gmail.com"},{"name":"dex_tracker","email":"noah@0xproject.com"},{"name":"dekz","email":"jacob@dekz.net"},{"name":"amirbandeali","email":"abandeali1@gmail.com"},{"name":"phil-ociraptor","email":"philipliao@gmail.com"}],"homepage":"https://github.com/0xProject/protocol#readme","bugs":{"url":"https://github.com/0xProject/protocol/issues"},"dist":{"shasum":"a828773225972e3bcf5ccc7787cbfb405bca1bdd","tarball":"https://registry.npmjs.org/@0x/governance/-/governance-1.0.5.tgz","fileCount":557,"integrity":"sha512-Wb7kT9dz0gVfQVcTMOX02tGtE10TyWoHK6Gnh3t2Y8sxte76XyMpJZsmwXk04v5Ioh70OgkvaJyop++e1JgfkA==","signatures":[{"sig":"MEUCIQDdZf18mccuwQomcjQdEtl8dCcHh4MbUzoGq+6ticf+TAIgbPE1OqjTZ/KoBGTNIOiJm3GfNtOuRKsIZaETjDrRtoU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":40434150,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkUC5jACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo+VA/+LUhS3eTOfP+OZjXwZaULzVuASezg00+5l6x4F6oyDkbzR38A\r\nyBorTLvebu+CvW61zGD4neMpydN1no5NNxXnOIM5DPtZ5Wu/luEOdyibFbgS\r\nC5d2R/AnpbiVfFBAq5gx3rkbJsz56ao09T+9ZSnHDqfk9vX52U9hc9JFM8GM\r\ne21IfjyiMNkiHtUd/S4uT/QWs35It1x3imp4DvHN7LFrqWDxyDrOTb6cmybz\r\nSoQHirEbUPwKjpsjgsxy+gq76yDIKyjGeGWvSD10KgmkiI4icWrtKvNS6FNB\r\nrrJhj9j0hO7C6eLlZDKibMbz8CoSnen10nRGXtD7b3Hyq+MWS5YpdsBkTKTo\r\ne3zYfoC0gEuTk5lQALitf5gD3hmkZvCvv3S54sgMh1Xmz7U3w4assabFJDiZ\r\nFPTc6gAmxYO8WLpnaEnHhWNPiT0og+5Y4SN4MB1eQvKCEZ33xos4CmCjVD87\r\naqKEM0j3Rf9YIYeOI0gSMQFi+3Z4iXOEtBKZtcPhrjSY6jPD1S/uxBDYyuqE\r\nhmHIC73n86Q2mWUCnNUkLQ+b+xg9CIDWiCMNIosAvxCUDU6Dreg/BFRrhPLL\r\nUvKoc8o7X046lYD6T+1bC24ApL/s3oWYoMA/Lbxtb/xOZ9UKd1hnt/UseSI/\r\nIwQDm9QGSql418hlnIVTyghgCYCDnMHc1xs=\r\n=XR/4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"fefa3c13f6f4eab076a8107c726ad48bd6ac219d","scripts":{"test":"forge test","build":"forge build","build:smt":"FOUNDRY_PROFILE=smt forge build","test:integration":"source .env && FOUNDRY_PROFILE=integration forge test --fork-url $MAINNET_RPC_URL --fork-block-number 16884148 -vvv","goerli:deploy:zrxtoken":"source .env && forge script script/DeployToken.s.sol:Deploy --rpc-url $GOERLI_RPC_URL --broadcast --slow -vvvv","goerli:deploy:governance":"source .env && forge script script/DeployGovernance.s.sol:Deploy --rpc-url $GOERLI_RPC_URL --broadcast --slow -vvvv","mainnet:deploy:governance":"source .env && forge script script/DeployGovernance.s.sol:Deploy --rpc-url $MAINNET_RPC_URL --broadcast --slow -vvvv"},"_npmUser":{"name":"tobernguyen","email":"tobernguyen@gmail.com"},"repository":{"url":"git+https://github.com/0xProject/protocol.git","type":"git"},"_npmVersion":"lerna/3.16.10/node@v16.20.0+x64 (linux)","description":"Governance implementation for the 0x protocol and treasury","directories":{"lib":"lib","test":"test"},"_nodeVersion":"16.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/governance_1.0.5_1682976355074_0.25121817220536213","host":"s3://npm-registry-packages"}}},"time":{"created":"2023-04-17T01:25:00.368Z","modified":"2026-08-12T18:07:24.161Z","1.0.3":"2023-04-17T01:25:00.780Z","1.0.4":"2023-04-17T18:29:31.569Z","1.0.5":"2023-05-01T21:25:55.435Z"},"bugs":{"url":"https://github.com/0xProject/protocol/issues"},"license":"Apache-2.0","homepage":"https://github.com/0xProject/protocol#readme","repository":{"url":"git+https://github.com/0xProject/protocol.git","type":"git"},"description":"Governance implementation for the 0x protocol and treasury","maintainers":[{"email":"talalashraf@0xproject.com","name":"zeroextalal"},{"email":"jacob@dekz.net","name":"dekz"},{"email":"abandeali1@gmail.com","name":"amirbandeali"},{"email":"hz@henryzhu.me","name":"henryzhu"},{"email":"tobernguyen@gmail.com","name":"tobernguyen"},{"email":"mathieuwelche@gmail.com","name":"mwelche"},{"email":"piotr@0xproject.com","name":"0xpgrzesik"},{"email":"patrickw@0xproject.com","name":"patrickat0x"},{"email":"jessica@0xproject.com","name":"0xjess"},{"email":"chrisbraun@0xproject.com","name":"cb44"},{"email":"wojciech@0xproject.com","name":"wojciechwasik"}],"readme":"## Governance\n\nThis package contains contracts for the ZeroEx governance of 0x Protocol and Treasury.\n\n## Production deployment\n\n`ZRXWrappedToken` 0xfcfaf7834f134f5146dbb3274bab9bed4bafa917\n`ZeroExVotesProxy` 0x9c766e51b46cbc1fa4f8b6718ed4a60ac9d591fb\n`ZeroExVotes` 0x8d208c5514b98c5b9ceed650b02df2aeb1c73e6f\nProtocol `ZeroExTimelock` 0xb6a1f58c5df9f13312639cddda0d128bf28cdd87\n`ZeroExProtocolGovernor` 0xc256035fe8533f9ce362012a6ae0aefed4df30f4\nTreasury `ZeroExTimelock` 0x0dcfb77a581bc8fe432e904643a5480cc183f38d\n`ZeroExTreasuryGovernor` 0x4822cfc1e7699bdb9551bdfd3a838ee414bc2008\nSecurity council 0x979BDb496e5f0A00af078b7a45F1E9E6bcff170F\n\n## Design\n\nThis implementation fully decentralises governance of 0x Protocol and Treasury. This is enabled via a wrapped ZRX token and a Compound-like governors design. There are two separate governors for Protocol - `ZeroExProtocolGovernor` and Treasury - `ZeroExTreasuryGovernor` respectively working with two separate Timelock instances of the same contract implementation - `ZeroExTimelock`.\n\n### Upgradability\n`ZRXWrappedToken` , `ZeroExProtocolGovernor` and `ZeroExTreasuryGovernor` governors are non-upgradable by design. However the voting implementation the governors use - `ZeroExVotes` is upgradable and using the OZ `ERC1967Proxy`.\n\n### Wrapped ZRX\nwZRX will be issued 1-to-1 for ZRX. No locking/vesting mechanisms will exist between wZRX and ZRX and the two will be freely interchangeable. The ZRX token is non-upgradable and same will be valid for its wrapped equivalent.\n\nThe token supports delegation which allows a user to delegate their entire voting power to another account (which doesn't necessarily need to be a token holder). This is modelled on the standard OpenZeppelin `ERC20Votes` implementation. We have added logic for block number stamping delegators' balance changes stored in the `DelegateInfo.balanceLastUpdated` property. This block number information is sent in calls to `ZeroExVotes.moveVotingPower` in order to provide support for future upgrades to the vote power calculation.\nNote that for consistency `block.number` is used for the governor settings, voting checkpoints and this delegators' balance last updated property while timelock logic for the governor uses block.timestamp.\n\n### Governors' settings\nChanging governors' settings for `votingDelay`, `votingPeriod` and `proposalThreshold` can be done via the normal proposal mechanism. Governors are deployed with the following initial settings:\n\n|                                | voting delay | voting period | proposal threshold |\n|-------------------|--------------|---------------|--------------------|\n| Protocol governor | 2 days            | 7 days             |  1000000e18           |\n| Treasury governor | 2 days           |  7 days             |   250000e18          |\n\n\nThis is using standard openzeppelin `GovernorSettings` implementation.\n\n### Quorum\nQuorum for Protocol is fixed at 10m (10000000e18) while for Treasury this is calculated as 10% of voting power of the total supply (see voting strategies below for quadratic voting power implementation specifics). The quorum calculations for Treasury are using OpenZeppelin's `GovernorVotesQuorumFraction`.\n\nNote that in-place updates to the quorum are not supported and will need to go through a governance upgrade. Reasoning behind this can be found in this discussion https://forum.openzeppelin.com/t/quorum-default-behaviour-on-governors/34560.\n\n### Voting strategies\nThe voting strategy will be linear 1-token-1-vote for Protocol and quadratic with threshold of 1000000e18 for Treasury (i.e. voting weight is linear up to 1m tokens and balance above that threshold is quadratic).\n\nWorth noting is the `Checkpoint` struct design. For packing every `Checkpoint` into a single storage slot we are using the minimum uint type size for `votes` and `quadraticVotes` members, e.g.\n\n```\nstruct Checkpoint {\n        uint32 fromBlock;\n        uint96 votes;\n        uint96 quadraticVotes;\n    }\n```\n\nsince the maximum token supply is 1bn we can have maximum value for:\n`votes` : 1bn *10^18 => can be stored in 90 bits\n`quadraticVotes` : due to the likelihood of threshold changing and potentially bringing it closer to a linear vote, we are preemptively keeping this to the same size as linear votes slot.\n\n### Time locks\nGovernance proposals are subject to a 3 days delay for Protocol and 2 days for Treasury. This delay allows Security Council time to review passed proposals and take action where needed.\n\n### Security Council\nThe concept of a Security council is introduced which allows a multisig of security council members to cancel a proposal on the treasury or protocol governors and also rollback the protocol to an earlier version.\n\nWhen no security council is assigned the following apply:\n\n- ongoing proposals can still be voted on\n- new proposals cannot be created - except assignSecurityCouncil\n- expired proposals that are successful cannot be queued - excepted assignSecurityCouncil\n\nThere is a provision for the governors to have different security council set although initially these are the same.\n","readmeFilename":"README.md"}