Enforced transactions

In future upgrades to Scroll, the Enforced Transaction contract will enable sending transactions between L1 and L2 with the sendTransaction function. This contract shares similarities with the Scroll Messenger contract as it allows sending arbitrary data from one layer to the other. However, it distinguishes itself by enabling the relaying of signed transactions and the ability to set the sender (CALLER or msg.sender) on the receiving transaction on Scroll.

Enforced Transactions API

Please visit the npm library for the complete Scroll contract API documentation.

sendTransaction

function sendTransaction(address _target, uint256 _value, uint256 _gasLimit, bytes calldata _data) public payable;

Add an enforced transaction to L2 from an EOA account sender.

ParameterDescription
_targetThe address of the target contract to call in L2.
_valueThe value passed.
_gasLimitThe maximum gas should be used for this transaction in L2.
_dataThe calldata passed to the target contract.

sendTransaction

function sendTransaction(
address _sender,
address _target,
uint256 _value,
uint256 _gasLimit,
bytes calldata _data,
bytes memory _signature,
address _refundAddress
) public payable;

Add an enforced transaction to L2 by relaying a signature from the sender.

ParameterDescription
_senderThe address of sender who will initiate this transaction in L2.
_targetThe address of target contract to call in L2.
_valueThe value passed
_gasLimitThe maximum gas should be used for this transaction in L2.
_dataThe calldata passed to target contract.
_signatureThe signature for the transaction.
_refundAddressThe address to refund exceeded fee.
Stay up-to-date on the latest Scroll Developer news
Roadmap updates, virtual and live events, ecosystem opportunities and more
Thank you for subscribing!

Resources

Follow Us