Skip to content

Commit db2fe4b

Browse files
authored
expose metadata stripping to hevm-cli (#357)
1 parent 8cf6894 commit db2fe4b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/hevm/hevm-cli/hevm-cli.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ data Command w
155155
| MerkleTest -- Insert a set of key values and check against the given root
156156
{ file :: w ::: String <?> "Path to .json test file"
157157
}
158+
| StripMetadata -- Remove metadata from contract bytecode
159+
{ code :: w ::: ByteString <?> "Program bytecode"
160+
}
158161

159162
deriving (Options.Generic)
160163

@@ -256,6 +259,8 @@ main = do
256259
Nothing -> error("Malformed RLP string")
257260
Just c -> putStrLn $ show c
258261
MerkleTest {} -> merkleTest cmd
262+
StripMetadata {} -> print .
263+
ByteStringS . stripBytecodeMetadata . hexByteString "bytecode" . strip0x $ code cmd
259264

260265
launchScript :: String -> Command Options.Unwrapped -> IO ()
261266
launchScript script cmd = do

0 commit comments

Comments
 (0)