Skip to content

Commit 58bf4dc

Browse files
committed
Update version to 0.1.40 and add new IFAsset interface. Modify RedeemRequested event in IInstructionsFacet and IPersonalAccount to include date parameters.
1 parent 85f03c4 commit 58bf4dc

File tree

8 files changed

+160
-27
lines changed

8 files changed

+160
-27
lines changed

foundry.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "flare-periphery"
3-
version = "0.1.39"
3+
version = "0.1.40"
44

55
[profile.default]
66
src = "src"

src/coston/IFAsset.sol

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity >=0.7.6 <0.9;
3+
4+
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
5+
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
6+
7+
8+
interface IFAsset is IERC20, IERC20Metadata {
9+
////////////////////////////////////////////////////////////////////////////////////
10+
// System information
11+
12+
/**
13+
* The name of the underlying asset.
14+
*/
15+
function assetName() external view returns (string memory);
16+
17+
/**
18+
* The symbol of the underlying asset.
19+
*/
20+
function assetSymbol() external view returns (string memory);
21+
22+
/**
23+
* Get the asset manager, corresponding to this fAsset.
24+
* fAssets and asset managers are in 1:1 correspondence.
25+
*/
26+
function assetManager() external view returns (address);
27+
}

src/coston2/IFAsset.sol

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity >=0.7.6 <0.9;
3+
4+
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
5+
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
6+
7+
8+
interface IFAsset is IERC20, IERC20Metadata {
9+
////////////////////////////////////////////////////////////////////////////////////
10+
// System information
11+
12+
/**
13+
* The name of the underlying asset.
14+
*/
15+
function assetName() external view returns (string memory);
16+
17+
/**
18+
* The symbol of the underlying asset.
19+
*/
20+
function assetSymbol() external view returns (string memory);
21+
22+
/**
23+
* Get the asset manager, corresponding to this fAsset.
24+
* fAssets and asset managers are in 1:1 correspondence.
25+
*/
26+
function assetManager() external view returns (address);
27+
}

src/coston2/IInstructionsFacet.sol

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,19 @@ interface IInstructionsFacet {
138138
* @param personalAccount The personal account address.
139139
* @param vault The vault address.
140140
* @param shares The number of shares to redeem.
141-
* @param amount The amount to redeem.
142141
* @param claimableEpoch The epoch when the claim becomes available.
142+
* @param year The year of the claimable date.
143+
* @param month The month of the claimable date.
144+
* @param day The day of the claimable date.
143145
*/
144146
event RedeemRequested(
145147
address indexed personalAccount,
146148
address indexed vault,
147149
uint256 shares,
148-
uint256 amount,
149-
uint256 claimableEpoch
150+
uint256 claimableEpoch,
151+
uint256 year,
152+
uint256 month,
153+
uint256 day
150154
);
151155

152156
/**

src/coston2/IPersonalAccount.sol

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,18 @@ interface IPersonalAccount {
9898
* @notice Emitted when a redeem request is made.
9999
* @param vault The vault address.
100100
* @param shares The number of shares to redeem.
101-
* @param amount The amount to redeem.
102101
* @param claimableEpoch The epoch when the claim becomes available.
102+
* @param year The year of the claimable date.
103+
* @param month The month of the claimable date.
104+
* @param day The day of the claimable date.
103105
*/
104106
event RedeemRequested(
105107
address indexed vault,
106108
uint256 shares,
107-
uint256 amount,
108-
uint256 claimableEpoch
109+
uint256 claimableEpoch,
110+
uint256 year,
111+
uint256 month,
112+
uint256 day
109113
);
110114

111115
/**

src/coston2/ISwapFacet.sol

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,23 @@ interface ISwapFacet {
1010
/**
1111
* @notice Emitted when swap parameters are set.
1212
* @param uniswapV3Router The Uniswap V3 router address.
13-
* @param usdt0 USDT0 token address.
14-
* @param wNatUsdt0PoolFeeTierPPM The WNAT/USDT0 pool fee tier (in PPM - supported values: 100, 500, 3000, 10000).
15-
* @param usdt0FXrpPoolFeeTierPPM The USDT0/FXRP pool fee tier (in PPM - supported values: 100, 500, 3000, 10000).
13+
* @param stableCoin StableCoin (USDT0, USDX,...) token address.
14+
* @param wNatStableCoinPoolFeeTierPPM The WNAT/StableCoin pool fee tier
15+
(in PPM - supported values: 100, 500, 3000, 10000).
16+
* @param stableCoinFXrpPoolFeeTierPPM The StableCoin/FXRP pool fee tier
17+
(in PPM - supported values: 100, 500, 3000, 10000).
1618
* @param maxSlippagePPM The maximum slippage allowed for swaps (in PPM).
19+
* @param stableCoinUsdFeedId The StableCoin/USD feed ID as in FTSO.
20+
* @param wNatUsdFeedId The WNAT/USD feed ID as in FTSO.
1721
*/
1822
event SwapParamsSet(
1923
address uniswapV3Router,
20-
address usdt0,
21-
uint24 wNatUsdt0PoolFeeTierPPM,
22-
uint24 usdt0FXrpPoolFeeTierPPM,
23-
uint24 maxSlippagePPM
24+
address stableCoin,
25+
uint24 wNatStableCoinPoolFeeTierPPM,
26+
uint24 stableCoinFXrpPoolFeeTierPPM,
27+
uint24 maxSlippagePPM,
28+
bytes21 stableCoinUsdFeedId,
29+
bytes21 wNatUsdFeedId
2430
);
2531

2632
/**
@@ -52,48 +58,59 @@ interface ISwapFacet {
5258
error InvalidPoolFeeTierPPM();
5359

5460
/**
55-
* @notice Reverts if the USDT0 token address is invalid.
61+
* @notice Reverts if the feed ID is invalid (cannot be zero).
5662
*/
57-
error InvalidUsdt0();
63+
error InvalidFeedId();
64+
65+
/**
66+
* @notice Reverts if the StableCoin (USDT0, USDX,...) token address is invalid.
67+
*/
68+
error InvalidStableCoin();
5869

5970
/**
6071
* @notice Reverts if the maximum slippage in PPM is invalid (must be less than or equal to 1e6).
6172
*/
6273
error InvalidMaxSlippagePPM();
6374

6475
/**
65-
* @notice Swaps WNAT for USDT0 for the personal account associated with the given XRPL address.
76+
* @notice Swaps WNAT for StableCoin (USDT0, USDX,...) for the personal account
77+
associated with the given XRPL address.
6678
* @param _xrplAddress The XRPL address of the personal account.
6779
*/
68-
function swapWNatForUsdt0(
80+
function swapWNatForStableCoin(
6981
string calldata _xrplAddress
7082
)
7183
external;
7284

7385
/**
74-
* @notice Swaps USDT0 for FAsset for the personal account associated with the given XRPL address.
86+
* @notice Swaps StableCoin (USDT0, USDX,...) for FAsset for the personal account
87+
associated with the given XRPL address.
7588
* @param _xrplAddress The XRPL address of the personal account.
7689
*/
77-
function swapUsdt0ForFAsset(
90+
function swapStableCoinForFAsset(
7891
string calldata _xrplAddress
7992
)
8093
external;
8194

8295
/**
8396
* Returns the swap parameters.
8497
* @return _uniswapV3Router The Uniswap V3 router address.
85-
* @return _usdt0 USDT0 token address.
86-
* @return _wNatUsdt0PoolFeeTierPPM The WNAT/USDT0 pool fee tier (in PPM).
87-
* @return _usdt0FXrpPoolFeeTierPPM The USDT0/FXRP pool fee tier (in PPM).
98+
* @return _stableCoin StableCoin (USDT0, USDX,...) token address.
99+
* @return _wNatStableCoinPoolFeeTierPPM The WNAT/StableCoin pool fee tier (in PPM).
100+
* @return _stableCoinFXrpPoolFeeTierPPM The StableCoin/FXRP pool fee tier (in PPM).
88101
* @return _maxSlippagePPM The maximum slippage allowed for swaps (in PPM).
102+
* @return _stableCoinUsdFeedId The StableCoin/USD feed ID as in FTSO.
103+
* @return _wNatUsdFeedId The WNAT/USD feed ID as in FTSO.
89104
*/
90105
function getSwapParams()
91106
external view
92107
returns (
93108
address _uniswapV3Router,
94-
address _usdt0,
95-
uint24 _wNatUsdt0PoolFeeTierPPM,
96-
uint24 _usdt0FXrpPoolFeeTierPPM,
97-
uint24 _maxSlippagePPM
109+
address _stableCoin,
110+
uint24 _wNatStableCoinPoolFeeTierPPM,
111+
uint24 _stableCoinFXrpPoolFeeTierPPM,
112+
uint24 _maxSlippagePPM,
113+
bytes21 _stableCoinUsdFeedId,
114+
bytes21 _wNatUsdFeedId
98115
);
99116
}

src/flare/IFAsset.sol

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity >=0.7.6 <0.9;
3+
4+
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
5+
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
6+
7+
8+
interface IFAsset is IERC20, IERC20Metadata {
9+
////////////////////////////////////////////////////////////////////////////////////
10+
// System information
11+
12+
/**
13+
* The name of the underlying asset.
14+
*/
15+
function assetName() external view returns (string memory);
16+
17+
/**
18+
* The symbol of the underlying asset.
19+
*/
20+
function assetSymbol() external view returns (string memory);
21+
22+
/**
23+
* Get the asset manager, corresponding to this fAsset.
24+
* fAssets and asset managers are in 1:1 correspondence.
25+
*/
26+
function assetManager() external view returns (address);
27+
}

src/songbird/IFAsset.sol

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity >=0.7.6 <0.9;
3+
4+
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
5+
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
6+
7+
8+
interface IFAsset is IERC20, IERC20Metadata {
9+
////////////////////////////////////////////////////////////////////////////////////
10+
// System information
11+
12+
/**
13+
* The name of the underlying asset.
14+
*/
15+
function assetName() external view returns (string memory);
16+
17+
/**
18+
* The symbol of the underlying asset.
19+
*/
20+
function assetSymbol() external view returns (string memory);
21+
22+
/**
23+
* Get the asset manager, corresponding to this fAsset.
24+
* fAssets and asset managers are in 1:1 correspondence.
25+
*/
26+
function assetManager() external view returns (address);
27+
}

0 commit comments

Comments
 (0)