Skip to content

update GetSenderAddressHelper contract to return in abi encoded format #384

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

Merged
merged 1 commit into from
Mar 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fine-goats-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"permissionless": patch
---

Updated GetSenderAddressHelper.sol to return abi encoded address (fixes edgecase when sender starts with 0xef...)
10 changes: 5 additions & 5 deletions packages/permissionless/actions/public/getSenderAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ import {
type OneOf,
type Prettify,
concat,
encodeDeployData,
getAddress
decodeAbiParameters,
encodeDeployData
} from "viem"

import { call } from "viem/actions"
import { getAction } from "viem/utils"

// https://github.com/pimlicolabs/entrypoint-estimations/blob/main/src/GetSenderAddressHelper.sol
// https://github.com/pimlicolabs/contracts/blob/80277d0de609e6b5fb4cedeeb1fb9a023caed59f/src/GetSenderAddressHelper.sol
const GetSenderAddressHelperByteCode =
"0x6080604052604051610302380380610302833981016040819052610022916101de565b600080836001600160a01b0316639b249f6960e01b8460405160240161004891906102b2565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905161008691906102e5565b6000604051808303816000865af19150503d80600081146100c3576040519150601f19603f3d011682016040523d82523d6000602084013e6100c8565b606091505b5091509150600082610148576004825111156100ef5760248201519050806000526014600cf35b60405162461bcd60e51b8152602060048201526024808201527f67657453656e64657241646472657373206661696c656420776974686f7574206044820152636461746160e01b60648201526084015b60405180910390fd5b60405162461bcd60e51b815260206004820152602b60248201527f67657453656e6465724164647265737320646964206e6f74207265766572742060448201526a185cc8195e1c1958dd195960aa1b606482015260840161013f565b634e487b7160e01b600052604160045260246000fd5b60005b838110156101d55781810151838201526020016101bd565b50506000910152565b600080604083850312156101f157600080fd5b82516001600160a01b038116811461020857600080fd5b60208401519092506001600160401b0381111561022457600080fd5b8301601f8101851361023557600080fd5b80516001600160401b0381111561024e5761024e6101a4565b604051601f8201601f19908116603f011681016001600160401b038111828210171561027c5761027c6101a4565b60405281815282820160200187101561029457600080fd5b6102a58260208301602086016101ba565b8093505050509250929050565b60208152600082518060208401526102d18160408501602087016101ba565b601f01601f19169190910160400192915050565b600082516102f78184602087016101ba565b919091019291505056fe"
"0x60806040526102a28038038091610015826100ae565b6080396040816080019112610093576080516001600160a01b03811681036100935760a0516001600160401b0381116100935782609f82011215610093578060800151610061816100fc565b9361006f60405195866100d9565b81855260a082840101116100935761008e9160a0602086019101610117565b610196565b600080fd5b634e487b7160e01b600052604160045260246000fd5b6080601f91909101601f19168101906001600160401b038211908210176100d457604052565b610098565b601f909101601f19168101906001600160401b038211908210176100d457604052565b6001600160401b0381116100d457601f01601f191660200190565b60005b83811061012a5750506000910152565b818101518382015260200161011a565b6040916020825261015a8151809281602086015260208686019101610117565b601f01601f1916010190565b3d15610191573d90610177826100fc565b9161018560405193846100d9565b82523d6000602084013e565b606090565b600091908291826040516101cd816101bf6020820195639b249f6960e01b87526024830161013a565b03601f1981018352826100d9565b51925af16101d9610166565b906102485760048151116000146101f7576024015160005260206000f35b60405162461bcd60e51b8152602060048201526024808201527f67657453656e64657241646472657373206661696c656420776974686f7574206044820152636461746160e01b6064820152608490fd5b60405162461bcd60e51b815260206004820152602b60248201527f67657453656e6465724164647265737320646964206e6f74207265766572742060448201526a185cc8195e1c1958dd195960aa1b6064820152608490fdfe"

const GetSenderAddressHelperAbi = [
{
Expand Down Expand Up @@ -125,5 +125,5 @@ export const getSenderAddress = async (
throw new Error("Failed to get sender address")
}

return getAddress(data)
return decodeAbiParameters([{ type: "address" }], data)[0]
}
Loading