-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for EXTCODEHASH #4676
Changes from all commits
c6bd297
5d985ab
6a1e79a
f2fa513
8d8c855
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -271,12 +271,14 @@ In the grammar, opcodes are represented as pre-defined identifiers. | |
+-------------------------+-----+---+-----------------------------------------------------------------+ | ||
| returndatacopy(t, f, s) | `-` | B | copy s bytes from returndata at position f to mem at position t | | ||
+-------------------------+-----+---+-----------------------------------------------------------------+ | ||
| extcodehash(a) | | C | code hash of address a | | ||
+-------------------------+-----+---+-----------------------------------------------------------------+ | ||
| create(v, p, s) | | F | create new contract with code mem[p...(p+s)) and send v wei | | ||
| | | | and return the new address | | ||
+-------------------------+-----+---+-----------------------------------------------------------------+ | ||
| create2(v, n, p, s) | | C | create new contract with code mem[p...(p+s)) at address | | ||
| | | | keccak256(<address> . n . keccak256(mem[p...(p+s))) and send v | | ||
| | | | wei and return the new address | | ||
| | | | keccak256(0xff . <address> . n . keccak256(mem[p...(p+s))) | | ||
| | | | and send v wei and return the new address | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was missed in #5013. |
||
+-------------------------+-----+---+-----------------------------------------------------------------+ | ||
| call(g, a, v, in, | | F | call contract at address a with input mem[in...(in+insize)) | | ||
| insize, out, outsize) | | | providing g gas and v wei and output area | | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,6 +114,9 @@ GasMeter::GasConsumption GasMeter::estimateMax(AssemblyItem const& _item, bool _ | |
case Instruction::EXTCODESIZE: | ||
gas = GasCosts::extCodeGas(m_evmVersion); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this really charged the same? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Most likely. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah I'm sorry, - it seems to be the same as |
||
break; | ||
case Instruction::EXTCODEHASH: | ||
gas = GasCosts::balanceGas(m_evmVersion); | ||
break; | ||
case Instruction::EXTCODECOPY: | ||
gas = GasCosts::extCodeGas(m_evmVersion); | ||
gas += memoryGas(-1, -3); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could use
u256(n)
to clarify padding?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Started doing that but ran into a lot more to explain. Will prepare a separate PR.