//Mapped data
mapping (uint256 => Job) public jobData;
//Transaction must contant Ethereum
modifier onlyHaveFund {
require(msg.value > MINIUM_SALARY);
_;
}
//Valid timeOut should be greater than 3 days
modifier onlyValidTimeOut(uint256 timeOut) {
require(timeOut > 3 days);
_;
}
//Check valid job Id
modifier onlyValidId(uint256 jobId) {
require(jobId < totalJob);
_;
}
//Mortgage should be greater than 1/10
modifier onlyValidMortgage(uint256 jobId) {
require(msg.value >= jobData[jobId].salary/10);
_;
}
//Only job creator is accepted
modifier onlyCreator(uint256 jobId) {
require(jobData[jobId].creator == msg.sender);
_;
}
//Only job labor is accepted
modifier onlyLabor(uint256 jobId) {
require(jobData[jobId].labor == msg.sender);
_;
}
//Check is it a taked job
modifier onlyAvailableJob(uint256 jobId) {
require(jobData[jobId].end == 0);
require(jobData[jobId].start == 0);
_;
}
//Only not completed
modifier onlyNotCompleted(uint256 jobId){
require(jobData[jobId].completed == false);
_;
}
Created
May 26, 2018 11:07
-
-
Save chiro-hiro/100172cf383778fdd4ff75b0946e06b3 to your computer and use it in GitHub Desktop.
Part time part 3/chap 6
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment