Skip to content

Commit

Permalink
deploy: e0dd952
Browse files Browse the repository at this point in the history
  • Loading branch information
tynes committed Oct 2, 2024
1 parent 87caf79 commit 3f3e09f
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion interop/predeploys.html
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ <h3 id="diagram"><a class="header" href="#diagram">Diagram</a></h3>
Inbox-&gt;&gt;Messenger_B: relayMessage()
Messenger_B-&gt;&gt;L2SBB: relayERC20(tokenAddr, from, to, amount)
L2SBB-&gt;&gt;SuperERC20_B: __superchainMint(to, amount)
SuperERC20_B--&gt;SuperERC20_B: emit SuperchainMint(to, amount)
SuperERC20_B--&gt;SuperERC20_B: emit SuperchainMinted(to, amount)
L2SBB--&gt;L2SBB: emit RelayedERC20(tokenAddr, from, to, amount, source)
</pre>
<h3 id="invariants-1"><a class="header" href="#invariants-1">Invariants</a></h3>
Expand Down
24 changes: 12 additions & 12 deletions interop/token-bridging.html
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ <h1 id="token-bridging"><a class="header" href="#token-bridging">Token Bridging<
<ul>
<li><a href="#__superchainmint"><code>__superchainMint</code></a></li>
<li><a href="#__superchainburn"><code>__superchainBurn</code></a></li>
<li><a href="#superchainmint"><code>SuperchainMint</code></a></li>
<li><a href="#superchainburn"><code>SuperchainBurn</code></a></li>
<li><a href="#superchainminted"><code>SuperchainMinted</code></a></li>
<li><a href="#superchainburnt"><code>SuperchainBurnt</code></a></li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -247,7 +247,7 @@ <h3 id="properties"><a class="header" href="#properties">Properties</a></h3>
using interop message passing
using a custom bridge or implementing <code>sendERC20</code> and <code>relayERC20</code> on their own contracts.</p>
<h3 id="interface"><a class="header" href="#interface">Interface</a></h3>
<p>Implementations of the <code>SuperchainERC20</code> standard will need to implement the following two public functions:</p>
<p>Implementations of the <code>SuperchainERC20</code> standard will need to implement two external functions and two events:</p>
<h4 id="__superchainmint"><a class="header" href="#__superchainmint"><code>__superchainMint</code></a></h4>
<p>Mints <code>_amount</code> of token to address <code>_account</code>. It should only be callable by the <code>SuperchainERC20Bridge</code></p>
<pre><code class="language-solidity">__superchainMint(address _account, uint256 _amount)
Expand All @@ -256,13 +256,13 @@ <h4 id="__superchainburn"><a class="header" href="#__superchainburn"><code>__sup
<p>Burns <code>_amount</code> of token from address <code>_account</code>. It should only be callable by the <code>SuperchainERC20Bridge</code></p>
<pre><code class="language-solidity">__superchainBurn(address _account, uint256 _amount)
</code></pre>
<h4 id="superchainmint"><a class="header" href="#superchainmint"><code>SuperchainMint</code></a></h4>
<h4 id="superchainminted"><a class="header" href="#superchainminted"><code>SuperchainMinted</code></a></h4>
<p>MUST trigger when <code>__superchainMint</code> is called</p>
<pre><code class="language-solidity">event SuperchainMint(address indexed _to, uint256 _amount)
<pre><code class="language-solidity">event SuperchainMinted(address indexed _to, uint256 _amount)
</code></pre>
<h4 id="superchainburn"><a class="header" href="#superchainburn"><code>SuperchainBurn</code></a></h4>
<h4 id="superchainburnt"><a class="header" href="#superchainburnt"><code>SuperchainBurnt</code></a></h4>
<p>MUST trigger when <code>__superchainBurn</code> is called</p>
<pre><code class="language-solidity">event SuperchainBurn(address indexed _from, uint256 _amount)
<pre><code class="language-solidity">event SuperchainBurnt(address indexed _from, uint256 _amount)
</code></pre>
<h2 id="superchainerc20bridge"><a class="header" href="#superchainerc20bridge"><code>SuperchainERC20Bridge</code></a></h2>
<p>The <code>SuperchainERC20Bridge</code> is a predeploy that works as an abstraction
Expand Down Expand Up @@ -294,18 +294,18 @@ <h2 id="diagram"><a class="header" href="#diagram">Diagram</a></h2>

from-&gt;&gt;L2SBA: sendERC20To(tokenAddr, to, amount, chainID)
L2SBA-&gt;&gt;SuperERC20_A: __superchainBurn(from, amount)
SuperERC20_A--&gt;SuperERC20_A: emit SuperchainBurn(from, amount)
SuperERC20_A--&gt;SuperERC20_A: emit SuperchainBurnt(from, amount)
L2SBA-&gt;&gt;Messenger_A: sendMessage(chainId, message)
L2SBA--&gt;L2SBA: emit SentERC20(tokenAddr, from, to, amount, destination)
Inbox-&gt;&gt;Messenger_B: relayMessage()
Messenger_B-&gt;&gt;L2SBB: relayERC20(tokenAddr, from, to, amount)
L2SBB-&gt;&gt;SuperERC20_B: __superchainMint(to, amount)
SuperERC20_B--&gt;SuperERC20_B: emit SuperchainMint(to, amount)
SuperERC20_B--&gt;SuperERC20_B: emit SuperchainMinted(to, amount)
L2SBB--&gt;L2SBB: emit RelayedERC20(tokenAddr, from, to, amount, source)
</pre>
<h2 id="implementation"><a class="header" href="#implementation">Implementation</a></h2>
<p>An example implementation for the <code>sendERC20</code> and <code>relayERC20</code> functions is provided.</p>
<pre><code class="language-solidity">function sendERC20(SuperchainERC20 _token, address _to, uint256 _amount, uint256 _chainId) public {
<pre><code class="language-solidity">function sendERC20(SuperchainERC20 _token, address _to, uint256 _amount, uint256 _chainId) external {
_token.__superchainBurn(msg.sender, _amount);

bytes memory _message = abi.encodeCall(this.relayERC20, (_token, msg.sender, _to, _amount));
Expand Down Expand Up @@ -372,14 +372,14 @@ <h3 id="concatenated-action"><a class="header" href="#concatenated-action">Conca
from-&gt;&gt;Intermediate_A: sendWithData(data)
Intermediate_A-&gt;&gt;L2SBA: sendERC20To(tokenAddr, to, amount, chainID)
L2SBA-&gt;&gt;SuperERC20_A: __superchainBurn(from, amount)
SuperERC20_A--&gt;SuperERC20_A: emit SuperchainBurn(from, amount)
SuperERC20_A--&gt;SuperERC20_A: emit SuperchainBurnt(from, amount)
L2SBA-&gt;&gt;Messenger_A: sendMessage(chainId, message)
L2SBA--&gt;L2SBA: emit SentERC20(tokenAddr, from, to, amount, destination)
Intermediate_A-&gt;&gt;Messenger_A: sendMessage(chainId, to, data)
Inbox-&gt;&gt;Messenger_B: relayMessage()
Messenger_B-&gt;&gt;L2SBB: relayERC20(tokenAddr, from, to, amount)
L2SBB-&gt;&gt;SuperERC20_B: __superchainMint(to, amount)
SuperERC20_B--&gt;SuperERC20_B: emit SuperchainMint(to, amount)
SuperERC20_B--&gt;SuperERC20_B: emit SuperchainMinted(to, amount)
Inbox-&gt;&gt;Messenger_B: relayMessage(): call
L2SBB--&gt;L2SBB: emit RelayedERC20(tokenAddr, from, to, amount, source)
Messenger_B-&gt;&gt;to: call(data)
Expand Down
26 changes: 13 additions & 13 deletions print.html
Original file line number Diff line number Diff line change
Expand Up @@ -11386,7 +11386,7 @@ <h3 id="diagram"><a class="header" href="#diagram">Diagram</a></h3>
Inbox-&gt;&gt;Messenger_B: relayMessage()
Messenger_B-&gt;&gt;L2SBB: relayERC20(tokenAddr, from, to, amount)
L2SBB-&gt;&gt;SuperERC20_B: __superchainMint(to, amount)
SuperERC20_B--&gt;SuperERC20_B: emit SuperchainMint(to, amount)
SuperERC20_B--&gt;SuperERC20_B: emit SuperchainMinted(to, amount)
L2SBB--&gt;L2SBB: emit RelayedERC20(tokenAddr, from, to, amount, source)
</pre>
<h3 id="invariants-2"><a class="header" href="#invariants-2">Invariants</a></h3>
Expand Down Expand Up @@ -11855,8 +11855,8 @@ <h1 id="token-bridging"><a class="header" href="#token-bridging">Token Bridging<
<ul>
<li><a href="interop/token-bridging.html#__superchainmint"><code>__superchainMint</code></a></li>
<li><a href="interop/token-bridging.html#__superchainburn"><code>__superchainBurn</code></a></li>
<li><a href="interop/token-bridging.html#superchainmint"><code>SuperchainMint</code></a></li>
<li><a href="interop/token-bridging.html#superchainburn"><code>SuperchainBurn</code></a></li>
<li><a href="interop/token-bridging.html#superchainminted"><code>SuperchainMinted</code></a></li>
<li><a href="interop/token-bridging.html#superchainburnt"><code>SuperchainBurnt</code></a></li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -11900,7 +11900,7 @@ <h3 id="properties"><a class="header" href="#properties">Properties</a></h3>
using interop message passing
using a custom bridge or implementing <code>sendERC20</code> and <code>relayERC20</code> on their own contracts.</p>
<h3 id="interface-8"><a class="header" href="#interface-8">Interface</a></h3>
<p>Implementations of the <code>SuperchainERC20</code> standard will need to implement the following two public functions:</p>
<p>Implementations of the <code>SuperchainERC20</code> standard will need to implement two external functions and two events:</p>
<h4 id="__superchainmint"><a class="header" href="#__superchainmint"><code>__superchainMint</code></a></h4>
<p>Mints <code>_amount</code> of token to address <code>_account</code>. It should only be callable by the <code>SuperchainERC20Bridge</code></p>
<pre><code class="language-solidity">__superchainMint(address _account, uint256 _amount)
Expand All @@ -11909,13 +11909,13 @@ <h4 id="__superchainburn"><a class="header" href="#__superchainburn"><code>__sup
<p>Burns <code>_amount</code> of token from address <code>_account</code>. It should only be callable by the <code>SuperchainERC20Bridge</code></p>
<pre><code class="language-solidity">__superchainBurn(address _account, uint256 _amount)
</code></pre>
<h4 id="superchainmint"><a class="header" href="#superchainmint"><code>SuperchainMint</code></a></h4>
<h4 id="superchainminted"><a class="header" href="#superchainminted"><code>SuperchainMinted</code></a></h4>
<p>MUST trigger when <code>__superchainMint</code> is called</p>
<pre><code class="language-solidity">event SuperchainMint(address indexed _to, uint256 _amount)
<pre><code class="language-solidity">event SuperchainMinted(address indexed _to, uint256 _amount)
</code></pre>
<h4 id="superchainburn"><a class="header" href="#superchainburn"><code>SuperchainBurn</code></a></h4>
<h4 id="superchainburnt"><a class="header" href="#superchainburnt"><code>SuperchainBurnt</code></a></h4>
<p>MUST trigger when <code>__superchainBurn</code> is called</p>
<pre><code class="language-solidity">event SuperchainBurn(address indexed _from, uint256 _amount)
<pre><code class="language-solidity">event SuperchainBurnt(address indexed _from, uint256 _amount)
</code></pre>
<h2 id="superchainerc20bridge-1"><a class="header" href="#superchainerc20bridge-1"><code>SuperchainERC20Bridge</code></a></h2>
<p>The <code>SuperchainERC20Bridge</code> is a predeploy that works as an abstraction
Expand Down Expand Up @@ -11947,18 +11947,18 @@ <h2 id="diagram-1"><a class="header" href="#diagram-1">Diagram</a></h2>

from-&gt;&gt;L2SBA: sendERC20To(tokenAddr, to, amount, chainID)
L2SBA-&gt;&gt;SuperERC20_A: __superchainBurn(from, amount)
SuperERC20_A--&gt;SuperERC20_A: emit SuperchainBurn(from, amount)
SuperERC20_A--&gt;SuperERC20_A: emit SuperchainBurnt(from, amount)
L2SBA-&gt;&gt;Messenger_A: sendMessage(chainId, message)
L2SBA--&gt;L2SBA: emit SentERC20(tokenAddr, from, to, amount, destination)
Inbox-&gt;&gt;Messenger_B: relayMessage()
Messenger_B-&gt;&gt;L2SBB: relayERC20(tokenAddr, from, to, amount)
L2SBB-&gt;&gt;SuperERC20_B: __superchainMint(to, amount)
SuperERC20_B--&gt;SuperERC20_B: emit SuperchainMint(to, amount)
SuperERC20_B--&gt;SuperERC20_B: emit SuperchainMinted(to, amount)
L2SBB--&gt;L2SBB: emit RelayedERC20(tokenAddr, from, to, amount, source)
</pre>
<h2 id="implementation"><a class="header" href="#implementation">Implementation</a></h2>
<p>An example implementation for the <code>sendERC20</code> and <code>relayERC20</code> functions is provided.</p>
<pre><code class="language-solidity">function sendERC20(SuperchainERC20 _token, address _to, uint256 _amount, uint256 _chainId) public {
<pre><code class="language-solidity">function sendERC20(SuperchainERC20 _token, address _to, uint256 _amount, uint256 _chainId) external {
_token.__superchainBurn(msg.sender, _amount);

bytes memory _message = abi.encodeCall(this.relayERC20, (_token, msg.sender, _to, _amount));
Expand Down Expand Up @@ -12025,14 +12025,14 @@ <h3 id="concatenated-action"><a class="header" href="#concatenated-action">Conca
from-&gt;&gt;Intermediate_A: sendWithData(data)
Intermediate_A-&gt;&gt;L2SBA: sendERC20To(tokenAddr, to, amount, chainID)
L2SBA-&gt;&gt;SuperERC20_A: __superchainBurn(from, amount)
SuperERC20_A--&gt;SuperERC20_A: emit SuperchainBurn(from, amount)
SuperERC20_A--&gt;SuperERC20_A: emit SuperchainBurnt(from, amount)
L2SBA-&gt;&gt;Messenger_A: sendMessage(chainId, message)
L2SBA--&gt;L2SBA: emit SentERC20(tokenAddr, from, to, amount, destination)
Intermediate_A-&gt;&gt;Messenger_A: sendMessage(chainId, to, data)
Inbox-&gt;&gt;Messenger_B: relayMessage()
Messenger_B-&gt;&gt;L2SBB: relayERC20(tokenAddr, from, to, amount)
L2SBB-&gt;&gt;SuperERC20_B: __superchainMint(to, amount)
SuperERC20_B--&gt;SuperERC20_B: emit SuperchainMint(to, amount)
SuperERC20_B--&gt;SuperERC20_B: emit SuperchainMinted(to, amount)
Inbox-&gt;&gt;Messenger_B: relayMessage(): call
L2SBB--&gt;L2SBB: emit RelayedERC20(tokenAddr, from, to, amount, source)
Messenger_B-&gt;&gt;to: call(data)
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 3f3e09f

Please sign in to comment.