Skip to content

Instantly share code, notes, and snippets.

@blakewest
Created May 20, 2024 21:00
Show Gist options
  • Save blakewest/0fbc666446183629992fa50141ef4ccb to your computer and use it in GitHub Desktop.
Save blakewest/0fbc666446183629992fa50141ef4ccb to your computer and use it in GitHub Desktop.
[
{
"inputs": [
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "cumulativeInterestOwed",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "cumulativePrincipalOwed",
"type": "uint256"
}
],
"name": "CannotDeleteLockedSnapshot",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
}
],
"name": "CumulativeInterestUndefinedAt",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "msgSender",
"type": "address"
}
],
"name": "DoesNotHaveUID",
"type": "error"
},
{
"inputs": [],
"name": "EmptySnapshots",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "interestPayment",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "principalPayment",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "unpaidInterestOwed",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "unpaidPrincipalOwed",
"type": "uint256"
}
],
"name": "ExcessivePayment",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "withdrawer",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "NotAuthorizedToWithdraw",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "latestTimestamp",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "latestCumulativeInterestOwed",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "latestCumulativePrincipalOwed",
"type": "uint256"
}
],
"name": "OutOfOrderAccountingSnapshot",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
}
],
"name": "PastTimestamp",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "interestPayment",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "principalPayment",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "unpaidInterestOwed",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "unpaidPrincipalOwed",
"type": "uint256"
}
],
"name": "PaymentWaterfallNotRespected",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "associatedLoan",
"type": "address"
},
{
"internalType": "uint256",
"name": "poolTokenId",
"type": "uint256"
}
],
"name": "PoolTokenDoesNotBelongToLoan",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "excessivePrincipalOwed",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "totalPrincipalDeposited",
"type": "uint256"
}
],
"name": "PrincipalOwedCannotExceedDeposit",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "SnapshotIndexOutOfBounds",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
}
],
"name": "TimestampBeforeFirstSnapshot",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "ZeroWithdrawableAmount",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "cumulativeInterestOwed",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "cumulativePrincipalOwed",
"type": "uint256"
}
],
"name": "AccountingSnapshotPopped",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "cumulativeInterestOwed",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "cumulativePrincipalOwed",
"type": "uint256"
}
],
"name": "AccountingSnapshotPushed",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint8",
"name": "version",
"type": "uint8"
}
],
"name": "Initialized",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "payer",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "interest",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "principal",
"type": "uint256"
}
],
"name": "PaymentMade",
"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": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "interest",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "principal",
"type": "uint256"
}
],
"name": "WithdrawalMade",
"type": "event"
},
{
"inputs": [],
"name": "DEFAULT_ADMIN_ROLE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "contract IPauser",
"name": "pauser",
"type": "address"
}
],
"name": "__BaseUpgradeablePausable__init",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "allowedUIDTypes",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "poolToken",
"type": "uint256"
}
],
"name": "availableToWithdraw",
"outputs": [
{
"internalType": "uint256",
"name": "interest",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "principal",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "config",
"outputs": [
{
"internalType": "contract IGoldfinchConfig",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "cumulativeInterestOwed",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
}
],
"name": "cumulativeInterestOwedAt",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "cumulativePrincipalOwed",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
}
],
"name": "cumulativePrincipalOwedAt",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
}
],
"name": "findSnapshotIndexBefore",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "getAccountingSnapshot",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "cumulativeInterestOwed",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "cumulativePrincipalOwed",
"type": "uint256"
}
],
"internalType": "struct SimpleLoan.AccountingSnapshot",
"name": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getMostRecentSnapshotTimestamp",
"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": "address",
"name": "account",
"type": "address"
}
],
"name": "grantRole",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
}
],
"name": "hasAllowedUID",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"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 IGoldfinchConfig",
"name": "_config",
"type": "address"
},
{
"internalType": "address",
"name": "_contractOwner",
"type": "address"
},
{
"internalType": "uint256[]",
"name": "_allowedUIDTypes",
"type": "uint256[]"
},
{
"internalType": "address",
"name": "_lender",
"type": "address"
},
{
"internalType": "uint256",
"name": "_totalPrincipalDeposited",
"type": "uint256"
}
],
"name": "initialize",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
}
],
"name": "interpolatedCumulativeInterestAt",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "isAdmin",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
}
],
"name": "isSnapshotLockedAtTimestamp",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "numSnapshots",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "paused",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "interestPayment",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "principalPayment",
"type": "uint256"
}
],
"name": "pay",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "peekAccountingSnapshot",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "cumulativeInterestOwed",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "cumulativePrincipalOwed",
"type": "uint256"
}
],
"internalType": "struct SimpleLoan.AccountingSnapshot",
"name": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "popAccountingSnapshot",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_cumulativeInterestOwed",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_cumulativePrincipalOwed",
"type": "uint256"
}
],
"name": "pushAccountingSnapshot",
"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": "bytes32",
"name": "role",
"type": "bytes32"
},
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "revokeRole",
"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": "totalInterestPaid",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalPrincipalDeposited",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalPrincipalPaid",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "unpaidInterestOwed",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
}
],
"name": "unpaidInterestOwedAt",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "unpaidPrincipalOwed",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
}
],
"name": "unpaidPrincipalOwedAt",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "poolTokenId",
"type": "uint256"
}
],
"name": "withdrawMax",
"outputs": [
{
"internalType": "uint256",
"name": "interest",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "principal",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment