diff --git a/doc/GenericSwap.md b/doc/GenericSwap.md index 17bab786..96ec69cf 100644 --- a/doc/GenericSwap.md +++ b/doc/GenericSwap.md @@ -2,7 +2,7 @@ GenericSwap is a general token swapping contract designed to integrate with various strategy executors (e.g. the `SmartOrderSwap` contract). The GenericSwap contract is responsible for ensuring a result of a swap is match the order. However, the actual swap is executed by a strategy executor. This design allows fulfilling an order with any combination of swapping protocols. Also, by adjusting payload in our off-chain system, it may support new protocol without upgrading contracts. -## Gas Saving Technical +## Gas Saving Technique GenericSwap retains 1 wei of the maker token at the end of each swap transaction. This practice avoids repeatedly clearing the token balance to zero, as the EVM charges different gas fees for various storage states. By preventing frequent resets to zero, this approach effectively reduces gas consumption. diff --git a/doc/RFQ.md b/doc/RFQ.md index 5d48f93c..22d99458 100644 --- a/doc/RFQ.md +++ b/doc/RFQ.md @@ -6,9 +6,9 @@ The RFQ (Request For Quote) contract facilitates the settlement of trades betwee The maker of an RFQ offer can specify certain options using a `uint256` field in the offer, referred to as option flags: -- `FLG_ALLOW_CONTRACT_SENDER` : Determines whether the RFQ offer can be filled by a contract. -- `FLG_ALLOW_PARTIAL_FILL` : Whether a RFQ offer can be filled partially or not (but once). -- `FLG_MAKER_RECEIVES_WETH` : Specifies whether a market maker is willing to receive WETH from a RFQ offer. +- `FLG_ALLOW_CONTRACT_SENDER` : Determines whether an RFQ offer can be filled by a contract. This flag is intended to prevent arbitrageurs from using contracts to execute flash loans to arbitrage RFQ orders. +- `FLG_ALLOW_PARTIAL_FILL: Determines whether an RFQ offer can be partially filled. However, each RFQ order can only be filled once, regardless of whether it's fully or partially filled. +- `FLG_MAKER_RECEIVES_WETH` : Specifies whether a market maker wants the RFQ contract to wrap the ETH he received into WETH for him. ## Relayer @@ -16,11 +16,11 @@ The RFQ contract allows for trade submissions by a relayer with user's signature ## Fee -A portion of the maker's asset in the order will be deducted as a protocol fee. This fee is transferred to the feeCollector during settlement. +A portion of the maker's asset in the order will be deducted as a protocol fee. This fee is transferred to the `feeCollector` during settlement. The fee factor is composed of two parts: 1. Protocol Fee 2. Gas Fee -If a relayer submits the trade on-chain, the gas fee will be adjusted according to the on-chain conditions at the time of the transaction. +If a trade is submitted by a relayer, the relayer will adjust the gas fee according to the on-chain conditions at the time of the transaction. diff --git a/doc/SmartOrderStrategy.md b/doc/SmartOrderStrategy.md index 24bcc217..016bbd3f 100644 --- a/doc/SmartOrderStrategy.md +++ b/doc/SmartOrderStrategy.md @@ -1,7 +1,7 @@ # SmartOrderStrategy -SmartOrderStrategy is a strategy executor of a generic swap. It is designed to be called by the `GenericSwap contract` and performs swaps according to the provided payload. This contract should not hold any significant token balance or require token approvals, as it can execute arbitrary calls. Additionally, the `executeStrategy` function is restricted to being called only by the GenericSwap contract. +`SmartOrderStrategy` is a strategy executor of a generic swap. It is designed to be called by the `GenericSwap` contract and performs swaps according to the provided payload. This contract should not hold any significant token balance or require token approvals, as it can execute arbitrary calls. Additionally, the `executeStrategy` function is restricted to being called only by the `GenericSwap` contract. -## Gas Saving Technical +## Gas Saving Technique -SmartOrderStrategy retains 1 wei of the maker token at the end of each swap transaction. This practice avoids repeatedly clearing the token balance to zero, as the EVM charges different gas fees for various storage states. By preventing frequent resets to zero, this approach effectively reduces gas consumption. +`SmartOrderStrategy` retains 1 wei of the maker token at the end of each swap transaction. This practice avoids repeatedly clearing the token balance to zero, as the EVM charges different gas fees for various storage states. By preventing frequent resets to zero, this approach effectively reduces gas consumption. diff --git a/doc/TokenCollector.md b/doc/TokenCollector.md index 152b0735..c39f1c2f 100644 --- a/doc/TokenCollector.md +++ b/doc/TokenCollector.md @@ -2,7 +2,7 @@ `TokenCollector` is an abstract contract designed to handle various token collection mechanisms. It supports different methods of token transfer, allowing flexibility in interacting with Tokenlon and other token standards. -When interacting with Tokenlon, users can select one of the supported approval schemes and provide the corresponding parameters in the data field (encoded in bytes). The first byte of this data indicates the type of the scheme, followed by the encoded data specific to that type. +When interacting with Tokenlon, users can select one of the supported approval schemes and provide the corresponding parameters in the data field (encoded as type `bytes`). The first byte of this data indicates the type of the scheme, followed by the encoded data specific to that type. ``` // ***********************************