Skip to content

Commit

Permalink
fix(core): Fix etherscan verification utility
Browse files Browse the repository at this point in the history
  • Loading branch information
RPate97 committed Nov 2, 2023
1 parent adf54c0 commit 22581a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/hip-buttons-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sphinx-labs/core': patch
---

Fix etherscan verification utility
6 changes: 3 additions & 3 deletions packages/core/src/etherscan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { SphinxJsonRpcProvider } from './provider'
import { getMinimumCompilerInput } from './languages/solidity/compiler'
import { getSphinxConstants } from './contract-info'
import { CompilerOutputMetadata } from './languages'
import { remove0x } from './utils'

export interface EtherscanResponseBody {
status: string
Expand Down Expand Up @@ -98,9 +99,8 @@ export const verifySphinxConfig = async (
// determine where the contract's creation code ends and the constructor arguments begin. This
// method works even if the `artifact.bytecode` contains externally linked library placeholders
// or immutable variable placeholders, which are always the same length as the real values.
const encodedConstructorArgs = ethers.dataSlice(
initCodeWithArgs,
ethers.dataLength(bytecode)
const encodedConstructorArgs = remove0x(
ethers.dataSlice(initCodeWithArgs, ethers.dataLength(bytecode))
)

const sphinxInput = compilerConfig.inputs.find((compilerInput) =>
Expand Down

0 comments on commit 22581a1

Please sign in to comment.