Skip to content

Commit 1d2b05f

Browse files
committed
Fix spellcheck
1 parent 037757a commit 1d2b05f

15 files changed

+60
-35
lines changed

.cspell.json

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"cashc",
3434
"cashproof",
3535
"cashscript",
36+
"cashtokens",
3637
"castable",
3738
"checkdatasig",
3839
"checkdatasigverify",
@@ -79,6 +80,7 @@
7980
"INPUTBYTECODE",
8081
"INPUTINDEX",
8182
"INPUTSEQUENCENUMBER",
83+
"ints",
8284
"kalis",
8385
"keypair",
8486
"keypairs",
@@ -98,6 +100,7 @@
98100
"meep",
99101
"minimaldata",
100102
"minimalif",
103+
"mocknet",
101104
"n",
102105
"noncompressed",
103106
"nonschnorr",
@@ -109,6 +112,7 @@
109112
"numequal",
110113
"numequalverify",
111114
"numnotequal",
115+
"NOTEQUAL",
112116
"op",
113117
"opcode",
114118
"opcodes",
@@ -156,21 +160,28 @@
156160
"sigs",
157161
"spedn",
158162
"startup",
163+
"standardness",
159164
"tagline",
160165
"teardown",
161166
"tendo",
162167
"timeout",
168+
"timeops",
169+
"timelock",
170+
"timelocks",
163171
"toaltstack",
164172
"troutner",
165173
"tuple",
166174
"tuples",
175+
"typeof",
167176
"txid",
168177
"TXINPUTCOUNT",
169178
"TXLOCKTIME",
170179
"TXOUTPUTCOUNT",
171180
"txvalue",
172181
"TXVERSION",
173182
"unary",
183+
"unlocker",
184+
"unlockers",
174185
"utxo",
175186
"utxo's",
176187
"UTXOBYTECODE",
@@ -185,29 +196,43 @@
185196
"workdir"
186197
],
187198
"ignoreWords": [
199+
"bitcats",
188200
"bitcoincashjs",
201+
"branchup",
202+
"bchguru",
189203
"cashcompiler",
204+
"cashninjas",
190205
"cherian",
206+
"CSCriptNum",
191207
"docu",
208+
"fundme",
209+
"hardhat",
192210
"infima",
193211
"jedex",
194212
"lichos",
213+
"mainnetjs",
195214
"maxdepth",
196215
"networkprovider",
197216
"outputnulldata",
198217
"outputp",
218+
"pako",
219+
"popd",
220+
"pushd",
199221
"setfiletype",
200222
"tada",
223+
"tapswap",
201224
"txage",
202225
"txbytecode",
203226
"txhashoutputs",
204227
"txtime",
228+
"vite",
205229
"withage",
206230
"withfeeperbyte",
207231
"withhardcodedfee",
208232
"withminchange",
209233
"withopreturn",
210-
"withtime"
234+
"withtime",
235+
"XBVJRKV"
211236
],
212237
"ignorePaths": [
213238
// Do not spellcheck NPM files

packages/cashscript/src/LibauthTemplate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export const buildTemplate = async ({
101101
};
102102

103103
// add extra unlocking and locking script for P2PKH inputs spent alongside our contract
104-
// this is needed for correct cross-referrences in the template
104+
// this is needed for correct cross-references in the template
105105
template.scripts[unlockScriptName] = {
106106
name: unlockScriptName,
107107
script:

packages/cashscript/src/Transaction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ export class Transaction {
278278
// Compare nfts in- and outputs, check if inputs have nfts corresponding to outputs
279279
// Keep list of nfts in inputs without matching output
280280
// First check immutable nfts, then mutable & minting nfts together
281-
// This is so an immutible input gets matched first and is removed from the list of unused nfts
281+
// This is so an immutable input gets matched first and is removed from the list of unused nfts
282282
let unusedNfts = listNftsInputs;
283283
for (const nftInput of listNftsInputs) {
284284
if (nftInput.capability === 'none') {

packages/cashscript/src/TransactionBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class TransactionBuilder {
5252
(!unlocker && utxos.some((utxo) => !isUnlockableUtxo(utxo)))
5353
|| (unlocker && utxos.some((utxo) => isUnlockableUtxo(utxo)))
5454
) {
55-
throw new Error('Either all UTXOs must have an individual unlocker speciifed, or no UTXOs must have an individual unlocker specified and a shared unlocker must be provided');
55+
throw new Error('Either all UTXOs must have an individual unlocker specified, or no UTXOs must have an individual unlocker specified and a shared unlocker must be provided');
5656
}
5757

5858
if (!unlocker) {

packages/cashscript/test/debugging.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ describe('Debugging tests', () => {
694694
});
695695

696696
// test_multiline_non_require_error
697-
it('should fail with correct error message and statament when a multiline non-require statement fails', async () => {
697+
it('should fail with correct error message and statement when a multiline non-require statement fails', async () => {
698698
const contract = new Contract(artifact3, [], { provider });
699699

700700
provider.addUtxo(contract.address, randomUtxo());

website/docs/basics/about-bch.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar_label: About Bitcoin Cash
55

66
Bitcoin Cash (ticker BCH) is one of the biggest cryptocurrencies. Bitcoin Cash is a fork of Bitcoin started in 2017 because of differences in vision for the future of the Bitcoin project.
77

8-
Bitcoin Cash shares many of the same fundamentals as Bitcoin (BTC) like the *Proof-of-Work* consensus alrgorithm and the *UTXO data-model*. However regarding smart contract programmability, Bitcoin Cash has significantly diverged from Bitcoin (BTC). We will first cover the UTXO data model and then delve into the smart contract capabilities of Bitcoin Cash.
8+
Bitcoin Cash shares many of the same fundamentals as Bitcoin (BTC) like the *Proof-of-Work* consensus algorithm and the *UTXO data-model*. However regarding smart contract programmability, Bitcoin Cash has significantly diverged from Bitcoin (BTC). We will first cover the UTXO data model and then delve into the smart contract capabilities of Bitcoin Cash.
99

1010
:::info
1111
To learn more about the Bitcoin Basics refer to the book ['Mastering Bitcoin'](https://github.com/bitcoinbook/bitcoinbook). There is also a modified version for BCH specifically called ['Mastering Bitcoin Cash'](https://github.com/Bitcoin-com/mastering-bitcoin-cash).
@@ -31,4 +31,4 @@ The locking and unlocking scripts of regular transactions and smart contracts on
3131

3232
### CashScript
3333

34-
CashScript is a high-level programming language for smart contracts on Bitcoin Cash that offers a strong abstraction for a smoother development experience. The CashScript syntax is based on Ethereum's smart contract language Solidity, but its functionality is very different since smart contracts on Bitcoin Cash differ greatly from smart contracts on Ethereum.
34+
CashScript is a high-level programming language for smart contracts on Bitcoin Cash that offers a strong abstraction for a smoother development experience. The CashScript syntax is based on Ethereum's smart contract language Solidity, but its functionality is very different since smart contracts on Bitcoin Cash differ greatly from smart contracts on Ethereum.

website/docs/basics/getting-started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ With the CashScript playground there's a nice integrated editor to get started,
2020

2121
To write CashScript smart contracts locally you use a code editor. For the best developer experience, we recommend to use VS Code with the CashScript extension. This way it will automatically recognize `.cash` files and offer highlighting and autocompletion.
2222

23-
:::note prerequisties
23+
:::note prerequisites
2424
- Basic familiarity with the command line
2525
- Node.js installed
2626
- A code editor (VS Code recommended)
@@ -149,4 +149,4 @@ const transferDetails = await contract.functions
149149
console.log(transferDetails);
150150
```
151151

152-
Congrats 🎉! You've successfully created a transaction spending from a Bitcoin Cash smart contract!
152+
Congrats 🎉! You've successfully created a transaction spending from a Bitcoin Cash smart contract!

website/docs/guides/debugging.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ If a CashScript transaction is evaluated with `.debug()` or is sent to a network
2626
```bash
2727
HodlVault.cash:23 Require statement failed at input 0 in contract HodlVault.cash at line 23.
2828
Failing statement: require(price >= priceTarget)
29-
Bithauth IDE: [link]
29+
Bitauth IDE: [link]
3030
```
3131

3232
Read the error message to see which line in the CashScript contract causes the transaction validation to fail. Investigate whether the contract function invocation is the issue (on the TypeScript SDK side) or whether the issue is in the CashScript contract itself (so you'd need to update your contract and recompile the artifact). If it is not clear **why** the CashScript contract is failing on that line, then you can use the following two strategies: console logging & Bitauth IDE stack trace.
3333

3434
### Console Logging
3535

36-
To help with debugging you can add `console.log` statements to your CashScript contract file to log variables. This way you investigate whether the variables have the expected values when they get to the failing `require` statement in the CashScript file. After adding the `console.log` statements, recompile your contract so they are added to your contract's Artifact.
36+
To help with debugging you can add `console.log` statements to your CashScript contract file to log variables. This way you investigate whether the variables have the expected values when they get to the failing `require` statement in the CashScript file. After adding the `console.log` statements, recompile your contract so they are added to your contract's Artifact.
3737

3838
### Bitauth IDE
3939

@@ -50,7 +50,7 @@ const uri = await transaction.bitauthUri();
5050
It is unsafe to debug transactions on mainnet as private keys will be exposed to BitAuth IDE and transmitted over the network.
5151
:::
5252

53-
The Bithauth IDE will show you the two-way mapping between the CashScript contract code generated opcodes. Here is [a Bithauth IDE link][BitauthIDE] for the basic `TransferWithTimeout` contract as an example:
53+
The Bitauth IDE will show you the two-way mapping between the CashScript contract code generated opcodes. Here is [a Bitauth IDE link][BitauthIDE] for the basic `TransferWithTimeout` contract as an example:
5454

5555
```js
5656
// "TransferWithTimeout" contract constructor parameters
@@ -73,7 +73,7 @@ OP_3 OP_ROLL OP_1 OP_ROLL OP_CHECKSIG OP_VERIFY /* require(checkSig(send
7373
OP_1 OP_ROLL OP_CHECKLOCKTIMEVERIFY OP_DROP /* require(tx.time >= timeout); */
7474
OP_1 OP_NIP /* } */
7575
OP_ENDIF /* } */
76-
/*
76+
/*
7777
```
7878
7979
## Advanced Transaction Builder
@@ -88,12 +88,12 @@ When a transaction gets rejected by a full node, it will return a cryptic error
8888
mandatory-script-verify-flag-failed (Script failed an OP_VERIFY operation) (code 16)
8989
```
9090
91-
Read the message carefully to investigate whether the issue is a failing script (failing OpCode) or whether a standardness rule like minimum-relay-fee is violated.
91+
Read the message carefully to investigate whether the issue is a failing script (failing OpCode) or whether a standardness rule like minimum-relay-fee is violated.
9292
If the cause is a failing OpCode, you can check the contract's Artifact to see how many appearances this OpCode has. Sometimes the OpCode only appears once or twice, indicating where the failing `require` statement is. Other times you might see 15 appearances of the OpCode leaving you to try the next strategies.
9393
9494
### Removing Contract Checks
9595
96-
If your contract fails, you can remove (or comment out) the lines that are the likely cause of the error. After recompiling to a new Artifact you can test whether the remaining subcontract works or fails with a different error. If this is the case, then you learned that there is an issue in the removed CashScript code block. In the worst case, when you have no indication from the failing opcode (previous strategy), then you will have to try to remove different parts of your contract and try different sub-contracts repeatedly.
96+
If your contract fails, you can remove (or comment out) the lines that are the likely cause of the error. After recompiling to a new Artifact you can test whether the remaining subcontract works or fails with a different error. If this is the case, then you learned that there is an issue in the removed CashScript code block. In the worst case, when you have no indication from the failing opcode (previous strategy), then you will have to try to remove different parts of your contract and try different sub-contracts repeatedly.
9797
9898
To use this strategy effectively, the contract setup with funding should be automated as to avoid having to send testnet coins manually to each different subcontract. However inefficient, this strategy should always be able to get you to find the failing line in your CashScript contract. Then you can investigate whether the issue is the contract invocation or the `require` statement in the CashScript file.
9999

website/docs/guides/optimization.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ console.log(contract.opcount);
109109
console.log(contract.bytesize);
110110
```
111111
112-
With this workflow, you can make changes to the contract and the run the JavaScript program to
112+
With this workflow, you can make changes to the contract and the run the JavaScript program to
113113
get an accurate measure of how the bytesize of your contract changes with different optimizations.
114114
115115
## To optimize or not to optimize?
@@ -120,5 +120,5 @@ In the context of optimizing contract bytecode, there's an important remark to c
120120
121121
>We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%.
122122
123-
It's worth considering whether optimizing the redeem script is necessary at all. If the contract is accepted by the network, and there is no glaring inefficiency in the bytecode, perhaps the best optimization is to not to obsess prematurely about things like blocksize.
123+
It's worth considering whether optimizing the redeem script is necessary at all. If the contract is accepted by the network, and there is no glaring inefficiency in the bytecode, perhaps the best optimization is to not to obsess prematurely about things like block size.
124124

website/docs/language/globals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ int tx.locktime
7171
Represents the `nLocktime` field of the transaction. This is similar to the [`tx.time`][tx.time] global variable but `tx.time` can only be used in `require` statements, not for variable declaration.
7272

7373
:::tip
74-
The usecase for `tx.locktime` is to read the `nLocktime` value and add to the local state. Example usage for this is demonstrated in the [Sablier example](/docs/guides/covenants#keeping-local-state-in-nfts).
74+
The use case for `tx.locktime` is to read the `nLocktime` value and add to the local state. Example usage for this is demonstrated in the [Sablier example](/docs/guides/covenants#keeping-local-state-in-nfts).
7575
:::
7676

7777
### tx.inputs

website/docs/sdk/examples.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ We will break up the development of the smart contract application in 4 manageab
1414

1515
### Creating the keypairs
1616

17-
To put the `HodlVault.cash` contract to use in a TypeScript application, we have to use the CashScript SDK in combination with a BCH library such as [Libauth][libauth], [Mainnetjs][mainnetjs] or [BCHJS][bchjs]. These libraries are used to generate public/private keys for the contract participants.
17+
To put the `HodlVault.cash` contract to use in a TypeScript application, we have to use the CashScript SDK in combination with a BCH library such as [Libauth][libauth], [Mainnetjs][mainnetjs] or [BCHJS][bchjs]. These libraries are used to generate public/private keys for the contract participants.
1818
In this example we'll use [Libauth][libauth] to generate the keys `alicePriv`, `alicePub`, `oracle` & `oraclePub`. Then we can use these keys to create the smart contract.
1919

2020
:::caution
21-
These 'private keys' are public just for testing, in other contexts you want to very carefully treat private keys as `environment variables`. You would also make sure to use a secure seed phrase and not 'CashScript Examples'...
21+
These 'private keys' are public just for testing, in other contexts you want to very carefully treat private keys as `environment variables`. You would also make sure to use a secure seed phrase and not 'CashScript Examples'...
2222
:::
2323

2424
```ts title="common.ts"
@@ -116,7 +116,7 @@ export class PriceOracle {
116116

117117
### Sending a Transaction
118118

119-
Finnally, we can put all of this together to create a working smart contract application. We use the generated keys as a contract arguments directly or in a `SignatureTemplate` to create a transaction signature.
119+
Finally, we can put all of this together to create a working smart contract application. We use the generated keys as a contract arguments directly or in a `SignatureTemplate` to create a transaction signature.
120120

121121
```ts title="hodl_vault.ts"
122122
import { stringify } from '@bitauth/libauth';
@@ -163,4 +163,4 @@ console.log(stringify(tx));
163163
[bchjs]: https://bchjs.fullstack.cash/
164164
[mainnetjs]: https://mainnet.cash/
165165
[libauth]: https://libauth.org/
166-
[github-examples]: https://github.com/CashScript/cashscript/tree/master/examples
166+
[github-examples]: https://github.com/CashScript/cashscript/tree/master/examples

website/docs/sdk/instantiation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ contract.address: string
6262
A contract's regular address (without token-support) can be retrieved through the `address` member field.
6363

6464
:::note
65-
Wallets will not allow you to send CashTokens to this address. For that you must use the [tokenAddress](#tokenaddress) below. Wallets which have not upgraded might not recognize this new address type.
65+
Wallets will not allow you to send CashTokens to this address. For that you must use the [tokenAddress](#tokenAddress) below. Wallets which have not upgraded might not recognize this new address type.
6666
:::
6767

6868
#### Example

website/docs/sdk/transactions-advanced.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ It is possible to create custom unlockers by implementing the `Unlocker` interfa
4343

4444
#### Example
4545
```ts
46-
import { contract, aliceTemplate, aliceAdress, transactionBuilder } from './somewhere.js';
46+
import { contract, aliceTemplate, aliceAddress, transactionBuilder } from './somewhere.js';
4747

4848
const contractUtxos = await contract.getUtxos();
49-
const aliceUtxos = await provider.getUtxos(aliceAdress);
49+
const aliceUtxos = await provider.getUtxos(aliceAddress);
5050

5151
transactionBuilder.addInput(contractUtxos[0], contract.unlock.spend());
5252
transactionBuilder.addInput(aliceUtxos[0], aliceTemplate.unlockP2PKH());
@@ -69,10 +69,10 @@ Adds a list of input UTXOs, either with a single shared unlocker or with individ
6969

7070
#### Example
7171
```ts
72-
import { contract, aliceTemplate, aliceAdress, transactionBuilder } from './somewhere.js';
72+
import { contract, aliceTemplate, aliceAddress, transactionBuilder } from './somewhere.js';
7373

7474
const contractUtxos = await contract.getUtxos();
75-
const aliceUtxos = await provider.getUtxos(aliceAdress);
75+
const aliceUtxos = await provider.getUtxos(aliceAddress);
7676

7777
// Use a single unlocker for all inputs you're adding at a time
7878
transactionBuilder.addInputs(contractUtxos, contract.unlock.spend());

website/docs/showcase.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ The CashTokens Studio is an application for creating CashTokens and for their ma
5858
<a href="https://badgers.cash/" target="_blank"><img style={{borderRadius: '100%'}} src="/img/badgers.png" /></a>
5959
</div>
6060

61-
BadgerCoin is a fungible CashToken using a novel distibution mechanism. BadgerCoins are earned through staking Bitcoin Cash in the Badgers Smart Contract. The staking duration is predetermined, and depending on the stake amount and period you earn tokens. The website allows for anyone to invoke contract unlocks.
61+
BadgerCoin is a fungible CashToken using a novel distribution mechanism. BadgerCoins are earned through staking Bitcoin Cash in the Badgers Smart Contract. The staking duration is predetermined, and depending on the stake amount and period you earn tokens. The website allows for anyone to invoke contract unlocks.
6262

6363
## FundMe.cash
6464

@@ -76,4 +76,4 @@ FundMe is a new BCH crowdfunding platform using WalletConnect. Fundme campaigns
7676
<a href="https://unspent.app/" target="_blank"><img src="/img/unspent_phi.png" /></a>
7777
</div>
7878

79-
Unspent Phi allows users to convert Bitcoin Cash they have today into a series of periodic payments over a long period of time. It's a set of simple contracts that rely on rolling timelocks and introspection rather than signatures; meaning as long as the correct recipients are paid, anyone may build and submit transactions.
79+
Unspent Phi allows users to convert Bitcoin Cash they have today into a series of periodic payments over a long period of time. It's a set of simple contracts that rely on rolling timelocks and introspection rather than signatures; meaning as long as the correct recipients are paid, anyone may build and submit transactions.

0 commit comments

Comments
 (0)