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

Contracts read functions calls exception. #44

Open
Mohzcrea8me opened this issue May 16, 2024 · 0 comments
Open

Contracts read functions calls exception. #44

Mohzcrea8me opened this issue May 16, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Mohzcrea8me
Copy link
Collaborator

Mohzcrea8me commented May 16, 2024

Verified Sdk is a tool that handles all verified contract interactions and basic web3 related methods. checkout https://github.com/verified-network/verified-sdk/blob/master/README.md to learn more

Task: Differentiate all verified contracts read functions from write functions in such a way that only write functions will be called as gasless and normal transactions while read functions will be called only as normal transactions.

Called as gasless above means using Biconomy SmartAccount UserOp to call transactions. Users don't pay gas fee
Called as normal transactions means using Ethers.js to call transactions. Users pay gas fee

The default callContract method used by Verified Sdk to make all smart contracts calls for both read and write functions works in a way that it will try calling the transaction as gasless and call as normal transaction if gasless transaction failed. Meaning it will send transaction as userOp using Biconomy SmartAccount first and then send transaction as normal transaction using ethers.js if gasless failed.

This works fine but calling read functions as gasless is not needed since read only transactions cost no gas fee, and biconomy work userOp transaction involved series of inter contracts calls to successfully call a transaction as gasless all these are not needed for read functions.

Hints on task

  1. All edits/updates will be done in typescript under the src directory
  2. src/contract/index.ts contains all contract related methods and src/contract contains verified contracts with their names as directories. For example: src/contract/client directory contains client contracts and it methods.
  3. Read functions start with 'get' most times so all functions in the list of functions in a contract that starts with 'get' is a read function.
  4. All updates/edits can be done under src/contract alone without changing any other directories apart from test.
  5. All updates/edits must support "Backward compatibility" meaning the contracts, classes and methods names must not change and the parameters/ arguments they take must remain the same so the methods must work when called using previous logic and using the updated logic
  6. New dependency can not be added since ethers and gasless call has been handled and tested already with the sdk. dependencies versions will remain the same too

How to submit
A new branch and a PR compared to the master branch must be created with no conflict and @kallolborah must be assigned as reviewer.

@Mohzcrea8me Mohzcrea8me added the enhancement New feature or request label May 16, 2024
@Mohzcrea8me Mohzcrea8me assigned vshall20 and unassigned vshall20 May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants