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

IntegerOutOfRangeError when contract interaction #1109

Closed
nufailTanjiro opened this issue Jan 23, 2025 · 2 comments
Closed

IntegerOutOfRangeError when contract interaction #1109

nufailTanjiro opened this issue Jan 23, 2025 · 2 comments

Comments

@nufailTanjiro
Copy link

Description

Executing encoded data to a contract using safe4337Pack createTransaction

Environment

  • Safe Core SDK versions:
    • relay-kit: ^3.4.0
  • Safe contract version:
  • Environment:
    • non-browser

Steps to reproduce

This is my transaction object:

const transaction: MetaTransactionData = {
      to: cleanIdAddress,
      data: CleanIdContract.interface.encodeFunctionData(
        "applyForVerification",
        [cleanId, orgId, metadata]
      ),
      value: BigInt(0).toString(),
    };

 const transactions = [transaction];
const safeOperation = await safe4337Pack.createTransaction({
      transactions,
    });

Image

Expected result

Execute the contract function sent in the data field

Additional

This is my encoded transaction data:
Transaction data: 0x16c91fb000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000408a2323aee5f105d0597b0c29480e489a0b743c226144f05210c42d7c9db997442b75046000000000000000000000000000000000000000000000000000000000000000d3039303331343436323535303700000000000000000000000000000000000000

But I am getting an error that has no related with the encoded data:

error: Error {"error":"Number \"0x307862353764613337393362316666666536396466616334333761353934323961366430643930396535303934656537633537323166366133626339663235356534\" is not in safe 256-bit unsigned integer range (0 to 115792089237316195423570985008687907853269984665640564039457584007913129639935)\n\nVersion: [email protected]","method":"POST","path":"/api/employee/create-employee","service":"cleanId-api","stack":"IntegerOutOfRangeError: Number \"0x307862353764613337393362316666666536396466616334333761353934323961366430643930396535303934656537633537323166366133626339663235356534\" is not in safe 256-bit unsigned integer range (0 to 115792089237316195423570985008687907853269984665640564039457584007913129639935)\
@dasanra
Copy link
Collaborator

dasanra commented Jan 23, 2025

As I understand from the info you shared, you are trying to interact using 4337 with a Safe that is not deployed yet?

If you set the configuration for a Safe that is not deployed yet, this feels like the saltNonce value you selected for it is too high so it's out of an uint256 range, which is the expected data type for the saltNonce. Please try to set a lower saltNonce

@nufailTanjiro
Copy link
Author

Yea, Fixed it.
Thanks

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

No branches or pull requests

2 participants