Skip to content

Commit

Permalink
fix: grammatical errors in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nakul1010 committed Jan 24, 2024
1 parent 37acfa3 commit 557a305
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 13 deletions.
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.8"
services:
bitcoind:
image: "ruimarinho/bitcoin-core:24"
image: "lightninglabs/bitcoin-core:25"
command:
- -regtest
- -server
Expand All @@ -15,7 +15,7 @@ services:
- "18443:18443"

bitcoin-cli:
image: "ruimarinho/bitcoin-core:24"
image: "lightninglabs/bitcoin-core:25"
command:
- /bin/sh
- -c
Expand Down
17 changes: 13 additions & 4 deletions docs/docs/build/getting-started/helloworld.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This guide provides step-by-step instructions on how to deploy smart contracts o

We will provide instructions for using Remix and Foundry.

- [Developer Starters Kit](https://github.com/bob-collective/StarterKit) the kit serves as the foundation to develop on BOB.
- [Developer Starter Kit](https://github.com/bob-collective/StarterKit) the kit serves as the foundation to develop on BOB.
- [Remix](https://remix.ethereum.org/) is a web-based IDE for writing smart contracts. This is a great option if you do not want to install any software on your computer.
- [Foundry](https://book.getfoundry.sh/) is a Rust-based development environment for writing smart contracts. This is a great option if you want to use a local development environment.

Expand Down Expand Up @@ -83,7 +83,9 @@ Add the following remappings in `compiler_config.json` under `settings`
}
}
```
Enter the below code in `HelloBitcoin.sol` file. To learn more about the contract [checkout the Solidity tutorial guide](https://docs.soliditylang.org/en/v0.8.21/introduction-to-smart-contracts.html#subcurrency-example).
Enter the below code in `HelloBitcoin.sol` file.

To learn more about the Solidity contracts in general [checkout the Solidity tutorial guide](https://docs.soliditylang.org/en/v0.8.21/introduction-to-smart-contracts.html#subcurrency-example).

```solidity
// SPDX-License-Identifier: UNLICENSED
Expand Down Expand Up @@ -521,9 +523,16 @@ Select contract as `TestLightRelay`. Click `Deploy` and sign the transaction pop

Copy the `TestLightRelay` contract address from the terminal this will be used as a constructor argument for `HelloBitcoin` contract.

Select contract as `HelloBitcoin`
Select contract as `HelloBitcoin`.

Add the `_RELAY` ie `TestLightRelay` address copied above.

Add the `_USDTCONTRACTADDRESS` address as `0xF58de5056b7057D74f957e75bFfe865F571c3fB6`.

Add the `_RELAY` ie `TestLightRelay` address and `_USDTCONTRACTADDRESS` address as `0xF58de5056b7057D74f957e75bFfe865F571c3fB6`.

:::tip
If you want, you can also modify the contract at a later stage and use [other ERC20 contracts already deployed on BOB testnet](/docs/build/contracts/).
:::

Click `Deploy` and sign the transaction pop up message.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,67 +4,87 @@
**Inherits:**
Ownable, [ILightRelay](../../relay/LightRelay.sol/interface.ILightRelay.md)

*THE RELAY MUST NOT BE USED BEFORE GENESIS AND AT LEAST ONE RETARGET.*
*The LightRelay contract manages a relay for Bitcoin header information,
allowing retargeting and validation of header chains.
THE RELAY MUST NOT BE USED BEFORE GENESIS AND AT LEAST ONE RETARGET.*


## State Variables
### ready
Flag indicating whether the relay is ready for use.


```solidity
bool public ready;
```


### authorizationRequired
Flag indicating whether authorization is required for retarget submitters.


```solidity
bool public authorizationRequired;
```


### proofLength
Number of blocks required for each side of a retarget proof.


```solidity
uint64 public proofLength;
```


### genesisEpoch
The number of the first epoch recorded by the relay.


```solidity
uint64 public genesisEpoch;
```


### currentEpoch
The number of the latest epoch whose difficulty is proven to the relay.


```solidity
uint64 public currentEpoch;
```


### currentEpochDifficulty
Difficulty of the current epoch.


```solidity
uint256 internal currentEpochDifficulty;
```


### prevEpochDifficulty
Difficulty of the previous epoch.


```solidity
uint256 internal prevEpochDifficulty;
```


### epochs
Mapping of each epoch from genesis to the current one, keyed by their numbers.


```solidity
mapping(uint256 => Epoch) internal epochs;
```


### isAuthorized
Mapping of authorized submitters.


```solidity
mapping(address => bool) public isAuthorized;
Expand All @@ -74,6 +94,8 @@ mapping(address => bool) public isAuthorized;
## Functions
### relayActive

Modifier to check if the relay is active.


```solidity
modifier relayActive();
Expand Down
21 changes: 15 additions & 6 deletions src/relay/LightRelay.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,42 +55,51 @@ library RelayUtils {
}
}

/// @dev THE RELAY MUST NOT BE USED BEFORE GENESIS AND AT LEAST ONE RETARGET.
/// @title LightRelay Contract
/// @dev The LightRelay contract manages a relay for Bitcoin header information,
/// allowing retargeting and validation of header chains.
/// THE RELAY MUST NOT BE USED BEFORE GENESIS AND AT LEAST ONE RETARGET.
contract LightRelay is Ownable, ILightRelay {
using BytesLib for bytes;
using BTCUtils for bytes;
using ValidateSPV for bytes;
using RelayUtils for bytes;

/// @notice Flag indicating whether the relay is ready for use.
bool public ready;
// Whether the relay requires the address submitting a retarget to be
// authorised in advance by governance.
/// @notice Flag indicating whether authorization is required for retarget submitters.
bool public authorizationRequired;
// Number of blocks required for each side of a retarget proof:
// a retarget must provide `proofLength` blocks before the retarget
/// @notice Number of blocks required for each side of a retarget proof.
// A retarget must provide `proofLength` blocks before the retarget
// and `proofLength` blocks after it.
// Governable
// Should be set to a fairly high number (e.g. 20-50) in production.
uint64 public proofLength;
// The number of the first epoch recorded by the relay.
/// @notice The number of the first epoch recorded by the relay.
// This should equal the height of the block starting the genesis epoch,
// divided by 2016, but this is not enforced as the relay has no
// information about block numbers.
uint64 public genesisEpoch;
// The number of the latest epoch whose difficulty is proven to the relay.
/// @notice The number of the latest epoch whose difficulty is proven to the relay.
// If the genesis epoch's number is set correctly, and retargets along the
// way have been legitimate, this equals the height of the block starting
// the most recent epoch, divided by 2016.
uint64 public currentEpoch;

/// @notice Difficulty of the current epoch.
uint256 internal currentEpochDifficulty;
/// @notice Difficulty of the previous epoch.
uint256 internal prevEpochDifficulty;

// Each epoch from genesis to the current one, keyed by their numbers.
/// @notice Mapping of each epoch from genesis to the current one, keyed by their numbers.
mapping(uint256 => Epoch) internal epochs;

/// @notice Mapping of authorized submitters.
mapping(address => bool) public isAuthorized;

/// @notice Modifier to check if the relay is active.
modifier relayActive() {
require(ready, "Relay is not ready for use");
_;
Expand Down

0 comments on commit 557a305

Please sign in to comment.