llamaxyz / llama

Llama is an onchain governance and access control framework for smart contracts.
https://llama.xyz
MIT License
47 stars 5 forks source link

refactor: move color/logo to metadata and remove `onlyRootLlama` from deploy #422

Closed AustinGreen closed 1 year ago

AustinGreen commented 1 year ago

Motivation:

This PR changes the way we use LlamaPolicyMetadata to accommodate a permissionless Llama world. It also removes the onlyRootLlama modifier from the deploy function. The full removal of the root instance will happen in a future PR.

Modifications:

The default metadata logic is set at factory construction. It is passed to the initialization of LlamaPolicy through LlamaCore. The policy has a function that accepts a metadata logic contract as a parameter along with arbitrary bytes data, deploys a new clone, and initializes it. This means that instances can deploy new metadata contracts with an arbitrary configuration. The default metadata accepts a color and logo. The storage of the color and logo and events are moved to this metadata contract.

Result:

Policy metadata management will happen in the contract itself as opposed to LlamaPolicy.

github-actions[bot] commented 1 year ago

Coverage after merging austin/make-deploy-public into main will be

84.87%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   LlamaCore.sol99.25%97.22%100%100%392, 627
   LlamaExecutor.sol80%50%100%100%33
   LlamaFactory.sol100%100%100%100%
   LlamaLens.sol72.09%20%100%82.61%174–175, 178, 178, 178–179, 179, 179–180, 180, 180, 188
   LlamaPolicy.sol91.35%88.89%94.74%90.99%309, 346, 346, 346–348, 348, 348, 350–353, 355, 368
   LlamaPolicyMetadata.sol100%100%100%100%
src/accounts
   LlamaAccount.sol100%100%100%100%
src/lib
   ERC721NonTransferableMinimalProxy.sol70.42%72.73%72.73%68.42%102, 104, 106, 118–120, 190, 88, 88, 88, 90, 90, 90, 92, 92, 92, 97, 99
   LlamaUtils.sol100%100%100%100%
   RoleCheckpoints.sol55.88%50%81.82%53.62%125, 179–181, 181, 181–182, 184, 187, 217, 224, 224–226, 228, 228–230, 232, 232–234, 236, 236–238, 257, 260–266, 273, 46, 46–48, 48, 48–49, 51
   SupplyCheckpoints.sol57.14%50%83.33%54.93%131, 183–185, 185, 185–186, 188, 191, 235, 242, 242–244, 246, 246–248, 250, 250–252, 254, 254–256, 275, 278–284, 291, 50, 50–52, 52, 52–53, 55
src/llama-scripts
   LlamaGovernanceScript.sol50%33.33%43.75%53.45%106–108, 115–117, 125–128, 135–137, 146–150, 157–158, 166–168, 67, 74, 74, 76, 89–90, 97–98
src/strategies
   LlamaAbsolutePeerReview.sol94.59%88.89%100%100%37, 40
   LlamaAbsoluteQuorum.sol92.86%85.71%100%100%24, 27
   LlamaAbsoluteStrategyBase.sol94.94%87.50%90.91%98.08%257, 260, 308
   LlamaRelativeQuorum.sol96.30%85.71%100%100%210, 214, 239, 330