Engineering @ privy
42 Followers
You can get the current delegation status by making an eth_getCode request! Using viem: ``` const bytecode = await publicClient.getCode({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', }) ``` Where address is the address of the EOA! It will return `0x0` if the address hasn’t been delegated.
You can use our `createViemAccount` function and call `signAuthorization` from the wallet client! Docs on viem for server wallets here: https://docs.privy.io/wallets/using-wallets/ethereum/web3-integrations#viem-2
Hmm can you try this out? I believe it should print the current authorized contract address. const code = await publicClient.getCode({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', // Your EOA address }) if (!code || code.length === 0) console.log("Address has not been activated with 7702.") else console.log("current account implementation address is:" code.split('0xef0100')[1]) Here’s an example of the Zerodev SDK running this check to see whether or not it should run the authorization step! https://github.com/zerodevapp/sdk/blob/0ef509b177b9691afd021db87572420d6ffe18d7/plugins/ecdsa/account/create7702KernelAccount.ts#L243
@privy has some awesome things cooking - our new fully integrated gas sponsorship capability is powered by 7702 :)