Skip to content

Commit

Permalink
🧹 Clean ups and code docs
Browse files Browse the repository at this point in the history
  • Loading branch information
z0r0z committed Jul 26, 2023
1 parent e52b433 commit 069af4e
Show file tree
Hide file tree
Showing 37 changed files with 2,871 additions and 332 deletions.
11 changes: 6 additions & 5 deletions docs/book.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[book]
src = 'src'
title = ''
src = "src"
title = ""

[output.html]
no-section-label = true
additional-js = ['solidity.min.js']
additional-css = ['book.css']
git-repository-url = 'https://github.com/kalidao/keep'
additional-js = ["solidity.min.js"]
additional-css = ["book.css"]
git-repository-url = "https://github.com/kalidao/keep"

[output.html.fold]
enable = true
19 changes: 12 additions & 7 deletions docs/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Model

`Keep` is a flexible governance system represented as an [ERC1155](https://ethereum.org/en/developers/docs/standards/tokens/erc-1155/) collection of NFTs. All stakeholders are tokenized, and group decisionmaking includes multi-sig and DAO voting features. Keep NFTs are semi-fungible. This means in some cases, they represent 1:1 rights, such as multi-sig and minting roles. Otherwise, they might be DAO voting balances or assets, such as [Moloch-style](https://github.com/MolochVentures/moloch) loot shares.
`Keep` is a flexible governance system represented as an [ERC1155](https://ethereum.org/en/developers/docs/standards/tokens/erc-1155/) collection of NFTs. All stakeholders are tokenized, and group decisionmaking includes multi-sig and DAO voting features. Keep NFTs are semi-fungible. This means in some cases, they represent 1:1 rights, such as multi-sig and minting roles. Otherwise, they might be DAO voting balances or assets, such as [Moloch-style](https://github.com/MolochVentures/moloch) loot shares. Ultimately Keep anticipates and maximixes a token-and-balance-centric approach to DAO interfaces, roles and permissions using the ERC1155 standard.

### Empowering Collectives

Expand Down Expand Up @@ -61,7 +61,6 @@ Several rounds of audits and security consultations were engaged in the developm
```ml
lib
├─ forge-std — https://github.com/brockelmore/forge-std
├─ kali — https://github.com/kalidao/rage-router
├─ solbase — https://github.com/Sol-DAO/solbase
src
│ └─ extensions
Expand All @@ -77,15 +76,21 @@ src

## Deployments

Keep is deployed to the `Ethereum`, `Arbitrum`, `Optimism`, `Polygon` and `Gnosis` blockchains at the following verified addresses:
Keep is deployed to the `Ethereum`, `Arbitrum`, `Optimism`, `Polygon`, `Gnosis` and `Canto` blockchains at the following verified addresses:

`KeepFactory`: [`0x00000000001cd071bd24a7561e642b3e121c9761`](https://etherscan.io/address/0x00000000001cd071bd24a7561e642b3e121c9761#code)
`KeepFactory`: [`0x00000000008dd7888459CaeB062eF9eCc1E27301`](https://etherscan.io/address/0x00000000008dd7888459CaeB062eF9eCc1E27301#code)

`Keep`: [`0x00000000058b15c4250af3e8a10a6cf2a0e0f1c4`](https://etherscan.io/address/0x00000000058b15c4250af3e8a10a6cf2a0e0f1c4#code)
`Keep`: [`0x00000000000058018B54c271615d94645b9aAb81`](https://etherscan.io/address/0x00000000000058018B54c271615d94645b9aAb81#code)

`URIfetcher`: [`0xcCfC4897C01e3E0885AEe45643868276894c40eb`](https://etherscan.io/address/0xccfc4897c01e3e0885aee45643868276894c40eb#code)
`URIfetcher`: [`0x72aa21a1b5a4719bf4c6ebb2fbad2db761d59a60`](https://etherscan.io/address/0x72aa21a1b5a4719bf4c6ebb2fbad2db761d59a60#code)

`URIRemoteFetcher`: [`0xcA0202398bf78E873f46C77ec6D7236f997c2Df5`](https://etherscan.io/address/0xca0202398bf78e873f46c77ec6d7236f997c2df5#code)
`URIRemoteFetcher`: [`0x1C51Ae918F1487Ac7fb254b170ee4fbC4641faf7`](https://etherscan.io/address/0x1C51Ae918F1487Ac7fb254b170ee4fbC4641faf7#code)

### DAO

`KaliFactory`: [`0xd353fB1c33202441373524d3Cc5d94cd74113e25`](https://etherscan.io/address/0xd353fB1c33202441373524d3Cc5d94cd74113e25#code)

`Kali`: [`0x000000000000b6a5Ca118D41a571041f329C4c64`](https://etherscan.io/address/0x000000000000b6a5Ca118D41a571041f329C4c64#code)

## Development

Expand Down
17 changes: 11 additions & 6 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
- [❱ extensions](src/extensions/README.md)
- [❱ dao](src/extensions/dao/README.md)
- [❱ utils](src/extensions/dao/utils/README.md)
- [KaliExtension](src/extensions/dao/utils/KaliExtension.sol/contract.KaliExtension.md)
- [KeepTokenManager](src/extensions/dao/utils/KeepTokenManager.sol/contract.KeepTokenManager.md)
- [KaliExtension](src/extensions/dao/utils/KaliExtension.sol/abstract.KaliExtension.md)
- [ProposalType](src/extensions/dao/Kali.sol/enum.ProposalType.md)
- [VoteType](src/extensions/dao/Kali.sol/enum.VoteType.md)
- [Proposal](src/extensions/dao/Kali.sol/struct.Proposal.md)
Expand All @@ -15,15 +14,21 @@
- [❱ metadata](src/extensions/metadata/README.md)
- [URIFetcher](src/extensions/metadata/URIFetcher.sol/contract.URIFetcher.md)
- [URIRemoteFetcher](src/extensions/metadata/URIRemoteFetcher.sol/contract.URIRemoteFetcher.md)
- [❱ mint](src/extensions/mint/README.md)
- [MintManager](src/extensions/mint/MintManager.sol/contract.MintManager.md)
- [❱ storage](src/extensions/storage/README.md)
- [DataRoom](src/extensions/storage/DataRoom.sol/contract.DataRoom.md)
- [❱ utils](src/extensions/utils/README.md)
- [KeepTokenManager](src/extensions/utils/KeepTokenManager.sol/abstract.KeepTokenManager.md)
- [Owned](src/extensions/utils/Owned.sol/abstract.Owned.md)
- [ReentrancyGuard](src/extensions/utils/ReentrancyGuard.sol/abstract.ReentrancyGuard.md)
- [❱ utils](src/utils/README.md)
- [LibClone](src/utils/LibClone.sol/contract.LibClone.md)
- [Multicallable](src/utils/Multicallable.sol/contract.Multicallable.md)
- [LibClone](src/utils/LibClone.sol/library.LibClone.md)
- [Multicallable](src/utils/Multicallable.sol/abstract.Multicallable.md)
- [Operation](src/Keep.sol/enum.Operation.md)
- [Call](src/Keep.sol/struct.Call.md)
- [Signature](src/Keep.sol/struct.Signature.md)
- [Keep](src/Keep.sol/contract.Keep.md)
- [KeepFactory](src/KeepFactory.sol/contract.KeepFactory.md)
- [ERC1155TokenReceiver](src/KeepToken.sol/contract.ERC1155TokenReceiver.md)
- [KeepToken](src/KeepToken.sol/contract.KeepToken.md)
- [ERC1155TokenReceiver](src/KeepToken.sol/abstract.ERC1155TokenReceiver.md)
- [KeepToken](src/KeepToken.sol/abstract.KeepToken.md)
56 changes: 35 additions & 21 deletions docs/src/src/Keep.sol/contract.Keep.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,16 @@
# Keep
[Git Source](https://github.com/kalidao/keep/blob/bf21b4d1d146ef800f17003b87f2cf6914c6539e/src/Keep.sol)
[Git Source](https://github.com/kalidao/keep/blob/e52b433e668648f92907034179bd28358496fd0a/src/Keep.sol)

**Inherits:**
[ERC1155TokenReceiver](/src/KeepToken.sol/contract.ERC1155TokenReceiver.md), [KeepToken](/src/KeepToken.sol/contract.KeepToken.md), [Multicallable](/src/utils/Multicallable.sol/contract.Multicallable.md)
[ERC1155TokenReceiver](/src/KeepToken.sol/abstract.ERC1155TokenReceiver.md), [KeepToken](/src/KeepToken.sol/abstract.KeepToken.md), [Multicallable](/src/utils/Multicallable.sol/abstract.Multicallable.md)


## State Variables
### MALLEABILITY_THRESHOLD
### CORE_KEY
-----------------------------------------------------------------------
Keep Storage/Logic
-----------------------------------------------------------------------

*The number which `s` must not exceed in order for
the signature to be non-malleable.*


```solidity
bytes32 internal constant MALLEABILITY_THRESHOLD = 0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0;
```


### CORE_KEY
*Core ID key permission.*


Expand Down Expand Up @@ -72,7 +62,7 @@ mapping(uint256 => string) internal _uris;


```solidity
function uri(uint256 id) public view virtual override returns (string memory);
function uri(uint256 id) public view virtual returns (string memory);
```
**Parameters**

Expand All @@ -90,7 +80,7 @@ function uri(uint256 id) public view virtual override returns (string memory);
### _authorized

*Access control check for ID key balance holders.
Initalizes with `address(this)` having implicit permission
Initializes with `address(this)` having implicit permission
without writing to storage by checking `totalSupply()` is zero.
Otherwise, this permission can be set to additional accounts,
including retaining `address(this)`, via `mint()`.*
Expand Down Expand Up @@ -198,26 +188,34 @@ function execute(Operation op, address to, uint256 value, bytes calldata data, S
|`sigs`|`Signature[]`|Array of Keep signatures in ascending order by addresses.|


### _recoverSig
### relay

Relay operation from Keep via `execute()` or as ID key holder.


```solidity
function _recoverSig(bytes32 hash, address user, uint8 v, bytes32 r, bytes32 s) internal view virtual;
function relay(Call calldata call) public payable virtual;
```
**Parameters**

|Name|Type|Description|
|----|----|-----------|
|`call`|`Call`|Keep operation as struct of `op, to, value, data`.|


### multiexecute
### multirelay

Execute operations from Keep via `execute()` or as ID key holder.
Relay operations from Keep via `execute()` or as ID key holder.


```solidity
function multiexecute(Call[] calldata calls) public payable virtual;
function multirelay(Call[] calldata calls) public payable virtual;
```
**Parameters**

|Name|Type|Description|
|----|----|-----------|
|`calls`|`Call[]`|Keep operations as arrays of `op, to, value, data`.|
|`calls`|`Call[]`|Keep operations as struct arrays of `op, to, value, data`.|


### _execute
Expand Down Expand Up @@ -371,6 +369,22 @@ Events
event Executed(uint256 indexed nonce, Operation op, address to, uint256 value, bytes data);
```

### Relayed
*Emitted when Keep relays call.*


```solidity
event Relayed(Call call);
```

### Multirelayed
*Emitted when Keep relays calls.*


```solidity
event Multirelayed(Call[] calls);
```

### QuorumSet
*Emitted when quorum threshold is updated.*

Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/Keep.sol/enum.Operation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Operation
[Git Source](https://github.com/kalidao/keep/blob/bf21b4d1d146ef800f17003b87f2cf6914c6539e/src/Keep.sol)
[Git Source](https://github.com/kalidao/keep/blob/e52b433e668648f92907034179bd28358496fd0a/src/Keep.sol)

**Author:**
z0r0z.eth
Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/Keep.sol/struct.Call.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Call
[Git Source](https://github.com/kalidao/keep/blob/bf21b4d1d146ef800f17003b87f2cf6914c6539e/src/Keep.sol)
[Git Source](https://github.com/kalidao/keep/blob/e52b433e668648f92907034179bd28358496fd0a/src/Keep.sol)


```solidity
Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/Keep.sol/struct.Signature.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Signature
[Git Source](https://github.com/kalidao/keep/blob/bf21b4d1d146ef800f17003b87f2cf6914c6539e/src/Keep.sol)
[Git Source](https://github.com/kalidao/keep/blob/e52b433e668648f92907034179bd28358496fd0a/src/Keep.sol)


```solidity
Expand Down
10 changes: 5 additions & 5 deletions docs/src/src/KeepFactory.sol/contract.KeepFactory.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# KeepFactory
[Git Source](https://github.com/kalidao/keep/blob/bf21b4d1d146ef800f17003b87f2cf6914c6539e/src/KeepFactory.sol)
[Git Source](https://github.com/kalidao/keep/blob/e52b433e668648f92907034179bd28358496fd0a/src/KeepFactory.sol)

**Inherits:**
[Multicallable](/src/utils/Multicallable.sol/contract.Multicallable.md)
[Multicallable](/src/utils/Multicallable.sol/abstract.Multicallable.md)

Keep Factory.

Expand All @@ -15,7 +15,7 @@ Immutables


```solidity
Keep internal immutable keepTemplate;
address internal immutable keepTemplate;
```


Expand All @@ -28,7 +28,7 @@ Constructor


```solidity
constructor(Keep _keepTemplate) payable;
constructor(address _keepTemplate) payable;
```

### determineKeep
Expand Down Expand Up @@ -63,6 +63,6 @@ Events


```solidity
event Deployed(Keep indexed keep, bytes32 name, address[] signers, uint256 threshold);
event Deployed(address indexed keep, address[] signers, uint256 threshold);
```

32 changes: 32 additions & 0 deletions docs/src/src/KeepToken.sol/abstract.ERC1155TokenReceiver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# ERC1155TokenReceiver
[Git Source](https://github.com/kalidao/keep/blob/e52b433e668648f92907034179bd28358496fd0a/src/KeepToken.sol)

**Author:**
Modified from Solbase (https://github.com/Sol-DAO/solbase/blob/main/src/tokens/ERC1155/ERC1155.sol)

ERC1155 interface to receive tokens.


## Functions
### onERC1155Received


```solidity
function onERC1155Received(address, address, uint256, uint256, bytes calldata)
public
payable
virtual
returns (bytes4);
```

### onERC1155BatchReceived


```solidity
function onERC1155BatchReceived(address, address, uint256[] calldata, uint256[] calldata, bytes calldata)
public
payable
virtual
returns (bytes4);
```

Loading

0 comments on commit 069af4e

Please sign in to comment.