Comments (5)
I found what causes the difference between the values shown and the values calculated: MSTORE is marked as "W_verylow" in the Yellowpaper (3 gas), shows 3 gas in the remix debugger, but takes up 12 gas on chain. I have released a similar contract on rinkeby, its's the third instruction and pretty obvious: http://rinkeby.etherscan.io/remix?txhash=0xb837a742727706e9b8f57f33477d3b5dfd3959f705f15f041c1ed6357178917b
I'd be very happy if someone can explain it to me before closing the issue. Thank you.
from remix-project.
That's a bug in Remix:
The cost of MSTORE is 3 gas, but the general cost if the step can be higher if the memory needs to be extended.
from remix-project.
Thanks for this @yann300 . Could you elaborate under what situation would the memory need to be extended? Is it a linear increase as well? Just curious.
from remix-project.
this is has been fixed for sometimes.
Sorry for not responding here.
you'll find the information here: https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a0-1-memory-expansion
The following opcodes incur a memory expansion cost in addition to their otherwise static gas cost: RETURN, REVERT, MLOAD, MSTORE, MSTORE8.
from remix-project.
@yann300 appreciate it. I already forgot about the issue, been 5 years. Again, really appreciate getting back to it and referencing more information here.
from remix-project.
Related Issues (20)
- [FEATURE REQUEST] Add issue templates HOT 1
- Account list is empty while connecting to localhost via Remixd
- Add import to AI code completion HOT 1
- Remix Desktop: Cannot Connect To Injected Provider HOT 2
- Debugger does not show correct calldata of contract called via delegatecall
- Curated list of tutorial videos / grid view
- AI improvements
- Code not compiling HOT 1
- [FEATURE REQUEST] Ability to add custom console command packs HOT 3
- font-awesome all.css file is bulky
- Remix Desktop displays a "scam alert" even though it's standalone
- Remix Desktop: Terminal doesn't close when exited cleanly
- Remix Can't Deploy Contracts Past Cancun Upgrade HOT 4
- Deterministic Deployment: altering opcodes for specific chains
- Cant verified contract in Coredao
- LearnEth update
- DAppDraft's Main Panel issues
- Too many AI's at top of Remix editor HOT 3
- Remix & front end dev
- fail to load dapp deployed by dapp-draft if the function's instructions contain no-english characters
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 remix-project.