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

feat(common,world): improvements for smart accounts #2578

Merged
merged 28 commits into from
Apr 2, 2024

Conversation

holic
Copy link
Member

@holic holic commented Apr 1, 2024

pulled out of #2458

Copy link

changeset-bot bot commented Apr 1, 2024

🦋 Changeset detected

Latest commit: 26410cf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 24 packages
Name Type
@latticexyz/common Patch
@latticexyz/world Patch
@latticexyz/block-logs-stream Patch
@latticexyz/cli Patch
@latticexyz/config Patch
@latticexyz/dev-tools Patch
@latticexyz/faucet Patch
@latticexyz/protocol-parser Patch
@latticexyz/query Patch
@latticexyz/store-indexer Patch
@latticexyz/store-sync Patch
@latticexyz/store Patch
@latticexyz/world-modules Patch
@latticexyz/react Patch
@latticexyz/abi-ts Patch
create-mud Patch
@latticexyz/gas-report Patch
@latticexyz/recs Patch
@latticexyz/schema-type Patch
@latticexyz/services Patch
solhint-config-mud Patch
solhint-plugin-mud Patch
@latticexyz/utils Patch
mock-game-contracts Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@@ -31,6 +32,7 @@ export async function writeContract<
>(
client: Client<Transport, chain, account>,
request: WriteContractParameters<abi, functionName, args, chain, account, chainOverride>,
publicClient?: PublicClient<Transport, chain>,
Copy link
Member Author

@holic holic Apr 1, 2024

Choose a reason for hiding this comment

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

this method is deprecated, so I didn't document this change in the changelog

I also don't love this pattern of adding an extra param, ideally should be an object here for easier extending, but again, this is deprecated so will leave it be

a future clean up should move this function inline into the transactionQueue decorator

Copy link
Member

@alvrs alvrs Apr 1, 2024

Choose a reason for hiding this comment

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

opened an issue for this so we can add it to the backlog: #2584

@@ -0,0 +1,9 @@
---
"@latticexyz/common": minor
Copy link
Member Author

Choose a reason for hiding this comment

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

so according to semver, this should be minor because its an extra feature, not a fix

but maybe we don't want to trigger a bump to 2.1 yet?

@holic holic changed the title Holic/action improvements feat(common,world): improvements for smart accounts Apr 1, 2024
@holic holic marked this pull request as ready for review April 1, 2024 11:29
@holic holic requested review from alvrs and yonadaa as code owners April 1, 2024 11:29
.changeset/smooth-ducks-sell.md Outdated Show resolved Hide resolved
@@ -0,0 +1,9 @@
---
"@latticexyz/common": patch
Copy link
Member Author

Choose a reason for hiding this comment

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

this should prob be minor but we're trying to batch a few minor version changes and don't want to block patch changes

writeArgs.address !== params.worldAddress ||
writeArgs.functionName === "call" ||
writeArgs.functionName === "callFrom" ||
writeArgs.functionName === "registerDelegationWithSignature"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this registerDelegationWithSignature condition necessary? The registerDelegationWithSignature function should be called by a delegator, not a delegatee. This callFrom extension action is intended for the use of the delegatee's wallet client (after delegation), and the delegator's wallet client does not need to use this.

Copy link
Member Author

@holic holic Apr 1, 2024

Choose a reason for hiding this comment

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

registerDelegationWithSignature is called by the delegatee, using a signed message by the delegator! This allows us to write to the world using only the delegatee/burner account.

Copy link
Contributor

Choose a reason for hiding this comment

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

Make sense! Thanks.

@holic holic merged commit d2e4d0f into main Apr 2, 2024
12 checks passed
@holic holic deleted the holic/action-improvements branch April 2, 2024 01:27
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

Successfully merging this pull request may close these issues.

5 participants