bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 37쪽 중 31쪽
e>L1BLOCKNUMBER</code></td><td align="center">N/A</td><td>Added in Mantle VM to query the L1 block number.<br>Use <a href="https://github.com/mantlenetworkio/mantle/blob/main/packages/contracts/contracts/L2/predeploys/iBVM_L1BlockNumber.sol"><code>iBVM_L1BlockNumber</code></a> with address <a href="https://github.com/mantlenetworkio/networks/blob/3aa49c0e1c6cc07e621b4f6ec80abd7958075610/mainnet/info/mainnet-info.yaml#L27"><code>0x4200000000000000000000000000000000000013</code></a> to call <code>getL1BlockNumber()</code></td></tr><tr><td align="center"><code>NUMBER</code></td><td align="center"><code>block.number</code></td><td>Returns latest L2 block number</td></tr><tr><td align="center"><code>BASEFEE</code></td><td align="center"><code>block.basefee</code></td><td>Not supported currently, will be available with EIP-1559 update</td></tr></tbody></table>
# Resources and Tooling
# Node RPC Providers
{% hint style="danger" %}
Mantle v2 Tectonic has been released, please move to the new [documentation](https://docs-v2.mantle.xyz/)!
{% endhint %}
We're working with popular node providers that you can use to connect your dApps or games to Mantle network. They enable convenient and scalable API access to Mantle nodes so you can focus on building without having to worry about the underlying infrastructure.
<table><thead><tr><th width="188.33333333333331" align="center">Provider</th><th align="center">Mainnet</th><th align="center">Testnet</th><th data-hidden align="center">Testnet</th></tr></thead><tbody><tr><td align="center">Ankr</td><td align="center"><a href="https://mantle.public-rpc.com/">Available</a></td><td align="center"><a href="https://www.ankr.com/rpc/mantle/">Available</a></td><td align="center"><a href="https://www.ankr.com/rpc/mantle">Available</a></td></tr><tr><td align="center">DRPC</td><td align="center"><a href="https://docs.drpc.org/gettingstarted/createaccount">Available</a></td><td align="center">N/A</td><td align="center"></td></tr><tr><td align="center">Blast API</td><td align="center"><a href="https://blastapi.io/public-api/mantle">Available</a></td><td align="center"><a href="https://blastapi.io/public-api/mantle">Available</a></td><td align="center">Coming soon!</td></tr><tr><td align="center">Allnodes</td><td align="center"><a href="https://mantle.publicnode.com/">Available</a></td><td align="center">N/A</td><td align="center">Coming soon!</td></tr></tbody></table>
# Network Faucet
Obtain testnet $MNT to get started
{% hint style="danger" %}
Mantle v2 Tectonic has been released, please move to the new [documentation](https://docs-v2.mantle.xyz/)!
{% endhint %}
## Testnet Faucets 
### $MNT Faucet
{% hint style="info" %}
Before moving forward please make sure your wallet has sufficient **$gETH (Goerli ETH)** to be used as gas for minting Goerli $MNT. 
{% endhint %}
[Mantle Faucet](https://faucet.testnet.mantle.xyz/) is a simple faucet for Mantle testnet that drips $MNT. It requires the following steps:
1. Authenticate with **Twitter**
2. Enter your wallet address
You will automatically be sent $MNT to your wallet on testnet. 
{% hint style="info" %}
Make sure you import the $MNT token to your wallet using the contract address `0xc1dC2d65A2243c22344E725677A3E3BEBD26E604`
{% endhint %}
### $gETH Faucet
You can get $gETH (Goerli ETH) from any of the following faucets:
1. [Paradigm Faucet](https://faucet.paradigm.xyz/)
2. [Alchemy Faucet](https://goerlifaucet.com/)
{% hint style="info" %}
Once you have some $gETH, you can use the [Mantle bridge](https://bridge.testnet.mantle.xyz) to transfer it to Mantle Goerli testnet.
{% endhint %}
## Mint Test $MNT on Etherscan
{% hint style="info" %}
Make sure your wallet has enough $gETH to perform the mint action before moving forward.
{% endhint %}
1. First, you'll need to look up the test $MNT contract on Etherscan and navigate to the <img src="https://3701411312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNHXgeqhgrznnRobzznxl%2Fuploads%2F6Um3cHMxS2mKk7k0fGUD%2Fimage.png?alt=media&token=40493aa9-5884-4cde-adcf-f773907dcf32" alt="" data-size="line"> section under the <img src="https://3701411312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNHXgeqhgrznnRobzznxl%2Fuploads%2FT8rkwVKWT8kYQF4g23XF%2Fimage.png?alt=media&token=a732bf71-f24e-4f5b-bbf7-26b9e624c846" alt="" data-size="line"> tab. You can follow this link to get there directly:
{% embed url="<https://goerli.etherscan.io/address/0xc1dC2d65A2243c22344E725677A3E3BEBD26E604#writeProxyContract>" %}
2. Next, switch your wallet network to Goerli, and import (if you haven't already) the $MNT token using this contract address: `0xc1dC2d65A2243c22344E725677A3E3BEBD26E604`
3. Now connect your wallet to Etherscan using the <img src="https://3701411312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNHXgeqhgrznnRobzznxl%2Fuploads%2Fdpt5wqt9FUhVtrbwnfYy%2Fimage.png?alt=media&token=e1564f26-140b-40b6-a68c-7ba7722a68f4" alt="" data-size="line"> button.
4. Find and click on the `mint()` function in the list on the Etherscan page. It's on no.9.
<figure><img src="https://3701411312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNHXgeqhgrznnRobzznxl%2Fuploads%2FCtAjJvjPxcRFkzmmgtwz%2Fimage.png?alt=media&token=2fbae3fe-f033-4be5-86cc-f0cf6ecda4fe" alt="" width="375"><figcaption></figcaption></figure>
5. Click on the <img src="https://3701411312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNHXgeqhgrznnRobzznxl%2Fuploads%2F4NCo26uMH6tOmTyvOmQn%2Fimage.png?alt=media&token=61c336cd-6d76-4789-ba49-35ef168a42ce" alt="" data-size="line"> button next to the function name to input a value. The mint amount needs to be entered in *wei* units, so 1 $MNT token is represented as 10^18. Select 10^18 from the drop-down list, and click on the <img src="https://3701411312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNHXgeqhgrznnRobzznxl%2Fuploads%2FamSKH61S4cS7PHQqMgnI%2Fimage.png?alt=media&token=62874213-3632-45c0-9665-635ea574a565" alt="" data-size="line"> button. That'll automatically enter 10^18 (1 followed by 18 zeroes) in the amount field.
<figure><img src="https://3701411312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNHXgeqhgrznnRobzznxl%2Fuploads%2FUNi3uszyqx9JFGD5zLOK%2Fimage.png?alt=media&token=602663b9-e5eb-4914-84db-4f50baf0fda3" alt="" width="371"><figcaption></figcaption></figure>
6. Now you can add a few zeroes at the back for a higher amount. For example, add three zeroes at the back to mint 1000 $MNT, and so on.
<figure><img src="https://3701411312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNHXgeqhgrznnRobzznxl%2Fuploads%2FfH0ILyxOvGIFLeTejWkq%2Fimage.png?alt=media&token=1223ff1d-81e2-4a17-930f-b63b98ebcf7e" alt="" width="375"><figcaption></figcaption></figure>
7. Finally, click on the <img src="https://3701411312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNHXgeqhgrznnRobzznxl%2Fuploads%2FP35Q7kyENkmOeDnlLBMd%2Fimage.png?alt=media&token=7b980452-7750-4c66-aef1-4af439a31b70" alt="" data-size="line"> button to send a transaction. Confirm the action in your wallet, and after a few seconds your $MNT will show up there.
# Mantle Node API
RPC API Reference
{% hint style="danger" %}
Mantle v2 Tectonic has been released, please move to the new [documentation](https://docs-v2.mantle.xyz/)!
{% endhint %}
Applications need to connect to a node to fetch block data and send transactions to the Mantle network. Mantle Network shares the same **JSON-RPC API** implementation as Ethereum.
{% hint style="info" %}
You can refer to the common endpoints [**here**](https://ethereum.org/en/developers/docs/apis/json-rpc/#json-rpc-methods). 
{% endhint %}
We've also introduced custom methods to simplify certain Mantle-specific interactions.
## API Access
All methods can be accessed via **https** and **websocket.**
<table><thead><tr><th width="177.33333333333331" align="center">Name</th><th width="304" align="center">Mainnet</th><th align="center">Testnet</th></tr></thead><tbody><tr><td align="center"><strong>RPC URL</strong></td><td align="center"><a href="https://rpc.mantle.xyz">https://rpc.mantle.xyz</a></td><td align="center"><a href="https://rpc.testnet.mantle.xyz/">https://rpc.testnet.mantle.xyz/</a></td></tr><tr><td align="center"><strong>Websocket URL</strong></td><td align="center">wss://wss.mantle.xyz</td><td align="center">wss://<a href="http://ws.testnet.mantle.xyz/">ws.testnet.mantle.xyz</a></td></tr></tbody></table>
{% hint style="info" %}
The websocket supports an access method equivalent to the **https** interface, along with event subscription and cancellation. See [**here**](https://ethereum.org/en/developers/tutorials/using-websockets/) for reference.
{% endhint %}
## Custom methods
<table><thead><tr><th width="261" align="center">Method</th><th>Description</th></tr></thead><tbody><tr><td align="center"><a href="#eth_getblockrange"><code>eth_getBlockRange</code></a></td><td>Returns block info for multiple blocks, takes a block range as parameter</td></tr><tr><td align="center"><a href="#rollup_getinfo"><code>rollup_getInfo</code></a></td><td>Returns L2 node info</td></tr><tr><td align="center"><a href="#rollup_gasprices"><code>rollup_gasPrices</code></a></td><td>Returns the current L1 and L2 gas prices that a <a href="/network/network/for-validators/network-roles#sequencers">Sequencer</a> node would use to calculate <a href="/network/network/introduction/transaction-fees-on-l2#understanding-fee-basics">gas fees</a> </td></tr></tbody></table>
### `eth_getBlockRange`
Returns the block info in the form of an array of `block` objects for multiple blocks within a specified range. (See [`eth_getBlockByHash`](https://eth.wiki/json-rpc/API#eth_getblockbyhash) for the structure of a `block` object) 
#### Parameters
<table><thead><tr><th width="75" align="center">No.</th><th width="160" align="center">Parameter</th><th width="153">Type</th><th>Description</th></tr></thead><tbody><tr><td align="center">1</td><td align="center"><code>QUANTITY|TAG</code></td><td>Integer | String</td><td>Starting block no. of the range, or one of <code>"earliest"</code>, <code>"latest"</code>, or <code>"pending"</code>, as in the <a href="https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block">default block parameter</a></td></tr><tr><td align="center">2</td><td align="center"><code>QUANTITY|TAG</code></td><td>Integer | String</td><td>Ending block no. of the range, or one of <code>"earliest"</code>, <code>"latest"</code>, or <code>"pending"</code>, as in the <a href="https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block">default block parameter</a></td></tr><tr><td align="center">3</td><td align="center"><code>BOOLEAN</code></td><td>Boolean</td><td>If <code>true</code>, returns full transaction objects<br>If <code>false</code>, returns transaction hashes only</td></tr></tbody></table>
#### Sample Request
{% code overflow="wrap" lineNumbers="true" %}
```shell
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockRange","params":["0x1", "0x2", false],"id":1}' <node url>
```
{% endcode %}
#### Sample Response
{% code lineNumbers="true" %}
```json
{
"jsonrpc":"2.0",
"id":1,
"result":[
{
"difficulty":"0x2",
"extraData":"0xd97735082a846765746889676f312e31352e3133856c696e75780000000000009c3827892825f0825a7e329b6913b84c9e4f89168350aff0939e0e6609629f2e7f07f2aeb62acbf4b16a739cab68866f4880ea406583a4b28a59d4f55dc2314e00",
"gasLimit":"0xe4e1c0",
"gasUsed":"0x3183d",
"hash":"0xbee7192e575af30420cae0c7776304ac196077ee72b048970549e4f08e875453",
"logsBloom":"0x00000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000400000000000100000000000000200000000002000000000000001000000000000000000004000000000000000000000000000040000400000100400000000000000100000000000000000000000000000020000000000000000000000000000000000000000000000001000000000000000000000100000000000000000000000000000000000000000000000000000000000000088000000080000000000010000000000000000000000000000800008000120000000000000000000000000000000002000",
"miner":"0x0000000000000000000000000000000000000000",
"mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce":"0x0000000000000000",
"number":"0x1",
"parentHash":"0x7ca38a1916c42007829c55e69d3e9a73265554b586a499015373241b8a3fa48b",
"receiptsRoot":"0xf4c97b1186b690ad3318f907c0cdaf46f4598f27f711a5609064b2690a767287",
"sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size":"0x30c",
"stateRoot":"0xd3ac40854cd2ac17d8effeae6065cea990b04be714f7061544973feeb2f1c95f",
"timestamp":"0x618d4769",
"totalDifficulty":"0x3",
"transactions":["0x5e77a04531c7c107af1882d76cbff9486d0a9aa53701c30888509d4f5f2b003a"],
"transactionsRoot":"0x19f5efd0d94386e72fcb3f296f1cb2936d017c37487982f76f09c591129f561f",
"uncles":[]
},
{
"difficulty":"0x2",
"extraData":"0xd98301090a848932606889676f312e61742e3133856c696e757800000000000064a82cb66c7810b9619e7f14ab65c769a828b1616974987c530684eb3870b65e5b2400c1b61c6d340beef8c8e99127ac0de50e479d21f0833a5e2910fe64b41801",
"gasLimit":"0xe4e1c0",
"gasUsed":"0x1c60d",
"hash":"0x45fd6ce41bb8ebb2bccdaa92dd1619e367404cb07722039901a7eba63dea1d13",
"logsBloom":"0x00080000000200000000000000000008000000000000000000000100008000000000000000000000000000000000000000000000000000000000400000000000100000000000000000000000020000000000000000000000000000000000004000000000000000000000000000000000400000000400000000000000100000000000000000000000000000020000000000000000000000000000000000000000100000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000008400000000000000000010000000000000000020000000020000000000000000000000000000000000000000000002000",
"miner":"0x0000000000000000000000000000000000000000",
"mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce":"0x0000000000000000",
"number":"0x2",
"parentHash":"0xbee7192e575af30420cae0c7776304ac196077ee72b048970549e4f08e875453",
"receiptsRoot":"0x2057c8fb79c0f294062c1436aa56741134dc46d228a4f874929f8b791a7007a4",
"sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size":"0x30c",
"stateRoot":"0x87026f3a614318ae24bcef6bc8f7564479afbbbe2b1fb189bc133a5de5a2b0f8",
"timestamp":"0x618d8837",
"totalDifficulty":"0x5",
"transactions":["0xaf6ed8a6864d44989adc47c84f6fe0aeb1819817505c42cde6cbbcd5e14dd317"],
"transactionsRoot":"0xa39c4d0d2397f8fcb1683ba833d4ab935cd2f4c5ca6f56a7d9a45b9904ea1c69",
"uncles":[]
}
]
}
```
{% endcode %}
### `rollup_getInfo`
Returns various pieces of information in the form of an `Object` for a specified node. 
The response `Object` structure is as follows:
<table><thead><tr><th width="182" align="center">Field</th><th width="122.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td align="center"><code>mode</code></td><td>String</td><td>Node's mode of operation - <code>"sequencer"</code> or <code>"verifier"</code></td></tr><tr><td align="center"><code>syncing</code></td><td>Boolean</td><td><code>true</code> if the node is currently syncing<br><code>false</code> otherwise</td></tr><tr><td align="center"><code>ethContext</code></td><td>Object</td><td>Nested object. Contains <code>blockNumber</code> and <code>timestamp</code></td></tr><tr><td align="center"><code>blockNumber</code></td><td>Quantity</td><td>Block no. of the latest known L1 block</td></tr><tr><td align="center"><code>timestamp</code></td><td>Quantity</td><td>Timestamp of the latest known L1 block</td></tr><tr><td align="center"><code>rollupContext</code></td><td>Object</td><td>Nested object. Contains <code>queueIndex</code>, <code>index</code>, and <code>verifiedIndex</code></td></tr><tr><td align="center"><code>queueIndex</code></td><td>Quantity</td><td>Index within the CTC of the last L1 to L2 message ingested</td></tr><tr><td align="center"><code>index</code></td><td>Quantity</td><td>Index of the last L2 transaction processed</td></tr><tr><td align="center"><code>verifiedIndex</code></td><td>Quantity</td><td>Index of the last transaction that was ingested from a batch that was posted to L1</td></tr></tbody></table>
#### Parameters
None
#### Sample Request
{% code overflow="wrap" lineNumbers="true" %}
```shell
curl -X POST --data '{"jsonrpc":"2.0","method":"rollup_getInfo","params":[],"id":1}' <node url>
```
{% endcode %}
#### Sample Response
{% code lineNumbers="true" %}
```json
{
"jsonrpc":"2.0",
"id":1,
"result":{
"mode":"verifier",
"syncing":false,
"ethContext":{
"blockNumber":10743302,
"timestamp":1957082793
},
"rollupContext":{
"index":11287,
"queueIndex":14362,
"verifiedIndex":0
}
}
}
```
{% endcode %}
### `rollup_gasPrices`
Returns an `Object` containing the L1 and L2 gas prices used by the Sequencer to calculate transaction gas fees.
The response `Object` structure is as follows:
<table><thead><tr><th width="161.33333333333331" align="center">Field</th><th width="111">Type</th><th>Description</th></tr></thead><tbody><tr><td align="center"><code>l1GasPrice</code></td><td>Quantity</td><td>L1 gas price in <em>wei</em> (used to estimate L1 calldata costs)</td></tr><tr><td align="center"><code>l2GasPrice</code></td><td>Quantity</td><td>L2 gas price in <em>wei</em> (used to estimate L2 execution costs)</td></tr></tbody></table>
#### Parameters
None
#### Sample Request
{% code overflow="wrap" lineNumbers="true" %}
```shell
curl -X POST --data '{"jsonrpc":"2.0","method":"rollup_gasPrices","params":[],"id":1}' <node url>
```
{% endcode %}
#### Sample Response
{% code lineNumbers="true" %}
```json
{
"jsonrpc":"2.0",
"id":1,
"result":{
"l1GasPrice":"0x254aa66732",
"l2GasPrice":"0xf3792"
}
}
```
{% endcode %}
## Unsupported Methods
<table><thead><tr><th width="240" align="center">Method</th><th>Description</th></tr></thead><tbody><tr><td align="center"><code>eth_getAccounts</code></td><td><p>Used to fetch the list of addresses owned by a user. Mantle nodes do not expose internal wallets for security reasons, and thus block the <code>eth_getAccounts</code> method. </p><p>You can use an external wallet service as an alternative.</p></td></tr><tr><td align="center"><code>eth_sendTransaction</code></td><td><p>Mantle nodes block <code>eth_sendTransaction</code> for security reasons as well. </p><p>This is different from <code>eth_sendRawTransaction</code> which takes a signed transaction as input, and is supported by Mantle nodes. </p></td></tr></tbody></table>
 
# Mantle Bridge API
A guide on using the Mantle Bridge API to move assets and data between Layer 1 and Layer 2
{% hint style="danger" %}
Mantle v2 Tectonic has been released, please move to the new [documentation](https://docs-v2.mantle.xyz/)!
{% endhint %}
The Mantle SDK implements methods to make contract calls for both:
* Locking $MNT/ERC20/ERC721 tokens on Layer 1 (L1) and minting equivalent tokens on Layer 2 (L2)
* Locking $MNT/ERC20/ERC721 tokens on L2 and minting equivalent tokens on L1
{% hint style="info" %}
Use [this link](https://sdk.mantle.xyz/index.html) to navigate to our SDK reference docs.
{% endhint %}
## Bridge Contracts
The Mantle Bridge is composed of two main contracts:
* [L1StandardBridge](https://github.com/mantlenetworkio/mantle/blob/main/packages/contracts/contracts/L1/messaging/L1StandardBridge.sol)[ ](https://github.com/ethereum-optimism/optimism/blob/master/packages/contracts/contracts/L1/messaging/L1StandardBridge.sol)on L1
* [L2StandardBridge](https://github.com/mantlenetworkio/mantle/blob/main/packages/contracts/contracts/L2/messaging/L2StandardBridge.sol) on L2
## SDK Tutorials
You can follow the links below to refer step-by-step guides on how to use the Mantle SDK to bridge asset프로젝트로 돌아가기