Skip to content

Commit

Permalink
Merge pull request #46 from tokenbound/bj/ensure-init-when-TBClient-i…
Browse files Browse the repository at this point in the history
…nstantiated-with-default-implementation

Ensure init in createAccount when TBClient is instantiated with default V3 implementationAddress
  • Loading branch information
bjfresh authored Oct 26, 2023
2 parents a0221ec + a59ab62 commit 7f209e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/on-create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: cd packages/sdk

- name: Install dependencies
run: cd packages/sdk && npm install
run: npm install

- name: Clean install and build 🔧
run: cd packages/sdk && npm ci && npm run build
Expand Down
5 changes: 4 additions & 1 deletion packages/sdk/src/TokenboundClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ class TokenboundClient {
const implementation =
this.implementationAddress ?? ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS
const registry = this.registryAddress ?? ERC_6551_DEFAULT.REGISTRY.ADDRESS
const isCustomImplementation =
this.implementationAddress &&
!isAddressEqual(this.implementationAddress, ERC_6551_DEFAULT.ACCOUNT_PROXY!.ADDRESS)

try {
let txHash: `0x${string}` | undefined
Expand Down Expand Up @@ -248,7 +251,7 @@ class TokenboundClient {
data: `0x${string}`
}

if (this.implementationAddress) {
if (isCustomImplementation) {
// Don't initalize for custom implementations. Allow third-party handling of initialization.
prepareCreateV3Account = prepareCreateAccount
} else {
Expand Down

0 comments on commit 7f209e6

Please sign in to comment.