@juicedollar/jusd 4.0.0 → 4.0.1
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/contracts/TeamMinter.sol +68 -0
- package/dist/index.js +33 -33
- package/dist/index.mjs +33 -33
- package/exports/address.config.ts +33 -33
- package/package.json +1 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
import {IJuiceDollar} from "./interface/IJuiceDollar.sol";
|
|
5
|
+
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @title TeamMinter
|
|
9
|
+
* @notice Team compensation tokens backed by 50% of JUSD equity.
|
|
10
|
+
*
|
|
11
|
+
* On deployment, mints a fixed supply of TEAM tokens to the deployer.
|
|
12
|
+
* Each TEAM token represents a claim on: equity() / (2 * initialSupply) JUSD.
|
|
13
|
+
*
|
|
14
|
+
* Team members decide individually when to redeem. Early = less (equity small),
|
|
15
|
+
* late = more (equity has grown). No price gate — the incentive is built-in.
|
|
16
|
+
*
|
|
17
|
+
* Redeeming burns TEAM tokens and distributes JUSD from the equity reserve.
|
|
18
|
+
*/
|
|
19
|
+
contract TeamMinter is ERC20 {
|
|
20
|
+
IJuiceDollar public immutable JUSD;
|
|
21
|
+
uint256 public immutable initialSupply;
|
|
22
|
+
|
|
23
|
+
event Redeemed(address indexed member, uint256 teamTokens, uint256 jusdAmount);
|
|
24
|
+
|
|
25
|
+
error NothingToRedeem();
|
|
26
|
+
error InvalidSupply();
|
|
27
|
+
|
|
28
|
+
constructor(
|
|
29
|
+
address _jusd,
|
|
30
|
+
uint256 _totalTeamTokens
|
|
31
|
+
) ERC20("TEAM", "TEAM") {
|
|
32
|
+
if (_totalTeamTokens == 0) revert InvalidSupply();
|
|
33
|
+
JUSD = IJuiceDollar(_jusd);
|
|
34
|
+
initialSupply = _totalTeamTokens;
|
|
35
|
+
_mint(msg.sender, _totalTeamTokens);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @notice Redeem all TEAM tokens for JUSD.
|
|
40
|
+
*/
|
|
41
|
+
function redeem() external {
|
|
42
|
+
_redeem(msg.sender, balanceOf(msg.sender));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @notice Redeem a specific amount of TEAM tokens for JUSD.
|
|
47
|
+
*/
|
|
48
|
+
function redeem(uint256 amount) external {
|
|
49
|
+
_redeem(msg.sender, amount);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @notice Current JUSD value of a given amount of TEAM tokens.
|
|
54
|
+
*/
|
|
55
|
+
function redeemValue(uint256 amount) public view returns (uint256) {
|
|
56
|
+
return (amount * JUSD.equity()) / (2 * initialSupply);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function _redeem(address member, uint256 amount) internal {
|
|
60
|
+
if (amount == 0) revert NothingToRedeem();
|
|
61
|
+
|
|
62
|
+
uint256 jusdAmount = redeemValue(amount);
|
|
63
|
+
_burn(member, amount);
|
|
64
|
+
JUSD.distributeProfits(member, jusdAmount);
|
|
65
|
+
|
|
66
|
+
emit Redeemed(member, amount, jusdAmount);
|
|
67
|
+
}
|
|
68
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -51,43 +51,43 @@ var import_viem = require("viem");
|
|
|
51
51
|
var ADDRESS = {
|
|
52
52
|
4114: {
|
|
53
53
|
// Citrea Mainnet
|
|
54
|
-
juiceDollar: "
|
|
55
|
-
equity: "
|
|
54
|
+
juiceDollar: "0x0987D3720d38847AC6dBB9D025B9DE892a3ca35c",
|
|
55
|
+
equity: "0x2a36f2b204B46Fd82653Cd06D00c7ff757C99ae4",
|
|
56
56
|
// V2
|
|
57
|
-
frontendGateway: "
|
|
58
|
-
savingsGateway: "
|
|
59
|
-
savingsVaultV2: "
|
|
60
|
-
mintingHubGateway: "
|
|
61
|
-
rollerV2: "
|
|
62
|
-
positionFactoryV2: "
|
|
63
|
-
genesisPosition: "
|
|
57
|
+
frontendGateway: "0x3090a89A1fF5DC99117Be655599E5491a0baBb92",
|
|
58
|
+
savingsGateway: "0x22fE239892EBc8805Da8f05ed3Bc6af75332b60b",
|
|
59
|
+
savingsVaultV2: "0x1b70ae756b1089CC5948e4F8a2aD498df30e897d",
|
|
60
|
+
mintingHubGateway: "0x1a20b160BF546774246c7920939E6e7AC0F88B8e",
|
|
61
|
+
rollerV2: "0xc1b97398C06b9c6A49fD9dCfaC8907700301e9AC",
|
|
62
|
+
positionFactoryV2: "0x107eDF5f030D724Bd0c73f88a300bEA09ae581e2",
|
|
63
|
+
genesisPosition: "0xe8C97614AC1A5aC0e8Ab2d0E04b4b315817ecb36",
|
|
64
64
|
// V3
|
|
65
|
-
savings: "
|
|
66
|
-
mintingHub: "
|
|
67
|
-
savingsVaultV3: "
|
|
68
|
-
rollerV3: "
|
|
69
|
-
positionFactoryV3: "
|
|
65
|
+
savings: "0x6347A7eC9cF3D04CD853425a9857513c600eaa94",
|
|
66
|
+
mintingHub: "0x0F0164a5D9556c64Ba879622C71732F3525C183A",
|
|
67
|
+
savingsVaultV3: "0xd6d874968882D01Fff6712E639F3f7E19Bda6523",
|
|
68
|
+
rollerV3: "0x7e2bc47C49e73340bB7d00BB1E972125cF76A54d",
|
|
69
|
+
positionFactoryV3: "0x37e45acef1E1fef03697440682329ffC84e9310E",
|
|
70
70
|
// Bridges
|
|
71
|
-
bridgeStartUSD: "
|
|
72
|
-
bridgeUSDC: "
|
|
73
|
-
bridgeUSDT: "
|
|
74
|
-
bridgeCTUSD: "
|
|
75
|
-
startUSD: "
|
|
76
|
-
USDC: "
|
|
77
|
-
USDT: "
|
|
78
|
-
CTUSD: "
|
|
71
|
+
bridgeStartUSD: "0x51ff8141d731676fB21ae1E5D5a88C04511994Dd",
|
|
72
|
+
bridgeUSDC: "0x920Db0ADF6fEE2d69401E9F68D60319177dCa20f",
|
|
73
|
+
bridgeUSDT: "0x5cC0e668F8BA61E111b6168e19d17D3c65040614",
|
|
74
|
+
bridgeCTUSD: "0x8d11020286af9ECf7e5D7Bd79699c391b224a0bD",
|
|
75
|
+
startUSD: "0xD41AB73aF9C7324b9C7C6E63DE1aeC666d98bc80",
|
|
76
|
+
USDC: "0xE045e6C36cf77FAA2cFB54466d71A3aEF7bBe839",
|
|
77
|
+
USDT: "0x9F3096bAc87E7f03dC09B0B416eb0dF837304Dc4",
|
|
78
|
+
CTUSD: "0x8D82c4e3C936c7b5724A382a9c5A4e6eb7Ab6D5d"
|
|
79
79
|
},
|
|
80
80
|
5115: {
|
|
81
|
-
juiceDollar: "
|
|
82
|
-
equity: "
|
|
81
|
+
juiceDollar: "0x6a850A548Fdd050E8961223eC8FfCdFaCEA57E39",
|
|
82
|
+
equity: "0x7fA131991C8a7D8c21B11391C977fC7C4C8e0D5e",
|
|
83
83
|
// V2
|
|
84
|
-
frontendGateway: "
|
|
85
|
-
savingsGateway: "
|
|
86
|
-
savingsVaultV2: "
|
|
87
|
-
mintingHubGateway: "
|
|
88
|
-
rollerV2: "
|
|
89
|
-
positionFactoryV2: "
|
|
90
|
-
genesisPosition: "
|
|
84
|
+
frontendGateway: "0xD824b7D36594fc3088B1d91a79f34931Aa2a15d0",
|
|
85
|
+
savingsGateway: "0x54430781b33581cE2B0dBd837ca66113BeEefd8E",
|
|
86
|
+
savingsVaultV2: "0x802A29BD29F02c8c477Af5362f9bA88faE39cc7b",
|
|
87
|
+
mintingHubGateway: "0x5fC684074FBAae37EB68D3E48d85f485cE5060F8",
|
|
88
|
+
rollerV2: "0x8A50329559ae3F2BaA1Fc8bc59FCd52958C61CAc",
|
|
89
|
+
positionFactoryV2: "0x2990C3219ed2763685d4420F5513fEea8991A7EE",
|
|
90
|
+
genesisPosition: "0x236375455EbDf941a83eCda3eEcaF2288B6A0f40",
|
|
91
91
|
// V3 (to be populated after deployment)
|
|
92
92
|
savings: import_viem.zeroAddress,
|
|
93
93
|
mintingHub: import_viem.zeroAddress,
|
|
@@ -95,8 +95,8 @@ var ADDRESS = {
|
|
|
95
95
|
rollerV3: import_viem.zeroAddress,
|
|
96
96
|
positionFactoryV3: import_viem.zeroAddress,
|
|
97
97
|
// Bridges
|
|
98
|
-
bridgeStartUSD: "
|
|
99
|
-
startUSD: "
|
|
98
|
+
bridgeStartUSD: "0x9ba2264Be7695044F59B9cA863e69ac38B3c913d",
|
|
99
|
+
startUSD: "0x8398dA4C32eaE51B9840Da230095BB29F4179390"
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
102
|
|
package/dist/index.mjs
CHANGED
|
@@ -3,43 +3,43 @@ import { zeroAddress } from "viem";
|
|
|
3
3
|
var ADDRESS = {
|
|
4
4
|
4114: {
|
|
5
5
|
// Citrea Mainnet
|
|
6
|
-
juiceDollar: "
|
|
7
|
-
equity: "
|
|
6
|
+
juiceDollar: "0x0987D3720d38847AC6dBB9D025B9DE892a3ca35c",
|
|
7
|
+
equity: "0x2a36f2b204B46Fd82653Cd06D00c7ff757C99ae4",
|
|
8
8
|
// V2
|
|
9
|
-
frontendGateway: "
|
|
10
|
-
savingsGateway: "
|
|
11
|
-
savingsVaultV2: "
|
|
12
|
-
mintingHubGateway: "
|
|
13
|
-
rollerV2: "
|
|
14
|
-
positionFactoryV2: "
|
|
15
|
-
genesisPosition: "
|
|
9
|
+
frontendGateway: "0x3090a89A1fF5DC99117Be655599E5491a0baBb92",
|
|
10
|
+
savingsGateway: "0x22fE239892EBc8805Da8f05ed3Bc6af75332b60b",
|
|
11
|
+
savingsVaultV2: "0x1b70ae756b1089CC5948e4F8a2aD498df30e897d",
|
|
12
|
+
mintingHubGateway: "0x1a20b160BF546774246c7920939E6e7AC0F88B8e",
|
|
13
|
+
rollerV2: "0xc1b97398C06b9c6A49fD9dCfaC8907700301e9AC",
|
|
14
|
+
positionFactoryV2: "0x107eDF5f030D724Bd0c73f88a300bEA09ae581e2",
|
|
15
|
+
genesisPosition: "0xe8C97614AC1A5aC0e8Ab2d0E04b4b315817ecb36",
|
|
16
16
|
// V3
|
|
17
|
-
savings: "
|
|
18
|
-
mintingHub: "
|
|
19
|
-
savingsVaultV3: "
|
|
20
|
-
rollerV3: "
|
|
21
|
-
positionFactoryV3: "
|
|
17
|
+
savings: "0x6347A7eC9cF3D04CD853425a9857513c600eaa94",
|
|
18
|
+
mintingHub: "0x0F0164a5D9556c64Ba879622C71732F3525C183A",
|
|
19
|
+
savingsVaultV3: "0xd6d874968882D01Fff6712E639F3f7E19Bda6523",
|
|
20
|
+
rollerV3: "0x7e2bc47C49e73340bB7d00BB1E972125cF76A54d",
|
|
21
|
+
positionFactoryV3: "0x37e45acef1E1fef03697440682329ffC84e9310E",
|
|
22
22
|
// Bridges
|
|
23
|
-
bridgeStartUSD: "
|
|
24
|
-
bridgeUSDC: "
|
|
25
|
-
bridgeUSDT: "
|
|
26
|
-
bridgeCTUSD: "
|
|
27
|
-
startUSD: "
|
|
28
|
-
USDC: "
|
|
29
|
-
USDT: "
|
|
30
|
-
CTUSD: "
|
|
23
|
+
bridgeStartUSD: "0x51ff8141d731676fB21ae1E5D5a88C04511994Dd",
|
|
24
|
+
bridgeUSDC: "0x920Db0ADF6fEE2d69401E9F68D60319177dCa20f",
|
|
25
|
+
bridgeUSDT: "0x5cC0e668F8BA61E111b6168e19d17D3c65040614",
|
|
26
|
+
bridgeCTUSD: "0x8d11020286af9ECf7e5D7Bd79699c391b224a0bD",
|
|
27
|
+
startUSD: "0xD41AB73aF9C7324b9C7C6E63DE1aeC666d98bc80",
|
|
28
|
+
USDC: "0xE045e6C36cf77FAA2cFB54466d71A3aEF7bBe839",
|
|
29
|
+
USDT: "0x9F3096bAc87E7f03dC09B0B416eb0dF837304Dc4",
|
|
30
|
+
CTUSD: "0x8D82c4e3C936c7b5724A382a9c5A4e6eb7Ab6D5d"
|
|
31
31
|
},
|
|
32
32
|
5115: {
|
|
33
|
-
juiceDollar: "
|
|
34
|
-
equity: "
|
|
33
|
+
juiceDollar: "0x6a850A548Fdd050E8961223eC8FfCdFaCEA57E39",
|
|
34
|
+
equity: "0x7fA131991C8a7D8c21B11391C977fC7C4C8e0D5e",
|
|
35
35
|
// V2
|
|
36
|
-
frontendGateway: "
|
|
37
|
-
savingsGateway: "
|
|
38
|
-
savingsVaultV2: "
|
|
39
|
-
mintingHubGateway: "
|
|
40
|
-
rollerV2: "
|
|
41
|
-
positionFactoryV2: "
|
|
42
|
-
genesisPosition: "
|
|
36
|
+
frontendGateway: "0xD824b7D36594fc3088B1d91a79f34931Aa2a15d0",
|
|
37
|
+
savingsGateway: "0x54430781b33581cE2B0dBd837ca66113BeEefd8E",
|
|
38
|
+
savingsVaultV2: "0x802A29BD29F02c8c477Af5362f9bA88faE39cc7b",
|
|
39
|
+
mintingHubGateway: "0x5fC684074FBAae37EB68D3E48d85f485cE5060F8",
|
|
40
|
+
rollerV2: "0x8A50329559ae3F2BaA1Fc8bc59FCd52958C61CAc",
|
|
41
|
+
positionFactoryV2: "0x2990C3219ed2763685d4420F5513fEea8991A7EE",
|
|
42
|
+
genesisPosition: "0x236375455EbDf941a83eCda3eEcaF2288B6A0f40",
|
|
43
43
|
// V3 (to be populated after deployment)
|
|
44
44
|
savings: zeroAddress,
|
|
45
45
|
mintingHub: zeroAddress,
|
|
@@ -47,8 +47,8 @@ var ADDRESS = {
|
|
|
47
47
|
rollerV3: zeroAddress,
|
|
48
48
|
positionFactoryV3: zeroAddress,
|
|
49
49
|
// Bridges
|
|
50
|
-
bridgeStartUSD: "
|
|
51
|
-
startUSD: "
|
|
50
|
+
bridgeStartUSD: "0x9ba2264Be7695044F59B9cA863e69ac38B3c913d",
|
|
51
|
+
startUSD: "0x8398dA4C32eaE51B9840Da230095BB29F4179390"
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
|
|
@@ -39,43 +39,43 @@ export interface ChainAddress {
|
|
|
39
39
|
export const ADDRESS: Record<number, ChainAddress> = {
|
|
40
40
|
4114: {
|
|
41
41
|
// Citrea Mainnet
|
|
42
|
-
juiceDollar: '
|
|
43
|
-
equity: '
|
|
42
|
+
juiceDollar: '0x0987D3720d38847AC6dBB9D025B9DE892a3ca35c',
|
|
43
|
+
equity: '0x2a36f2b204B46Fd82653Cd06D00c7ff757C99ae4',
|
|
44
44
|
// V2
|
|
45
|
-
frontendGateway: '
|
|
46
|
-
savingsGateway: '
|
|
47
|
-
savingsVaultV2: '
|
|
48
|
-
mintingHubGateway: '
|
|
49
|
-
rollerV2: '
|
|
50
|
-
positionFactoryV2: '
|
|
51
|
-
genesisPosition: '
|
|
45
|
+
frontendGateway: '0x3090a89A1fF5DC99117Be655599E5491a0baBb92',
|
|
46
|
+
savingsGateway: '0x22fE239892EBc8805Da8f05ed3Bc6af75332b60b',
|
|
47
|
+
savingsVaultV2: '0x1b70ae756b1089CC5948e4F8a2aD498df30e897d',
|
|
48
|
+
mintingHubGateway: '0x1a20b160BF546774246c7920939E6e7AC0F88B8e',
|
|
49
|
+
rollerV2: '0xc1b97398C06b9c6A49fD9dCfaC8907700301e9AC',
|
|
50
|
+
positionFactoryV2: '0x107eDF5f030D724Bd0c73f88a300bEA09ae581e2',
|
|
51
|
+
genesisPosition: '0xe8C97614AC1A5aC0e8Ab2d0E04b4b315817ecb36',
|
|
52
52
|
// V3
|
|
53
|
-
savings: '
|
|
54
|
-
mintingHub: '
|
|
55
|
-
savingsVaultV3: '
|
|
56
|
-
rollerV3: '
|
|
57
|
-
positionFactoryV3: '
|
|
53
|
+
savings: '0x6347A7eC9cF3D04CD853425a9857513c600eaa94',
|
|
54
|
+
mintingHub: '0x0F0164a5D9556c64Ba879622C71732F3525C183A',
|
|
55
|
+
savingsVaultV3: '0xd6d874968882D01Fff6712E639F3f7E19Bda6523',
|
|
56
|
+
rollerV3: '0x7e2bc47C49e73340bB7d00BB1E972125cF76A54d',
|
|
57
|
+
positionFactoryV3: '0x37e45acef1E1fef03697440682329ffC84e9310E',
|
|
58
58
|
// Bridges
|
|
59
|
-
bridgeStartUSD: '
|
|
60
|
-
bridgeUSDC: '
|
|
61
|
-
bridgeUSDT: '
|
|
62
|
-
bridgeCTUSD: '
|
|
63
|
-
startUSD: '
|
|
64
|
-
USDC: '
|
|
65
|
-
USDT: '
|
|
66
|
-
CTUSD: '
|
|
59
|
+
bridgeStartUSD: '0x51ff8141d731676fB21ae1E5D5a88C04511994Dd',
|
|
60
|
+
bridgeUSDC: '0x920Db0ADF6fEE2d69401E9F68D60319177dCa20f',
|
|
61
|
+
bridgeUSDT: '0x5cC0e668F8BA61E111b6168e19d17D3c65040614',
|
|
62
|
+
bridgeCTUSD: '0x8d11020286af9ECf7e5D7Bd79699c391b224a0bD',
|
|
63
|
+
startUSD: '0xD41AB73aF9C7324b9C7C6E63DE1aeC666d98bc80',
|
|
64
|
+
USDC: '0xE045e6C36cf77FAA2cFB54466d71A3aEF7bBe839',
|
|
65
|
+
USDT: '0x9F3096bAc87E7f03dC09B0B416eb0dF837304Dc4',
|
|
66
|
+
CTUSD: '0x8D82c4e3C936c7b5724A382a9c5A4e6eb7Ab6D5d',
|
|
67
67
|
},
|
|
68
68
|
5115: {
|
|
69
|
-
juiceDollar: '
|
|
70
|
-
equity: '
|
|
69
|
+
juiceDollar: '0x6a850A548Fdd050E8961223eC8FfCdFaCEA57E39',
|
|
70
|
+
equity: '0x7fA131991C8a7D8c21B11391C977fC7C4C8e0D5e',
|
|
71
71
|
// V2
|
|
72
|
-
frontendGateway: '
|
|
73
|
-
savingsGateway: '
|
|
74
|
-
savingsVaultV2: '
|
|
75
|
-
mintingHubGateway: '
|
|
76
|
-
rollerV2: '
|
|
77
|
-
positionFactoryV2: '
|
|
78
|
-
genesisPosition: '
|
|
72
|
+
frontendGateway: '0xD824b7D36594fc3088B1d91a79f34931Aa2a15d0',
|
|
73
|
+
savingsGateway: '0x54430781b33581cE2B0dBd837ca66113BeEefd8E',
|
|
74
|
+
savingsVaultV2: '0x802A29BD29F02c8c477Af5362f9bA88faE39cc7b',
|
|
75
|
+
mintingHubGateway: '0x5fC684074FBAae37EB68D3E48d85f485cE5060F8',
|
|
76
|
+
rollerV2: '0x8A50329559ae3F2BaA1Fc8bc59FCd52958C61CAc',
|
|
77
|
+
positionFactoryV2: '0x2990C3219ed2763685d4420F5513fEea8991A7EE',
|
|
78
|
+
genesisPosition: '0x236375455EbDf941a83eCda3eEcaF2288B6A0f40',
|
|
79
79
|
// V3 (to be populated after deployment)
|
|
80
80
|
savings: zeroAddress,
|
|
81
81
|
mintingHub: zeroAddress,
|
|
@@ -83,7 +83,7 @@ export const ADDRESS: Record<number, ChainAddress> = {
|
|
|
83
83
|
rollerV3: zeroAddress,
|
|
84
84
|
positionFactoryV3: zeroAddress,
|
|
85
85
|
// Bridges
|
|
86
|
-
bridgeStartUSD: '
|
|
87
|
-
startUSD: '
|
|
86
|
+
bridgeStartUSD: '0x9ba2264Be7695044F59B9cA863e69ac38B3c913d',
|
|
87
|
+
startUSD: '0x8398dA4C32eaE51B9840Da230095BB29F4179390',
|
|
88
88
|
},
|
|
89
89
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juicedollar/jusd",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "JuiceDollar (JUSD) - Oracle-free, Bitcoin-collateralized stablecoin on Citrea. Decentralized minting with democratic governance.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|