当前位置:网站首页>合约锁仓漏洞
合约锁仓漏洞
2022-04-23 05:31:00 【龙_破风】
pragma solidity ^0.4.18;
contract longTest3{
uint public ownerAmount;
struct HoldRecord{
uint amount;
uint time;
}
mapping(address => HoldRecord) public balance;
function payIn(uint holdTime) public payable{
require(msg.value > 0);
HoldRecord newRecord;
//当我们锁仓自己的金额时,其实金额是锁仓到了ownerAmount里面,而没有锁入我们自己的地址
//这样就会导致资金被盗,使用5.0以上版本就会避免这个问题
newRecord.amount+=msg.value;
newRecord.time=now + holdTime;
balance[msg.sender] = newRecord;
}
}
版权声明
本文为[龙_破风]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_38935605/article/details/124302278
边栏推荐
- selenium預先加載cookie的必要性
- Use pagoda + Xdebug + vscode to debug code remotely
- 2021-10-25
- deep learning object detection
- Excel 2016 cannot open the file for the first time. Sometimes it is blank and sometimes it is very slow. You have to open it for the second time
- 世界与个人发展
- Solve the problem of JS calculation accuracy
- QSslSocket::connectToHostEncrypted: TLS initialization failed
- Multiple mainstream SQL queries only take the latest one of the data
- Cross platform packaging of QT packaging program
猜你喜欢

what is wifi6?

Laravel database
Basic knowledge of redis

Intel SGX preliminary learning and understanding notes (continuously updated)

open3d材质设置参数分析

varnish入门
![[untitled] Notepad content writing area](/img/0a/4a3636025c3e0441f45c99e3c67b67.png)
[untitled] Notepad content writing area

弘玑微课堂 | Cyclone RPA之“灵活的数字员工”执行器

Camera imaging + homography transformation + camera calibration + stereo correction

Laravel routing settings
随机推荐
Xiuxian real world and game world
Uncle wolf is looking for a translator -- Plato -- ongoing translation
Understand the relationship between promise async await
Error handling mechanism of the strongest egg framework in history
Arithmetic and logical operations
The title bar will be pushed to coincide with the status bar
Self incrementing sequence creation of MySQL
OSI层常用协议
分支与循环语句
Generation of straightening body in 3D slicer
2021-09-27
CMake基础教程(39)pkgconfig
双击.jar包无法运行解决方法
Cmake basic tutorial (39) pkgconfig
STL learning notes 0x0001 (container classification)
egg中的cors和proxy(づ ̄3 ̄)づ╭~踩坑填坑的过程~ToT~
Reading notes of modern methods of C language programming
MFC implementation resources are implemented separately by DLL
[untitled] Notepad content writing area
Redis in node -- ioredis