diff --git a/.github/workflows/format_snapshot.yml b/.github/workflows/format_snapshot.yml index 6cb9e99..d831a11 100644 --- a/.github/workflows/format_snapshot.yml +++ b/.github/workflows/format_snapshot.yml @@ -28,7 +28,7 @@ jobs: run: forge fmt - name: Snapshot - run: forge snapshot --diff --no-match-test /^testFuzz/g + run: forge snapshot --diff --no-match-path *fuzz* - name: Test run: forge test -vvv diff --git a/.github/workflows/lint_test.yml b/.github/workflows/lint_test.yml index f19d03f..49e52a8 100644 --- a/.github/workflows/lint_test.yml +++ b/.github/workflows/lint_test.yml @@ -30,4 +30,4 @@ jobs: run: forge test -vvv - name: Snapshot - run: forge snapshot --diff --no-match-test /^testFuzz/g + run: forge snapshot --diff --no-match-path "*fuzz*" diff --git a/.husky/pre-commit b/.husky/pre-commit index d420e76..6b55f12 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -2,6 +2,6 @@ . "$(dirname -- "$0")/_/husky.sh" forge fmt --check -forge snapshot --diff --no-match-test /^testFuzz/g +forge snapshot --diff --no-match-path "*fuzz*" git add .gas-snapshot diff --git a/README.md b/README.md index 8678fb0..4ebe6a2 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ ## ๐Ÿ’ซ Astaria v1 Core + +### License + +[BUSL-1.1](LICENSE) Copyright 2023 Astaria Labs, Inc. diff --git a/package.json b/package.json index 46ccf4a..72f2118 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,6 @@ }, "scripts": { "prepare": "husky install", - "snapshot": "forge snapshot --diff --no-match-test /^testFuzz/g" + "snapshot": "forge snapshot --diff --no-match-path *fuzz*" } } diff --git a/src/enforcers/AstariaV1BorrowerEnforcer.sol b/src/enforcers/AstariaV1BorrowerEnforcer.sol index 9bbe8ac..0e17320 100644 --- a/src/enforcers/AstariaV1BorrowerEnforcer.sol +++ b/src/enforcers/AstariaV1BorrowerEnforcer.sol @@ -1,5 +1,14 @@ -// SPDX-License-Identifier: BUSL-1.1 -// Copyright (c) 2023 Astaria Labs +// SPDX-License-Identifier: BUSL-1.1 +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ• +// +// Astaria v1 Lending +// Built on Starport https://github.com/astariaXYZ/starport +// Designed with love by Astaria Labs, Inc pragma solidity ^0.8.17; @@ -11,9 +20,17 @@ import {AdditionalTransfer} from "starport-core/lib/StarportLib.sol"; import {AstariaV1Lib} from "v1-core/lib/AstariaV1Lib.sol"; contract AstariaV1BorrowerEnforcer is BorrowerEnforcer { - error LoanRateExceedsCurrentRate(); - error LoanAmountOutOfBounds(); + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* CUSTOM ERRORS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + error DebtBundlesNotSupported(); + error LoanAmountOutOfBounds(); + error LoanRateExceedsCurrentRate(); + + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* STRUCTS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ struct V1BorrowerDetails { uint256 startBlock; @@ -24,6 +41,20 @@ contract AstariaV1BorrowerEnforcer is BorrowerEnforcer { BorrowerEnforcer.Details details; } + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* EXTERNAL FUNCTIONS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + + /// @notice Calculates the current maximum valid rate of a caveat + function locateCurrentRate(bytes calldata caveatData) external view returns (uint256 currentRate) { + V1BorrowerDetails memory v1Details = abi.decode(caveatData, (V1BorrowerDetails)); + return _locateCurrentRate(v1Details); + } + + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* PUBLIC FUNCTIONS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + /// @notice Validates a loan against a caveat, w/ an inclining rate auction, and a min/max amount /// @dev Bundle support is not implemented, and will revert /// @dev The rate in pricing is the endRate. @@ -71,11 +102,9 @@ contract AstariaV1BorrowerEnforcer is BorrowerEnforcer { _validate(additionalTransfers, loan, v1Details.details); } - /// @notice Calculates the current maximum valid rate of a caveat - function locateCurrentRate(bytes calldata caveatData) external view returns (uint256 currentRate) { - V1BorrowerDetails memory v1Details = abi.decode(caveatData, (V1BorrowerDetails)); - return _locateCurrentRate(v1Details); - } + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* INTERNAL FUNCTIONS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ function _locateCurrentRate(V1BorrowerDetails memory v1Details) internal view returns (uint256 currentRate) { uint256 endRate = AstariaV1Lib.getBasePricingRate(v1Details.details.loan.terms.pricingData); diff --git a/src/enforcers/AstariaV1LenderEnforcer.sol b/src/enforcers/AstariaV1LenderEnforcer.sol index b7e51c1..f2f4038 100644 --- a/src/enforcers/AstariaV1LenderEnforcer.sol +++ b/src/enforcers/AstariaV1LenderEnforcer.sol @@ -1,5 +1,14 @@ -// SPDX-License-Identifier: BUSL-1.1 -// Copyright (c) 2023 Astaria Labs +// SPDX-License-Identifier: BUSL-1.1 +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ• +// +// Astaria v1 Lending +// Built on Starport https://github.com/astariaXYZ/starport +// Designed with love by Astaria Labs, Inc pragma solidity ^0.8.17; @@ -13,17 +22,33 @@ import {AstariaV1Lib} from "v1-core/lib/AstariaV1Lib.sol"; import {SpentItem} from "seaport-types/src/lib/ConsiderationStructs.sol"; contract AstariaV1LenderEnforcer is LenderEnforcer { - uint256 constant MAX_DURATION = uint256(3 * 365 * 1 days); // 3 years + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* CUSTOM ERRORS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ error LoanAmountExceedsCaveatAmount(); error LoanRateLessThanCaveatRate(); error DebtBundlesNotSupported(); + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* CONSTANTS AND IMMUTABLES */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + + uint256 constant MAX_DURATION = uint256(3 * 365 * 1 days); // 3 years + + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* STRUCTS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + struct V1LenderDetails { bool matchIdentifier; LenderEnforcer.Details details; } + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* PUBLIC FUNCTIONS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + /// @notice Validates a loan against a caveat, w/ a minimum rate and a maximum amount /// @dev Bundle support is not implemented, and will revert /// @dev matchIdentifier = false will allow the loan to have a different identifier than the caveat diff --git a/src/lib/AstariaV1Lib.sol b/src/lib/AstariaV1Lib.sol index b1743bf..b49ba83 100644 --- a/src/lib/AstariaV1Lib.sol +++ b/src/lib/AstariaV1Lib.sol @@ -1,5 +1,14 @@ -// SPDX-License-Identifier: BUSL-1.1 -// Copyright (c) 2023 Astaria Labs +// SPDX-License-Identifier: BUSL-1.1 +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ• +// +// Astaria v1 Lending +// Built on Starport https://github.com/astariaXYZ/starport +// Designed with love by Astaria Labs, Inc pragma solidity ^0.8.17; @@ -16,35 +25,67 @@ library AstariaV1Lib { using FixedPointMathLib for uint256; using FixedPointMathLib for int256; + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* CONSTANTS AND IMMUTABLES */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + uint256 constant WAD = 18; uint256 constant MAX_DURATION = uint256(3 * 365 * 1 days); // 3 years + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* CUSTOM ERRORS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + error InterestAccrualRoundingMinimum(); error UnsupportedDecimalValue(); error RateExceedMaxRecallRate(); + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* PUBLIC FUNCTIONS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + + function calculateCompoundInterest(uint256 delta_t, uint256 amount, uint256 rate, uint256 decimals) + public + pure + returns (uint256) + { + if (decimals < WAD) { + uint256 baseAdjustment = 10 ** (WAD - decimals); + int256 exponent = int256((rate * baseAdjustment * delta_t) / 365 days); + amount *= baseAdjustment; + uint256 result = amount.mulWad(uint256(exponent.expWad())) - amount; + return result /= baseAdjustment; + } + int256 exponent = int256((rate * delta_t) / 365 days); + return amount.mulWad(uint256(exponent.expWad())) - amount; + } + + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* INTERNAL FUNCTIONS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + function validateCompoundInterest(uint256 amount, uint256 rate, uint256 recallMax, uint256 decimals) internal pure { - // rate should never exceed the recallMax rate + // Rate should never exceed the recallMax rate if (rate > recallMax) { revert RateExceedMaxRecallRate(); } - // only decimal values of 1-18 are supported + // Only decimal values of 1-18 are supported if (decimals > 18 || decimals == 0) { revert UnsupportedDecimalValue(); } - // check to validate that the MAX_DURATION does not overflow interest calculation - // creates a maximum safe duration for a loan, loans can go beyond MAX_DURATION with undefined behavior + // Check to validate that the MAX_DURATION does not overflow interest calculation + // Creates a maximum safe duration for a loan, loans can go beyond MAX_DURATION with undefined behavior calculateCompoundInterest(MAX_DURATION, amount, recallMax, decimals); - // calculate interest for 1 second of time - // loan must produce 1 wei of interest per 1 second of time + // Calculate interest for 1 second of time + // Loan must produce 1 wei of interest per 1 second of time if (calculateCompoundInterest(1, amount, rate, decimals) == 0) { - // interest does not accrue at least 1 wei per second + // Interest does not accrue at least 1 wei per second revert InterestAccrualRoundingMinimum(); } } @@ -72,20 +113,4 @@ library AstariaV1Lib { mstore(add(0x20, pricingData), newRate) } } - - function calculateCompoundInterest(uint256 delta_t, uint256 amount, uint256 rate, uint256 decimals) - public - pure - returns (uint256) - { - if (decimals < WAD) { - uint256 baseAdjustment = 10 ** (WAD - decimals); - int256 exponent = int256((rate * baseAdjustment * delta_t) / 365 days); - amount *= baseAdjustment; - uint256 result = amount.mulWad(uint256(exponent.expWad())) - amount; - return result /= baseAdjustment; - } - int256 exponent = int256((rate * delta_t) / 365 days); - return amount.mulWad(uint256(exponent.expWad())) - amount; - } } diff --git a/src/pricing/AstariaV1Pricing.sol b/src/pricing/AstariaV1Pricing.sol index 5e0378d..dcbf0c7 100644 --- a/src/pricing/AstariaV1Pricing.sol +++ b/src/pricing/AstariaV1Pricing.sol @@ -1,5 +1,14 @@ -// SPDX-License-Identifier: BUSL-1.1 -// Copyright (c) 2023 Astaria Labs +// SPDX-License-Identifier: BUSL-1.1 +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ• +// +// Astaria v1 Lending +// Built on Starport https://github.com/astariaXYZ/starport +// Designed with love by Astaria Labs, Inc pragma solidity ^0.8.17; @@ -21,10 +30,22 @@ contract AstariaV1Pricing is CompoundInterestPricing { using FixedPointMathLib for uint256; using {StarportLib.getId} for Starport.Loan; - constructor(Starport SP_) Pricing(SP_) {} + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* CUSTOM ERRORS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ error InsufficientRefinance(); + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* CONSTRUCTOR */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + + constructor(Starport SP_) Pricing(SP_) {} + + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* EXTERNAL FUNCTIONS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + // @inheritdoc Pricing function getRefinanceConsideration(Starport.Loan calldata loan, bytes calldata newPricingData, address fulfiller) external @@ -37,9 +58,9 @@ contract AstariaV1Pricing is CompoundInterestPricing { AdditionalTransfer[] memory recallConsideration ) { - // borrowers can refinance a loan at any time + // Borrowers can refinance a loan at any time if (fulfiller != loan.borrower) { - // check if a recall is occuring + // Check if a recall is occuring AstariaV1Status status = AstariaV1Status(loan.terms.status); Details memory newDetails = abi.decode(newPricingData, (Details)); @@ -48,7 +69,7 @@ contract AstariaV1Pricing is CompoundInterestPricing { revert InvalidRefinance(); } uint256 rate = status.getRecallRate(loan); - // offered loan did not meet the terms of the recall auction + // Offered loan did not meet the terms of the recall auction if (newDetails.rate > rate) { revert InsufficientRefinance(); } @@ -56,15 +77,15 @@ contract AstariaV1Pricing is CompoundInterestPricing { uint256 proportion; address payable receiver = payable(loan.issuer); uint256 loanId = loan.getId(); - // scenario where the recaller is not penalized - // recaller stake is refunded + // Scenario where the recaller is not penalized + // Recaller stake is refunded if (newDetails.rate > oldDetails.rate) { proportion = 0; (receiver,) = status.recalls(loanId); } else { - // scenario where the recaller is penalized - // essentially the old lender and the new lender split the stake of the recaller - // split is proportional to the difference in rate + // Scenario where the recaller is penalized + // Essentially the old lender and the new lender split the stake of the recaller + // Split is proportional to the difference in rate proportion = (oldDetails.rate - newDetails.rate).divWad(oldDetails.rate); } recallConsideration = status.generateRecallConsideration(loan, proportion, fulfiller, receiver); diff --git a/src/pricing/BaseRecallPricing.sol b/src/pricing/BaseRecallPricing.sol index e667388..53fdd24 100644 --- a/src/pricing/BaseRecallPricing.sol +++ b/src/pricing/BaseRecallPricing.sol @@ -1,5 +1,14 @@ -// SPDX-License-Identifier: BUSL-1.1 -// Copyright (c) 2023 Astaria Labs +// SPDX-License-Identifier: BUSL-1.1 +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ• +// +// Astaria v1 Lending +// Built on Starport https://github.com/astariaXYZ/starport +// Designed with love by Astaria Labs, Inc pragma solidity ^0.8.17; @@ -13,6 +22,10 @@ import {SpentItem} from "seaport-types/src/lib/ConsiderationStructs.sol"; import {FixedPointMathLib} from "solady/src/utils/FixedPointMathLib.sol"; abstract contract BaseRecallPricing is BasePricing { + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* EXTERNAL FUNCTIONS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + // @inheritdoc Pricing function getRefinanceConsideration(Starport.Loan calldata loan, bytes memory newPricingData, address fulfiller) external diff --git a/src/pricing/CompoundInterestPricing.sol b/src/pricing/CompoundInterestPricing.sol index 1bd4e7b..0f55921 100644 --- a/src/pricing/CompoundInterestPricing.sol +++ b/src/pricing/CompoundInterestPricing.sol @@ -1,5 +1,14 @@ -// SPDX-License-Identifier: BUSL-1.1 -// Copyright (c) 2023 Astaria Labs +// SPDX-License-Identifier: BUSL-1.1 +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ• +// +// Astaria v1 Lending +// Built on Starport https://github.com/astariaXYZ/starport +// Designed with love by Astaria Labs, Inc pragma solidity ^0.8.17; @@ -9,6 +18,10 @@ import {BaseRecallPricing} from "v1-core/pricing/BaseRecallPricing.sol"; import {AstariaV1Lib} from "v1-core/lib/AstariaV1Lib.sol"; abstract contract CompoundInterestPricing is BaseRecallPricing { + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* PUBLIC FUNCTIONS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + // @inheritdoc BasePricing function calculateInterest(uint256 delta_t, uint256 amount, uint256 rate, uint256 decimals) public diff --git a/src/settlement/AstariaV1Settlement.sol b/src/settlement/AstariaV1Settlement.sol index 11639ba..7210a87 100644 --- a/src/settlement/AstariaV1Settlement.sol +++ b/src/settlement/AstariaV1Settlement.sol @@ -1,5 +1,14 @@ -// SPDX-License-Identifier: BUSL-1.1 -// Copyright (c) 2023 Astaria Labs +// SPDX-License-Identifier: BUSL-1.1 +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ• +// +// Astaria v1 Lending +// Built on Starport https://github.com/astariaXYZ/starport +// Designed with love by Astaria Labs, Inc pragma solidity ^0.8.17; @@ -19,17 +28,29 @@ contract AstariaV1Settlement is DutchAuctionSettlement { using {StarportLib.getId} for Starport.Loan; using FixedPointMathLib for uint256; - constructor(Starport SP_) DutchAuctionSettlement(SP_) {} + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* CUSTOM ERRORS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ - error NoAuction(); - error LoanNotRecalled(); error ExecuteHandlerNotImplemented(); error InvalidHandler(); + error LoanNotRecalled(); + error NoAuction(); + + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* CONSTRUCTOR */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + + constructor(Starport SP_) DutchAuctionSettlement(SP_) {} + + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* PUBLIC FUNCTIONS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ /** * @dev retrieve the current auction price - * @param loan The loan in question - * @return uint256 The current auction price + * @param loan The loan in question + * @return uint256 The current auction price */ function getCurrentAuctionPrice(Starport.Loan calldata loan) public view virtual returns (uint256) { (address recaller, uint64 recallStart) = BaseRecall(loan.terms.status).recalls(loan.getId()); @@ -60,6 +81,10 @@ contract AstariaV1Settlement is DutchAuctionSettlement { return start + recallWindow + 1; } + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* INTERNAL FUNCTIONS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + /* @dev internal helper to get the auction start to save double decoding * @param loan The loan in question * @return uint256 The start of the auction @@ -69,6 +94,34 @@ contract AstariaV1Settlement is DutchAuctionSettlement { return start + recallWindow + 1; } + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* EXTERNAL FUNCTIONS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + + // @inheritdoc Settlement + function postSettlement(Starport.Loan calldata loan, address) external virtual override returns (bytes4) { + (address recaller,) = BaseRecall(loan.terms.status).recalls(loan.getId()); + _executeWithdraw(loan, recaller); + return Settlement.postSettlement.selector; + } + + // @inheritdoc Settlement + function postRepayment(Starport.Loan calldata loan, address fulfiller) external virtual override returns (bytes4) { + _executeWithdraw(loan, fulfiller); + + return Settlement.postRepayment.selector; + } + + // @inheritdoc Validation + function validate(Starport.Loan calldata loan) external view virtual override returns (bytes4) { + Details memory details = abi.decode(loan.terms.settlementData, (Details)); // Will revert if this fails + return (details.startingPrice > details.endingPrice) ? Validation.validate.selector : bytes4(0xFFFFFFFF); + } + + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* PUBLIC FUNCTIONS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + // @inheritdoc Settlement function getSettlementConsideration(Starport.Loan calldata loan) public @@ -170,27 +223,11 @@ contract AstariaV1Settlement is DutchAuctionSettlement { } } - // @inheritdoc Settlement - function postSettlement(Starport.Loan calldata loan, address) external virtual override returns (bytes4) { - (address recaller,) = BaseRecall(loan.terms.status).recalls(loan.getId()); - _executeWithdraw(loan, recaller); - return Settlement.postSettlement.selector; - } - - // @inheritdoc Settlement - function postRepayment(Starport.Loan calldata loan, address fulfiller) external virtual override returns (bytes4) { - _executeWithdraw(loan, fulfiller); - - return Settlement.postRepayment.selector; - } + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* INTERNAL FUNCTIONS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ function _executeWithdraw(Starport.Loan calldata loan, address fulfiller) internal { loan.terms.status.call(abi.encodeWithSelector(BaseRecall.withdraw.selector, loan, fulfiller)); } - - // @inheritdoc Validation - function validate(Starport.Loan calldata loan) external view virtual override returns (bytes4) { - Details memory details = abi.decode(loan.terms.settlementData, (Details)); // Will revert if this fails - return (details.startingPrice > details.endingPrice) ? Validation.validate.selector : bytes4(0xFFFFFFFF); - } } diff --git a/src/status/AstariaV1Status.sol b/src/status/AstariaV1Status.sol index 9ee45a3..7d53f12 100644 --- a/src/status/AstariaV1Status.sol +++ b/src/status/AstariaV1Status.sol @@ -1,5 +1,14 @@ -// SPDX-License-Identifier: BUSL-1.1 -// Copyright (c) 2023 Astaria Labs +// SPDX-License-Identifier: BUSL-1.1 +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ• +// +// Astaria v1 Lending +// Built on Starport https://github.com/astariaXYZ/starport +// Designed with love by Astaria Labs, Inc pragma solidity ^0.8.17; @@ -14,8 +23,16 @@ import {BaseStatus} from "v1-core/status/BaseStatus.sol"; contract AstariaV1Status is BaseStatus, BaseRecall { using {StarportLib.getId} for Starport.Loan; + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* CONSTRUCTOR */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + constructor(Starport SP_) BaseRecall(SP_) {} + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* EXTERNAL FUNCTIONS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + // @inheritdoc Status function isActive(Starport.Loan calldata loan, bytes calldata) external view override returns (bool) { Details memory details = abi.decode(loan.terms.statusData, (Details)); diff --git a/src/status/BaseRecall.sol b/src/status/BaseRecall.sol index c91c357..fc24eaf 100644 --- a/src/status/BaseRecall.sol +++ b/src/status/BaseRecall.sol @@ -1,5 +1,14 @@ -// SPDX-License-Identifier: BUSL-1.1 -// Copyright (c) 2023 Astaria Labs +// SPDX-License-Identifier: BUSL-1.1 +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ• +// +// Astaria v1 Lending +// Built on Starport https://github.com/astariaXYZ/starport +// Designed with love by Astaria Labs, Inc pragma solidity ^0.8.17; @@ -17,22 +26,42 @@ abstract contract BaseRecall { using FixedPointMathLib for uint256; using {StarportLib.getId} for Starport.Loan; + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* EVENTS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + event Recalled(uint256 loandId, address recaller, uint256 end); event Withdraw(uint256 loanId, address withdrawer); + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* CONSTANTS AND IMMUTABLES */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + Starport public immutable SP; - error InvalidWithdraw(); + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* STORAGE */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + + mapping(uint256 => Recall) public recalls; + + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* CUSTOM ERRORS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + error AdditionalTransferError(); + error InvalidItemType(); error InvalidStakeType(); + error InvalidWithdraw(); error LoanDoesNotExist(); - error RecallBeforeHoneymoonExpiry(); error LoanHasNotBeenRefinanced(); - error WithdrawDoesNotExist(); - error InvalidItemType(); error RecallAlreadyExists(); + error RecallBeforeHoneymoonExpiry(); + error WithdrawDoesNotExist(); - mapping(uint256 => Recall) public recalls; + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* STRUCTS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ struct Details { // Period at the begininng of a loan in which the loan cannot be recalled @@ -52,10 +81,18 @@ abstract contract BaseRecall { uint64 start; } + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* CONSTRUCTOR */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + constructor(Starport SP_) { SP = SP_; } + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* EXTERNAL FUNCTIONS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + /** * @dev Gets the recall rate for a loan * @param loan The loan to get the recall rate for @@ -137,25 +174,6 @@ abstract contract BaseRecall { emit Withdraw(loanId, receiver); } - /** - * @dev Withdraws the recall stake from the contract - * @param transfers The transfers to make - */ - function _withdrawRecallStake(AdditionalTransfer[] memory transfers) internal { - uint256 i = 0; - for (i; i < transfers.length;) { - AdditionalTransfer memory transfer = transfers[i]; - if (transfer.itemType != ItemType.ERC20) { - revert InvalidItemType(); - } - ERC20(transfer.token).transfer(transfer.to, transfer.amount); - - unchecked { - ++i; - } - } - } - /** * @dev Generates the consideration for a recall * @param loan The loan to generate the consideration for @@ -213,4 +231,27 @@ abstract contract BaseRecall { additionalTransfers = new AdditionalTransfer[](0); } } + + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* INTERNAL FUNCTIONS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + + /** + * @dev Withdraws the recall stake from the contract + * @param transfers The transfers to make + */ + function _withdrawRecallStake(AdditionalTransfer[] memory transfers) internal { + uint256 i = 0; + for (i; i < transfers.length;) { + AdditionalTransfer memory transfer = transfers[i]; + if (transfer.itemType != ItemType.ERC20) { + revert InvalidItemType(); + } + ERC20(transfer.token).transfer(transfer.to, transfer.amount); + + unchecked { + ++i; + } + } + } } diff --git a/src/status/BaseStatus.sol b/src/status/BaseStatus.sol index b9472a6..03b88d1 100644 --- a/src/status/BaseStatus.sol +++ b/src/status/BaseStatus.sol @@ -1,5 +1,14 @@ -// SPDX-License-Identifier: BUSL-1.1 -// Copyright (c) 2023 Astaria Labs +// SPDX-License-Identifier: BUSL-1.1 +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ• +// +// Astaria v1 Lending +// Built on Starport https://github.com/astariaXYZ/starport +// Designed with love by Astaria Labs, Inc pragma solidity ^0.8.17; @@ -7,6 +16,10 @@ import {Starport} from "starport-core/Starport.sol"; import {Status} from "starport-core/status/Status.sol"; abstract contract BaseStatus is Status { + /*ยด:ยฐโ€ข.ยฐ+.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐโ€ข.*โ€ขยด.*:หš.ยฐ*.หšโ€ขยด.ยฐ:ยฐโ€ข.ยฐ+.*โ€ขยด.*:*/ + /* EXTERNAL FUNCTIONS */ + /*.โ€ขยฐ:ยฐ.ยด+หš.*ยฐ.หš:*.ยดโ€ข*.+ยฐ.โ€ขยฐ:ยด*.ยดโ€ข*.โ€ขยฐ.โ€ขยฐ:ยฐ.ยด:โ€ขหšยฐ.*ยฐ.หš:*.ยด+ยฐ.โ€ข*/ + /* * @dev Returns true if the loan is still active, false otherwise. * @param loan The loan to check. diff --git a/test/AstariaV1Test.sol b/test/AstariaV1Test.sol index 940ae51..02e6fc0 100644 --- a/test/AstariaV1Test.sol +++ b/test/AstariaV1Test.sol @@ -1,5 +1,14 @@ -// SPDX-License-Identifier: BUSL-1.1 -// Copyright (c) 2023 Astaria Labs +// SPDX-License-Identifier: BUSL-1.1 +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ• +// +// Astaria v1 Lending +// Built on Starport https://github.com/astariaXYZ/starport +// Designed with love by Astaria Labs, Inc pragma solidity ^0.8.17; diff --git a/test/TestAstariaV1Loan.sol b/test/TestAstariaV1Loan.sol index b589500..d990405 100644 --- a/test/TestAstariaV1Loan.sol +++ b/test/TestAstariaV1Loan.sol @@ -1,5 +1,14 @@ -// SPDX-License-Identifier: BUSL-1.1 -// Copyright (c) 2023 Astaria Labs +// SPDX-License-Identifier: BUSL-1.1 +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ• +// +// Astaria v1 Lending +// Built on Starport https://github.com/astariaXYZ/starport +// Designed with love by Astaria Labs, Inc pragma solidity ^0.8.17; diff --git a/test/TestCompoundInterest.sol b/test/TestCompoundInterest.sol index 1f19e75..a661176 100644 --- a/test/TestCompoundInterest.sol +++ b/test/TestCompoundInterest.sol @@ -1,5 +1,14 @@ -// SPDX-License-Identifier: BUSL-1.1 -// Copyright (c) 2023 Astaria Labs +// SPDX-License-Identifier: BUSL-1.1 +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ• +// +// Astaria v1 Lending +// Built on Starport https://github.com/astariaXYZ/starport +// Designed with love by Astaria Labs, Inc pragma solidity ^0.8.17; diff --git a/test/TestV1BorrowerEnforcer.sol b/test/TestV1BorrowerEnforcer.sol index d39c10c..deccb26 100644 --- a/test/TestV1BorrowerEnforcer.sol +++ b/test/TestV1BorrowerEnforcer.sol @@ -1,5 +1,14 @@ -// SPDX-License-Identifier: BUSL-1.1 -// Copyright (c) 2023 Astaria Labs +// SPDX-License-Identifier: BUSL-1.1 +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ• +// +// Astaria v1 Lending +// Built on Starport https://github.com/astariaXYZ/starport +// Designed with love by Astaria Labs, Inc pragma solidity ^0.8.17; diff --git a/test/TestV1LenderEnforcer.sol b/test/TestV1LenderEnforcer.sol index 14109db..cd2cb36 100644 --- a/test/TestV1LenderEnforcer.sol +++ b/test/TestV1LenderEnforcer.sol @@ -1,5 +1,14 @@ -// SPDX-License-Identifier: BUSL-1.1 -// Copyright (c) 2023 Astaria Labs +// SPDX-License-Identifier: BUSL-1.1 +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ• +// +// Astaria v1 Lending +// Built on Starport https://github.com/astariaXYZ/starport +// Designed with love by Astaria Labs, Inc pragma solidity ^0.8.17; diff --git a/test/TestV1Pricing.sol b/test/TestV1Pricing.sol index 410562d..4b7c9d0 100644 --- a/test/TestV1Pricing.sol +++ b/test/TestV1Pricing.sol @@ -1,5 +1,14 @@ -// SPDX-License-Identifier: BUSL-1.1 -// Copyright (c) 2023 Astaria Labs +// SPDX-License-Identifier: BUSL-1.1 +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ• +// +// Astaria v1 Lending +// Built on Starport https://github.com/astariaXYZ/starport +// Designed with love by Astaria Labs, Inc pragma solidity ^0.8.17; diff --git a/test/TestV1Settlement.sol b/test/TestV1Settlement.sol index 80ba532..de835e8 100644 --- a/test/TestV1Settlement.sol +++ b/test/TestV1Settlement.sol @@ -1,5 +1,14 @@ -// SPDX-License-Identifier: BUSL-1.1 -// Copyright (c) 2023 Astaria Labs +// SPDX-License-Identifier: BUSL-1.1 +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ• +// +// Astaria v1 Lending +// Built on Starport https://github.com/astariaXYZ/starport +// Designed with love by Astaria Labs, Inc pragma solidity ^0.8.17; diff --git a/test/TestV1Status.sol b/test/TestV1Status.sol index 0063bd5..75f4e48 100644 --- a/test/TestV1Status.sol +++ b/test/TestV1Status.sol @@ -1,5 +1,14 @@ -// SPDX-License-Identifier: BUSL-1.1 -// Copyright (c) 2023 Astaria Labs +// SPDX-License-Identifier: BUSL-1.1 +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ +// โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ• +// +// Astaria v1 Lending +// Built on Starport https://github.com/astariaXYZ/starport +// Designed with love by Astaria Labs, Inc pragma solidity ^0.8.17; diff --git a/yarn.lock b/yarn.lock index 4ba8287..3761aa0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,7 +2,7 @@ # yarn lockfile v1 -husky@^8.0.3: +husky@^8.0.0: version "8.0.3" resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184" integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==