From dca0f1ea9075a00c70dea4856c2f1011078ccc78 Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Wed, 22 Nov 2023 12:21:45 +0530 Subject: [PATCH 01/37] fix: added contracts in docs --- docs/docs/contracts/book.css | 13 + docs/docs/contracts/book.toml | 12 + docs/docs/contracts/solidity.min.js | 74 ++++ docs/docs/contracts/src/README.md | 48 +++ docs/docs/contracts/src/SUMMARY.md | 19 + docs/docs/contracts/src/src/README.md | 6 + .../bridge/BitcoinTx.sol/library.BitcoinTx.md | 138 ++++++ .../BridgeState.sol/library.BridgeState.md | 14 + .../src/bridge/IRelay.sol/interface.IRelay.md | 36 ++ docs/docs/contracts/src/src/bridge/README.md | 7 + .../bridge/WitnessTx.sol/library.WitnessTx.md | 99 +++++ .../DummyRelay.sol/contract.DummyRelay.md | 32 ++ .../LightRelay.sol/contract.LightRelay.md | 399 ++++++++++++++++++ .../LightRelay.sol/interface.ILightRelay.md | 84 ++++ .../LightRelay.sol/library.RelayUtils.md | 30 ++ .../src/relay/LightRelay.sol/struct.Epoch.md | 11 + docs/docs/contracts/src/src/relay/README.md | 8 + .../src/swap/Bridge.sol/contract.Bridge.md | 159 +++++++ .../contract.BtcMarketPlace.md | 306 ++++++++++++++ .../Marketplace.sol/contract.MarketPlace.md | 87 ++++ docs/docs/contracts/src/src/swap/README.md | 7 + .../Wrapped.sol/contract.BobWrappedBtc.md | 36 ++ docs/docusaurus.config.js | 6 + docs/sidebars.js | 39 ++ src/bridge/BitcoinTx.sol | 126 +++--- 25 files changed, 1732 insertions(+), 64 deletions(-) create mode 100644 docs/docs/contracts/book.css create mode 100644 docs/docs/contracts/book.toml create mode 100644 docs/docs/contracts/solidity.min.js create mode 100644 docs/docs/contracts/src/README.md create mode 100644 docs/docs/contracts/src/SUMMARY.md create mode 100644 docs/docs/contracts/src/src/README.md create mode 100644 docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md create mode 100644 docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md create mode 100644 docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md create mode 100644 docs/docs/contracts/src/src/bridge/README.md create mode 100644 docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md create mode 100644 docs/docs/contracts/src/src/relay/DummyRelay.sol/contract.DummyRelay.md create mode 100644 docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md create mode 100644 docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md create mode 100644 docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md create mode 100644 docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md create mode 100644 docs/docs/contracts/src/src/relay/README.md create mode 100644 docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md create mode 100644 docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md create mode 100644 docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md create mode 100644 docs/docs/contracts/src/src/swap/README.md create mode 100644 docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md diff --git a/docs/docs/contracts/book.css b/docs/docs/contracts/book.css new file mode 100644 index 00000000..b5ce903f --- /dev/null +++ b/docs/docs/contracts/book.css @@ -0,0 +1,13 @@ +table { + margin: 0 auto; + border-collapse: collapse; + width: 100%; +} + +table td:first-child { + width: 15%; +} + +table td:nth-child(2) { + width: 25%; +} \ No newline at end of file diff --git a/docs/docs/contracts/book.toml b/docs/docs/contracts/book.toml new file mode 100644 index 00000000..353bd356 --- /dev/null +++ b/docs/docs/contracts/book.toml @@ -0,0 +1,12 @@ +[book] +src = "src" +title = "" + +[output.html] +no-section-label = true +additional-js = ["solidity.min.js"] +additional-css = ["book.css"] +git-repository-url = "https://github.com/bob-collective/bob" + +[output.html.fold] +enable = true diff --git a/docs/docs/contracts/solidity.min.js b/docs/docs/contracts/solidity.min.js new file mode 100644 index 00000000..19249329 --- /dev/null +++ b/docs/docs/contracts/solidity.min.js @@ -0,0 +1,74 @@ +hljs.registerLanguage("solidity",(()=>{"use strict";function e(){try{return!0 +}catch(e){return!1}} +var a=/-?(\b0[xX]([a-fA-F0-9]_?)*[a-fA-F0-9]|(\b[1-9](_?\d)*(\.((\d_?)*\d)?)?|\.\d(_?\d)*)([eE][-+]?\d(_?\d)*)?|\b0)(?!\w|\$)/ +;e()&&(a=a.source.replace(/\\b/g,"(?{ +var a=r(e),o=l(e),c=/[A-Za-z_$][A-Za-z_$0-9.]*/,d=e.inherit(e.TITLE_MODE,{ +begin:/[A-Za-z$_][0-9A-Za-z$_]*/,lexemes:c,keywords:n}),u={className:"params", +begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,lexemes:c,keywords:n, +contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,o,s]},_={ +className:"operator",begin:/:=|->/};return{keywords:n,lexemes:c, +contains:[a,o,i,t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s,_,{ +className:"function",lexemes:c,beginKeywords:"function",end:"{",excludeEnd:!0, +contains:[d,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,_]}]}}, +solAposStringMode:r,solQuoteStringMode:l,HEX_APOS_STRING_MODE:i, +HEX_QUOTE_STRING_MODE:t,SOL_NUMBER:s,isNegativeLookbehindAvailable:e} +;const{baseAssembly:c,solAposStringMode:d,solQuoteStringMode:u,HEX_APOS_STRING_MODE:_,HEX_QUOTE_STRING_MODE:m,SOL_NUMBER:b,isNegativeLookbehindAvailable:E}=o +;return e=>{for(var a=d(e),s=u(e),n=[],i=0;i<32;i++)n[i]=i+1 +;var t=n.map((e=>8*e)),r=[];for(i=0;i<=80;i++)r[i]=i +;var l=n.map((e=>"bytes"+e)).join(" ")+" ",o=t.map((e=>"uint"+e)).join(" ")+" ",g=t.map((e=>"int"+e)).join(" ")+" ",M=[].concat.apply([],t.map((e=>r.map((a=>e+"x"+a))))),p={ +keyword:"var bool string int uint "+g+o+"byte bytes "+l+"fixed ufixed "+M.map((e=>"fixed"+e)).join(" ")+" "+M.map((e=>"ufixed"+e)).join(" ")+" enum struct mapping address new delete if else for while continue break return throw emit try catch revert unchecked _ function modifier event constructor fallback receive error virtual override constant immutable anonymous indexed storage memory calldata external public internal payable pure view private returns import from as using pragma contract interface library is abstract type assembly", +literal:"true false wei gwei szabo finney ether seconds minutes hours days weeks years", +built_in:"self this super selfdestruct suicide now msg block tx abi blockhash gasleft assert require Error Panic sha3 sha256 keccak256 ripemd160 ecrecover addmod mulmod log0 log1 log2 log3 log4" +},O={className:"operator",begin:/[+\-!~*\/%<>&^|=]/ +},C=/[A-Za-z_$][A-Za-z_$0-9]*/,N={className:"params",begin:/\(/,end:/\)/, +excludeBegin:!0,excludeEnd:!0,lexemes:C,keywords:p, +contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,s,b,"self"]},f={ +begin:/\.\s*/,end:/[^A-Za-z0-9$_\.]/,excludeBegin:!0,excludeEnd:!0,keywords:{ +built_in:"gas value selector address length push pop send transfer call callcode delegatecall staticcall balance code codehash wrap unwrap name creationCode runtimeCode interfaceId min max" +},relevance:2},y=e.inherit(e.TITLE_MODE,{begin:/[A-Za-z$_][0-9A-Za-z$_]*/, +lexemes:C,keywords:p}),w={className:"built_in", +begin:(E()?"(? Epoch) internal epochs; +``` + + +### isAuthorized + +```solidity +mapping(address => bool) public isAuthorized; +``` + + +## Functions +### relayActive + + +```solidity +modifier relayActive(); +``` + +### genesis + +Establish a starting point for the relay by providing the +target, timestamp and blockheight of the first block of the relay +genesis epoch. + +*If the relay is used by querying the current and previous epoch +difficulty, at least one retarget needs to be provided after genesis; +otherwise the prevEpochDifficulty will be uninitialised and zero.* + + +```solidity +function genesis(bytes calldata genesisHeader, uint256 genesisHeight, uint64 genesisProofLength) external onlyOwner; +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`genesisHeader`|`bytes`|The first block header of the genesis epoch.| +|`genesisHeight`|`uint256`|The block number of the first block of the epoch.| +|`genesisProofLength`|`uint64`|The number of blocks required to accept a proof.| + + +### setProofLength + +Set the number of blocks required to accept a header chain. + +*For production, a high number (e.g. 20-50) is recommended. +Small numbers are accepted but should only be used for testing.* + + +```solidity +function setProofLength(uint64 newLength) external relayActive onlyOwner; +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`newLength`|`uint64`|The required number of blocks. Must be less than 2016.| + + +### setAuthorizationStatus + +Set whether the relay requires retarget submitters to be +pre-authorised by governance. + + +```solidity +function setAuthorizationStatus(bool status) external onlyOwner; +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`status`|`bool`|True if authorisation is to be required, false if not.| + + +### authorize + +Authorise the given address to submit retarget proofs. + + +```solidity +function authorize(address submitter) external onlyOwner; +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`submitter`|`address`|The address to be authorised.| + + +### deauthorize + +Rescind the authorisation of the submitter to retarget. + + +```solidity +function deauthorize(address submitter) external onlyOwner; +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`submitter`|`address`|The address to be deauthorised.| + + +### retarget + +Add a new epoch to the relay by providing a proof +of the difficulty before and after the retarget. + +*Checks that the first X blocks are valid in the most recent epoch, +that the difficulty of the new epoch is calculated correctly according +to the block timestamps, and that the next X blocks would be valid in +the new epoch. +We have no information of block heights, so we cannot enforce that +retargets only happen every 2016 blocks; instead, we assume that this +is the case if a valid proof of work is provided. +It is possible to cheat the relay by providing X blocks from earlier in +the most recent epoch, and then mining X new blocks after them. +However, each of these malicious blocks would have to be mined to a +higher difficulty than the legitimate ones. +Alternatively, if the retarget has not been performed yet, one could +first mine X blocks in the old difficulty with timestamps set far in +the future, and then another X blocks at a greatly reduced difficulty. +In either case, cheating the relay requires more work than mining X +legitimate blocks. +Only the most recent epoch is vulnerable to these attacks; once a +retarget has been proven to the relay, the epoch is immutable even if a +contradictory proof were to be presented later.* + + +```solidity +function retarget(bytes memory headers) external relayActive; +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`headers`|`bytes`|A chain of headers including the last X blocks before the retarget, followed by the first X blocks after the retarget, where X equals the current proof length.| + + +### validateChain + +Check whether a given chain of headers should be accepted as +valid within the rules of the relay. +If the validation fails, this function throws an exception. + +*A chain of headers is accepted as valid if: +- Its length is between 2 and 2015 headers. +- Headers in the chain are sequential and refer to previous digests. +- Each header is mined with the correct amount of work. +- The difficulty in each header matches an epoch of the relay, +as determined by the headers' timestamps. The headers must be between +the genesis epoch and the latest proven epoch (inclusive). +If the chain contains a retarget, it is accepted if the retarget has +already been proven to the relay. +If the chain contains blocks of an epoch that has not been proven to +the relay (after a retarget within the header chain, or when the entire +chain falls within an epoch that has not been proven yet), it will be +rejected. +One exception to this is when two subsequent epochs have exactly the +same difficulty; headers from the latter epoch will be accepted if the +previous epoch has been proven to the relay. +This is because it is not possible to distinguish such headers from +headers of the previous epoch. +If the difficulty increases significantly between relay genesis and the +present, creating fraudulent proofs for earlier epochs becomes easier. +Users of the relay should check the timestamps of valid headers and +only accept appropriately recent ones.* + + +```solidity +function validateChain(bytes memory headers) + external + view + returns (uint256 startingHeaderTimestamp, uint256 headerCount); +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`headers`|`bytes`|A chain of 2 to 2015 bitcoin headers.| + +**Returns** + +|Name|Type|Description| +|----|----|-----------| +|`startingHeaderTimestamp`|`uint256`|The timestamp of the first header.| +|`headerCount`|`uint256`|The number of headers.| + + +### getBlockDifficulty + +Get the difficulty of the specified block. + + +```solidity +function getBlockDifficulty(uint256 blockNumber) external view returns (uint256); +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`blockNumber`|`uint256`|The number of the block. Must fall within the relay range (at or after the relay genesis, and at or before the end of the most recent epoch proven to the relay).| + +**Returns** + +|Name|Type|Description| +|----|----|-----------| +|``|`uint256`|The difficulty of the epoch.| + + +### getRelayRange + +Get the range of blocks the relay can accept proofs for. + +*Assumes that the genesis has been set correctly. +Additionally, if the next epoch after the current one has the exact +same difficulty, headers for it can be validated as well. +This function should be used for informative purposes, +e.g. to determine whether a retarget must be provided before submitting +a header chain for validation.* + + +```solidity +function getRelayRange() external view returns (uint256 relayGenesis, uint256 currentEpochEnd); +``` +**Returns** + +|Name|Type|Description| +|----|----|-----------| +|`relayGenesis`|`uint256`|The height of the earliest block that can be included in header chains for the relay to validate.| +|`currentEpochEnd`|`uint256`|The height of the last block that can be included in header chains for the relay to validate.| + + +### getCurrentEpochDifficulty + +Returns the difficulty of the current epoch. + +*returns 0 if the relay is not ready.* + + +```solidity +function getCurrentEpochDifficulty() external view virtual returns (uint256); +``` +**Returns** + +|Name|Type|Description| +|----|----|-----------| +|``|`uint256`|The difficulty of the current epoch.| + + +### getPrevEpochDifficulty + +Returns the difficulty of the previous epoch. + +*Returns 0 if the relay is not ready or has not had a retarget.* + + +```solidity +function getPrevEpochDifficulty() external view virtual returns (uint256); +``` +**Returns** + +|Name|Type|Description| +|----|----|-----------| +|``|`uint256`|The difficulty of the previous epoch.| + + +### getCurrentAndPrevEpochDifficulty + + +```solidity +function getCurrentAndPrevEpochDifficulty() external view returns (uint256 current, uint256 previous); +``` + +### difficultyCheckEnabled + + +```solidity +function difficultyCheckEnabled() external view returns (bool); +``` + +### getEpochDifficulty + +Get the difficulty of the specified epoch. + + +```solidity +function getEpochDifficulty(uint256 epochNumber) public view returns (uint256); +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`epochNumber`|`uint256`|The number of the epoch (the height of the first block of the epoch, divided by 2016). Must fall within the relay range.| + +**Returns** + +|Name|Type|Description| +|----|----|-----------| +|``|`uint256`|The difficulty of the epoch.| + + +### validateHeader + +Check that the specified header forms a correct chain with the +digest of the previous header (if provided), and has sufficient work. + +*Throws an exception if the header's chain or PoW are invalid. +Performs no other validation.* + + +```solidity +function validateHeader(bytes memory headers, uint256 start, bytes32 prevDigest) + internal + view + returns (bytes32 digest, uint256 target); +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`headers`|`bytes`|The byte array containing the header of interest.| +|`start`|`uint256`|The start of the header in the array.| +|`prevDigest`|`bytes32`|The digest of the previous header (optional; providing zeros for the digest skips the check).| + +**Returns** + +|Name|Type|Description| +|----|----|-----------| +|`digest`|`bytes32`|The digest of the current header.| +|`target`|`uint256`|The PoW target of the header.| + + diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md new file mode 100644 index 00000000..7135d7bb --- /dev/null +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md @@ -0,0 +1,84 @@ +# ILightRelay +[Git Source](https://github.com/bob-collective/bob/blob/d9da9844231f0238dc8154200871bc3b4af31769/src/relay/LightRelay.sol) + +[//]: # (**Inherits:**) + +[//]: # ([IRelay](/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md)) + + +## Functions +### retarget + + +```solidity +function retarget(bytes memory headers) external; +``` + +### validateChain + + +```solidity +function validateChain(bytes memory headers) + external + view + returns (uint256 startingHeaderTimestamp, uint256 headerCount); +``` + +### getBlockDifficulty + + +```solidity +function getBlockDifficulty(uint256 blockNumber) external view returns (uint256); +``` + +### getEpochDifficulty + + +```solidity +function getEpochDifficulty(uint256 epochNumber) external view returns (uint256); +``` + +### getRelayRange + + +```solidity +function getRelayRange() external view returns (uint256 relayGenesis, uint256 currentEpochEnd); +``` + +## Events +### Genesis + +```solidity +event Genesis(uint256 blockHeight); +``` + +### Retarget + +```solidity +event Retarget(uint256 oldDifficulty, uint256 newDifficulty); +``` + +### ProofLengthChanged + +```solidity +event ProofLengthChanged(uint256 newLength); +``` + +### AuthorizationRequirementChanged + +```solidity +event AuthorizationRequirementChanged(bool newStatus); +``` + +### SubmitterAuthorized + +```solidity +event SubmitterAuthorized(address submitter); +``` + +### SubmitterDeauthorized + +```solidity +event SubmitterDeauthorized(address submitter); +``` + diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md new file mode 100644 index 00000000..b36577a8 --- /dev/null +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md @@ -0,0 +1,30 @@ +# RelayUtils +[Git Source](https://github.com/bob-collective/bob/blob/d9da9844231f0238dc8154200871bc3b4af31769/src/relay/LightRelay.sol) + + +## Functions +### extractTimestampAt + +Extract the timestamp of the header at the given position. + +*Assumes that the specified position contains a valid header. +Performs no validation whatsoever.* + + +```solidity +function extractTimestampAt(bytes memory headers, uint256 at) internal pure returns (uint32); +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`headers`|`bytes`|Byte array containing the header of interest.| +|`at`|`uint256`|The start of the header in the array.| + +**Returns** + +|Name|Type|Description| +|----|----|-----------| +|``|`uint32`|The timestamp of the header.| + + diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md new file mode 100644 index 00000000..7261c72d --- /dev/null +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md @@ -0,0 +1,11 @@ +# Epoch +[Git Source](https://github.com/bob-collective/bob/blob/d9da9844231f0238dc8154200871bc3b4af31769/src/relay/LightRelay.sol) + + +```solidity +struct Epoch { + uint32 timestamp; + uint224 target; +} +``` + diff --git a/docs/docs/contracts/src/src/relay/README.md b/docs/docs/contracts/src/src/relay/README.md new file mode 100644 index 00000000..fe076483 --- /dev/null +++ b/docs/docs/contracts/src/src/relay/README.md @@ -0,0 +1,8 @@ + + +# Contents +- [DummyRelay](DummyRelay.sol/contract.DummyRelay.md) +- [Epoch](LightRelay.sol/struct.Epoch.md) +- [ILightRelay](LightRelay.sol/interface.ILightRelay.md) +- [RelayUtils](LightRelay.sol/library.RelayUtils.md) +- [LightRelay](LightRelay.sol/contract.LightRelay.md) diff --git a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md new file mode 100644 index 00000000..75017ede --- /dev/null +++ b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md @@ -0,0 +1,159 @@ +# Bridge +[Git Source](https://github.com/bob-collective/bob/blob/d9da9844231f0238dc8154200871bc3b4af31769/src/swap/Bridge.sol) + + +## State Variables +### number + +```solidity +uint256 public number; +``` + + +### collateralThreshold + +```solidity +uint256 public collateralThreshold; +``` + + +### nextOrderId + +```solidity +uint256 nextOrderId; +``` + + +### orders + +```solidity +mapping(uint256 => Order) public orders; +``` + + +### suppliedCollateral + +```solidity +mapping(address => uint256) public suppliedCollateral; +``` + + +### totalCollateral + +```solidity +uint256 totalCollateral; +``` + + +### wrapped + +```solidity +BobWrappedBtc wrapped = new BobWrappedBtc(); +``` + + +## Functions +### constructor + + +```solidity +constructor(uint256 threshold); +``` + +### mint + +lock COL in exchange for zBTC and cCOL + + +```solidity +function mint() public payable; +``` + +### requestSwap + +request zBTC to be redeemed for given amount of BTC. + + +```solidity +function requestSwap(uint256 amountZbtc, uint256 amountBtc, BitcoinAddress calldata bitcoinAddress) public; +``` + +### acceptSwap + + +```solidity +function acceptSwap(uint256 id) public; +``` + +### cancelSwap + + +```solidity +function cancelSwap(uint256 id) public; +``` + +### executeSwap + + +```solidity +function executeSwap(uint256 id, TransactionProof calldata transactionProof) public; +``` + +### liquidate + + +```solidity +function liquidate(uint256 amountZbtc) public; +``` + +### withdraw + + +```solidity +function withdraw() public; +``` + +### colToBtc + + +```solidity +function colToBtc(uint256 collateral) internal pure returns (uint256); +``` + +### btcToCol + + +```solidity +function btcToCol(uint256 collateral) internal pure returns (uint256); +``` + +## Structs +### Order + +```solidity +struct Order { + bool open; + uint256 amountZbtc; + uint256 amountBtc; + address requesterAddress; + address accepterAddress; + BitcoinAddress bitcoinAddress; +} +``` + +### BitcoinAddress + +```solidity +struct BitcoinAddress { + uint256 bitcoinAddress; +} +``` + +### TransactionProof + +```solidity +struct TransactionProof { + uint256 dummy; +} +``` + diff --git a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md new file mode 100644 index 00000000..ad21e1d7 --- /dev/null +++ b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md @@ -0,0 +1,306 @@ +# BtcMarketPlace +[Git Source](https://github.com/bob-collective/bob/blob/d9da9844231f0238dc8154200871bc3b4af31769/src/swap/Btc_Marketplace.sol) + + +## State Variables +### btcBuyOrders + +```solidity +mapping(uint256 => BtcBuyOrder) public btcBuyOrders; +``` + + +### acceptedBtcBuyOrders + +```solidity +mapping(uint256 => AcceptedBtcBuyOrder) public acceptedBtcBuyOrders; +``` + + +### btcSellOrders + +```solidity +mapping(uint256 => BtcSellOrder) public btcSellOrders; +``` + + +### acceptedBtcSellOrders + +```solidity +mapping(uint256 => AcceptedBtcSellOrder) public acceptedBtcSellOrders; +``` + + +### nextOrderId + +```solidity +uint256 nextOrderId; +``` + + +### REQUEST_EXPIRATION_SECONDS + +```solidity +uint256 public constant REQUEST_EXPIRATION_SECONDS = 6 hours; +``` + + +### relay + +```solidity +BridgeState.Storage internal relay; +``` + + +## Functions +### constructor + + +```solidity +constructor(IRelay _relay); +``` + +### placeBtcSellOrder + + +```solidity +function placeBtcSellOrder(uint256 amountBtc, address buyingToken, uint256 buyAmount) public; +``` + +### acceptBtcSellOrder + + +```solidity +function acceptBtcSellOrder(uint256 id, BitcoinAddress calldata bitcoinAddress, uint256 amountBtc) + public + returns (uint256); +``` + +### proofBtcSellOrder + + +```solidity +function proofBtcSellOrder(uint256 id, BitcoinTx.Info calldata transaction, BitcoinTx.Proof calldata proof) public; +``` + +### withdrawBtcSellOrder + + +```solidity +function withdrawBtcSellOrder(uint256 id) public; +``` + +### cancelAcceptedBtcSellOrder + + +```solidity +function cancelAcceptedBtcSellOrder(uint256 id) public; +``` + +### placeBtcBuyOrder + + +```solidity +function placeBtcBuyOrder( + uint256 amountBtc, + BitcoinAddress calldata bitcoinAddress, + address sellingToken, + uint256 saleAmount +) public; +``` + +### acceptBtcBuyOrder + + +```solidity +function acceptBtcBuyOrder(uint256 id, uint256 amountBtc) public returns (uint256); +``` + +### proofBtcBuyOrder + + +```solidity +function proofBtcBuyOrder(uint256 id, BitcoinTx.Info calldata transaction, BitcoinTx.Proof calldata proof) public; +``` + +### withdrawBtcBuyOrder + + +```solidity +function withdrawBtcBuyOrder(uint256 id) public; +``` + +### cancelAcceptedBtcBuyOrder + + +```solidity +function cancelAcceptedBtcBuyOrder(uint256 id) public; +``` + +### getOpenBtcSellOrders + + +```solidity +function getOpenBtcSellOrders() external view returns (BtcSellOrder[] memory, uint256[] memory); +``` + +### getOpenAcceptedBtcSellOrders + + +```solidity +function getOpenAcceptedBtcSellOrders() external view returns (AcceptedBtcSellOrder[] memory, uint256[] memory); +``` + +### getOpenBtcBuyOrders + + +```solidity +function getOpenBtcBuyOrders() external view returns (BtcBuyOrder[] memory, uint256[] memory); +``` + +### getOpenAcceptedBtcBuyOrders + + +```solidity +function getOpenAcceptedBtcBuyOrders() external view returns (AcceptedBtcBuyOrder[] memory, uint256[] memory); +``` + +## Events +### placeBtcSellOrderEvent + +```solidity +event placeBtcSellOrderEvent(uint256 indexed orderId, uint256 amountBtc, address buyingToken, uint256 buyAmount); +``` + +### acceptBtcSellOrderEvent + +```solidity +event acceptBtcSellOrderEvent( + uint256 indexed id, + uint256 indexed acceptId, + BitcoinAddress bitcoinAddress, + uint256 amountBtc, + uint256 ercAmount, + address ercToken +); +``` + +### proofBtcSellOrderEvent + +```solidity +event proofBtcSellOrderEvent(uint256 id); +``` + +### withdrawBtcSellOrderEvent + +```solidity +event withdrawBtcSellOrderEvent(uint256 id); +``` + +### cancelAcceptedBtcSellOrderEvent + +```solidity +event cancelAcceptedBtcSellOrderEvent(uint256 id); +``` + +### placeBtcBuyOrderEvent + +```solidity +event placeBtcBuyOrderEvent(uint256 amountBtc, BitcoinAddress bitcoinAddress, address sellingToken, uint256 saleAmount); +``` + +### acceptBtcBuyOrderEvent + +```solidity +event acceptBtcBuyOrderEvent( + uint256 indexed orderId, uint256 indexed acceptId, uint256 amountBtc, uint256 ercAmount, address ercToken +); +``` + +### proofBtcBuyOrderEvent + +```solidity +event proofBtcBuyOrderEvent(uint256 id); +``` + +### withdrawBtcBuyOrderEvent + +```solidity +event withdrawBtcBuyOrderEvent(uint256 id); +``` + +### cancelAcceptedBtcBuyOrderEvent + +```solidity +event cancelAcceptedBtcBuyOrderEvent(uint256 id); +``` + +## Structs +### BtcSellOrder + +```solidity +struct BtcSellOrder { + uint256 amountBtc; + address askingToken; + uint256 askingAmount; + address requester; +} +``` + +### AcceptedBtcSellOrder + +```solidity +struct AcceptedBtcSellOrder { + uint256 orderId; + BitcoinAddress bitcoinAddress; + uint256 amountBtc; + address ercToken; + uint256 ercAmount; + address requester; + address accepter; + uint256 acceptTime; +} +``` + +### BtcBuyOrder + +```solidity +struct BtcBuyOrder { + uint256 amountBtc; + BitcoinAddress bitcoinAddress; + address offeringToken; + uint256 offeringAmount; + address requester; +} +``` + +### AcceptedBtcBuyOrder + +```solidity +struct AcceptedBtcBuyOrder { + uint256 orderId; + uint256 amountBtc; + address ercToken; + uint256 ercAmount; + address requester; + address accepter; + uint256 acceptTime; +} +``` + +### BitcoinAddress + +```solidity +struct BitcoinAddress { + string bitcoinAddress; +} +``` + +### TransactionProof + +```solidity +struct TransactionProof { + uint256 dummy; +} +``` + diff --git a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md new file mode 100644 index 00000000..33c2fc5a --- /dev/null +++ b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md @@ -0,0 +1,87 @@ +# MarketPlace +[Git Source](https://github.com/bob-collective/bob/blob/d9da9844231f0238dc8154200871bc3b4af31769/src/swap/Marketplace.sol) + + +## State Variables +### ercErcOrders + +```solidity +mapping(uint256 => Order) public ercErcOrders; +``` + + +### nextOrderId + +```solidity +uint256 public nextOrderId; +``` + + +## Functions +### placeErcErcOrder + + +```solidity +function placeErcErcOrder(address sellingToken, uint256 saleAmount, address buyingToken, uint256 buyAmount) public; +``` + +### acceptErcErcOrder + + +```solidity +function acceptErcErcOrder(uint256 id, uint256 saleAmount) public; +``` + +### withdrawErcErcOrder + + +```solidity +function withdrawErcErcOrder(uint256 id) public; +``` + +### getOpenOrders + + +```solidity +function getOpenOrders() external view returns (Order[] memory); +``` + +## Events +### placeOrder + +```solidity +event placeOrder( + uint256 indexed orderId, + address indexed requesterAddress, + uint256 offeringAmount, + address offeringToken, + uint256 askingAmount, + address askingToken +); +``` + +### acceptOrder + +```solidity +event acceptOrder(uint256 indexed orderId, address indexed who, uint256 buyAmount, uint256 saleAmount); +``` + +### withdrawOrder + +```solidity +event withdrawOrder(uint256 indexed orderId); +``` + +## Structs +### Order + +```solidity +struct Order { + uint256 offeringAmount; + address offeringToken; + uint256 askingAmount; + address askingToken; + address requesterAddress; +} +``` + diff --git a/docs/docs/contracts/src/src/swap/README.md b/docs/docs/contracts/src/src/swap/README.md new file mode 100644 index 00000000..cbed71f4 --- /dev/null +++ b/docs/docs/contracts/src/src/swap/README.md @@ -0,0 +1,7 @@ + + +# Contents +- [Bridge](Bridge.sol/contract.Bridge.md) +- [BtcMarketPlace](Btc_Marketplace.sol/contract.BtcMarketPlace.md) +- [MarketPlace](Marketplace.sol/contract.MarketPlace.md) +- [BobWrappedBtc](Wrapped.sol/contract.BobWrappedBtc.md) diff --git a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md new file mode 100644 index 00000000..1d262e5b --- /dev/null +++ b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md @@ -0,0 +1,36 @@ +# BobWrappedBtc +[Git Source](https://github.com/bob-collective/bob/blob/d9da9844231f0238dc8154200871bc3b4af31769/src/swap/Wrapped.sol) + +**Inherits:** +ERC20, ERC20Burnable, Ownable + + +## Functions +### constructor + + +```solidity +constructor() ERC20("Bob Wrapped BTC", "zBTC"); +``` + +### sudoMint + + +```solidity +function sudoMint(address to, uint256 amount) public onlyOwner; +``` + +### sudoBurnFrom + + +```solidity +function sudoBurnFrom(address account, uint256 amount) public onlyOwner; +``` + +### sudoTransferFrom + + +```solidity +function sudoTransferFrom(address from, address to, uint256 amount) public onlyOwner; +``` + diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index ec3ecdad..d333208c 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -98,6 +98,12 @@ const config = { position: "left", label: "API", }, + { + type: "docSidebar", + sidebarId: "contractSidebar", + position: "left", + label: "Contract", + }, { href: DISCORD, label: "Discord", diff --git a/docs/sidebars.js b/docs/sidebars.js index 88fc7f6e..d230d576 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -17,6 +17,45 @@ const sidebars = { rootSidebar: [{type: 'autogenerated', dirName: '.'}], learnSidebar: [{type: 'autogenerated', dirName: 'learn'}], buildSidebar: [{type: 'autogenerated', dirName: 'build'}], + contractSidebar: [ + { + type: 'category', + label: 'Contracts', + collapsed: false, + items: [ + { + type: 'category', + label: 'Bridge', + items: [ + { + type: 'autogenerated', + dirName: 'contracts/src/src/bridge' + } + ] + }, + { + type: 'category', + label: 'Relay', + items: [ + { + type: 'autogenerated', + dirName: 'contracts/src/src/relay' + } + ] + }, + { + type: 'category', + label: 'Swap', + items: [ + { + type: 'autogenerated', + dirName: 'contracts/src/src/swap' + } + ] + }, + ], + } + ], apiSidebar: [ { type: 'category', diff --git a/src/bridge/BitcoinTx.sol b/src/bridge/BitcoinTx.sol index 1e4616e0..9bf95403 100644 --- a/src/bridge/BitcoinTx.sol +++ b/src/bridge/BitcoinTx.sol @@ -13,71 +13,69 @@ import "./BridgeState.sol"; /// @title Bitcoin transaction /// @notice Allows to reference Bitcoin raw transaction in Solidity. /// @dev See https://developer.bitcoin.org/reference/transactions.html#raw-transaction-format -/// -/// Raw Bitcoin transaction data: -/// -/// | Bytes | Name | BTC type | Description | -/// |--------|--------------|------------------------|---------------------------| -/// | 4 | version | int32_t (LE) | TX version number | -/// | varies | tx_in_count | compactSize uint (LE) | Number of TX inputs | -/// | varies | tx_in | txIn[] | TX inputs | -/// | varies | tx_out_count | compactSize uint (LE) | Number of TX outputs | -/// | varies | tx_out | txOut[] | TX outputs | -/// | 4 | lock_time | uint32_t (LE) | Unix time or block number | -/// +// Raw Bitcoin transaction data: +// | Bytes | Name | BTC type | Description | +// |--------|--------------|------------------------|---------------------------| +// | 4 | version | int32_t (LE) | TX version number | +// | varies | tx_in_count | compactSize uint (LE) | Number of TX inputs | +// | varies | tx_in | txIn[] | TX inputs | +// | varies | tx_out_count | compactSize uint (LE) | Number of TX outputs | +// | varies | tx_out | txOut[] | TX outputs | +// | 4 | lock_time | uint32_t (LE) | Unix time or block number | // -/// Non-coinbase transaction input (txIn): -/// -/// | Bytes | Name | BTC type | Description | -/// |--------|------------------|------------------------|---------------------------------------------| -/// | 36 | previous_output | outpoint | The previous outpoint being spent | -/// | varies | script_bytes | compactSize uint (LE) | The number of bytes in the signature script | -/// | varies | signature_script | char[] | The signature script, empty for P2WSH | -/// | 4 | sequence | uint32_t (LE) | Sequence number | -/// -/// -/// The reference to transaction being spent (outpoint): -/// -/// | Bytes | Name | BTC type | Description | -/// |-------|-------|---------------|------------------------------------------| -/// | 32 | hash | char[32] | Hash of the transaction to spend | -/// | 4 | index | uint32_t (LE) | Index of the specific output from the TX | -/// -/// -/// Transaction output (txOut): -/// -/// | Bytes | Name | BTC type | Description | -/// |--------|-----------------|-----------------------|--------------------------------------| -/// | 8 | value | int64_t (LE) | Number of satoshis to spend | -/// | 1+ | pk_script_bytes | compactSize uint (LE) | Number of bytes in the pubkey script | -/// | varies | pk_script | char[] | Pubkey script | -/// -/// compactSize uint format: -/// -/// | Value | Bytes | Format | -/// |-----------------------------------------|-------|----------------------------------------------| -/// | >= 0 && <= 252 | 1 | uint8_t | -/// | >= 253 && <= 0xffff | 3 | 0xfd followed by the number as uint16_t (LE) | -/// | >= 0x10000 && <= 0xffffffff | 5 | 0xfe followed by the number as uint32_t (LE) | -/// | >= 0x100000000 && <= 0xffffffffffffffff | 9 | 0xff followed by the number as uint64_t (LE) | -/// -/// (*) compactSize uint is often references as VarInt) -/// -/// Coinbase transaction input (txIn): -/// -/// | Bytes | Name | BTC type | Description | -/// |--------|------------------|------------------------|---------------------------------------------| -/// | 32 | hash | char[32] | A 32-byte 0x0 null (no previous_outpoint) | -/// | 4 | index | uint32_t (LE) | 0xffffffff (no previous_outpoint) | -/// | varies | script_bytes | compactSize uint (LE) | The number of bytes in the coinbase script | -/// | varies | height | char[] | The block height of this block (BIP34) (*) | -/// | varies | coinbase_script | none | Arbitrary data, max 100 bytes | -/// | 4 | sequence | uint32_t (LE) | Sequence number -/// -/// (*) Uses script language: starts with a data-pushing opcode that indicates how many bytes to push to -/// the stack followed by the block height as a little-endian unsigned integer. This script must be as -/// short as possible, otherwise it may be rejected. The data-pushing opcode will be 0x03 and the total -/// size four bytes until block 16,777,216 about 300 years from now. +// Non-coinbase transaction input (txIn): +// +// | Bytes | Name | BTC type | Description | +// |--------|------------------|------------------------|---------------------------------------------| +// | 36 | previous_output | outpoint | The previous outpoint being spent | +// | varies | script_bytes | compactSize uint (LE) | The number of bytes in the signature script | +// | varies | signature_script | char[] | The signature script, empty for P2WSH | +// | 4 | sequence | uint32_t (LE) | Sequence number | +// +// +// The reference to transaction being spent (outpoint): +// +// | Bytes | Name | BTC type | Description | +// |-------|-------|---------------|------------------------------------------| +// | 32 | hash | char[32] | Hash of the transaction to spend | +// | 4 | index | uint32_t (LE) | Index of the specific output from the TX | +// +// +// Transaction output (txOut): +// +// | Bytes | Name | BTC type | Description | +// |--------|-----------------|-----------------------|--------------------------------------| +// | 8 | value | int64_t (LE) | Number of satoshis to spend | +// | 1+ | pk_script_bytes | compactSize uint (LE) | Number of bytes in the pubkey script | +// | varies | pk_script | char[] | Pubkey script | +// +// compactSize uint format: +// +// | Value | Bytes | Format | +// |-----------------------------------------|-------|----------------------------------------------| +// | >= 0 && <= 252 | 1 | uint8_t | +// | >= 253 && <= 0xffff | 3 | 0xfd followed by the number as uint16_t (LE) | +// | >= 0x10000 && <= 0xffffffff | 5 | 0xfe followed by the number as uint32_t (LE) | +// | >= 0x100000000 && <= 0xffffffffffffffff | 9 | 0xff followed by the number as uint64_t (LE) | +// +// (*) compactSize uint is often references as VarInt) +// +// Coinbase transaction input (txIn): +// +// | Bytes | Name | BTC type | Description | +// |--------|------------------|------------------------|---------------------------------------------| +// | 32 | hash | char[32] | A 32-byte 0x0 null (no previous_outpoint) | +// | 4 | index | uint32_t (LE) | 0xffffffff (no previous_outpoint) | +// | varies | script_bytes | compactSize uint (LE) | The number of bytes in the coinbase script | +// | varies | height | char[] | The block height of this block (BIP34) (*) | +// | varies | coinbase_script | none | Arbitrary data, max 100 bytes | +// | 4 | sequence | uint32_t (LE) | Sequence number +// +// (*) Uses script language: starts with a data-pushing opcode that indicates how many bytes to push to +// the stack followed by the block height as a little-endian unsigned integer. This script must be as +// short as possible, otherwise it may be rejected. The data-pushing opcode will be 0x03 and the total +// size four bytes until block 16,777,216 about 300 years from now. + library BitcoinTx { using BTCUtils for bytes; using BTCUtils for uint256; From b9ba1aada1ab63e6ddbf7c9821ab2cd83a057452 Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Wed, 22 Nov 2023 13:54:50 +0530 Subject: [PATCH 02/37] fix: remove readme file --- docs/docs/contracts/src/src/README.md | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 docs/docs/contracts/src/src/README.md diff --git a/docs/docs/contracts/src/src/README.md b/docs/docs/contracts/src/src/README.md deleted file mode 100644 index a9f0ae43..00000000 --- a/docs/docs/contracts/src/src/README.md +++ /dev/null @@ -1,6 +0,0 @@ - - -# Contents -- [bridge](/src/bridge) -- [relay](/src/relay) -- [swap](/src/swap) From d92d70ede819147c720d492e74e2e3b2c369a3fb Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Wed, 22 Nov 2023 14:02:35 +0530 Subject: [PATCH 03/37] fix: add doc command in ci --- .github/workflows/test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b02e156d..b96dfb4f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,6 +33,11 @@ jobs: forge build --sizes id: build + - name: Run Forge doc + run: | + forge doc --out docs/docs/contracts + id: doc + - name: Run Forge tests run: | forge test -vvv From c75366cfdc9cce72e2aea2f2886cb961c4b241d7 Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Wed, 22 Nov 2023 14:06:37 +0530 Subject: [PATCH 04/37] fix: change solidity comment --- src/bridge/BitcoinTx.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bridge/BitcoinTx.sol b/src/bridge/BitcoinTx.sol index 9bf95403..0ea9016c 100644 --- a/src/bridge/BitcoinTx.sol +++ b/src/bridge/BitcoinTx.sol @@ -11,7 +11,7 @@ import {ValidateSPV} from "@bob-collective/bitcoin-spv/ValidateSPV.sol"; import "./BridgeState.sol"; /// @title Bitcoin transaction -/// @notice Allows to reference Bitcoin raw transaction in Solidity. +/// @notice Allows to reference Bitcoin raw transaction in Solidity /// @dev See https://developer.bitcoin.org/reference/transactions.html#raw-transaction-format // Raw Bitcoin transaction data: // | Bytes | Name | BTC type | Description | From 2eb9cd3bcaab6eeef0d7ed73bcdf3a415c541d2a Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Wed, 22 Nov 2023 14:40:21 +0530 Subject: [PATCH 05/37] fix: revert changes done to ci --- .github/workflows/test.yml | 5 ----- src/bridge/BitcoinTx.sol | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b96dfb4f..b02e156d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,11 +33,6 @@ jobs: forge build --sizes id: build - - name: Run Forge doc - run: | - forge doc --out docs/docs/contracts - id: doc - - name: Run Forge tests run: | forge test -vvv diff --git a/src/bridge/BitcoinTx.sol b/src/bridge/BitcoinTx.sol index 0ea9016c..9bf95403 100644 --- a/src/bridge/BitcoinTx.sol +++ b/src/bridge/BitcoinTx.sol @@ -11,7 +11,7 @@ import {ValidateSPV} from "@bob-collective/bitcoin-spv/ValidateSPV.sol"; import "./BridgeState.sol"; /// @title Bitcoin transaction -/// @notice Allows to reference Bitcoin raw transaction in Solidity +/// @notice Allows to reference Bitcoin raw transaction in Solidity. /// @dev See https://developer.bitcoin.org/reference/transactions.html#raw-transaction-format // Raw Bitcoin transaction data: // | Bytes | Name | BTC type | Description | From b1d2e344f73495bf4b7b0690a66a25fa4693d0c3 Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Wed, 22 Nov 2023 19:12:02 +0530 Subject: [PATCH 06/37] fix: change label remove summary --- docs/docs/contracts/src/SUMMARY.md | 19 ------------------- docs/docs/contracts/src/src/bridge/README.md | 7 ------- docs/docs/contracts/src/src/relay/README.md | 8 -------- docs/docs/contracts/src/src/swap/README.md | 7 ------- docs/docusaurus.config.js | 2 +- 5 files changed, 1 insertion(+), 42 deletions(-) delete mode 100644 docs/docs/contracts/src/SUMMARY.md delete mode 100644 docs/docs/contracts/src/src/bridge/README.md delete mode 100644 docs/docs/contracts/src/src/relay/README.md delete mode 100644 docs/docs/contracts/src/src/swap/README.md diff --git a/docs/docs/contracts/src/SUMMARY.md b/docs/docs/contracts/src/SUMMARY.md deleted file mode 100644 index 61440d3b..00000000 --- a/docs/docs/contracts/src/SUMMARY.md +++ /dev/null @@ -1,19 +0,0 @@ -# Summary -- [Home](README.md) -# src - - [❱ bridge](src/bridge/README.md) - - [BitcoinTx](src/bridge/BitcoinTx.sol/library.BitcoinTx.md) - - [BridgeState](src/bridge/BridgeState.sol/library.BridgeState.md) - - [IRelay](src/bridge/IRelay.sol/interface.IRelay.md) - - [WitnessTx](src/bridge/WitnessTx.sol/library.WitnessTx.md) - - [❱ relay](src/relay/README.md) - - [DummyRelay](src/relay/DummyRelay.sol/contract.DummyRelay.md) - - [Epoch](src/relay/LightRelay.sol/struct.Epoch.md) - - [ILightRelay](src/relay/LightRelay.sol/interface.ILightRelay.md) - - [RelayUtils](src/relay/LightRelay.sol/library.RelayUtils.md) - - [LightRelay](src/relay/LightRelay.sol/contract.LightRelay.md) - - [❱ swap](src/swap/README.md) - - [Bridge](src/swap/Bridge.sol/contract.Bridge.md) - - [BtcMarketPlace](src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md) - - [MarketPlace](src/swap/Marketplace.sol/contract.MarketPlace.md) - - [BobWrappedBtc](src/swap/Wrapped.sol/contract.BobWrappedBtc.md) diff --git a/docs/docs/contracts/src/src/bridge/README.md b/docs/docs/contracts/src/src/bridge/README.md deleted file mode 100644 index 0fda2c04..00000000 --- a/docs/docs/contracts/src/src/bridge/README.md +++ /dev/null @@ -1,7 +0,0 @@ - - -# Contents -- [BitcoinTx](BitcoinTx.sol/library.BitcoinTx.md) -- [BridgeState](BridgeState.sol/library.BridgeState.md) -- [IRelay](IRelay.sol/interface.IRelay.md) -- [WitnessTx](WitnessTx.sol/library.WitnessTx.md) diff --git a/docs/docs/contracts/src/src/relay/README.md b/docs/docs/contracts/src/src/relay/README.md deleted file mode 100644 index fe076483..00000000 --- a/docs/docs/contracts/src/src/relay/README.md +++ /dev/null @@ -1,8 +0,0 @@ - - -# Contents -- [DummyRelay](DummyRelay.sol/contract.DummyRelay.md) -- [Epoch](LightRelay.sol/struct.Epoch.md) -- [ILightRelay](LightRelay.sol/interface.ILightRelay.md) -- [RelayUtils](LightRelay.sol/library.RelayUtils.md) -- [LightRelay](LightRelay.sol/contract.LightRelay.md) diff --git a/docs/docs/contracts/src/src/swap/README.md b/docs/docs/contracts/src/src/swap/README.md deleted file mode 100644 index cbed71f4..00000000 --- a/docs/docs/contracts/src/src/swap/README.md +++ /dev/null @@ -1,7 +0,0 @@ - - -# Contents -- [Bridge](Bridge.sol/contract.Bridge.md) -- [BtcMarketPlace](Btc_Marketplace.sol/contract.BtcMarketPlace.md) -- [MarketPlace](Marketplace.sol/contract.MarketPlace.md) -- [BobWrappedBtc](Wrapped.sol/contract.BobWrappedBtc.md) diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index d333208c..a573f24f 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -102,7 +102,7 @@ const config = { type: "docSidebar", sidebarId: "contractSidebar", position: "left", - label: "Contract", + label: "Contracts", }, { href: DISCORD, From cebdda1540fcce89f17d600bd2a84828c8c85ba6 Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Thu, 23 Nov 2023 11:09:04 +0530 Subject: [PATCH 07/37] fix: update contract docs --- .../src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md | 2 +- .../src/src/bridge/BridgeState.sol/library.BridgeState.md | 2 +- .../contracts/src/src/bridge/IRelay.sol/interface.IRelay.md | 2 +- .../src/src/bridge/WitnessTx.sol/library.WitnessTx.md | 2 +- .../src/src/relay/DummyRelay.sol/contract.DummyRelay.md | 6 +++--- .../src/src/relay/LightRelay.sol/contract.LightRelay.md | 6 +++--- .../src/src/relay/LightRelay.sol/interface.ILightRelay.md | 6 +++--- .../src/src/relay/LightRelay.sol/library.RelayUtils.md | 2 +- .../contracts/src/src/relay/LightRelay.sol/struct.Epoch.md | 2 +- .../contracts/src/src/swap/Bridge.sol/contract.Bridge.md | 2 +- .../src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md | 2 +- .../src/src/swap/Marketplace.sol/contract.MarketPlace.md | 2 +- .../src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md | 2 +- 13 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md index 56168b47..34bf49c3 100644 --- a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md +++ b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md @@ -1,5 +1,5 @@ # BitcoinTx -[Git Source](https://github.com/bob-collective/bob/blob/d9da9844231f0238dc8154200871bc3b4af31769/src/bridge/BitcoinTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/bridge/BitcoinTx.sol) Allows to reference Bitcoin raw transaction in Solidity. diff --git a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md index 25593a89..a0c41681 100644 --- a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md +++ b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md @@ -1,5 +1,5 @@ # BridgeState -[Git Source](https://github.com/bob-collective/bob/blob/d9da9844231f0238dc8154200871bc3b4af31769/src/bridge/BridgeState.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/bridge/BridgeState.sol) ## Structs diff --git a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md index 2abad141..6fb30f61 100644 --- a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md +++ b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md @@ -1,5 +1,5 @@ # IRelay -[Git Source](https://github.com/bob-collective/bob/blob/d9da9844231f0238dc8154200871bc3b4af31769/src/bridge/IRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/bridge/IRelay.sol) Contains only the methods needed by tBTC v2. The Bitcoin relay provides the difficulty of the previous and current epoch. One diff --git a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md index 2e587bbc..28a4ae9e 100644 --- a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md +++ b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md @@ -1,5 +1,5 @@ # WitnessTx -[Git Source](https://github.com/bob-collective/bob/blob/d9da9844231f0238dc8154200871bc3b4af31769/src/bridge/WitnessTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/bridge/WitnessTx.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/relay/DummyRelay.sol/contract.DummyRelay.md b/docs/docs/contracts/src/src/relay/DummyRelay.sol/contract.DummyRelay.md index ae0796de..cd8483a6 100644 --- a/docs/docs/contracts/src/src/relay/DummyRelay.sol/contract.DummyRelay.md +++ b/docs/docs/contracts/src/src/relay/DummyRelay.sol/contract.DummyRelay.md @@ -1,9 +1,9 @@ # DummyRelay -[Git Source](https://github.com/bob-collective/bob/blob/d9da9844231f0238dc8154200871bc3b4af31769/src/relay/DummyRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/relay/DummyRelay.sol) -[//]: # (**Inherits:**) +**Inherits:** -[//]: # ([IRelay](/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md)) +[IRelay](../../bridge/IRelay.sol/interface.IRelay.md) *DEV-only!* diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md index a18a0a98..c3728c96 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md @@ -1,9 +1,9 @@ # LightRelay -[Git Source](https://github.com/bob-collective/bob/blob/d9da9844231f0238dc8154200871bc3b4af31769/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/relay/LightRelay.sol) -[//]: # (**Inherits:**) +**Inherits:** -[//]: # (Ownable, [ILightRelay](/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md)) +Ownable, [ILightRelay](../../relay/LightRelay.sol/interface.ILightRelay.md) *THE RELAY MUST NOT BE USED BEFORE GENESIS AND AT LEAST ONE RETARGET.* diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md index 7135d7bb..bc30c774 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md @@ -1,9 +1,9 @@ # ILightRelay -[Git Source](https://github.com/bob-collective/bob/blob/d9da9844231f0238dc8154200871bc3b4af31769/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/relay/LightRelay.sol) -[//]: # (**Inherits:**) +**Inherits:** -[//]: # ([IRelay](/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md)) +[IRelay](../../bridge/IRelay.sol/interface.IRelay.md) ## Functions diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md index b36577a8..23c3b5dd 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md @@ -1,5 +1,5 @@ # RelayUtils -[Git Source](https://github.com/bob-collective/bob/blob/d9da9844231f0238dc8154200871bc3b4af31769/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/relay/LightRelay.sol) ## Functions diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md index 7261c72d..a7e80692 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md @@ -1,5 +1,5 @@ # Epoch -[Git Source](https://github.com/bob-collective/bob/blob/d9da9844231f0238dc8154200871bc3b4af31769/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/relay/LightRelay.sol) ```solidity diff --git a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md index 75017ede..d3487baf 100644 --- a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md +++ b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md @@ -1,5 +1,5 @@ # Bridge -[Git Source](https://github.com/bob-collective/bob/blob/d9da9844231f0238dc8154200871bc3b4af31769/src/swap/Bridge.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/swap/Bridge.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md index ad21e1d7..96ff3a11 100644 --- a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md @@ -1,5 +1,5 @@ # BtcMarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/d9da9844231f0238dc8154200871bc3b4af31769/src/swap/Btc_Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/swap/Btc_Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md index 33c2fc5a..f598ef09 100644 --- a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md @@ -1,5 +1,5 @@ # MarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/d9da9844231f0238dc8154200871bc3b4af31769/src/swap/Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/swap/Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md index 1d262e5b..6bc13267 100644 --- a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md +++ b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md @@ -1,5 +1,5 @@ # BobWrappedBtc -[Git Source](https://github.com/bob-collective/bob/blob/d9da9844231f0238dc8154200871bc3b4af31769/src/swap/Wrapped.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/swap/Wrapped.sol) **Inherits:** ERC20, ERC20Burnable, Ownable From 889506fd23c2370b43d5e2fa44894978ff8df367 Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Sat, 25 Nov 2023 16:37:35 +0530 Subject: [PATCH 08/37] fix: py script added to modify docs --- docs/docs/contracts/src/README.md | 48 -------------- .../bridge/BitcoinTx.sol/library.BitcoinTx.md | 2 +- .../BridgeState.sol/library.BridgeState.md | 2 +- .../src/bridge/IRelay.sol/interface.IRelay.md | 2 +- .../bridge/WitnessTx.sol/library.WitnessTx.md | 2 +- .../DummyRelay.sol/contract.DummyRelay.md | 3 +- .../LightRelay.sol/contract.LightRelay.md | 3 +- .../LightRelay.sol/interface.ILightRelay.md | 3 +- .../LightRelay.sol/library.RelayUtils.md | 2 +- .../src/relay/LightRelay.sol/struct.Epoch.md | 2 +- .../src/swap/Bridge.sol/contract.Bridge.md | 2 +- .../contract.BtcMarketPlace.md | 2 +- .../Marketplace.sol/contract.MarketPlace.md | 2 +- .../Wrapped.sol/contract.BobWrappedBtc.md | 2 +- python_script/refactor_doc.py | 63 +++++++++++++++++++ 15 files changed, 76 insertions(+), 64 deletions(-) delete mode 100644 docs/docs/contracts/src/README.md create mode 100644 python_script/refactor_doc.py diff --git a/docs/docs/contracts/src/README.md b/docs/docs/contracts/src/README.md deleted file mode 100644 index 6b91b9cc..00000000 --- a/docs/docs/contracts/src/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# Build on Bitcoin - -BOB is a Bitcoin-augmented rollup bringing experimentation and freedom of choice to builders to make a real-world impact. BOBs vision is to onboard the next billion users to Bitcoin. - -## Learn more - -- [Website](https://www.gobob.xyz/) -- [Docs](https://docs.gobob.xyz/) - -## Contribution - -BOB is an open-source project. We welcome contributions of all sorts. There are many ways to help, from reporting issues, contributing code, and helping us improve our community. - -## Getting Started - -We use foundry extensively for maintaining and testing this contract suite: - -### Build - -```shell -$ forge build -``` - -### Test - -```shell -$ forge test -``` - -### Format - -```shell -$ forge fmt -``` - -## Local Testnet - -To deploy the relay contract to a local environment for testing use our convenience script [here](https://github.com/bob-collective/bob/blob/master/sdk/scripts/init-bridge.ts): - -```shell -# start local ethereum testnet node -docker-compose up anvil -# run script to deploy the relay contract -cd sdk -yarn run deploy-relay --init-height 2016 --private-key dev-0 --dev --network testnet -``` - -The initialization height should be a multiple of 2016 with at least one subsequent retarget (i.e. if using 2016 as the starting height, blocks 4031-4032 must exist). \ No newline at end of file diff --git a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md index 34bf49c3..11fb05b4 100644 --- a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md +++ b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md @@ -1,5 +1,5 @@ # BitcoinTx -[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/bridge/BitcoinTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/cebdda1540fcce89f17d600bd2a84828c8c85ba6/src/bridge/BitcoinTx.sol) Allows to reference Bitcoin raw transaction in Solidity. diff --git a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md index a0c41681..4ded601b 100644 --- a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md +++ b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md @@ -1,5 +1,5 @@ # BridgeState -[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/bridge/BridgeState.sol) +[Git Source](https://github.com/bob-collective/bob/blob/cebdda1540fcce89f17d600bd2a84828c8c85ba6/src/bridge/BridgeState.sol) ## Structs diff --git a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md index 6fb30f61..d6be5e30 100644 --- a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md +++ b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md @@ -1,5 +1,5 @@ # IRelay -[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/bridge/IRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/cebdda1540fcce89f17d600bd2a84828c8c85ba6/src/bridge/IRelay.sol) Contains only the methods needed by tBTC v2. The Bitcoin relay provides the difficulty of the previous and current epoch. One diff --git a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md index 28a4ae9e..7857cf8a 100644 --- a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md +++ b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md @@ -1,5 +1,5 @@ # WitnessTx -[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/bridge/WitnessTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/cebdda1540fcce89f17d600bd2a84828c8c85ba6/src/bridge/WitnessTx.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/relay/DummyRelay.sol/contract.DummyRelay.md b/docs/docs/contracts/src/src/relay/DummyRelay.sol/contract.DummyRelay.md index cd8483a6..1a8a131a 100644 --- a/docs/docs/contracts/src/src/relay/DummyRelay.sol/contract.DummyRelay.md +++ b/docs/docs/contracts/src/src/relay/DummyRelay.sol/contract.DummyRelay.md @@ -1,8 +1,7 @@ # DummyRelay -[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/relay/DummyRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/cebdda1540fcce89f17d600bd2a84828c8c85ba6/src/relay/DummyRelay.sol) **Inherits:** - [IRelay](../../bridge/IRelay.sol/interface.IRelay.md) *DEV-only!* diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md index c3728c96..d5208cb4 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md @@ -1,8 +1,7 @@ # LightRelay -[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/cebdda1540fcce89f17d600bd2a84828c8c85ba6/src/relay/LightRelay.sol) **Inherits:** - Ownable, [ILightRelay](../../relay/LightRelay.sol/interface.ILightRelay.md) *THE RELAY MUST NOT BE USED BEFORE GENESIS AND AT LEAST ONE RETARGET.* diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md index bc30c774..e5d2afd9 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md @@ -1,8 +1,7 @@ # ILightRelay -[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/cebdda1540fcce89f17d600bd2a84828c8c85ba6/src/relay/LightRelay.sol) **Inherits:** - [IRelay](../../bridge/IRelay.sol/interface.IRelay.md) diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md index 23c3b5dd..e2b3ba61 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md @@ -1,5 +1,5 @@ # RelayUtils -[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/cebdda1540fcce89f17d600bd2a84828c8c85ba6/src/relay/LightRelay.sol) ## Functions diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md index a7e80692..6c9faaae 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md @@ -1,5 +1,5 @@ # Epoch -[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/cebdda1540fcce89f17d600bd2a84828c8c85ba6/src/relay/LightRelay.sol) ```solidity diff --git a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md index d3487baf..f70351ee 100644 --- a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md +++ b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md @@ -1,5 +1,5 @@ # Bridge -[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/swap/Bridge.sol) +[Git Source](https://github.com/bob-collective/bob/blob/cebdda1540fcce89f17d600bd2a84828c8c85ba6/src/swap/Bridge.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md index 96ff3a11..806f7b7d 100644 --- a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md @@ -1,5 +1,5 @@ # BtcMarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/swap/Btc_Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/cebdda1540fcce89f17d600bd2a84828c8c85ba6/src/swap/Btc_Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md index f598ef09..403b043e 100644 --- a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md @@ -1,5 +1,5 @@ # MarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/swap/Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/cebdda1540fcce89f17d600bd2a84828c8c85ba6/src/swap/Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md index 6bc13267..d9b95fcf 100644 --- a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md +++ b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md @@ -1,5 +1,5 @@ # BobWrappedBtc -[Git Source](https://github.com/bob-collective/bob/blob/b1d2e344f73495bf4b7b0690a66a25fa4693d0c3/src/swap/Wrapped.sol) +[Git Source](https://github.com/bob-collective/bob/blob/cebdda1540fcce89f17d600bd2a84828c8c85ba6/src/swap/Wrapped.sol) **Inherits:** ERC20, ERC20Burnable, Ownable diff --git a/python_script/refactor_doc.py b/python_script/refactor_doc.py new file mode 100644 index 00000000..f343098c --- /dev/null +++ b/python_script/refactor_doc.py @@ -0,0 +1,63 @@ +import os +import re + +# Function to parse the Inherits line in the Markdown content +def parse_inherits(md_content): + inherits_match = re.search(r'\*\*Inherits:\*\*\s*([\s\S]*?)\n', md_content) + if inherits_match: + inheritances = inherits_match.group(1).strip() + return inheritances + return None + +# Function to replace paths inside brackets with empty brackets +def replace_paths_with_empty_brackets(line): + def replace_path(match): + default_path = 'docs/docs/src' + path = default_path + match.group(0)[1:-1] # Remove parentheses + start = "docs/docs/src/src/X/X/" + relative_path = os.path.relpath(path, start) + print(f"Original Path: {relative_path}") + return '(' + relative_path + ')' + return re.sub(r'\([^)]+\)', replace_path, line) + +# Function to process a single Markdown file +def process_md_file(file_path): + with open(file_path, 'r') as file: + md_content = file.read() + + # Parse Inherits line + inherits = parse_inherits(md_content) + + # Modify the Inherits line + if inherits: + modified_inherits = replace_paths_with_empty_brackets(inherits) + md_content = md_content.replace(inherits, modified_inherits) + + # Write the modified content back to the original file + with open(file_path, 'w') as file: + file.write(md_content) + + print(f"File modified: {file_path}") + + # Check if the file name is README.md or SUMMARY.md and delete it + file_name = os.path.basename(file_path) + if file_name.lower() in ['readme.md', 'summary.md']: + os.remove(file_path) + print(f"Deleted file: {file_path}") + +# Main function to process all Markdown files in a directory and its subdirectories +def process_all_md_files(directory): + for root, dirs, files in os.walk(directory): + for file in files: + if file.endswith('.md'): + file_path = os.path.join(root, file) + process_md_file(file_path) + +if __name__ == "__main__": + # Specify the directory path + directory_path = '../docs/docs/contracts/src' + + # Process all Markdown files in the specified directory and its subdirectories + process_all_md_files(directory_path) + + print("All Markdown files in the directory processed.") From 058250265e0127c1757b0494e385db96fdfd6c04 Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Sat, 25 Nov 2023 17:22:23 +0530 Subject: [PATCH 09/37] ci: fix formatting --- src/swap/Btc_Marketplace.sol | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/swap/Btc_Marketplace.sol b/src/swap/Btc_Marketplace.sol index 505442e1..275a0b58 100644 --- a/src/swap/Btc_Marketplace.sol +++ b/src/swap/Btc_Marketplace.sol @@ -298,7 +298,7 @@ contract BtcMarketPlace { } BtcSellOrder[] memory ret = new BtcSellOrder[](numOpenOrders); - uint256[] memory identifiers = new uint[](numOpenOrders); + uint256[] memory identifiers = new uint256[](numOpenOrders); uint256 numPushed = 0; for (uint256 i = 0; i < nextOrderId; i++) { if (btcSellOrders[i].requester != address(0x0)) { @@ -318,10 +318,8 @@ contract BtcMarketPlace { } } - AcceptedBtcSellOrder[] memory ret = new AcceptedBtcSellOrder[]( - numOpenOrders - ); - uint256[] memory identifiers = new uint[](numOpenOrders); + AcceptedBtcSellOrder[] memory ret = new AcceptedBtcSellOrder[](numOpenOrders); + uint256[] memory identifiers = new uint256[](numOpenOrders); uint256 numPushed = 0; for (uint256 i = 0; i < nextOrderId; i++) { if (acceptedBtcSellOrders[i].amountBtc > 0) { @@ -342,7 +340,7 @@ contract BtcMarketPlace { } BtcBuyOrder[] memory ret = new BtcBuyOrder[](numOpenOrders); - uint256[] memory identifiers = new uint[](numOpenOrders); + uint256[] memory identifiers = new uint256[](numOpenOrders); uint256 numPushed = 0; for (uint256 i = 0; i < nextOrderId; i++) { if (btcBuyOrders[i].requester != address(0x0)) { @@ -362,10 +360,8 @@ contract BtcMarketPlace { } } - AcceptedBtcBuyOrder[] memory ret = new AcceptedBtcBuyOrder[]( - numOpenOrders - ); - uint256[] memory identifiers = new uint[](numOpenOrders); + AcceptedBtcBuyOrder[] memory ret = new AcceptedBtcBuyOrder[](numOpenOrders); + uint256[] memory identifiers = new uint256[](numOpenOrders); uint256 numPushed = 0; for (uint256 i = 0; i < nextOrderId; i++) { if (acceptedBtcBuyOrders[i].amountBtc > 0) { From 033d654f1439155f7b476738eadeae04027f7afe Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Sat, 25 Nov 2023 17:33:54 +0530 Subject: [PATCH 10/37] fix: add comment --- .../forge_doc_reformat.py | 6 ++++++ 1 file changed, 6 insertions(+) rename python_script/refactor_doc.py => docs_reformat_scripts/forge_doc_reformat.py (88%) diff --git a/python_script/refactor_doc.py b/docs_reformat_scripts/forge_doc_reformat.py similarity index 88% rename from python_script/refactor_doc.py rename to docs_reformat_scripts/forge_doc_reformat.py index f343098c..b95d1dea 100644 --- a/python_script/refactor_doc.py +++ b/docs_reformat_scripts/forge_doc_reformat.py @@ -1,3 +1,9 @@ +""" +This Python script is designed to modify the Markdown files generated by the 'forge doc' command. +The 'forge doc' command doesn't return the docs in the right format for Docusaurus. +Therefore, run this script before publishing the doc to make it compatible with Docusaurus. +""" + import os import re From 8bd56c97d4cd314048c18508d8fd4a944c4d4d72 Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Sat, 25 Nov 2023 17:34:27 +0530 Subject: [PATCH 11/37] fix: modify comment --- docs_reformat_scripts/forge_doc_reformat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs_reformat_scripts/forge_doc_reformat.py b/docs_reformat_scripts/forge_doc_reformat.py index b95d1dea..998bcf44 100644 --- a/docs_reformat_scripts/forge_doc_reformat.py +++ b/docs_reformat_scripts/forge_doc_reformat.py @@ -1,6 +1,6 @@ """ This Python script is designed to modify the Markdown files generated by the 'forge doc' command. -The 'forge doc' command doesn't return the docs in the right format for Docusaurus. +The 'forge doc --out docs/docs/contracts' command doesn't return the docs in the right format for Docusaurus. Therefore, run this script before publishing the doc to make it compatible with Docusaurus. """ From 27d6d5c4f13e57667bb89c8c157b43897244430e Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Sat, 25 Nov 2023 18:40:50 +0530 Subject: [PATCH 12/37] fix: modify comment --- docs_reformat_scripts/forge_doc_reformat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs_reformat_scripts/forge_doc_reformat.py b/docs_reformat_scripts/forge_doc_reformat.py index 998bcf44..1027feb0 100644 --- a/docs_reformat_scripts/forge_doc_reformat.py +++ b/docs_reformat_scripts/forge_doc_reformat.py @@ -1,7 +1,7 @@ """ This Python script is designed to modify the Markdown files generated by the 'forge doc' command. The 'forge doc --out docs/docs/contracts' command doesn't return the docs in the right format for Docusaurus. -Therefore, run this script before publishing the doc to make it compatible with Docusaurus. +Therefore, run this script after running the `forge doc --out docs/docs/contracts` & before publishing the doc to make it compatible with Docusaurus. """ import os From 5f4b0e7f41a14214d588ecb121f8a27dd5b22925 Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Wed, 29 Nov 2023 15:23:56 +0530 Subject: [PATCH 13/37] fix: remove contracts dir --- contracts/hello-zkvm | 1 - 1 file changed, 1 deletion(-) delete mode 160000 contracts/hello-zkvm diff --git a/contracts/hello-zkvm b/contracts/hello-zkvm deleted file mode 160000 index 8a783d30..00000000 --- a/contracts/hello-zkvm +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8a783d30bb92226fe3b72dc514486b9f045fcf07 From 3c2d30ec56eddb2026f4d2799c6536df726ae114 Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Tue, 5 Dec 2023 13:48:30 +0530 Subject: [PATCH 14/37] fix: remove contracts docs --- .gitignore | 4 +- docs/docs/contracts/book.css | 13 - docs/docs/contracts/book.toml | 12 - docs/docs/contracts/solidity.min.js | 74 ---- .../bridge/BitcoinTx.sol/library.BitcoinTx.md | 138 ------ .../BridgeState.sol/library.BridgeState.md | 14 - .../src/bridge/IRelay.sol/interface.IRelay.md | 36 -- .../bridge/WitnessTx.sol/library.WitnessTx.md | 99 ----- .../DummyRelay.sol/contract.DummyRelay.md | 31 -- .../LightRelay.sol/contract.LightRelay.md | 398 ------------------ .../LightRelay.sol/interface.ILightRelay.md | 83 ---- .../LightRelay.sol/library.RelayUtils.md | 30 -- .../src/relay/LightRelay.sol/struct.Epoch.md | 11 - .../src/swap/Bridge.sol/contract.Bridge.md | 159 ------- .../contract.BtcMarketPlace.md | 306 -------------- .../Marketplace.sol/contract.MarketPlace.md | 87 ---- .../Wrapped.sol/contract.BobWrappedBtc.md | 36 -- 17 files changed, 3 insertions(+), 1528 deletions(-) delete mode 100644 docs/docs/contracts/book.css delete mode 100644 docs/docs/contracts/book.toml delete mode 100644 docs/docs/contracts/solidity.min.js delete mode 100644 docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md delete mode 100644 docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md delete mode 100644 docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md delete mode 100644 docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md delete mode 100644 docs/docs/contracts/src/src/relay/DummyRelay.sol/contract.DummyRelay.md delete mode 100644 docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md delete mode 100644 docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md delete mode 100644 docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md delete mode 100644 docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md delete mode 100644 docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md delete mode 100644 docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md delete mode 100644 docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md delete mode 100644 docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md diff --git a/.gitignore b/.gitignore index 83b39d9c..d960e46b 100644 --- a/.gitignore +++ b/.gitignore @@ -39,4 +39,6 @@ out/ node_modules/* # generated docs -/docs/docs/api/* \ No newline at end of file +/docs/docs/api/* + +/docs/docs/contracts/* \ No newline at end of file diff --git a/docs/docs/contracts/book.css b/docs/docs/contracts/book.css deleted file mode 100644 index b5ce903f..00000000 --- a/docs/docs/contracts/book.css +++ /dev/null @@ -1,13 +0,0 @@ -table { - margin: 0 auto; - border-collapse: collapse; - width: 100%; -} - -table td:first-child { - width: 15%; -} - -table td:nth-child(2) { - width: 25%; -} \ No newline at end of file diff --git a/docs/docs/contracts/book.toml b/docs/docs/contracts/book.toml deleted file mode 100644 index 353bd356..00000000 --- a/docs/docs/contracts/book.toml +++ /dev/null @@ -1,12 +0,0 @@ -[book] -src = "src" -title = "" - -[output.html] -no-section-label = true -additional-js = ["solidity.min.js"] -additional-css = ["book.css"] -git-repository-url = "https://github.com/bob-collective/bob" - -[output.html.fold] -enable = true diff --git a/docs/docs/contracts/solidity.min.js b/docs/docs/contracts/solidity.min.js deleted file mode 100644 index 19249329..00000000 --- a/docs/docs/contracts/solidity.min.js +++ /dev/null @@ -1,74 +0,0 @@ -hljs.registerLanguage("solidity",(()=>{"use strict";function e(){try{return!0 -}catch(e){return!1}} -var a=/-?(\b0[xX]([a-fA-F0-9]_?)*[a-fA-F0-9]|(\b[1-9](_?\d)*(\.((\d_?)*\d)?)?|\.\d(_?\d)*)([eE][-+]?\d(_?\d)*)?|\b0)(?!\w|\$)/ -;e()&&(a=a.source.replace(/\\b/g,"(?{ -var a=r(e),o=l(e),c=/[A-Za-z_$][A-Za-z_$0-9.]*/,d=e.inherit(e.TITLE_MODE,{ -begin:/[A-Za-z$_][0-9A-Za-z$_]*/,lexemes:c,keywords:n}),u={className:"params", -begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,lexemes:c,keywords:n, -contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,o,s]},_={ -className:"operator",begin:/:=|->/};return{keywords:n,lexemes:c, -contains:[a,o,i,t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s,_,{ -className:"function",lexemes:c,beginKeywords:"function",end:"{",excludeEnd:!0, -contains:[d,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,_]}]}}, -solAposStringMode:r,solQuoteStringMode:l,HEX_APOS_STRING_MODE:i, -HEX_QUOTE_STRING_MODE:t,SOL_NUMBER:s,isNegativeLookbehindAvailable:e} -;const{baseAssembly:c,solAposStringMode:d,solQuoteStringMode:u,HEX_APOS_STRING_MODE:_,HEX_QUOTE_STRING_MODE:m,SOL_NUMBER:b,isNegativeLookbehindAvailable:E}=o -;return e=>{for(var a=d(e),s=u(e),n=[],i=0;i<32;i++)n[i]=i+1 -;var t=n.map((e=>8*e)),r=[];for(i=0;i<=80;i++)r[i]=i -;var l=n.map((e=>"bytes"+e)).join(" ")+" ",o=t.map((e=>"uint"+e)).join(" ")+" ",g=t.map((e=>"int"+e)).join(" ")+" ",M=[].concat.apply([],t.map((e=>r.map((a=>e+"x"+a))))),p={ -keyword:"var bool string int uint "+g+o+"byte bytes "+l+"fixed ufixed "+M.map((e=>"fixed"+e)).join(" ")+" "+M.map((e=>"ufixed"+e)).join(" ")+" enum struct mapping address new delete if else for while continue break return throw emit try catch revert unchecked _ function modifier event constructor fallback receive error virtual override constant immutable anonymous indexed storage memory calldata external public internal payable pure view private returns import from as using pragma contract interface library is abstract type assembly", -literal:"true false wei gwei szabo finney ether seconds minutes hours days weeks years", -built_in:"self this super selfdestruct suicide now msg block tx abi blockhash gasleft assert require Error Panic sha3 sha256 keccak256 ripemd160 ecrecover addmod mulmod log0 log1 log2 log3 log4" -},O={className:"operator",begin:/[+\-!~*\/%<>&^|=]/ -},C=/[A-Za-z_$][A-Za-z_$0-9]*/,N={className:"params",begin:/\(/,end:/\)/, -excludeBegin:!0,excludeEnd:!0,lexemes:C,keywords:p, -contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,s,b,"self"]},f={ -begin:/\.\s*/,end:/[^A-Za-z0-9$_\.]/,excludeBegin:!0,excludeEnd:!0,keywords:{ -built_in:"gas value selector address length push pop send transfer call callcode delegatecall staticcall balance code codehash wrap unwrap name creationCode runtimeCode interfaceId min max" -},relevance:2},y=e.inherit(e.TITLE_MODE,{begin:/[A-Za-z$_][0-9A-Za-z$_]*/, -lexemes:C,keywords:p}),w={className:"built_in", -begin:(E()?"(? Epoch) internal epochs; -``` - - -### isAuthorized - -```solidity -mapping(address => bool) public isAuthorized; -``` - - -## Functions -### relayActive - - -```solidity -modifier relayActive(); -``` - -### genesis - -Establish a starting point for the relay by providing the -target, timestamp and blockheight of the first block of the relay -genesis epoch. - -*If the relay is used by querying the current and previous epoch -difficulty, at least one retarget needs to be provided after genesis; -otherwise the prevEpochDifficulty will be uninitialised and zero.* - - -```solidity -function genesis(bytes calldata genesisHeader, uint256 genesisHeight, uint64 genesisProofLength) external onlyOwner; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`genesisHeader`|`bytes`|The first block header of the genesis epoch.| -|`genesisHeight`|`uint256`|The block number of the first block of the epoch.| -|`genesisProofLength`|`uint64`|The number of blocks required to accept a proof.| - - -### setProofLength - -Set the number of blocks required to accept a header chain. - -*For production, a high number (e.g. 20-50) is recommended. -Small numbers are accepted but should only be used for testing.* - - -```solidity -function setProofLength(uint64 newLength) external relayActive onlyOwner; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`newLength`|`uint64`|The required number of blocks. Must be less than 2016.| - - -### setAuthorizationStatus - -Set whether the relay requires retarget submitters to be -pre-authorised by governance. - - -```solidity -function setAuthorizationStatus(bool status) external onlyOwner; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`status`|`bool`|True if authorisation is to be required, false if not.| - - -### authorize - -Authorise the given address to submit retarget proofs. - - -```solidity -function authorize(address submitter) external onlyOwner; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`submitter`|`address`|The address to be authorised.| - - -### deauthorize - -Rescind the authorisation of the submitter to retarget. - - -```solidity -function deauthorize(address submitter) external onlyOwner; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`submitter`|`address`|The address to be deauthorised.| - - -### retarget - -Add a new epoch to the relay by providing a proof -of the difficulty before and after the retarget. - -*Checks that the first X blocks are valid in the most recent epoch, -that the difficulty of the new epoch is calculated correctly according -to the block timestamps, and that the next X blocks would be valid in -the new epoch. -We have no information of block heights, so we cannot enforce that -retargets only happen every 2016 blocks; instead, we assume that this -is the case if a valid proof of work is provided. -It is possible to cheat the relay by providing X blocks from earlier in -the most recent epoch, and then mining X new blocks after them. -However, each of these malicious blocks would have to be mined to a -higher difficulty than the legitimate ones. -Alternatively, if the retarget has not been performed yet, one could -first mine X blocks in the old difficulty with timestamps set far in -the future, and then another X blocks at a greatly reduced difficulty. -In either case, cheating the relay requires more work than mining X -legitimate blocks. -Only the most recent epoch is vulnerable to these attacks; once a -retarget has been proven to the relay, the epoch is immutable even if a -contradictory proof were to be presented later.* - - -```solidity -function retarget(bytes memory headers) external relayActive; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`headers`|`bytes`|A chain of headers including the last X blocks before the retarget, followed by the first X blocks after the retarget, where X equals the current proof length.| - - -### validateChain - -Check whether a given chain of headers should be accepted as -valid within the rules of the relay. -If the validation fails, this function throws an exception. - -*A chain of headers is accepted as valid if: -- Its length is between 2 and 2015 headers. -- Headers in the chain are sequential and refer to previous digests. -- Each header is mined with the correct amount of work. -- The difficulty in each header matches an epoch of the relay, -as determined by the headers' timestamps. The headers must be between -the genesis epoch and the latest proven epoch (inclusive). -If the chain contains a retarget, it is accepted if the retarget has -already been proven to the relay. -If the chain contains blocks of an epoch that has not been proven to -the relay (after a retarget within the header chain, or when the entire -chain falls within an epoch that has not been proven yet), it will be -rejected. -One exception to this is when two subsequent epochs have exactly the -same difficulty; headers from the latter epoch will be accepted if the -previous epoch has been proven to the relay. -This is because it is not possible to distinguish such headers from -headers of the previous epoch. -If the difficulty increases significantly between relay genesis and the -present, creating fraudulent proofs for earlier epochs becomes easier. -Users of the relay should check the timestamps of valid headers and -only accept appropriately recent ones.* - - -```solidity -function validateChain(bytes memory headers) - external - view - returns (uint256 startingHeaderTimestamp, uint256 headerCount); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`headers`|`bytes`|A chain of 2 to 2015 bitcoin headers.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|`startingHeaderTimestamp`|`uint256`|The timestamp of the first header.| -|`headerCount`|`uint256`|The number of headers.| - - -### getBlockDifficulty - -Get the difficulty of the specified block. - - -```solidity -function getBlockDifficulty(uint256 blockNumber) external view returns (uint256); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`blockNumber`|`uint256`|The number of the block. Must fall within the relay range (at or after the relay genesis, and at or before the end of the most recent epoch proven to the relay).| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`uint256`|The difficulty of the epoch.| - - -### getRelayRange - -Get the range of blocks the relay can accept proofs for. - -*Assumes that the genesis has been set correctly. -Additionally, if the next epoch after the current one has the exact -same difficulty, headers for it can be validated as well. -This function should be used for informative purposes, -e.g. to determine whether a retarget must be provided before submitting -a header chain for validation.* - - -```solidity -function getRelayRange() external view returns (uint256 relayGenesis, uint256 currentEpochEnd); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|`relayGenesis`|`uint256`|The height of the earliest block that can be included in header chains for the relay to validate.| -|`currentEpochEnd`|`uint256`|The height of the last block that can be included in header chains for the relay to validate.| - - -### getCurrentEpochDifficulty - -Returns the difficulty of the current epoch. - -*returns 0 if the relay is not ready.* - - -```solidity -function getCurrentEpochDifficulty() external view virtual returns (uint256); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`uint256`|The difficulty of the current epoch.| - - -### getPrevEpochDifficulty - -Returns the difficulty of the previous epoch. - -*Returns 0 if the relay is not ready or has not had a retarget.* - - -```solidity -function getPrevEpochDifficulty() external view virtual returns (uint256); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`uint256`|The difficulty of the previous epoch.| - - -### getCurrentAndPrevEpochDifficulty - - -```solidity -function getCurrentAndPrevEpochDifficulty() external view returns (uint256 current, uint256 previous); -``` - -### difficultyCheckEnabled - - -```solidity -function difficultyCheckEnabled() external view returns (bool); -``` - -### getEpochDifficulty - -Get the difficulty of the specified epoch. - - -```solidity -function getEpochDifficulty(uint256 epochNumber) public view returns (uint256); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`epochNumber`|`uint256`|The number of the epoch (the height of the first block of the epoch, divided by 2016). Must fall within the relay range.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`uint256`|The difficulty of the epoch.| - - -### validateHeader - -Check that the specified header forms a correct chain with the -digest of the previous header (if provided), and has sufficient work. - -*Throws an exception if the header's chain or PoW are invalid. -Performs no other validation.* - - -```solidity -function validateHeader(bytes memory headers, uint256 start, bytes32 prevDigest) - internal - view - returns (bytes32 digest, uint256 target); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`headers`|`bytes`|The byte array containing the header of interest.| -|`start`|`uint256`|The start of the header in the array.| -|`prevDigest`|`bytes32`|The digest of the previous header (optional; providing zeros for the digest skips the check).| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|`digest`|`bytes32`|The digest of the current header.| -|`target`|`uint256`|The PoW target of the header.| - - diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md deleted file mode 100644 index e5d2afd9..00000000 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md +++ /dev/null @@ -1,83 +0,0 @@ -# ILightRelay -[Git Source](https://github.com/bob-collective/bob/blob/cebdda1540fcce89f17d600bd2a84828c8c85ba6/src/relay/LightRelay.sol) - -**Inherits:** -[IRelay](../../bridge/IRelay.sol/interface.IRelay.md) - - -## Functions -### retarget - - -```solidity -function retarget(bytes memory headers) external; -``` - -### validateChain - - -```solidity -function validateChain(bytes memory headers) - external - view - returns (uint256 startingHeaderTimestamp, uint256 headerCount); -``` - -### getBlockDifficulty - - -```solidity -function getBlockDifficulty(uint256 blockNumber) external view returns (uint256); -``` - -### getEpochDifficulty - - -```solidity -function getEpochDifficulty(uint256 epochNumber) external view returns (uint256); -``` - -### getRelayRange - - -```solidity -function getRelayRange() external view returns (uint256 relayGenesis, uint256 currentEpochEnd); -``` - -## Events -### Genesis - -```solidity -event Genesis(uint256 blockHeight); -``` - -### Retarget - -```solidity -event Retarget(uint256 oldDifficulty, uint256 newDifficulty); -``` - -### ProofLengthChanged - -```solidity -event ProofLengthChanged(uint256 newLength); -``` - -### AuthorizationRequirementChanged - -```solidity -event AuthorizationRequirementChanged(bool newStatus); -``` - -### SubmitterAuthorized - -```solidity -event SubmitterAuthorized(address submitter); -``` - -### SubmitterDeauthorized - -```solidity -event SubmitterDeauthorized(address submitter); -``` - diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md deleted file mode 100644 index e2b3ba61..00000000 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md +++ /dev/null @@ -1,30 +0,0 @@ -# RelayUtils -[Git Source](https://github.com/bob-collective/bob/blob/cebdda1540fcce89f17d600bd2a84828c8c85ba6/src/relay/LightRelay.sol) - - -## Functions -### extractTimestampAt - -Extract the timestamp of the header at the given position. - -*Assumes that the specified position contains a valid header. -Performs no validation whatsoever.* - - -```solidity -function extractTimestampAt(bytes memory headers, uint256 at) internal pure returns (uint32); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`headers`|`bytes`|Byte array containing the header of interest.| -|`at`|`uint256`|The start of the header in the array.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`uint32`|The timestamp of the header.| - - diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md deleted file mode 100644 index 6c9faaae..00000000 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md +++ /dev/null @@ -1,11 +0,0 @@ -# Epoch -[Git Source](https://github.com/bob-collective/bob/blob/cebdda1540fcce89f17d600bd2a84828c8c85ba6/src/relay/LightRelay.sol) - - -```solidity -struct Epoch { - uint32 timestamp; - uint224 target; -} -``` - diff --git a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md deleted file mode 100644 index f70351ee..00000000 --- a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md +++ /dev/null @@ -1,159 +0,0 @@ -# Bridge -[Git Source](https://github.com/bob-collective/bob/blob/cebdda1540fcce89f17d600bd2a84828c8c85ba6/src/swap/Bridge.sol) - - -## State Variables -### number - -```solidity -uint256 public number; -``` - - -### collateralThreshold - -```solidity -uint256 public collateralThreshold; -``` - - -### nextOrderId - -```solidity -uint256 nextOrderId; -``` - - -### orders - -```solidity -mapping(uint256 => Order) public orders; -``` - - -### suppliedCollateral - -```solidity -mapping(address => uint256) public suppliedCollateral; -``` - - -### totalCollateral - -```solidity -uint256 totalCollateral; -``` - - -### wrapped - -```solidity -BobWrappedBtc wrapped = new BobWrappedBtc(); -``` - - -## Functions -### constructor - - -```solidity -constructor(uint256 threshold); -``` - -### mint - -lock COL in exchange for zBTC and cCOL - - -```solidity -function mint() public payable; -``` - -### requestSwap - -request zBTC to be redeemed for given amount of BTC. - - -```solidity -function requestSwap(uint256 amountZbtc, uint256 amountBtc, BitcoinAddress calldata bitcoinAddress) public; -``` - -### acceptSwap - - -```solidity -function acceptSwap(uint256 id) public; -``` - -### cancelSwap - - -```solidity -function cancelSwap(uint256 id) public; -``` - -### executeSwap - - -```solidity -function executeSwap(uint256 id, TransactionProof calldata transactionProof) public; -``` - -### liquidate - - -```solidity -function liquidate(uint256 amountZbtc) public; -``` - -### withdraw - - -```solidity -function withdraw() public; -``` - -### colToBtc - - -```solidity -function colToBtc(uint256 collateral) internal pure returns (uint256); -``` - -### btcToCol - - -```solidity -function btcToCol(uint256 collateral) internal pure returns (uint256); -``` - -## Structs -### Order - -```solidity -struct Order { - bool open; - uint256 amountZbtc; - uint256 amountBtc; - address requesterAddress; - address accepterAddress; - BitcoinAddress bitcoinAddress; -} -``` - -### BitcoinAddress - -```solidity -struct BitcoinAddress { - uint256 bitcoinAddress; -} -``` - -### TransactionProof - -```solidity -struct TransactionProof { - uint256 dummy; -} -``` - diff --git a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md deleted file mode 100644 index 806f7b7d..00000000 --- a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md +++ /dev/null @@ -1,306 +0,0 @@ -# BtcMarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/cebdda1540fcce89f17d600bd2a84828c8c85ba6/src/swap/Btc_Marketplace.sol) - - -## State Variables -### btcBuyOrders - -```solidity -mapping(uint256 => BtcBuyOrder) public btcBuyOrders; -``` - - -### acceptedBtcBuyOrders - -```solidity -mapping(uint256 => AcceptedBtcBuyOrder) public acceptedBtcBuyOrders; -``` - - -### btcSellOrders - -```solidity -mapping(uint256 => BtcSellOrder) public btcSellOrders; -``` - - -### acceptedBtcSellOrders - -```solidity -mapping(uint256 => AcceptedBtcSellOrder) public acceptedBtcSellOrders; -``` - - -### nextOrderId - -```solidity -uint256 nextOrderId; -``` - - -### REQUEST_EXPIRATION_SECONDS - -```solidity -uint256 public constant REQUEST_EXPIRATION_SECONDS = 6 hours; -``` - - -### relay - -```solidity -BridgeState.Storage internal relay; -``` - - -## Functions -### constructor - - -```solidity -constructor(IRelay _relay); -``` - -### placeBtcSellOrder - - -```solidity -function placeBtcSellOrder(uint256 amountBtc, address buyingToken, uint256 buyAmount) public; -``` - -### acceptBtcSellOrder - - -```solidity -function acceptBtcSellOrder(uint256 id, BitcoinAddress calldata bitcoinAddress, uint256 amountBtc) - public - returns (uint256); -``` - -### proofBtcSellOrder - - -```solidity -function proofBtcSellOrder(uint256 id, BitcoinTx.Info calldata transaction, BitcoinTx.Proof calldata proof) public; -``` - -### withdrawBtcSellOrder - - -```solidity -function withdrawBtcSellOrder(uint256 id) public; -``` - -### cancelAcceptedBtcSellOrder - - -```solidity -function cancelAcceptedBtcSellOrder(uint256 id) public; -``` - -### placeBtcBuyOrder - - -```solidity -function placeBtcBuyOrder( - uint256 amountBtc, - BitcoinAddress calldata bitcoinAddress, - address sellingToken, - uint256 saleAmount -) public; -``` - -### acceptBtcBuyOrder - - -```solidity -function acceptBtcBuyOrder(uint256 id, uint256 amountBtc) public returns (uint256); -``` - -### proofBtcBuyOrder - - -```solidity -function proofBtcBuyOrder(uint256 id, BitcoinTx.Info calldata transaction, BitcoinTx.Proof calldata proof) public; -``` - -### withdrawBtcBuyOrder - - -```solidity -function withdrawBtcBuyOrder(uint256 id) public; -``` - -### cancelAcceptedBtcBuyOrder - - -```solidity -function cancelAcceptedBtcBuyOrder(uint256 id) public; -``` - -### getOpenBtcSellOrders - - -```solidity -function getOpenBtcSellOrders() external view returns (BtcSellOrder[] memory, uint256[] memory); -``` - -### getOpenAcceptedBtcSellOrders - - -```solidity -function getOpenAcceptedBtcSellOrders() external view returns (AcceptedBtcSellOrder[] memory, uint256[] memory); -``` - -### getOpenBtcBuyOrders - - -```solidity -function getOpenBtcBuyOrders() external view returns (BtcBuyOrder[] memory, uint256[] memory); -``` - -### getOpenAcceptedBtcBuyOrders - - -```solidity -function getOpenAcceptedBtcBuyOrders() external view returns (AcceptedBtcBuyOrder[] memory, uint256[] memory); -``` - -## Events -### placeBtcSellOrderEvent - -```solidity -event placeBtcSellOrderEvent(uint256 indexed orderId, uint256 amountBtc, address buyingToken, uint256 buyAmount); -``` - -### acceptBtcSellOrderEvent - -```solidity -event acceptBtcSellOrderEvent( - uint256 indexed id, - uint256 indexed acceptId, - BitcoinAddress bitcoinAddress, - uint256 amountBtc, - uint256 ercAmount, - address ercToken -); -``` - -### proofBtcSellOrderEvent - -```solidity -event proofBtcSellOrderEvent(uint256 id); -``` - -### withdrawBtcSellOrderEvent - -```solidity -event withdrawBtcSellOrderEvent(uint256 id); -``` - -### cancelAcceptedBtcSellOrderEvent - -```solidity -event cancelAcceptedBtcSellOrderEvent(uint256 id); -``` - -### placeBtcBuyOrderEvent - -```solidity -event placeBtcBuyOrderEvent(uint256 amountBtc, BitcoinAddress bitcoinAddress, address sellingToken, uint256 saleAmount); -``` - -### acceptBtcBuyOrderEvent - -```solidity -event acceptBtcBuyOrderEvent( - uint256 indexed orderId, uint256 indexed acceptId, uint256 amountBtc, uint256 ercAmount, address ercToken -); -``` - -### proofBtcBuyOrderEvent - -```solidity -event proofBtcBuyOrderEvent(uint256 id); -``` - -### withdrawBtcBuyOrderEvent - -```solidity -event withdrawBtcBuyOrderEvent(uint256 id); -``` - -### cancelAcceptedBtcBuyOrderEvent - -```solidity -event cancelAcceptedBtcBuyOrderEvent(uint256 id); -``` - -## Structs -### BtcSellOrder - -```solidity -struct BtcSellOrder { - uint256 amountBtc; - address askingToken; - uint256 askingAmount; - address requester; -} -``` - -### AcceptedBtcSellOrder - -```solidity -struct AcceptedBtcSellOrder { - uint256 orderId; - BitcoinAddress bitcoinAddress; - uint256 amountBtc; - address ercToken; - uint256 ercAmount; - address requester; - address accepter; - uint256 acceptTime; -} -``` - -### BtcBuyOrder - -```solidity -struct BtcBuyOrder { - uint256 amountBtc; - BitcoinAddress bitcoinAddress; - address offeringToken; - uint256 offeringAmount; - address requester; -} -``` - -### AcceptedBtcBuyOrder - -```solidity -struct AcceptedBtcBuyOrder { - uint256 orderId; - uint256 amountBtc; - address ercToken; - uint256 ercAmount; - address requester; - address accepter; - uint256 acceptTime; -} -``` - -### BitcoinAddress - -```solidity -struct BitcoinAddress { - string bitcoinAddress; -} -``` - -### TransactionProof - -```solidity -struct TransactionProof { - uint256 dummy; -} -``` - diff --git a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md deleted file mode 100644 index 403b043e..00000000 --- a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md +++ /dev/null @@ -1,87 +0,0 @@ -# MarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/cebdda1540fcce89f17d600bd2a84828c8c85ba6/src/swap/Marketplace.sol) - - -## State Variables -### ercErcOrders - -```solidity -mapping(uint256 => Order) public ercErcOrders; -``` - - -### nextOrderId - -```solidity -uint256 public nextOrderId; -``` - - -## Functions -### placeErcErcOrder - - -```solidity -function placeErcErcOrder(address sellingToken, uint256 saleAmount, address buyingToken, uint256 buyAmount) public; -``` - -### acceptErcErcOrder - - -```solidity -function acceptErcErcOrder(uint256 id, uint256 saleAmount) public; -``` - -### withdrawErcErcOrder - - -```solidity -function withdrawErcErcOrder(uint256 id) public; -``` - -### getOpenOrders - - -```solidity -function getOpenOrders() external view returns (Order[] memory); -``` - -## Events -### placeOrder - -```solidity -event placeOrder( - uint256 indexed orderId, - address indexed requesterAddress, - uint256 offeringAmount, - address offeringToken, - uint256 askingAmount, - address askingToken -); -``` - -### acceptOrder - -```solidity -event acceptOrder(uint256 indexed orderId, address indexed who, uint256 buyAmount, uint256 saleAmount); -``` - -### withdrawOrder - -```solidity -event withdrawOrder(uint256 indexed orderId); -``` - -## Structs -### Order - -```solidity -struct Order { - uint256 offeringAmount; - address offeringToken; - uint256 askingAmount; - address askingToken; - address requesterAddress; -} -``` - diff --git a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md deleted file mode 100644 index d9b95fcf..00000000 --- a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md +++ /dev/null @@ -1,36 +0,0 @@ -# BobWrappedBtc -[Git Source](https://github.com/bob-collective/bob/blob/cebdda1540fcce89f17d600bd2a84828c8c85ba6/src/swap/Wrapped.sol) - -**Inherits:** -ERC20, ERC20Burnable, Ownable - - -## Functions -### constructor - - -```solidity -constructor() ERC20("Bob Wrapped BTC", "zBTC"); -``` - -### sudoMint - - -```solidity -function sudoMint(address to, uint256 amount) public onlyOwner; -``` - -### sudoBurnFrom - - -```solidity -function sudoBurnFrom(address account, uint256 amount) public onlyOwner; -``` - -### sudoTransferFrom - - -```solidity -function sudoTransferFrom(address from, address to, uint256 amount) public onlyOwner; -``` - From e8e240ece1e4f19ec692ed0a76145c2afe541e3a Mon Sep 17 00:00:00 2001 From: ns212 Date: Tue, 5 Dec 2023 09:17:13 +0000 Subject: [PATCH 15/37] chore: format forge-rs docs as part of the build process --- .github/workflows/test.yml | 5 +++++ docs/package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b02e156d..42caeea5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,6 +33,11 @@ jobs: forge build --sizes id: build + - name: Run Forge docs + run: | + forge doc --out docs/docs/contracts + python3 docs_reformat_scripts/forge_doc_reformat.py + - name: Run Forge tests run: | forge test -vvv diff --git a/docs/package.json b/docs/package.json index 23d38bd4..2bce45b5 100644 --- a/docs/package.json +++ b/docs/package.json @@ -7,7 +7,7 @@ "install:sdk": "cd ../sdk && yarn install", "start": "docusaurus start", "build:docs": "docusaurus build", - "build": "yarn install:sdk && yarn build:docs", + "build": "python ../docs_reformat_scripts/forge_doc_reformat.py && yarn install:sdk && yarn build:docs", "swizzle": "docusaurus swizzle", "deploy": "docusaurus deploy", "clear": "docusaurus clear", From 0973c17a2090a5b4966dce28a3ebddc9629715a2 Mon Sep 17 00:00:00 2001 From: ns212 Date: Tue, 5 Dec 2023 09:19:37 +0000 Subject: [PATCH 16/37] chore: format forge-rs docs as part of the build process --- docs/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/package.json b/docs/package.json index 2bce45b5..7b389a10 100644 --- a/docs/package.json +++ b/docs/package.json @@ -7,7 +7,7 @@ "install:sdk": "cd ../sdk && yarn install", "start": "docusaurus start", "build:docs": "docusaurus build", - "build": "python ../docs_reformat_scripts/forge_doc_reformat.py && yarn install:sdk && yarn build:docs", + "build": "python3 ../docs_reformat_scripts/forge_doc_reformat.py && yarn install:sdk && yarn build:docs", "swizzle": "docusaurus swizzle", "deploy": "docusaurus deploy", "clear": "docusaurus clear", From 6d0380c46cc35780400ed0b9a79d959f6970b8f7 Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Tue, 5 Dec 2023 15:40:25 +0530 Subject: [PATCH 17/37] fix: update sidebar script --- .gitignore | 3 +- docs/docs/contracts/contract_references.md | 7 ++ docs/sidebars.js | 76 +++++++++------------- 3 files changed, 38 insertions(+), 48 deletions(-) create mode 100644 docs/docs/contracts/contract_references.md diff --git a/.gitignore b/.gitignore index d960e46b..117df1dc 100644 --- a/.gitignore +++ b/.gitignore @@ -41,4 +41,5 @@ node_modules/* # generated docs /docs/docs/api/* -/docs/docs/contracts/* \ No newline at end of file +/docs/docs/contracts/* +!/docs/docs/contracts/contract_references.md diff --git a/docs/docs/contracts/contract_references.md b/docs/docs/contracts/contract_references.md new file mode 100644 index 00000000..f109f392 --- /dev/null +++ b/docs/docs/contracts/contract_references.md @@ -0,0 +1,7 @@ +# Smart Contracts + +The source code for the smart contracts can be found in the following repository: + +- [Relay Smart Contracts](https://github.com/bob-collective/bob/tree/master/src/relay) +- [Bridge Smart Contracts](https://github.com/bob-collective/bob/tree/master/src/bridge) +- [Swap Smart Contracts](https://github.com/bob-collective/bob/tree/master/src/swap) diff --git a/docs/sidebars.js b/docs/sidebars.js index d230d576..5a0aef05 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -11,6 +11,34 @@ // @ts-check +const fs = require('fs'); +const contractDir = 'docs/contracts/src/src'; +const contractItems = + fs.existsSync(contractDir) && fs.lstatSync(contractDir).isDirectory() + ? fs + .readdirSync(contractDir, { withFileTypes: true }) + .filter((dirent) => dirent.isDirectory()) + .map((dirent) => ({ + type: "category", + label: `${dirent.name.charAt(0).toUpperCase()}${dirent.name.slice( + 1 + )}`, // Capitalize the first letter + items: [ + { + type: "autogenerated", + dirName: `contracts/src/src/${dirent.name}`, + }, + ], + })) + : [ + { + type: "category", + label: "Contracts", + items: ["contracts/contract_references"], + }, + ]; + + /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ const sidebars = { // By default, Docusaurus generates a sidebar from the docs folder structure @@ -22,38 +50,7 @@ const sidebars = { type: 'category', label: 'Contracts', collapsed: false, - items: [ - { - type: 'category', - label: 'Bridge', - items: [ - { - type: 'autogenerated', - dirName: 'contracts/src/src/bridge' - } - ] - }, - { - type: 'category', - label: 'Relay', - items: [ - { - type: 'autogenerated', - dirName: 'contracts/src/src/relay' - } - ] - }, - { - type: 'category', - label: 'Swap', - items: [ - { - type: 'autogenerated', - dirName: 'contracts/src/src/swap' - } - ] - }, - ], + items: contractItems, } ], apiSidebar: [ @@ -96,21 +93,6 @@ const sidebars = { ], } ], - // guideSidebar: [{type: 'autogenerated', dirName: 'guide'}], - // runSidebar: [{type: 'autogenerated', dirName: 'run'}], - - // But you can create a sidebar manually - /* - tutorialSidebar: [ - 'intro', - 'hello', - { - type: 'category', - label: 'Tutorial', - items: ['tutorial-basics/create-a-document'], - }, - ], - */ }; module.exports = sidebars; From e2d3831c473b5a289480e48c5c318e8aa013652a Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Tue, 5 Dec 2023 15:44:05 +0530 Subject: [PATCH 18/37] fix: add comment --- docs/sidebars.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/sidebars.js b/docs/sidebars.js index 5a0aef05..e3bae94b 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -13,6 +13,7 @@ const fs = require('fs'); const contractDir = 'docs/contracts/src/src'; +// Check if the contract directory exists and is a directory const contractItems = fs.existsSync(contractDir) && fs.lstatSync(contractDir).isDirectory() ? fs @@ -22,7 +23,7 @@ const contractItems = type: "category", label: `${dirent.name.charAt(0).toUpperCase()}${dirent.name.slice( 1 - )}`, // Capitalize the first letter + )}`, // Capitalize the first letter of the directory name items: [ { type: "autogenerated", @@ -34,7 +35,7 @@ const contractItems = { type: "category", label: "Contracts", - items: ["contracts/contract_references"], + items: ["contracts/contract_references"], // Default item when the directory doesn't exist or is not a directory }, ]; From e9e07df9b9f97174c404435376acf2dbc44d755b Mon Sep 17 00:00:00 2001 From: ns212 Date: Wed, 6 Dec 2023 08:29:02 +0000 Subject: [PATCH 19/37] chore: format forge-rs docs as part of the build process --- .github/workflows/test.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 42caeea5..398d1108 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,11 +7,12 @@ env: jobs: check: - strategy: - fail-fast: true - name: Foundry runs-on: ubuntu-latest + + permissions: + contents: write + steps: - uses: actions/checkout@v4 with: @@ -33,12 +34,18 @@ jobs: forge build --sizes id: build + - name: Run Forge tests + run: | + forge test -vvv + id: test + - name: Run Forge docs run: | forge doc --out docs/docs/contracts python3 docs_reformat_scripts/forge_doc_reformat.py - - name: Run Forge tests - run: | - forge test -vvv - id: test + - name: Commit Forge docs + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "Generate Foundry docs" + file_pattern: "*.md" From f0e8381a1c7bf51bebf3d6d9afc68973e34d3fe0 Mon Sep 17 00:00:00 2001 From: ns212 Date: Wed, 6 Dec 2023 08:33:45 +0000 Subject: [PATCH 20/37] chore: format forge-rs docs as part of the build process --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 398d1108..524fd3c0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,4 +48,4 @@ jobs: uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: "Generate Foundry docs" - file_pattern: "*.md" + file_pattern: "./docs/" From 8300e03d60e52cd9c195686d4aff73c1ccfd8e0d Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Wed, 6 Dec 2023 14:14:50 +0530 Subject: [PATCH 21/37] fix: remove contracts dir from gitignore. --- .gitignore | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitignore b/.gitignore index 117df1dc..fd706a78 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,3 @@ node_modules/* # generated docs /docs/docs/api/* - -/docs/docs/contracts/* -!/docs/docs/contracts/contract_references.md From 353b24c6f6a701b8192f555a9128f93497a6216b Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Wed, 6 Dec 2023 08:45:28 +0000 Subject: [PATCH 22/37] Generate Foundry docs --- docs/docs/contracts/.gitignore | 1 + docs/docs/contracts/book.css | 13 + docs/docs/contracts/book.toml | 12 + docs/docs/contracts/solidity.min.js | 74 ++++ docs/docs/contracts/src/README.md | 48 +++ docs/docs/contracts/src/SUMMARY.md | 19 + docs/docs/contracts/src/src/README.md | 6 + .../bridge/BitcoinTx.sol/library.BitcoinTx.md | 138 +++++++ .../BridgeState.sol/library.BridgeState.md | 14 + .../src/bridge/IRelay.sol/interface.IRelay.md | 27 ++ docs/docs/contracts/src/src/bridge/README.md | 7 + .../bridge/WitnessTx.sol/library.WitnessTx.md | 99 +++++ .../LightRelay.sol/contract.LightRelay.md | 391 ++++++++++++++++++ .../LightRelay.sol/interface.ILightRelay.md | 83 ++++ .../LightRelay.sol/library.RelayUtils.md | 30 ++ .../src/relay/LightRelay.sol/struct.Epoch.md | 11 + docs/docs/contracts/src/src/relay/README.md | 8 + .../contract.TestLightRelay.md | 28 ++ .../src/swap/Bridge.sol/contract.Bridge.md | 159 +++++++ .../contract.BtcMarketPlace.md | 335 +++++++++++++++ .../Marketplace.sol/contract.MarketPlace.md | 87 ++++ docs/docs/contracts/src/src/swap/README.md | 7 + .../Wrapped.sol/contract.BobWrappedBtc.md | 36 ++ 23 files changed, 1633 insertions(+) create mode 100644 docs/docs/contracts/.gitignore create mode 100644 docs/docs/contracts/book.css create mode 100644 docs/docs/contracts/book.toml create mode 100644 docs/docs/contracts/solidity.min.js create mode 100644 docs/docs/contracts/src/README.md create mode 100644 docs/docs/contracts/src/SUMMARY.md create mode 100644 docs/docs/contracts/src/src/README.md create mode 100644 docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md create mode 100644 docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md create mode 100644 docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md create mode 100644 docs/docs/contracts/src/src/bridge/README.md create mode 100644 docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md create mode 100644 docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md create mode 100644 docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md create mode 100644 docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md create mode 100644 docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md create mode 100644 docs/docs/contracts/src/src/relay/README.md create mode 100644 docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md create mode 100644 docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md create mode 100644 docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md create mode 100644 docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md create mode 100644 docs/docs/contracts/src/src/swap/README.md create mode 100644 docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md diff --git a/docs/docs/contracts/.gitignore b/docs/docs/contracts/.gitignore new file mode 100644 index 00000000..4e42a1bc --- /dev/null +++ b/docs/docs/contracts/.gitignore @@ -0,0 +1 @@ +book/ \ No newline at end of file diff --git a/docs/docs/contracts/book.css b/docs/docs/contracts/book.css new file mode 100644 index 00000000..b5ce903f --- /dev/null +++ b/docs/docs/contracts/book.css @@ -0,0 +1,13 @@ +table { + margin: 0 auto; + border-collapse: collapse; + width: 100%; +} + +table td:first-child { + width: 15%; +} + +table td:nth-child(2) { + width: 25%; +} \ No newline at end of file diff --git a/docs/docs/contracts/book.toml b/docs/docs/contracts/book.toml new file mode 100644 index 00000000..353bd356 --- /dev/null +++ b/docs/docs/contracts/book.toml @@ -0,0 +1,12 @@ +[book] +src = "src" +title = "" + +[output.html] +no-section-label = true +additional-js = ["solidity.min.js"] +additional-css = ["book.css"] +git-repository-url = "https://github.com/bob-collective/bob" + +[output.html.fold] +enable = true diff --git a/docs/docs/contracts/solidity.min.js b/docs/docs/contracts/solidity.min.js new file mode 100644 index 00000000..19249329 --- /dev/null +++ b/docs/docs/contracts/solidity.min.js @@ -0,0 +1,74 @@ +hljs.registerLanguage("solidity",(()=>{"use strict";function e(){try{return!0 +}catch(e){return!1}} +var a=/-?(\b0[xX]([a-fA-F0-9]_?)*[a-fA-F0-9]|(\b[1-9](_?\d)*(\.((\d_?)*\d)?)?|\.\d(_?\d)*)([eE][-+]?\d(_?\d)*)?|\b0)(?!\w|\$)/ +;e()&&(a=a.source.replace(/\\b/g,"(?{ +var a=r(e),o=l(e),c=/[A-Za-z_$][A-Za-z_$0-9.]*/,d=e.inherit(e.TITLE_MODE,{ +begin:/[A-Za-z$_][0-9A-Za-z$_]*/,lexemes:c,keywords:n}),u={className:"params", +begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,lexemes:c,keywords:n, +contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,o,s]},_={ +className:"operator",begin:/:=|->/};return{keywords:n,lexemes:c, +contains:[a,o,i,t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s,_,{ +className:"function",lexemes:c,beginKeywords:"function",end:"{",excludeEnd:!0, +contains:[d,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,_]}]}}, +solAposStringMode:r,solQuoteStringMode:l,HEX_APOS_STRING_MODE:i, +HEX_QUOTE_STRING_MODE:t,SOL_NUMBER:s,isNegativeLookbehindAvailable:e} +;const{baseAssembly:c,solAposStringMode:d,solQuoteStringMode:u,HEX_APOS_STRING_MODE:_,HEX_QUOTE_STRING_MODE:m,SOL_NUMBER:b,isNegativeLookbehindAvailable:E}=o +;return e=>{for(var a=d(e),s=u(e),n=[],i=0;i<32;i++)n[i]=i+1 +;var t=n.map((e=>8*e)),r=[];for(i=0;i<=80;i++)r[i]=i +;var l=n.map((e=>"bytes"+e)).join(" ")+" ",o=t.map((e=>"uint"+e)).join(" ")+" ",g=t.map((e=>"int"+e)).join(" ")+" ",M=[].concat.apply([],t.map((e=>r.map((a=>e+"x"+a))))),p={ +keyword:"var bool string int uint "+g+o+"byte bytes "+l+"fixed ufixed "+M.map((e=>"fixed"+e)).join(" ")+" "+M.map((e=>"ufixed"+e)).join(" ")+" enum struct mapping address new delete if else for while continue break return throw emit try catch revert unchecked _ function modifier event constructor fallback receive error virtual override constant immutable anonymous indexed storage memory calldata external public internal payable pure view private returns import from as using pragma contract interface library is abstract type assembly", +literal:"true false wei gwei szabo finney ether seconds minutes hours days weeks years", +built_in:"self this super selfdestruct suicide now msg block tx abi blockhash gasleft assert require Error Panic sha3 sha256 keccak256 ripemd160 ecrecover addmod mulmod log0 log1 log2 log3 log4" +},O={className:"operator",begin:/[+\-!~*\/%<>&^|=]/ +},C=/[A-Za-z_$][A-Za-z_$0-9]*/,N={className:"params",begin:/\(/,end:/\)/, +excludeBegin:!0,excludeEnd:!0,lexemes:C,keywords:p, +contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,s,b,"self"]},f={ +begin:/\.\s*/,end:/[^A-Za-z0-9$_\.]/,excludeBegin:!0,excludeEnd:!0,keywords:{ +built_in:"gas value selector address length push pop send transfer call callcode delegatecall staticcall balance code codehash wrap unwrap name creationCode runtimeCode interfaceId min max" +},relevance:2},y=e.inherit(e.TITLE_MODE,{begin:/[A-Za-z$_][0-9A-Za-z$_]*/, +lexemes:C,keywords:p}),w={className:"built_in", +begin:(E()?"(? Epoch) internal epochs; +``` + + +### isAuthorized + +```solidity +mapping(address => bool) public isAuthorized; +``` + + +## Functions +### relayActive + + +```solidity +modifier relayActive(); +``` + +### genesis + +Establish a starting point for the relay by providing the +target, timestamp and blockheight of the first block of the relay +genesis epoch. + +*If the relay is used by querying the current and previous epoch +difficulty, at least one retarget needs to be provided after genesis; +otherwise the prevEpochDifficulty will be uninitialised and zero.* + + +```solidity +function genesis(bytes calldata genesisHeader, uint256 genesisHeight, uint64 genesisProofLength) external onlyOwner; +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`genesisHeader`|`bytes`|The first block header of the genesis epoch.| +|`genesisHeight`|`uint256`|The block number of the first block of the epoch.| +|`genesisProofLength`|`uint64`|The number of blocks required to accept a proof.| + + +### setProofLength + +Set the number of blocks required to accept a header chain. + +*For production, a high number (e.g. 20-50) is recommended. +Small numbers are accepted but should only be used for testing.* + + +```solidity +function setProofLength(uint64 newLength) external relayActive onlyOwner; +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`newLength`|`uint64`|The required number of blocks. Must be less than 2016.| + + +### setAuthorizationStatus + +Set whether the relay requires retarget submitters to be +pre-authorised by governance. + + +```solidity +function setAuthorizationStatus(bool status) external onlyOwner; +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`status`|`bool`|True if authorisation is to be required, false if not.| + + +### authorize + +Authorise the given address to submit retarget proofs. + + +```solidity +function authorize(address submitter) external onlyOwner; +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`submitter`|`address`|The address to be authorised.| + + +### deauthorize + +Rescind the authorisation of the submitter to retarget. + + +```solidity +function deauthorize(address submitter) external onlyOwner; +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`submitter`|`address`|The address to be deauthorised.| + + +### retarget + +Add a new epoch to the relay by providing a proof +of the difficulty before and after the retarget. + +*Checks that the first X blocks are valid in the most recent epoch, +that the difficulty of the new epoch is calculated correctly according +to the block timestamps, and that the next X blocks would be valid in +the new epoch. +We have no information of block heights, so we cannot enforce that +retargets only happen every 2016 blocks; instead, we assume that this +is the case if a valid proof of work is provided. +It is possible to cheat the relay by providing X blocks from earlier in +the most recent epoch, and then mining X new blocks after them. +However, each of these malicious blocks would have to be mined to a +higher difficulty than the legitimate ones. +Alternatively, if the retarget has not been performed yet, one could +first mine X blocks in the old difficulty with timestamps set far in +the future, and then another X blocks at a greatly reduced difficulty. +In either case, cheating the relay requires more work than mining X +legitimate blocks. +Only the most recent epoch is vulnerable to these attacks; once a +retarget has been proven to the relay, the epoch is immutable even if a +contradictory proof were to be presented later.* + + +```solidity +function retarget(bytes memory headers) external relayActive; +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`headers`|`bytes`|A chain of headers including the last X blocks before the retarget, followed by the first X blocks after the retarget, where X equals the current proof length.| + + +### validateChain + +Check whether a given chain of headers should be accepted as +valid within the rules of the relay. +If the validation fails, this function throws an exception. + +*A chain of headers is accepted as valid if: +- Its length is between 2 and 2015 headers. +- Headers in the chain are sequential and refer to previous digests. +- Each header is mined with the correct amount of work. +- The difficulty in each header matches an epoch of the relay, +as determined by the headers' timestamps. The headers must be between +the genesis epoch and the latest proven epoch (inclusive). +If the chain contains a retarget, it is accepted if the retarget has +already been proven to the relay. +If the chain contains blocks of an epoch that has not been proven to +the relay (after a retarget within the header chain, or when the entire +chain falls within an epoch that has not been proven yet), it will be +rejected. +One exception to this is when two subsequent epochs have exactly the +same difficulty; headers from the latter epoch will be accepted if the +previous epoch has been proven to the relay. +This is because it is not possible to distinguish such headers from +headers of the previous epoch. +If the difficulty increases significantly between relay genesis and the +present, creating fraudulent proofs for earlier epochs becomes easier. +Users of the relay should check the timestamps of valid headers and +only accept appropriately recent ones.* + + +```solidity +function validateChain(bytes memory headers) + external + view + returns (uint256 startingHeaderTimestamp, uint256 headerCount); +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`headers`|`bytes`|A chain of 2 to 2015 bitcoin headers.| + +**Returns** + +|Name|Type|Description| +|----|----|-----------| +|`startingHeaderTimestamp`|`uint256`|The timestamp of the first header.| +|`headerCount`|`uint256`|The number of headers.| + + +### getBlockDifficulty + +Get the difficulty of the specified block. + + +```solidity +function getBlockDifficulty(uint256 blockNumber) external view returns (uint256); +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`blockNumber`|`uint256`|The number of the block. Must fall within the relay range (at or after the relay genesis, and at or before the end of the most recent epoch proven to the relay).| + +**Returns** + +|Name|Type|Description| +|----|----|-----------| +|``|`uint256`|The difficulty of the epoch.| + + +### getRelayRange + +Get the range of blocks the relay can accept proofs for. + +*Assumes that the genesis has been set correctly. +Additionally, if the next epoch after the current one has the exact +same difficulty, headers for it can be validated as well. +This function should be used for informative purposes, +e.g. to determine whether a retarget must be provided before submitting +a header chain for validation.* + + +```solidity +function getRelayRange() external view returns (uint256 relayGenesis, uint256 currentEpochEnd); +``` +**Returns** + +|Name|Type|Description| +|----|----|-----------| +|`relayGenesis`|`uint256`|The height of the earliest block that can be included in header chains for the relay to validate.| +|`currentEpochEnd`|`uint256`|The height of the last block that can be included in header chains for the relay to validate.| + + +### getCurrentEpochDifficulty + +Returns the difficulty of the current epoch. + +*returns 0 if the relay is not ready.* + + +```solidity +function getCurrentEpochDifficulty() external view virtual returns (uint256); +``` +**Returns** + +|Name|Type|Description| +|----|----|-----------| +|``|`uint256`|The difficulty of the current epoch.| + + +### getPrevEpochDifficulty + +Returns the difficulty of the previous epoch. + +*Returns 0 if the relay is not ready or has not had a retarget.* + + +```solidity +function getPrevEpochDifficulty() external view virtual returns (uint256); +``` +**Returns** + +|Name|Type|Description| +|----|----|-----------| +|``|`uint256`|The difficulty of the previous epoch.| + + +### getCurrentAndPrevEpochDifficulty + + +```solidity +function getCurrentAndPrevEpochDifficulty() external view returns (uint256 current, uint256 previous); +``` + +### getEpochDifficulty + +Get the difficulty of the specified epoch. + + +```solidity +function getEpochDifficulty(uint256 epochNumber) public view returns (uint256); +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`epochNumber`|`uint256`|The number of the epoch (the height of the first block of the epoch, divided by 2016). Must fall within the relay range.| + +**Returns** + +|Name|Type|Description| +|----|----|-----------| +|``|`uint256`|The difficulty of the epoch.| + + +### validateHeader + +Check that the specified header forms a correct chain with the +digest of the previous header (if provided), and has sufficient work. + +*Throws an exception if the header's chain or PoW are invalid. +Performs no other validation.* + + +```solidity +function validateHeader(bytes memory headers, uint256 start, bytes32 prevDigest) + internal + view + returns (bytes32 digest, uint256 target); +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`headers`|`bytes`|The byte array containing the header of interest.| +|`start`|`uint256`|The start of the header in the array.| +|`prevDigest`|`bytes32`|The digest of the previous header (optional; providing zeros for the digest skips the check).| + +**Returns** + +|Name|Type|Description| +|----|----|-----------| +|`digest`|`bytes32`|The digest of the current header.| +|`target`|`uint256`|The PoW target of the header.| + + diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md new file mode 100644 index 00000000..97a97a93 --- /dev/null +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md @@ -0,0 +1,83 @@ +# ILightRelay +[Git Source](https://github.com/bob-collective/bob/blob/288d76a65db4dba19d3e63373ae56c5a46a13fc7/src/relay/LightRelay.sol) + +**Inherits:** +[IRelay](/src/bridge/IRelay.sol/interface.IRelay.md) + + +## Functions +### retarget + + +```solidity +function retarget(bytes memory headers) external; +``` + +### validateChain + + +```solidity +function validateChain(bytes memory headers) + external + view + returns (uint256 startingHeaderTimestamp, uint256 headerCount); +``` + +### getBlockDifficulty + + +```solidity +function getBlockDifficulty(uint256 blockNumber) external view returns (uint256); +``` + +### getEpochDifficulty + + +```solidity +function getEpochDifficulty(uint256 epochNumber) external view returns (uint256); +``` + +### getRelayRange + + +```solidity +function getRelayRange() external view returns (uint256 relayGenesis, uint256 currentEpochEnd); +``` + +## Events +### Genesis + +```solidity +event Genesis(uint256 blockHeight); +``` + +### Retarget + +```solidity +event Retarget(uint256 oldDifficulty, uint256 newDifficulty); +``` + +### ProofLengthChanged + +```solidity +event ProofLengthChanged(uint256 newLength); +``` + +### AuthorizationRequirementChanged + +```solidity +event AuthorizationRequirementChanged(bool newStatus); +``` + +### SubmitterAuthorized + +```solidity +event SubmitterAuthorized(address submitter); +``` + +### SubmitterDeauthorized + +```solidity +event SubmitterDeauthorized(address submitter); +``` + diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md new file mode 100644 index 00000000..f61aa066 --- /dev/null +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md @@ -0,0 +1,30 @@ +# RelayUtils +[Git Source](https://github.com/bob-collective/bob/blob/288d76a65db4dba19d3e63373ae56c5a46a13fc7/src/relay/LightRelay.sol) + + +## Functions +### extractTimestampAt + +Extract the timestamp of the header at the given position. + +*Assumes that the specified position contains a valid header. +Performs no validation whatsoever.* + + +```solidity +function extractTimestampAt(bytes memory headers, uint256 at) internal pure returns (uint32); +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`headers`|`bytes`|Byte array containing the header of interest.| +|`at`|`uint256`|The start of the header in the array.| + +**Returns** + +|Name|Type|Description| +|----|----|-----------| +|``|`uint32`|The timestamp of the header.| + + diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md new file mode 100644 index 00000000..03c56aa7 --- /dev/null +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md @@ -0,0 +1,11 @@ +# Epoch +[Git Source](https://github.com/bob-collective/bob/blob/288d76a65db4dba19d3e63373ae56c5a46a13fc7/src/relay/LightRelay.sol) + + +```solidity +struct Epoch { + uint32 timestamp; + uint224 target; +} +``` + diff --git a/docs/docs/contracts/src/src/relay/README.md b/docs/docs/contracts/src/src/relay/README.md new file mode 100644 index 00000000..06222840 --- /dev/null +++ b/docs/docs/contracts/src/src/relay/README.md @@ -0,0 +1,8 @@ + + +# Contents +- [Epoch](LightRelay.sol/struct.Epoch.md) +- [ILightRelay](LightRelay.sol/interface.ILightRelay.md) +- [RelayUtils](LightRelay.sol/library.RelayUtils.md) +- [LightRelay](LightRelay.sol/contract.LightRelay.md) +- [TestLightRelay](TestLightRelay.sol/contract.TestLightRelay.md) diff --git a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md new file mode 100644 index 00000000..23ae29f3 --- /dev/null +++ b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md @@ -0,0 +1,28 @@ +# TestLightRelay +[Git Source](https://github.com/bob-collective/bob/blob/288d76a65db4dba19d3e63373ae56c5a46a13fc7/src/relay/TestLightRelay.sol) + +**Inherits:** +[LightRelay](/src/relay/LightRelay.sol/contract.LightRelay.md) + +TestLightRelay is a stub version of LightRelay intended to be +used on for testing network. It allows to set the relay's +difficulty based on arbitrary Bitcoin headers thus effectively +bypass the validation of difficulties of Bitcoin testnet blocks. +Since difficulty in Bitcoin testnet often falls to `1` it would not +be possible to validate blocks with the real LightRelay. + +*Notice that TestLightRelay is derived from LightRelay so that the two +contracts have the same API and correct bindings can be generated.* + + +## Functions +### setDifficultyFromHeaders + +Sets the current and previous difficulty based on the difficulty +inferred from the provided Bitcoin headers. + + +```solidity +function setDifficultyFromHeaders(bytes memory bitcoinHeaders) external onlyOwner; +``` + diff --git a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md new file mode 100644 index 00000000..e5b3cd12 --- /dev/null +++ b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md @@ -0,0 +1,159 @@ +# Bridge +[Git Source](https://github.com/bob-collective/bob/blob/288d76a65db4dba19d3e63373ae56c5a46a13fc7/src/swap/Bridge.sol) + + +## State Variables +### number + +```solidity +uint256 public number; +``` + + +### collateralThreshold + +```solidity +uint256 public collateralThreshold; +``` + + +### nextOrderId + +```solidity +uint256 nextOrderId; +``` + + +### orders + +```solidity +mapping(uint256 => Order) public orders; +``` + + +### suppliedCollateral + +```solidity +mapping(address => uint256) public suppliedCollateral; +``` + + +### totalCollateral + +```solidity +uint256 totalCollateral; +``` + + +### wrapped + +```solidity +BobWrappedBtc wrapped = new BobWrappedBtc(); +``` + + +## Functions +### constructor + + +```solidity +constructor(uint256 threshold); +``` + +### mint + +lock COL in exchange for zBTC and cCOL + + +```solidity +function mint() public payable; +``` + +### requestSwap + +request zBTC to be redeemed for given amount of BTC. + + +```solidity +function requestSwap(uint256 amountZbtc, uint256 amountBtc, BitcoinAddress calldata bitcoinAddress) public; +``` + +### acceptSwap + + +```solidity +function acceptSwap(uint256 id) public; +``` + +### cancelSwap + + +```solidity +function cancelSwap(uint256 id) public; +``` + +### executeSwap + + +```solidity +function executeSwap(uint256 id, TransactionProof calldata transactionProof) public; +``` + +### liquidate + + +```solidity +function liquidate(uint256 amountZbtc) public; +``` + +### withdraw + + +```solidity +function withdraw() public; +``` + +### colToBtc + + +```solidity +function colToBtc(uint256 collateral) internal pure returns (uint256); +``` + +### btcToCol + + +```solidity +function btcToCol(uint256 collateral) internal pure returns (uint256); +``` + +## Structs +### Order + +```solidity +struct Order { + bool open; + uint256 amountZbtc; + uint256 amountBtc; + address requesterAddress; + address accepterAddress; + BitcoinAddress bitcoinAddress; +} +``` + +### BitcoinAddress + +```solidity +struct BitcoinAddress { + bytes scriptPubKey; +} +``` + +### TransactionProof + +```solidity +struct TransactionProof { + uint256 dummy; +} +``` + diff --git a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md new file mode 100644 index 00000000..c1da8680 --- /dev/null +++ b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md @@ -0,0 +1,335 @@ +# BtcMarketPlace +[Git Source](https://github.com/bob-collective/bob/blob/288d76a65db4dba19d3e63373ae56c5a46a13fc7/src/swap/Btc_Marketplace.sol) + + +## State Variables +### btcBuyOrders + +```solidity +mapping(uint256 => BtcBuyOrder) public btcBuyOrders; +``` + + +### acceptedBtcBuyOrders + +```solidity +mapping(uint256 => AcceptedBtcBuyOrder) public acceptedBtcBuyOrders; +``` + + +### btcSellOrders + +```solidity +mapping(uint256 => BtcSellOrder) public btcSellOrders; +``` + + +### acceptedBtcSellOrders + +```solidity +mapping(uint256 => AcceptedBtcSellOrder) public acceptedBtcSellOrders; +``` + + +### nextOrderId + +```solidity +uint256 nextOrderId; +``` + + +### REQUEST_EXPIRATION_SECONDS + +```solidity +uint256 public constant REQUEST_EXPIRATION_SECONDS = 6 hours; +``` + + +### relay + +```solidity +BridgeState.Storage internal relay; +``` + + +## Functions +### constructor + + +```solidity +constructor(IRelay _relay); +``` + +### setRelay + + +```solidity +function setRelay(IRelay _relay) internal; +``` + +### placeBtcSellOrder + + +```solidity +function placeBtcSellOrder(uint256 amountBtc, address buyingToken, uint256 buyAmount) public; +``` + +### acceptBtcSellOrder + + +```solidity +function acceptBtcSellOrder(uint256 id, BitcoinAddress calldata bitcoinAddress, uint256 amountBtc) + public + returns (uint256); +``` + +### proofBtcSellOrder + + +```solidity +function proofBtcSellOrder(uint256 id, BitcoinTx.Info calldata transaction, BitcoinTx.Proof calldata proof) public; +``` + +### withdrawBtcSellOrder + + +```solidity +function withdrawBtcSellOrder(uint256 id) public; +``` + +### cancelAcceptedBtcSellOrder + + +```solidity +function cancelAcceptedBtcSellOrder(uint256 id) public; +``` + +### placeBtcBuyOrder + + +```solidity +function placeBtcBuyOrder( + uint256 amountBtc, + BitcoinAddress calldata bitcoinAddress, + address sellingToken, + uint256 saleAmount +) public; +``` + +### acceptBtcBuyOrder + + +```solidity +function acceptBtcBuyOrder(uint256 id, uint256 amountBtc) public returns (uint256); +``` + +### proofBtcBuyOrder + + +```solidity +function proofBtcBuyOrder(uint256 id, BitcoinTx.Info calldata transaction, BitcoinTx.Proof calldata proof) public; +``` + +### withdrawBtcBuyOrder + + +```solidity +function withdrawBtcBuyOrder(uint256 id) public; +``` + +### cancelAcceptedBtcBuyOrder + + +```solidity +function cancelAcceptedBtcBuyOrder(uint256 id) public; +``` + +### getOpenBtcSellOrders + + +```solidity +function getOpenBtcSellOrders() external view returns (BtcSellOrder[] memory, uint256[] memory); +``` + +### getOpenAcceptedBtcSellOrders + + +```solidity +function getOpenAcceptedBtcSellOrders() external view returns (AcceptedBtcSellOrder[] memory, uint256[] memory); +``` + +### getOpenBtcBuyOrders + + +```solidity +function getOpenBtcBuyOrders() external view returns (BtcBuyOrder[] memory, uint256[] memory); +``` + +### getOpenAcceptedBtcBuyOrders + + +```solidity +function getOpenAcceptedBtcBuyOrders() external view returns (AcceptedBtcBuyOrder[] memory, uint256[] memory); +``` + +### _checkBitcoinTxOutput + +Checks output script pubkey (recipient address) and amount. +Reverts if transaction amount is lower or bitcoin address is not found. + + +```solidity +function _checkBitcoinTxOutput( + uint256 expectedBtcAmount, + BitcoinAddress storage bitcoinAddress, + BitcoinTx.Info calldata transaction +) private; +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`expectedBtcAmount`|`uint256`|BTC amount requested in order.| +|`bitcoinAddress`|`BitcoinAddress`|Recipient's bitcoin address.| +|`transaction`|`BitcoinTx.Info`|Transaction fulfilling the order.| + + +## Events +### placeBtcSellOrderEvent + +```solidity +event placeBtcSellOrderEvent(uint256 indexed orderId, uint256 amountBtc, address buyingToken, uint256 buyAmount); +``` + +### acceptBtcSellOrderEvent + +```solidity +event acceptBtcSellOrderEvent( + uint256 indexed id, + uint256 indexed acceptId, + BitcoinAddress bitcoinAddress, + uint256 amountBtc, + uint256 ercAmount, + address ercToken +); +``` + +### proofBtcSellOrderEvent + +```solidity +event proofBtcSellOrderEvent(uint256 id); +``` + +### withdrawBtcSellOrderEvent + +```solidity +event withdrawBtcSellOrderEvent(uint256 id); +``` + +### cancelAcceptedBtcSellOrderEvent + +```solidity +event cancelAcceptedBtcSellOrderEvent(uint256 id); +``` + +### placeBtcBuyOrderEvent + +```solidity +event placeBtcBuyOrderEvent(uint256 amountBtc, BitcoinAddress bitcoinAddress, address sellingToken, uint256 saleAmount); +``` + +### acceptBtcBuyOrderEvent + +```solidity +event acceptBtcBuyOrderEvent( + uint256 indexed orderId, uint256 indexed acceptId, uint256 amountBtc, uint256 ercAmount, address ercToken +); +``` + +### proofBtcBuyOrderEvent + +```solidity +event proofBtcBuyOrderEvent(uint256 id); +``` + +### withdrawBtcBuyOrderEvent + +```solidity +event withdrawBtcBuyOrderEvent(uint256 id); +``` + +### cancelAcceptedBtcBuyOrderEvent + +```solidity +event cancelAcceptedBtcBuyOrderEvent(uint256 id); +``` + +## Structs +### BtcSellOrder + +```solidity +struct BtcSellOrder { + uint256 amountBtc; + address askingToken; + uint256 askingAmount; + address requester; +} +``` + +### AcceptedBtcSellOrder + +```solidity +struct AcceptedBtcSellOrder { + uint256 orderId; + BitcoinAddress bitcoinAddress; + uint256 amountBtc; + address ercToken; + uint256 ercAmount; + address requester; + address accepter; + uint256 acceptTime; +} +``` + +### BtcBuyOrder + +```solidity +struct BtcBuyOrder { + uint256 amountBtc; + BitcoinAddress bitcoinAddress; + address offeringToken; + uint256 offeringAmount; + address requester; +} +``` + +### AcceptedBtcBuyOrder + +```solidity +struct AcceptedBtcBuyOrder { + uint256 orderId; + uint256 amountBtc; + address ercToken; + uint256 ercAmount; + address requester; + address accepter; + uint256 acceptTime; +} +``` + +### BitcoinAddress + +```solidity +struct BitcoinAddress { + bytes scriptPubKey; +} +``` + +### TransactionProof + +```solidity +struct TransactionProof { + uint256 dummy; +} +``` + diff --git a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md new file mode 100644 index 00000000..65b47b12 --- /dev/null +++ b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md @@ -0,0 +1,87 @@ +# MarketPlace +[Git Source](https://github.com/bob-collective/bob/blob/288d76a65db4dba19d3e63373ae56c5a46a13fc7/src/swap/Marketplace.sol) + + +## State Variables +### ercErcOrders + +```solidity +mapping(uint256 => Order) public ercErcOrders; +``` + + +### nextOrderId + +```solidity +uint256 public nextOrderId; +``` + + +## Functions +### placeErcErcOrder + + +```solidity +function placeErcErcOrder(address sellingToken, uint256 saleAmount, address buyingToken, uint256 buyAmount) public; +``` + +### acceptErcErcOrder + + +```solidity +function acceptErcErcOrder(uint256 id, uint256 saleAmount) public; +``` + +### withdrawErcErcOrder + + +```solidity +function withdrawErcErcOrder(uint256 id) public; +``` + +### getOpenOrders + + +```solidity +function getOpenOrders() external view returns (Order[] memory); +``` + +## Events +### placeOrder + +```solidity +event placeOrder( + uint256 indexed orderId, + address indexed requesterAddress, + uint256 offeringAmount, + address offeringToken, + uint256 askingAmount, + address askingToken +); +``` + +### acceptOrder + +```solidity +event acceptOrder(uint256 indexed orderId, address indexed who, uint256 buyAmount, uint256 saleAmount); +``` + +### withdrawOrder + +```solidity +event withdrawOrder(uint256 indexed orderId); +``` + +## Structs +### Order + +```solidity +struct Order { + uint256 offeringAmount; + address offeringToken; + uint256 askingAmount; + address askingToken; + address requesterAddress; +} +``` + diff --git a/docs/docs/contracts/src/src/swap/README.md b/docs/docs/contracts/src/src/swap/README.md new file mode 100644 index 00000000..cbed71f4 --- /dev/null +++ b/docs/docs/contracts/src/src/swap/README.md @@ -0,0 +1,7 @@ + + +# Contents +- [Bridge](Bridge.sol/contract.Bridge.md) +- [BtcMarketPlace](Btc_Marketplace.sol/contract.BtcMarketPlace.md) +- [MarketPlace](Marketplace.sol/contract.MarketPlace.md) +- [BobWrappedBtc](Wrapped.sol/contract.BobWrappedBtc.md) diff --git a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md new file mode 100644 index 00000000..ade99074 --- /dev/null +++ b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md @@ -0,0 +1,36 @@ +# BobWrappedBtc +[Git Source](https://github.com/bob-collective/bob/blob/288d76a65db4dba19d3e63373ae56c5a46a13fc7/src/swap/Wrapped.sol) + +**Inherits:** +ERC20, ERC20Burnable, Ownable + + +## Functions +### constructor + + +```solidity +constructor() ERC20("Bob Wrapped BTC", "zBTC"); +``` + +### sudoMint + + +```solidity +function sudoMint(address to, uint256 amount) public onlyOwner; +``` + +### sudoBurnFrom + + +```solidity +function sudoBurnFrom(address account, uint256 amount) public onlyOwner; +``` + +### sudoTransferFrom + + +```solidity +function sudoTransferFrom(address from, address to, uint256 amount) public onlyOwner; +``` + From 93a7ef5f9a2c06cf15c8874343b6f360f742e99c Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Wed, 6 Dec 2023 08:50:36 +0000 Subject: [PATCH 23/37] Generate Foundry docs --- .../contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md | 2 +- .../src/src/bridge/BridgeState.sol/library.BridgeState.md | 2 +- .../contracts/src/src/bridge/IRelay.sol/interface.IRelay.md | 2 +- .../contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md | 2 +- .../src/src/relay/LightRelay.sol/contract.LightRelay.md | 2 +- .../src/src/relay/LightRelay.sol/interface.ILightRelay.md | 2 +- .../src/src/relay/LightRelay.sol/library.RelayUtils.md | 2 +- .../docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md | 2 +- .../src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md | 2 +- docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md | 2 +- .../src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md | 2 +- .../src/src/swap/Marketplace.sol/contract.MarketPlace.md | 2 +- .../src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md index 0458f59e..e0d81687 100644 --- a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md +++ b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md @@ -1,5 +1,5 @@ # BitcoinTx -[Git Source](https://github.com/bob-collective/bob/blob/288d76a65db4dba19d3e63373ae56c5a46a13fc7/src/bridge/BitcoinTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/bridge/BitcoinTx.sol) Allows to reference Bitcoin raw transaction in Solidity. diff --git a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md index d2a09bd9..5d1f8708 100644 --- a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md +++ b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md @@ -1,5 +1,5 @@ # BridgeState -[Git Source](https://github.com/bob-collective/bob/blob/288d76a65db4dba19d3e63373ae56c5a46a13fc7/src/bridge/BridgeState.sol) +[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/bridge/BridgeState.sol) ## Structs diff --git a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md index 824bb50e..0b49c747 100644 --- a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md +++ b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md @@ -1,5 +1,5 @@ # IRelay -[Git Source](https://github.com/bob-collective/bob/blob/288d76a65db4dba19d3e63373ae56c5a46a13fc7/src/bridge/IRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/bridge/IRelay.sol) Contains only the methods needed by tBTC v2. The Bitcoin relay provides the difficulty of the previous and current epoch. One diff --git a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md index 53c310cc..961893ef 100644 --- a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md +++ b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md @@ -1,5 +1,5 @@ # WitnessTx -[Git Source](https://github.com/bob-collective/bob/blob/288d76a65db4dba19d3e63373ae56c5a46a13fc7/src/bridge/WitnessTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/bridge/WitnessTx.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md index c3994755..47f599ff 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md @@ -1,5 +1,5 @@ # LightRelay -[Git Source](https://github.com/bob-collective/bob/blob/288d76a65db4dba19d3e63373ae56c5a46a13fc7/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/relay/LightRelay.sol) **Inherits:** Ownable, [ILightRelay](/src/relay/LightRelay.sol/interface.ILightRelay.md) diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md index 97a97a93..2aab39fc 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md @@ -1,5 +1,5 @@ # ILightRelay -[Git Source](https://github.com/bob-collective/bob/blob/288d76a65db4dba19d3e63373ae56c5a46a13fc7/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/relay/LightRelay.sol) **Inherits:** [IRelay](/src/bridge/IRelay.sol/interface.IRelay.md) diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md index f61aa066..49a0efa9 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md @@ -1,5 +1,5 @@ # RelayUtils -[Git Source](https://github.com/bob-collective/bob/blob/288d76a65db4dba19d3e63373ae56c5a46a13fc7/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/relay/LightRelay.sol) ## Functions diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md index 03c56aa7..39d06fd8 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md @@ -1,5 +1,5 @@ # Epoch -[Git Source](https://github.com/bob-collective/bob/blob/288d76a65db4dba19d3e63373ae56c5a46a13fc7/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/relay/LightRelay.sol) ```solidity diff --git a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md index 23ae29f3..6c277549 100644 --- a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md +++ b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md @@ -1,5 +1,5 @@ # TestLightRelay -[Git Source](https://github.com/bob-collective/bob/blob/288d76a65db4dba19d3e63373ae56c5a46a13fc7/src/relay/TestLightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/relay/TestLightRelay.sol) **Inherits:** [LightRelay](/src/relay/LightRelay.sol/contract.LightRelay.md) diff --git a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md index e5b3cd12..5e1d0867 100644 --- a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md +++ b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md @@ -1,5 +1,5 @@ # Bridge -[Git Source](https://github.com/bob-collective/bob/blob/288d76a65db4dba19d3e63373ae56c5a46a13fc7/src/swap/Bridge.sol) +[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/swap/Bridge.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md index c1da8680..2327457d 100644 --- a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md @@ -1,5 +1,5 @@ # BtcMarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/288d76a65db4dba19d3e63373ae56c5a46a13fc7/src/swap/Btc_Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/swap/Btc_Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md index 65b47b12..c3d8c030 100644 --- a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md @@ -1,5 +1,5 @@ # MarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/288d76a65db4dba19d3e63373ae56c5a46a13fc7/src/swap/Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/swap/Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md index ade99074..c880c019 100644 --- a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md +++ b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md @@ -1,5 +1,5 @@ # BobWrappedBtc -[Git Source](https://github.com/bob-collective/bob/blob/288d76a65db4dba19d3e63373ae56c5a46a13fc7/src/swap/Wrapped.sol) +[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/swap/Wrapped.sol) **Inherits:** ERC20, ERC20Burnable, Ownable From 1ac20aef464da0fb0be4eede5a915108ba3b4f18 Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Wed, 6 Dec 2023 14:23:33 +0530 Subject: [PATCH 24/37] fix: update commit message. --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 524fd3c0..2aab4c17 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,5 +47,5 @@ jobs: - name: Commit Forge docs uses: stefanzweifel/git-auto-commit-action@v5 with: - commit_message: "Generate Foundry docs" + commit_message: "chore: Generate Foundry docs" file_pattern: "./docs/" From 51411a1dc3e9caf1fbd213b112cb280e5b93e6df Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Wed, 6 Dec 2023 08:54:06 +0000 Subject: [PATCH 25/37] chore: Generate Foundry docs --- .../contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md | 2 +- .../src/src/bridge/BridgeState.sol/library.BridgeState.md | 2 +- .../contracts/src/src/bridge/IRelay.sol/interface.IRelay.md | 2 +- .../contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md | 2 +- .../src/src/relay/LightRelay.sol/contract.LightRelay.md | 2 +- .../src/src/relay/LightRelay.sol/interface.ILightRelay.md | 2 +- .../src/src/relay/LightRelay.sol/library.RelayUtils.md | 2 +- .../docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md | 2 +- .../src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md | 2 +- docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md | 2 +- .../src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md | 2 +- .../src/src/swap/Marketplace.sol/contract.MarketPlace.md | 2 +- .../src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md index e0d81687..4cc3b169 100644 --- a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md +++ b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md @@ -1,5 +1,5 @@ # BitcoinTx -[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/bridge/BitcoinTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/bridge/BitcoinTx.sol) Allows to reference Bitcoin raw transaction in Solidity. diff --git a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md index 5d1f8708..a15a1e12 100644 --- a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md +++ b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md @@ -1,5 +1,5 @@ # BridgeState -[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/bridge/BridgeState.sol) +[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/bridge/BridgeState.sol) ## Structs diff --git a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md index 0b49c747..b39b60b9 100644 --- a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md +++ b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md @@ -1,5 +1,5 @@ # IRelay -[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/bridge/IRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/bridge/IRelay.sol) Contains only the methods needed by tBTC v2. The Bitcoin relay provides the difficulty of the previous and current epoch. One diff --git a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md index 961893ef..b36d4076 100644 --- a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md +++ b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md @@ -1,5 +1,5 @@ # WitnessTx -[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/bridge/WitnessTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/bridge/WitnessTx.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md index 47f599ff..346e4b69 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md @@ -1,5 +1,5 @@ # LightRelay -[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/relay/LightRelay.sol) **Inherits:** Ownable, [ILightRelay](/src/relay/LightRelay.sol/interface.ILightRelay.md) diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md index 2aab39fc..804f1536 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md @@ -1,5 +1,5 @@ # ILightRelay -[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/relay/LightRelay.sol) **Inherits:** [IRelay](/src/bridge/IRelay.sol/interface.IRelay.md) diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md index 49a0efa9..deeeae80 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md @@ -1,5 +1,5 @@ # RelayUtils -[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/relay/LightRelay.sol) ## Functions diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md index 39d06fd8..35c01023 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md @@ -1,5 +1,5 @@ # Epoch -[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/relay/LightRelay.sol) ```solidity diff --git a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md index 6c277549..3c1d9ce8 100644 --- a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md +++ b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md @@ -1,5 +1,5 @@ # TestLightRelay -[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/relay/TestLightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/relay/TestLightRelay.sol) **Inherits:** [LightRelay](/src/relay/LightRelay.sol/contract.LightRelay.md) diff --git a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md index 5e1d0867..e11b9fa7 100644 --- a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md +++ b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md @@ -1,5 +1,5 @@ # Bridge -[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/swap/Bridge.sol) +[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/swap/Bridge.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md index 2327457d..63354d1e 100644 --- a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md @@ -1,5 +1,5 @@ # BtcMarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/swap/Btc_Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/swap/Btc_Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md index c3d8c030..042dc1d4 100644 --- a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md @@ -1,5 +1,5 @@ # MarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/swap/Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/swap/Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md index c880c019..27e90bc7 100644 --- a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md +++ b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md @@ -1,5 +1,5 @@ # BobWrappedBtc -[Git Source](https://github.com/bob-collective/bob/blob/dae01a70f25bbe8256dca739e9a4468ec9c8194f/src/swap/Wrapped.sol) +[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/swap/Wrapped.sol) **Inherits:** ERC20, ERC20Burnable, Ownable From 4b30b16557d2bcebfbb4a5a3eba7d0630ae28f5c Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Wed, 13 Dec 2023 12:56:46 +0530 Subject: [PATCH 26/37] fix: move script to docs folder. --- .github/workflows/test.yml | 2 +- docs/docs/contracts/src/README.md | 48 ------------------- docs/docs/contracts/src/SUMMARY.md | 19 -------- docs/docs/contracts/src/src/README.md | 6 --- .../bridge/BitcoinTx.sol/library.BitcoinTx.md | 2 +- .../BridgeState.sol/library.BridgeState.md | 2 +- .../src/bridge/IRelay.sol/interface.IRelay.md | 2 +- docs/docs/contracts/src/src/bridge/README.md | 7 --- .../bridge/WitnessTx.sol/library.WitnessTx.md | 2 +- .../LightRelay.sol/contract.LightRelay.md | 4 +- .../LightRelay.sol/interface.ILightRelay.md | 4 +- .../LightRelay.sol/library.RelayUtils.md | 2 +- .../src/relay/LightRelay.sol/struct.Epoch.md | 2 +- docs/docs/contracts/src/src/relay/README.md | 8 ---- .../contract.TestLightRelay.md | 4 +- .../src/swap/Bridge.sol/contract.Bridge.md | 2 +- .../contract.BtcMarketPlace.md | 2 +- .../Marketplace.sol/contract.MarketPlace.md | 2 +- docs/docs/contracts/src/src/swap/README.md | 7 --- .../Wrapped.sol/contract.BobWrappedBtc.md | 2 +- docs/package.json | 2 +- .../scripts}/forge_doc_reformat.py | 2 +- 22 files changed, 19 insertions(+), 114 deletions(-) delete mode 100644 docs/docs/contracts/src/README.md delete mode 100644 docs/docs/contracts/src/SUMMARY.md delete mode 100644 docs/docs/contracts/src/src/README.md delete mode 100644 docs/docs/contracts/src/src/bridge/README.md delete mode 100644 docs/docs/contracts/src/src/relay/README.md delete mode 100644 docs/docs/contracts/src/src/swap/README.md rename {docs_reformat_scripts => docs/scripts}/forge_doc_reformat.py (98%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2aab4c17..84a960b7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,7 +42,7 @@ jobs: - name: Run Forge docs run: | forge doc --out docs/docs/contracts - python3 docs_reformat_scripts/forge_doc_reformat.py + python3 docs/scripts/forge_doc_reformat.py - name: Commit Forge docs uses: stefanzweifel/git-auto-commit-action@v5 diff --git a/docs/docs/contracts/src/README.md b/docs/docs/contracts/src/README.md deleted file mode 100644 index 6b91b9cc..00000000 --- a/docs/docs/contracts/src/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# Build on Bitcoin - -BOB is a Bitcoin-augmented rollup bringing experimentation and freedom of choice to builders to make a real-world impact. BOBs vision is to onboard the next billion users to Bitcoin. - -## Learn more - -- [Website](https://www.gobob.xyz/) -- [Docs](https://docs.gobob.xyz/) - -## Contribution - -BOB is an open-source project. We welcome contributions of all sorts. There are many ways to help, from reporting issues, contributing code, and helping us improve our community. - -## Getting Started - -We use foundry extensively for maintaining and testing this contract suite: - -### Build - -```shell -$ forge build -``` - -### Test - -```shell -$ forge test -``` - -### Format - -```shell -$ forge fmt -``` - -## Local Testnet - -To deploy the relay contract to a local environment for testing use our convenience script [here](https://github.com/bob-collective/bob/blob/master/sdk/scripts/init-bridge.ts): - -```shell -# start local ethereum testnet node -docker-compose up anvil -# run script to deploy the relay contract -cd sdk -yarn run deploy-relay --init-height 2016 --private-key dev-0 --dev --network testnet -``` - -The initialization height should be a multiple of 2016 with at least one subsequent retarget (i.e. if using 2016 as the starting height, blocks 4031-4032 must exist). \ No newline at end of file diff --git a/docs/docs/contracts/src/SUMMARY.md b/docs/docs/contracts/src/SUMMARY.md deleted file mode 100644 index 3ad1b790..00000000 --- a/docs/docs/contracts/src/SUMMARY.md +++ /dev/null @@ -1,19 +0,0 @@ -# Summary -- [Home](README.md) -# src - - [❱ bridge](src/bridge/README.md) - - [BitcoinTx](src/bridge/BitcoinTx.sol/library.BitcoinTx.md) - - [BridgeState](src/bridge/BridgeState.sol/library.BridgeState.md) - - [IRelay](src/bridge/IRelay.sol/interface.IRelay.md) - - [WitnessTx](src/bridge/WitnessTx.sol/library.WitnessTx.md) - - [❱ relay](src/relay/README.md) - - [Epoch](src/relay/LightRelay.sol/struct.Epoch.md) - - [ILightRelay](src/relay/LightRelay.sol/interface.ILightRelay.md) - - [RelayUtils](src/relay/LightRelay.sol/library.RelayUtils.md) - - [LightRelay](src/relay/LightRelay.sol/contract.LightRelay.md) - - [TestLightRelay](src/relay/TestLightRelay.sol/contract.TestLightRelay.md) - - [❱ swap](src/swap/README.md) - - [Bridge](src/swap/Bridge.sol/contract.Bridge.md) - - [BtcMarketPlace](src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md) - - [MarketPlace](src/swap/Marketplace.sol/contract.MarketPlace.md) - - [BobWrappedBtc](src/swap/Wrapped.sol/contract.BobWrappedBtc.md) diff --git a/docs/docs/contracts/src/src/README.md b/docs/docs/contracts/src/src/README.md deleted file mode 100644 index a9f0ae43..00000000 --- a/docs/docs/contracts/src/src/README.md +++ /dev/null @@ -1,6 +0,0 @@ - - -# Contents -- [bridge](/src/bridge) -- [relay](/src/relay) -- [swap](/src/swap) diff --git a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md index 4cc3b169..6c0e610f 100644 --- a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md +++ b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md @@ -1,5 +1,5 @@ # BitcoinTx -[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/bridge/BitcoinTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/bridge/BitcoinTx.sol) Allows to reference Bitcoin raw transaction in Solidity. diff --git a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md index a15a1e12..94048e19 100644 --- a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md +++ b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md @@ -1,5 +1,5 @@ # BridgeState -[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/bridge/BridgeState.sol) +[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/bridge/BridgeState.sol) ## Structs diff --git a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md index b39b60b9..240da1e6 100644 --- a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md +++ b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md @@ -1,5 +1,5 @@ # IRelay -[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/bridge/IRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/bridge/IRelay.sol) Contains only the methods needed by tBTC v2. The Bitcoin relay provides the difficulty of the previous and current epoch. One diff --git a/docs/docs/contracts/src/src/bridge/README.md b/docs/docs/contracts/src/src/bridge/README.md deleted file mode 100644 index 0fda2c04..00000000 --- a/docs/docs/contracts/src/src/bridge/README.md +++ /dev/null @@ -1,7 +0,0 @@ - - -# Contents -- [BitcoinTx](BitcoinTx.sol/library.BitcoinTx.md) -- [BridgeState](BridgeState.sol/library.BridgeState.md) -- [IRelay](IRelay.sol/interface.IRelay.md) -- [WitnessTx](WitnessTx.sol/library.WitnessTx.md) diff --git a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md index b36d4076..6c36a9ed 100644 --- a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md +++ b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md @@ -1,5 +1,5 @@ # WitnessTx -[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/bridge/WitnessTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/bridge/WitnessTx.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md index 346e4b69..149a53b9 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md @@ -1,8 +1,8 @@ # LightRelay -[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/relay/LightRelay.sol) **Inherits:** -Ownable, [ILightRelay](/src/relay/LightRelay.sol/interface.ILightRelay.md) +Ownable, [ILightRelay](../../relay/LightRelay.sol/interface.ILightRelay.md) *THE RELAY MUST NOT BE USED BEFORE GENESIS AND AT LEAST ONE RETARGET.* diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md index 804f1536..129d3b2a 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md @@ -1,8 +1,8 @@ # ILightRelay -[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/relay/LightRelay.sol) **Inherits:** -[IRelay](/src/bridge/IRelay.sol/interface.IRelay.md) +[IRelay](../../bridge/IRelay.sol/interface.IRelay.md) ## Functions diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md index deeeae80..749c5caf 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md @@ -1,5 +1,5 @@ # RelayUtils -[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/relay/LightRelay.sol) ## Functions diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md index 35c01023..c0bea8d3 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md @@ -1,5 +1,5 @@ # Epoch -[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/relay/LightRelay.sol) ```solidity diff --git a/docs/docs/contracts/src/src/relay/README.md b/docs/docs/contracts/src/src/relay/README.md deleted file mode 100644 index 06222840..00000000 --- a/docs/docs/contracts/src/src/relay/README.md +++ /dev/null @@ -1,8 +0,0 @@ - - -# Contents -- [Epoch](LightRelay.sol/struct.Epoch.md) -- [ILightRelay](LightRelay.sol/interface.ILightRelay.md) -- [RelayUtils](LightRelay.sol/library.RelayUtils.md) -- [LightRelay](LightRelay.sol/contract.LightRelay.md) -- [TestLightRelay](TestLightRelay.sol/contract.TestLightRelay.md) diff --git a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md index 3c1d9ce8..a732680e 100644 --- a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md +++ b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md @@ -1,8 +1,8 @@ # TestLightRelay -[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/relay/TestLightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/relay/TestLightRelay.sol) **Inherits:** -[LightRelay](/src/relay/LightRelay.sol/contract.LightRelay.md) +[LightRelay](../../relay/LightRelay.sol/contract.LightRelay.md) TestLightRelay is a stub version of LightRelay intended to be used on for testing network. It allows to set the relay's diff --git a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md index e11b9fa7..eabb9c9e 100644 --- a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md +++ b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md @@ -1,5 +1,5 @@ # Bridge -[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/swap/Bridge.sol) +[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/swap/Bridge.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md index 63354d1e..ecb5e4d4 100644 --- a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md @@ -1,5 +1,5 @@ # BtcMarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/swap/Btc_Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/swap/Btc_Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md index 042dc1d4..546d371d 100644 --- a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md @@ -1,5 +1,5 @@ # MarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/swap/Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/swap/Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/README.md b/docs/docs/contracts/src/src/swap/README.md deleted file mode 100644 index cbed71f4..00000000 --- a/docs/docs/contracts/src/src/swap/README.md +++ /dev/null @@ -1,7 +0,0 @@ - - -# Contents -- [Bridge](Bridge.sol/contract.Bridge.md) -- [BtcMarketPlace](Btc_Marketplace.sol/contract.BtcMarketPlace.md) -- [MarketPlace](Marketplace.sol/contract.MarketPlace.md) -- [BobWrappedBtc](Wrapped.sol/contract.BobWrappedBtc.md) diff --git a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md index 27e90bc7..9bdee2da 100644 --- a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md +++ b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md @@ -1,5 +1,5 @@ # BobWrappedBtc -[Git Source](https://github.com/bob-collective/bob/blob/a99b3699ad3d0a3694628b215f3ada9fa41517db/src/swap/Wrapped.sol) +[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/swap/Wrapped.sol) **Inherits:** ERC20, ERC20Burnable, Ownable diff --git a/docs/package.json b/docs/package.json index 7b389a10..4d9b86f1 100644 --- a/docs/package.json +++ b/docs/package.json @@ -7,7 +7,7 @@ "install:sdk": "cd ../sdk && yarn install", "start": "docusaurus start", "build:docs": "docusaurus build", - "build": "python3 ../docs_reformat_scripts/forge_doc_reformat.py && yarn install:sdk && yarn build:docs", + "build": "python3 scripts/forge_doc_reformat.py && yarn install:sdk && yarn build:docs", "swizzle": "docusaurus swizzle", "deploy": "docusaurus deploy", "clear": "docusaurus clear", diff --git a/docs_reformat_scripts/forge_doc_reformat.py b/docs/scripts/forge_doc_reformat.py similarity index 98% rename from docs_reformat_scripts/forge_doc_reformat.py rename to docs/scripts/forge_doc_reformat.py index 1027feb0..cb47b7eb 100644 --- a/docs_reformat_scripts/forge_doc_reformat.py +++ b/docs/scripts/forge_doc_reformat.py @@ -61,7 +61,7 @@ def process_all_md_files(directory): if __name__ == "__main__": # Specify the directory path - directory_path = '../docs/docs/contracts/src' + directory_path = '../docs/contracts/src' # Process all Markdown files in the specified directory and its subdirectories process_all_md_files(directory_path) From 456fe37ae06eed4c593876aae4bf6d3e434d3e77 Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Wed, 13 Dec 2023 07:27:25 +0000 Subject: [PATCH 27/37] chore: Generate Foundry docs --- docs/docs/contracts/src/README.md | 48 +++++++++++++++++++ docs/docs/contracts/src/SUMMARY.md | 22 +++++++++ docs/docs/contracts/src/src/README.md | 7 +++ .../bridge/BitcoinTx.sol/library.BitcoinTx.md | 2 +- .../BridgeState.sol/library.BridgeState.md | 2 +- .../src/bridge/IRelay.sol/interface.IRelay.md | 2 +- docs/docs/contracts/src/src/bridge/README.md | 7 +++ .../bridge/WitnessTx.sol/library.WitnessTx.md | 2 +- .../Erc20Minter.sol/contract.Erc20Minter.md | 37 ++++++++++++++ .../interface.Erc20Mintable.md | 40 ++++++++++++++++ docs/docs/contracts/src/src/faucet/README.md | 5 ++ .../LightRelay.sol/contract.LightRelay.md | 4 +- .../LightRelay.sol/interface.ILightRelay.md | 4 +- .../LightRelay.sol/library.RelayUtils.md | 2 +- .../src/relay/LightRelay.sol/struct.Epoch.md | 2 +- docs/docs/contracts/src/src/relay/README.md | 8 ++++ .../contract.TestLightRelay.md | 4 +- .../src/swap/Bridge.sol/contract.Bridge.md | 2 +- .../contract.BtcMarketPlace.md | 2 +- .../Marketplace.sol/contract.MarketPlace.md | 2 +- docs/docs/contracts/src/src/swap/README.md | 7 +++ .../Wrapped.sol/contract.BobWrappedBtc.md | 2 +- 22 files changed, 197 insertions(+), 16 deletions(-) create mode 100644 docs/docs/contracts/src/README.md create mode 100644 docs/docs/contracts/src/SUMMARY.md create mode 100644 docs/docs/contracts/src/src/README.md create mode 100644 docs/docs/contracts/src/src/bridge/README.md create mode 100644 docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md create mode 100644 docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md create mode 100644 docs/docs/contracts/src/src/faucet/README.md create mode 100644 docs/docs/contracts/src/src/relay/README.md create mode 100644 docs/docs/contracts/src/src/swap/README.md diff --git a/docs/docs/contracts/src/README.md b/docs/docs/contracts/src/README.md new file mode 100644 index 00000000..6b91b9cc --- /dev/null +++ b/docs/docs/contracts/src/README.md @@ -0,0 +1,48 @@ +# Build on Bitcoin + +BOB is a Bitcoin-augmented rollup bringing experimentation and freedom of choice to builders to make a real-world impact. BOBs vision is to onboard the next billion users to Bitcoin. + +## Learn more + +- [Website](https://www.gobob.xyz/) +- [Docs](https://docs.gobob.xyz/) + +## Contribution + +BOB is an open-source project. We welcome contributions of all sorts. There are many ways to help, from reporting issues, contributing code, and helping us improve our community. + +## Getting Started + +We use foundry extensively for maintaining and testing this contract suite: + +### Build + +```shell +$ forge build +``` + +### Test + +```shell +$ forge test +``` + +### Format + +```shell +$ forge fmt +``` + +## Local Testnet + +To deploy the relay contract to a local environment for testing use our convenience script [here](https://github.com/bob-collective/bob/blob/master/sdk/scripts/init-bridge.ts): + +```shell +# start local ethereum testnet node +docker-compose up anvil +# run script to deploy the relay contract +cd sdk +yarn run deploy-relay --init-height 2016 --private-key dev-0 --dev --network testnet +``` + +The initialization height should be a multiple of 2016 with at least one subsequent retarget (i.e. if using 2016 as the starting height, blocks 4031-4032 must exist). \ No newline at end of file diff --git a/docs/docs/contracts/src/SUMMARY.md b/docs/docs/contracts/src/SUMMARY.md new file mode 100644 index 00000000..2da89532 --- /dev/null +++ b/docs/docs/contracts/src/SUMMARY.md @@ -0,0 +1,22 @@ +# Summary +- [Home](README.md) +# src + - [❱ bridge](src/bridge/README.md) + - [BitcoinTx](src/bridge/BitcoinTx.sol/library.BitcoinTx.md) + - [BridgeState](src/bridge/BridgeState.sol/library.BridgeState.md) + - [IRelay](src/bridge/IRelay.sol/interface.IRelay.md) + - [WitnessTx](src/bridge/WitnessTx.sol/library.WitnessTx.md) + - [❱ faucet](src/faucet/README.md) + - [Erc20Mintable](src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md) + - [Erc20Minter](src/faucet/Erc20Minter.sol/contract.Erc20Minter.md) + - [❱ relay](src/relay/README.md) + - [Epoch](src/relay/LightRelay.sol/struct.Epoch.md) + - [ILightRelay](src/relay/LightRelay.sol/interface.ILightRelay.md) + - [RelayUtils](src/relay/LightRelay.sol/library.RelayUtils.md) + - [LightRelay](src/relay/LightRelay.sol/contract.LightRelay.md) + - [TestLightRelay](src/relay/TestLightRelay.sol/contract.TestLightRelay.md) + - [❱ swap](src/swap/README.md) + - [Bridge](src/swap/Bridge.sol/contract.Bridge.md) + - [BtcMarketPlace](src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md) + - [MarketPlace](src/swap/Marketplace.sol/contract.MarketPlace.md) + - [BobWrappedBtc](src/swap/Wrapped.sol/contract.BobWrappedBtc.md) diff --git a/docs/docs/contracts/src/src/README.md b/docs/docs/contracts/src/src/README.md new file mode 100644 index 00000000..1a342451 --- /dev/null +++ b/docs/docs/contracts/src/src/README.md @@ -0,0 +1,7 @@ + + +# Contents +- [bridge](/src/bridge) +- [faucet](/src/faucet) +- [relay](/src/relay) +- [swap](/src/swap) diff --git a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md index 6c0e610f..5b04747d 100644 --- a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md +++ b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md @@ -1,5 +1,5 @@ # BitcoinTx -[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/bridge/BitcoinTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/bridge/BitcoinTx.sol) Allows to reference Bitcoin raw transaction in Solidity. diff --git a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md index 94048e19..5d049299 100644 --- a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md +++ b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md @@ -1,5 +1,5 @@ # BridgeState -[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/bridge/BridgeState.sol) +[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/bridge/BridgeState.sol) ## Structs diff --git a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md index 240da1e6..27c16c7a 100644 --- a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md +++ b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md @@ -1,5 +1,5 @@ # IRelay -[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/bridge/IRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/bridge/IRelay.sol) Contains only the methods needed by tBTC v2. The Bitcoin relay provides the difficulty of the previous and current epoch. One diff --git a/docs/docs/contracts/src/src/bridge/README.md b/docs/docs/contracts/src/src/bridge/README.md new file mode 100644 index 00000000..0fda2c04 --- /dev/null +++ b/docs/docs/contracts/src/src/bridge/README.md @@ -0,0 +1,7 @@ + + +# Contents +- [BitcoinTx](BitcoinTx.sol/library.BitcoinTx.md) +- [BridgeState](BridgeState.sol/library.BridgeState.md) +- [IRelay](IRelay.sol/interface.IRelay.md) +- [WitnessTx](WitnessTx.sol/library.WitnessTx.md) diff --git a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md index 6c36a9ed..41a28984 100644 --- a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md +++ b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md @@ -1,5 +1,5 @@ # WitnessTx -[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/bridge/WitnessTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/bridge/WitnessTx.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md new file mode 100644 index 00000000..5249d57d --- /dev/null +++ b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md @@ -0,0 +1,37 @@ +# Erc20Minter +[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/faucet/Erc20Minter.sol) + +**Inherits:** +Ownable + + +## State Variables +### nextTokenId + +```solidity +uint256 nextTokenId; +``` + + +### supportedErc20Addresses + +```solidity +mapping(uint256 => address) supportedErc20Addresses; +``` + + +## Functions +### addErc20 + + +```solidity +function addErc20(address newErc20) public onlyOwner; +``` + +### mint + + +```solidity +function mint() public; +``` + diff --git a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md new file mode 100644 index 00000000..b0d8e2c8 --- /dev/null +++ b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md @@ -0,0 +1,40 @@ +# Erc20Mintable +[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/faucet/Erc20Minter.sol) + + +## Functions +### decimals + + +```solidity +function decimals() external returns (uint256); +``` + +### mint + + +```solidity +function mint(uint256 amount) external; +``` + +### transfer + + +```solidity +function transfer(address to, uint256 amount) external returns (bool); +``` + +### approve + + +```solidity +function approve(address spender, uint256 amount) external; +``` + +### balanceOf + + +```solidity +function balanceOf(address account) external view returns (uint256); +``` + diff --git a/docs/docs/contracts/src/src/faucet/README.md b/docs/docs/contracts/src/src/faucet/README.md new file mode 100644 index 00000000..ff7ce46e --- /dev/null +++ b/docs/docs/contracts/src/src/faucet/README.md @@ -0,0 +1,5 @@ + + +# Contents +- [Erc20Mintable](Erc20Minter.sol/interface.Erc20Mintable.md) +- [Erc20Minter](Erc20Minter.sol/contract.Erc20Minter.md) diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md index 149a53b9..5ef66cf7 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md @@ -1,8 +1,8 @@ # LightRelay -[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/relay/LightRelay.sol) **Inherits:** -Ownable, [ILightRelay](../../relay/LightRelay.sol/interface.ILightRelay.md) +Ownable, [ILightRelay](/src/relay/LightRelay.sol/interface.ILightRelay.md) *THE RELAY MUST NOT BE USED BEFORE GENESIS AND AT LEAST ONE RETARGET.* diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md index 129d3b2a..43d08e38 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md @@ -1,8 +1,8 @@ # ILightRelay -[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/relay/LightRelay.sol) **Inherits:** -[IRelay](../../bridge/IRelay.sol/interface.IRelay.md) +[IRelay](/src/bridge/IRelay.sol/interface.IRelay.md) ## Functions diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md index 749c5caf..8f39cebe 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md @@ -1,5 +1,5 @@ # RelayUtils -[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/relay/LightRelay.sol) ## Functions diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md index c0bea8d3..2b7a1773 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md @@ -1,5 +1,5 @@ # Epoch -[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/relay/LightRelay.sol) ```solidity diff --git a/docs/docs/contracts/src/src/relay/README.md b/docs/docs/contracts/src/src/relay/README.md new file mode 100644 index 00000000..06222840 --- /dev/null +++ b/docs/docs/contracts/src/src/relay/README.md @@ -0,0 +1,8 @@ + + +# Contents +- [Epoch](LightRelay.sol/struct.Epoch.md) +- [ILightRelay](LightRelay.sol/interface.ILightRelay.md) +- [RelayUtils](LightRelay.sol/library.RelayUtils.md) +- [LightRelay](LightRelay.sol/contract.LightRelay.md) +- [TestLightRelay](TestLightRelay.sol/contract.TestLightRelay.md) diff --git a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md index a732680e..dd996a91 100644 --- a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md +++ b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md @@ -1,8 +1,8 @@ # TestLightRelay -[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/relay/TestLightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/relay/TestLightRelay.sol) **Inherits:** -[LightRelay](../../relay/LightRelay.sol/contract.LightRelay.md) +[LightRelay](/src/relay/LightRelay.sol/contract.LightRelay.md) TestLightRelay is a stub version of LightRelay intended to be used on for testing network. It allows to set the relay's diff --git a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md index eabb9c9e..757ee221 100644 --- a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md +++ b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md @@ -1,5 +1,5 @@ # Bridge -[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/swap/Bridge.sol) +[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/swap/Bridge.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md index ecb5e4d4..ebea09a2 100644 --- a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md @@ -1,5 +1,5 @@ # BtcMarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/swap/Btc_Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/swap/Btc_Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md index 546d371d..915d7248 100644 --- a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md @@ -1,5 +1,5 @@ # MarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/swap/Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/swap/Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/README.md b/docs/docs/contracts/src/src/swap/README.md new file mode 100644 index 00000000..cbed71f4 --- /dev/null +++ b/docs/docs/contracts/src/src/swap/README.md @@ -0,0 +1,7 @@ + + +# Contents +- [Bridge](Bridge.sol/contract.Bridge.md) +- [BtcMarketPlace](Btc_Marketplace.sol/contract.BtcMarketPlace.md) +- [MarketPlace](Marketplace.sol/contract.MarketPlace.md) +- [BobWrappedBtc](Wrapped.sol/contract.BobWrappedBtc.md) diff --git a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md index 9bdee2da..24b4950e 100644 --- a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md +++ b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md @@ -1,5 +1,5 @@ # BobWrappedBtc -[Git Source](https://github.com/bob-collective/bob/blob/51411a1dc3e9caf1fbd213b112cb280e5b93e6df/src/swap/Wrapped.sol) +[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/swap/Wrapped.sol) **Inherits:** ERC20, ERC20Burnable, Ownable From 80772f7c2d8f8ff44caab8044ebec86492593b3c Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Wed, 13 Dec 2023 07:31:14 +0000 Subject: [PATCH 28/37] chore: Generate Foundry docs --- .../contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md | 2 +- .../src/src/bridge/BridgeState.sol/library.BridgeState.md | 2 +- .../contracts/src/src/bridge/IRelay.sol/interface.IRelay.md | 2 +- .../contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md | 2 +- .../src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md | 2 +- .../src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md | 2 +- .../src/src/relay/LightRelay.sol/contract.LightRelay.md | 2 +- .../src/src/relay/LightRelay.sol/interface.ILightRelay.md | 2 +- .../src/src/relay/LightRelay.sol/library.RelayUtils.md | 2 +- .../docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md | 2 +- .../src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md | 2 +- docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md | 2 +- .../src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md | 2 +- .../src/src/swap/Marketplace.sol/contract.MarketPlace.md | 2 +- .../src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md index 5b04747d..286646f2 100644 --- a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md +++ b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md @@ -1,5 +1,5 @@ # BitcoinTx -[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/bridge/BitcoinTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/bridge/BitcoinTx.sol) Allows to reference Bitcoin raw transaction in Solidity. diff --git a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md index 5d049299..822b5892 100644 --- a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md +++ b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md @@ -1,5 +1,5 @@ # BridgeState -[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/bridge/BridgeState.sol) +[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/bridge/BridgeState.sol) ## Structs diff --git a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md index 27c16c7a..02c85c05 100644 --- a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md +++ b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md @@ -1,5 +1,5 @@ # IRelay -[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/bridge/IRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/bridge/IRelay.sol) Contains only the methods needed by tBTC v2. The Bitcoin relay provides the difficulty of the previous and current epoch. One diff --git a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md index 41a28984..58685a93 100644 --- a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md +++ b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md @@ -1,5 +1,5 @@ # WitnessTx -[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/bridge/WitnessTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/bridge/WitnessTx.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md index 5249d57d..399ad5e9 100644 --- a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md +++ b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md @@ -1,5 +1,5 @@ # Erc20Minter -[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/faucet/Erc20Minter.sol) +[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/faucet/Erc20Minter.sol) **Inherits:** Ownable diff --git a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md index b0d8e2c8..363d5efe 100644 --- a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md +++ b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md @@ -1,5 +1,5 @@ # Erc20Mintable -[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/faucet/Erc20Minter.sol) +[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/faucet/Erc20Minter.sol) ## Functions diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md index 5ef66cf7..47132f03 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md @@ -1,5 +1,5 @@ # LightRelay -[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/relay/LightRelay.sol) **Inherits:** Ownable, [ILightRelay](/src/relay/LightRelay.sol/interface.ILightRelay.md) diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md index 43d08e38..64cf8d92 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md @@ -1,5 +1,5 @@ # ILightRelay -[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/relay/LightRelay.sol) **Inherits:** [IRelay](/src/bridge/IRelay.sol/interface.IRelay.md) diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md index 8f39cebe..7bcaa257 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md @@ -1,5 +1,5 @@ # RelayUtils -[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/relay/LightRelay.sol) ## Functions diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md index 2b7a1773..c6d46682 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md @@ -1,5 +1,5 @@ # Epoch -[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/relay/LightRelay.sol) ```solidity diff --git a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md index dd996a91..ea21d43d 100644 --- a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md +++ b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md @@ -1,5 +1,5 @@ # TestLightRelay -[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/relay/TestLightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/relay/TestLightRelay.sol) **Inherits:** [LightRelay](/src/relay/LightRelay.sol/contract.LightRelay.md) diff --git a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md index 757ee221..b27f0455 100644 --- a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md +++ b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md @@ -1,5 +1,5 @@ # Bridge -[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/swap/Bridge.sol) +[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/swap/Bridge.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md index ebea09a2..90bd6d86 100644 --- a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md @@ -1,5 +1,5 @@ # BtcMarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/swap/Btc_Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/swap/Btc_Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md index 915d7248..f5bc57f8 100644 --- a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md @@ -1,5 +1,5 @@ # MarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/swap/Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/swap/Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md index 24b4950e..b91f5ecd 100644 --- a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md +++ b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md @@ -1,5 +1,5 @@ # BobWrappedBtc -[Git Source](https://github.com/bob-collective/bob/blob/8c3fe55e3293351a02cff493e52a7ca562403658/src/swap/Wrapped.sol) +[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/swap/Wrapped.sol) **Inherits:** ERC20, ERC20Burnable, Ownable From 1f6139438eebf27a2734d65f793e1f0d0b48a4f7 Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Wed, 13 Dec 2023 13:24:25 +0530 Subject: [PATCH 29/37] fix: update ci --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 84a960b7..3fa274e1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,7 +42,8 @@ jobs: - name: Run Forge docs run: | forge doc --out docs/docs/contracts - python3 docs/scripts/forge_doc_reformat.py + cd docs/scripts + python3 forge_doc_reformat.py - name: Commit Forge docs uses: stefanzweifel/git-auto-commit-action@v5 From 2956bf22cd7198fdbb50e9b1fe84376d1e1b7644 Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Wed, 13 Dec 2023 07:55:08 +0000 Subject: [PATCH 30/37] chore: Generate Foundry docs --- docs/docs/contracts/src/README.md | 48 ------------------- docs/docs/contracts/src/SUMMARY.md | 22 --------- docs/docs/contracts/src/src/README.md | 7 --- .../bridge/BitcoinTx.sol/library.BitcoinTx.md | 2 +- .../BridgeState.sol/library.BridgeState.md | 2 +- .../src/bridge/IRelay.sol/interface.IRelay.md | 2 +- docs/docs/contracts/src/src/bridge/README.md | 7 --- .../bridge/WitnessTx.sol/library.WitnessTx.md | 2 +- .../Erc20Minter.sol/contract.Erc20Minter.md | 2 +- .../interface.Erc20Mintable.md | 2 +- docs/docs/contracts/src/src/faucet/README.md | 5 -- .../LightRelay.sol/contract.LightRelay.md | 4 +- .../LightRelay.sol/interface.ILightRelay.md | 4 +- .../LightRelay.sol/library.RelayUtils.md | 2 +- .../src/relay/LightRelay.sol/struct.Epoch.md | 2 +- docs/docs/contracts/src/src/relay/README.md | 8 ---- .../contract.TestLightRelay.md | 4 +- .../src/swap/Bridge.sol/contract.Bridge.md | 2 +- .../contract.BtcMarketPlace.md | 2 +- .../Marketplace.sol/contract.MarketPlace.md | 2 +- docs/docs/contracts/src/src/swap/README.md | 7 --- .../Wrapped.sol/contract.BobWrappedBtc.md | 2 +- 22 files changed, 18 insertions(+), 122 deletions(-) delete mode 100644 docs/docs/contracts/src/README.md delete mode 100644 docs/docs/contracts/src/SUMMARY.md delete mode 100644 docs/docs/contracts/src/src/README.md delete mode 100644 docs/docs/contracts/src/src/bridge/README.md delete mode 100644 docs/docs/contracts/src/src/faucet/README.md delete mode 100644 docs/docs/contracts/src/src/relay/README.md delete mode 100644 docs/docs/contracts/src/src/swap/README.md diff --git a/docs/docs/contracts/src/README.md b/docs/docs/contracts/src/README.md deleted file mode 100644 index 6b91b9cc..00000000 --- a/docs/docs/contracts/src/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# Build on Bitcoin - -BOB is a Bitcoin-augmented rollup bringing experimentation and freedom of choice to builders to make a real-world impact. BOBs vision is to onboard the next billion users to Bitcoin. - -## Learn more - -- [Website](https://www.gobob.xyz/) -- [Docs](https://docs.gobob.xyz/) - -## Contribution - -BOB is an open-source project. We welcome contributions of all sorts. There are many ways to help, from reporting issues, contributing code, and helping us improve our community. - -## Getting Started - -We use foundry extensively for maintaining and testing this contract suite: - -### Build - -```shell -$ forge build -``` - -### Test - -```shell -$ forge test -``` - -### Format - -```shell -$ forge fmt -``` - -## Local Testnet - -To deploy the relay contract to a local environment for testing use our convenience script [here](https://github.com/bob-collective/bob/blob/master/sdk/scripts/init-bridge.ts): - -```shell -# start local ethereum testnet node -docker-compose up anvil -# run script to deploy the relay contract -cd sdk -yarn run deploy-relay --init-height 2016 --private-key dev-0 --dev --network testnet -``` - -The initialization height should be a multiple of 2016 with at least one subsequent retarget (i.e. if using 2016 as the starting height, blocks 4031-4032 must exist). \ No newline at end of file diff --git a/docs/docs/contracts/src/SUMMARY.md b/docs/docs/contracts/src/SUMMARY.md deleted file mode 100644 index 2da89532..00000000 --- a/docs/docs/contracts/src/SUMMARY.md +++ /dev/null @@ -1,22 +0,0 @@ -# Summary -- [Home](README.md) -# src - - [❱ bridge](src/bridge/README.md) - - [BitcoinTx](src/bridge/BitcoinTx.sol/library.BitcoinTx.md) - - [BridgeState](src/bridge/BridgeState.sol/library.BridgeState.md) - - [IRelay](src/bridge/IRelay.sol/interface.IRelay.md) - - [WitnessTx](src/bridge/WitnessTx.sol/library.WitnessTx.md) - - [❱ faucet](src/faucet/README.md) - - [Erc20Mintable](src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md) - - [Erc20Minter](src/faucet/Erc20Minter.sol/contract.Erc20Minter.md) - - [❱ relay](src/relay/README.md) - - [Epoch](src/relay/LightRelay.sol/struct.Epoch.md) - - [ILightRelay](src/relay/LightRelay.sol/interface.ILightRelay.md) - - [RelayUtils](src/relay/LightRelay.sol/library.RelayUtils.md) - - [LightRelay](src/relay/LightRelay.sol/contract.LightRelay.md) - - [TestLightRelay](src/relay/TestLightRelay.sol/contract.TestLightRelay.md) - - [❱ swap](src/swap/README.md) - - [Bridge](src/swap/Bridge.sol/contract.Bridge.md) - - [BtcMarketPlace](src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md) - - [MarketPlace](src/swap/Marketplace.sol/contract.MarketPlace.md) - - [BobWrappedBtc](src/swap/Wrapped.sol/contract.BobWrappedBtc.md) diff --git a/docs/docs/contracts/src/src/README.md b/docs/docs/contracts/src/src/README.md deleted file mode 100644 index 1a342451..00000000 --- a/docs/docs/contracts/src/src/README.md +++ /dev/null @@ -1,7 +0,0 @@ - - -# Contents -- [bridge](/src/bridge) -- [faucet](/src/faucet) -- [relay](/src/relay) -- [swap](/src/swap) diff --git a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md index 286646f2..37b0bb30 100644 --- a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md +++ b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md @@ -1,5 +1,5 @@ # BitcoinTx -[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/bridge/BitcoinTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/bridge/BitcoinTx.sol) Allows to reference Bitcoin raw transaction in Solidity. diff --git a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md index 822b5892..94c20f75 100644 --- a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md +++ b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md @@ -1,5 +1,5 @@ # BridgeState -[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/bridge/BridgeState.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/bridge/BridgeState.sol) ## Structs diff --git a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md index 02c85c05..597c6e01 100644 --- a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md +++ b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md @@ -1,5 +1,5 @@ # IRelay -[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/bridge/IRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/bridge/IRelay.sol) Contains only the methods needed by tBTC v2. The Bitcoin relay provides the difficulty of the previous and current epoch. One diff --git a/docs/docs/contracts/src/src/bridge/README.md b/docs/docs/contracts/src/src/bridge/README.md deleted file mode 100644 index 0fda2c04..00000000 --- a/docs/docs/contracts/src/src/bridge/README.md +++ /dev/null @@ -1,7 +0,0 @@ - - -# Contents -- [BitcoinTx](BitcoinTx.sol/library.BitcoinTx.md) -- [BridgeState](BridgeState.sol/library.BridgeState.md) -- [IRelay](IRelay.sol/interface.IRelay.md) -- [WitnessTx](WitnessTx.sol/library.WitnessTx.md) diff --git a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md index 58685a93..c50df402 100644 --- a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md +++ b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md @@ -1,5 +1,5 @@ # WitnessTx -[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/bridge/WitnessTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/bridge/WitnessTx.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md index 399ad5e9..cbda96c5 100644 --- a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md +++ b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md @@ -1,5 +1,5 @@ # Erc20Minter -[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/faucet/Erc20Minter.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/faucet/Erc20Minter.sol) **Inherits:** Ownable diff --git a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md index 363d5efe..a2f58611 100644 --- a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md +++ b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md @@ -1,5 +1,5 @@ # Erc20Mintable -[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/faucet/Erc20Minter.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/faucet/Erc20Minter.sol) ## Functions diff --git a/docs/docs/contracts/src/src/faucet/README.md b/docs/docs/contracts/src/src/faucet/README.md deleted file mode 100644 index ff7ce46e..00000000 --- a/docs/docs/contracts/src/src/faucet/README.md +++ /dev/null @@ -1,5 +0,0 @@ - - -# Contents -- [Erc20Mintable](Erc20Minter.sol/interface.Erc20Mintable.md) -- [Erc20Minter](Erc20Minter.sol/contract.Erc20Minter.md) diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md index 47132f03..d1e4dee7 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md @@ -1,8 +1,8 @@ # LightRelay -[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/relay/LightRelay.sol) **Inherits:** -Ownable, [ILightRelay](/src/relay/LightRelay.sol/interface.ILightRelay.md) +Ownable, [ILightRelay](../../relay/LightRelay.sol/interface.ILightRelay.md) *THE RELAY MUST NOT BE USED BEFORE GENESIS AND AT LEAST ONE RETARGET.* diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md index 64cf8d92..9475a8af 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md @@ -1,8 +1,8 @@ # ILightRelay -[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/relay/LightRelay.sol) **Inherits:** -[IRelay](/src/bridge/IRelay.sol/interface.IRelay.md) +[IRelay](../../bridge/IRelay.sol/interface.IRelay.md) ## Functions diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md index 7bcaa257..abe86c98 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md @@ -1,5 +1,5 @@ # RelayUtils -[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/relay/LightRelay.sol) ## Functions diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md index c6d46682..353e89f4 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md @@ -1,5 +1,5 @@ # Epoch -[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/relay/LightRelay.sol) ```solidity diff --git a/docs/docs/contracts/src/src/relay/README.md b/docs/docs/contracts/src/src/relay/README.md deleted file mode 100644 index 06222840..00000000 --- a/docs/docs/contracts/src/src/relay/README.md +++ /dev/null @@ -1,8 +0,0 @@ - - -# Contents -- [Epoch](LightRelay.sol/struct.Epoch.md) -- [ILightRelay](LightRelay.sol/interface.ILightRelay.md) -- [RelayUtils](LightRelay.sol/library.RelayUtils.md) -- [LightRelay](LightRelay.sol/contract.LightRelay.md) -- [TestLightRelay](TestLightRelay.sol/contract.TestLightRelay.md) diff --git a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md index ea21d43d..4ef5002d 100644 --- a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md +++ b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md @@ -1,8 +1,8 @@ # TestLightRelay -[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/relay/TestLightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/relay/TestLightRelay.sol) **Inherits:** -[LightRelay](/src/relay/LightRelay.sol/contract.LightRelay.md) +[LightRelay](../../relay/LightRelay.sol/contract.LightRelay.md) TestLightRelay is a stub version of LightRelay intended to be used on for testing network. It allows to set the relay's diff --git a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md index b27f0455..35cd8d88 100644 --- a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md +++ b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md @@ -1,5 +1,5 @@ # Bridge -[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/swap/Bridge.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/swap/Bridge.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md index 90bd6d86..9c2f3815 100644 --- a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md @@ -1,5 +1,5 @@ # BtcMarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/swap/Btc_Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/swap/Btc_Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md index f5bc57f8..697e5490 100644 --- a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md @@ -1,5 +1,5 @@ # MarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/swap/Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/swap/Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/README.md b/docs/docs/contracts/src/src/swap/README.md deleted file mode 100644 index cbed71f4..00000000 --- a/docs/docs/contracts/src/src/swap/README.md +++ /dev/null @@ -1,7 +0,0 @@ - - -# Contents -- [Bridge](Bridge.sol/contract.Bridge.md) -- [BtcMarketPlace](Btc_Marketplace.sol/contract.BtcMarketPlace.md) -- [MarketPlace](Marketplace.sol/contract.MarketPlace.md) -- [BobWrappedBtc](Wrapped.sol/contract.BobWrappedBtc.md) diff --git a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md index b91f5ecd..9bdbd55b 100644 --- a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md +++ b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md @@ -1,5 +1,5 @@ # BobWrappedBtc -[Git Source](https://github.com/bob-collective/bob/blob/abb5084b54645fa5dfcdae21ebb12974a2bcbb80/src/swap/Wrapped.sol) +[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/swap/Wrapped.sol) **Inherits:** ERC20, ERC20Burnable, Ownable From d9c9196f0c99ad631c4c8411f2d25decea2e634f Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Wed, 13 Dec 2023 14:39:46 +0530 Subject: [PATCH 31/37] fix: remove python script command from ci --- .github/workflows/test.yml | 2 -- docs/scripts/forge_doc_reformat.py | 7 +++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3fa274e1..96859f3a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,8 +42,6 @@ jobs: - name: Run Forge docs run: | forge doc --out docs/docs/contracts - cd docs/scripts - python3 forge_doc_reformat.py - name: Commit Forge docs uses: stefanzweifel/git-auto-commit-action@v5 diff --git a/docs/scripts/forge_doc_reformat.py b/docs/scripts/forge_doc_reformat.py index cb47b7eb..eadbe040 100644 --- a/docs/scripts/forge_doc_reformat.py +++ b/docs/scripts/forge_doc_reformat.py @@ -60,8 +60,11 @@ def process_all_md_files(directory): process_md_file(file_path) if __name__ == "__main__": - # Specify the directory path - directory_path = '../docs/contracts/src' + # Get the absolute path of the directory containing the script + script_directory = os.path.dirname(os.path.abspath(__file__)) + + # Specify the directory path relative to the script + directory_path = os.path.join(script_directory, '../docs/contracts/src') # Process all Markdown files in the specified directory and its subdirectories process_all_md_files(directory_path) From 2ea7c12fc24227037cd30e02c78abc007e8901f4 Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Wed, 13 Dec 2023 09:10:23 +0000 Subject: [PATCH 32/37] chore: Generate Foundry docs --- docs/docs/contracts/src/README.md | 48 +++++++++++++++++++ docs/docs/contracts/src/SUMMARY.md | 22 +++++++++ docs/docs/contracts/src/src/README.md | 7 +++ .../bridge/BitcoinTx.sol/library.BitcoinTx.md | 2 +- .../BridgeState.sol/library.BridgeState.md | 2 +- .../src/bridge/IRelay.sol/interface.IRelay.md | 2 +- docs/docs/contracts/src/src/bridge/README.md | 7 +++ .../bridge/WitnessTx.sol/library.WitnessTx.md | 2 +- .../Erc20Minter.sol/contract.Erc20Minter.md | 2 +- .../interface.Erc20Mintable.md | 2 +- docs/docs/contracts/src/src/faucet/README.md | 5 ++ .../LightRelay.sol/contract.LightRelay.md | 4 +- .../LightRelay.sol/interface.ILightRelay.md | 4 +- .../LightRelay.sol/library.RelayUtils.md | 2 +- .../src/relay/LightRelay.sol/struct.Epoch.md | 2 +- docs/docs/contracts/src/src/relay/README.md | 8 ++++ .../contract.TestLightRelay.md | 4 +- .../src/swap/Bridge.sol/contract.Bridge.md | 2 +- .../contract.BtcMarketPlace.md | 2 +- .../Marketplace.sol/contract.MarketPlace.md | 2 +- docs/docs/contracts/src/src/swap/README.md | 7 +++ .../Wrapped.sol/contract.BobWrappedBtc.md | 2 +- 22 files changed, 122 insertions(+), 18 deletions(-) create mode 100644 docs/docs/contracts/src/README.md create mode 100644 docs/docs/contracts/src/SUMMARY.md create mode 100644 docs/docs/contracts/src/src/README.md create mode 100644 docs/docs/contracts/src/src/bridge/README.md create mode 100644 docs/docs/contracts/src/src/faucet/README.md create mode 100644 docs/docs/contracts/src/src/relay/README.md create mode 100644 docs/docs/contracts/src/src/swap/README.md diff --git a/docs/docs/contracts/src/README.md b/docs/docs/contracts/src/README.md new file mode 100644 index 00000000..6b91b9cc --- /dev/null +++ b/docs/docs/contracts/src/README.md @@ -0,0 +1,48 @@ +# Build on Bitcoin + +BOB is a Bitcoin-augmented rollup bringing experimentation and freedom of choice to builders to make a real-world impact. BOBs vision is to onboard the next billion users to Bitcoin. + +## Learn more + +- [Website](https://www.gobob.xyz/) +- [Docs](https://docs.gobob.xyz/) + +## Contribution + +BOB is an open-source project. We welcome contributions of all sorts. There are many ways to help, from reporting issues, contributing code, and helping us improve our community. + +## Getting Started + +We use foundry extensively for maintaining and testing this contract suite: + +### Build + +```shell +$ forge build +``` + +### Test + +```shell +$ forge test +``` + +### Format + +```shell +$ forge fmt +``` + +## Local Testnet + +To deploy the relay contract to a local environment for testing use our convenience script [here](https://github.com/bob-collective/bob/blob/master/sdk/scripts/init-bridge.ts): + +```shell +# start local ethereum testnet node +docker-compose up anvil +# run script to deploy the relay contract +cd sdk +yarn run deploy-relay --init-height 2016 --private-key dev-0 --dev --network testnet +``` + +The initialization height should be a multiple of 2016 with at least one subsequent retarget (i.e. if using 2016 as the starting height, blocks 4031-4032 must exist). \ No newline at end of file diff --git a/docs/docs/contracts/src/SUMMARY.md b/docs/docs/contracts/src/SUMMARY.md new file mode 100644 index 00000000..2da89532 --- /dev/null +++ b/docs/docs/contracts/src/SUMMARY.md @@ -0,0 +1,22 @@ +# Summary +- [Home](README.md) +# src + - [❱ bridge](src/bridge/README.md) + - [BitcoinTx](src/bridge/BitcoinTx.sol/library.BitcoinTx.md) + - [BridgeState](src/bridge/BridgeState.sol/library.BridgeState.md) + - [IRelay](src/bridge/IRelay.sol/interface.IRelay.md) + - [WitnessTx](src/bridge/WitnessTx.sol/library.WitnessTx.md) + - [❱ faucet](src/faucet/README.md) + - [Erc20Mintable](src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md) + - [Erc20Minter](src/faucet/Erc20Minter.sol/contract.Erc20Minter.md) + - [❱ relay](src/relay/README.md) + - [Epoch](src/relay/LightRelay.sol/struct.Epoch.md) + - [ILightRelay](src/relay/LightRelay.sol/interface.ILightRelay.md) + - [RelayUtils](src/relay/LightRelay.sol/library.RelayUtils.md) + - [LightRelay](src/relay/LightRelay.sol/contract.LightRelay.md) + - [TestLightRelay](src/relay/TestLightRelay.sol/contract.TestLightRelay.md) + - [❱ swap](src/swap/README.md) + - [Bridge](src/swap/Bridge.sol/contract.Bridge.md) + - [BtcMarketPlace](src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md) + - [MarketPlace](src/swap/Marketplace.sol/contract.MarketPlace.md) + - [BobWrappedBtc](src/swap/Wrapped.sol/contract.BobWrappedBtc.md) diff --git a/docs/docs/contracts/src/src/README.md b/docs/docs/contracts/src/src/README.md new file mode 100644 index 00000000..1a342451 --- /dev/null +++ b/docs/docs/contracts/src/src/README.md @@ -0,0 +1,7 @@ + + +# Contents +- [bridge](/src/bridge) +- [faucet](/src/faucet) +- [relay](/src/relay) +- [swap](/src/swap) diff --git a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md index 37b0bb30..bf3ac3d3 100644 --- a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md +++ b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md @@ -1,5 +1,5 @@ # BitcoinTx -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/bridge/BitcoinTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9fd4522721442ac5e04e105bccf23b16c8ad31a6/src/bridge/BitcoinTx.sol) Allows to reference Bitcoin raw transaction in Solidity. diff --git a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md index 94c20f75..4a8c5a36 100644 --- a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md +++ b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md @@ -1,5 +1,5 @@ # BridgeState -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/bridge/BridgeState.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9fd4522721442ac5e04e105bccf23b16c8ad31a6/src/bridge/BridgeState.sol) ## Structs diff --git a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md index 597c6e01..7f0181e9 100644 --- a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md +++ b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md @@ -1,5 +1,5 @@ # IRelay -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/bridge/IRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9fd4522721442ac5e04e105bccf23b16c8ad31a6/src/bridge/IRelay.sol) Contains only the methods needed by tBTC v2. The Bitcoin relay provides the difficulty of the previous and current epoch. One diff --git a/docs/docs/contracts/src/src/bridge/README.md b/docs/docs/contracts/src/src/bridge/README.md new file mode 100644 index 00000000..0fda2c04 --- /dev/null +++ b/docs/docs/contracts/src/src/bridge/README.md @@ -0,0 +1,7 @@ + + +# Contents +- [BitcoinTx](BitcoinTx.sol/library.BitcoinTx.md) +- [BridgeState](BridgeState.sol/library.BridgeState.md) +- [IRelay](IRelay.sol/interface.IRelay.md) +- [WitnessTx](WitnessTx.sol/library.WitnessTx.md) diff --git a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md index c50df402..6750d88c 100644 --- a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md +++ b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md @@ -1,5 +1,5 @@ # WitnessTx -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/bridge/WitnessTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9fd4522721442ac5e04e105bccf23b16c8ad31a6/src/bridge/WitnessTx.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md index cbda96c5..a5806508 100644 --- a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md +++ b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md @@ -1,5 +1,5 @@ # Erc20Minter -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/faucet/Erc20Minter.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9fd4522721442ac5e04e105bccf23b16c8ad31a6/src/faucet/Erc20Minter.sol) **Inherits:** Ownable diff --git a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md index a2f58611..678f0400 100644 --- a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md +++ b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md @@ -1,5 +1,5 @@ # Erc20Mintable -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/faucet/Erc20Minter.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9fd4522721442ac5e04e105bccf23b16c8ad31a6/src/faucet/Erc20Minter.sol) ## Functions diff --git a/docs/docs/contracts/src/src/faucet/README.md b/docs/docs/contracts/src/src/faucet/README.md new file mode 100644 index 00000000..ff7ce46e --- /dev/null +++ b/docs/docs/contracts/src/src/faucet/README.md @@ -0,0 +1,5 @@ + + +# Contents +- [Erc20Mintable](Erc20Minter.sol/interface.Erc20Mintable.md) +- [Erc20Minter](Erc20Minter.sol/contract.Erc20Minter.md) diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md index d1e4dee7..81f97cf9 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md @@ -1,8 +1,8 @@ # LightRelay -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9fd4522721442ac5e04e105bccf23b16c8ad31a6/src/relay/LightRelay.sol) **Inherits:** -Ownable, [ILightRelay](../../relay/LightRelay.sol/interface.ILightRelay.md) +Ownable, [ILightRelay](/src/relay/LightRelay.sol/interface.ILightRelay.md) *THE RELAY MUST NOT BE USED BEFORE GENESIS AND AT LEAST ONE RETARGET.* diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md index 9475a8af..a1e66abe 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md @@ -1,8 +1,8 @@ # ILightRelay -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9fd4522721442ac5e04e105bccf23b16c8ad31a6/src/relay/LightRelay.sol) **Inherits:** -[IRelay](../../bridge/IRelay.sol/interface.IRelay.md) +[IRelay](/src/bridge/IRelay.sol/interface.IRelay.md) ## Functions diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md index abe86c98..591b5964 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md @@ -1,5 +1,5 @@ # RelayUtils -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9fd4522721442ac5e04e105bccf23b16c8ad31a6/src/relay/LightRelay.sol) ## Functions diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md index 353e89f4..8847d7f4 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md @@ -1,5 +1,5 @@ # Epoch -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9fd4522721442ac5e04e105bccf23b16c8ad31a6/src/relay/LightRelay.sol) ```solidity diff --git a/docs/docs/contracts/src/src/relay/README.md b/docs/docs/contracts/src/src/relay/README.md new file mode 100644 index 00000000..06222840 --- /dev/null +++ b/docs/docs/contracts/src/src/relay/README.md @@ -0,0 +1,8 @@ + + +# Contents +- [Epoch](LightRelay.sol/struct.Epoch.md) +- [ILightRelay](LightRelay.sol/interface.ILightRelay.md) +- [RelayUtils](LightRelay.sol/library.RelayUtils.md) +- [LightRelay](LightRelay.sol/contract.LightRelay.md) +- [TestLightRelay](TestLightRelay.sol/contract.TestLightRelay.md) diff --git a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md index 4ef5002d..dea3cbcc 100644 --- a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md +++ b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md @@ -1,8 +1,8 @@ # TestLightRelay -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/relay/TestLightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9fd4522721442ac5e04e105bccf23b16c8ad31a6/src/relay/TestLightRelay.sol) **Inherits:** -[LightRelay](../../relay/LightRelay.sol/contract.LightRelay.md) +[LightRelay](/src/relay/LightRelay.sol/contract.LightRelay.md) TestLightRelay is a stub version of LightRelay intended to be used on for testing network. It allows to set the relay's diff --git a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md index 35cd8d88..938c2a6e 100644 --- a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md +++ b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md @@ -1,5 +1,5 @@ # Bridge -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/swap/Bridge.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9fd4522721442ac5e04e105bccf23b16c8ad31a6/src/swap/Bridge.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md index 9c2f3815..c38fade0 100644 --- a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md @@ -1,5 +1,5 @@ # BtcMarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/swap/Btc_Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9fd4522721442ac5e04e105bccf23b16c8ad31a6/src/swap/Btc_Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md index 697e5490..469eddcd 100644 --- a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md @@ -1,5 +1,5 @@ # MarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/swap/Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9fd4522721442ac5e04e105bccf23b16c8ad31a6/src/swap/Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/README.md b/docs/docs/contracts/src/src/swap/README.md new file mode 100644 index 00000000..cbed71f4 --- /dev/null +++ b/docs/docs/contracts/src/src/swap/README.md @@ -0,0 +1,7 @@ + + +# Contents +- [Bridge](Bridge.sol/contract.Bridge.md) +- [BtcMarketPlace](Btc_Marketplace.sol/contract.BtcMarketPlace.md) +- [MarketPlace](Marketplace.sol/contract.MarketPlace.md) +- [BobWrappedBtc](Wrapped.sol/contract.BobWrappedBtc.md) diff --git a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md index 9bdbd55b..40239f34 100644 --- a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md +++ b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md @@ -1,5 +1,5 @@ # BobWrappedBtc -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/swap/Wrapped.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9fd4522721442ac5e04e105bccf23b16c8ad31a6/src/swap/Wrapped.sol) **Inherits:** ERC20, ERC20Burnable, Ownable From eeecf07b873a9ba246ea78b0d74f84073db1c7c8 Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Wed, 13 Dec 2023 14:58:48 +0530 Subject: [PATCH 33/37] fix: remove python command from package.json --- .github/workflows/test.yml | 1 + .../contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md | 2 +- .../src/src/bridge/BridgeState.sol/library.BridgeState.md | 2 +- .../contracts/src/src/bridge/IRelay.sol/interface.IRelay.md | 2 +- .../contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md | 2 +- .../src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md | 2 +- .../src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md | 2 +- .../src/src/relay/LightRelay.sol/contract.LightRelay.md | 2 +- .../src/src/relay/LightRelay.sol/interface.ILightRelay.md | 2 +- .../src/src/relay/LightRelay.sol/library.RelayUtils.md | 2 +- .../docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md | 2 +- .../src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md | 2 +- docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md | 2 +- .../src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md | 2 +- .../src/src/swap/Marketplace.sol/contract.MarketPlace.md | 2 +- .../src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md | 2 +- docs/package.json | 2 +- 17 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 96859f3a..84a960b7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,6 +42,7 @@ jobs: - name: Run Forge docs run: | forge doc --out docs/docs/contracts + python3 docs/scripts/forge_doc_reformat.py - name: Commit Forge docs uses: stefanzweifel/git-auto-commit-action@v5 diff --git a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md index 37b0bb30..9652f040 100644 --- a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md +++ b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md @@ -1,5 +1,5 @@ # BitcoinTx -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/bridge/BitcoinTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/bridge/BitcoinTx.sol) Allows to reference Bitcoin raw transaction in Solidity. diff --git a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md index 94c20f75..c884c4fb 100644 --- a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md +++ b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md @@ -1,5 +1,5 @@ # BridgeState -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/bridge/BridgeState.sol) +[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/bridge/BridgeState.sol) ## Structs diff --git a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md index 597c6e01..0d300d82 100644 --- a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md +++ b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md @@ -1,5 +1,5 @@ # IRelay -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/bridge/IRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/bridge/IRelay.sol) Contains only the methods needed by tBTC v2. The Bitcoin relay provides the difficulty of the previous and current epoch. One diff --git a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md index c50df402..c3b66c32 100644 --- a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md +++ b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md @@ -1,5 +1,5 @@ # WitnessTx -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/bridge/WitnessTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/bridge/WitnessTx.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md index cbda96c5..29385949 100644 --- a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md +++ b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md @@ -1,5 +1,5 @@ # Erc20Minter -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/faucet/Erc20Minter.sol) +[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/faucet/Erc20Minter.sol) **Inherits:** Ownable diff --git a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md index a2f58611..bae0ebeb 100644 --- a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md +++ b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md @@ -1,5 +1,5 @@ # Erc20Mintable -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/faucet/Erc20Minter.sol) +[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/faucet/Erc20Minter.sol) ## Functions diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md index d1e4dee7..9712cd70 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md @@ -1,5 +1,5 @@ # LightRelay -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/relay/LightRelay.sol) **Inherits:** Ownable, [ILightRelay](../../relay/LightRelay.sol/interface.ILightRelay.md) diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md index 9475a8af..930b0bed 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md @@ -1,5 +1,5 @@ # ILightRelay -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/relay/LightRelay.sol) **Inherits:** [IRelay](../../bridge/IRelay.sol/interface.IRelay.md) diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md index abe86c98..774934d0 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md @@ -1,5 +1,5 @@ # RelayUtils -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/relay/LightRelay.sol) ## Functions diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md index 353e89f4..dbd95732 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md @@ -1,5 +1,5 @@ # Epoch -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/relay/LightRelay.sol) ```solidity diff --git a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md index 4ef5002d..85591b2d 100644 --- a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md +++ b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md @@ -1,5 +1,5 @@ # TestLightRelay -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/relay/TestLightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/relay/TestLightRelay.sol) **Inherits:** [LightRelay](../../relay/LightRelay.sol/contract.LightRelay.md) diff --git a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md index 35cd8d88..84a3244e 100644 --- a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md +++ b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md @@ -1,5 +1,5 @@ # Bridge -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/swap/Bridge.sol) +[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/swap/Bridge.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md index 9c2f3815..ffb09a12 100644 --- a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md @@ -1,5 +1,5 @@ # BtcMarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/swap/Btc_Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/swap/Btc_Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md index 697e5490..fb090fb8 100644 --- a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md @@ -1,5 +1,5 @@ # MarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/swap/Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/swap/Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md index 9bdbd55b..c189297d 100644 --- a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md +++ b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md @@ -1,5 +1,5 @@ # BobWrappedBtc -[Git Source](https://github.com/bob-collective/bob/blob/b2d54e5c3996ef2181be170d263691c7d860e253/src/swap/Wrapped.sol) +[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/swap/Wrapped.sol) **Inherits:** ERC20, ERC20Burnable, Ownable diff --git a/docs/package.json b/docs/package.json index 4d9b86f1..23d38bd4 100644 --- a/docs/package.json +++ b/docs/package.json @@ -7,7 +7,7 @@ "install:sdk": "cd ../sdk && yarn install", "start": "docusaurus start", "build:docs": "docusaurus build", - "build": "python3 scripts/forge_doc_reformat.py && yarn install:sdk && yarn build:docs", + "build": "yarn install:sdk && yarn build:docs", "swizzle": "docusaurus swizzle", "deploy": "docusaurus deploy", "clear": "docusaurus clear", From 413a802024a42b60f092f1454b12d27825873a79 Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Wed, 13 Dec 2023 15:00:26 +0530 Subject: [PATCH 34/37] fix: remove python command from package.json --- docs/docs/contracts/src/README.md | 48 ------------------- docs/docs/contracts/src/SUMMARY.md | 22 --------- docs/docs/contracts/src/src/README.md | 7 --- .../bridge/BitcoinTx.sol/library.BitcoinTx.md | 2 +- .../BridgeState.sol/library.BridgeState.md | 2 +- .../src/bridge/IRelay.sol/interface.IRelay.md | 2 +- docs/docs/contracts/src/src/bridge/README.md | 7 --- .../bridge/WitnessTx.sol/library.WitnessTx.md | 2 +- .../Erc20Minter.sol/contract.Erc20Minter.md | 2 +- .../interface.Erc20Mintable.md | 2 +- docs/docs/contracts/src/src/faucet/README.md | 5 -- .../LightRelay.sol/contract.LightRelay.md | 2 +- .../LightRelay.sol/interface.ILightRelay.md | 2 +- .../LightRelay.sol/library.RelayUtils.md | 2 +- .../src/relay/LightRelay.sol/struct.Epoch.md | 2 +- docs/docs/contracts/src/src/relay/README.md | 8 ---- .../contract.TestLightRelay.md | 2 +- .../src/swap/Bridge.sol/contract.Bridge.md | 2 +- .../contract.BtcMarketPlace.md | 2 +- .../Marketplace.sol/contract.MarketPlace.md | 2 +- docs/docs/contracts/src/src/swap/README.md | 7 --- .../Wrapped.sol/contract.BobWrappedBtc.md | 2 +- 22 files changed, 15 insertions(+), 119 deletions(-) delete mode 100644 docs/docs/contracts/src/README.md delete mode 100644 docs/docs/contracts/src/SUMMARY.md delete mode 100644 docs/docs/contracts/src/src/README.md delete mode 100644 docs/docs/contracts/src/src/bridge/README.md delete mode 100644 docs/docs/contracts/src/src/faucet/README.md delete mode 100644 docs/docs/contracts/src/src/relay/README.md delete mode 100644 docs/docs/contracts/src/src/swap/README.md diff --git a/docs/docs/contracts/src/README.md b/docs/docs/contracts/src/README.md deleted file mode 100644 index 6b91b9cc..00000000 --- a/docs/docs/contracts/src/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# Build on Bitcoin - -BOB is a Bitcoin-augmented rollup bringing experimentation and freedom of choice to builders to make a real-world impact. BOBs vision is to onboard the next billion users to Bitcoin. - -## Learn more - -- [Website](https://www.gobob.xyz/) -- [Docs](https://docs.gobob.xyz/) - -## Contribution - -BOB is an open-source project. We welcome contributions of all sorts. There are many ways to help, from reporting issues, contributing code, and helping us improve our community. - -## Getting Started - -We use foundry extensively for maintaining and testing this contract suite: - -### Build - -```shell -$ forge build -``` - -### Test - -```shell -$ forge test -``` - -### Format - -```shell -$ forge fmt -``` - -## Local Testnet - -To deploy the relay contract to a local environment for testing use our convenience script [here](https://github.com/bob-collective/bob/blob/master/sdk/scripts/init-bridge.ts): - -```shell -# start local ethereum testnet node -docker-compose up anvil -# run script to deploy the relay contract -cd sdk -yarn run deploy-relay --init-height 2016 --private-key dev-0 --dev --network testnet -``` - -The initialization height should be a multiple of 2016 with at least one subsequent retarget (i.e. if using 2016 as the starting height, blocks 4031-4032 must exist). \ No newline at end of file diff --git a/docs/docs/contracts/src/SUMMARY.md b/docs/docs/contracts/src/SUMMARY.md deleted file mode 100644 index 2da89532..00000000 --- a/docs/docs/contracts/src/SUMMARY.md +++ /dev/null @@ -1,22 +0,0 @@ -# Summary -- [Home](README.md) -# src - - [❱ bridge](src/bridge/README.md) - - [BitcoinTx](src/bridge/BitcoinTx.sol/library.BitcoinTx.md) - - [BridgeState](src/bridge/BridgeState.sol/library.BridgeState.md) - - [IRelay](src/bridge/IRelay.sol/interface.IRelay.md) - - [WitnessTx](src/bridge/WitnessTx.sol/library.WitnessTx.md) - - [❱ faucet](src/faucet/README.md) - - [Erc20Mintable](src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md) - - [Erc20Minter](src/faucet/Erc20Minter.sol/contract.Erc20Minter.md) - - [❱ relay](src/relay/README.md) - - [Epoch](src/relay/LightRelay.sol/struct.Epoch.md) - - [ILightRelay](src/relay/LightRelay.sol/interface.ILightRelay.md) - - [RelayUtils](src/relay/LightRelay.sol/library.RelayUtils.md) - - [LightRelay](src/relay/LightRelay.sol/contract.LightRelay.md) - - [TestLightRelay](src/relay/TestLightRelay.sol/contract.TestLightRelay.md) - - [❱ swap](src/swap/README.md) - - [Bridge](src/swap/Bridge.sol/contract.Bridge.md) - - [BtcMarketPlace](src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md) - - [MarketPlace](src/swap/Marketplace.sol/contract.MarketPlace.md) - - [BobWrappedBtc](src/swap/Wrapped.sol/contract.BobWrappedBtc.md) diff --git a/docs/docs/contracts/src/src/README.md b/docs/docs/contracts/src/src/README.md deleted file mode 100644 index 1a342451..00000000 --- a/docs/docs/contracts/src/src/README.md +++ /dev/null @@ -1,7 +0,0 @@ - - -# Contents -- [bridge](/src/bridge) -- [faucet](/src/faucet) -- [relay](/src/relay) -- [swap](/src/swap) diff --git a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md index 9652f040..8d4e1747 100644 --- a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md +++ b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md @@ -1,5 +1,5 @@ # BitcoinTx -[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/bridge/BitcoinTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/bridge/BitcoinTx.sol) Allows to reference Bitcoin raw transaction in Solidity. diff --git a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md index c884c4fb..7ed44b94 100644 --- a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md +++ b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md @@ -1,5 +1,5 @@ # BridgeState -[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/bridge/BridgeState.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/bridge/BridgeState.sol) ## Structs diff --git a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md index 0d300d82..9fa8706f 100644 --- a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md +++ b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md @@ -1,5 +1,5 @@ # IRelay -[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/bridge/IRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/bridge/IRelay.sol) Contains only the methods needed by tBTC v2. The Bitcoin relay provides the difficulty of the previous and current epoch. One diff --git a/docs/docs/contracts/src/src/bridge/README.md b/docs/docs/contracts/src/src/bridge/README.md deleted file mode 100644 index 0fda2c04..00000000 --- a/docs/docs/contracts/src/src/bridge/README.md +++ /dev/null @@ -1,7 +0,0 @@ - - -# Contents -- [BitcoinTx](BitcoinTx.sol/library.BitcoinTx.md) -- [BridgeState](BridgeState.sol/library.BridgeState.md) -- [IRelay](IRelay.sol/interface.IRelay.md) -- [WitnessTx](WitnessTx.sol/library.WitnessTx.md) diff --git a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md index c3b66c32..741c5597 100644 --- a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md +++ b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md @@ -1,5 +1,5 @@ # WitnessTx -[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/bridge/WitnessTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/bridge/WitnessTx.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md index 29385949..6207917b 100644 --- a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md +++ b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md @@ -1,5 +1,5 @@ # Erc20Minter -[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/faucet/Erc20Minter.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/faucet/Erc20Minter.sol) **Inherits:** Ownable diff --git a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md index bae0ebeb..e5cbdc7b 100644 --- a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md +++ b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md @@ -1,5 +1,5 @@ # Erc20Mintable -[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/faucet/Erc20Minter.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/faucet/Erc20Minter.sol) ## Functions diff --git a/docs/docs/contracts/src/src/faucet/README.md b/docs/docs/contracts/src/src/faucet/README.md deleted file mode 100644 index ff7ce46e..00000000 --- a/docs/docs/contracts/src/src/faucet/README.md +++ /dev/null @@ -1,5 +0,0 @@ - - -# Contents -- [Erc20Mintable](Erc20Minter.sol/interface.Erc20Mintable.md) -- [Erc20Minter](Erc20Minter.sol/contract.Erc20Minter.md) diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md index 9712cd70..0d7a0f46 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md @@ -1,5 +1,5 @@ # LightRelay -[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/relay/LightRelay.sol) **Inherits:** Ownable, [ILightRelay](../../relay/LightRelay.sol/interface.ILightRelay.md) diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md index 930b0bed..0a7450f1 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md @@ -1,5 +1,5 @@ # ILightRelay -[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/relay/LightRelay.sol) **Inherits:** [IRelay](../../bridge/IRelay.sol/interface.IRelay.md) diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md index 774934d0..a5b7935b 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md @@ -1,5 +1,5 @@ # RelayUtils -[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/relay/LightRelay.sol) ## Functions diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md index dbd95732..8f3c0e79 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md @@ -1,5 +1,5 @@ # Epoch -[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/relay/LightRelay.sol) ```solidity diff --git a/docs/docs/contracts/src/src/relay/README.md b/docs/docs/contracts/src/src/relay/README.md deleted file mode 100644 index 06222840..00000000 --- a/docs/docs/contracts/src/src/relay/README.md +++ /dev/null @@ -1,8 +0,0 @@ - - -# Contents -- [Epoch](LightRelay.sol/struct.Epoch.md) -- [ILightRelay](LightRelay.sol/interface.ILightRelay.md) -- [RelayUtils](LightRelay.sol/library.RelayUtils.md) -- [LightRelay](LightRelay.sol/contract.LightRelay.md) -- [TestLightRelay](TestLightRelay.sol/contract.TestLightRelay.md) diff --git a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md index 85591b2d..be27ec01 100644 --- a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md +++ b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md @@ -1,5 +1,5 @@ # TestLightRelay -[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/relay/TestLightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/relay/TestLightRelay.sol) **Inherits:** [LightRelay](../../relay/LightRelay.sol/contract.LightRelay.md) diff --git a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md index 84a3244e..285eeffe 100644 --- a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md +++ b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md @@ -1,5 +1,5 @@ # Bridge -[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/swap/Bridge.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/swap/Bridge.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md index ffb09a12..4149fd92 100644 --- a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md @@ -1,5 +1,5 @@ # BtcMarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/swap/Btc_Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/swap/Btc_Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md index fb090fb8..33b91201 100644 --- a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md @@ -1,5 +1,5 @@ # MarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/swap/Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/swap/Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/README.md b/docs/docs/contracts/src/src/swap/README.md deleted file mode 100644 index cbed71f4..00000000 --- a/docs/docs/contracts/src/src/swap/README.md +++ /dev/null @@ -1,7 +0,0 @@ - - -# Contents -- [Bridge](Bridge.sol/contract.Bridge.md) -- [BtcMarketPlace](Btc_Marketplace.sol/contract.BtcMarketPlace.md) -- [MarketPlace](Marketplace.sol/contract.MarketPlace.md) -- [BobWrappedBtc](Wrapped.sol/contract.BobWrappedBtc.md) diff --git a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md index c189297d..64fc26e2 100644 --- a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md +++ b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md @@ -1,5 +1,5 @@ # BobWrappedBtc -[Git Source](https://github.com/bob-collective/bob/blob/d9c9196f0c99ad631c4c8411f2d25decea2e634f/src/swap/Wrapped.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/swap/Wrapped.sol) **Inherits:** ERC20, ERC20Burnable, Ownable From f4a21bec919041d14042eb8a5f6ddf59665a0eec Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Wed, 13 Dec 2023 09:31:02 +0000 Subject: [PATCH 35/37] chore: Generate Foundry docs --- .../contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md | 2 +- .../src/src/bridge/BridgeState.sol/library.BridgeState.md | 2 +- .../contracts/src/src/bridge/IRelay.sol/interface.IRelay.md | 2 +- .../contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md | 2 +- .../src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md | 2 +- .../src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md | 2 +- .../src/src/relay/LightRelay.sol/contract.LightRelay.md | 2 +- .../src/src/relay/LightRelay.sol/interface.ILightRelay.md | 2 +- .../src/src/relay/LightRelay.sol/library.RelayUtils.md | 2 +- .../docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md | 2 +- .../src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md | 2 +- docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md | 2 +- .../src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md | 2 +- .../src/src/swap/Marketplace.sol/contract.MarketPlace.md | 2 +- .../src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md index 8d4e1747..6e2ca800 100644 --- a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md +++ b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md @@ -1,5 +1,5 @@ # BitcoinTx -[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/bridge/BitcoinTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/bridge/BitcoinTx.sol) Allows to reference Bitcoin raw transaction in Solidity. diff --git a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md index 7ed44b94..27fe7b9b 100644 --- a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md +++ b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md @@ -1,5 +1,5 @@ # BridgeState -[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/bridge/BridgeState.sol) +[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/bridge/BridgeState.sol) ## Structs diff --git a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md index 9fa8706f..790bf717 100644 --- a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md +++ b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md @@ -1,5 +1,5 @@ # IRelay -[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/bridge/IRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/bridge/IRelay.sol) Contains only the methods needed by tBTC v2. The Bitcoin relay provides the difficulty of the previous and current epoch. One diff --git a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md index 741c5597..bf889082 100644 --- a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md +++ b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md @@ -1,5 +1,5 @@ # WitnessTx -[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/bridge/WitnessTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/bridge/WitnessTx.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md index 6207917b..e0245bd6 100644 --- a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md +++ b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md @@ -1,5 +1,5 @@ # Erc20Minter -[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/faucet/Erc20Minter.sol) +[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/faucet/Erc20Minter.sol) **Inherits:** Ownable diff --git a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md index e5cbdc7b..f9cb3ae8 100644 --- a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md +++ b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md @@ -1,5 +1,5 @@ # Erc20Mintable -[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/faucet/Erc20Minter.sol) +[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/faucet/Erc20Minter.sol) ## Functions diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md index 0d7a0f46..52aeb92d 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md @@ -1,5 +1,5 @@ # LightRelay -[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/relay/LightRelay.sol) **Inherits:** Ownable, [ILightRelay](../../relay/LightRelay.sol/interface.ILightRelay.md) diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md index 0a7450f1..fab2369e 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md @@ -1,5 +1,5 @@ # ILightRelay -[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/relay/LightRelay.sol) **Inherits:** [IRelay](../../bridge/IRelay.sol/interface.IRelay.md) diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md index a5b7935b..c73688cb 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md @@ -1,5 +1,5 @@ # RelayUtils -[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/relay/LightRelay.sol) ## Functions diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md index 8f3c0e79..201c1c47 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md @@ -1,5 +1,5 @@ # Epoch -[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/relay/LightRelay.sol) ```solidity diff --git a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md index be27ec01..fd20eb59 100644 --- a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md +++ b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md @@ -1,5 +1,5 @@ # TestLightRelay -[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/relay/TestLightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/relay/TestLightRelay.sol) **Inherits:** [LightRelay](../../relay/LightRelay.sol/contract.LightRelay.md) diff --git a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md index 285eeffe..ea541e61 100644 --- a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md +++ b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md @@ -1,5 +1,5 @@ # Bridge -[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/swap/Bridge.sol) +[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/swap/Bridge.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md index 4149fd92..15dd2c26 100644 --- a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md @@ -1,5 +1,5 @@ # BtcMarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/swap/Btc_Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/swap/Btc_Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md index 33b91201..e1f3e6e1 100644 --- a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md @@ -1,5 +1,5 @@ # MarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/swap/Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/swap/Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md index 64fc26e2..9b0a403d 100644 --- a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md +++ b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md @@ -1,5 +1,5 @@ # BobWrappedBtc -[Git Source](https://github.com/bob-collective/bob/blob/9c01c7cfc14aec17ca362111dc5fef421675ccf1/src/swap/Wrapped.sol) +[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/swap/Wrapped.sol) **Inherits:** ERC20, ERC20Burnable, Ownable From 6d141409b4721c555a616012a2581028bca95432 Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Fri, 15 Dec 2023 09:37:21 +0000 Subject: [PATCH 36/37] chore: Generate Foundry docs --- .../contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md | 2 +- .../src/src/bridge/BridgeState.sol/library.BridgeState.md | 2 +- .../contracts/src/src/bridge/IRelay.sol/interface.IRelay.md | 2 +- .../contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md | 2 +- .../src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md | 2 +- .../src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md | 2 +- .../src/src/relay/LightRelay.sol/contract.LightRelay.md | 2 +- .../src/src/relay/LightRelay.sol/interface.ILightRelay.md | 2 +- .../src/src/relay/LightRelay.sol/library.RelayUtils.md | 2 +- .../docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md | 2 +- .../src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md | 2 +- docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md | 2 +- .../src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md | 2 +- .../src/src/swap/Marketplace.sol/contract.MarketPlace.md | 2 +- .../src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md index 6e2ca800..c326d77a 100644 --- a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md +++ b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md @@ -1,5 +1,5 @@ # BitcoinTx -[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/bridge/BitcoinTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/bridge/BitcoinTx.sol) Allows to reference Bitcoin raw transaction in Solidity. diff --git a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md index 27fe7b9b..dfd74d48 100644 --- a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md +++ b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md @@ -1,5 +1,5 @@ # BridgeState -[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/bridge/BridgeState.sol) +[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/bridge/BridgeState.sol) ## Structs diff --git a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md index 790bf717..d61dbfa9 100644 --- a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md +++ b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md @@ -1,5 +1,5 @@ # IRelay -[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/bridge/IRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/bridge/IRelay.sol) Contains only the methods needed by tBTC v2. The Bitcoin relay provides the difficulty of the previous and current epoch. One diff --git a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md index bf889082..bf44dffa 100644 --- a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md +++ b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md @@ -1,5 +1,5 @@ # WitnessTx -[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/bridge/WitnessTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/bridge/WitnessTx.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md index e0245bd6..b7d887a8 100644 --- a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md +++ b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md @@ -1,5 +1,5 @@ # Erc20Minter -[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/faucet/Erc20Minter.sol) +[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/faucet/Erc20Minter.sol) **Inherits:** Ownable diff --git a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md index f9cb3ae8..ba7d915e 100644 --- a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md +++ b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md @@ -1,5 +1,5 @@ # Erc20Mintable -[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/faucet/Erc20Minter.sol) +[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/faucet/Erc20Minter.sol) ## Functions diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md index 52aeb92d..d7b2813a 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md @@ -1,5 +1,5 @@ # LightRelay -[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/relay/LightRelay.sol) **Inherits:** Ownable, [ILightRelay](../../relay/LightRelay.sol/interface.ILightRelay.md) diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md index fab2369e..2bf1ff3d 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md @@ -1,5 +1,5 @@ # ILightRelay -[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/relay/LightRelay.sol) **Inherits:** [IRelay](../../bridge/IRelay.sol/interface.IRelay.md) diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md index c73688cb..5d847bcb 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md @@ -1,5 +1,5 @@ # RelayUtils -[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/relay/LightRelay.sol) ## Functions diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md index 201c1c47..e49462f8 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md @@ -1,5 +1,5 @@ # Epoch -[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/relay/LightRelay.sol) ```solidity diff --git a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md index fd20eb59..6ef8aff8 100644 --- a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md +++ b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md @@ -1,5 +1,5 @@ # TestLightRelay -[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/relay/TestLightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/relay/TestLightRelay.sol) **Inherits:** [LightRelay](../../relay/LightRelay.sol/contract.LightRelay.md) diff --git a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md index ea541e61..40abfdcd 100644 --- a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md +++ b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md @@ -1,5 +1,5 @@ # Bridge -[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/swap/Bridge.sol) +[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/swap/Bridge.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md index 15dd2c26..36a63afd 100644 --- a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md @@ -1,5 +1,5 @@ # BtcMarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/swap/Btc_Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/swap/Btc_Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md index e1f3e6e1..afac79a9 100644 --- a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md @@ -1,5 +1,5 @@ # MarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/swap/Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/swap/Marketplace.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md index 9b0a403d..42539f47 100644 --- a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md +++ b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md @@ -1,5 +1,5 @@ # BobWrappedBtc -[Git Source](https://github.com/bob-collective/bob/blob/67a580a9eab42424f3435ce488e8ec16222a7a9b/src/swap/Wrapped.sol) +[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/swap/Wrapped.sol) **Inherits:** ERC20, ERC20Burnable, Ownable From 1817d76cccbdb72df6c1c466f05b26219a7ada92 Mon Sep 17 00:00:00 2001 From: nud3l Date: Thu, 21 Dec 2023 00:22:38 +0000 Subject: [PATCH 37/37] chore: Generate Foundry docs --- .../TestingErc20.sol/contract.TestingErc20.md | 58 +++++ .../bridge/BitcoinTx.sol/library.BitcoinTx.md | 28 ++- .../BridgeState.sol/library.BridgeState.md | 2 +- .../src/bridge/IRelay.sol/interface.IRelay.md | 2 +- .../bridge/WitnessTx.sol/library.WitnessTx.md | 2 +- .../Erc20Minter.sol/contract.Erc20Minter.md | 2 +- .../interface.Erc20Mintable.md | 2 +- .../contract.PimlicoERC20Paymaster.md | 229 ++++++++++++++++++ .../library.SafeTransferLib.md | 131 ++++++++++ .../contract.OnboardingPaymaster.md | 102 ++++++++ .../Oracle.sol/contract.DummyOracle.md | 40 +++ .../Oracle.sol/interface.IOracle.md | 22 ++ .../contract.OracleTokenPaymaster.md | 191 +++++++++++++++ .../LightRelay.sol/contract.LightRelay.md | 2 +- .../LightRelay.sol/interface.ILightRelay.md | 2 +- .../LightRelay.sol/library.RelayUtils.md | 2 +- .../src/relay/LightRelay.sol/struct.Epoch.md | 2 +- .../contract.TestLightRelay.md | 4 +- .../src/swap/Bridge.sol/contract.Bridge.md | 5 +- .../contract.BtcMarketPlace.md | 14 +- .../src/swap/Faucet.sol/contract.Faucet.md | 51 ++++ .../Faucet.sol/interface.Erc20Mintable.md | 26 ++ .../Marketplace.sol/contract.MarketPlace.md | 14 +- .../contract.OrdMarketplace.md | 215 ++++++++++++++++ .../Wrapped.sol/contract.BobWrappedBtc.md | 2 +- 25 files changed, 1132 insertions(+), 18 deletions(-) create mode 100644 docs/docs/contracts/src/src/TestingErc20.sol/contract.TestingErc20.md create mode 100644 docs/docs/contracts/src/src/paymasters/AccountAbstraction/AATokenPaymaster.sol/contract.PimlicoERC20Paymaster.md create mode 100644 docs/docs/contracts/src/src/paymasters/AccountAbstraction/SafeTransferLib.sol/library.SafeTransferLib.md create mode 100644 docs/docs/contracts/src/src/paymasters/OnboardingPaymaster.sol/contract.OnboardingPaymaster.md create mode 100644 docs/docs/contracts/src/src/paymasters/Oracle.sol/contract.DummyOracle.md create mode 100644 docs/docs/contracts/src/src/paymasters/Oracle.sol/interface.IOracle.md create mode 100644 docs/docs/contracts/src/src/paymasters/OracleTokenPaymaster.sol/contract.OracleTokenPaymaster.md create mode 100644 docs/docs/contracts/src/src/swap/Faucet.sol/contract.Faucet.md create mode 100644 docs/docs/contracts/src/src/swap/Faucet.sol/interface.Erc20Mintable.md create mode 100644 docs/docs/contracts/src/src/swap/Ord_Marketplace.sol/contract.OrdMarketplace.md diff --git a/docs/docs/contracts/src/src/TestingErc20.sol/contract.TestingErc20.md b/docs/docs/contracts/src/src/TestingErc20.sol/contract.TestingErc20.md new file mode 100644 index 00000000..3b32773f --- /dev/null +++ b/docs/docs/contracts/src/src/TestingErc20.sol/contract.TestingErc20.md @@ -0,0 +1,58 @@ +# TestingErc20 +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/TestingErc20.sol) + +**Inherits:** +ERC20, ERC20Burnable, Ownable, ERC2771Recipient + + +## State Variables +### _numDecimals + +```solidity +uint8 _numDecimals; +``` + + +## Functions +### constructor + + +```solidity +constructor(string memory _name, string memory _symbol, uint8 _decimals) ERC20(_name, _symbol); +``` + +### setTrustedForwarder + + +```solidity +function setTrustedForwarder(address _forwarder) public onlyOwner; +``` + +### mint + + +```solidity +function mint(uint256 amount) external; +``` + +### _msgSender + + +```solidity +function _msgSender() internal view override(Context, ERC2771Recipient) returns (address sender); +``` + +### _msgData + + +```solidity +function _msgData() internal view override(Context, ERC2771Recipient) returns (bytes calldata); +``` + +### decimals + + +```solidity +function decimals() public view virtual override returns (uint8); +``` + diff --git a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md index c326d77a..a0119d6b 100644 --- a/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md +++ b/docs/docs/contracts/src/src/bridge/BitcoinTx.sol/library.BitcoinTx.md @@ -1,5 +1,5 @@ # BitcoinTx -[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/bridge/BitcoinTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/bridge/BitcoinTx.sol) Allows to reference Bitcoin raw transaction in Solidity. @@ -95,6 +95,20 @@ function getTxOutputValue( |`processInfo`|`TxOutputsProcessingInfo`|TxOutputsProcessingInfo identifying output starting index and the number of outputs.| +### reverseEndianness + + +```solidity +function reverseEndianness(bytes32 b) internal pure returns (bytes32 txHash); +``` + +### ensureTxInputSpendsUtxo + + +```solidity +function ensureTxInputSpendsUtxo(bytes memory _vin, BitcoinTx.UTXO memory utxo) internal pure; +``` + ## Structs ### Info Represents Bitcoin transaction data. @@ -121,6 +135,18 @@ struct Proof { } ``` +### UTXO +Represents info about an unspent transaction output. + + +```solidity +struct UTXO { + bytes32 txHash; + uint32 txOutputIndex; + uint64 txOutputValue; +} +``` + ### TxOutputsProcessingInfo Represents temporary information needed during the processing of the Bitcoin transaction outputs. This structure is an internal one diff --git a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md index dfd74d48..098402dc 100644 --- a/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md +++ b/docs/docs/contracts/src/src/bridge/BridgeState.sol/library.BridgeState.md @@ -1,5 +1,5 @@ # BridgeState -[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/bridge/BridgeState.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/bridge/BridgeState.sol) ## Structs diff --git a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md index d61dbfa9..8ae84f56 100644 --- a/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md +++ b/docs/docs/contracts/src/src/bridge/IRelay.sol/interface.IRelay.md @@ -1,5 +1,5 @@ # IRelay -[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/bridge/IRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/bridge/IRelay.sol) Contains only the methods needed by tBTC v2. The Bitcoin relay provides the difficulty of the previous and current epoch. One diff --git a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md index bf44dffa..be6cf658 100644 --- a/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md +++ b/docs/docs/contracts/src/src/bridge/WitnessTx.sol/library.WitnessTx.md @@ -1,5 +1,5 @@ # WitnessTx -[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/bridge/WitnessTx.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/bridge/WitnessTx.sol) ## State Variables diff --git a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md index b7d887a8..561fa834 100644 --- a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md +++ b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/contract.Erc20Minter.md @@ -1,5 +1,5 @@ # Erc20Minter -[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/faucet/Erc20Minter.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/faucet/Erc20Minter.sol) **Inherits:** Ownable diff --git a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md index ba7d915e..29d860d7 100644 --- a/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md +++ b/docs/docs/contracts/src/src/faucet/Erc20Minter.sol/interface.Erc20Mintable.md @@ -1,5 +1,5 @@ # Erc20Mintable -[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/faucet/Erc20Minter.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/faucet/Erc20Minter.sol) ## Functions diff --git a/docs/docs/contracts/src/src/paymasters/AccountAbstraction/AATokenPaymaster.sol/contract.PimlicoERC20Paymaster.md b/docs/docs/contracts/src/src/paymasters/AccountAbstraction/AATokenPaymaster.sol/contract.PimlicoERC20Paymaster.md new file mode 100644 index 00000000..87c06724 --- /dev/null +++ b/docs/docs/contracts/src/src/paymasters/AccountAbstraction/AATokenPaymaster.sol/contract.PimlicoERC20Paymaster.md @@ -0,0 +1,229 @@ +# PimlicoERC20Paymaster +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/paymasters/AccountAbstraction/AATokenPaymaster.sol) + +**Inherits:** +BasePaymaster + +An ERC-4337 Paymaster contract by Pimlico which is able to sponsor gas fees in exchange for ERC20 tokens. +The contract refunds excess tokens if the actual gas cost is lower than the initially provided amount. +It also allows updating price configuration and withdrawing tokens by the contract owner. +The contract uses an Oracle to fetch the latest token prices. + +*Inherits from BasePaymaster.* + + +## State Variables +### priceDenominator + +```solidity +uint256 public constant priceDenominator = 1e6; +``` + + +### REFUND_POSTOP_COST + +```solidity +uint256 public constant REFUND_POSTOP_COST = 40000; +``` + + +### token + +```solidity +IERC20 public immutable token; +``` + + +### tokenDecimals + +```solidity +uint256 public immutable tokenDecimals; +``` + + +### tokenOracle + +```solidity +IOracle public immutable tokenOracle; +``` + + +### nativeAssetOracle + +```solidity +IOracle public immutable nativeAssetOracle; +``` + + +### previousPrice + +```solidity +uint192 public previousPrice; +``` + + +### priceMarkup + +```solidity +uint32 public priceMarkup; +``` + + +### priceUpdateThreshold + +```solidity +uint32 public priceUpdateThreshold; +``` + + +## Functions +### constructor + +Initializes the PimlicoERC20Paymaster contract with the given parameters. + + +```solidity +constructor( + IERC20 _token, + IEntryPoint _entryPoint, + IOracle _tokenOracle, + IOracle _nativeAssetOracle, + address _owner, + uint8 _tokenDecimals +) BasePaymaster(_entryPoint); +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`_token`|`IERC20`|The ERC20 token used for transaction fee payments.| +|`_entryPoint`|`IEntryPoint`|The EntryPoint contract used in the Account Abstraction infrastructure.| +|`_tokenOracle`|`IOracle`|The Oracle contract used to fetch the latest token prices.| +|`_nativeAssetOracle`|`IOracle`|The Oracle contract used to fetch the latest native asset (ETH, Matic, Avax, etc.) prices.| +|`_owner`|`address`|The address that will be set as the owner of the contract.| +|`_tokenDecimals`|`uint8`|| + + +### updateConfig + +Updates the price markup and price update threshold configurations. + + +```solidity +function updateConfig(uint32 _priceMarkup, uint32 _updateThreshold) external onlyOwner; +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`_priceMarkup`|`uint32`|The new price markup percentage (1e6 = 100%).| +|`_updateThreshold`|`uint32`|The new price update threshold percentage (1e6 = 100%).| + + +### withdrawToken + +Allows the contract owner to withdraw a specified amount of tokens from the contract. + + +```solidity +function withdrawToken(address to, uint256 amount) external onlyOwner; +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`to`|`address`|The address to transfer the tokens to.| +|`amount`|`uint256`|The amount of tokens to transfer.| + + +### updatePrice + +Updates the token price by fetching the latest price from the Oracle. + + +```solidity +function updatePrice() external; +``` + +### _validatePaymasterUserOp + +Validates a paymaster user operation and calculates the required token amount for the transaction. + + +```solidity +function _validatePaymasterUserOp(UserOperation calldata userOp, bytes32, uint256 requiredPreFund) + internal + override + returns (bytes memory context, uint256 validationResult); +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`userOp`|`UserOperation`|The user operation data.| +|``|`bytes32`|| +|`requiredPreFund`|`uint256`|The amount of tokens required for pre-funding.| + +**Returns** + +|Name|Type|Description| +|----|----|-----------| +|`context`|`bytes`|The context containing the token amount and user sender address (if applicable).| +|`validationResult`|`uint256`|A uint256 value indicating the result of the validation (always 0 in this implementation).| + + +### _postOp + +Performs post-operation tasks, such as updating the token price and refunding excess tokens. + +*This function is called after a user operation has been executed or reverted.* + + +```solidity +function _postOp(PostOpMode mode, bytes calldata context, uint256 actualGasCost) internal override; +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`mode`|`PostOpMode`|The post-operation mode (either successful or reverted).| +|`context`|`bytes`|The context containing the token amount and user sender address.| +|`actualGasCost`|`uint256`|The actual gas cost of the transaction.| + + +### fetchPrice + +Fetches the latest price from the given Oracle. + +*This function is used to get the latest price from the tokenOracle or nativeAssetOracle.* + + +```solidity +function fetchPrice(IOracle _oracle) internal view returns (uint192 price); +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`_oracle`|`IOracle`|The Oracle contract to fetch the price from.| + +**Returns** + +|Name|Type|Description| +|----|----|-----------| +|`price`|`uint192`|The latest price fetched from the Oracle.| + + +## Events +### ConfigUpdated + +```solidity +event ConfigUpdated(uint32 priceMarkup, uint32 updateThreshold); +``` + +### UserOperationSponsored + +```solidity +event UserOperationSponsored(address indexed user, uint256 actualTokenNeeded, uint256 actualGasCost); +``` + diff --git a/docs/docs/contracts/src/src/paymasters/AccountAbstraction/SafeTransferLib.sol/library.SafeTransferLib.md b/docs/docs/contracts/src/src/paymasters/AccountAbstraction/SafeTransferLib.sol/library.SafeTransferLib.md new file mode 100644 index 00000000..f3432714 --- /dev/null +++ b/docs/docs/contracts/src/src/paymasters/AccountAbstraction/SafeTransferLib.sol/library.SafeTransferLib.md @@ -0,0 +1,131 @@ +# SafeTransferLib +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/paymasters/AccountAbstraction/SafeTransferLib.sol) + +**Authors:** +Solady (https://github.com/vectorized/solady/blob/main/src/utils/SafeTransferLib.sol), Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol) + +Safe ETH and ERC20 transfer library that gracefully handles missing return values. + +*Caution! This library won't check that a token has code, responsibility is delegated to the caller.* + + +## State Variables +### _GAS_STIPEND_NO_STORAGE_WRITES +*Suggested gas stipend for contract receiving ETH +that disallows any storage writes.* + + +```solidity +uint256 internal constant _GAS_STIPEND_NO_STORAGE_WRITES = 2300; +``` + + +### _GAS_STIPEND_NO_GRIEF +*Suggested gas stipend for contract receiving ETH to perform a few +storage reads and writes, but low enough to prevent griefing. +Multiply by a small constant (e.g. 2), if needed.* + + +```solidity +uint256 internal constant _GAS_STIPEND_NO_GRIEF = 100000; +``` + + +## Functions +### safeTransferFrom + +*Sends `amount` of ERC20 `token` from `from` to `to`. +Reverts upon failure. +The `from` account must have at least `amount` approved for +the current contract to manage.* + + +```solidity +function safeTransferFrom(address token, address from, address to, uint256 amount) internal; +``` + +### safeTransferAllFrom + +*Sends all of ERC20 `token` from `from` to `to`. +Reverts upon failure. +The `from` account must have at least `amount` approved for +the current contract to manage.* + + +```solidity +function safeTransferAllFrom(address token, address from, address to) internal returns (uint256 amount); +``` + +### safeTransfer + +*Sends `amount` of ERC20 `token` from the current contract to `to`. +Reverts upon failure.* + + +```solidity +function safeTransfer(address token, address to, uint256 amount) internal; +``` + +### safeTransferAll + +*Sends all of ERC20 `token` from the current contract to `to`. +Reverts upon failure.* + + +```solidity +function safeTransferAll(address token, address to) internal returns (uint256 amount); +``` + +### safeApprove + +*Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract. +Reverts upon failure.* + + +```solidity +function safeApprove(address token, address to, uint256 amount) internal; +``` + +### balanceOf + +*Returns the amount of ERC20 `token` owned by `account`. +Returns zero if the `token` does not exist.* + + +```solidity +function balanceOf(address token, address account) internal view returns (uint256 amount); +``` + +## Errors +### ETHTransferFailed +*The ETH transfer has failed.* + + +```solidity +error ETHTransferFailed(); +``` + +### TransferFromFailed +*The ERC20 `transferFrom` has failed.* + + +```solidity +error TransferFromFailed(); +``` + +### TransferFailed +*The ERC20 `transfer` has failed.* + + +```solidity +error TransferFailed(); +``` + +### ApproveFailed +*The ERC20 `approve` has failed.* + + +```solidity +error ApproveFailed(); +``` + diff --git a/docs/docs/contracts/src/src/paymasters/OnboardingPaymaster.sol/contract.OnboardingPaymaster.md b/docs/docs/contracts/src/src/paymasters/OnboardingPaymaster.sol/contract.OnboardingPaymaster.md new file mode 100644 index 00000000..2c3b0049 --- /dev/null +++ b/docs/docs/contracts/src/src/paymasters/OnboardingPaymaster.sol/contract.OnboardingPaymaster.md @@ -0,0 +1,102 @@ +# OnboardingPaymaster +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/paymasters/OnboardingPaymaster.sol) + +**Inherits:** +BasePaymaster + + +## State Variables +### whitelistedContract + +```solidity +address public whitelistedContract; +``` + + +### whitelistedSelector + +```solidity +uint32 public whitelistedSelector; +``` + + +### gasUsedByPost + +```solidity +uint256 public gasUsedByPost; +``` + + +## Functions +### constructor + + +```solidity +constructor(address _whitelistedContract, uint32 _whitelistedSelector); +``` + +### versionPaymaster + + +```solidity +function versionPaymaster() external view virtual override returns (string memory); +``` + +### setPostGasUsage + + +```solidity +function setPostGasUsage(uint256 _gasUsedByPost) external onlyOwner; +``` + +### _getPaymasterData + + +```solidity +function _getPaymasterData(bytes memory paymasterData) private returns (IERC20 token, uint256 maxTokens); +``` + +### getSelector + + +```solidity +function getSelector(bytes calldata call) public view returns (uint32); +``` + +### _preRelayedCall + + +```solidity +function _preRelayedCall( + GsnTypes.RelayRequest calldata relayRequest, + bytes calldata signature, + bytes calldata approvalData, + uint256 maxPossibleGas +) internal virtual override returns (bytes memory context, bool revertOnRecipientRevert); +``` + +### _postRelayedCall + + +```solidity +function _postRelayedCall( + bytes calldata context, + bool, + uint256 gasUseWithoutPost, + GsnTypes.RelayData calldata relayData +) internal virtual override; +``` + +## Events +### PreRelay + +```solidity +event PreRelay(address indexed sender); +``` + +### PostRelay + +```solidity +event PostRelay(address indexed sender); +``` + diff --git a/docs/docs/contracts/src/src/paymasters/Oracle.sol/contract.DummyOracle.md b/docs/docs/contracts/src/src/paymasters/Oracle.sol/contract.DummyOracle.md new file mode 100644 index 00000000..8ab44a9a --- /dev/null +++ b/docs/docs/contracts/src/src/paymasters/Oracle.sol/contract.DummyOracle.md @@ -0,0 +1,40 @@ +# DummyOracle +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/paymasters/Oracle.sol) + +**Inherits:** +[IOracle](../../paymasters/Oracle.sol/interface.IOracle.md) + + +## State Variables +### price + +```solidity +int256 public price; +``` + + +## Functions +### decimals + + +```solidity +function decimals() external view returns (uint8); +``` + +### latestRoundData + + +```solidity +function latestRoundData() + external + view + returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); +``` + +### setPrice + + +```solidity +function setPrice(int256 _price) public; +``` + diff --git a/docs/docs/contracts/src/src/paymasters/Oracle.sol/interface.IOracle.md b/docs/docs/contracts/src/src/paymasters/Oracle.sol/interface.IOracle.md new file mode 100644 index 00000000..ae9d6bb6 --- /dev/null +++ b/docs/docs/contracts/src/src/paymasters/Oracle.sol/interface.IOracle.md @@ -0,0 +1,22 @@ +# IOracle +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/paymasters/Oracle.sol) + + +## Functions +### decimals + + +```solidity +function decimals() external view returns (uint8); +``` + +### latestRoundData + + +```solidity +function latestRoundData() + external + view + returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); +``` + diff --git a/docs/docs/contracts/src/src/paymasters/OracleTokenPaymaster.sol/contract.OracleTokenPaymaster.md b/docs/docs/contracts/src/src/paymasters/OracleTokenPaymaster.sol/contract.OracleTokenPaymaster.md new file mode 100644 index 00000000..acd33cf5 --- /dev/null +++ b/docs/docs/contracts/src/src/paymasters/OracleTokenPaymaster.sol/contract.OracleTokenPaymaster.md @@ -0,0 +1,191 @@ +# OracleTokenPaymaster +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/paymasters/OracleTokenPaymaster.sol) + +**Inherits:** +BasePaymaster + +A very basic paymaster that makes the payer pay in ERC20 tokens. +- The token prices need to be provided by an IOracle. +- No swaps are done - the paymaster simply receives ERC20 tokens. This means +that over time, the paymaster's eth balance will decrease. It is up to the +owner of the contract to replenish the eth balance. +- The owner of the contract can withdraw their received erc20 balances. +- Users specify an erc20 address and a maximum amount they are willing to pay +for the tx. This reduces the trust put in the oracle. + + +## State Variables +### nativeTokenOracle + +```solidity +IOracle nativeTokenOracle; +``` + + +### tokenOracles + +```solidity +mapping(IERC20 => TokenDetails) public tokenOracles; +``` + + +### gasUsedByPost + +```solidity +uint256 public gasUsedByPost; +``` + + +## Functions +### constructor + + +```solidity +constructor(IOracle _nativeTokenOracle); +``` + +### versionPaymaster + + +```solidity +function versionPaymaster() external view virtual override returns (string memory); +``` + +### addOracle + + +```solidity +function addOracle(IERC20 _token, uint256 _decimals, IOracle _oracle) external onlyOwner; +``` + +### fetchPrice + + +```solidity +function fetchPrice(IOracle _oracle) internal view returns (uint192 price); +``` + +### _ethToTokens + + +```solidity +function _ethToTokens(IERC20 token, uint256 ethAmount) internal view returns (uint256); +``` + +### setPostGasUsage + + +```solidity +function setPostGasUsage(uint256 _gasUsedByPost) external onlyOwner; +``` + +### withdrawAll + + +```solidity +function withdrawAll(IERC20 token) external onlyOwner; +``` + +### getPayer + + +```solidity +function getPayer(GsnTypes.RelayRequest calldata relayRequest) public view virtual returns (address); +``` + +### _getPaymasterData + + +```solidity +function _getPaymasterData(bytes memory paymasterData) private returns (IERC20 token, uint256 maxTokens); +``` + +### _calculatePreCharge + + +```solidity +function _calculatePreCharge(IERC20 token, GsnTypes.RelayRequest calldata relayRequest, uint256 maxPossibleGas) + internal + returns (address payer, uint256 ethPrecharge, uint256 tokenPreCharge); +``` + +### _verifyPaymasterData + + +```solidity +function _verifyPaymasterData(GsnTypes.RelayRequest calldata relayRequest) internal view virtual override; +``` + +### __preRelayedCall + + +```solidity +function __preRelayedCall( + GsnTypes.RelayRequest calldata relayRequest, + bytes calldata signature, + bytes calldata approvalData, + uint256 maxPossibleGas +) public returns (bytes memory context, bool revertOnRecipientRevert); +``` + +### _preRelayedCall + + +```solidity +function _preRelayedCall( + GsnTypes.RelayRequest calldata relayRequest, + bytes calldata signature, + bytes calldata approvalData, + uint256 maxPossibleGas +) internal virtual override returns (bytes memory context, bool revertOnRecipientRevert); +``` + +### _postRelayedCall + + +```solidity +function _postRelayedCall( + bytes calldata context, + bool, + uint256 gasUseWithoutPost, + GsnTypes.RelayData calldata relayData +) internal virtual override; +``` + +### _postRelayedCallInternal + + +```solidity +function _postRelayedCallInternal( + address payer, + uint256 tokenPrecharge, + uint256 valueRequested, + uint256 gasUseWithoutPost, + GsnTypes.RelayData calldata relayData, + IERC20 token +) internal; +``` + +## Events +### PreRelayPayment + +```solidity +event PreRelayPayment(uint256 ethAmount, IERC20 token, uint256 tokenAmount, address indexed payer); +``` + +### PostRelay + +```solidity +event PostRelay(uint256 actualEthAmount, IERC20 token, uint256 actualTokenAmount, address payer); +``` + +## Structs +### TokenDetails + +```solidity +struct TokenDetails { + uint256 div; + IOracle oracle; +} +``` + diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md index d7b2813a..88376108 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/contract.LightRelay.md @@ -1,5 +1,5 @@ # LightRelay -[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/relay/LightRelay.sol) **Inherits:** Ownable, [ILightRelay](../../relay/LightRelay.sol/interface.ILightRelay.md) diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md index 2bf1ff3d..4f3d544c 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/interface.ILightRelay.md @@ -1,5 +1,5 @@ # ILightRelay -[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/relay/LightRelay.sol) **Inherits:** [IRelay](../../bridge/IRelay.sol/interface.IRelay.md) diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md index 5d847bcb..7886e4ec 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/library.RelayUtils.md @@ -1,5 +1,5 @@ # RelayUtils -[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/relay/LightRelay.sol) ## Functions diff --git a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md index e49462f8..7d27b34a 100644 --- a/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md +++ b/docs/docs/contracts/src/src/relay/LightRelay.sol/struct.Epoch.md @@ -1,5 +1,5 @@ # Epoch -[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/relay/LightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/relay/LightRelay.sol) ```solidity diff --git a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md index 6ef8aff8..6d5000d7 100644 --- a/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md +++ b/docs/docs/contracts/src/src/relay/TestLightRelay.sol/contract.TestLightRelay.md @@ -1,5 +1,5 @@ # TestLightRelay -[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/relay/TestLightRelay.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/relay/TestLightRelay.sol) **Inherits:** [LightRelay](../../relay/LightRelay.sol/contract.LightRelay.md) @@ -23,6 +23,6 @@ inferred from the provided Bitcoin headers. ```solidity -function setDifficultyFromHeaders(bytes memory bitcoinHeaders) external onlyOwner; +function setDifficultyFromHeaders(bytes memory bitcoinHeaders) external; ``` diff --git a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md index 40abfdcd..26e1911e 100644 --- a/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md +++ b/docs/docs/contracts/src/src/swap/Bridge.sol/contract.Bridge.md @@ -1,5 +1,8 @@ # Bridge -[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/swap/Bridge.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/swap/Bridge.sol) + +**Inherits:** +ERC2771Recipient ## State Variables diff --git a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md index 36a63afd..aaa7b711 100644 --- a/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Btc_Marketplace.sol/contract.BtcMarketPlace.md @@ -1,5 +1,8 @@ # BtcMarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/swap/Btc_Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/swap/Btc_Marketplace.sol) + +**Inherits:** +ERC2771Recipient ## State Variables @@ -52,12 +55,19 @@ BridgeState.Storage internal relay; ``` +### testLightRelay + +```solidity +TestLightRelay internal testLightRelay; +``` + + ## Functions ### constructor ```solidity -constructor(IRelay _relay); +constructor(IRelay _relay, address erc2771Forwarder); ``` ### setRelay diff --git a/docs/docs/contracts/src/src/swap/Faucet.sol/contract.Faucet.md b/docs/docs/contracts/src/src/swap/Faucet.sol/contract.Faucet.md new file mode 100644 index 00000000..6eacb164 --- /dev/null +++ b/docs/docs/contracts/src/src/swap/Faucet.sol/contract.Faucet.md @@ -0,0 +1,51 @@ +# Faucet +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/swap/Faucet.sol) + +**Inherits:** +Ownable, ERC2771Recipient + + +## State Variables +### nextTokenId + +```solidity +uint256 nextTokenId; +``` + + +### supportedErc20Addresses + +```solidity +mapping(uint256 => address) supportedErc20Addresses; +``` + + +## Functions +### addErc20 + + +```solidity +function addErc20(address newErc20) public onlyOwner; +``` + +### mint + + +```solidity +function mint() public; +``` + +### _msgSender + + +```solidity +function _msgSender() internal view override(Context, ERC2771Recipient) returns (address sender); +``` + +### _msgData + + +```solidity +function _msgData() internal view override(Context, ERC2771Recipient) returns (bytes calldata); +``` + diff --git a/docs/docs/contracts/src/src/swap/Faucet.sol/interface.Erc20Mintable.md b/docs/docs/contracts/src/src/swap/Faucet.sol/interface.Erc20Mintable.md new file mode 100644 index 00000000..aa45b213 --- /dev/null +++ b/docs/docs/contracts/src/src/swap/Faucet.sol/interface.Erc20Mintable.md @@ -0,0 +1,26 @@ +# Erc20Mintable +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/swap/Faucet.sol) + + +## Functions +### decimals + + +```solidity +function decimals() external returns (uint256); +``` + +### mint + + +```solidity +function mint(uint256 amount) external; +``` + +### transfer + + +```solidity +function transfer(address to, uint256 value) external returns (bool); +``` + diff --git a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md index afac79a9..ee9df890 100644 --- a/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md +++ b/docs/docs/contracts/src/src/swap/Marketplace.sol/contract.MarketPlace.md @@ -1,5 +1,8 @@ # MarketPlace -[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/swap/Marketplace.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/swap/Marketplace.sol) + +**Inherits:** +ERC2771Recipient ## State Variables @@ -18,6 +21,13 @@ uint256 public nextOrderId; ## Functions +### constructor + + +```solidity +constructor(address erc2771Forwarder); +``` + ### placeErcErcOrder @@ -43,7 +53,7 @@ function withdrawErcErcOrder(uint256 id) public; ```solidity -function getOpenOrders() external view returns (Order[] memory); +function getOpenOrders() external view returns (Order[] memory, uint256[] memory); ``` ## Events diff --git a/docs/docs/contracts/src/src/swap/Ord_Marketplace.sol/contract.OrdMarketplace.md b/docs/docs/contracts/src/src/swap/Ord_Marketplace.sol/contract.OrdMarketplace.md new file mode 100644 index 00000000..99ee4fa6 --- /dev/null +++ b/docs/docs/contracts/src/src/swap/Ord_Marketplace.sol/contract.OrdMarketplace.md @@ -0,0 +1,215 @@ +# OrdMarketplace +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/swap/Ord_Marketplace.sol) + + +## State Variables +### ordinalSellOrders + +```solidity +mapping(uint256 => OrdinalSellOrder) public ordinalSellOrders; +``` + + +### acceptedOrdinalSellOrders + +```solidity +mapping(uint256 => AcceptedOrdinalSellOrder) public acceptedOrdinalSellOrders; +``` + + +### nextOrdinalId + +```solidity +uint256 nextOrdinalId; +``` + + +### REQUEST_EXPIRATION_SECONDS + +```solidity +uint256 public constant REQUEST_EXPIRATION_SECONDS = 6 hours; +``` + + +### relay + +```solidity +BridgeState.Storage internal relay; +``` + + +### testLightRelay + +```solidity +TestLightRelay internal testLightRelay; +``` + + +## Functions +### constructor + + +```solidity +constructor(IRelay _relay); +``` + +### setRelay + + +```solidity +function setRelay(IRelay _relay) internal; +``` + +### placeOrdinalSellOrder + + +```solidity +function placeOrdinalSellOrder( + OrdinalId calldata ordinalID, + BitcoinTx.UTXO calldata utxo, + address sellToken, + uint256 sellAmount +) public; +``` + +### acceptOrdinalSellOrder + + +```solidity +function acceptOrdinalSellOrder(uint256 id, BitcoinAddress calldata bitcoinAddress) public returns (uint256); +``` + +### proofOrdinalSellOrder + + +```solidity +function proofOrdinalSellOrder(uint256 id, BitcoinTx.Info calldata transaction, BitcoinTx.Proof calldata proof) + public; +``` + +### _checkBitcoinTxOutput + +Checks output script pubkey (recipient address) matches output script. +Reverts if bitcoin address is not found. + + +```solidity +function _checkBitcoinTxOutput(BitcoinAddress storage bitcoinAddress, BitcoinTx.Info calldata transaction) private; +``` +**Parameters** + +|Name|Type|Description| +|----|----|-----------| +|`bitcoinAddress`|`BitcoinAddress`|Recipient's bitcoin address.| +|`transaction`|`BitcoinTx.Info`|Transaction fulfilling the order.| + + +### withdrawOrdinalSellOrder + + +```solidity +function withdrawOrdinalSellOrder(uint256 id) public; +``` + +### cancelAcceptedOrdinalSellOrder + + +```solidity +function cancelAcceptedOrdinalSellOrder(uint256 id) public; +``` + +### getOpenOrdinalSellOrders + + +```solidity +function getOpenOrdinalSellOrders() external view returns (OrdinalSellOrder[] memory, uint256[] memory); +``` + +### getOpenAcceptedOrdinalSellOrders + + +```solidity +function getOpenAcceptedOrdinalSellOrders() + external + view + returns (AcceptedOrdinalSellOrder[] memory, uint256[] memory); +``` + +## Events +### placeOrdinalSellOrderEvent + +```solidity +event placeOrdinalSellOrderEvent(uint256 indexed orderId, OrdinalId ordinalID, address sellToken, uint256 sellAmount); +``` + +### acceptOrdinalSellOrderEvent + +```solidity +event acceptOrdinalSellOrderEvent( + uint256 indexed id, uint256 indexed acceptId, BitcoinAddress bitcoinAddress, address ercToken, uint256 ercAmount +); +``` + +### proofOrdinalSellOrderEvent + +```solidity +event proofOrdinalSellOrderEvent(uint256 id); +``` + +### withdrawOrdinalSellOrderEvent + +```solidity +event withdrawOrdinalSellOrderEvent(uint256 id); +``` + +### cancelAcceptedOrdinalSellOrderEvent + +```solidity +event cancelAcceptedOrdinalSellOrderEvent(uint256 id); +``` + +## Structs +### OrdinalSellOrder + +```solidity +struct OrdinalSellOrder { + OrdinalId ordinalID; + address sellToken; + uint256 sellAmount; + BitcoinTx.UTXO utxo; + address requester; + bool isOrderAccepted; +} +``` + +### AcceptedOrdinalSellOrder + +```solidity +struct AcceptedOrdinalSellOrder { + uint256 orderId; + BitcoinAddress bitcoinAddress; + address ercToken; + uint256 ercAmount; + address requester; + address acceptor; + uint256 acceptTime; +} +``` + +### BitcoinAddress + +```solidity +struct BitcoinAddress { + bytes scriptPubKey; +} +``` + +### OrdinalId + +```solidity +struct OrdinalId { + bytes32 txId; + uint32 index; +} +``` + diff --git a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md index 42539f47..6fc3a09e 100644 --- a/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md +++ b/docs/docs/contracts/src/src/swap/Wrapped.sol/contract.BobWrappedBtc.md @@ -1,5 +1,5 @@ # BobWrappedBtc -[Git Source](https://github.com/bob-collective/bob/blob/6feef4b26921a0e62c67cac7076c04271613ba33/src/swap/Wrapped.sol) +[Git Source](https://github.com/bob-collective/bob/blob/9dd94230dd2abcab7dfb659e986743be10093c68/src/swap/Wrapped.sol) **Inherits:** ERC20, ERC20Burnable, Ownable