Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/juliannicholls/blockchain-course
Code from the Udemy Ethereum and Solidity: The Complete Developer's Guide course by Stephen Grider
https://github.com/juliannicholls/blockchain-course
blockchain ethereum ethereum-contract solidity
Last synced: 3 months ago
JSON representation
Code from the Udemy Ethereum and Solidity: The Complete Developer's Guide course by Stephen Grider
- Host: GitHub
- URL: https://github.com/juliannicholls/blockchain-course
- Owner: JulianNicholls
- Created: 2018-04-26T14:55:57.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-18T06:11:29.000Z (4 months ago)
- Last Synced: 2024-09-18T08:34:14.157Z (4 months ago)
- Topics: blockchain, ethereum, ethereum-contract, solidity
- Language: JavaScript
- Size: 4.27 MB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Blockchain Course
Code from the Udemy
[Ethereum and Solidity: The Complete Developer's Guide course](https://www.udemy.com/ethereum-and-solidity-the-complete-developers-guide)
by Stephen Grider.## Progress
Section 5 - Campaign App, just finished initial campaign details page
## Security
The deploy scripts are not included, for security of my seed words. Although I will never use
them for a real app, you can never be too careful.## Differences
There will inevitably be differences between my code and Stephen's. I will
point out the most relevant parts below.### Testing of failures
In the tests which have the form
it('should fail xxx', () => {
try {
await xxx.methods.xxx().send({
xxx: xxx,
xxx: xxx
});assert(false);
} catch (err) {
assert(err);
}
};The `catch(err)` will always be entered even when the `assert(false)` is hit, making the test
null and void. A change is needed to the assert inside to `assert.equal(err.name, 'c')`....
} catch (err) {
assert.equal(err.name, 'c');
}### General
I prefer to use names like `enterLottery()` or `createCampaign()` instead of `onSubmit()`,
and names like `updateAmount()` instead of `onChange()`.I have done a lot of object destructuring.
#### Layout
My Layout component takes a title attribute to set the title in the head section.
### Lottery Contract
I have implemented the lastWinner storage in my Lottery contract and use it in the lottery app.
### Campaign
#### Contract
I have used `contributors` and `contributorsCount` for contributors in the contract and
subsequent summary page. The Request struct still has `approvals` and `approvalCount` though.My finalise function is called `finaliseRequest()` with an s.
#### App
I am validating the numeric inputs to only allow digits and the decimal point in. I feel that
there's no point in allowing bad input and then only catching it when it fails to convert to a
number later on.