Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] Automate smart contract docgen and PR branch creation into Linea docs repo #446

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ on:
# '!**.md' will not work by itself to exclude *.md files. See https://github.com/orgs/community/discussions/25369
- '**'
- '!**.md'
- '!**.mdx'
- '!**/docs/**'
- '!docs/**'

jobs:
analyze:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ jobs:
filters: |
has-changes-requiring-build:
- '!**/*.md'
- '!**/*.mdx'
- '!**/docs/**'
- '!docs/**'
# Enables us to exclude changes in multiple file types if required
predicate-quantifier: 'every'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/run-smc-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ on:
- 'testdata/**'
- 'prover/**'
- '!contracts/**/*.md'
- '!contracts/**/*.mdx'
- '!testdata/**/*.md'
- '!prover/**/*.md'
- '!**/docs/**'
push:
branches:
- main
Expand All @@ -17,8 +19,10 @@ on:
- 'testdata/**'
- 'prover/**'
- '!contracts/**/*.md'
- '!contracts/**/*.mdx'
- '!testdata/**/*.md'
- '!prover/**/*.md'
- '!**/docs/**'

env:
GOPROXY: "https://proxy.golang.org"
Expand Down
6 changes: 3 additions & 3 deletions contracts/contracts/lib/SparseMerkleProof.sol
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ library SparseMerkleProof {
/**
* @notice Hash a value using MIMC hash
* @param _input Value to hash
* @return {bytes32} Mimc hash
* @return bytes32 Mimc hash
*/
function mimcHash(bytes calldata _input) external pure returns (bytes32) {
return Mimc.hash(_input);
Expand All @@ -106,7 +106,7 @@ library SparseMerkleProof {
/**
* @notice Hash account value
* @param _value Encoded account value bytes (nonce, balance, storageRoot, mimcCodeHash, keccakCodeHash, codeSize)
* @return {bytes32} Account value hash
* @return bytes32 Account value hash
*/
function hashAccountValue(bytes calldata _value) external pure returns (bytes32) {
Account memory account = _parseAccount(_value);
Expand All @@ -128,7 +128,7 @@ library SparseMerkleProof {
/**
* @notice Hash storage value
* @param _value Encoded storage value bytes
* @return {bytes32} Storage value hash
* @return bytes32 Storage value hash
*/
function hashStorageValue(bytes32 _value) external pure returns (bytes32) {
(bytes32 msb, bytes32 lsb) = _splitBytes32(_value);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## LineaRollup

### CONTRACT_VERSION
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## ZkEvmV2

### MODULO_R
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## IGenericErrors

### ZeroAddressNotAllowed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## IMessageService

### MessageSent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## IPauseManager

### PauseTypeRole
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## IPermissionsManager

### RoleAddress
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## IRateLimiter

### RateLimitInitialized
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## IL1MessageManager

### RollingHashUpdated
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## IL1MessageManagerV1

### MessageDoesNotExistOrHasAlreadyBeenClaimed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## IL1MessageService

### ClaimMessageWithProofParams
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## ILineaRollup

### InitializationData
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## IPlonkVerifier

### Verify
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## IZkEvmV2

### StartingRootHashDoesNotMatch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## IL2MessageManager

### RollingHashUpdated
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## IL2MessageManagerV1

### MinimumFeeChanged
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## IL2MessageServiceV1

### setMinimumFee
Expand Down
24 changes: 24 additions & 0 deletions contracts/docs/api/lib/CallForwardingProxy.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## CallForwardingProxy

### target

```solidity
address target
```

The underlying target address that is called.

### constructor

```solidity
constructor(address _target) public
```

### fallback

```solidity
fallback() external payable
```

Defaults to, and forwards all calls to the target address.

Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## L2MessageServicePauseManager

### PAUSE_L1_L2_ROLE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## LineaRollupPauseManager

### PAUSE_L1_L2_ROLE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## Mimc

### DataMissing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## PauseManager

### PAUSE_ALL_ROLE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## PermissionsManager

### __Permissions_init
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## SparseMerkleProof

### Account
Expand Down Expand Up @@ -130,7 +128,7 @@ Hash a value using MIMC hash

| Name | Type | Description |
| ---- | ---- | ----------- |
| [0] | bytes32 | {bytes32} Mimc hash |
| [0] | bytes32 | bytes32 Mimc hash |

### getLeaf

Expand Down Expand Up @@ -190,7 +188,7 @@ Hash account value

| Name | Type | Description |
| ---- | ---- | ----------- |
| [0] | bytes32 | {bytes32} Account value hash |
| [0] | bytes32 | bytes32 Account value hash |

### hashStorageValue

Expand All @@ -210,5 +208,5 @@ Hash storage value

| Name | Type | Description |
| ---- | ---- | ----------- |
| [0] | bytes32 | {bytes32} Storage value hash |
| [0] | bytes32 | bytes32 Storage value hash |

Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## TokenBridgePauseManager

### PAUSE_INITIATE_TOKEN_BRIDGING_ROLE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## Utils

### _efficientKeccak
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## MessageServiceBase

### messageService
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## L1MessageManager

### rollingHashes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## L1MessageService

### systemMigrationBlock
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## TransientStorageReentrancyGuardUpgradeable

### ReentrantCall
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## L1MessageManagerV1

### INBOX_STATUS_UNKNOWN
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## L1MessageServiceV1

### nextMessageNumber
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## L2MessageManager

### L1_L2_MESSAGE_SETTER_ROLE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## L2MessageService

### CONTRACT_VERSION
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## L2MessageManagerV1

### INBOX_STATUS_UNKNOWN
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## L2MessageServiceV1

### MINIMUM_FEE_SETTER_ROLE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## MessageHashing

### _hashMessage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## RateLimiter

You can use this control numeric limits over a period using timestamp.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## SparseMerkleTreeVerifier

### SafeCastOverflowedUintDowncast
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## TimeLock

This timelock contract will be the owner of all upgrades that gives users confidence and an ability to exit should they want to before an upgrade takes place
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## TransientStorageHelpers

### tstoreUint256
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## BridgedToken

ERC20 token created when a native token is bridged to a target chain.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## CustomBridgedToken

Custom ERC20 token manually deployed for the Linea TokenBridge.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## TokenBridge

Contract to manage cross-chain ERC20 bridging.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Solidity API

## ITokenBridge

### InitializationData
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
# Solidity API

## StorageFiller39

8 changes: 8 additions & 0 deletions contracts/docs/docgen-templates/page.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{! This template is from the solidity-docgen repository - https://github.com/OpenZeppelin/solidity-docgen/blob/f51c722278bef58847214a4d6b0ffd60dcdfa719/src/themes/markdown/page.hbs }}
{{! We delete the top line `# Solidity API` to make the generated documentation more Docusarus-friendly }}
{{#each items}}
{{#hsection}}
{{>item}}
{{/hsection}}

{{/each}}
Loading
Loading