Skip to content

Commit

Permalink
Merge branch 'dcmt/sonic-amms'
Browse files Browse the repository at this point in the history
  • Loading branch information
duncancmt committed Dec 19, 2024
2 parents ae5e5f9 + f63ad92 commit e39296a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Master list of UniV3 forks:
25. Panko
26. Swapr (Algebra-like)
27. SpookySwap
28. Wagmi

---

Expand Down Expand Up @@ -56,6 +57,8 @@ Master list of UniV3 forks:
* Add `DODOV1` action to Polygon
* Add `DODOV1` action to Scroll
* Add `rebateClaimer()(address)` function on Mainnet Settlers for gas rebate program
* Add SolidlyV3 UniV3 fork to Sonic
* Add Wagmi UniV3 fork to Sonic

## 2024-12-18

Expand Down
15 changes: 15 additions & 0 deletions src/chains/Sonic/Common.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ import {
uniswapV3ForkId,
IUniswapV3Callback
} from "../../core/univ3forks/UniswapV3.sol";
import {
solidlyV3SonicFactory,
solidlyV3InitHash,
solidlyV3ForkId,
ISolidlyV3Callback
} from "../../core/univ3forks/SolidlyV3.sol";
import {spookySwapFactory, spookySwapForkId} from "../../core/univ3forks/SpookySwap.sol";
import {wagmiFactory, wagmiInitHash, wagmiForkId} from "../../core/univ3forks/Wagmi.sol";

// Solidity inheritance is stupid
import {SettlerAbstract} from "../../SettlerAbstract.sol";
Expand Down Expand Up @@ -51,10 +58,18 @@ abstract contract SonicMixin is FreeMemory, SettlerBase {
factory = uniswapV3SonicFactory;
initHash = uniswapV3InitHash;
callbackSelector = uint32(IUniswapV3Callback.uniswapV3SwapCallback.selector);
} else if (forkId == solidlyV3ForkId) {
factory = solidlyV3SonicFactory;
initHash = solidlyV3InitHash;
callbackSelector = uint32(ISolidlyV3Callback.solidlyV3SwapCallback.selector);
} else if (forkId == spookySwapForkId) {
factory = spookySwapFactory;
initHash = uniswapV3InitHash;
callbackSelector = uint32(IUniswapV3Callback.uniswapV3SwapCallback.selector);
} else if (forkId == wagmiForkId) {
factory = wagmiFactory;
initHash = wagmiInitHash;
callbackSelector = uint32(IUniswapV3Callback.uniswapV3SwapCallback.selector);
} else {
revert UnknownForkId(forkId);
}
Expand Down
1 change: 1 addition & 0 deletions src/core/univ3forks/SolidlyV3.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pragma solidity ^0.8.25;

address constant solidlyV3Factory = 0x70Fe4a44EA505cFa3A57b95cF2862D4fd5F0f687;
address constant solidlyV3SonicFactory = 0x777fAca731b17E8847eBF175c94DbE9d81A8f630;
bytes32 constant solidlyV3InitHash = 0xe9b68c5f77858eecac2e651646e208175e9b1359d68d0e14fc69f8c54e5010bf;
uint8 constant solidlyV3ForkId = 3;

Expand Down
6 changes: 6 additions & 0 deletions src/core/univ3forks/Wagmi.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;

address constant wagmiFactory = 0x56CFC796bC88C9c7e1b38C2b0aF9B7120B079aef;
bytes32 constant wagmiInitHash = 0x30146866f3a846fe3c636beb2756dbd24cf321bc52c9113c837c21f47470dfeb;
uint8 constant wagmiForkId = 28;

0 comments on commit e39296a

Please sign in to comment.