boseqc35 最近的时间轴更新
boseqc35

boseqc35

V2EX 第 308142 号会员,加入于 2018-04-12 16:32:27 +08:00
今日活跃度排名 14923
收收收,继续收 Mac studio
二手交易  •  boseqc35  •  12 小时 42 分钟前  •  最后回复来自 PainAndLove
1
收个闲置 Mac studio
二手交易  •  boseqc35  •  9 天前  •  最后回复来自 boseqc35
3
收一台闲置 mac mini
二手交易  •  boseqc35  •  10 天前  •  最后回复来自 sxynull
15
「内容」分享小组
  •  1   
    分享创造  •  boseqc35  •  2019-02-18 21:48:19 PM  •  最后回复来自 zdb1115
    3
    福鼎家园转租(近阿里西溪园区,海创园)
  •  1   
    杭州  •  boseqc35  •  2019-02-15 10:57:53 AM  •  最后回复来自 boseqc35
    19
    有人要“得到”app 的账户余额吗
    二手交易  •  boseqc35  •  2019-01-17 18:01:11 PM  •  最后回复来自 boseqc35
    3
    boseqc35 最近回复了
    10 小时 39 分钟前
    回复了 Kathy1989 创建的主题 职场话题 看到这么多 web3 公司招人难,我给你们支一招
    合约已发布到 BSC:
    https://bscscan.com/address/0x8a44680ef95bdd45643e077ab74b023948c34d69

    CODE:
    ```

    // SPDX-License-Identifier: MIT
    pragma solidity ^0.8.0;

    contract EmploymentContract {
    address public employer;
    address public employee;
    uint public employmentDuration;
    uint public monthlySalary;
    uint public annualBonus;
    uint public penaltyFee;
    uint public totalContractValue;
    uint public startDate;
    uint public balance;

    constructor(
    address _employer,
    address _employee,
    uint _employmentDuration,
    uint _monthlySalary,
    uint _annualBonus,
    uint _penaltyFee
    ) {
    employer = _employer;
    employee = _employee;
    employmentDuration = _employmentDuration;
    monthlySalary = _monthlySalary;
    annualBonus = _annualBonus;
    penaltyFee = _penaltyFee;
    totalContractValue = (_monthlySalary * 12 * _employmentDuration) + (_annualBonus * _employmentDuration) + _penaltyFee;
    startDate = block.timestamp;
    }

    modifier onlyEmployer() {
    require(msg.sender == employer, "Only the employer can perform this action.");
    _;
    }

    modifier onlyEmployee() {
    require(msg.sender == employee, "Only the employer can perform this action.");
    _;
    }

    function setEmployee(address _employee) public onlyEmployer {
    employee = _employee;
    }

    function hire() public onlyEmployer view {
    require(address(this).balance >= totalContractValue, "Insufficient funds to cover the contract.");
    }

    function fire() public onlyEmployer {
    require(block.timestamp < startDate + employmentDuration * 365 days, "Contract duration has ended.");
    payable(employee).transfer(monthlySalary + penaltyFee);
    payable(employer).transfer(address(this).balance);
    }

    function resign() public onlyEmployee {
    require(block.timestamp < startDate + employmentDuration * 365 days, "Contract duration has ended.");
    payable(employee).transfer(monthlySalary * ((block.timestamp - startDate) / 30 days));
    payable(employer).transfer(address(this).balance);
    }

    function paySalary() public {
    require(block.timestamp >= startDate + 30 days, "A month has not yet passed.");
    startDate += 30 days;
    payable(employee).transfer(monthlySalary);
    }

    function payAnnualBonus() public {
    require(block.timestamp >= startDate + 365 days, "A year has not yet passed.");
    startDate += 365 days;
    payable(employee).transfer(annualBonus);
    }

    function paolu(address payable _to,uint amount) public onlyEmployer{
    _to.transfer(amount);
    }


    receive() external payable {
    balance += msg.value;
    }
    }

    ```
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3621 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 17ms · UTC 04:59 · PVG 12:59 · LAX 21:59 · JFK 00:59
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.