safe-global / safe-apps-sdk

Client-side SDKs to create third-party Safe Apps
https://safe.global
MIT License
239 stars 114 forks source link

Cannot execute SignMessageLib.signMessage assembled from tx builder #556

Open chiefbiiko opened 4 months ago

chiefbiiko commented 4 months ago

Bug description

Environment

Steps to reproduce

  1. Go to the tx builder and assemble a tx with:
    • address 0xd53cd0aB83D845Ac265BE939c57F53AD838012c9
    • function signMessage
    • message 0x68616c6c6f63
  2. Confirm the tx with $threshold signers
  3. Try execute the tx (will fail)

Expected result

Executing a SignMessageLib.signMessage tx built from the tx builder ui should work.

For SignMessageLib.signMessage the tx builder should always use operation delegatecall instead of call. The latter will always fail as the library function is referring to Safe contract storage that is only available when executing the tx via delegatecall.

Obtained result

The tx builder wrongfully sets operation call for SignMessageLib.signMessage invocations and there is no ui input to manually change it to delegatecall.

Screenshots

Shows operation call wrongfully set for SignMessageLib.signMessage:

safestucksignmsgviaui

Moved from https://github.com/safe-global/safe-wallet-web/issues/3406