Skip to content

Commit

Permalink
Comments added
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjimmutable committed Nov 7, 2023
1 parent 98dc26a commit 0e5264d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/root/RootERC20Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {IWETH} from "../interfaces/root/IWETH.sol";
* and also allows us to decouple vendor-specific messaging logic from the bridge logic.
* @dev Because of this pattern, any checks or logic that is agnostic to the messaging protocol should be done in RootERC20Bridge.
* @dev Any checks or logic that is specific to the underlying messaging protocol should be done in the bridge adaptor.
* @dev Note that there is undefined behaviour for bridging non-standard ERC20 tokens (e.g. rebasing tokens). Please approach such cases with great care.
*/
contract RootERC20Bridge is
AccessControlUpgradeable, // AccessControlUpgradeable inherits Initializable
Expand Down Expand Up @@ -203,10 +204,7 @@ contract RootERC20Bridge is

/**
* @inheritdoc IRootERC20Bridge
* @dev TODO when this becomes part of the deposit flow on a token's first bridge, this logic will need to be mostly moved into an internal function.
* Additionally, we need to investigate what the ordering guarantees are. i.e. if we send a map token message, then a bridge token message,
* in the same TX (or even very close but separate transactions), is it possible the order gets reversed? This could potentially make some
* first bridges break and we might then have to separate them and wait for the map to be confirmed.
* @dev Note that there is undefined behaviour for bridging non-standard ERC20 tokens (e.g. rebasing tokens). Please approach such cases with great care.
*/
function mapToken(IERC20Metadata rootToken) external payable override returns (address) {
return _mapToken(rootToken);
Expand All @@ -222,15 +220,15 @@ contract RootERC20Bridge is

/**
* @inheritdoc IRootERC20Bridge
* @dev Note that there is undefined behaviour for bridging non-standard ERC20 tokens. Please approach such cases with great care.
* @dev Note that there is undefined behaviour for bridging non-standard ERC20 tokens (e.g. rebasing tokens). Please approach such cases with great care.
*/
function deposit(IERC20Metadata rootToken, uint256 amount) external payable override {
_depositToken(rootToken, msg.sender, amount);
}

/**
* @inheritdoc IRootERC20Bridge
* @dev Note that there is undefined behaviour for bridging non-standard ERC20 tokens. Please approach such cases with great care.
* @dev Note that there is undefined behaviour for bridging non-standard ERC20 tokens (e.g. rebasing tokens). Please approach such cases with great care.
*/
function depositTo(IERC20Metadata rootToken, address receiver, uint256 amount) external payable override {
_depositToken(rootToken, receiver, amount);
Expand Down

0 comments on commit 0e5264d

Please sign in to comment.