@ape.swap/bonds-sdk 1.0.354 → 1.0.356

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.
@@ -62,9 +62,10 @@ import { TooltipText } from '../../enum/tooltips';
62
62
  import { formatNumberSI } from '../../utils/formatNumber';
63
63
  import { ethers } from 'ethers';
64
64
  import { adjustDecimals } from "../../utils/convertToTokenValue";
65
- import { BondAbi } from '../../enum/abis';
66
65
  import TokenImage from '../uikit-sdk/TokenImage';
67
66
  import '../../scss/BondModal.scss';
67
+ import BOND_ABI from '../../config/abi/bond.json';
68
+ import ERC_20_ABI from '../../config/abi/bond.json';
68
69
  var BondModal = function (_a) {
69
70
  var isOpen = _a.isOpen, onClose = _a.onClose, bondAddress = _a.bondAddress;
70
71
  if (!isOpen)
@@ -115,6 +116,8 @@ var BondModal = function (_a) {
115
116
  setSelectedBond(bond);
116
117
  navigate("/bondsingle/".concat(bond.billAddress));
117
118
  };
119
+ //Note to Gordon: Can we put all this in a helper file or something so the code in here is less?
120
+ /////////////////////
118
121
  function formatNumber(input) {
119
122
  var number = new BigNumber(input);
120
123
  if (number.isNaN())
@@ -166,6 +169,9 @@ var BondModal = function (_a) {
166
169
  var getPremium = premium(bond);
167
170
  return parseFloat(getPremium) < 0 ? 'premium-negative' : 'premium-positive';
168
171
  };
172
+ ////////////////////////////////////////////////////////////////////////////////////
173
+ ////////////////////////////////////////////////////////////////////////////////////
174
+ ////////////////////////////////////////////////////////////////////////////////////
169
175
  var handleBuy = function () { return __awaiter(void 0, void 0, void 0, function () {
170
176
  var provider, signer, bondContract, maxPrice, amount, tx, error_1;
171
177
  return __generator(this, function (_a) {
@@ -179,7 +185,7 @@ var BondModal = function (_a) {
179
185
  }
180
186
  provider = new ethers.providers.Web3Provider(window.ethereum);
181
187
  signer = provider.getSigner();
182
- bondContract = new ethers.Contract(bondAddress !== null && bondAddress !== void 0 ? bondAddress : "", BondAbi, signer);
188
+ bondContract = new ethers.Contract(bondAddress !== null && bondAddress !== void 0 ? bondAddress : "", BOND_ABI, signer);
183
189
  _a.label = 1;
184
190
  case 1:
185
191
  _a.trys.push([1, 4, , 5]);
@@ -202,10 +208,12 @@ var BondModal = function (_a) {
202
208
  }
203
209
  });
204
210
  }); };
211
+ //You approve the token, not the contract (this code will have to be updated for zap)
205
212
  var handleApprove = function () { return __awaiter(void 0, void 0, void 0, function () {
206
213
  var provider, signer, bondContract, amount, tx, error_2;
207
- return __generator(this, function (_a) {
208
- switch (_a.label) {
214
+ var _a;
215
+ return __generator(this, function (_b) {
216
+ switch (_b.label) {
209
217
  case 0:
210
218
  console.log('handle approve clicked');
211
219
  if (!window.ethereum) {
@@ -213,24 +221,25 @@ var BondModal = function (_a) {
213
221
  alert('No Ethereum provider found');
214
222
  return [2 /*return*/];
215
223
  }
224
+ console.log(selectedBond === null || selectedBond === void 0 ? void 0 : selectedBond.principalToken);
216
225
  provider = new ethers.providers.Web3Provider(window.ethereum);
217
226
  signer = provider.getSigner();
218
- bondContract = new ethers.Contract(bondAddress !== null && bondAddress !== void 0 ? bondAddress : "", BondAbi, signer);
219
- _a.label = 1;
227
+ bondContract = new ethers.Contract((_a = selectedBond === null || selectedBond === void 0 ? void 0 : selectedBond.principalToken) !== null && _a !== void 0 ? _a : "", ERC_20_ABI, signer);
228
+ _b.label = 1;
220
229
  case 1:
221
- _a.trys.push([1, 4, , 5]);
230
+ _b.trys.push([1, 4, , 5]);
222
231
  amount = adjustDecimals(inputValue);
223
232
  return [4 /*yield*/, bondContract.approve(bondAddress, amount)];
224
233
  case 2:
225
- tx = _a.sent();
234
+ tx = _b.sent();
226
235
  return [4 /*yield*/, tx.wait()];
227
236
  case 3:
228
- _a.sent();
237
+ _b.sent();
229
238
  setApprovalStatus(true);
230
239
  alert('Approve Successful');
231
240
  return [3 /*break*/, 5];
232
241
  case 4:
233
- error_2 = _a.sent();
242
+ error_2 = _b.sent();
234
243
  console.error('Approval error', error_2);
235
244
  alert('Approval Failed');
236
245
  return [3 /*break*/, 5];
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Ape Bond SDK",
4
4
  "author": "Ape Bond",
5
5
  "license": "MIT",
6
- "version": "1.0.354",
6
+ "version": "1.0.356",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",
@@ -1,80 +0,0 @@
1
- export declare const BondAbi: ({
2
- anonymous: boolean;
3
- inputs: ({
4
- components: {
5
- internalType: string;
6
- name: string;
7
- type: string;
8
- }[];
9
- indexed: boolean;
10
- internalType: string;
11
- name: string;
12
- type: string;
13
- } | {
14
- indexed: boolean;
15
- internalType: string;
16
- name: string;
17
- type: string;
18
- components?: undefined;
19
- })[];
20
- name: string;
21
- type: string;
22
- outputs?: undefined;
23
- stateMutability?: undefined;
24
- } | {
25
- inputs: {
26
- internalType: string;
27
- name: string;
28
- type: string;
29
- }[];
30
- name: string;
31
- outputs: {
32
- internalType: string;
33
- name: string;
34
- type: string;
35
- }[];
36
- stateMutability: string;
37
- type: string;
38
- anonymous?: undefined;
39
- } | {
40
- inputs: {
41
- internalType: string;
42
- name: string;
43
- type: string;
44
- }[];
45
- name: string;
46
- outputs: {
47
- components: {
48
- internalType: string;
49
- name: string;
50
- type: string;
51
- }[];
52
- internalType: string;
53
- name: string;
54
- type: string;
55
- }[];
56
- stateMutability: string;
57
- type: string;
58
- anonymous?: undefined;
59
- } | {
60
- inputs: ({
61
- internalType: string;
62
- name: string;
63
- type: string;
64
- components?: undefined;
65
- } | {
66
- components: {
67
- internalType: string;
68
- name: string;
69
- type: string;
70
- }[];
71
- internalType: string;
72
- name: string;
73
- type: string;
74
- })[];
75
- name: string;
76
- outputs: never[];
77
- stateMutability: string;
78
- type: string;
79
- anonymous?: undefined;
80
- })[];
package/dist/enum/abis.js DELETED
@@ -1 +0,0 @@
1
- export var BondAbi = [{ "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "billId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "payout", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "remaining", "type": "uint256" }], "name": "BillClaimed", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "deposit", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "payout", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "expires", "type": "uint256" }, { "indexed": true, "internalType": "uint256", "name": "billId", "type": "uint256" }], "name": "BillCreated", "type": "event" }, { "anonymous": false, "inputs": [{ "components": [{ "internalType": "uint256", "name": "controlVariable", "type": "uint256" }, { "internalType": "uint256", "name": "vestingTerm", "type": "uint256" }, { "internalType": "uint256", "name": "minimumPrice", "type": "uint256" }, { "internalType": "uint256", "name": "maxPayout", "type": "uint256" }, { "internalType": "uint256", "name": "maxDebt", "type": "uint256" }, { "internalType": "uint256", "name": "maxTotalPayout", "type": "uint256" }, { "internalType": "uint256", "name": "initialDebt", "type": "uint256" }], "indexed": false, "internalType": "struct ICustomBill.BillTerms", "name": "billTerms", "type": "tuple" }, { "indexed": false, "internalType": "uint256", "name": "lastDecay", "type": "uint256" }], "name": "BillInitialized", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "internalPrice", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "debtRatio", "type": "uint256" }], "name": "BillPriceChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "payoutToken", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amountAdded", "type": "uint256" }], "name": "BillRefilled", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "initialBCV", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "newBCV", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "adjustment", "type": "uint256" }], "name": "ControlVariableAdjustment", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "newFeeTo", "type": "address" }], "name": "FeeToChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" }], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "newMaxTotalPayout", "type": "uint256" }], "name": "MaxTotalPayoutChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }], "name": "OwnershipTransferred", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" }], "name": "RoleAdminChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], "name": "RoleGranted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], "name": "RoleRevoked", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "currentBCV", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "increment", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "targetBCV", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "buffer", "type": "uint256" }], "name": "SetAdjustment", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256[]", "name": "fees", "type": "uint256[]" }, { "indexed": false, "internalType": "uint256[]", "name": "tierCeilings", "type": "uint256[]" }], "name": "SetFees", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "pendingOwner", "type": "address" }], "name": "SetPendingOwner", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "enum CustomBill.PARAMETER", "name": "parameter", "type": "uint8" }, { "indexed": false, "internalType": "uint256", "name": "input", "type": "uint256" }], "name": "TermsSet", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "approvedAccount", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" }], "name": "UpdateClaimApproval", "type": "event" }, { "inputs": [], "name": "DAO", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "DEFAULT_ADMIN_ROLE", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "MAX_FEE", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "REFILL_ROLE", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "adjustment", "outputs": [{ "internalType": "uint256", "name": "rate", "type": "uint256" }, { "internalType": "uint256", "name": "target", "type": "uint256" }, { "internalType": "uint256", "name": "buffer", "type": "uint256" }, { "internalType": "uint256", "name": "lastAdjustmentTimestamp", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "allIssuedBillIds", "outputs": [{ "internalType": "uint256[]", "name": "", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256[]", "name": "_billIds", "type": "uint256[]" }], "name": "batchClaim", "outputs": [{ "internalType": "uint256", "name": "payout", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256[]", "name": "_billIds", "type": "uint256[]" }], "name": "batchRedeem", "outputs": [{ "internalType": "uint256", "name": "payout", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "name": "billInfo", "outputs": [{ "internalType": "uint256", "name": "payout", "type": "uint256" }, { "internalType": "uint256", "name": "payoutClaimed", "type": "uint256" }, { "internalType": "uint256", "name": "vesting", "type": "uint256" }, { "internalType": "uint256", "name": "vestingTerm", "type": "uint256" }, { "internalType": "uint256", "name": "vestingStartTimestamp", "type": "uint256" }, { "internalType": "uint256", "name": "lastClaimTimestamp", "type": "uint256" }, { "internalType": "uint256", "name": "truePricePaid", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "billNft", "outputs": [{ "internalType": "contract IBillNft", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "billPrice", "outputs": [{ "internalType": "uint256", "name": "price_", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_feeTo", "type": "address" }], "name": "changeFeeTo", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_billId", "type": "uint256" }], "name": "claim", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_billId", "type": "uint256" }], "name": "claimablePayout", "outputs": [{ "internalType": "uint256", "name": "claimablePayout_", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "currentDebt", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "currentFee", "outputs": [{ "internalType": "uint256", "name": "currentFee_", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "customTreasury", "outputs": [{ "internalType": "contract ICustomTreasury", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "debtDecay", "outputs": [{ "internalType": "uint256", "name": "decay_", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "debtRatio", "outputs": [{ "internalType": "uint256", "name": "debtRatio_", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_amount", "type": "uint256" }, { "internalType": "uint256", "name": "_maxPrice", "type": "uint256" }, { "internalType": "address", "name": "_depositor", "type": "address" }], "name": "deposit", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "feeInPayout", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "name": "feeTiers", "outputs": [{ "internalType": "uint256", "name": "tierCeilings", "type": "uint256" }, { "internalType": "uint256", "name": "fees", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "feeTo", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "user", "type": "address" }], "name": "getBillIds", "outputs": [{ "internalType": "uint256[]", "name": "", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "uint256", "name": "start", "type": "uint256" }, { "internalType": "uint256", "name": "end", "type": "uint256" }], "name": "getBillIdsInRange", "outputs": [{ "internalType": "uint256[]", "name": "", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "billId", "type": "uint256" }], "name": "getBillInfo", "outputs": [{ "components": [{ "internalType": "uint256", "name": "payout", "type": "uint256" }, { "internalType": "uint256", "name": "payoutClaimed", "type": "uint256" }, { "internalType": "uint256", "name": "vesting", "type": "uint256" }, { "internalType": "uint256", "name": "vestingTerm", "type": "uint256" }, { "internalType": "uint256", "name": "vestingStartTimestamp", "type": "uint256" }, { "internalType": "uint256", "name": "lastClaimTimestamp", "type": "uint256" }, { "internalType": "uint256", "name": "truePricePaid", "type": "uint256" }], "internalType": "struct ICustomBill.Bill", "name": "", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getFeeTierLength", "outputs": [{ "internalType": "uint256", "name": "tierLength_", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getMaxTotalPayout", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], "name": "getRoleAdmin", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "uint256", "name": "index", "type": "uint256" }], "name": "getRoleMember", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], "name": "getRoleMemberCount", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address[]", "name": "_billRefillers", "type": "address[]" }], "name": "grantRefillRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "grantRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "hasRole", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "contract ICustomTreasury", "name": "_customTreasury", "type": "address" }, { "components": [{ "internalType": "address", "name": "payoutToken", "type": "address" }, { "internalType": "address", "name": "principalToken", "type": "address" }, { "internalType": "address", "name": "initialOwner", "type": "address" }, { "internalType": "contract IVestingCurve", "name": "vestingCurve", "type": "address" }, { "internalType": "uint256[]", "name": "tierCeilings", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "fees", "type": "uint256[]" }, { "internalType": "bool", "name": "feeInPayout", "type": "bool" }], "internalType": "struct ICustomBill.BillCreationDetails", "name": "_billCreationDetails", "type": "tuple" }, { "components": [{ "internalType": "uint256", "name": "controlVariable", "type": "uint256" }, { "internalType": "uint256", "name": "vestingTerm", "type": "uint256" }, { "internalType": "uint256", "name": "minimumPrice", "type": "uint256" }, { "internalType": "uint256", "name": "maxPayout", "type": "uint256" }, { "internalType": "uint256", "name": "maxDebt", "type": "uint256" }, { "internalType": "uint256", "name": "maxTotalPayout", "type": "uint256" }, { "internalType": "uint256", "name": "initialDebt", "type": "uint256" }], "internalType": "struct ICustomBill.BillTerms", "name": "_billTerms", "type": "tuple" }, { "components": [{ "internalType": "address", "name": "feeTo", "type": "address" }, { "internalType": "address", "name": "DAO", "type": "address" }, { "internalType": "address", "name": "billNft", "type": "address" }], "internalType": "struct ICustomBill.BillAccounts", "name": "_billAccounts", "type": "tuple" }, { "internalType": "address[]", "name": "_billRefillers", "type": "address[]" }], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "contract ICustomTreasury", "name": "_customTreasury", "type": "address" }, { "components": [{ "internalType": "address", "name": "payoutToken", "type": "address" }, { "internalType": "address", "name": "principalToken", "type": "address" }, { "internalType": "address", "name": "initialOwner", "type": "address" }, { "internalType": "contract IVestingCurve", "name": "vestingCurve", "type": "address" }, { "internalType": "uint256[]", "name": "tierCeilings", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "fees", "type": "uint256[]" }, { "internalType": "bool", "name": "feeInPayout", "type": "bool" }], "internalType": "struct ICustomBill.BillCreationDetails", "name": "_billCreationDetails", "type": "tuple" }, { "components": [{ "internalType": "uint256", "name": "controlVariable", "type": "uint256" }, { "internalType": "uint256", "name": "vestingTerm", "type": "uint256" }, { "internalType": "uint256", "name": "minimumPrice", "type": "uint256" }, { "internalType": "uint256", "name": "maxPayout", "type": "uint256" }, { "internalType": "uint256", "name": "maxDebt", "type": "uint256" }, { "internalType": "uint256", "name": "maxTotalPayout", "type": "uint256" }, { "internalType": "uint256", "name": "initialDebt", "type": "uint256" }], "internalType": "struct ICustomBill.BillTerms", "name": "_billTerms", "type": "tuple" }, { "components": [{ "internalType": "address", "name": "feeTo", "type": "address" }, { "internalType": "address", "name": "DAO", "type": "address" }, { "internalType": "address", "name": "billNft", "type": "address" }], "internalType": "struct ICustomBill.BillAccounts", "name": "_billAccounts", "type": "tuple" }], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "lastDecay", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "maxPayout", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_amount", "type": "uint256" }], "name": "payoutFor", "outputs": [{ "internalType": "uint256", "name": "_payout", "type": "uint256" }, { "internalType": "uint256", "name": "_fee", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "payoutToken", "outputs": [{ "internalType": "contract IERC20MetadataUpgradeable", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "pendingOwner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_billId", "type": "uint256" }], "name": "pendingPayout", "outputs": [{ "internalType": "uint256", "name": "pendingPayout_", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_billId", "type": "uint256" }], "name": "pendingVesting", "outputs": [{ "internalType": "uint256", "name": "pendingVesting_", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "principalToken", "outputs": [{ "internalType": "contract IERC20MetadataUpgradeable", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_billId", "type": "uint256" }], "name": "redeem", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }, { "internalType": "address", "name": "", "type": "address" }], "name": "redeemerApproved", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_refillAmount", "type": "uint256" }], "name": "refillPayoutToken", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "renounceRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address[]", "name": "_billRefillers", "type": "address[]" }], "name": "revokeRefillRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "revokeRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_rate", "type": "uint256" }, { "internalType": "uint256", "name": "_target", "type": "uint256" }, { "internalType": "uint256", "name": "_buffer", "type": "uint256" }], "name": "setAdjustment", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "enum CustomBill.PARAMETER", "name": "_parameter", "type": "uint8" }, { "internalType": "uint256", "name": "_input", "type": "uint256" }], "name": "setBillTerms", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "approvedAccount", "type": "address" }, { "internalType": "bool", "name": "approved", "type": "bool" }], "name": "setClaimApproval", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256[]", "name": "fees", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "tierCeilings", "type": "uint256[]" }], "name": "setFeeTiers", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_maxTotalPayout", "type": "uint256" }], "name": "setMaxTotalPayout", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newPendingOwner", "type": "address" }], "name": "setPendingOwner", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }], "name": "supportsInterface", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "terms", "outputs": [{ "internalType": "uint256", "name": "controlVariable", "type": "uint256" }, { "internalType": "uint256", "name": "vestingTerm", "type": "uint256" }, { "internalType": "uint256", "name": "minimumPrice", "type": "uint256" }, { "internalType": "uint256", "name": "maxPayout", "type": "uint256" }, { "internalType": "uint256", "name": "maxDebt", "type": "uint256" }, { "internalType": "uint256", "name": "maxTotalPayout", "type": "uint256" }, { "internalType": "uint256", "name": "initialDebt", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalDebt", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalPayoutGiven", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalPrincipalBilled", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }], "name": "transferOwnership", "outputs": [], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "trueBillPrice", "outputs": [{ "internalType": "uint256", "name": "price_", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "userBillIds", "outputs": [{ "internalType": "uint256[]", "name": "", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_billId", "type": "uint256" }, { "internalType": "uint256", "name": "_timestamp", "type": "uint256" }], "name": "vestedPayoutAtTime", "outputs": [{ "internalType": "uint256", "name": "vestedPayout_", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "vestingCurve", "outputs": [{ "internalType": "contract IVestingCurve", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_billId", "type": "uint256" }], "name": "vestingPayout", "outputs": [{ "internalType": "uint256", "name": "vestingPayout_", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_billId", "type": "uint256" }], "name": "vestingPeriod", "outputs": [{ "internalType": "uint256", "name": "vestingStart_", "type": "uint256" }, { "internalType": "uint256", "name": "vestingEnd_", "type": "uint256" }], "stateMutability": "view", "type": "function" }];