Skip to content
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

feat: issuePermissions flow with safe7579 user operation builder #578

Merged
merged 8 commits into from
Jun 17, 2024

Conversation

KannuSingh
Copy link
Collaborator

No description provided.

Copy link

vercel bot commented May 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
decentralized-relay-wallet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 17, 2024 4:23pm
react-wallet-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 17, 2024 4:23pm
10 Ignored Deployments
Name Status Preview Comments Updated (UTC)
decentralized-relay-app ⬜️ Ignored (Inspect) Visit Preview Jun 17, 2024 4:23pm
malicious-dapp-verify-simulation ⬜️ Ignored (Inspect) Visit Preview Jun 17, 2024 4:23pm
react-auth-dapp ⬜️ Ignored (Inspect) Visit Preview Jun 17, 2024 4:23pm
react-auth-wallet ⬜️ Ignored (Inspect) Visit Preview Jun 17, 2024 4:23pm
react-dapp-v2 ⬜️ Ignored (Inspect) Visit Preview Jun 17, 2024 4:23pm
react-dapp-v2-cosmos-provider ⬜️ Ignored (Inspect) Visit Preview Jun 17, 2024 4:23pm
react-dapp-v2-with-ethers ⬜️ Ignored (Inspect) Visit Preview Jun 17, 2024 4:23pm
react-dapp-v2-with-web3js ⬜️ Ignored (Inspect) Visit Preview Jun 17, 2024 4:23pm
svelte-web3modal ⬜️ Ignored (Inspect) Visit Preview Jun 17, 2024 4:23pm
vue-dapp-auth ⬜️ Ignored (Inspect) Visit Preview Jun 17, 2024 4:23pm

Comment on lines 166 to 197
console.log(`isAccountDeployed = false`)
console.log(`Deploying and setting up Safe7579 account...`)
const setUpAndExecuteUserOpHash = await this.setupSafe7579AndExecute(
initialCallsAtSafeSetupPhase
)
await this.bundlerClient.waitForUserOperationReceipt({
hash: setUpAndExecuteUserOpHash
})
console.log(`Deployment completed.`)
}
console.log(`isAccountDeployed = true`)
console.log(`checking isPermissionValidator Module installed...`)
// check whether PermissionValidator module is install or not
const isPermissionValidatorModuleInstalled = await this.publicClient.readContract({
address: this.client.account.address,
abi: isModuleInstalledAbi,
functionName: 'isModuleInstalled',
args: [
BigInt(1), // ModuleType
PERMISSION_VALIDATOR_ADDRESS, // Module Address
'0x' // Additional Context
]
})
// if not then install Permissionvalidator module on Safe7579 Account.
if (!isPermissionValidatorModuleInstalled) {
console.log(`isPermissionValidatorModuleInstalled == false`)
console.log(`Should not have happen, need to debug initCode to check safe setUp process`)
throw new Error(
'isPermissionValidatorModuleInstalled == false \n Should not have happen, need to debug initCode to check safe setUp process'
)
// TODO: install the module , but for safe7579 PERMISSION_VALIDATOR module is
// part of initial validator module, so on safe setup phase it get installed.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we extract to its own private method?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with the permissions code below

@KannuSingh KannuSingh merged commit e94986f into main Jun 17, 2024
19 checks passed
@KannuSingh KannuSingh deleted the permissions-flow-with-safe7579UserOperationBuilder branch June 17, 2024 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants