-
Notifications
You must be signed in to change notification settings - Fork 138
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: add support for overriding the initCode for an account #197
Conversation
b4c69c0
to
82dbef7
Compare
82dbef7
to
6a070e6
Compare
q1: what was the context around needing this feature? This feature is for deployed accounts only or could be also used for non-deployed accounts? q2: should we add some validations on when these optional parameters should be passed in so that devs can catch when incorrect set of parameters are passed in? (runtime validation using zod) cc: @avasisht23 |
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.
few qs before the stamp
Q1: context around this is to support the case where a developer wants to snapshot the initCode that generated a given counterfactual. This is useful to protect against the case where the counterfactual might change before a user eventually sends a UO and deploys their account. with this, a dev can make sure that when a UO is finally sent, they deploy the account the user has been using the counterfactual of, even if the default factory address or account impl changes down the line Q2: I've added validations to Zod around passing this in already here. However, beyond that we can't do much else to enforce that a dev SHOULD pass them. it's opt-in if they want to override these params |
186acee
to
6a070e6
Compare
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
Pull Request Checklist
yarn test
)site
folder, see guidleines below)feat!: breaking change
)yarn lint:check
) and fix any issues? (yarn lint:fix
)development
and notmain
?PR-Codex overview
Detailed summary
createBaseSmartAccountParamsSchema
function inpackages/core/src/account/schema.ts
.SimpleSmartContractAccount
constructor inpackages/core/src/account/__tests__/simple.test.ts
to use the account init code override.accountInitCode
property to theBaseSmartContractAccount
class inpackages/core/src/account/base.ts
to store the account init code.getAccountInitCode
method in theBaseSmartContractAccount
class to return the account init code override if available, otherwise call the abstractgetAccountInitCode
method._getAccountInitCode
andcreate6492Signature
methods to theBaseSmartContractAccount
class to handle the account init code and signature creation logic.