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

Enable contract mocks for CALL OP-codes in solEVM #23

Closed
johannbarbie opened this issue Nov 2, 2018 · 2 comments
Closed

Enable contract mocks for CALL OP-codes in solEVM #23

johannbarbie opened this issue Nov 2, 2018 · 2 comments
Assignees
Labels

Comments

@johannbarbie
Copy link
Member

When Leap transaction run on Plasma, a virtual state environment is created from the inputs of the transaction:

  • For each fungible input an ERC20 mock is created and a balance minted.
  • For each non-fungible input an ERC721 mock is created and a token minted.
  • A mock for the Plasma bridge is created and the last 100 periods with data are added.

During the execution of a spending condition the CALL and STATICCALL OP-codes are intercepted.

  • If the destination of the OP-codes is any other address than the described mocks, the transaction fails.
  • If the destination is one of the mocks, selected functions are executed.

To create a virtual state environment for Plasma transaction in the EVM enforcer, CALL and STATICCALL OP-codes need to be intercepted in a similar way.

  • for transfer() on a token contract a LOG event should be emitted.
  • for balanceOf() on a token contract the input's balance should be returned.
  • for getPeriod() on the bridge the call should be forwarded to the actual bridge contract.
@johannbarbie johannbarbie changed the title Enable Contract mocks for CALL OP-codes in solEVM Enable contract mocks for CALL OP-codes in solEVM Nov 2, 2018
@johannbarbie johannbarbie added this to the 🌃 2.0 Metaverse milestone Jan 11, 2019
@pinkiebell
Copy link
Contributor

Does these mocks going to exist as separate contracts or builtins of the EthereumRuntime?

@pinkiebell pinkiebell self-assigned this Jan 18, 2019
@johannbarbie johannbarbie removed this from the Song of Dawn milestone Jun 5, 2019
@pinkiebell
Copy link
Contributor

PlasmaVerifier is the skeleton. Closing this, we can issue a new bounty for more specific functionality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants