Skip to content
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

Implement EIP-2937 #7

Closed

Conversation

astarinmymind
Copy link

Implements Set Indestructible Opcode

technicallyty and others added 13 commits December 24, 2020 11:22
Added an indestructable property to a contract instance
-added new EVM error for when an indestructible contract tries to self destruct
-added if case in opsuicide to throw the error described above when an indestructible contract tries to opSuicide
-appeased some golint stuff
* added 2937 to valideip map
* added comments to exported functions to appease go linter
* updated bastanchury instructionset to inherit yolov2
* set opcode to 0xa8 per eip spec
-test for contract self destructing on itself with indestructible set
-test for contract self destructing via delegatecall with indestructible set
reverted change made that was unrelated to PR/EIP
@lightclient lightclient force-pushed the impl-eip-2718 branch 2 times, most recently from 2f696dc to 254a593 Compare January 8, 2021 20:20
@@ -270,7 +270,7 @@ func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas
// The depth-check is already done, and precompiles handled above
contract := NewContract(caller, AccountRef(addrCopy), value, gas)
contract.SetCallCode(&addrCopy, evm.StateDB.GetCodeHash(addrCopy), code)
ret, err = run(evm, contract, input, false)
ret, err = run(evm, contract, input, false, false)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this highlights the commens I made on FEM about the EIP: it's far too vaguely specified. In this case, it appears that executing this sequence:

  • A calls B.
  • B does set-indesructible as the first op.
  • B calls on C
  • C does selfdestruct, but is prevented, because the flag was stickified from B.

This implementation seems based on the static mode, which is meant to be 'sticky' -- following along any child scopes.
I don't interpret the EIP to have the same semantics, though

@holiman holiman force-pushed the impl-eip-2718 branch 4 times, most recently from 3c8c36c to 77fea7f Compare February 2, 2021 13:46
@holiman holiman force-pushed the impl-eip-2718 branch 2 times, most recently from 525ab04 to d1be5fa Compare February 14, 2021 13:26
lightclient pushed a commit that referenced this pull request Jun 16, 2021
…er (#7) (ethereum#22989)

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: Mikhail Kalinin <noblesse.knight@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants