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: steps towards atomic swap and campaign #57

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

petrovska-petro
Copy link
Collaborator

currently there is a hop that will happen in univ3 given a revert locally, which ill like to confirm that others are able to replicate as well locally

run:

brownie run scripts/merkl_incentive_campaign swap_badger_for_campaign_target

simulation of each self.quoter.quoteExactInput.call in isolation:

@gosuto-inzasheru
Copy link
Collaborator

i think i have it working:

# univ3 swap
safe.uni_v3.swap([weth, badger], weth_equivalent_mantissa)
Events In This Transaction
--------------------------
├── Wrapped Ether (0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2)
│   └── Approval
│       ├── owner: 0xB76782B51BFf9C27bA69C77027e20Abd92Bcf3a8
│       ├── spender: 0xE592427A0AEce92De3Edee1F18E0157C05861564
│       └── value: 820480645437611648
│   
├── Badger (0x3472A5A71965499acd81997a54BBA8D852C6E53d)
│   └── Transfer
│       ├── _from: 0x74092c7c0024feeb3839bED5ab6189eeD86ae856
│       ├── _to: 0xB76782B51BFf9C27bA69C77027e20Abd92Bcf3a8
│       └── _amount: 630464077571942589212
│   
├── Wrapped Ether (0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2)
│   └── Transfer
│       ├── from: 0xB76782B51BFf9C27bA69C77027e20Abd92Bcf3a8
│       ├── to: 0x74092c7c0024feeb3839bED5ab6189eeD86ae856
│       └── value: 820480645437611648
│   
├── 0x74092c7c0024feeb3839bED5ab6189eeD86ae856
│   └── Swap
│       ├── sender: 0xE592427A0AEce92De3Edee1F18E0157C05861564
│       ├── recipient: 0xB76782B51BFf9C27bA69C77027e20Abd92Bcf3a8
│       ├── amount0: -630464077571942589212
│       ├── amount1: 820480645437611648
│       ├── sqrtPriceX96: 2848617092885455447719638952
│       ├── liquidity: 6704905905380502881145
│       └── tick: -66514
│   
└── Gnosis Safe (0xB76782B51BFf9C27bA69C77027e20Abd92Bcf3a8)
    └── ExecutionSuccess
        ├── txHash: 0x971f964b2d4089fa6920a724fcf260a4dc689e3021c71de1321853c19022821b
        └── payment: 0

@petrovska-petro and or @sajanrajdev can you confirm you cannot reproduce this? because then your error is probably related to old packages (i got this result on ganache@7, eth-brownie@1.20.5 and brownie-safe@0.9.0)

@gosuto-inzasheru gosuto-inzasheru linked an issue Jun 11, 2024 that may be closed by this pull request
@petrovska-petro
Copy link
Collaborator Author

petrovska-petro commented Jun 11, 2024

@gosuto-inzasheru can you push into another branch or here your pyproject.toml file so we can replicate locally easily?

in the case that bumping all those packages does not encounter the revert and neither breaks other stuff on this repo, i will be on favour on updating the whole packaging deps then

@gosuto-inzasheru
Copy link
Collaborator

sure. there are still some issues though; it seems gas price cannot be set to 0 onfork

have a try at this script but then in the following branch: #60

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.

Atomic purchase of badger and campaign creation
2 participants