@zoralabs/coins 0.1.1 → 0.3.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.
- package/.turbo/turbo-build.log +35 -37
- package/CHANGELOG.md +13 -0
- package/abis/Coin.json +2 -14
- package/abis/ICoin.json +74 -14
- package/abis/IZoraFactory.json +9 -9
- package/abis/ZoraFactoryImpl.json +9 -9
- package/addresses/8453.json +2 -2
- package/addresses/84532.json +2 -2
- package/dist/index.cjs +11 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -28
- package/dist/index.js.map +1 -1
- package/dist/wagmiGenerated.d.ts +10 -20
- package/dist/wagmiGenerated.d.ts.map +1 -1
- package/package/wagmiGenerated.ts +11 -28
- package/package.json +3 -3
- package/src/Coin.sol +12 -24
- package/src/ZoraFactoryImpl.sol +2 -2
- package/src/interfaces/ICoin.sol +11 -9
- package/src/interfaces/IZoraFactory.sol +8 -8
- package/src/utils/CoinConstants.sol +1 -1
- package/src/version/ContractVersionBase.sol +1 -1
- package/test/Coin.t.sol +7 -4
package/src/interfaces/ICoin.sol
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity ^0.8.23;
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
|
5
|
+
import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
|
|
6
|
+
import {IERC7572} from "./IERC7572.sol";
|
|
7
|
+
|
|
8
|
+
interface ICoin is IERC165, IERC721Receiver, IERC7572 {
|
|
5
9
|
/// @notice Thrown when an operation is attempted with a zero address
|
|
6
10
|
error AddressZero();
|
|
7
11
|
|
|
@@ -66,13 +70,13 @@ interface ICoin {
|
|
|
66
70
|
}
|
|
67
71
|
|
|
68
72
|
/// @notice Emitted when market rewards are distributed
|
|
69
|
-
/// @param
|
|
73
|
+
/// @param payoutRecipient The address of the creator rewards payout recipient
|
|
70
74
|
/// @param platformReferrer The address of the platform referrer
|
|
71
75
|
/// @param protocolRewardRecipient The address of the protocol reward recipient
|
|
72
76
|
/// @param currency The address of the currency
|
|
73
77
|
/// @param marketRewards The rewards accrued from the market's liquidity position
|
|
74
78
|
event CoinMarketRewards(
|
|
75
|
-
address indexed
|
|
79
|
+
address indexed payoutRecipient,
|
|
76
80
|
address indexed platformReferrer,
|
|
77
81
|
address protocolRewardRecipient,
|
|
78
82
|
address currency,
|
|
@@ -94,8 +98,7 @@ interface ICoin {
|
|
|
94
98
|
uint256 coinsPurchased,
|
|
95
99
|
address currency,
|
|
96
100
|
uint256 amountFee,
|
|
97
|
-
uint256 amountSold
|
|
98
|
-
string comment // TODO remove after backend approval
|
|
101
|
+
uint256 amountSold
|
|
99
102
|
);
|
|
100
103
|
|
|
101
104
|
/// @notice Emitted when coins are sold
|
|
@@ -113,8 +116,7 @@ interface ICoin {
|
|
|
113
116
|
uint256 coinsSold,
|
|
114
117
|
address currency,
|
|
115
118
|
uint256 amountFee,
|
|
116
|
-
uint256 amountPurchased
|
|
117
|
-
string comment // TODO remove after backend approval
|
|
119
|
+
uint256 amountPurchased
|
|
118
120
|
);
|
|
119
121
|
|
|
120
122
|
/// @notice Emitted when a coin is transferred
|
|
@@ -126,7 +128,7 @@ interface ICoin {
|
|
|
126
128
|
event CoinTransfer(address indexed sender, address indexed recipient, uint256 amount, uint256 senderBalance, uint256 recipientBalance);
|
|
127
129
|
|
|
128
130
|
/// @notice Emitted when trade rewards are distributed
|
|
129
|
-
/// @param
|
|
131
|
+
/// @param payoutRecipient The address of the creator rewards payout recipient
|
|
130
132
|
/// @param platformReferrer The address of the platform referrer
|
|
131
133
|
/// @param tradeReferrer The address of the trade referrer
|
|
132
134
|
/// @param protocolRewardRecipient The address of the protocol reward recipient
|
|
@@ -136,7 +138,7 @@ interface ICoin {
|
|
|
136
138
|
/// @param protocolReward The reward for the protocol
|
|
137
139
|
/// @param currency The address of the currency
|
|
138
140
|
event CoinTradeRewards(
|
|
139
|
-
address indexed
|
|
141
|
+
address indexed payoutRecipient,
|
|
140
142
|
address indexed platformReferrer,
|
|
141
143
|
address indexed tradeReferrer,
|
|
142
144
|
address protocolRewardRecipient,
|
|
@@ -3,27 +3,27 @@ pragma solidity ^0.8.23;
|
|
|
3
3
|
|
|
4
4
|
interface IZoraFactory {
|
|
5
5
|
/// @notice Emitted when a coin is created
|
|
6
|
-
/// @param
|
|
7
|
-
/// @param creator The address of the creator of the coin
|
|
6
|
+
/// @param caller The msg.sender address
|
|
8
7
|
/// @param payoutRecipient The address of the creator payout recipient
|
|
9
8
|
/// @param platformReferrer The address of the platform referrer
|
|
10
9
|
/// @param currency The address of the currency
|
|
11
|
-
/// @param
|
|
10
|
+
/// @param uri The URI of the coin
|
|
12
11
|
/// @param name The name of the coin
|
|
13
12
|
/// @param symbol The symbol of the coin
|
|
14
13
|
/// @param coin The address of the coin
|
|
15
14
|
/// @param pool The address of the pool
|
|
15
|
+
/// @param version The coin contract version
|
|
16
16
|
event CoinCreated(
|
|
17
|
-
address indexed
|
|
18
|
-
address indexed creator, // TODO remove after backend approval
|
|
17
|
+
address indexed caller,
|
|
19
18
|
address indexed payoutRecipient,
|
|
20
|
-
address platformReferrer,
|
|
19
|
+
address indexed platformReferrer,
|
|
21
20
|
address currency,
|
|
22
|
-
string
|
|
21
|
+
string uri,
|
|
23
22
|
string name,
|
|
24
23
|
string symbol,
|
|
25
24
|
address coin,
|
|
26
|
-
address pool
|
|
25
|
+
address pool,
|
|
26
|
+
string version
|
|
27
27
|
);
|
|
28
28
|
|
|
29
29
|
/// @notice Thrown when the amount of ERC20 tokens transferred does not match the expected amount
|
|
@@ -60,7 +60,7 @@ abstract contract CoinConstants {
|
|
|
60
60
|
|
|
61
61
|
/// @notice The LP's lower tick
|
|
62
62
|
/// @dev This is only used if the currency is WETH
|
|
63
|
-
int24 internal constant LP_TICK_LOWER_WETH = -
|
|
63
|
+
int24 internal constant LP_TICK_LOWER_WETH = -199200;
|
|
64
64
|
|
|
65
65
|
/// @notice The LP's upper tick
|
|
66
66
|
int24 internal constant LP_TICK_UPPER = 887200;
|
|
@@ -9,6 +9,6 @@ import {IVersionedContract} from "@zoralabs/shared-contracts/interfaces/IVersion
|
|
|
9
9
|
contract ContractVersionBase is IVersionedContract {
|
|
10
10
|
/// @notice The version of the contract
|
|
11
11
|
function contractVersion() external pure override returns (string memory) {
|
|
12
|
-
return "0.
|
|
12
|
+
return "0.3.0";
|
|
13
13
|
}
|
|
14
14
|
}
|
package/test/Coin.t.sol
CHANGED
|
@@ -377,19 +377,22 @@ contract CoinTest is BaseTest {
|
|
|
377
377
|
MarketRewards memory marketRewards = _calculateMarketRewards(expectedLpFee);
|
|
378
378
|
|
|
379
379
|
assertEq(marketRewards.creator + marketRewards.platformReferrer + marketRewards.protocol, expectedLpFee, "Secondary rewards incorrect");
|
|
380
|
-
|
|
380
|
+
assertApproxEqAbs(
|
|
381
381
|
protocolRewards.balanceOf(users.creator),
|
|
382
382
|
initialTokenCreatorBalance + orderFees.creator + marketRewards.creator,
|
|
383
|
+
0.0000000000000001 ether,
|
|
383
384
|
"Token creator rewards incorrect"
|
|
384
385
|
);
|
|
385
|
-
|
|
386
|
+
assertApproxEqAbs(
|
|
386
387
|
protocolRewards.balanceOf(users.platformReferrer),
|
|
387
388
|
initialPlatformReferrerBalance + orderFees.platformReferrer + marketRewards.platformReferrer,
|
|
389
|
+
0.0000000000000001 ether,
|
|
388
390
|
"Platform referrer rewards incorrect"
|
|
389
391
|
);
|
|
390
|
-
|
|
392
|
+
assertApproxEqAbs(
|
|
391
393
|
protocolRewards.balanceOf(users.feeRecipient),
|
|
392
394
|
initialFeeRecipientBalance + orderFees.protocol + marketRewards.protocol,
|
|
395
|
+
0.0000000000000001 ether,
|
|
393
396
|
"Protocol rewards incorrect"
|
|
394
397
|
);
|
|
395
398
|
assertEq(protocolRewards.balanceOf(users.tradeReferrer), initialOrderReferrerBalance + orderFees.tradeReferrer, "Order referrer rewards incorrect");
|
|
@@ -438,6 +441,6 @@ contract CoinTest is BaseTest {
|
|
|
438
441
|
}
|
|
439
442
|
|
|
440
443
|
function test_contract_version() public view {
|
|
441
|
-
assertEq(coin.contractVersion(), "0.
|
|
444
|
+
assertEq(coin.contractVersion(), "0.3.0");
|
|
442
445
|
}
|
|
443
446
|
}
|