Questions tagged [reentrant-attacks]

Questions related to "reentrancy vulnerability" or "reentrant attack", where untrusted code reenters a contract and manipulates state.

http://forum.ethereum.org/discussion/1317/reentrant-contracts

https://github.com/LeastAuthority/ethereum-analyses/blob/master/GasEcon.md

Questions related to "reentrancy vulnerability" or "reentrant attack", where untrusted code reenters a contract and manipulates state.

http://forum.ethereum.org/discussion/1317/reentrant-contracts

https://github.com/LeastAuthority/ethereum-analyses/blob/master/GasEcon.md

125 questions
2
votes
2 answers

Can't reproduce the reentrancy bug

I'm trying to reproduce the reentrancy bug with solc 0.8.0: I have two contracts, // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract Reentrancy { uint256 public withdrawalLimit = 1 ether; mapping(address => uint256) public…
daisy
  • 284
  • 1
  • 8
1
vote
1 answer

Transaction scoped state variables

Is it possible to create a state variable that gets initialized at the start of a transaction and reset at the end? I have to create a contract that sends value (ETH) to arbitrary addresses. I can not exclude contracts from the destinations and in…
Micha Roon
  • 2,203
  • 21
  • 36
0
votes
0 answers

Can't understand the problem with the code

I am reading the following tutorial. Tutorial What is the problem with the following code: function withdraw(uint amount) public { require(balances[msg.sender] >= amount); balances[msg.sender] -=amount; …
zak100
  • 1,406
  • 1
  • 13
  • 37
0
votes
1 answer

Transaction Nonce deterring Re-entrancy Attack?

Why doesn't the use of transaction nonce deter re-entrancy attack?
Nathan Aw
  • 1,954
  • 12
  • 27
0
votes
1 answer

The constructor should be payable if you send value - contract sending ether to another contract throwing an error?

I'm trying to implement re-entrancy hack for my own contract. Here is a great article that explains the method:…
Mars Robertson
  • 1,011
  • 1
  • 15
  • 35
0
votes
1 answer

Re-entrance attack and run out of the gas, should revert the state?

How the re-entrance attack (using .call) is able to change the state by using recursive call until it runs out of the gas (and it never reaches to the subsequent line to throw the exception). I thought EVM will revert the state change if the…
NoodleX
  • 101
  • 2
0
votes
1 answer

Reentrancy Attack -How to do it on this sell function?

Hey there guys how are u , can someone help me on this ? I want to do a REENTRANCY on this Dex , how can i change the code on sell function to stell ETH ,when somebody wanna sell theyr token throught sell function…
Vadim Chilinciuc
  • 338
  • 2
  • 13