From 03b2563334dcdd1b48621e191d0779423777eec0 Mon Sep 17 00:00:00 2001 From: ryo hashimoto Date: Mon, 30 Oct 2023 22:37:54 +0900 Subject: [PATCH] refator: format comments --- src/types/oneinch-fusion.ts | 8 +++++--- src/visualizer/oneinch-fusion/getAuctionTime.ts | 12 ++++++++---- src/visualizer/oneinch-fusion/index.ts | 10 ++++++++-- test/visualizer/oneinch-fusion/data.ts | 7 ++++--- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/types/oneinch-fusion.ts b/src/types/oneinch-fusion.ts index 6b7628d..7089947 100644 --- a/src/types/oneinch-fusion.ts +++ b/src/types/oneinch-fusion.ts @@ -1,6 +1,8 @@ -// @see -// https://github.com/1inch/fusion-sdk/blob/4b76e9c232276742f879f3495e452dfc667b5a3a/src/limit-order/types.ts#L29-L41 -// https://github.com/1inch/fusion-sdk/blob/4b76e9c232276742f879f3495e452dfc667b5a3a/src/limit-order/eip712/order-typed-data-builder.ts#L23-L37 +/** + * @dev 1inch fusion order struct types + * @see https://github.com/1inch/fusion-sdk/blob/4b76e9c232276742f879f3495e452dfc667b5a3a/src/limit-order/types.ts#L29-L41 + * @see https://github.com/1inch/fusion-sdk/blob/4b76e9c232276742f879f3495e452dfc667b5a3a/src/limit-order/eip712/order-typed-data-builder.ts#L34 + */ export type OneinchFusionOrder = { salt: string; makerAsset: string; diff --git a/src/visualizer/oneinch-fusion/getAuctionTime.ts b/src/visualizer/oneinch-fusion/getAuctionTime.ts index 65aa7c5..c37e7a7 100644 --- a/src/visualizer/oneinch-fusion/getAuctionTime.ts +++ b/src/visualizer/oneinch-fusion/getAuctionTime.ts @@ -1,5 +1,7 @@ -// The bit constants refers to fusion-sdk code. -// @see https://github.com/1inch/fusion-sdk/blob/4b76e9c232276742f879f3495e452dfc667b5a3a/src/auction-salt/parser/constants.ts +/** + * @dev 1inch fusion auction salt mask constants + * @see https://github.com/1inch/fusion-sdk/blob/4b76e9c232276742f879f3495e452dfc667b5a3a/src/auction-salt/parser/constants.ts + */ const START_TIME_MASK = BigInt( "0xFFFFFFFF00000000000000000000000000000000000000000000000000000000" ); @@ -9,8 +11,10 @@ const DURATION_MASK = BigInt( const START_TIME_SHIFT = BigInt(224); const DURATION_SHIFT = BigInt(200); -// get the auction start and end time from the salt -// @see https://github.com/1inch/fusion-sdk/blob/4b76e9c232276742f879f3495e452dfc667b5a3a/src/auction-salt/parser/parser.ts#L15-L27 +/** + * @dev get the auction start and end time from the salt + * @see https://github.com/1inch/fusion-sdk/blob/4b76e9c232276742f879f3495e452dfc667b5a3a/src/auction-salt/parser/parser.ts#L15-L27 + */ export const getAuctionTime = (salt: string): { startTime: number; endTime: number } => { const startTime = getAuctionStartTime(salt); const duration = getAuctionDuration(salt); diff --git a/src/visualizer/oneinch-fusion/index.ts b/src/visualizer/oneinch-fusion/index.ts index 6f6bab1..6e32f2e 100644 --- a/src/visualizer/oneinch-fusion/index.ts +++ b/src/visualizer/oneinch-fusion/index.ts @@ -7,11 +7,17 @@ import { getAuctionTime } from "./getAuctionTime"; const { NATIVE } = ASSET_TYPE; -// @see https://github.com/1inch/fusion-sdk/blob/4b76e9c232276742f879f3495e452dfc667b5a3a/src/constants.ts#L50 +/** + * @dev 1inch fusion verifying contract address + * @see https://github.com/1inch/fusion-sdk/blob/4b76e9c232276742f879f3495e452dfc667b5a3a/src/constants.ts#L50 + */ export const ONEINCH_FUSION_VERIFYING_CONTRACT = "0x1111111254eeb25477b68fb85ed929f73a960582"; -// @see https://github.com/1inch/fusion-sdk/blob/4b76e9c232276742f879f3495e452dfc667b5a3a/src/constants.ts#L6-L15 +/** + * @dev 1inch fusion supported chains + * @see https://github.com/1inch/fusion-sdk/blob/4b76e9c232276742f879f3495e452dfc667b5a3a/src/constants.ts#L6-L15 + */ export const ONEINCH_FUSION_SUPPORTED_CHAINS = [ 1, //Ethereum 137, //Polygon diff --git a/test/visualizer/oneinch-fusion/data.ts b/test/visualizer/oneinch-fusion/data.ts index d641ba0..83d9760 100644 --- a/test/visualizer/oneinch-fusion/data.ts +++ b/test/visualizer/oneinch-fusion/data.ts @@ -1,8 +1,9 @@ import { oneinchFusionTypes } from "../../../src/types"; -// Test data refers to fusion-sdk code. -// @see https://github.com/1inch/fusion-sdk/blob/4b76e9c232276742f879f3495e452dfc667b5a3a/src/fusion-order/fusion-order.spec.ts#L12-L61 - +/** + * @dev test data for 1inch fusion successful order + * @see https://github.com/1inch/fusion-sdk/blob/4b76e9c232276742f879f3495e452dfc667b5a3a/src/fusion-order/fusion-order.spec.ts#L12-L61 + */ const oneinchFusionOrder: oneinchFusionTypes.OneinchFusionOrder = { salt: "45118768841948961586167738353692277076075522015101619148498725069326976558864", makerAsset: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",