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

Fix issue 505 by updating abiMapping with result from constructor #562

Closed
wants to merge 1 commit into from

Conversation

erivas
Copy link
Contributor

@erivas erivas commented Nov 22, 2020

Note: adding a test for this would need Solidity 0.6.x (see #383)

@ggrieco-tob
Copy link
Member

Is this patch complete? It seems it will be necessary to correct the bytecode in case we load raw transactions here:

echidna/lib/Echidna/RPC.hs

Lines 96 to 111 in 673aece

-- | Takes a list of Etheno transactions and loads them into the VM, returning the
-- | address containing echidna tests
execEthenoTxs :: (MonadState x m, Has VM x, MonadThrow m, Has TxConf y, MonadReader y m, M.MonadFail m)
=> [T.Text] -> Maybe Addr -> Etheno -> m (Maybe Addr)
execEthenoTxs ts addr et = do
setupEthenoTx et
res <- liftSH exec
g <- view (hasLens . propGas)
case (res, et) of
(Reversion, _) -> throwM $ EthenoException "Encountered reversion while setting up Etheno transactions"
(VMFailure x, _) -> vmExcept x >> M.fail "impossible"
(VMSuccess (ConcreteBuffer bc),
ContractCreated _ ca _ _ _ _) -> do
hasLens . env . contracts . at ca . _Just . contractcode .= InitCode ""
liftSH (replaceCodeOfSelf (RuntimeCode bc) >> loadContract ca)
og <- get

@ggrieco-tob
Copy link
Member

Superseeded by #593 (but thanks for the PR, this was an interesting idea to consider)

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.

2 participants