@@ -18,9 +18,6 @@ interface IERC20Decimals {
1818contract OFTTransportAdapter {
1919 using AddressToBytes32 for address ;
2020
21- bytes public constant MSG_EMPTY_PARAM = new bytes (0 );
22- address public constant ZERO_ADDRESS = address (0 );
23-
2421 IERC20 public immutable usdt;
2522 IOFT public immutable oftTransport;
2623
@@ -52,13 +49,8 @@ contract OFTTransportAdapter {
5249 return address (oftTransport) != address (0 ) && address (usdt) == _token;
5350 }
5451
55- /**
56- * @notice Transfers USDT from the current domain to the given address on the new domain.
57- * @dev This function will revert if the OFT bridge is disabled. I.e. if the zero address is passed to the constructor for the cctpTokenMessenger.
58- * @param _to Address to receive USDT on the new domain represented as bytes32.
59- * @param amount Amount of USDT to transfer.
60- */
6152 function _transferUsdt (address _to , uint256 amount ) internal {
53+ // @dev: building `SendParam` struct
6254 // receiver address converted to bytes32
6355 bytes32 to = _to.toBytes32 ();
6456
@@ -75,19 +67,11 @@ contract OFTTransportAdapter {
7567 // bytes memory extraOptions = OptionsBuilder.newOptions(); // todo: this requires installing an extra lib `solidity-bytes-utils`
7668 bytes memory extraOptions = new bytes (0 );
7769
70+ // todo: can make these an immutable storage var, ZERO_BYTES? Idk
7871 bytes memory composeMsg = new bytes (0 );
7972 bytes memory oftCmd = new bytes (0 );
8073
81- // we don't use last 3 params to the `send()` call later, so we set them to zero bytes const, `MSG_EMPTY_PARAM`
82- SendParam memory sendParam = SendParam (
83- dstEid,
84- to,
85- amountLD,
86- minAmountLD,
87- MSG_EMPTY_PARAM,
88- MSG_EMPTY_PARAM,
89- MSG_EMPTY_PARAM
90- );
74+ SendParam memory sendParam = SendParam (dstEid, to, amountLD, minAmountLD, extraOptions, composeMsg, oftCmd);
9175
9276 MessagingFee memory fee = oftTransport.quoteSend (sendParam, false );
9377
@@ -96,7 +80,7 @@ contract OFTTransportAdapter {
9680 (MessagingReceipt memory msgReceipt , OFTReceipt memory oftReceipt ) = oftTransport.send { value: fee.nativeFee }(
9781 sendParam,
9882 fee,
99- ZERO_ADDRESS
83+ address ( 0 )
10084 );
10185
10286 // todo: possible further actions:
0 commit comments