-
Notifications
You must be signed in to change notification settings - Fork 130
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
42_王启翰_Assignment#1&Assignment#2 #111
Conversation
Create payroll.sol
update lesson folder
Pull First Assignment
lesson1/assignment/yours.sol
Outdated
owner = msg.sender; | ||
} | ||
|
||
//function to change employee's ssalary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- salary改变之前需要先结算下之前的工资
- 另外注意的是如果真的写实际用到的project,setSalary的参数一定要明确单位。这里你的函数定义里,我事实上是不知道单位是wei, 还是ether或者其他的
- 另外你注释里面salary拼错了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
非常感謝你的時間 :)
已改成結算之前的工資
也修正了註釋中的 salary
但是我不太清楚要如何在參數中限制 明確單位... :o?
能否給些提示呢? 感謝 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修正!~ :) 單位已命名在參數中 @sunnyszy
Thank you very much for your time~
lesson1/assignment/yours.sol
Outdated
uint payment = salary * (now - lastPayday) / payDuration; | ||
lastPayday = now; | ||
employee.transfer(payment); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这点逻辑稍微有点问题。
- 要求实现的是改变老员工地址,这里考虑的多了一点~关于添加新员工的知识第二课会有介绍
- 关于要不要在改地址之前付工资这点其实题目有点歧义,不需要纠结。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修正~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File has been updated according to the comments.
Thank you very much for your time :)
@sunnyszy
lesson1/assignment/yours.sol
Outdated
owner = msg.sender; | ||
} | ||
|
||
//function to change employee's ssalary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修正!~ :) 單位已命名在參數中 @sunnyszy
Thank you very much for your time~
Just realized my previous comments are linked to outdated codes. The unit of salary has been added to parameter :) in newest version of the file. |
Revert "Xw dev"
Merge pull request #1 from linjie-1/master
update my branch
Add answers to the question
@sunnyszy I have pushed the changes for HW#2 now. Since the first PR hasn't completed, it seems GitHub blocked me from creating another PR :( and put all my changes under this PR... Thank you very much for your time :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有一个合约变量初始化的小问题你下次注意下,直接给你merge了
uint constant payDuration = 10 seconds; | ||
address owner; | ||
Employee [] employees; | ||
uint total_salary = 0 * 1 ether; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注意下这里可以不需要赋值的,默认会初始化成零
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的 非常感謝 :)
下次會注意!~~
Assignment is under "your.sol" file