Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import not-so-smart-contracts #146

Open
wants to merge 74 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
930ee7c
Initial commit
montyly Aug 28, 2017
0dff584
Add new examples:
montyly Aug 29, 2017
8600067
Minor modifs in Readme(s)
montyly Aug 29, 2017
5f20de6
Improve reentrancy example
montyly Sep 7, 2017
6f1ec23
Make titles consistent
Oct 12, 2017
7f1374e
Add unchecked external call
Oct 12, 2017
1c0e2e3
Add links to lines of code
Oct 12, 2017
8562893
Update README.md
Oct 13, 2017
b9c064d
Update README.md
Oct 13, 2017
1fdd900
small edits
Oct 13, 2017
ae8d419
Added credits and contact info (#5)
ESultanik Oct 13, 2017
0b51260
Add race condition (#3)
montyly Oct 13, 2017
8818252
README nitpics
dguido Oct 15, 2017
c3f5799
correct path
dguido Oct 15, 2017
a47392b
Create LICENSE
dguido Oct 16, 2017
c256330
Clean reentrancy exploit
montyly Mar 6, 2018
2d775c2
Added a README on variable shadowing
ggrieco-tob Mar 19, 2018
0e66892
Added honeypot examples
Apr 2, 2018
93c7242
wrong -> incorrect
dguido Jul 26, 2018
ae26f59
Small spelling correction in file name...
Aug 29, 2018
7928b85
Fix syntax error so solc compiles...
Aug 29, 2018
4397d5e
Denial of service vulns added
blperez01 Aug 31, 2018
d1742f9
Fixed README
blperez01 Aug 31, 2018
7fa9467
Created readme's for two new vulns and updated master readme accordingly
blperez01 Aug 31, 2018
46a7d81
updated bad randomness readme. still need examples
blperez01 Aug 31, 2018
041c3d1
Updated integer overlow and denial of service readme
blperez01 Aug 31, 2018
2cf5365
updated missing constructor and race condition READMEs
blperez01 Aug 31, 2018
a9aaec1
added forced ether reception example
ggrieco-tob Sep 4, 2018
df804f0
More README updates
blperez01 Sep 4, 2018
4196490
Create inherited_state.sol
ggrieco-tob Mar 19, 2018
a2b15da
Another round of readme updates
blperez01 Sep 4, 2018
d214ed6
Fixed links
blperez01 Sep 4, 2018
1afbaea
fixed top level readme, added references
blperez01 Sep 4, 2018
939b0ab
Fix syntax error so solc compiles...
Aug 29, 2018
f619b7f
Update README.md
ggrieco-tob Sep 4, 2018
3c93d0e
More educational clarification for the reentrancy example
ESultanik Sep 5, 2018
0abd0e5
Added forced ether reception to README
blperez01 Sep 5, 2018
d516ef2
Added links, slight format changes
blperez01 Sep 5, 2018
64cfc2a
Fix path to relative link to code
ESultanik Sep 5, 2018
15714f4
Fixed variable shadowing link
blperez01 Sep 5, 2018
2335b71
Update README.md
blperez01 Sep 5, 2018
d075aa8
Update list_dos.sol
blperez01 Sep 19, 2018
5adefba
Update README.md
blperez01 Sep 19, 2018
c46872a
Changed missing constructor to more sensible name
blperez01 Sep 19, 2018
e33f629
removed missing constructor folder
blperez01 Sep 19, 2018
456fa55
Update README.md
blperez01 Sep 19, 2018
7b8fa0b
Fixed the link to the constructor example
Sep 24, 2018
7e72091
Fixed main README link to Wrong Constructor Name
Sep 24, 2018
ea3625d
Added theRun as an example of bad randomness
Sep 27, 2018
c9b9d42
added theRun source code
Sep 27, 2018
56e4af4
updated README to reference the local source code
Sep 27, 2018
d7ac0a7
Add a new reference to unchecked external calls
Oct 3, 2018
6b162c0
Add the same reference to Denial of Service
Oct 4, 2018
778153e
Update README.md
dguido Oct 5, 2018
2966bba
Update README.md
dguido Oct 5, 2018
777bc54
Update README.md
dguido Oct 5, 2018
cba8e6f
updated not-so-smart-contracts to add SpankChain
Oct 9, 2018
d2846df
add more examples
tayvano Feb 25, 2020
77a96d3
Update theRun.sol
May 31, 2022
821d22d
mv everything into subfolder
Oct 3, 2022
00d656c
Merge branch 'master' into import-nssc
Oct 4, 2022
3b41791
Add 10 vulnerabilities
montyly Apr 24, 2020
dac979c
rm nssc/solidity/license
Oct 4, 2022
0d9ada8
describe solc version impact on integer over-/under-flows
Oct 4, 2022
cd1dab9
fix spelling mistakes
Oct 4, 2022
63dbb5c
init solhint config
Oct 4, 2022
e1e63ac
bad_randomness editing pass
Oct 4, 2022
a332427
dos & ether reception editing pass
Oct 4, 2022
4281a02
honeypot editing pass
Oct 4, 2022
897c9ad
remove incorrect interface examples
Oct 4, 2022
953c20a
reentrancy editing pass
Oct 4, 2022
d9e440a
rm old examples already covered by honeypot examples
Oct 4, 2022
edda363
more cleanup & update nssc/solidity readme
Oct 4, 2022
6ca3a11
fix typo
Oct 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added a README on variable shadowing
ggrieco-tob authored and bohendo committed Mar 19, 2018
commit 2d775c2c5bffb9f1d42d4e46006a84883674957a
14 changes: 14 additions & 0 deletions variable shadowing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Variable Shadowing

## Principle
- Variable shadowing occurs when a variable declared within a certain scope (decision block, method, or inner class)
has the same name as a variable declared in an outer scope.

## Attack
This depends a lot on the code of the contract itself. For instance, in the state_inherance.sol example,
it stops the owner to perform the self-destruction of the contract.

## Mitigation
The solidity compiler has [some checks](https://github.com/ethereum/solidity/issues/973) to emit warnings when
it detects this kind of issue, but [it has known examples](https://github.com/ethereum/solidity/issues/2563) where
it fails.