Skip to content

Conversation

@ScreamingHawk
Copy link
Contributor

@ScreamingHawk ScreamingHawk commented Dec 19, 2024

Requires: 0xsequence/wallet-contracts#191

Immutable ERC721/1155s have an OperatorAllowlist that prevent contracts owning tokens. For wallets to own tokens they must have an approved bytecode and implementation address returned by a PROXY_getImplementation() function.

This PR adds the PROXY_getImplementation() function to a wallet via the hooks module. This is added whenever the user interacts with an immutable chain. The hook is only added once.

@ScreamingHawk ScreamingHawk requested a review from a team as a code owner December 19, 2024 01:35
]),
gasLimit: 50000, // Expected ~28k gas. Buffer added
delegateCall: false,
revertOnError: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

revertOnError: false, is intentional. We don't want a failure adding the hook to prevent whatever the user's intended transaction is.

to: this.address,
data: hooksInterface.encodeFunctionData(hooksInterface.getFunction('addHook')!, [
'0x90611127',
'0x1f56dbAD5e8319F0DE9a323E24A31b5077dEB1a4'
Copy link
Member

Choose a reason for hiding this comment

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

Lets move this hardcoded address somewhere else, maybe context.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated. Now requires this change to wallet webapp to pass context: https://github.com/0xsequence/wallet-webapp/pull/807

@ScreamingHawk ScreamingHawk force-pushed the immutable-hook branch 2 times, most recently from 0190b94 to 5796b2a Compare January 10, 2025 09:43
@Agusx1211
Copy link
Member

LGTM Now

@ScreamingHawk ScreamingHawk requested a review from a team as a code owner January 10, 2025 14:19
@attente attente merged commit 3fc1d25 into master Jan 10, 2025
22 checks passed
@attente attente deleted the immutable-hook branch January 10, 2025 14: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.

4 participants