@juicedollar/jusd 1.0.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/LICENSE +21 -0
- package/README.md +356 -0
- package/contracts/Equity.sol +457 -0
- package/contracts/JuiceDollar.sol +363 -0
- package/contracts/Leadrate.sol +79 -0
- package/contracts/MintingHubV2/MintingHub.sol +445 -0
- package/contracts/MintingHubV2/Position.sol +810 -0
- package/contracts/MintingHubV2/PositionFactory.sol +69 -0
- package/contracts/MintingHubV2/PositionRoller.sol +159 -0
- package/contracts/MintingHubV2/interface/IMintingHub.sol +26 -0
- package/contracts/MintingHubV2/interface/IPosition.sol +90 -0
- package/contracts/MintingHubV2/interface/IPositionFactory.sol +20 -0
- package/contracts/Savings.sol +141 -0
- package/contracts/SavingsVaultJUSD.sol +140 -0
- package/contracts/StablecoinBridge.sol +109 -0
- package/contracts/StartUSD.sol +16 -0
- package/contracts/gateway/CoinLendingGateway.sol +223 -0
- package/contracts/gateway/FrontendGateway.sol +224 -0
- package/contracts/gateway/MintingHubGateway.sol +87 -0
- package/contracts/gateway/SavingsGateway.sol +51 -0
- package/contracts/gateway/interface/ICoinLendingGateway.sol +73 -0
- package/contracts/gateway/interface/IFrontendGateway.sol +49 -0
- package/contracts/gateway/interface/IMintingHubGateway.sol +12 -0
- package/contracts/impl/ERC3009.sol +171 -0
- package/contracts/interface/IJuiceDollar.sol +54 -0
- package/contracts/interface/ILeadrate.sol +7 -0
- package/contracts/interface/IReserve.sol +9 -0
- package/contracts/interface/ISavingsJUSD.sol +49 -0
- package/contracts/test/FreakToken.sol +25 -0
- package/contracts/test/Math.sol +339 -0
- package/contracts/test/MockEquity.sol +15 -0
- package/contracts/test/PositionExpirationTest.sol +75 -0
- package/contracts/test/PositionRollingTest.sol +65 -0
- package/contracts/test/TestFlashLoan.sol +84 -0
- package/contracts/test/TestFlashLoanGateway.sol +49 -0
- package/contracts/test/TestMathUtil.sol +40 -0
- package/contracts/test/TestToken.sol +45 -0
- package/contracts/test/TestWcBTC.sol +35 -0
- package/contracts/utils/MathUtil.sol +61 -0
- package/dist/index.d.mts +8761 -0
- package/dist/index.d.ts +8761 -0
- package/dist/index.js +11119 -0
- package/dist/index.mjs +11073 -0
- package/exports/abis/MintingHubV2/PositionFactoryV2.ts +90 -0
- package/exports/abis/MintingHubV2/PositionRoller.ts +183 -0
- package/exports/abis/MintingHubV2/PositionV2.ts +999 -0
- package/exports/abis/core/CoinLendingGateway.ts +427 -0
- package/exports/abis/core/Equity.ts +1286 -0
- package/exports/abis/core/FrontendGateway.ts +906 -0
- package/exports/abis/core/JuiceDollar.ts +1366 -0
- package/exports/abis/core/MintingHubGateway.ts +865 -0
- package/exports/abis/core/SavingsGateway.ts +559 -0
- package/exports/abis/core/SavingsVaultJUSD.ts +920 -0
- package/exports/abis/utils/ERC20.ts +310 -0
- package/exports/abis/utils/ERC20PermitLight.ts +520 -0
- package/exports/abis/utils/Leadrate.ts +175 -0
- package/exports/abis/utils/MintingHubV2.ts +682 -0
- package/exports/abis/utils/Ownable.ts +76 -0
- package/exports/abis/utils/Savings.ts +453 -0
- package/exports/abis/utils/StablecoinBridge.ts +209 -0
- package/exports/abis/utils/StartUSD.ts +315 -0
- package/exports/abis/utils/UniswapV3Pool.ts +638 -0
- package/exports/address.config.ts +48 -0
- package/exports/index.ts +28 -0
- package/package.json +87 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export const PositionFactoryV2ABI = [
|
|
2
|
+
{
|
|
3
|
+
inputs: [
|
|
4
|
+
{
|
|
5
|
+
internalType: 'address',
|
|
6
|
+
name: '_parent',
|
|
7
|
+
type: 'address',
|
|
8
|
+
},
|
|
9
|
+
],
|
|
10
|
+
name: 'clonePosition',
|
|
11
|
+
outputs: [
|
|
12
|
+
{
|
|
13
|
+
internalType: 'address',
|
|
14
|
+
name: '',
|
|
15
|
+
type: 'address',
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
stateMutability: 'nonpayable',
|
|
19
|
+
type: 'function',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
inputs: [
|
|
23
|
+
{
|
|
24
|
+
internalType: 'address',
|
|
25
|
+
name: '_owner',
|
|
26
|
+
type: 'address',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
internalType: 'address',
|
|
30
|
+
name: '_jusd',
|
|
31
|
+
type: 'address',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
internalType: 'address',
|
|
35
|
+
name: '_collateral',
|
|
36
|
+
type: 'address',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
internalType: 'uint256',
|
|
40
|
+
name: '_minCollateral',
|
|
41
|
+
type: 'uint256',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
internalType: 'uint256',
|
|
45
|
+
name: '_initialLimit',
|
|
46
|
+
type: 'uint256',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
internalType: 'uint40',
|
|
50
|
+
name: '_initPeriod',
|
|
51
|
+
type: 'uint40',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
internalType: 'uint40',
|
|
55
|
+
name: '_duration',
|
|
56
|
+
type: 'uint40',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
internalType: 'uint40',
|
|
60
|
+
name: '_challengePeriod',
|
|
61
|
+
type: 'uint40',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
internalType: 'uint24',
|
|
65
|
+
name: '_riskPremiumPPM',
|
|
66
|
+
type: 'uint24',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
internalType: 'uint256',
|
|
70
|
+
name: '_liqPrice',
|
|
71
|
+
type: 'uint256',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
internalType: 'uint24',
|
|
75
|
+
name: '_reserve',
|
|
76
|
+
type: 'uint24',
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
name: 'createNewPosition',
|
|
80
|
+
outputs: [
|
|
81
|
+
{
|
|
82
|
+
internalType: 'address',
|
|
83
|
+
name: '',
|
|
84
|
+
type: 'address',
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
stateMutability: 'nonpayable',
|
|
88
|
+
type: 'function',
|
|
89
|
+
},
|
|
90
|
+
] as const;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
export const PositionRollerABI = [
|
|
2
|
+
{
|
|
3
|
+
inputs: [
|
|
4
|
+
{
|
|
5
|
+
internalType: 'address',
|
|
6
|
+
name: 'jusd_',
|
|
7
|
+
type: 'address',
|
|
8
|
+
},
|
|
9
|
+
],
|
|
10
|
+
stateMutability: 'nonpayable',
|
|
11
|
+
type: 'constructor',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
inputs: [
|
|
15
|
+
{
|
|
16
|
+
internalType: 'uint256',
|
|
17
|
+
name: '',
|
|
18
|
+
type: 'uint256',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
internalType: 'uint256',
|
|
22
|
+
name: '',
|
|
23
|
+
type: 'uint256',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
internalType: 'uint256',
|
|
27
|
+
name: '',
|
|
28
|
+
type: 'uint256',
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
name: 'Log',
|
|
32
|
+
type: 'error',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
inputs: [
|
|
36
|
+
{
|
|
37
|
+
internalType: 'address',
|
|
38
|
+
name: 'pos',
|
|
39
|
+
type: 'address',
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
name: 'NotOwner',
|
|
43
|
+
type: 'error',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
inputs: [
|
|
47
|
+
{
|
|
48
|
+
internalType: 'address',
|
|
49
|
+
name: 'pos',
|
|
50
|
+
type: 'address',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
name: 'NotPosition',
|
|
54
|
+
type: 'error',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
anonymous: false,
|
|
58
|
+
inputs: [
|
|
59
|
+
{
|
|
60
|
+
indexed: false,
|
|
61
|
+
internalType: 'address',
|
|
62
|
+
name: 'source',
|
|
63
|
+
type: 'address',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
indexed: false,
|
|
67
|
+
internalType: 'uint256',
|
|
68
|
+
name: 'collWithdraw',
|
|
69
|
+
type: 'uint256',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
indexed: false,
|
|
73
|
+
internalType: 'uint256',
|
|
74
|
+
name: 'repay',
|
|
75
|
+
type: 'uint256',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
indexed: false,
|
|
79
|
+
internalType: 'address',
|
|
80
|
+
name: 'target',
|
|
81
|
+
type: 'address',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
indexed: false,
|
|
85
|
+
internalType: 'uint256',
|
|
86
|
+
name: 'collDeposit',
|
|
87
|
+
type: 'uint256',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
indexed: false,
|
|
91
|
+
internalType: 'uint256',
|
|
92
|
+
name: 'mint',
|
|
93
|
+
type: 'uint256',
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
name: 'Roll',
|
|
97
|
+
type: 'event',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
inputs: [
|
|
101
|
+
{
|
|
102
|
+
internalType: 'contract IPosition',
|
|
103
|
+
name: 'source',
|
|
104
|
+
type: 'address',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
internalType: 'uint256',
|
|
108
|
+
name: 'repay',
|
|
109
|
+
type: 'uint256',
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
internalType: 'uint256',
|
|
113
|
+
name: 'collWithdraw',
|
|
114
|
+
type: 'uint256',
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
internalType: 'contract IPosition',
|
|
118
|
+
name: 'target',
|
|
119
|
+
type: 'address',
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
internalType: 'uint256',
|
|
123
|
+
name: 'mint',
|
|
124
|
+
type: 'uint256',
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
internalType: 'uint256',
|
|
128
|
+
name: 'collDeposit',
|
|
129
|
+
type: 'uint256',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
internalType: 'uint40',
|
|
133
|
+
name: 'expiration',
|
|
134
|
+
type: 'uint40',
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
name: 'roll',
|
|
138
|
+
outputs: [],
|
|
139
|
+
stateMutability: 'nonpayable',
|
|
140
|
+
type: 'function',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
inputs: [
|
|
144
|
+
{
|
|
145
|
+
internalType: 'contract IPosition',
|
|
146
|
+
name: 'source',
|
|
147
|
+
type: 'address',
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
internalType: 'contract IPosition',
|
|
151
|
+
name: 'target',
|
|
152
|
+
type: 'address',
|
|
153
|
+
},
|
|
154
|
+
],
|
|
155
|
+
name: 'rollFully',
|
|
156
|
+
outputs: [],
|
|
157
|
+
stateMutability: 'nonpayable',
|
|
158
|
+
type: 'function',
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
inputs: [
|
|
162
|
+
{
|
|
163
|
+
internalType: 'contract IPosition',
|
|
164
|
+
name: 'source',
|
|
165
|
+
type: 'address',
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
internalType: 'contract IPosition',
|
|
169
|
+
name: 'target',
|
|
170
|
+
type: 'address',
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
internalType: 'uint40',
|
|
174
|
+
name: 'expiration',
|
|
175
|
+
type: 'uint40',
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
name: 'rollFullyWithExpiration',
|
|
179
|
+
outputs: [],
|
|
180
|
+
stateMutability: 'nonpayable',
|
|
181
|
+
type: 'function',
|
|
182
|
+
},
|
|
183
|
+
] as const;
|