Skip to content

Commit

Permalink
Merge branch 'main' into request-redemption-in-one-tx
Browse files Browse the repository at this point in the history
  • Loading branch information
r-czajkowski authored Jul 6, 2023
2 parents 5f0365d + 9596f80 commit 885ddd8
Show file tree
Hide file tree
Showing 14 changed files with 2,748 additions and 541 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/contracts-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Solidity docs

on:
pull_request:
push:
branches:
- releases/mainnet/solidity/**
release:
types:
- "published"
workflow_dispatch:

jobs:
docs-detect-changes:
runs-on: ubuntu-latest
outputs:
path-filter: ${{ steps.filter.outputs.path-filter }}
steps:
- uses: actions/checkout@v3
if: github.event_name == 'pull_request'
- uses: dorny/paths-filter@v2
if: github.event_name == 'pull_request'
id: filter
with:
filters: |
path-filter:
- './solidity/contracts/**'
- './.github/workflows/contracts-docs.yml'
# This job will be triggered for PRs which modify contracts. It will generate
# the archive with contracts documentation in Markdown and attatch it to the
# workflow run results. Link to the archive will be posted in a PR comment.
# The job will also be run after manual triggering and after pushes to the
# `releases/mainnet/solidity/**` branches.
contracts-docs-publish-preview:
name: Publish preview of contracts documentation
needs: docs-detect-changes
if: |
needs.docs-detect-changes.outputs.path-filter == 'true'
|| github.event_name == 'push'
|| github.event_name == 'workflow_dispatch'
uses: keep-network/ci/.github/workflows/reusable-solidity-docs.yml@main
with:
projectDir: /solidity
# We need to remove unnecessary `//` comment used in the `@dev`
# section of `BitcoinTx` documentation, which was causing problem with
# rendering of the `.md` file. We do that by executing
# `sed -i ':a;N;$!ba;s_///\n//\n_///\n_g'` on the problematic file. The
# command substitutes `///` + newline + `//` + newline with just `///` +
# newline and does this in a loop.
preProcessingCommand: sed -i ':a;N;$!ba;s_///\n//\n_///\n_g' ./contracts/bridge/BitcoinTx.sol
publish: false
addTOC: false
commentPR: true
exportAsGHArtifacts: true

# This job will be triggered for releases which name starts with
# `refs/tags/solidity/`. It will generate contracts documentation in
# Markdown and sync it with a specific path of
# `threshold-network/threshold` repository. If changes will be detected,
# a PR updating the docs will be created in the destination repository. The
# commit pushing the changes will be verified using GPG key.
contracts-docs-publish:
name: Publish contracts documentation
needs: docs-detect-changes
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/solidity/')
uses: keep-network/ci/.github/workflows/reusable-solidity-docs.yml@main
with:
projectDir: /solidity
# We need to remove unnecessary `//` comment used in the `@dev`
# section of `BitcoinTx` documentation, which was causing problem with
# rendering of the `.md` file. We do that by executing
# `sed -i ':a;N;$!ba;s_///\n//\n_///\n_g'` on the problematic file. The
# command substitutes `///` + newline + `//` + newline with just `///` +
# newline and does this in a loop.
preProcessingCommand: sed -i ':a;N;$!ba;s_///\n//\n_///\n_g' ./contracts/bridge/BitcoinTx.sol
publish: true
addTOC: false
verifyCommits: true
destinationRepo: threshold-network/threshold
destinationFolder: ./docs/app-development/tbtc-v2/tbtc-v2-api
destinationBaseBranch: main
userEmail: 38324465+thesis-valkyrie@users.noreply.github.com
userName: Valkyrie
rsyncDelete: true
secrets:
githubToken: ${{ secrets.THRESHOLD_DOCS_GITHUB_TOKEN }}
gpgPrivateKey: ${{ secrets.THRESHOLD_DOCS_GPG_PRIVATE_KEY_BASE64 }}
gpgPassphrase: ${{ secrets.THRESHOLD_DOCS_GPG_PASSPHRASE }}
270 changes: 270 additions & 0 deletions solidity/.openzeppelin/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -1646,6 +1646,276 @@
}
}
}
},
"ce16848058a776a80d070af74d85fb4d1e632b07a9857bddcd0276c13aaf20c6": {
"address": "0x10Fb5943E2F4F67Ee6a533DaE49B6d4cC443ffE5",
"txHash": "0xe13747dba11729d2fd7aa9eca5ebba44073591c774122760008a3dd6e2dced76",
"layout": {
"solcVersion": "0.8.17",
"storage": [
{
"label": "_initialized",
"offset": 0,
"slot": "0",
"type": "t_uint8",
"contract": "Initializable",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62",
"retypedFrom": "bool"
},
{
"label": "_initializing",
"offset": 1,
"slot": "0",
"type": "t_bool",
"contract": "Initializable",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67"
},
{
"label": "__gap",
"offset": 0,
"slot": "1",
"type": "t_array(t_uint256)50_storage",
"contract": "ContextUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36"
},
{
"label": "_owner",
"offset": 0,
"slot": "51",
"type": "t_address",
"contract": "OwnableUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22"
},
{
"label": "__gap",
"offset": 0,
"slot": "52",
"type": "t_array(t_uint256)49_storage",
"contract": "OwnableUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94"
},
{
"label": "reimbursementPool",
"offset": 0,
"slot": "101",
"type": "t_contract(ReimbursementPool)8816",
"contract": "Reimbursable",
"src": "@keep-network/random-beacon/contracts/Reimbursable.sol:51"
},
{
"label": "__gap",
"offset": 0,
"slot": "102",
"type": "t_array(t_uint256)49_storage",
"contract": "Reimbursable",
"src": "@keep-network/random-beacon/contracts/Reimbursable.sol:51"
},
{
"label": "isCoordinator",
"offset": 0,
"slot": "151",
"type": "t_mapping(t_address,t_bool)",
"contract": "WalletCoordinator",
"src": "contracts/bridge/WalletCoordinator.sol:150"
},
{
"label": "walletLock",
"offset": 0,
"slot": "152",
"type": "t_mapping(t_bytes20,t_struct(WalletLock)34672_storage)",
"contract": "WalletCoordinator",
"src": "contracts/bridge/WalletCoordinator.sol:152"
},
{
"label": "bridge",
"offset": 0,
"slot": "153",
"type": "t_contract(Bridge)25740",
"contract": "WalletCoordinator",
"src": "contracts/bridge/WalletCoordinator.sol:154"
},
{
"label": "heartbeatRequestValidity",
"offset": 20,
"slot": "153",
"type": "t_uint32",
"contract": "WalletCoordinator",
"src": "contracts/bridge/WalletCoordinator.sol:165"
},
{
"label": "heartbeatRequestGasOffset",
"offset": 24,
"slot": "153",
"type": "t_uint32",
"contract": "WalletCoordinator",
"src": "contracts/bridge/WalletCoordinator.sol:169"
},
{
"label": "depositSweepProposalValidity",
"offset": 28,
"slot": "153",
"type": "t_uint32",
"contract": "WalletCoordinator",
"src": "contracts/bridge/WalletCoordinator.sol:181"
},
{
"label": "depositMinAge",
"offset": 0,
"slot": "154",
"type": "t_uint32",
"contract": "WalletCoordinator",
"src": "contracts/bridge/WalletCoordinator.sol:191"
},
{
"label": "depositRefundSafetyMargin",
"offset": 4,
"slot": "154",
"type": "t_uint32",
"contract": "WalletCoordinator",
"src": "contracts/bridge/WalletCoordinator.sol:212"
},
{
"label": "depositSweepMaxSize",
"offset": 8,
"slot": "154",
"type": "t_uint16",
"contract": "WalletCoordinator",
"src": "contracts/bridge/WalletCoordinator.sol:214"
},
{
"label": "depositSweepProposalSubmissionGasOffset",
"offset": 10,
"slot": "154",
"type": "t_uint32",
"contract": "WalletCoordinator",
"src": "contracts/bridge/WalletCoordinator.sol:218"
},
{
"label": "redemptionProposalValidity",
"offset": 14,
"slot": "154",
"type": "t_uint32",
"contract": "WalletCoordinator",
"src": "contracts/bridge/WalletCoordinator.sol:230"
},
{
"label": "redemptionRequestMinAge",
"offset": 18,
"slot": "154",
"type": "t_uint32",
"contract": "WalletCoordinator",
"src": "contracts/bridge/WalletCoordinator.sol:238"
},
{
"label": "redemptionRequestTimeoutSafetyMargin",
"offset": 22,
"slot": "154",
"type": "t_uint32",
"contract": "WalletCoordinator",
"src": "contracts/bridge/WalletCoordinator.sol:261"
},
{
"label": "redemptionMaxSize",
"offset": 26,
"slot": "154",
"type": "t_uint16",
"contract": "WalletCoordinator",
"src": "contracts/bridge/WalletCoordinator.sol:265"
},
{
"label": "redemptionProposalSubmissionGasOffset",
"offset": 28,
"slot": "154",
"type": "t_uint32",
"contract": "WalletCoordinator",
"src": "contracts/bridge/WalletCoordinator.sol:274"
}
],
"types": {
"t_address": {
"label": "address",
"numberOfBytes": "20"
},
"t_array(t_uint256)49_storage": {
"label": "uint256[49]",
"numberOfBytes": "1568"
},
"t_array(t_uint256)50_storage": {
"label": "uint256[50]",
"numberOfBytes": "1600"
},
"t_bool": {
"label": "bool",
"numberOfBytes": "1"
},
"t_bytes20": {
"label": "bytes20",
"numberOfBytes": "20"
},
"t_contract(Bridge)25740": {
"label": "contract Bridge",
"numberOfBytes": "20"
},
"t_contract(ReimbursementPool)8816": {
"label": "contract ReimbursementPool",
"numberOfBytes": "20"
},
"t_enum(WalletAction)34664": {
"label": "enum WalletCoordinator.WalletAction",
"members": [
"Idle",
"Heartbeat",
"DepositSweep",
"Redemption",
"MovingFunds",
"MovedFundsSweep"
],
"numberOfBytes": "1"
},
"t_mapping(t_address,t_bool)": {
"label": "mapping(address => bool)",
"numberOfBytes": "32"
},
"t_mapping(t_bytes20,t_struct(WalletLock)34672_storage)": {
"label": "mapping(bytes20 => struct WalletCoordinator.WalletLock)",
"numberOfBytes": "32"
},
"t_struct(WalletLock)34672_storage": {
"label": "struct WalletCoordinator.WalletLock",
"members": [
{
"label": "expiresAt",
"type": "t_uint32",
"offset": 0,
"slot": "0"
},
{
"label": "cause",
"type": "t_enum(WalletAction)34664",
"offset": 4,
"slot": "0"
}
],
"numberOfBytes": "32"
},
"t_uint16": {
"label": "uint16",
"numberOfBytes": "2"
},
"t_uint256": {
"label": "uint256",
"numberOfBytes": "32"
},
"t_uint32": {
"label": "uint32",
"numberOfBytes": "4"
},
"t_uint8": {
"label": "uint8",
"numberOfBytes": "1"
}
}
}
}
}
}
1 change: 1 addition & 0 deletions solidity/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ deployments/
export/
hardhat-dependency-compiler/
typechain/
docgen-templates/
export.json
Loading

0 comments on commit 885ddd8

Please sign in to comment.