Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
proletesseract committed Oct 26, 2023
1 parent f2beb02 commit 0a6034a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 3 additions & 4 deletions src/root/RootERC20Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ contract RootERC20Bridge is
// ETH, WETH and IMX do not need to be mapped since it should have been mapped on initialization
// ETH also cannot be transferred since it was received in the payable function call
// WETH is also not transferred here since it was earlier unwrapped to ETH

// TODO We can call _mapToken here, but ordering in the GMP is not guaranteed.
// Therefore, we need to decide how to handle this and it may be a UI decision to wait until map token message is executed on child chain.
// Discuss this, and add this decision to the design doc.
Expand All @@ -250,11 +250,11 @@ contract RootERC20Bridge is
}
}
rootToken.safeTransferFrom(msg.sender, address(this), amount);
}
}

// Deposit sig, root token address, depositor, receiver, amount
bytes memory payload = abi.encode(DEPOSIT_SIG, payloadToken, msg.sender, receiver, amount);

// TODO investigate using delegatecall to keep the axelar message sender as the bridge contract, since adaptor can change.
rootBridgeAdaptor.sendMessage{value: feeAmount}(payload, msg.sender);

Expand All @@ -268,5 +268,4 @@ contract RootERC20Bridge is
emit ERC20Deposit(address(rootToken), childToken, msg.sender, receiver, amount);
}
}

}
4 changes: 1 addition & 3 deletions test/integration/root/RootERC20Bridge.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,7 @@ contract RootERC20BridgeIntegrationTest is Test, IRootERC20BridgeEvents, IRootAx
vm.expectEmit(address(axelarAdaptor));
emit MapTokenAxelarMessage(CHILD_CHAIN_NAME, childBridgeAdaptorString, predictedPayload);
vm.expectEmit(address(rootBridge));
emit WETHDeposit(
address(WRAPPED_ETH), address(this), address(this), tokenAmount
);
emit WETHDeposit(address(WRAPPED_ETH), address(this), address(this), tokenAmount);
vm.expectCall(
address(axelarAdaptor),
depositFee,
Expand Down

0 comments on commit 0a6034a

Please sign in to comment.