Commit e031de8d authored by Maurelian's avatar Maurelian Committed by GitHub

contracts-bedrock: depositTransaction warning (#2678)

Addresses TOB-OPT-7:
> When a smart contract submits a deposit transaction, the code will transform the contract address to an aliased address by adding a fixed offset. Due to the lack of specification and guidance regarding how smart contracts should manage funds within the system, a naive smart contract that interacts with the DepositFeed could lock funds in the system that may not be retrievable later.

The recommendation was:
> Provide guidance within the documentation to ensure that smart contract developers are aware of this edge case.
Co-authored-by: default avatarmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: default avatarMark Tyneway <mark.tyneway@gmail.com>
Co-authored-by: default avatarMatthew Slipper <me@matthewslipper.com>
parent 1d92dfd0
......@@ -78,8 +78,11 @@ contract OptimismPortal is ResourceMetering {
}
/**
* Accepts deposits of ETH and data, and emits a TransactionDeposited event for use in deriving
* deposit transactions.
* @notice Accepts deposits of ETH and data, and emits a TransactionDeposited event for use in
* deriving deposit transactions. Note that if a deposit is made by a contract, its address will
* be aliased when retrieved using `tx.origin` or `msg.sender`. This can lead to loss of funds
* in some cases which the depositing contract may not have accounted for. Consider using the
* Bridge or CrossDomainMessenger contracts which provide additional safety assurances.
*
* @param _to The L2 destination address.
* @param _value The ETH value to send in the deposit transaction.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment