Comments (9)
Awesome, thanks!
from pure-evm.
pure-evm
can only execute evm bytecode that computes pure functions, so the code being executed should never read from or modify state.
Are you trying to read contract storage (considering it's a view
function)?
from pure-evm.
No, the contract storage isn't being read or modified. It could be a pure
function, but it would break the interface we are inheriting.
However, this problem persisted even when I used a pure
function. Using ethers v5 and solidity 0.6.4 if that helps
from pure-evm.
Please attach a minimum reproducible example and I'll take a look.
from pure-evm.
Without looking at your code, it seems the problem is that the depth()
externality is being called by your code (which would result in the given error, as expected).
I took a quick look at the parity-ethereum/open-ethereum codebase and it looks like it's only called on contract creation or cross contract calls.
So I would guess your bytecode has at least one of those opcodes in it, i.e.,instructions::CREATE | instructions::CREATE2, instructions::CALL | instructions::CALLCODE | instructions::DELEGATECALL | instructions::STATICCALL
.
from pure-evm.
Sure, here is a simple reproduction. Just install, build, and test and you should see the same failure.
That's interesting. Was chatting with @HeikoFisch about it on our side, and we were thinking it might be due to the usage of sha256
or recover
within the pure
or view
function
from pure-evm.
If I recall correctly, all Ethereum "builtin" functions like sha256
and recover
execute as cross contract calls at builtin addresses, which would explain the error you're receiving.
from pure-evm.
Yeah, they would appear as contract calls in the compiled code.
So even though this is accepted as pure
by the EVM it doesn't look like it will work within this library, bummer! Do you have any plans on supporting these precompile calls in the future?
from pure-evm.
There's currently no plans for feature development on this project, but I filed a new issue to track this feature request. See #7.
from pure-evm.
Related Issues (7)
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 pure-evm.