V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  boseqc35  ›  全部回复第 1 页 / 共 3 页
回复总数  48
1  2  3  
6 天前
回复了 zhouyin 创建的主题 生活 坐标杭州 又想回老家小镇躺平了
知道你有 150 多万现金了
7 天前
回复了 nerocho 创建的主题 信息安全 公司系统被攻击
@nerocho 那怎么还一堆遍历、注入
7 天前
回复了 nerocho 创建的主题 信息安全 公司系统被攻击
waf 是可以 bypass 的,建议找白帽给你们做一波渗透,该补补,该修修
8 天前
回复了 58k 创建的主题 问与答 哪位好心人帮忙在 cmd5 上解密一条付费秘钥
你不发出来,我怎么查
合约已发布到 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;
}
}

```
1  2  3  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2692 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 27ms · UTC 13:45 · PVG 21:45 · LAX 06:45 · JFK 09:45
Developed with CodeLauncher
♥ Do have faith in what you're doing.