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

Favor nonce from Safe Multisig api #75

Merged
merged 2 commits into from
Feb 29, 2024
Merged

Conversation

fedgiac
Copy link
Contributor

@fedgiac fedgiac commented Feb 29, 2024

If there is a pending transaction in the Safe, the self-sell script overwrites it when creating the settle transaction.
With these changes, the created transaction will use the nonce that is recommended by the Safe API. This is the same nonce used by the interface to determine the nonce for the next transaction.

I also sneaked in a change in the parameters, since the script is not working unless --to-token is explicit.

Test Plan

This is difficult to test as the script only works on mainnet (see #74).
I suggest to see that the api call returns the expected nonce.
For example, 0xA03be496e67Ec29bC62F01a428683D7F9c204930 is a Safe that right now has a pending transaction, and you can see that the API output is the expected one:

curl -X 'GET' \
  'https://safe-client.safe.global/v1/chains/11155111/safes/0xA03be496e67Ec29bC62F01a428683D7F9c204930/nonces' \
  -H 'accept: application/json'
{"currentNonce":10,"recommendedNonce":11}

@fedgiac fedgiac force-pushed the safe-nonce-from-safe-api branch from 68d6ece to 01440b1 Compare February 29, 2024 11:53
@coveralls
Copy link

coveralls commented Feb 29, 2024

Pull Request Test Coverage Report for Build 8095554159

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 97.398%

Totals Coverage Status
Change from base Build 8048270935: 0.0%
Covered Lines: 364
Relevant Lines: 366

💛 - Coveralls

@fedgiac fedgiac requested a review from a team February 29, 2024 11:54
Copy link
Contributor

@fleupold fleupold left a comment

Choose a reason for hiding this comment

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

src/tasks/withdraw/safe.ts Outdated Show resolved Hide resolved
Co-authored-by: Felix Leupold <[email protected]>
@fedgiac fedgiac enabled auto-merge (squash) February 29, 2024 13:24
@fedgiac fedgiac merged commit fbb2bb9 into main Feb 29, 2024
5 checks passed
@fedgiac fedgiac deleted the safe-nonce-from-safe-api branch February 29, 2024 13:25
@github-actions github-actions bot locked and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants