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

42_王启翰_Assignment#1&Assignment#2 #111

Merged
merged 77 commits into from
Jan 13, 2018
Merged

Conversation

cwang25
Copy link
Contributor

@cwang25 cwang25 commented Jan 10, 2018

Assignment is under "your.sol" file

owner = msg.sender;
}

//function to change employee's ssalary
Copy link
Collaborator

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拼错了

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

非常感謝你的時間 :)
已改成結算之前的工資
也修正了註釋中的 salary

但是我不太清楚要如何在參數中限制 明確單位... :o?
能否給些提示呢? 感謝 :)

Copy link
Contributor Author

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~

uint payment = salary * (now - lastPayday) / payDuration;
lastPayday = now;
employee.transfer(payment);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这点逻辑稍微有点问题。

  • 要求实现的是改变老员工地址,这里考虑的多了一点~关于添加新员工的知识第二课会有介绍
  • 关于要不要在改地址之前付工资这点其实题目有点歧义,不需要纠结。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修正~

Copy link
Contributor Author

@cwang25 cwang25 left a 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

owner = msg.sender;
}

//function to change employee's ssalary
Copy link
Contributor Author

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~

@cwang25
Copy link
Contributor Author

cwang25 commented Jan 11, 2018

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.
Thank you very much for your time.

@cwang25
Copy link
Contributor Author

cwang25 commented Jan 13, 2018

@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 :)

@cwang25 cwang25 changed the title 42_王启翰_Assignment#1 42_王启翰_Assignment#1&Assignment#2 Jan 13, 2018
Copy link
Collaborator

@sunnyszy sunnyszy left a 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;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注意下这里可以不需要赋值的,默认会初始化成零

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的 非常感謝 :)
下次會注意!~~

@sunnyszy sunnyszy merged commit 2785431 into linjie-1:42-王启翰 Jan 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.