HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
Consensys
smart-contract-best-practices
HTML2017–2017
Consensys / smart-contract-best-practices

smart-contract-best-practices

A guide to smart contract security best practices

7Distinct people
7Mentions
0Explicit recommenders
27GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A guide to smart contract security best practices

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by week7 dated mentions

Observed mentions: 2017-07-19 22:41:34 UTC to 2017-11-07 16:59:57 UTC. Weeks start Monday, UTC.

012342017-07-17 00:00:00 UTC to 2017-07-24 00:00:00 UTC (exclusive): 4 mentions; 2 submissions, 2 commentsJul 172017-07-24 00:00:00 UTC to 2017-07-31 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2017-07-31 00:00:00 UTC to 2017-08-07 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-08-07 00:00:00 UTC to 2017-08-14 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-08-14 00:00:00 UTC to 2017-08-21 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-08-21 00:00:00 UTC to 2017-08-28 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-08-28 00:00:00 UTC to 2017-09-04 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-09-04 00:00:00 UTC to 2017-09-11 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-09-11 00:00:00 UTC to 2017-09-18 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsSep 112017-09-18 00:00:00 UTC to 2017-09-25 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-09-25 00:00:00 UTC to 2017-10-02 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-10-02 00:00:00 UTC to 2017-10-09 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-10-09 00:00:00 UTC to 2017-10-16 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-10-16 00:00:00 UTC to 2017-10-23 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2017-10-23 00:00:00 UTC to 2017-10-30 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-10-30 00:00:00 UTC to 2017-11-06 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-11-06 00:00:00 UTC to 2017-11-13 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsNov 6

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Jul 172017-07-17 00:00:00 UTC2017-07-24 00:00:00 UTC422
Jul 242017-07-24 00:00:00 UTC2017-07-31 00:00:00 UTC101
Jul 312017-07-31 00:00:00 UTC2017-08-07 00:00:00 UTC000
Aug 72017-08-07 00:00:00 UTC2017-08-14 00:00:00 UTC000
Aug 142017-08-14 00:00:00 UTC2017-08-21 00:00:00 UTC000
Aug 212017-08-21 00:00:00 UTC2017-08-28 00:00:00 UTC000
Aug 282017-08-28 00:00:00 UTC2017-09-04 00:00:00 UTC000
Sep 42017-09-04 00:00:00 UTC2017-09-11 00:00:00 UTC000
Sep 112017-09-11 00:00:00 UTC2017-09-18 00:00:00 UTC000
Sep 182017-09-18 00:00:00 UTC2017-09-25 00:00:00 UTC000
Sep 252017-09-25 00:00:00 UTC2017-10-02 00:00:00 UTC000
Oct 22017-10-02 00:00:00 UTC2017-10-09 00:00:00 UTC000
Oct 92017-10-09 00:00:00 UTC2017-10-16 00:00:00 UTC000
Oct 162017-10-16 00:00:00 UTC2017-10-23 00:00:00 UTC101
Oct 232017-10-23 00:00:00 UTC2017-10-30 00:00:00 UTC000
Oct 302017-10-30 00:00:00 UTC2017-11-06 00:00:00 UTC000
Nov 62017-11-06 00:00:00 UTC2017-11-13 00:00:00 UTC101

What Hacker News says

7 sources
You need a reasonable understanding of how Ethereum works (and blockchains in general). The primary language is Solidity, which is pretty simple but has some security gotchas to be aware of. Javascript is most important for writing UI. There's also an API for Go, so that can be pretty helpful. The main clients are written in Go, Rust, C++, and Javascript. Write some open source code, blog about it, participate in the community, and if you impress people they'll come to you. Resources: ethereum.org https://github.com/ethereum/wiki/wiki/White-Paper https://solidity.readthedocs.io/en/develop/solidity-in-depth... https://github.com/ethereum/wiki/wiki/JavaScript-API r/ethereum r/ethdev https://gitter.im/ethereum/home ethereum.stackexchange.com truffleframework.com https://github.com/ConsenSys/smart-contract-best-practices https://medium.com/@w
Read the rest
In Ask HN: Is it too late to get into Bitcoin or cryptocurrency in general?
If you are considering writing a smart contract, you should read this first https://github.com/ConsenSys/smart-contract-best-practices for Solidity security pitfalls, and hopefully have some idea of invariants/contracts to verify expected properties of your smart contract https://www.cs.cmu.edu/~rjsimmon/15122-s16/lec/01-contracts.... and additionally hope the EVM doesn't have unexpected behavior. Anybody know if the legality of exploiting leaky smart contracts has been tested? Since a lawyer can exploit a badly written contract I wonder if somebody who finds a flaw in a smart contract can legally just jack all the coins or alternatively, write purposely obfuscated contracts (underhanded Solidity contest) to run a scam.
In Learn Ethereum smart contract programming
The 20 cases for underflow and overflow [0] show how difficult it is to develop error-free contracts. Would have been great if the VM would detect such cases and thus make the contract code less polluted with boundary and overflow checks. Some projects have started sharing audit results publicly directly in their repos [1]. It's a great read to see common errors and yet unsolved issues that originate in the ERC20 token specification. [0] https://github.com/ConsenSys/smart-contract-best-practices#i... [1] https://github.com/status-im/status-network-token#reviewers-...
In 153k Ether Stolen in Parity Multi-Sig Attack
Poking around in that project, I don't see any specific tests of the Wallet contract... would be interested to see what UTs/STs were included if anyone knows where they are -- or was it just manually tested on the testnet? It seems that a basic set of UTs for this contract should have caught this issue. It's not even in the category of weird timing attacks or complicated internal states allowing unexpected state transitions -- this is a trivial bug that could be spotted by viewing the contract in Remix (the Solidity IDE). There are certainly some weird edge cases in the Ethereum VM programming model that are hard to UT, and I think that dev efforts in this area are under-resourced (e.g. it's currently impossible to test time-dependent contracts as there's no way of mocking out the clock in the simulated blockchain). If you are considering
Read the rest
writing a smart contract, read and re-read https://github.com/ConsenSys/smart-contract-best-practices, and then write UTs for each of these cases so that you can convince yourself that you've covered them. Relevant to this bug: > Understand that your public functions are public, and may be called maliciously. Your private data is also viewable by anyone.
In 153k Ether Stolen in Parity Multi-Sig Attack

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.