-
Notifications
You must be signed in to change notification settings - Fork 3
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
allow safe signature #135
allow safe signature #135
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was amazing to see this working this morning. Good stuff @technophile-04 !!
It's looking great!! I'll do some more testing tomorrow.
Question: would it be possible to avoid the isSafeContext
RPC call to get the bytecode? Wondering if we could detect it some other way:
- Are the signatures equal in length? (Probably they are for EOA vs 1/n Safe).
- Are we getting something else back or it's safe injecting something in the page? (maybe it won't work if we wallet connect into the app, without the frame)
Like I said, no need to change it... just wondering :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow! Really nice job tackling it @technophile-04!!. Seems like a tough issue.
The creation>approve/reject flow is working great to me with my Sepolia safe wallet, but then I tried to do the same flow with a regular wallet, and it's throwing "Error reviewing grant".
It seems like it's not checking correctly if the address is a contract to execute the new safe logic. The log I'm getting:
Error: SafeProxy contract is not deployed on the current network
at getSafeContract (webpack-internal:///(rsc)/./node_modules/@safe-global/pr
otocol-kit/dist/src/contracts/safeDeploymentContracts.js:15:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5
)
at async ContractManager._ContractManager_initializeContractManager (webpack
-internal:///(rsc)/./node_modules/@safe-global/protocol-kit/dist/src/managers/co
ntractManager.js:61:45)
at async ContractManager.init (webpack-internal:///(rsc)/./node_modules/@saf
e-global/protocol-kit/dist/src/managers/contractManager.js:31:9)
at async Safe.Safe_initializeProtocolKit (webpack-internal:///(rsc)/./node
modules/@safe-global/protocol-kit/dist/src/Safe.js:1166:61)
at async Safe.init (webpack-internal:///(rsc)/./node_modules/@safe-global/pr
otocol-kit/dist/src/Safe.js:118:9)
at async validateSafeSignature (webpack-internal:///(rsc)/./utils/safe-signa
ture.ts:63:25)
at async POST (webpack-internal:///(rsc)/./app/api/grants/[grantId]/review/r
oute.tsx:52:32)
at async C:\GitHub\grants\packages\nextjs\node_modules\next\dist\compiled\ne
xt-server\app-route.runtime.dev.js:6:63251
So yeah their length seems same and we are not able to distinguish
The thing it could be connected via walletconnect breaks all the approaches. I tried getting current connected connector from wagmi's Also while digging found this https://ethereum.stackexchange.com/a/141258 where one of the Safe developer answered and he too seems to tell to check if connected address is contract or not
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking it up @technophile-04 !! Detecting the contract is good enough for now (the proxy thing is not needed in our use case for now)
Testing everything and it's working great!
Description
Updated all the routes where we were doing admin check:
Demo signing with admin :
Screen.Recording.2024-08-13.at.11.10.15.PM.mov
Demo with contract interaction( there was this transaction notification that transaction hash not found in background but everything seems to work, maybe some problem in sepolia etherscan because my trasactions was also taking time)
Untitled.1.mp4