Skip to content

Commit a301eff

Browse files
committed
feat: add deposit types to erc20 gateway
1 parent 7756629 commit a301eff

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/solidity-contracts/contracts/messaging/gateway/FuelERC20Gateway/FuelERC20GatewayV4.sol

+5-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ contract FuelERC20GatewayV4 is
4242
event Withdrawal(bytes32 indexed recipient, address indexed tokenAddress, uint256 amount);
4343

4444
enum MessageType {
45-
DEPOSIT,
45+
DEPOSIT_TO_ADDRESS,
46+
DEPOSIT_TO_CONTRACT,
47+
DEPOSIT_WITH_DATA,
4648
METADATA
4749
}
4850

@@ -146,7 +148,7 @@ contract FuelERC20GatewayV4 is
146148

147149
bytes memory depositMessage = abi.encodePacked(
148150
assetIssuerId,
149-
MessageType.DEPOSIT,
151+
MessageType.DEPOSIT_TO_ADDRESS,
150152
bytes32(uint256(uint160(tokenAddress))),
151153
bytes32(0),
152154
bytes32(uint256(uint160(msg.sender))),
@@ -174,7 +176,7 @@ contract FuelERC20GatewayV4 is
174176

175177
bytes memory depositMessage = abi.encodePacked(
176178
assetIssuerId,
177-
MessageType.DEPOSIT,
179+
data.length == 0 ? MessageType.DEPOSIT_TO_CONTRACT : MessageType.DEPOSIT_WITH_DATA,
178180
bytes32(uint256(uint160(tokenAddress))),
179181
bytes32(0),
180182
bytes32(uint256(uint160(msg.sender))),

0 commit comments

Comments
 (0)