Skip to content

Commit cd1dab9

Browse files
author
bohendo
committed
fix spelling mistakes
1 parent 0d9ada8 commit cd1dab9

File tree

9 files changed

+17
-23
lines changed

9 files changed

+17
-23
lines changed

not-so-smart-contracts/solidity/bad_randomness/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Pseudorandom number generation on the blockchain is generally unsafe. There are
1010

1111
A common workaround for the lack of on-chain randomness is using a commit and reveal scheme. Here, each user submits the hash of their secret number.
1212
When the time comes for the random number to be generated, each user sends their secret number to the contract
13-
which then verifies it matches the hash submitted earlier and xors them together. Therefore no participant can observe how their contribution
13+
which then verifies it matches the hash submitted earlier and XORs them together. Therefore no participant can observe how their contribution
1414
will affect the end result until after everyone has already committed to a value. However, this is also vulnerable to DoS attacks,
1515
since the last person to reveal can choose to never submit their secret. Even if the contract is allowed to move forward without
1616
everyone's secrets, this gives them influence over the end result. In general, we do not recommend commit and reveal schemes.
@@ -20,7 +20,7 @@ everyone's secrets, this gives them influence over the end result. In general, w
2020
- A lottery where people bet on whether the hash of the current block is even or odd. A miner that bets on even can throw out blocks whose
2121
hash are even.
2222
- A commit-reveal scheme where users don't necessarily have to reveal their secret (to prevent DoS). A user has money riding on the outcome
23-
of the PRG and submits a large number of commits, allowing them to choose the one they want to reveal at the end.
23+
of the PRNG and submits a large number of commits, allowing them to choose the one they want to reveal at the end.
2424

2525
## Mitigations
2626

@@ -30,13 +30,13 @@ In the future, however, these approaches show promise
3030

3131
- [Verifiable delay functions](https://eprint.iacr.org/2018/601.pdf): functions which produce a pseudorandom number
3232
and take a fixed amount of sequential time to evaluate
33-
- [Randao](https://github.com/randao/randao): A commit reveal scheme where users must stake wei to participate
33+
- [RANDAO](https://github.com/randao/randao): A commit reveal scheme where users must stake wei to participate
3434

3535
## Examples
3636

3737
- The `random` function in [theRun](theRun_source_code/theRun.sol) was vulnerable to this attack. It used the blockhash, timestamp and block number to generate numbers in a range to determine winners of the lottery. To exploit this, an attacker could set up a smart contract that generates numbers in the same way and submits entries when it would win. As well, the miner of the block has some control over the blockhash and timestamp and would also be able to influence the lottery in their favor.
3838

3939
## Sources
4040

41-
- https://ethereum.stackexchange.com/questions/191/how-can-i-securely-generate-a-random-number-in-my-smart-contract
42-
- https://blog.positive.com/predicting-random-numbers-in-ethereum-smart-contracts-e5358c6b8620
41+
- [StackExchange](https://ethereum.stackexchange.com/questions/191/how-can-i-securely-generate-a-random-number-in-my-smart-contract)
42+
- [Blog Post](https://blog.positive.com/predicting-random-numbers-in-ethereum-smart-contracts-e5358c6b8620)

not-so-smart-contracts/solidity/denial_of_service/README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Denial of Service
22

3-
A malicious contract can permanently stall another contract by failing
4-
in a strategic way. In particular, contracts that bulk perform transactions or updates using
5-
a `for` loop can be DoS'd if a call to another contract or `transfer` fails during the loop.
3+
A malicious contract can permanently stall another contract by failing in a strategic way. In particular, contracts that bulk perform transactions or updates using a `for` loop can be DoS'd if a call to another contract or `transfer` fails during the loop.
64

75
## Attack Scenarios
86

@@ -19,7 +17,7 @@ might run out of gas and revert.
1917

2018
- Both [insecure](auction.sol#L4) and [secure](auction.sol#L26) versions of the auction contract mentioned above
2119

22-
- Bulk refund functionality that is [suceptible to DoS](list_dos.sol#L3), and a [secure](list_dos.sol#L29) version
20+
- Bulk refund functionality that is [susceptible to DoS](list_dos.sol#L3), and a [secure](list_dos.sol#L29) version
2321

2422
## Mitigations
2523

not-so-smart-contracts/solidity/forced_ether_reception/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contracts can be forced to receive ether
22

3-
In certain circunstances, contracts can be forced to receive ether without triggering any code. This should be considered by the contract developers in order to avoid breaking important invariants in their code.
3+
In certain circumstances, contracts can be forced to receive ether without triggering any code. This should be considered by the contract developers in order to avoid breaking important invariants in their code.
44

55
## Attack Scenario
66

not-so-smart-contracts/solidity/honeypots/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The contract takes advantage of the fact that the global variable balance on the
2323

2424
The contract appears vulnerable to a constructor mismatch, allowing anyone to call the public method `Test1()` and double any ether they send to the function. The calculation involves a while loop which is strange, but the bounds conditions seem correct enough.
2525

26-
One of the features of Solidity is that it seeks to mimic JavaScript in its language syntax and style. This is ostensibly to ease onboarding of developers with something familiar. In this case, the contract takes advantage of different semantics between Solidity and JavaScript to create type confusion. The var keyword allows the compiler to infer the type of the assignment when declaring a variable. In this instance, `i1` and `i2` are resolved to fact be `uint8`. As such, their maximum value will be 255 before overflow -- causing the loop condition `if(i1<i2)` to fail, sending at most 255 wei to the caller before terminating.
26+
One of the features of Solidity is that it seeks to mimic JavaScript in its language syntax and style. This is ostensibly to ease on-boarding of developers with something familiar. In this case, the contract takes advantage of different semantics between Solidity and JavaScript to create type confusion. The var keyword allows the compiler to infer the type of the assignment when declaring a variable. In this instance, `i1` and `i2` are resolved to fact be `uint8`. As such, their maximum value will be 255 before overflow -- causing the loop condition `if(i1<i2)` to fail, sending at most 255 wei to the caller before terminating.
2727

2828
Fortunately the var keyword has been deprecated by the Solidity authors.
2929

not-so-smart-contracts/solidity/incorrect_erc20_interface/README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Incorrect erc20 interface
1+
## Incorrect ERC20 interface
22

33
### Description
44
Incorrect return values for ERC20 functions. A contract compiled with solidity > 0.4.22 interacting with these functions will fail to execute them, as the return value is missing.
@@ -16,6 +16,4 @@ contract Token{
1616
### Recommendation
1717
- Set the appropriate return values and value-types for the defined ERC20 functions.
1818
- Use [Slither](https://github.com/crytic/slither/) or [crytic.io](https://crytic.io/) to detect the issue
19-
- Use `slither-check-erc` to ensure ERC's conformance
20-
21-
19+
- Use `slither-check-erc` to ensure ERC conformance

not-so-smart-contracts/solidity/incorrect_erc721_interface/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Incorrect erc721 interface
1+
## Incorrect ERC721 interface
22

33
### Description
44
Incorrect return values for ERC721 functions. A contract compiled with solidity > 0.4.22 interacting with these functions will fail to execute them, as the return value is missing.

not-so-smart-contracts/solidity/incorrect_interface/README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Incorrect interface
22
A contract interface defines functions with a different type signature than the implementation, causing two different method id's to be created.
3-
As a result, when the interfact is called, the fallback method will be executed.
3+
As a result, when the interface is called, the fallback method will be executed.
44

55
## Attack Scenario
66

7-
- The interface is incorrectly defined. `Alice.set(uint)` takes an `uint` in `Bob.sol` but `Alice.set(int)` a `int` in `Alice.sol`. The two interfaces will produce two differents method IDs. As a result, Bob will call the fallback function of Alice rather than of `set`.
7+
- The interface is incorrectly defined. `Alice.set(uint)` takes an `uint` in `Bob.sol` but `Alice.set(int)` a `int` in `Alice.sol`. The two interfaces will produce two different method IDs. As a result, Bob will call the fallback function of Alice rather than of `set`.
88

99
## Mitigations
1010

11-
Verify that type signatures are identical between inferfaces and implementations.
11+
Verify that type signatures are identical between interfaces and implementations.
1212

1313
## Example
1414

@@ -79,4 +79,3 @@ bob.set_fixed(alice.address, {from: eth.accounts[0]} )
7979
alice.val()
8080
```
8181

82-

not-so-smart-contracts/solidity/reentrancy/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Re-entrancy
1+
# Reentrancy
22
A state variable is changed after a contract uses `call.value`. The attacker uses
33
[a fallback function](ReentrancyExploit.sol#L26-L33)—which is automatically executed after
44
Ether is transferred from the targeted contract—to execute the vulnerable function again, *before* the

not-so-smart-contracts/solidity/uninitialized-storage/README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
## Uninitialized storage variables
33

44
### Description
5-
An uinitialized storage variable will act as a reference to the first state variable, and can override a critical variable.
5+
An uninitialized storage variable will act as a reference to the first state variable, and can override a critical variable.
66

77
### Exploit Scenario:
88

@@ -27,4 +27,3 @@ Bob calls `func`. As a result, `owner` is override to 0.
2727
- Initialize all the storage variables.
2828
- Use [Slither](https://github.com/crytic/slither/) or [crytic.io](https://crytic.io/) to detect the issue
2929

30-

0 commit comments

Comments
 (0)