Starknet 백서

Starknet

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 73쪽 중 59쪽

epolia.json) | ### Staking #### Mainnet | | | | - | - | | Staking contract | 0x00ca1702e64c81d9a07b86bd2c540188d92a2c73cf5cc0e508d949015e7e84a7 | | L1 Reward supplier contract | 0xCa1406D57eD09947E68DE121316C87113fBE9ff5 | | L2 Reward supplier contract | 0x009035556d1ee136e7722ae4e78f92828553a45eed3bc9b2aba90788ec2ca112 | | Mint manager contract | 0xCa14076A3cec95448BaD179cc19B351A4204B88B | | Minting curve contract | 0x00ca1705e74233131dbcdee7f1b8d2926bf262168c7df339004b3f46015b6984 | | Attestation contract | 0x10398fe631af9ab2311840432d507bf7ef4b959ae967f1507928f5afe888a99 | | **Stakable tokens** | | | :- | :- | | STRK | 0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d | | WBTC | 0x03fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac | | SolvBTC | 0x0593e034dda23eea82d2ba9a30960ed42cf4a01502cc2351dc9b9881f9931a68 | | tBTC | 0x04daa17763b286d1e59b97c283c0b8c949994c361e426a28f743c67bdfe9a32f | | LBTC | 0x036834a40984312f7f7de8d31e3f6305b325389eaeea5b1c0664b2fb936461a4 | #### Sepolia | | | | - | - | | Staking contract | 0x03745ab04a431fc02871a139be6b93d9260b0ff3e779ad9c8b377183b23109f1 | | L1 Reward supplier contract | 0xE58d25681B9d290D60e4d7f379a05d5BFD973fFB | | L2 Reward supplier contract | 0x02ebbebb8ceb2e07f30a5088f5849afd4f908f04f3f9c97c694e5d83d2a7cc61 | | Mint manager contract | 0x648D1B35a932F5189e7ff97b2F795E03734DE4ce | | Minting curve contract | 0x06043928ca93cff6d6f39378ba391d7152eea707bdd624c1b2074e71af2abaca | | Attestation contract | 0x03f32e152b9637c31bfcf73e434f78591067a01ba070505ff6ee195642c9acfb | | **Stakable tokens** | | | :- | :- | | STRK | 0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d | | TestBTC1 token | 0x044ad07751ad782288413c7db42c48e1c4f6195876bca3b6caef449bb4fb8d36 | | TestBTC2 token | 0x07e97477601e5606359303cf50c050fd3ba94f66bd041f4ed504673ba2b81696 | # Compatibility tables Source: https://docs.starknet.io/learn/cheatsheets/compatibility <Note> For the RPC, Cairo, and Sierra versions, the version specified is the latest version supported by the respective Starknet version. For the Pathfinder and Juno versions, the version specified is the recommended version for running a full node with the respective Starknet version. </Note> ## Starknet versions | | Starknet 0.14.3 | Starknet 0.14.2 | Starknet 0.14.1 | Starknet 0.14.0 | | - | - | :- | :- | :- | | RPC | 0.10.2 | 0.10.2 | 0.10 | 0.9 | | Cairo | 2.19.0 | 2.18.0 | 2.13.2 | 2.12.0 | | Sierra | 1.9.0 | 1.7.0 | 1.7.0 | 1.7.0 | | Pathfinder | 0.22.7 | 0.22.2 | 0.21.3 | 0.18.0 | | Juno | 0.16.4 | 0.15.22 | 0.15.15 | 0.15.1 | ## Starknet RPC versions <Note> For the latest Starknet RPC API version, the version specified is the recommended version for working with the respective API version. If a newer version exist, the newest version should be used instead. For older versions, the version specified is the last recommended version of the tool that worked with the respective API version. </Note> | | RPC 0.10.2 | RPC 0.10 | RPC 0.9 | RPC 0.8 | | - | - | :- | :- | :- | | Pathfinder | 0.22.7 | 0.21 | 0.18.0 | 0.16.2 | | Juno | 0.16.4 | 0.15.11 | 0.15.1 | 0.14.2 | | Starknet Foundry | 0.62.0 | 0.53 | 0.48.0 | 0.39.0 | | Starknet Devnet | 0.9.0 | 0.7 | 0.5.0-rc.4 | 0.3.0 | | starknet.js | 10.4.0 | 8.9.0 | 8.0.0-beta.4 | 7.0.1 | | starknet.py | 0.30.0 | 0.29.0 | 0.28.0-rc.3 | 0.26.0 | | starknet-rs | 0.19.1 | 0.18.0 | 0.17.2-rc.2 | 0.14.0 | | starknet-jvm | 0.18.0 | 0.17.0-rc.0 | 0.16.0-rc.0 | 0.14.0 | | starknet.swift | 0.16.0 | 0.15.0 | v0.14.0-rc.1 | 0.13.1 | ## # Developer integrations Source: https://docs.starknet.io/learn/cheatsheets/integrations <Warning> This page is continuously updated. If a project you are using is missing, please consider opening an issue or editing the page. </Warning> ## Infrastructure * **Full nodes:** [Juno](https://www.nethermind.io/juno), [Madara](https://github.com/madara-alliance/madara), and [Pathfinder](https://docs.swmansion.com/pathfinder) * **RPC providers:** [Alchemy](http://www.alchemy.com/starknet), [All That Node](https://www.allthatnode.com/starknet.dsrv), [BlockPI](http://blockpi.io/starknet), [Chainstack](https://chainstack.com/build-better-with-starknet/), [dRPC](https://drpc.org/chainlist/starknet), [Dwellir](https://www.dwellir.com/), [GetBlock](https://getblock.io/nodes/strk/), [Infura](https://www.infura.io/networks/ethereum/starknet), [Lava](https://www.lavanet.xyz/), [NOWNodes](https://nownodes.io/starknet), [OMNIA](https://omniatech.io/), [OnFinality](https://onfinality.io/networks/starknet), [QuickNode](https://www.quicknode.com/chains/strk), [Spectrum](https://spectrumnodes.com/), and [Zan](https://zan.top/home/node-service) <Note> OnFinality also provides a WSS open endpoint, and dRPC and Lava also provide open endpoints to Sepolia. For version support: * In Dwellir, GetBlock, Lava, and Zan, use the `/rpc/vX_Y` suffix (e.g., use `/rpc/v0_9` for v0.9.0) * In Alchemy, see [docs.alchemy.com/reference/starknet-api-faq](https://docs.alchemy.com/reference/starknet-api-faq#what-versions-of-starknet-api-are-supported) * In Chainstack, see [docs.chainstack.com/reference/getting-started-starknet](https://docs.chainstack.com/reference/getting-started-starknet#starknet-json-rpc-version-endpoints) * In QuickNode, see [quicknode.com/docs/starknet](https://www.quicknode.com/docs/starknet#supporting-multiple-versions) For complete information on the Starknet JSON-RPC API, see [`starknet_api_openrpc.json`](https://github.com/starkware-libs/starknet-specs/blob/master/api/starknet_api_openrpc.json). </Note> * **Sepolia Faucet:** [Starknet Foundation](https://faucet.starknet.io/) * **Paymaster:** [AVNU](https://github.com/avnu-labs/paymaster) ## Analytics and monitoring * **Block explorers:** [Cartridge](https://explorer.cartridge.gg/), [OKLink](https://www.oklink.com/starknet), [Starkscan](https://starkscan.co), [ViewBlock](https://viewblock.io/starknet), and [Voyager](https://voyager.online) <Note> [Starkscan](https://sepolia.starkscan.co/) and [Voyager](https://sepolia.voyager.online) also provide explorers for Sepolia. </Note> * **Monitoring tools:** [Starknet Monitor](https://www.starknet-monitor.com/) and [Starknet Status](https://status.starknet.io/) * **Indexers:** [Apibara](https://www.apibara.com/), [Checkpoint](https://checkpoint.box/), [DipDup](https://dipdup.io/), [Footprint Analytics](https://www.footprint.network/), [Goldsky](https://goldsky.com/chains/starknet), [SubQuery](https://subquery.network/), [The Graph](https://thegraph.com/), and [Token Flow](https://tokenflow.live/) * **Enhanced APIs:** [Alchemy](https://docs.alchemy.com/reference/starknet-api-endpoints#nft-api), [ArkProject](https://www.arkproject.dev/products/nft-api), and [Starkscan](https://starkscan.co/api-info) ## Bridges and interoperability * **Bridges:** [ArkProject](https://bridge.arkproject.dev/) (NFT bridge), [Layerswap](https://layerswap.io/app), [Mini Bridge](https://minibridge.chaineye.tools/?src=ethereum\&dst=starknet), [Orbiter Finance](https://www.orbiter.finance/en?src_chain=1\&tgt_chain=SN_MAIN\&src_token=ETH), [Owlto Finance](https://owlto.finance/), [Rango](https://app.rango.exchange/bridge?fromBlockchain=ARBITRUM\&fromToken=ETH\&toBlockchain=STARKNET\&toToken=ETH—0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7), [Rhino.fi](https://app.rhino.fi/bridge?token=ETH\&chainOut=STARKNET\&chain=ETHEREUM), [RetroBridge](https://app.retrobridge.io/?tokenFrom=ETH), and [StarkGate](https://starkgate.starknet.io/bridge/deposit) * **Oracles:** [Chainlink](https://docs.chain.link/data-feeds/starknet/), [Pragma](https://docs.pragma.build/starknet/), and [Pyth](https://docs.pyth.network/price-feeds/use-real-time-data/starknet/) ## User interfaces * **Wallets:** [Braavos](https://braavos.app/), [Keplr](https://www.keplr.app/), [Ledger](https://www.ledger.com/), [MetaMask](https://snaps.consensys.io/starknet), and [Ready](https://www.ready.co/ready-wallet) * **On-ramps:** [Banxa](https://banxa.com/), [Changelly](https://changelly.com/), [Checkout](https://fun.xyz/), [Moonpay](https://www.moonpay.com/), [Onramp Money](https://onramp.money/), [Ramp](https://ramp.network/), [Transak](https://transak.com/), and [Unlimit Crypto](https://www.crypto.unlimit.com/) ## Security * **Auditors:** [ABDK](https://www.abdk.consulting/), [Beosin](https://beosin.com/), [Beyond](https://beyondaudit.github.io/), [Cairo Security Clan](https://cairosecurityclan.com/), [ChainSecurity](https://chainsecurity.com/), [CODESPECT](https://codespect.net/), [ConsenSys](http://consensys.net/diligence), [Defense](https://thesis.co/defense), [Extropy](https://www.extropy.io/), [FuzzingLabs](https://fuzzinglabs.com/), [Ginger Security](https://gingersec.xyz/), [Hashlock](https://hashlock.com/), [Nethermind Security](https://www.nethermind.io/smart-contract-audits), [Oak Security](https://www.oaksecurity.io/), [Open Zeppelin](https://www.openzeppelin.com/), [OtterSec](https://osec.io/), [PeckShield](https://peckshield.com/), [Trail of Bits](http://www.trailofbits.com/), and [Zellic](https://www.zellic.io/) * **Security platforms:** [Hypernative](https://www.hypernative.io/) and [Trustblock](https://trustblock.run/) # Messaging functions and events Source: https://docs.starknet.io/learn/cheatsheets/messaging-reference <Tip> For information on the messaging mechanism, see [Messaging mechanism](/learn/protocol/messaging/). </Tip> ## L1 function reference ### `cancelL1ToL2Message` #### Description Cancels an L1 to L2 message. Call this function after calling the [`startL1ToL2MessageCancellation`](#startL1ToL2MessageCancellation) function. The time between the calls to these two functions must be at least the number of seconds defined by the [`messageCancellationDelay`](#messageCancellationDelay) function. Only a sender can cancel a message. If the message is missing, the call reverts. Be aware that the message fee is not refunded. #### State Mutability None. #### Parameters | | | | - | - | | `uint256 toAddress` | The address of the L2 contract. | | `uint256 selector` | The function, in the recipient L2 contract, that the message called. | | `uint256[] calldata payload` | The payload of the message. | | `uint256 nonce` | The nonce of the message. | #### Returns | | | | - | - | | `bytes32 msgHash` | The hash of the canceled message. | #### Emitted event [`MessageToL2Canceled`](#MessageToL2Canceled) #### Function definition Contract: [`StarknetMessaging.sol`](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/solidity/StarknetMessaging.sol) * Function: [`cancelL1ToL2Message`](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/solidity/StarknetMessaging.sol#L161) ### `consumeMessageFromL2` #### Description Consumes a message that was sent from an L2 contract. Returns the hash of the message. #### State Mutability None. #### Parameters | | | | - | - | | `uint256 fromAddress` | The address of the L2 contract sending the message. | | `uint256[] calldata payload` | The payload of the message. | #### Returns | | | | - | - | | `bytes32 msgHash` | The hash of the consumed message. | #### Emitted event [`ConsumedMessageToL1`](#ConsumedMessageToL1) #### Function definition Contract: [`StarknetMessaging.sol`](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/solidity/StarknetMessaging.sol) * Function: [`consumeMessageFromL2`](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/solidity/StarknetMessaging.sol#L132) *** ### `getMaxL1MsgFee` #### Description Returns the maximum fee, in Wei, that Starknet accepts for a single message. If the fee passed is higher than this value, the transaction is not accepted. #### State Mutability `pure` #### Parameters None. #### Returns | | | | - | - | | `uint256 MAX_L1_MSG_FEE` | The maximum fee, in Wei, that Starknet accepts for a single message. | #### Function definition Contract: [`StarknetMessaging.sol`](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/solidity/StarknetMessaging.sol) * Function: [`getMaxL1MsgFee`](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/solidity/StarknetMessaging.sol#L31) *** ### `l1ToL2MessageCancellations` #### Description Returns the timestamp of the cancellation request. #### State Mutability `view` #### Parameters | | | | - | - | | `bytes32 msgHash` | The message hash. | #### Returns | | | | - | - | | `uint256 result` | The Ethereum block timestamp. | Returns `0` if `cancelL1ToL2Message` was not called with the message hash `msgHash`. #### Function definition Contract: [`StarknetMessaging.sol`](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/solidity/StarknetMessaging.sol) * Function: [`l1ToL2MessageCancellations`](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/solidity/StarknetMessaging.sol#L73) *** ### `l1ToL2MessageNonce` #### Description Returns the nonce of the next message sent to the L2 contract. So if If `n` messages have been sent to Starknet, this function returns `n + 1`. #### State Mutability `view` #### Parameters None. #### Returns | | | | - | - | | `uint256 nonce` | The nonce of the next message sending to L2 contract. | #### Function definition Contract: [`StarknetMessaging.sol`](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/solidity/StarknetMessaging.sol) * Function: [`l1ToL2MessageNonce`](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/solidity/StarknetMessaging.sol#L55) *** ### `l1ToL2Messages` #### Description Indicates if a pending message is associated with a given message hash. #### State Mutability `view` #### Parameters | | | | - | - | | `bytes32 msgHash` | The message hash. | #### Returns Returns `uint256 result`, where `result` is one of the following: | | | | - | - | | `message_fee + 1` | A pending message is associated with the `msgHash` parameter. | | `0` | No pending message is associated with the `msgHash` parameter. | #### Function definition Contract: [`StarknetMessaging.sol`](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/solidity/StarknetMessaging.sol) * Function: [`l1ToL2Messages`](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/solidity/StarknetMessaging.sol#L39) *** ### `l2ToL1Messages` #### Description Indicates the number of pending messages associated with a given message hash. #### State Mutability `view` #### Parameters | | | | - | - | | `bytes32 msgHash` | The message hash. | #### Returns Returns `uint256 result`, where `result` is the number of pending messages associated with the `msgHash` parameter. #### Function definition Contract: [`StarknetMessaging.sol`](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/solidity/StarknetMessaging.sol) * Function: [`l2ToL1Messages`](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/solidity/StarknetMessaging.sol#L43) *** ### `messageCancellationDelay` #### Description Returns the time interval, in seconds, after which you can cancel a message starting from the moment of calling the [`startL1ToL2MessageCancellation`](#startL1ToL2MessageCancellation) function. You can get the real value by calling the [`messageCancellationDelay`](https://etherscan.io/address/0xc662c410c0ecf747543f5ba90660f6abebd9c8c4#readProxyContract#F11) function on a block explorer, such as Etherscan. #### State Mutability `view` #### Parameters None. #### Returns | | | | - | - | | `uint256 result` | The time interval. | #### Function definition Contract: [`StarknetMessaging.sol`](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/solidity/StarknetMessaging.sol) * Function: [`messageCancellationDelay`](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/solidity/StarknetMessaging.sol#L59) *** ### `sendMessageToL2` #### Description Sends a message to an L2 contract. The message fee is the cost of executing this function. #### State Mutability `payable` #### Parameters | | | | - | - | | `uint256 toAddress` | The address of the L2 contract. | | `uint256 selector` | The function, in the recipient L2 contract, that the message called. | | `uint256[] calldata payload` | The payload of the message. | #### Returns | | | | - | - | | `bytes32 msgHash` | The hash of the message. | | `uint256 nonce` | The nonce of the message. | #### Emitted event [`LogMessageToL2`](#LogMessageToL2) #### Function definition Contract: [`StarknetMessaging.sol`](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/solidity/StarknetMessaging.sol) * Function: [`sendMessageToL2`](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/solidity/StarknetMessaging.sol#L110) *** ### `startL1ToL2MessageCancellation` #### Description Starts the cancellation of a message from L1 to L2. You can cancel a message after a predefined about of time from the moment this function is called. The amount of time is set by the [`messageCancellationDelay`](#messageCancellationDelay) function. You can only call this function for a message that is currently pending, and the caller must be the sender of that message. #### State Mutability None. #### Parameters | | | | - | - | | `uint256 toAddress` | The address of the L2 contract. | | `uint256 selector` | The function, in the recipient L2 contract, that the message called. | | `uint256[] calldata payload` | The payload of the message. | | `uint256 nonce` | The nonce of the message. | #### Returns | | | | - | - | | `bytes32 msgHash` | The hash of the cancellation message. | #### Emitted event [`MessageToL2CancellationStarted`](#MessageToL2CancellationStarted) #### Function definition Contract: [`StarknetMessaging.sol`](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/solidity/StarknetMessaging.sol) * Function: [`startL1ToL2MessageCancellation`](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/solidity/StarknetMessaging.sol#L147) ## L1 event reference Events are listed in alphabetical order. *** ### `ConsumedMessageToL1` #### Description This event is emitted when a message from L2 to L1 is consumed by the [`consumeMessageFromL2`](#consumeMessageFromL2) function. #### Event attributes | | | | - | - | | `uint256 indexed fromAddress` | The address of the sender on L2. | | `address indexed toAddress` | The address of the receiver on L1. | | `uint256[] payload` | The payload of the consumed message. | #### Event definition * Contract: [`IStarknetMessagingEvents`](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/solidity/IStarknetMessagingEvents.sol) * Event: [`ConsumedMessageToL1`](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/solidity/IStarknetMessagingEvents.sol#L19) *** ### `LogMessageToL2` #### Description This event is emitted when a message is sent from L1 to L2 by the [`sendMessageToL2`](#sendMessageToL2) function. #### Event attributes | | | | - | - | | `address indexed fromAddress` | The address of the sender on L1. | | `uint256 indexed toAddress` | The address of the receiver on L2. | | `uint256 indexed selector` | The function, in the recipient L2 contract, that the message called. | | `uint256[] payload` | The payload of the message. | | `uint256 nonce` | The nonce of the message. | | `uint256 fee` | The fee associated with the message. | #### Event definition * Contract: [`IStarknetMessagingEvents`](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/solidity/IStarknetMessag
프로젝트로 돌아가기