From 893509c8f2585635ec39a1f06435f0ece73cc5fa Mon Sep 17 00:00:00 2001 From: Xavier Romero Date: Tue, 10 Dec 2024 12:09:05 +0100 Subject: [PATCH] ToLower() --- doc/polycli_wrap-contract.md | 2 +- util/util.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/polycli_wrap-contract.md b/doc/polycli_wrap-contract.md index d7ae6be3..e67bae1e 100644 --- a/doc/polycli_wrap-contract.md +++ b/doc/polycli_wrap-contract.md @@ -19,7 +19,7 @@ polycli wrap-contract bytecode [flags] ## Usage -This command takes the bytecode that we want to be deployed for a new contract, and wraps its into the bytecode that we can use to create the contract. +This command takes the runtime bytecode, the bytecode deployed on-chain, as input and converts it into creation bytecode, the bytecode used to create the contract ```bash $ polycli wrap-contract 69602a60005260206000f3600052600a6016f3 diff --git a/util/util.go b/util/util.go index 9927871f..0c0fa159 100644 --- a/util/util.go +++ b/util/util.go @@ -319,8 +319,8 @@ func BlockUntilSuccessful(ctx context.Context, c *ethclient.Client, retryable fu } func WrapDeployedCode(deployedBytecode string, storageBytecode string) string { - deployedBytecode = strings.TrimPrefix(deployedBytecode, "0x") - storageBytecode = strings.TrimPrefix(storageBytecode, "0x") + deployedBytecode = strings.ToLower(strings.TrimPrefix(deployedBytecode, "0x")) + storageBytecode = strings.ToLower(strings.TrimPrefix(storageBytecode, "0x")) codeCopySize := len(deployedBytecode) / 2 codeCopyOffset := (len(storageBytecode)/2) + 13 + 8 // 13 for CODECOPY + 8 for RETURN