@@ -33,7 +33,10 @@ contract FuelERC20Gateway is
33
33
34
34
/// @dev Emitted when tokens are withdrawn from Fuel to Ethereum
35
35
event Withdrawal (
36
- bytes32 indexed recipient , address indexed tokenAddress , bytes32 indexed fuelContractId , uint256 amount
36
+ bytes32 indexed recipient ,
37
+ address indexed tokenAddress ,
38
+ bytes32 indexed fuelContractId ,
39
+ uint256 amount
37
40
);
38
41
39
42
///////////////
@@ -108,12 +111,12 @@ contract FuelERC20Gateway is
108
111
/// @param fuelContractId ID of the contract on Fuel that manages the deposited tokens
109
112
/// @param amount Amount of tokens to deposit
110
113
/// @dev Made payable to reduce gas costs
111
- function deposit (bytes32 to , address tokenAddress , bytes32 fuelContractId , uint256 amount )
112
- external
113
- payable
114
- virtual
115
- whenNotPaused
116
- {
114
+ function deposit (
115
+ bytes32 to ,
116
+ address tokenAddress ,
117
+ bytes32 fuelContractId ,
118
+ uint256 amount
119
+ ) external payable virtual whenNotPaused {
117
120
bytes memory messageData = abi.encodePacked (
118
121
fuelContractId,
119
122
bytes32 (uint256 (uint160 (tokenAddress))), // OFFSET_TOKEN_ADDRESS = 32
@@ -158,14 +161,12 @@ contract FuelERC20Gateway is
158
161
/// @param amount Amount of tokens to withdraw
159
162
/// @param tokenId Discriminator for ERC721 / ERC1155 tokens. For ERC20, it must be 0
160
163
/// @dev Made payable to reduce gas costs
161
- function finalizeWithdrawal (address to , address tokenAddress , uint256 amount , uint256 tokenId )
162
- external
163
- payable
164
- virtual
165
- override
166
- whenNotPaused
167
- onlyFromPortal
168
- {
164
+ function finalizeWithdrawal (
165
+ address to ,
166
+ address tokenAddress ,
167
+ uint256 amount ,
168
+ uint256 tokenId
169
+ ) external payable virtual override whenNotPaused onlyFromPortal {
169
170
require (amount > 0 , "Cannot withdraw zero " );
170
171
require (tokenId == 0 , "Fungible tokens cannot have a tokenId " );
171
172
bytes32 fuelContractId = messageSender ();
@@ -181,7 +182,7 @@ contract FuelERC20Gateway is
181
182
/// @notice Allows the admin to rescue ETH sent to this contract by accident
182
183
/// @dev Made payable to reduce gas costs
183
184
function rescueETH () external payable virtual onlyRole (DEFAULT_ADMIN_ROLE) {
184
- (bool success ,) = address (msg .sender ).call {value: address (this ).balance}("" );
185
+ (bool success , ) = address (msg .sender ).call {value: address (this ).balance}("" );
185
186
require (success);
186
187
}
187
188
@@ -194,10 +195,12 @@ contract FuelERC20Gateway is
194
195
/// @param fuelContractId ID of the contract on Fuel that manages the deposited tokens
195
196
/// @param amount Amount of tokens to deposit
196
197
/// @param messageData The data of the message to send for deposit
197
- function _deposit (address tokenAddress , bytes32 fuelContractId , uint256 amount , bytes memory messageData )
198
- internal
199
- virtual
200
- {
198
+ function _deposit (
199
+ address tokenAddress ,
200
+ bytes32 fuelContractId ,
201
+ uint256 amount ,
202
+ bytes memory messageData
203
+ ) internal virtual {
201
204
require (amount > 0 , "Cannot deposit zero " );
202
205
203
206
//transfer tokens to this contract and update deposit balance
0 commit comments