@zoralabs/coins 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/.env +1 -0
  2. package/.turbo/turbo-build.log +114 -109
  3. package/.turbo/turbo-update-contract-version.log +22 -0
  4. package/CHANGELOG.md +34 -0
  5. package/abis/BadImpl.json +15 -0
  6. package/abis/BalanceDeltaLibrary.json +15 -0
  7. package/abis/BaseCoin.json +1442 -0
  8. package/abis/BaseCoinDeployHook.json +78 -0
  9. package/abis/BaseHook.json +897 -0
  10. package/abis/BaseTest.json +13 -91
  11. package/abis/BeforeSwapDeltaLibrary.json +15 -0
  12. package/abis/BuySupplyWithSwapRouterHook.json +126 -0
  13. package/abis/Coin.json +48 -92
  14. package/abis/CoinConstants.json +65 -0
  15. package/abis/CoinTest.json +27 -91
  16. package/abis/CoinV4.json +1664 -0
  17. package/abis/CurrencyLibrary.json +25 -0
  18. package/abis/DeployHooks.json +9 -0
  19. package/abis/DopplerUniswapV3Test.json +20 -91
  20. package/abis/FactoryTest.json +13 -91
  21. package/abis/FakeHookNoInterface.json +21 -0
  22. package/abis/HookDeployer.json +68 -0
  23. package/abis/Hooks.json +28 -0
  24. package/abis/HooksTest.json +651 -0
  25. package/abis/IAllowanceTransfer.json +486 -0
  26. package/abis/ICoin.json +25 -1
  27. package/abis/ICoinDeployHook.json +31 -0
  28. package/abis/IContractMetadata.json +28 -0
  29. package/abis/IEIP712.json +15 -0
  30. package/abis/IEIP712_v4.json +15 -0
  31. package/abis/IERC20Minimal.json +172 -0
  32. package/abis/IERC6909Claims.json +288 -0
  33. package/abis/IERC721Permit_v4.json +88 -0
  34. package/abis/IExtsload.json +64 -0
  35. package/abis/IExttload.json +40 -0
  36. package/abis/IHasAfterCoinDeploy.json +31 -0
  37. package/abis/IHasContractName.json +15 -0
  38. package/abis/IHookDeployer.json +42 -0
  39. package/abis/IHooks.json +789 -0
  40. package/abis/IImmutableState.json +15 -0
  41. package/abis/IMulticall_v4.json +21 -0
  42. package/abis/INotifier.json +187 -0
  43. package/abis/IPermit2.json +865 -0
  44. package/abis/IPermit2Forwarder.json +138 -0
  45. package/abis/IPoolInitializer_v4.json +53 -0
  46. package/abis/IPoolManager.json +1286 -0
  47. package/abis/IPositionManager.json +712 -0
  48. package/abis/IProtocolFees.json +174 -0
  49. package/abis/ISignatureTransfer.json +394 -0
  50. package/abis/ISubscriber.json +89 -0
  51. package/abis/ISwapRouter.json +82 -0
  52. package/abis/IUnorderedNonce.json +44 -0
  53. package/abis/IV4Router.json +47 -0
  54. package/abis/IZoraFactory.json +144 -0
  55. package/abis/IZoraV4CoinHook.json +83 -0
  56. package/abis/ImmutableState.json +36 -0
  57. package/abis/LPFeeLibrary.json +65 -0
  58. package/abis/MultiOwnableTest.json +13 -91
  59. package/abis/Simulate.json +0 -91
  60. package/abis/UniV3BuySell.json +12 -0
  61. package/abis/UniV3Errors.json +32 -0
  62. package/abis/UpgradeFactoryImpl.json +9 -0
  63. package/abis/UpgradesTest.json +604 -0
  64. package/abis/ZoraFactoryImpl.json +111 -0
  65. package/abis/ZoraV4CoinHook.json +989 -0
  66. package/addresses/8453.json +2 -1
  67. package/addresses/84532.json +4 -3
  68. package/dist/index.cjs +125 -62
  69. package/dist/index.cjs.map +1 -1
  70. package/dist/index.js +120 -56
  71. package/dist/index.js.map +1 -1
  72. package/dist/wagmiGenerated.d.ts +212 -464
  73. package/dist/wagmiGenerated.d.ts.map +1 -1
  74. package/package/wagmiGenerated.ts +122 -66
  75. package/package.json +4 -4
  76. package/script/CoinsDeployerBase.sol +32 -0
  77. package/script/DeployHooks.s.sol +22 -0
  78. package/script/Simulate.s.sol +3 -2
  79. package/script/UpgradeCoinImpl.sol +2 -2
  80. package/script/UpgradeFactoryImpl.s.sol +23 -0
  81. package/src/Coin.sol +35 -342
  82. package/src/ZoraFactoryImpl.sol +73 -45
  83. package/src/hooks/BaseCoinDeployHook.sol +62 -0
  84. package/src/hooks/BuySupplyWithSwapRouterHook.sol +78 -0
  85. package/src/interfaces/ICoin.sol +5 -1
  86. package/src/interfaces/ICoinDeployHook.sol +8 -0
  87. package/src/interfaces/ISwapRouter.sol +1 -35
  88. package/src/interfaces/IZoraFactory.sol +52 -0
  89. package/src/{utils → libs}/CoinConstants.sol +6 -6
  90. package/src/libs/CoinLegacy.sol +4 -4
  91. package/src/libs/CoinLegacyMarket.sol +182 -0
  92. package/src/libs/CoinSetupV3.sol +111 -0
  93. package/src/libs/UniV3BuySell.sol +449 -0
  94. package/src/libs/UniV3Errors.sol +11 -0
  95. package/src/version/ContractVersionBase.sol +1 -1
  96. package/test/Coin.t.sol +35 -17
  97. package/test/CoinDopplerUniV3.t.sol +14 -17
  98. package/test/Factory.t.sol +4 -3
  99. package/test/Hooks.t.sol +274 -0
  100. package/test/Upgrades.t.sol +67 -0
  101. package/test/utils/BaseTest.sol +18 -3
  102. package/wagmi.config.ts +6 -9
  103. package/src/libs/CoinSetup.sol +0 -37
  104. /package/abis/{CoinSetup.json → CoinSetupV3.json} +0 -0
@@ -0,0 +1,25 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "ADDRESS_ZERO",
5
+ "inputs": [],
6
+ "outputs": [
7
+ {
8
+ "name": "",
9
+ "type": "address",
10
+ "internalType": "Currency"
11
+ }
12
+ ],
13
+ "stateMutability": "view"
14
+ },
15
+ {
16
+ "type": "error",
17
+ "name": "ERC20TransferFailed",
18
+ "inputs": []
19
+ },
20
+ {
21
+ "type": "error",
22
+ "name": "NativeTransferFailed",
23
+ "inputs": []
24
+ }
25
+ ]
@@ -0,0 +1,9 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "run",
5
+ "inputs": [],
6
+ "outputs": [],
7
+ "stateMutability": "nonpayable"
8
+ }
9
+ ]
@@ -12,97 +12,6 @@
12
12
  ],
13
13
  "stateMutability": "view"
14
14
  },
15
- {
16
- "type": "function",
17
- "name": "MAX_TOTAL_SUPPLY",
18
- "inputs": [],
19
- "outputs": [
20
- {
21
- "name": "",
22
- "type": "uint256",
23
- "internalType": "uint256"
24
- }
25
- ],
26
- "stateMutability": "view"
27
- },
28
- {
29
- "type": "function",
30
- "name": "MIN_ORDER_SIZE",
31
- "inputs": [],
32
- "outputs": [
33
- {
34
- "name": "",
35
- "type": "uint256",
36
- "internalType": "uint256"
37
- }
38
- ],
39
- "stateMutability": "view"
40
- },
41
- {
42
- "type": "function",
43
- "name": "PLATFORM_REFERRER_FEE_BPS",
44
- "inputs": [],
45
- "outputs": [
46
- {
47
- "name": "",
48
- "type": "uint256",
49
- "internalType": "uint256"
50
- }
51
- ],
52
- "stateMutability": "view"
53
- },
54
- {
55
- "type": "function",
56
- "name": "PROTOCOL_FEE_BPS",
57
- "inputs": [],
58
- "outputs": [
59
- {
60
- "name": "",
61
- "type": "uint256",
62
- "internalType": "uint256"
63
- }
64
- ],
65
- "stateMutability": "view"
66
- },
67
- {
68
- "type": "function",
69
- "name": "TOKEN_CREATOR_FEE_BPS",
70
- "inputs": [],
71
- "outputs": [
72
- {
73
- "name": "",
74
- "type": "uint256",
75
- "internalType": "uint256"
76
- }
77
- ],
78
- "stateMutability": "view"
79
- },
80
- {
81
- "type": "function",
82
- "name": "TOTAL_FEE_BPS",
83
- "inputs": [],
84
- "outputs": [
85
- {
86
- "name": "",
87
- "type": "uint256",
88
- "internalType": "uint256"
89
- }
90
- ],
91
- "stateMutability": "view"
92
- },
93
- {
94
- "type": "function",
95
- "name": "TRADE_REFERRER_FEE_BPS",
96
- "inputs": [],
97
- "outputs": [
98
- {
99
- "name": "",
100
- "type": "uint256",
101
- "internalType": "uint256"
102
- }
103
- ],
104
- "stateMutability": "view"
105
- },
106
15
  {
107
16
  "type": "function",
108
17
  "name": "excludeArtifacts",
@@ -187,6 +96,19 @@
187
96
  "outputs": [],
188
97
  "stateMutability": "nonpayable"
189
98
  },
99
+ {
100
+ "type": "function",
101
+ "name": "setUpWithBlockNumber",
102
+ "inputs": [
103
+ {
104
+ "name": "forkBlockNumber",
105
+ "type": "uint256",
106
+ "internalType": "uint256"
107
+ }
108
+ ],
109
+ "outputs": [],
110
+ "stateMutability": "nonpayable"
111
+ },
190
112
  {
191
113
  "type": "function",
192
114
  "name": "targetArtifactSelectors",
@@ -432,6 +354,13 @@
432
354
  "outputs": [],
433
355
  "stateMutability": "nonpayable"
434
356
  },
357
+ {
358
+ "type": "function",
359
+ "name": "test_invalid_pool_config",
360
+ "inputs": [],
361
+ "outputs": [],
362
+ "stateMutability": "nonpayable"
363
+ },
435
364
  {
436
365
  "type": "function",
437
366
  "name": "test_invalid_tick_range",
@@ -12,97 +12,6 @@
12
12
  ],
13
13
  "stateMutability": "view"
14
14
  },
15
- {
16
- "type": "function",
17
- "name": "MAX_TOTAL_SUPPLY",
18
- "inputs": [],
19
- "outputs": [
20
- {
21
- "name": "",
22
- "type": "uint256",
23
- "internalType": "uint256"
24
- }
25
- ],
26
- "stateMutability": "view"
27
- },
28
- {
29
- "type": "function",
30
- "name": "MIN_ORDER_SIZE",
31
- "inputs": [],
32
- "outputs": [
33
- {
34
- "name": "",
35
- "type": "uint256",
36
- "internalType": "uint256"
37
- }
38
- ],
39
- "stateMutability": "view"
40
- },
41
- {
42
- "type": "function",
43
- "name": "PLATFORM_REFERRER_FEE_BPS",
44
- "inputs": [],
45
- "outputs": [
46
- {
47
- "name": "",
48
- "type": "uint256",
49
- "internalType": "uint256"
50
- }
51
- ],
52
- "stateMutability": "view"
53
- },
54
- {
55
- "type": "function",
56
- "name": "PROTOCOL_FEE_BPS",
57
- "inputs": [],
58
- "outputs": [
59
- {
60
- "name": "",
61
- "type": "uint256",
62
- "internalType": "uint256"
63
- }
64
- ],
65
- "stateMutability": "view"
66
- },
67
- {
68
- "type": "function",
69
- "name": "TOKEN_CREATOR_FEE_BPS",
70
- "inputs": [],
71
- "outputs": [
72
- {
73
- "name": "",
74
- "type": "uint256",
75
- "internalType": "uint256"
76
- }
77
- ],
78
- "stateMutability": "view"
79
- },
80
- {
81
- "type": "function",
82
- "name": "TOTAL_FEE_BPS",
83
- "inputs": [],
84
- "outputs": [
85
- {
86
- "name": "",
87
- "type": "uint256",
88
- "internalType": "uint256"
89
- }
90
- ],
91
- "stateMutability": "view"
92
- },
93
- {
94
- "type": "function",
95
- "name": "TRADE_REFERRER_FEE_BPS",
96
- "inputs": [],
97
- "outputs": [
98
- {
99
- "name": "",
100
- "type": "uint256",
101
- "internalType": "uint256"
102
- }
103
- ],
104
- "stateMutability": "view"
105
- },
106
15
  {
107
16
  "type": "function",
108
17
  "name": "excludeArtifacts",
@@ -187,6 +96,19 @@
187
96
  "outputs": [],
188
97
  "stateMutability": "nonpayable"
189
98
  },
99
+ {
100
+ "type": "function",
101
+ "name": "setUpWithBlockNumber",
102
+ "inputs": [
103
+ {
104
+ "name": "forkBlockNumber",
105
+ "type": "uint256",
106
+ "internalType": "uint256"
107
+ }
108
+ ],
109
+ "outputs": [],
110
+ "stateMutability": "nonpayable"
111
+ },
190
112
  {
191
113
  "type": "function",
192
114
  "name": "targetArtifactSelectors",
@@ -0,0 +1,21 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "supportsInterface",
5
+ "inputs": [
6
+ {
7
+ "name": "",
8
+ "type": "bytes4",
9
+ "internalType": "bytes4"
10
+ }
11
+ ],
12
+ "outputs": [
13
+ {
14
+ "name": "",
15
+ "type": "bool",
16
+ "internalType": "bool"
17
+ }
18
+ ],
19
+ "stateMutability": "pure"
20
+ }
21
+ ]
@@ -0,0 +1,68 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "deployZoraV4CoinHookFromContract",
5
+ "inputs": [
6
+ {
7
+ "name": "poolManager",
8
+ "type": "address",
9
+ "internalType": "address"
10
+ }
11
+ ],
12
+ "outputs": [
13
+ {
14
+ "name": "hook",
15
+ "type": "address",
16
+ "internalType": "contract IHooks"
17
+ }
18
+ ],
19
+ "stateMutability": "nonpayable"
20
+ },
21
+ {
22
+ "type": "error",
23
+ "name": "Create2EmptyBytecode",
24
+ "inputs": []
25
+ },
26
+ {
27
+ "type": "error",
28
+ "name": "Create2FailedDeployment",
29
+ "inputs": []
30
+ },
31
+ {
32
+ "type": "error",
33
+ "name": "Create2InsufficientBalance",
34
+ "inputs": [
35
+ {
36
+ "name": "balance",
37
+ "type": "uint256",
38
+ "internalType": "uint256"
39
+ },
40
+ {
41
+ "name": "needed",
42
+ "type": "uint256",
43
+ "internalType": "uint256"
44
+ }
45
+ ]
46
+ },
47
+ {
48
+ "type": "error",
49
+ "name": "HookNotDeployed",
50
+ "inputs": []
51
+ },
52
+ {
53
+ "type": "error",
54
+ "name": "InvalidHookAddress",
55
+ "inputs": [
56
+ {
57
+ "name": "expected",
58
+ "type": "address",
59
+ "internalType": "address"
60
+ },
61
+ {
62
+ "name": "actual",
63
+ "type": "address",
64
+ "internalType": "address"
65
+ }
66
+ ]
67
+ }
68
+ ]
@@ -0,0 +1,28 @@
1
+ [
2
+ {
3
+ "type": "error",
4
+ "name": "HookAddressNotValid",
5
+ "inputs": [
6
+ {
7
+ "name": "hooks",
8
+ "type": "address",
9
+ "internalType": "address"
10
+ }
11
+ ]
12
+ },
13
+ {
14
+ "type": "error",
15
+ "name": "HookCallFailed",
16
+ "inputs": []
17
+ },
18
+ {
19
+ "type": "error",
20
+ "name": "HookDeltaExceedsSwapAmount",
21
+ "inputs": []
22
+ },
23
+ {
24
+ "type": "error",
25
+ "name": "InvalidHookResponse",
26
+ "inputs": []
27
+ }
28
+ ]