Comments (4)
Hey, oyente flags this as a bug because in theory beneficiary
can call itself recursively to exceed the callstack limit, run out of gas etc. and throw an exception. The recommended way to handle this, is to refactor the code to as follows or use the more safer transfer
function -
pragma solidity ^0.4.11;
contract Foo {
address public beneficiary = msg.sender;
function withdraw() public
returns (bool success)
{
if (msg.sender != beneficiary) {
throw;
}
if(!beneficiary.call.value(this.balance)()) {
throw;
}
return true;
}
function ()
payable
{
}
}
from oyente.
Well, it was the first thing I tried before open this issue, and it also causes Callstack Attack: True
.
For sure I know that beneficiary could make recursive calls to exceed the callstack limit, but in this case it doesn’t affect anything, no?
from oyente.
Hey, can u try again with the latest version of the code? I modified the callstack detection logic in a recent commit :)
Yes, as you said it cannot be exploited in this case (since it is the last statement).
from oyente.
Sorry, can’t check. I use a web version (which is not the latest one, I suppose).
Docker container doesn‘t work for me:
# cd /oyente && python oyente.py -s foo.sol
WARNING:root:You are using evm version 1.6.5. The supported version is 1.6.1
WARNING:root:You are using solc version 0.4.12, The supported version is 0.4.10
CRITICAL:root:Solidity compilation failed
from oyente.
Related Issues (20)
- Solidity 0.6.x
- Option -r has issues
- Having trouble with newest verions solc:0.8.0 as `solc` is now `solcjs`
- Reentrancy detection machanism
- Upcoming changes in CryticCompile
- Nurses
- How to use the oyente to batch test smart contracts? HOT 2
- docker
- First or second argument must be a Z3 bit-vector expression HOT 1
- ModuleNotFoundError: No module named 'crytic_compile' HOT 2
- Any plan to support solc 0.8.x HOT 1
- Bugs HOT 3
- Bad return value HOT 2
- Error: Expected identifier, got 'LParen' HOT 1
- Exception on binary contract
- UNKNOWN INSTRUCTION: SHL HOT 2
- Why does Oyente report different results on virtually identical contracts?
- docker not run HOT 1
- Installation Error
- python3 error in docker
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oyente.