Skip to content

Commit

Permalink
deploy: 8b7f0f1
Browse files Browse the repository at this point in the history
  • Loading branch information
skeletor-spaceman committed Aug 13, 2024
1 parent 714cc4e commit 43f17ed
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 30 deletions.
26 changes: 13 additions & 13 deletions interop/token-bridging.html
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ <h1 id="token-bridging"><a class="header" href="#token-bridging">Token Bridging<
</li>
<li><a href="#events">Events</a>
<ul>
<li><a href="#senderc20"><code>SendERC20</code></a></li>
<li><a href="#relayerc20"><code>RelayERC20</code></a></li>
<li><a href="#senterc20"><code>SentERC20</code></a></li>
<li><a href="#relayederc20"><code>RelayedERC20</code></a></li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -226,7 +226,7 @@ <h3 id="functions"><a class="header" href="#functions">Functions</a></h3>
<h4 id="senderc20"><a class="header" href="#senderc20"><code>sendERC20</code></a></h4>
<p>Transfer <code>_amount</code> amount of tokens to address <code>_to</code> in chain <code>_chainId</code>.</p>
<p>It SHOULD burn <code>_amount</code> tokens and initialize a message to the <code>L2ToL2CrossChainMessenger</code> to mint the <code>_amount</code>
in the target address <code>_to</code> at <code>_chainId</code> and emit the <code>SendERC20</code> event including the <code>msg.sender</code> as parameter.</p>
in the target address <code>_to</code> at <code>_chainId</code> and emit the <code>SentERC20</code> event including the <code>msg.sender</code> as parameter.</p>
<pre><code class="language-solidity">sendERC20(address _to, uint256 _amount, uint256 _chainId)
</code></pre>
<h4 id="relayerc20"><a class="header" href="#relayerc20"><code>relayERC20</code></a></h4>
Expand All @@ -239,13 +239,13 @@ <h4 id="relayerc20"><a class="header" href="#relayerc20"><code>relayERC20</code>
<pre><code class="language-solidity">relayERC20(address _from, address _to, uint256 _amount)
</code></pre>
<h3 id="events"><a class="header" href="#events">Events</a></h3>
<h4 id="senderc20-1"><a class="header" href="#senderc20-1"><code>SendERC20</code></a></h4>
<h4 id="senterc20"><a class="header" href="#senterc20"><code>SentERC20</code></a></h4>
<p>MUST trigger when a cross-chain transfer is initiated using <code>sendERC20</code>.</p>
<pre><code class="language-solidity">event SendERC20(address indexed from, address indexed to, uint256 amount, uint256 destination)
<pre><code class="language-solidity">event SentERC20(address indexed from, address indexed to, uint256 amount, uint256 destination)
</code></pre>
<h4 id="relayerc20-1"><a class="header" href="#relayerc20-1"><code>RelayERC20</code></a></h4>
<h4 id="relayederc20"><a class="header" href="#relayederc20"><code>RelayedERC20</code></a></h4>
<p>MUST trigger when a cross-chain transfer is finalized using <code>relayERC20</code>.</p>
<pre><code class="language-solidity">event RelayERC20(address indexed from, address indexed to, uint256 amount, uint256 source);
<pre><code class="language-solidity">event RelayedERC20(address indexed from, address indexed to, uint256 amount, uint256 source);
</code></pre>
<h2 id="diagram"><a class="header" href="#diagram">Diagram</a></h2>
<p>The following diagram depicts a cross-chain transfer.</p>
Expand All @@ -261,11 +261,11 @@ <h2 id="diagram"><a class="header" href="#diagram">Diagram</a></h2>
from-&gt;&gt;SuperERC20_A: sendERC20To(to, amount, chainID)
SuperERC20_A-&gt;&gt;SuperERC20_A: burn(from, amount)
SuperERC20_A-&gt;&gt;Messenger_A: sendMessage(chainId, message)
SuperERC20_A--&gt;SuperERC20_A: emit SendERC20(from, to, amount, destination)
SuperERC20_A--&gt;SuperERC20_A: emit SentERC20(from, to, amount, destination)
Inbox-&gt;&gt;Messenger_B: relayMessage()
Messenger_B-&gt;&gt;SuperERC20_B: relayERC20(from, to, amount)
SuperERC20_B-&gt;&gt;SuperERC20_B: mint(to, amount)
SuperERC20_B--&gt;SuperERC20_B: emit RelayERC20(from, to, amount, source)
SuperERC20_B--&gt;SuperERC20_B: emit RelayedERC20(from, to, amount, source)
</pre>
<h2 id="implementation"><a class="header" href="#implementation">Implementation</a></h2>
<p>An example implementation that depends on deterministic deployments across chains
Expand All @@ -276,7 +276,7 @@ <h2 id="implementation"><a class="header" href="#implementation">Implementation<
_burn(msg.sender, _amount);
bytes memory _message = abi.encodeCall(this.relayERC20, (msg.sender, _to, _amount));
L2ToL2CrossDomainMessenger.sendMessage(_chainId, address(this), _message);
emit SendERC20(msg.sender, _to, _amount, _chainId);
emit SentERC20(msg.sender, _to, _amount, _chainId);
}

function relayERC20(address _from, address _to, uint256 _amount) external {
Expand All @@ -286,7 +286,7 @@ <h2 id="implementation"><a class="header" href="#implementation">Implementation<

_mint(_to, _amount);

emit RelayERC20(_from, _to, _amount, _source);
emit RelayedERC20(_from, _to, _amount, _source);
}
</code></pre>
<h2 id="invariants"><a class="header" href="#invariants">Invariants</a></h2>
Expand Down Expand Up @@ -334,8 +334,8 @@ <h2 id="invariants"><a class="header" href="#invariants">Invariants</a></h2>
</li>
<li>Bridge Events:
<ul>
<li><code>sendERC20()</code> should emit a <code>SendERC20</code> event. `</li>
<li><code>relayERC20()</code> should emit a <code>RelayERC20</code> event.</li>
<li><code>sendERC20()</code> should emit a <code>SentERC20</code> event. `</li>
<li><code>relayERC20()</code> should emit a <code>RelayedERC20</code> event.</li>
</ul>
</li>
</ul>
Expand Down
30 changes: 15 additions & 15 deletions print.html
Original file line number Diff line number Diff line change
Expand Up @@ -9593,8 +9593,8 @@ <h1 id="token-bridging"><a class="header" href="#token-bridging">Token Bridging<
</li>
<li><a href="interop/token-bridging.html#events">Events</a>
<ul>
<li><a href="interop/token-bridging.html#senderc20"><code>SendERC20</code></a></li>
<li><a href="interop/token-bridging.html#relayerc20"><code>RelayERC20</code></a></li>
<li><a href="interop/token-bridging.html#senterc20"><code>SentERC20</code></a></li>
<li><a href="interop/token-bridging.html#relayederc20"><code>RelayedERC20</code></a></li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -9623,7 +9623,7 @@ <h3 id="functions-1"><a class="header" href="#functions-1">Functions</a></h3>
<h4 id="senderc20"><a class="header" href="#senderc20"><code>sendERC20</code></a></h4>
<p>Transfer <code>_amount</code> amount of tokens to address <code>_to</code> in chain <code>_chainId</code>.</p>
<p>It SHOULD burn <code>_amount</code> tokens and initialize a message to the <code>L2ToL2CrossChainMessenger</code> to mint the <code>_amount</code>
in the target address <code>_to</code> at <code>_chainId</code> and emit the <code>SendERC20</code> event including the <code>msg.sender</code> as parameter.</p>
in the target address <code>_to</code> at <code>_chainId</code> and emit the <code>SentERC20</code> event including the <code>msg.sender</code> as parameter.</p>
<pre><code class="language-solidity">sendERC20(address _to, uint256 _amount, uint256 _chainId)
</code></pre>
<h4 id="relayerc20"><a class="header" href="#relayerc20"><code>relayERC20</code></a></h4>
Expand All @@ -9636,13 +9636,13 @@ <h4 id="relayerc20"><a class="header" href="#relayerc20"><code>relayERC20</code>
<pre><code class="language-solidity">relayERC20(address _from, address _to, uint256 _amount)
</code></pre>
<h3 id="events-1"><a class="header" href="#events-1">Events</a></h3>
<h4 id="senderc20-1"><a class="header" href="#senderc20-1"><code>SendERC20</code></a></h4>
<h4 id="senterc20"><a class="header" href="#senterc20"><code>SentERC20</code></a></h4>
<p>MUST trigger when a cross-chain transfer is initiated using <code>sendERC20</code>.</p>
<pre><code class="language-solidity">event SendERC20(address indexed from, address indexed to, uint256 amount, uint256 destination)
<pre><code class="language-solidity">event SentERC20(address indexed from, address indexed to, uint256 amount, uint256 destination)
</code></pre>
<h4 id="relayerc20-1"><a class="header" href="#relayerc20-1"><code>RelayERC20</code></a></h4>
<h4 id="relayederc20"><a class="header" href="#relayederc20"><code>RelayedERC20</code></a></h4>
<p>MUST trigger when a cross-chain transfer is finalized using <code>relayERC20</code>.</p>
<pre><code class="language-solidity">event RelayERC20(address indexed from, address indexed to, uint256 amount, uint256 source);
<pre><code class="language-solidity">event RelayedERC20(address indexed from, address indexed to, uint256 amount, uint256 source);
</code></pre>
<h2 id="diagram"><a class="header" href="#diagram">Diagram</a></h2>
<p>The following diagram depicts a cross-chain transfer.</p>
Expand All @@ -9658,11 +9658,11 @@ <h2 id="diagram"><a class="header" href="#diagram">Diagram</a></h2>
from-&gt;&gt;SuperERC20_A: sendERC20To(to, amount, chainID)
SuperERC20_A-&gt;&gt;SuperERC20_A: burn(from, amount)
SuperERC20_A-&gt;&gt;Messenger_A: sendMessage(chainId, message)
SuperERC20_A--&gt;SuperERC20_A: emit SendERC20(from, to, amount, destination)
SuperERC20_A--&gt;SuperERC20_A: emit SentERC20(from, to, amount, destination)
Inbox-&gt;&gt;Messenger_B: relayMessage()
Messenger_B-&gt;&gt;SuperERC20_B: relayERC20(from, to, amount)
SuperERC20_B-&gt;&gt;SuperERC20_B: mint(to, amount)
SuperERC20_B--&gt;SuperERC20_B: emit RelayERC20(from, to, amount, source)
SuperERC20_B--&gt;SuperERC20_B: emit RelayedERC20(from, to, amount, source)
</pre>
<h2 id="implementation"><a class="header" href="#implementation">Implementation</a></h2>
<p>An example implementation that depends on deterministic deployments across chains
Expand All @@ -9673,7 +9673,7 @@ <h2 id="implementation"><a class="header" href="#implementation">Implementation<
_burn(msg.sender, _amount);
bytes memory _message = abi.encodeCall(this.relayERC20, (msg.sender, _to, _amount));
L2ToL2CrossDomainMessenger.sendMessage(_chainId, address(this), _message);
emit SendERC20(msg.sender, _to, _amount, _chainId);
emit SentERC20(msg.sender, _to, _amount, _chainId);
}

function relayERC20(address _from, address _to, uint256 _amount) external {
Expand All @@ -9683,7 +9683,7 @@ <h2 id="implementation"><a class="header" href="#implementation">Implementation<

_mint(_to, _amount);

emit RelayERC20(_from, _to, _amount, _source);
emit RelayedERC20(_from, _to, _amount, _source);
}
</code></pre>
<h2 id="invariants-1"><a class="header" href="#invariants-1">Invariants</a></h2>
Expand Down Expand Up @@ -9731,8 +9731,8 @@ <h2 id="invariants-1"><a class="header" href="#invariants-1">Invariants</a></h2>
</li>
<li>Bridge Events:
<ul>
<li><code>sendERC20()</code> should emit a <code>SendERC20</code> event. `</li>
<li><code>relayERC20()</code> should emit a <code>RelayERC20</code> event.</li>
<li><code>sendERC20()</code> should emit a <code>SentERC20</code> event. `</li>
<li><code>relayERC20()</code> should emit a <code>RelayedERC20</code> event.</li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -9866,7 +9866,7 @@ <h4 id="withdraw"><a class="header" href="#withdraw"><code>withdraw</code></a></
<ul>
<li>Reverts if triggered on a chain that does not use ETH as a native token.</li>
</ul>
<h4 id="senderc20-2"><a class="header" href="#senderc20-2"><code>sendERC20</code></a></h4>
<h4 id="senderc20-1"><a class="header" href="#senderc20-1"><code>sendERC20</code></a></h4>
<ul>
<li>Reverts if attempting to send more than the sender's available balance.</li>
<li>Reduce's the sender's balance by the sent amount.</li>
Expand All @@ -9888,7 +9888,7 @@ <h4 id="senderc20to"><a class="header" href="#senderc20to"><code>sendERC20To</co
<li>All invariants of <code>sendERC20</code>.</li>
<li>Message sent to <code>SuperchainWETH</code> on recipient chain includes <code>to</code> address as recipient.</li>
</ul>
<h4 id="relayerc20-2"><a class="header" href="#relayerc20-2"><code>relayERC20</code></a></h4>
<h4 id="relayerc20-1"><a class="header" href="#relayerc20-1"><code>relayERC20</code></a></h4>
<ul>
<li>Reverts if called by any address other than the <code>L2ToL2CrossDomainMessenger</code>.</li>
<li>Reverts if <code>crossDomainMessageSender</code> is not the <code>SuperchainWETH</code> contract.</li>
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion searchindex.json

Large diffs are not rendered by default.

0 comments on commit 43f17ed

Please sign in to comment.