Skip to content

Commit

Permalink
deploy: b1de5f6
Browse files Browse the repository at this point in the history
  • Loading branch information
tynes committed Oct 11, 2024
1 parent 97f303b commit 7ca7e0e
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 44 deletions.
12 changes: 6 additions & 6 deletions interop/predeploys.html
Original file line number Diff line number Diff line change
Expand Up @@ -940,9 +940,9 @@ <h4 id="senderc20"><a class="header" href="#senderc20"><code>sendERC20</code></a
<code>L2ToL2CrossChainMessenger</code> to mint the <code>_amount</code> of the same token
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>
<p>To burn the token, the <code>sendERC20</code> function
calls <code>__crosschainBurn</code> in the token contract,
calls <code>crosschainBurn</code> in the token contract,
which is included as part of the the <code>ICrosschainERC20</code>
<a href="./token-bridging.html#__crosschainburn">interface</a>
<a href="./token-bridging.html#crosschainburn">interface</a>
implemented by the <code>SuperchainERC20</code> standard.</p>
<p>Returns the <code>msgHash_</code> crafted by the <code>L2ToL2CrossChainMessenger</code>.</p>
<pre><code class="language-solidity">sendERC20(address _tokenAddress, address _to, uint256 _amount, uint256 _chainId) returns (bytes32 msgHash_)
Expand All @@ -955,9 +955,9 @@ <h4 id="relayerc20"><a class="header" href="#relayerc20"><code>relayERC20</code>
and emit an event including the <code>_tokenAddress</code>, the <code>_from</code> and chain id from the
<code>source</code> chain, where <code>_from</code> is the <code>msg.sender</code> of <code>sendERC20</code>.</p>
<p>To mint the token, the <code>relayERC20</code> function
calls <code>__crosschainMint</code> in the token contract,
calls <code>crosschainMint</code> in the token contract,
which is included as part of the the <code>ICrosschainERC20</code>
<a href="./token-bridging.html#__crosschainmint">interface</a>
<a href="./token-bridging.html#crosschainmint">interface</a>
implemented by the <code>SuperchainERC20</code> standard.</p>
<pre><code class="language-solidity">relayERC20(address _tokenAddress, address _from, address _to, uint256 _amount)
</code></pre>
Expand All @@ -983,15 +983,15 @@ <h3 id="diagram"><a class="header" href="#diagram">Diagram</a></h3>
participant SuperERC20_B as SuperchainERC20 (Chain B)

from-&gt;&gt;L2SBA: sendERC20(tokenAddr, to, amount, chainID)
L2SBA-&gt;&gt;SuperERC20_A: __crosschainBurn(from, amount)
L2SBA-&gt;&gt;SuperERC20_A: crosschainBurn(from, amount)
SuperERC20_A--&gt;SuperERC20_A: emit SuperchainBurn(from, amount)
L2SBA-&gt;&gt;Messenger_A: sendMessage(chainId, message)
Messenger_A-&gt;&gt;L2SBA: return msgHash_
L2SBA--&gt;L2SBA: emit SentERC20(tokenAddr, from, to, amount, destination)
L2SBA-&gt;&gt;from: return msgHash_
Inbox-&gt;&gt;Messenger_B: relayMessage()
Messenger_B-&gt;&gt;L2SBB: relayERC20(tokenAddr, from, to, amount)
L2SBB-&gt;&gt;SuperERC20_B: __crosschainMint(to, amount)
L2SBB-&gt;&gt;SuperERC20_B: crosschainMint(to, amount)
SuperERC20_B--&gt;SuperERC20_B: emit SuperchainMinted(to, amount)
L2SBB--&gt;L2SBB: emit RelayedERC20(tokenAddr, from, to, amount, source)
</pre>
Expand Down
30 changes: 15 additions & 15 deletions interop/token-bridging.html
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ <h1 id="token-bridging"><a class="header" href="#token-bridging">Token Bridging<
<li><a href="#properties">Properties</a></li>
<li><a href="#icrosschainerc20"><code>ICrosschainERC20</code></a>
<ul>
<li><a href="#__crosschainmint"><code>__crosschainMint</code></a></li>
<li><a href="#__crosschainburn"><code>__crosschainBurn</code></a></li>
<li><a href="#crosschainmint"><code>crosschainMint</code></a></li>
<li><a href="#crosschainburn"><code>crosschainBurn</code></a></li>
<li><a href="#crosschainminted"><code>CrosschainMinted</code></a></li>
<li><a href="#crosschainburnt"><code>CrosschainBurnt</code></a></li>
</ul>
Expand Down Expand Up @@ -230,7 +230,7 @@ <h3 id="properties"><a class="header" href="#properties">Properties</a></h3>
interface and include the following properties:</p>
<ol>
<li>Only allow <code>SuperchainERC20Bridge</code> to call
<a href="#__crosschainmint"><code>__crosschainMint</code></a> and <a href="#__crosschainburn"><code>__crosschainBurn</code></a>.</li>
<a href="#crosschainmint"><code>crosschainMint</code></a> and <a href="#crosschainburn"><code>crosschainBurn</code></a>.</li>
<li>Be deployed at the same address on every chain in the Superchain.</li>
</ol>
<p>The first property will allow the <code>SuperchainERC20Bridge</code> to have a liquidity guarantee,
Expand All @@ -251,20 +251,20 @@ <h3 id="properties"><a class="header" href="#properties">Properties</a></h3>
<h3 id="icrosschainerc20"><a class="header" href="#icrosschainerc20"><code>ICrosschainERC20</code></a></h3>
<p>Implementations of the <code>SuperchainERC20</code> standard will need to implement the <code>ICrosschainERC20</code>
token standard, that includes two external functions and two events:</p>
<h4 id="__crosschainmint"><a class="header" href="#__crosschainmint"><code>__crosschainMint</code></a></h4>
<h4 id="crosschainmint"><a class="header" href="#crosschainmint"><code>crosschainMint</code></a></h4>
<p>Mints <code>_amount</code> of token to address <code>_account</code>.</p>
<pre><code class="language-solidity">__crosschainMint(address _account, uint256 _amount)
<pre><code class="language-solidity">crosschainMint(address _account, uint256 _amount)
</code></pre>
<h4 id="__crosschainburn"><a class="header" href="#__crosschainburn"><code>__crosschainBurn</code></a></h4>
<h4 id="crosschainburn"><a class="header" href="#crosschainburn"><code>crosschainBurn</code></a></h4>
<p>Burns <code>_amount</code> of token from address <code>_account</code>.</p>
<pre><code class="language-solidity">__crosschainBurn(address _account, uint256 _amount)
<pre><code class="language-solidity">crosschainBurn(address _account, uint256 _amount)
</code></pre>
<h4 id="crosschainminted"><a class="header" href="#crosschainminted"><code>CrosschainMinted</code></a></h4>
<p>MUST trigger when <code>__crosschainMint</code> is called</p>
<p>MUST trigger when <code>crosschainMint</code> is called</p>
<pre><code class="language-solidity">event CrosschainMinted(address indexed _to, uint256 _amount)
</code></pre>
<h4 id="crosschainburnt"><a class="header" href="#crosschainburnt"><code>CrosschainBurnt</code></a></h4>
<p>MUST trigger when <code>__crosschainBurn</code> is called</p>
<p>MUST trigger when <code>crosschainBurn</code> is called</p>
<pre><code class="language-solidity">event CrosschainBurnt(address indexed _from, uint256 _amount)
</code></pre>
<h2 id="superchainerc20bridge"><a class="header" href="#superchainerc20bridge"><code>SuperchainERC20Bridge</code></a></h2>
Expand Down Expand Up @@ -297,22 +297,22 @@ <h2 id="diagram"><a class="header" href="#diagram">Diagram</a></h2>
participant SuperERC20_B as SuperchainERC20 (Chain B)

from-&gt;&gt;L2SBA: sendERC20(tokenAddr, to, amount, chainID)
L2SBA-&gt;&gt;SuperERC20_A: __crosschainBurn(from, amount)
L2SBA-&gt;&gt;SuperERC20_A: crosschainBurn(from, amount)
SuperERC20_A--&gt;SuperERC20_A: emit CrosschainBurnt(from, amount)
L2SBA-&gt;&gt;Messenger_A: sendMessage(chainId, message)
Messenger_A-&gt;&gt;L2SBA: return msgHash_
L2SBA--&gt;L2SBA: emit SentERC20(tokenAddr, from, to, amount, destination)
L2SBA-&gt;&gt;from: return msgHash_
Inbox-&gt;&gt;Messenger_B: relayMessage()
Messenger_B-&gt;&gt;L2SBB: relayERC20(tokenAddr, from, to, amount)
L2SBB-&gt;&gt;SuperERC20_B: __crosschainMint(to, amount)
L2SBB-&gt;&gt;SuperERC20_B: crosschainMint(to, amount)
SuperERC20_B--&gt;SuperERC20_B: emit CrosschainMinted(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) external returns (bytes32 msgHash_) {
_token.__crosschainBurn(msg.sender, _amount);
_token.crosschainBurn(msg.sender, _amount);

bytes memory _message = abi.encodeCall(this.relayERC20, (_token, msg.sender, _to, _amount));

Expand All @@ -327,7 +327,7 @@ <h2 id="implementation"><a class="header" href="#implementation">Implementation<

uint256 _source = L2ToL2CrossChainMessenger.crossDomainMessageSource();

_token.__crosschainMint(_to, _amount);
_token.crosschainMint(_to, _amount);

emit RelayedERC20(address(_token), _from, _to, _amount, _source);
}
Expand Down Expand Up @@ -378,14 +378,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: __crosschainBurn(from, amount)
L2SBA-&gt;&gt;SuperERC20_A: crosschainBurn(from, amount)
SuperERC20_A--&gt;SuperERC20_A: emit CrosschainBurnt(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: __crosschainMint(to, amount)
L2SBB-&gt;&gt;SuperERC20_B: crosschainMint(to, amount)
SuperERC20_B--&gt;SuperERC20_B: emit CrosschainMinted(to, amount)
Inbox-&gt;&gt;Messenger_B: relayMessage(): call
L2SBB--&gt;L2SBB: emit RelayedERC20(tokenAddr, from, to, amount, source)
Expand Down
42 changes: 21 additions & 21 deletions print.html
Original file line number Diff line number Diff line change
Expand Up @@ -11056,9 +11056,9 @@ <h4 id="senderc20"><a class="header" href="#senderc20"><code>sendERC20</code></a
<code>L2ToL2CrossChainMessenger</code> to mint the <code>_amount</code> of the same token
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>
<p>To burn the token, the <code>sendERC20</code> function
calls <code>__crosschainBurn</code> in the token contract,
calls <code>crosschainBurn</code> in the token contract,
which is included as part of the the <code>ICrosschainERC20</code>
<a href="interop/./token-bridging.html#__crosschainburn">interface</a>
<a href="interop/./token-bridging.html#crosschainburn">interface</a>
implemented by the <code>SuperchainERC20</code> standard.</p>
<p>Returns the <code>msgHash_</code> crafted by the <code>L2ToL2CrossChainMessenger</code>.</p>
<pre><code class="language-solidity">sendERC20(address _tokenAddress, address _to, uint256 _amount, uint256 _chainId) returns (bytes32 msgHash_)
Expand All @@ -11071,9 +11071,9 @@ <h4 id="relayerc20"><a class="header" href="#relayerc20"><code>relayERC20</code>
and emit an event including the <code>_tokenAddress</code>, the <code>_from</code> and chain id from the
<code>source</code> chain, where <code>_from</code> is the <code>msg.sender</code> of <code>sendERC20</code>.</p>
<p>To mint the token, the <code>relayERC20</code> function
calls <code>__crosschainMint</code> in the token contract,
calls <code>crosschainMint</code> in the token contract,
which is included as part of the the <code>ICrosschainERC20</code>
<a href="interop/./token-bridging.html#__crosschainmint">interface</a>
<a href="interop/./token-bridging.html#crosschainmint">interface</a>
implemented by the <code>SuperchainERC20</code> standard.</p>
<pre><code class="language-solidity">relayERC20(address _tokenAddress, address _from, address _to, uint256 _amount)
</code></pre>
Expand All @@ -11099,15 +11099,15 @@ <h3 id="diagram"><a class="header" href="#diagram">Diagram</a></h3>
participant SuperERC20_B as SuperchainERC20 (Chain B)

from-&gt;&gt;L2SBA: sendERC20(tokenAddr, to, amount, chainID)
L2SBA-&gt;&gt;SuperERC20_A: __crosschainBurn(from, amount)
L2SBA-&gt;&gt;SuperERC20_A: crosschainBurn(from, amount)
SuperERC20_A--&gt;SuperERC20_A: emit SuperchainBurn(from, amount)
L2SBA-&gt;&gt;Messenger_A: sendMessage(chainId, message)
Messenger_A-&gt;&gt;L2SBA: return msgHash_
L2SBA--&gt;L2SBA: emit SentERC20(tokenAddr, from, to, amount, destination)
L2SBA-&gt;&gt;from: return msgHash_
Inbox-&gt;&gt;Messenger_B: relayMessage()
Messenger_B-&gt;&gt;L2SBB: relayERC20(tokenAddr, from, to, amount)
L2SBB-&gt;&gt;SuperERC20_B: __crosschainMint(to, amount)
L2SBB-&gt;&gt;SuperERC20_B: crosschainMint(to, amount)
SuperERC20_B--&gt;SuperERC20_B: emit SuperchainMinted(to, amount)
L2SBB--&gt;L2SBB: emit RelayedERC20(tokenAddr, from, to, amount, source)
</pre>
Expand Down Expand Up @@ -11575,8 +11575,8 @@ <h1 id="token-bridging"><a class="header" href="#token-bridging">Token Bridging<
<li><a href="interop/token-bridging.html#properties">Properties</a></li>
<li><a href="interop/token-bridging.html#icrosschainerc20"><code>ICrosschainERC20</code></a>
<ul>
<li><a href="interop/token-bridging.html#__crosschainmint"><code>__crosschainMint</code></a></li>
<li><a href="interop/token-bridging.html#__crosschainburn"><code>__crosschainBurn</code></a></li>
<li><a href="interop/token-bridging.html#crosschainmint"><code>crosschainMint</code></a></li>
<li><a href="interop/token-bridging.html#crosschainburn"><code>crosschainBurn</code></a></li>
<li><a href="interop/token-bridging.html#crosschainminted"><code>CrosschainMinted</code></a></li>
<li><a href="interop/token-bridging.html#crosschainburnt"><code>CrosschainBurnt</code></a></li>
</ul>
Expand Down Expand Up @@ -11605,7 +11605,7 @@ <h3 id="properties"><a class="header" href="#properties">Properties</a></h3>
interface and include the following properties:</p>
<ol>
<li>Only allow <code>SuperchainERC20Bridge</code> to call
<a href="interop/token-bridging.html#__crosschainmint"><code>__crosschainMint</code></a> and <a href="interop/token-bridging.html#__crosschainburn"><code>__crosschainBurn</code></a>.</li>
<a href="interop/token-bridging.html#crosschainmint"><code>crosschainMint</code></a> and <a href="interop/token-bridging.html#crosschainburn"><code>crosschainBurn</code></a>.</li>
<li>Be deployed at the same address on every chain in the Superchain.</li>
</ol>
<p>The first property will allow the <code>SuperchainERC20Bridge</code> to have a liquidity guarantee,
Expand All @@ -11626,20 +11626,20 @@ <h3 id="properties"><a class="header" href="#properties">Properties</a></h3>
<h3 id="icrosschainerc20"><a class="header" href="#icrosschainerc20"><code>ICrosschainERC20</code></a></h3>
<p>Implementations of the <code>SuperchainERC20</code> standard will need to implement the <code>ICrosschainERC20</code>
token standard, that includes two external functions and two events:</p>
<h4 id="__crosschainmint"><a class="header" href="#__crosschainmint"><code>__crosschainMint</code></a></h4>
<h4 id="crosschainmint"><a class="header" href="#crosschainmint"><code>crosschainMint</code></a></h4>
<p>Mints <code>_amount</code> of token to address <code>_account</code>.</p>
<pre><code class="language-solidity">__crosschainMint(address _account, uint256 _amount)
<pre><code class="language-solidity">crosschainMint(address _account, uint256 _amount)
</code></pre>
<h4 id="__crosschainburn"><a class="header" href="#__crosschainburn"><code>__crosschainBurn</code></a></h4>
<h4 id="crosschainburn"><a class="header" href="#crosschainburn"><code>crosschainBurn</code></a></h4>
<p>Burns <code>_amount</code> of token from address <code>_account</code>.</p>
<pre><code class="language-solidity">__crosschainBurn(address _account, uint256 _amount)
<pre><code class="language-solidity">crosschainBurn(address _account, uint256 _amount)
</code></pre>
<h4 id="crosschainminted"><a class="header" href="#crosschainminted"><code>CrosschainMinted</code></a></h4>
<p>MUST trigger when <code>__crosschainMint</code> is called</p>
<p>MUST trigger when <code>crosschainMint</code> is called</p>
<pre><code class="language-solidity">event CrosschainMinted(address indexed _to, uint256 _amount)
</code></pre>
<h4 id="crosschainburnt"><a class="header" href="#crosschainburnt"><code>CrosschainBurnt</code></a></h4>
<p>MUST trigger when <code>__crosschainBurn</code> is called</p>
<p>MUST trigger when <code>crosschainBurn</code> is called</p>
<pre><code class="language-solidity">event CrosschainBurnt(address indexed _from, uint256 _amount)
</code></pre>
<h2 id="superchainerc20bridge-1"><a class="header" href="#superchainerc20bridge-1"><code>SuperchainERC20Bridge</code></a></h2>
Expand Down Expand Up @@ -11672,22 +11672,22 @@ <h2 id="diagram-1"><a class="header" href="#diagram-1">Diagram</a></h2>
participant SuperERC20_B as SuperchainERC20 (Chain B)

from-&gt;&gt;L2SBA: sendERC20(tokenAddr, to, amount, chainID)
L2SBA-&gt;&gt;SuperERC20_A: __crosschainBurn(from, amount)
L2SBA-&gt;&gt;SuperERC20_A: crosschainBurn(from, amount)
SuperERC20_A--&gt;SuperERC20_A: emit CrosschainBurnt(from, amount)
L2SBA-&gt;&gt;Messenger_A: sendMessage(chainId, message)
Messenger_A-&gt;&gt;L2SBA: return msgHash_
L2SBA--&gt;L2SBA: emit SentERC20(tokenAddr, from, to, amount, destination)
L2SBA-&gt;&gt;from: return msgHash_
Inbox-&gt;&gt;Messenger_B: relayMessage()
Messenger_B-&gt;&gt;L2SBB: relayERC20(tokenAddr, from, to, amount)
L2SBB-&gt;&gt;SuperERC20_B: __crosschainMint(to, amount)
L2SBB-&gt;&gt;SuperERC20_B: crosschainMint(to, amount)
SuperERC20_B--&gt;SuperERC20_B: emit CrosschainMinted(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) external returns (bytes32 msgHash_) {
_token.__crosschainBurn(msg.sender, _amount);
_token.crosschainBurn(msg.sender, _amount);

bytes memory _message = abi.encodeCall(this.relayERC20, (_token, msg.sender, _to, _amount));

Expand All @@ -11702,7 +11702,7 @@ <h2 id="implementation"><a class="header" href="#implementation">Implementation<

uint256 _source = L2ToL2CrossChainMessenger.crossDomainMessageSource();

_token.__crosschainMint(_to, _amount);
_token.crosschainMint(_to, _amount);

emit RelayedERC20(address(_token), _from, _to, _amount, _source);
}
Expand Down Expand Up @@ -11753,14 +11753,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: __crosschainBurn(from, amount)
L2SBA-&gt;&gt;SuperERC20_A: crosschainBurn(from, amount)
SuperERC20_A--&gt;SuperERC20_A: emit CrosschainBurnt(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: __crosschainMint(to, amount)
L2SBB-&gt;&gt;SuperERC20_B: crosschainMint(to, amount)
SuperERC20_B--&gt;SuperERC20_B: emit CrosschainMinted(to, amount)
Inbox-&gt;&gt;Messenger_B: relayMessage(): call
L2SBB--&gt;L2SBB: emit RelayedERC20(tokenAddr, from, to, amount, source)
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 7ca7e0e

Please sign in to comment.