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

fix: governor mod token validation #242

Merged
merged 2 commits into from
Aug 1, 2024
Merged

Conversation

juliopavila
Copy link
Collaborator

Bug Report

https://discord.com/channels/881881751369175040/1032974561735606322/1268312094386950286

Implementation

In the packages/app/src/views/AddModule/wizards/OzGovernor/service/tokenValidation.ts file, the following changes were made to fix the bug:

  1. Replaced tokenContract.delegates(RANDOM_VALID_ADDRESS) with tokenContract.delegates.staticCall(RANDOM_VALID_ADDRESS).
  2. Removed the lines:
    // @ts-ignore
    tokenContract.functions['delegateBySig'].name
  3. Added the line:
    tokenContract.delegateBySig.name

These changes ensure the application correctly identifies and calls the delegateBySig function on the contract, addressing the issues caused by the proxy contract used by the Arbitrum Foundation.

Additional Context

The error reported was:

Error: missing revert data (action="call", data=null, reason=null, transaction={ "data": "0x9ab24eb0000000000000000000000000d028d504316fec029cfa36bdc3a8f053f6e5a6e4", "to": "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8" }, invocation=null, revert=null, code=CALL_EXCEPTION, version=6.13.1)
    at makeError (errors.ts:694:21)
    at getBuiltinCallException (abi-coder.ts:118:12)
    at _AbiCoder.getBuiltinCallException (abi-coder.ts:235:16)
    at BrowserProvider.getRpcError (provider-jsonrpc.ts:989:32)
    at BrowserProvider.getRpcError (provider-browser.ts:122:22)
    at provider-jsonrpc.ts:563:45

This error occurred while testing with the Arbitrum Foundation's address 0x912CE59144191C1204E64559FE8253a0e49E6548. The application was not seeing the delegateBySig() function on the contract, likely due to the proxy contract being used.


Commit Changes

This change ensures that the function calls are correctly handled and improves compatibility with contracts deployed on all networks, specifically addressing the issues with proxy contracts.

@juliopavila juliopavila added the bug Something isn't working label Aug 1, 2024
Copy link

vercel bot commented Aug 1, 2024

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

Name Status Preview Comments Updated (UTC)
zodiac-safe-app-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 1, 2024 8:05pm

auryn-macmillan
auryn-macmillan previously approved these changes Aug 1, 2024
Copy link
Member

@auryn-macmillan auryn-macmillan left a comment

Choose a reason for hiding this comment

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

lgtm. Thanks @juliopavila!

@auryn-macmillan
Copy link
Member

@juliopavila, would you mind also bumping the package version so we can publish a new release immediately?

Copy link
Member

@auryn-macmillan auryn-macmillan left a comment

Choose a reason for hiding this comment

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

lgtm

@juliopavila juliopavila merged commit b4ff63e into master Aug 1, 2024
2 checks passed
@juliopavila juliopavila deleted the governor_token_validation branch August 1, 2024 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants