Skip to content

Commit

Permalink
feat: update technical docs to latest version of protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
nftchance committed Apr 24, 2024
1 parent 908ff9d commit 476f0ff
Show file tree
Hide file tree
Showing 23 changed files with 128 additions and 567 deletions.
12 changes: 0 additions & 12 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,6 @@ export default defineConfig({
collapsed: true,
items: getItems("./generated/hash-getters"),
},
{
text: "Digest Getters",
link: "/decoders/digest-getters",
collapsed: true,
items: getItems("./generated/digest-getters"),
},
{
text: "Signer Getters",
link: "/decoders/signer-getters",
collapsed: true,
items: getItems("./generated/signer-getters"),
},
{
text: "Fuses",
link: "/core/fuses",
Expand Down
10 changes: 5 additions & 5 deletions .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import DefaultTheme from "vitepress/theme-without-fonts";
import "./style.css";

export default {
extends: DefaultTheme,
Layout: () => {
return h(DefaultTheme.Layout, null, {});
},
enhanceApp() {},
extends: DefaultTheme,
Layout: () => {
return h(DefaultTheme.Layout, null, {});
},
enhanceApp() {},
} satisfies Theme;
4 changes: 1 addition & 3 deletions core/sockets.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ The methods available for public interfacing are:
While these are the two key functions for public use, there are also internal functions that meant to be overridden including:

- `_enforceRouter`: Extend the validation logic of [Routers](/core/routers).
- `_enforceSigner`: Extend the validation logic of who can be a signer.
- `_enforceFuse`: Extend the validation logic of [Fuse](/core/fuses) conditions.
- `_enforceCurrent`: Extend the validation logic of the executable [Currents](/generated/base-types/Current).
- `_enforceSignature`: Extend the validation logic of what is accepted as a valid signature.

With these pairings, a `Socket` can be configured to provide the precise functionality desired with ease and without needing to manipulate the core logic of the architecture.
8 changes: 2 additions & 6 deletions decoders/base-types.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Base Types

`Plug` is architected on a handful of [Base EIP-712 Types](/decoders/base-types) that are used to build the [Plugs](/generated/base-types/Plugs) and [Fuses](/generated/base-types/Fuse). Alone these types are not very useful, but together they form the foundation of the [Plug](/) framework.
`Plug` is architected on a handful of [Base EIP-712 Types](/decoders/base-types) that are used to build the [Plugs](/generated/base-types/Plugs). Alone Plugs are not very useful, but when signed they form the foundation of the [Plug](/) framework.

## Type Hashes

Expand Down Expand Up @@ -81,12 +81,8 @@ By default, most libraries include the `EIP712Domain` type in the signature. Thi

## Plug Types

The `Plug Types` are used to define the [Plug](/generated/base-types/Plug) that is executed.
The `Plug Types` are used to define the [Plug](/generated/base-types/Plug) that is executed:

When creating new plugs you will utilize:

- [Current](/generated/base-types/Current)
- [Fuse](/generated/base-types/Fuse)
- [Plug](/generated/base-types/Plug)

When distributing new plugs you will utilize:
Expand Down
78 changes: 0 additions & 78 deletions generated/base-types/Current.md

This file was deleted.

23 changes: 5 additions & 18 deletions generated/base-types/EIP712Domain.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ head:
notes:
- - author: Auto generated by @nftchance/plug-types/cli
---

# EIP712Domain

A [EIP712Domain](/generated/base-types/EIP712Domain) data type provides EIP-712 compatability for encoding and decoding the data needed for an `Plug` to be securely distributed and executed.
Expand All @@ -25,20 +25,20 @@ To interact with the data type onchain will you need both the `Typescript` and `

``` typescript [Typescript/Javascript]
{
name: string,
name: string,
version: string,
chainId: bigint,
verifyingContract: '0x${string}'
}
```

```typescript [EIP-712]
{
{ name: 'name', type: 'string' },
[
{ name: 'name', type: 'string' },
{ name: 'version', type: 'string' },
{ name: 'chainId', type: 'uint256' },
{ name: 'verifyingContract', type: 'address' }
}
]
```

:::
Expand All @@ -55,19 +55,6 @@ With `name`, `version`, `chainId` and `verifyingContract` as the fields of the `

::: code-group

```solidity [Verbose.sol]
bytes32 constant EIP712_DOMAIN_TYPEHASH = keccak256(
abi.encodePacked(
"EIP712Domain(",
"string name",
"string version",
"uint256 chainId",
"address verifyingContract",
")"
)
);
```

```solidity [Inline.sol]
bytes32 constant EIP712_DOMAIN_TYPEHASH = keccak256(
'EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'
Expand Down
75 changes: 0 additions & 75 deletions generated/base-types/Fuse.md

This file was deleted.

25 changes: 7 additions & 18 deletions generated/base-types/LivePlugs.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ head:
notes:
- - author: Auto generated by @nftchance/plug-types/cli
---

# LivePlugs

A [LivePlugs](/generated/base-types/LivePlugs) data type provides EIP-712 compatability for encoding and decoding the data needed for an `Plug` to be securely distributed and executed.
Expand All @@ -31,16 +31,16 @@ To interact with the data type onchain will you need both the `Typescript` and `

``` typescript [Typescript/Javascript]
{
plugs: Plugs,
plugs: Plugs,
signature: '0x${string}'
}
```

```typescript [EIP-712]
{
{ name: 'plugs', type: 'Plugs' },
[
{ name: 'plugs', type: 'Plugs' },
{ name: 'signature', type: 'bytes' }
}
]
```

:::
Expand All @@ -57,25 +57,14 @@ With `plugs` and `signature` as the fields of the `LivePlugs` data type we can g

::: code-group

```solidity [Verbose.sol]
bytes32 constant LIVE_PLUGS_TYPEHASH = keccak256(
abi.encodePacked(
"LivePlugs(",
"Plugs plugs",
"bytes signature",
")"
)
);
```

```solidity [Inline.sol]
bytes32 constant LIVE_PLUGS_TYPEHASH = keccak256(
'LivePlugs(Plugs plugs,bytes signature)Current(address target,uint256 value,bytes data)Fuse(address target,bytes data)Plug(Current current,Fuse[] fuses)Plugs(address socket,Plug[] plugs,bytes32 salt,uint256 fee,uint256 maxFeePerGas,uint256 maxPriorityFeePerGas,address executor)'
'LivePlugs(Plugs plugs,bytes signature)Plug(address target,uint256 value,bytes data)Plugs(address socket,Plug[] plugs,bytes solver,bytes32 salt)'
);
```

```solidity [Hash.sol]
bytes32 constant LIVE_PLUGS_TYPEHASH = 0x9826b78cb7c16c81b780befb1a76a98667ee53dc94480b2e7606856e1110a485
bytes32 constant LIVE_PLUGS_TYPEHASH = 0x6cd9425d5dd731a623cc0fee82dd49189fd54b9a5d85856406fe9744411d9157
```

:::
Loading

0 comments on commit 476f0ff

Please sign in to comment.