Skip to content

Commit bd0f4c0

Browse files
authored
doc: [macro-q12] missing natspec (#36)
* doc: missing natspec * chore: typo
1 parent d334331 commit bd0f4c0

File tree

8 files changed

+26
-0
lines changed

8 files changed

+26
-0
lines changed

contracts/destination/xreceivers/AuthForwarderXReceiver.sol

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ abstract contract AuthForwarderXReceiver is IXReceiver, Ownable2Step {
144144
* @param _amount - The amount of funds received in this transfer
145145
* @param _asset - The asset of the funds received in this transfer
146146
* @param _callData - The data to be prepared and forwarded
147+
* @return the success status of the forwardFunctionCall
147148
*/
148149
function xReceive(
149150
bytes32 _transferId,
@@ -199,6 +200,7 @@ abstract contract AuthForwarderXReceiver is IXReceiver, Ownable2Step {
199200
* @param _data - The data to be prepared
200201
* @param _amount - The amount of funds received in this transfer
201202
* @param _asset - The asset of the funds received in this transfer
203+
* @return The result of the forward Function call
202204
*/
203205
function prepareAndForward(
204206
bytes32 _transferId,
@@ -229,6 +231,7 @@ abstract contract AuthForwarderXReceiver is IXReceiver, Ownable2Step {
229231
* @param _data - The data to be prepared
230232
* @param _amount - The amount of funds received in this transfer
231233
* @param _asset - The asset of the funds received in this transfer
234+
* @return encoded data
232235
*/
233236
function _prepare(
234237
bytes32 _transferId,
@@ -249,6 +252,7 @@ abstract contract AuthForwarderXReceiver is IXReceiver, Ownable2Step {
249252
* @param _transferId - The transfer ID of the transfer that triggered this call
250253
* @param _amount - The amount of funds received in this transfer
251254
* @param _asset - The asset of the funds received in this transfer
255+
* @return the result of the call
252256
*/
253257
function _forwardFunctionCall(
254258
bytes memory _preparedData,

contracts/destination/xreceivers/ForwarderXReceiver.sol

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ abstract contract ForwarderXReceiver is IXReceiver {
5858
* @param _amount - The amount of funds received in this transfer.
5959
* @param _asset - The asset of the funds received in this transfer.
6060
* @param _callData - The data to be prepared and forwarded. Fallback address needs to be encoded in the data to be used in case the forward fails.
61+
* @return the success status of the forwardFunctionCall
6162
*/
6263
function xReceive(
6364
bytes32 _transferId,
@@ -113,6 +114,7 @@ abstract contract ForwarderXReceiver is IXReceiver {
113114
* @param _data - The data to be prepared
114115
* @param _amount - The amount of funds received in this transfer
115116
* @param _asset - The asset of the funds received in this transfer
117+
* @return The result of the forward Function call
116118
*/
117119
function prepareAndForward(
118120
bytes32 _transferId,
@@ -143,6 +145,7 @@ abstract contract ForwarderXReceiver is IXReceiver {
143145
* @param _data - The data to be prepared
144146
* @param _amount - The amount of funds received in this transfer
145147
* @param _asset - The asset of the funds received in this transfer
148+
* @return encoded data
146149
*/
147150
function _prepare(
148151
bytes32 _transferId,
@@ -163,6 +166,7 @@ abstract contract ForwarderXReceiver is IXReceiver {
163166
* @param _transferId - The transfer ID of the transfer that triggered this call
164167
* @param _amount - The amount of funds received in this transfer
165168
* @param _asset - The asset of the funds received in this transfer
169+
* @return the result of the call
166170
*/
167171
function _forwardFunctionCall(
168172
bytes memory _preparedData,

contracts/destination/xreceivers/Swap/SwapForwarderXReceiver.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ abstract contract SwapForwarderXReceiver is ForwarderXReceiver, SwapAdapter {
2424
* @param _data The data to be swapped.
2525
* @param _amount The amount to be swapped.
2626
* @param _asset The incoming asset to be swapped.
27+
* @return prepared data
2728
*/
2829
function _prepare(
2930
bytes32 _transferId,

contracts/shared/Swap/OneInch/OneInchUniswapV3.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ contract OneInchUniswapV3 is ISwapper {
4242
* @param _fromAsset Address of the token to swap from.
4343
* @param _toAsset Address of the token to swap to.
4444
* @param _swapData Data to pass to the 1inch aggregator router.
45+
* @return amountOut Amount of the token received
4546
*/
4647
function swap(
4748
uint256 _amountIn,
@@ -81,6 +82,7 @@ contract OneInchUniswapV3 is ISwapper {
8182
* @param _amountIn Amount of tokens to swap.
8283
* @param _toAsset Address of the token to swap to.
8384
* @param _swapData Data to pass to the 1inch aggregator router.
85+
* @return amountOut Amount of the token received
8486
*/
8587
function swapETH(
8688
uint256 _amountIn,

contracts/shared/Swap/SwapAdapter.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ contract SwapAdapter is Ownable2Step {
7676
* @param _toAsset Address of the token to swap to.
7777
* @param _swapData Data to pass to the swapper. This data is encoded for a particular swap router, usually given
7878
* by an API. The swapper will decode the data and re-encode it with the new amountIn.
79+
* @return amountOut Amount that is expected to get received in the swap
7980
*/
8081
function exactSwap(
8182
address _swapper,
@@ -108,6 +109,7 @@ contract SwapAdapter is Ownable2Step {
108109
* easy swaps on the source side where the amount does not need to be changed.
109110
* @param _swapper Address of the swapper to use.
110111
* @param swapData Data to pass to the swapper. This data is encoded for a particular swap router.
112+
* @return amountOut Amount that is expected to get received in the swap
111113
*/
112114
function directSwapperCall(address _swapper, bytes calldata swapData) external payable returns (uint256 amountOut) {
113115
require(allowedSwappers[_swapper], "!allowedSwapper");

contracts/shared/Swap/Uniswap/UniV2Swapper.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ contract UniV2Swapper is ISwapper {
2626
* @param _fromAsset Address of the token to swap from.
2727
* @param _toAsset Address of the token to swap to.
2828
* @param _swapData Data to pass to the UniV2 router.
29+
* @return amountOut Amount of the token received
2930
*/
3031
function swap(
3132
uint256 _amountIn,
@@ -73,6 +74,7 @@ contract UniV2Swapper is ISwapper {
7374
* @param _amountIn Amount of tokens to swap.
7475
* @param _toAsset Address of the token to swap to.
7576
* @param _swapData Data to pass to the UniV2 router.
77+
* @return amountOut Amount of the token received
7678
*/
7779
function swapETH(
7880
uint256 _amountIn,

contracts/shared/Swap/Uniswap/UniV3Swapper.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ contract UniV3Swapper is ISwapper {
3030
* @param _fromAsset Address of the token to swap from.
3131
* @param _toAsset Address of the token to swap to.
3232
* @param _swapData Data to pass to the UniV3 router.
33+
* @return amountOut Amount of the token received
3334
*/
3435
function swap(
3536
uint256 _amountIn,
@@ -82,6 +83,7 @@ contract UniV3Swapper is ISwapper {
8283
* @param _amountIn Amount of tokens to swap.
8384
* @param _toAsset Address of the token to swap to.
8485
* @param _swapData Data to pass to the UniV3 router.
86+
* @return amountOut Amount of the token received
8587
*/
8688
function swapETH(
8789
uint256 _amountIn,

contracts/shared/Swap/interfaces/ISwapper.sol

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,22 @@
33
pragma solidity ^0.8.17;
44

55
interface ISwapper {
6+
/// @notice Swaps `amountIn` of _tokenIn for as much as possible of _tokenOut
7+
/// @param _amountIn The amount of the token to swap
8+
/// @param _tokenIn The address of the token0
9+
/// @param _tokenOut The amount of the token1
10+
/// @return amountOut The amount of the received token
611
function swap(
712
uint256 _amountIn,
813
address _tokenIn,
914
address _tokenOut,
1015
bytes calldata _swapData
1116
) external returns (uint256 amountOut);
1217

18+
/// @notice Swaps `amountIn` of ETH for as much as possible of _tokenOut
19+
/// @param _amountIn The amount of the token to swap
20+
/// @param _tokenOut The amount of the token1
21+
/// @return amountOut The amount of the received token
1322
function swapETH(
1423
uint256 _amountIn,
1524
address _tokenOut,

0 commit comments

Comments
 (0)