-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from linjie-1/master
更新本地文档
- Loading branch information
Showing
15 changed files
with
201 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
## 硅谷live以太坊智能合约频道官方地址 | ||
|
||
### 第二课《智能合约设计进阶-多员工薪酬系统》 | ||
|
||
目录结构 | ||
<br/>| | ||
<br/>|--orgin 课程初始代码 | ||
<br/>| | ||
<br/>|--assignment 课程作业提交代码 | ||
<br/> | ||
### 本节知识点 | ||
第2课:智能合约设计进阶-多员工薪酬系统 | ||
- 动态静态数组的不同 | ||
- 函数输入参数检查 revert | ||
- 循环与遍历的安全性 | ||
- 程序运行错误检查和容错:assert与require |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
## 硅谷live以太坊智能合约 第二课作业 | ||
这里是同学提交作业的目录 | ||
|
||
### 第二课:课后作业 | ||
完成今天的智能合约添加100ETH到合约中 | ||
- 加入十个员工,每个员工的薪水都是1ETH | ||
每次加入一个员工后调用calculateRunway这个函数,并且记录消耗的gas是多少?Gas变化么?如果有 为什么? | ||
- 如何优化calculateRunway这个函数来减少gas的消耗? | ||
提交:智能合约代码,gas变化的记录,calculateRunway函数的优化 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/*作业请提交在这个目录下*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## 硅谷live以太坊智能合约 第二课《智能合约设计进阶-多员工薪酬系统》 | ||
|
||
这里是每一课的初始代码,有需要的同学可以参考 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
pragma solidity ^0.4.14; | ||
|
||
contract Payroll { | ||
struct Employee { | ||
address id; | ||
uint salary; | ||
uint lastPayday; | ||
} | ||
|
||
uint constant payDuration = 10 seconds; | ||
|
||
address owner; | ||
Employee[] employees; | ||
|
||
function Payroll() { | ||
owner = msg.sender; | ||
} | ||
|
||
function _partialPaid(Employee employee) private { | ||
} | ||
|
||
function _findEmployee(address employeeId) private returns (Employee, uint) { | ||
} | ||
|
||
function addEmployee(address employeeId, uint salary) { | ||
} | ||
|
||
function removeEmployee(address employeeId) { | ||
} | ||
|
||
function updateEmployee(address employeeId, uint salary) { | ||
} | ||
|
||
function addFund() payable returns (uint) { | ||
} | ||
|
||
function calculateRunway() returns (uint) { | ||
uint totalSalary = 0; | ||
for (uint i = 0; i < employees.length; i++) { | ||
totalSalary += employees[i].salary; | ||
} | ||
return this.balance / totalSalary; | ||
} | ||
|
||
function hasEnoughFund() returns (bool) { | ||
} | ||
|
||
function getPaid() { | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
## 硅谷live以太坊智能合约 第三课作业 | ||
这里是同学提交作业的目录 | ||
|
||
### 第三课:课后作业 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/*作业请提交在这个目录下*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## 硅谷live以太坊智能合约 第三课 | ||
|
||
这里是每一课的初始代码,有需要的同学可以参考 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,102 @@ | ||
# 老董区块链干货铺 | ||
硅谷live以太坊智能合约频道官方地址 | ||
# 硅谷live以太坊智能合约频道官方地址 | ||
|
||
### 一、课程如何更新的呢?(以北京时间为准) | ||
|
||
每周三、日更新课程,具体安排如下 | ||
|
||
| 日期 | 课程 | | ||
| ------ | ------ | | ||
| 1月7号 | 第一课 《智能合约设计初阶-单员工薪酬系统》| | ||
| 1月10号 | 第二课 《智能合约设计进阶-多员工薪酬系统》| | ||
| 1月14号 | 第三课 《智能合约后端优化和产品化》| | ||
| 1月17号 | 第四课 《使用Truffle架构进行前后端交互,测试,部署》| | ||
| 1月21号 | 第五课 《分布式应用前端产品化》| | ||
| 1月24号 | 第六课 《分布式应用前端产品化-进阶》| | ||
| 1月28号 | 第七课 《智能合约的主网部署》| | ||
| 2月4号 | 总答疑 | | ||
|
||
每周日上午10点为直播答疑(14、21、28号) | ||
|
||
### 二、课程大纲: | ||
#### 第1课:智能合约设计初阶-单员工薪酬系统 | ||
- 合约的基本概念和定义 | ||
- Solidity类型系统与传统语言的异同 | ||
- Solidity独特的单位系统 | ||
- 区块链系统全局变量:区块信息,消息 | ||
|
||
#### 第2课:智能合约设计进阶-多员工薪酬系统 | ||
- 动态静态数组的不同 | ||
- 函数输入参数检查 revert | ||
- 循环与遍历的安全性 | ||
- 程序运行错误检查和容错:assert与require | ||
|
||
#### 第3课:智能合约后端优化和产品化 | ||
- 如何通过数据结构优化降低合约执行成本 | ||
- 合约的继承 | ||
- 巧用modifier | ||
- 以太坊函数库的使用和基本介绍 | ||
|
||
#### 第4课:使用Truffle架构进行前后端交互,测试,部署 | ||
- 为什么要用Truffle,Truffle的基本概念 | ||
- Truffle 的command line 功能 | ||
- 初始化项目与Truffle项目目录结构 | ||
- 编译部署合约到testrpc | ||
|
||
#### 第5课:分布式应用前端产品化 | ||
- Metamask交互,Chrome浏览使用dApp | ||
- Event和智能合约后端的交互 | ||
- 前段代码和后端代码的整合测试(integration test) | ||
|
||
|
||
#### 第6课:《分布式应用前端产品化-进阶》 | ||
- 对我们之前开发的payroll合约进行整合,我们主要讲介绍一下以下两部分的内容,metamask插件与前端代码的交互;前端代码中Event的使用。 | ||
|
||
#### 第7课:《智能合约的主网部署》 | ||
- 智能合约安全 | ||
- 主网合约部署 | ||
- 拜占庭硬分叉,最新solidity语音特性 | ||
- 介绍白帽黑客实践所要破解的合约,公布竞赛规则 | ||
|
||
## 三、人员分工 | ||
#### 班长雅珣: | ||
- 负责发送入学指南、拉人进群、大群的群规制定; | ||
- 发现社群中优质kol用户,并持续激励他们; | ||
- 用户产生疑问,我们能快速进行解答; | ||
- 负责社群打卡活动、联系助教及学员征集话题; | ||
- 负责社群开营仪式、结业仪式、中期活动、白帽黑客等活动。 | ||
|
||
#### 班长Nicole: | ||
- 帮用户获取课程之外的干货和拆解课程中的疑难知识点 | ||
|
||
#### 班长晓杰: | ||
- 负责督促用户写作业,助教批改作业; | ||
- 负责总体的作业统计,公布作业信息,筛选优秀作业,海报展示; | ||
- 负责每周六的助教分享会。 | ||
|
||
#### 班长令帆: | ||
- 负责统计学员和小组积分,提前制作积分表; | ||
- 负责每周和结业在社群中用海报公布各小组的积分状态和前三名个人分状态。 | ||
|
||
#### 助教: | ||
作业点评 | ||
- 唐涵:负责1-10号、同时在社群“开拓者A战队”担任助教 | ||
- 海罗沃德:负责11-20号,同时在社群“开拓者B战队”担任助教 | ||
- Jonny:负责21-30号,同时在社群“开拓者C战队”担任助教 | ||
- Steven:负责31-40号,同时在社群“开拓者D战队”担任助教 | ||
- 振宇:负责41-50号,同时在社群“开拓者E战队”担任助教 | ||
- 李明:负责51-60号,同时在社群“开拓者F战队”担任助教 | ||
- 高冰:负责61-70号,同时在社群“开拓者G战队”担任助教 | ||
- 刘芳路:负责71-80号,同时在社群“开拓者H战队”担任助教 | ||
- 何智华:负责81-90号,同时在社群“开拓者 I 战队”担任助教 | ||
- 王鲁明:负责91-100号,同时在社群“开拓者J战队”担任助教 | ||
|
||
## 四、课程表 | ||
|
||
北京时间 | 星期一 | 星期二 | 星期三 | 星期四 | 星期五 | 星期六 | 星期天 | ||
:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| | ||
09:00 | 鲸打卡 | 鲸打卡 | 鲸打卡 | 鲸打卡 | 鲸打卡 | 鲸打卡 | 鲸打卡 | ||
10:00 | | | | | | live分享会 | 直播答疑 | ||
11:00 | | | | | | | 课程更新 | ||
12:00 | | | 疑难知识点汇总和解析 | | | 疑难知识点汇总和解析 | | | ||
21:00 | 每日复盘 | 每日复盘 | 每日复盘 | 每日复盘 | 每日复盘 | 每日复盘 | 每日复盘 | ||
22:00 | | | 周日课程作业截止/<br/>课程更新 | | 课外知识点拓展 | 周三课程作业截止 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
## 老董区块链干货铺 第一课作业 | ||
## 硅谷live以太坊智能合约 第一课作业 | ||
这里是同学提交作业的目录 | ||
|
||
### 第一课:课后作业 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,5 +35,4 @@ contract Payroll { | |
salary=0; | ||
employee=0x0000000000000000000000000000000000000000; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
## 老董区块链干货铺 第一课《智能合约设计初阶-单员工薪酬系统》 | ||
## 硅谷live以太坊智能合约 第一课《智能合约设计初阶-单员工薪酬系统》 | ||
|
||
这里是每一课的初始代码,有需要的同学可以参考 |