diff --git a/docs/builder/_category_.json b/docs/builder/_category_.json new file mode 100644 index 00000000..0085891d --- /dev/null +++ b/docs/builder/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "Builder", + "collapsible": false, + "position": 1 +} diff --git a/docs/builder/ethereum-api.md b/docs/builder/ethereum-api.md new file mode 100644 index 00000000..14ae92cf --- /dev/null +++ b/docs/builder/ethereum-api.md @@ -0,0 +1,108 @@ +--- +sidebar_position: 105 +--- + +# Ethereum API + +## Introduction + +DVM(Darwinia Virtual Machine) is fully compatible with EVM (Ethereum Virtual Machine) in Darwinia Network. + +You can use `web3.js` or other [ethereum tools](#dev-tools) to interact with Darwinia using Ethereum compactible RPC api. + +## RPC List + +> Note: The currently implemented RPC apis is compatible with Ethereum, but some apis are not yet implemented. + +## Supported Interfaces + +- [x] debug_traceBlockByNumber +- [x] debug_traceByHash +- [x] debug_traceTransaction +- [x] eth_accounts +- [x] eth_blockNumber +- [x] eth_chainId +- [x] eth_coinbase +- [x] eth_call +- [x] eth_estimateGas +- [x] eth_feeHistory +- [x] eth_gasPrice +- [x] eth_getBlockByHash +- [x] eth_getBlockByNumber +- [x] eth_getTransactionCount +- [x] eth_getBlockTransactionCountByHash +- [x] eth_getBlockTransactionCountByNumber +- [x] eth_getCode +- [x] eth_getTransactionByBlockHashAndIndex +- [x] eth_getTransactionByHash +- [x] eth_getTransactionByBlockNumberAndIndex +- [x] eth_getTransactionReceipt +- [x] eth_getUncleByBlockHashAndIndex +- [x] eth_getUncleByBlockNumberAndIndex +- [x] eth_getUncleCountByBlockHash +- [x] eth_getUncleCountByBlockNumber +- [x] eth_getLogs +- [x] eth_getWork +- [x] eth_getBalance +- [x] eth_getFilterChanges +- [x] eth_getFilterLogs +- [x] eth_hashrate +- [x] eth_mining +- [x] eth_newFilter +- [x] eth_newBlockFilter +- [x] eth_newPendingTransactionFilter +- [x] eth_protocolVersion +- [x] eth_sendTransaction +- [x] eth_sendRawTransaction +- [x] eth_submitWork +- [x] eth_submitHashrate +- [x] eth_subscription +- [x] eth_syncing +- [x] eth_unsubscribe +- [x] eth_uninstallFilter +- [x] net_version +- [x] net_peerCount +- [x] net_listening +- [x] trace_filter +- [x] web3_clientVersion +- [x] web3_sha3 + +## Things Dapp developers must know + +### Use `block.timestamp` instead of `block.number` + +On Ethereum or other EVM-Compatible platform, you may use `block.number` in contract, but this is not recommended in CSC. We may introduce CSC 2.0 (The Next Generation of CSC) in the future and export the data from CSC 1.0 to CSC 2.0, which may reset the chain height to zero, so we recommend using `block.timestamp`. + +### Consensus Related Field + +Ethereum uses a consensus protocol named Proof-of-Work (PoW). While CSC uses the Nominated Proof of Stake(NPOS). They are two completely different consensus mechanisms. Consequently, Proof of Work concepts, such as `difficulty`, `uncles`, `hashrate`, generally is not applicable to CSC. For APIs that return value related to Ethereum’s Proof of Work, default value are returned. + +### Genesis Block + +It is particularly important to note that CSC's genesis block does not start at 0 like Ethereum. It is `4969901`. This means that if you try to query the block history before `4969901` with `eth_getBlockByNumber()` or `eth_getBlockByHash()`, you will get `null`. This is because the DVM smart contract solution was added in the middle of the Substrate-base Crab chain, there are no Ethereum transactions in the Substrate history blocks and no corresponding Ethereum history blocks generated. + +### Ethereum Block Author + +The author(miner) of the ethereum block you get from `eth_getBlockByNumber()` or `eth_getBlockByHash()` is the last 20 bytes of the actual substrate block author. It's because the ethereum block is built based on substrate block and who's author is a 32-bytes address. We have to truncate to adapt ethereum block needs. **Please do not tranfer to the ethereum block author, since the private key of this address is unknown.** + +## Dev Tools + +Darwinia is EVM-compatiable, so your can use almost all toolchains for EVM. Here are some of our picks: + +Wallets: + +- [MetaMask](https://metamask.io/) + +Libraries: + +* [web3.js](https://github.com/web3/web3.js) +* [ethers.js](https://github.com/ethers-io/ethers.js) + +Contract Libraries: + +* [OpenZeppelin](https://openzeppelin.com/) + +Dev Environment: + +* [Remix](https://remix.ethereum.org/) +* [Hardhat](https://hardhat.org/) diff --git a/docs/builder/explorers.md b/docs/builder/explorers.md new file mode 100644 index 00000000..7a5053a6 --- /dev/null +++ b/docs/builder/explorers.md @@ -0,0 +1,19 @@ +--- +sidebar_position: 104 +--- + +# Explorers + +## Darwinia +- https://darwinia.subscan.io/ +- https://darwinia.subview.xyz/ + +## Crab +- https://crab.subscan.io/ +- https://crab.subview.xyz/ + +## Pangoro +- https://pangoro.subscan.io/ + +## Pangolin +- https://pangolin.subscan.io/ diff --git a/docs/glossary.md b/docs/builder/glossary.md similarity index 99% rename from docs/glossary.md rename to docs/builder/glossary.md index 78e695ea..549e1bee 100644 --- a/docs/glossary.md +++ b/docs/builder/glossary.md @@ -1,5 +1,5 @@ --- -sidebar_position: 7 +sidebar_position: 108 --- # Glossary diff --git a/docs/builder/networks/_category_.json b/docs/builder/networks/_category_.json new file mode 100644 index 00000000..ffbb9477 --- /dev/null +++ b/docs/builder/networks/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Networks", + "position": 101 +} diff --git a/docs/builder/networks/crab.md b/docs/builder/networks/crab.md new file mode 100644 index 00000000..b0cee936 --- /dev/null +++ b/docs/builder/networks/crab.md @@ -0,0 +1,109 @@ +--- +sidebar_position: 1 +title: Crab +--- + +Crab Network is a canary network with real economic value for Darwinia, and its positioning is similar to Polkadot's Kusama Network. To expect chaos is a reasonable assumption! + +Crab is now a parachain of [Kusama](https://kusama.subscan.io/parachain/2229). + +## Network Info + +- Network Name: Crab +- Token Name: CRAB +- Token Decimal: 9 +- Block Explorer: + - https://crab.subscan.io/ +- HTTP Endpoints: + - https://crab-rpc.darwinia.network + - https://darwinia-crab.api.onfinality.io/public + - https://darwiniacrab-rpc.dwellir.com +- WSS Endpoints: + - wss://crab-rpc.darwinia.network + - wss://darwinia-crab.api.onfinality.io/public-ws + - wss://darwiniacrab-rpc.dwellir.com + +#### EVM Info +- Network Name: Crab Smart Chain +- Token Name: CRAB +- Token Decimal: 18 +- ChainId: 44 +- Block Explorer: + - https://crab.subscan.io/ +- HTTP Endpoints: + - https://crab-rpc.darwinia.network + - https://darwinia-crab.api.onfinality.io/public + - https://darwiniacrab-rpc.dwellir.com +- WSS Endpoints: + - wss://crab-rpc.darwinia.network + - wss://darwinia-crab.api.onfinality.io/public-ws + - wss://darwiniacrab-rpc.dwellir.com + +## Other tokens + +| Token Symbol | Spec | Decimals | Smart Contract Address | +| --- | --- | --- | --- | +| CKTON | ERC20 | 18 | 0x0000000000000000000000000000000000000402 | +| WCRAB | ERC20 | 18 | 0x2d2b97ea380b0185e9fdf8271d1afb5d2bf18329 | +| xWRING | ERC20 | 18 | 0x273131F7CB50ac002BDd08cA721988731F7e1092 | + + +### Deprecated tokens + +| Token Symbol | Spec | Decimals | Smart Contract Address | Why | +| --- | --- | --- | --- | --- | +| WCKTON(Classic) | ERC20 | 18 | 0x159933C635570D5042723359fbD1619dFe83D3f3 | migrated to CKTON | +| xRING(Classic) | ERC20 | 9 | 0x7399Ea6C9d35124d893B8d9808930e9d3F211501 | migrated to xWRING | + +## Params + +### Block, Epoch and Era Time + +| Darwinia | Time | Slots | +| -------- | --------- | ----- | +| Block | 6 seconds | 1 | +| Epoch | 1 hour | 600 | +| Era | 6 hours | 3,600 | + +### Staking, Validating, and Nominating + +| Darwinia | Time | Slots | Description | +| ----------------------- | ---------------------------------- | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| Validator Slots | 7 | Initial slots for active validators, gradually increasing. | | +| Term duration | 6 hours | 3,600 | The time for which a validator is in the set after being elected. Note, this duration can be shortened in the case that a validator misbehaves. | +| Nomination period | 6 hours | 3,600 | Every 6 hours, a new validator set is elected according to Phragmen's method. | +| Bonding duration | 14 days | 201,600 | How long until your funds will be transferrable after unbonding. | +| Slash defer duration | 14 days | 201,600 | Prevents overslashing and validators "escaping" and getting their nominators slashed with no repercussions to themselves | +| Slash Cancellation Vote | Requires 3/4 of Council to Approve | | | +### Governance + +| Democracy | Time | Slots | Description | +| ---------------- | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Voting period | 7 days | 100,800 | How long the public can vote on a referendum. | +| Launch period | 7 days | 100,800 | How long the public can select which proposal to hold a referendum on. i.e., Every week, the highest-weighted proposal will be selected to have a referendum | +| Enactment period | 8 days | 115,200 | Time it takes for a successful referendum to be implemented on the network. | + +| Council | Time | Slots | Description | +| ------------- | ----- | ----- | -------------------------------------------------------------------- | +| Term duration | 1 day | 3,600 | The length of a council member's term until the next election round. | +| Voting period | 1 day | 3,600 | The council's voting period for motions. | + +| Technical committee | Time | Slots | Description | +| ----------------------- | ------- | ------- | ---------------------------------------------------------------------------------------------- | +| Cool-off period | 7 days | 100,800 | The time a veto from the technical committee lasts before the proposal can be submitted again. | +| Emergency voting period | 3 hours | 1,800 | The voting period after the technical committee expedites voting. | + +### Treasury + +| Parameter | Value | Description | +| --------------------------- | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| Budgeting Period** | 6 days | When the treasury can spend again after spending previously. | +| Proposal Bond | 5% and minumum 1000 CRAB | The amount required to bond in order to propose a treasury spend. If approved, it is returned, if the proposal fails, it is burnt. | +| Burn unspent treasury funds | Off | This deactivates a burn of all unspent treasury funds at the end of a budgeting period. | + +### SS58 Address Format + +Chain specification name: Crab + +SS58 prefix: 42 + diff --git a/docs/builder/networks/darwinia.md b/docs/builder/networks/darwinia.md new file mode 100644 index 00000000..d89f0591 --- /dev/null +++ b/docs/builder/networks/darwinia.md @@ -0,0 +1,79 @@ +--- +sidebar_position: 0 +title: Darwinia +--- + +Darwinia is a chain based on substrate with cross-chain components, including substrate to ethereum and substrate to substrate. + +Darwinia is now a parachain of [Polkadot](https://polkadot.subscan.io/parachain/2046). + +## Network Info + +- Network Name: Darwinia +- Token Name: RING +- Token Decimal: 9 +- Block Explorer: + - https://darwinia.subscan.io/ +- HTTP Endpoints: + - https://rpc.darwinia.network + - https://darwinia-rpc.dwellir.com +- WSS Endpoints: + - wss://rpc.darwinia.network + - wss://darwinia-rpc.dwellir.com + +#### EVM Info +- Network Name: Darwinia Smart Chain +- Token Name: RING +- Token Decimal: 18 +- ChainId: 46 +- Block Explorer: + - https://darwinia.subscan.io/ +- HTTP Endpoints: + - https://rpc.darwinia.network + - https://darwinia-rpc.dwellir.com +- WSS Endpoints: + - wss://rpc.darwinia.network + - wss://darwinia-rpc.dwellir.com + +## Params + +### Block, Epoch and Era Time + +| Darwinia | Time | Slots | +| -------- | --------- | ----- | +| Block | 6 seconds | 1 | +| Epoch | 4 hour | 2,400 | +| Era | 24 hours |14,400 | + + +### Staking, Validating and Nominating Time + +| Darwinia | Time | Slots | Description | +| --- | --- | --- | --- | +| Term duration | 24 hours | 14,400 | The time for which a validator is in the set after being elected. Note, this duration can be shortened in the case that a validator misbehaves. | +| Nomination period | 24 hours | 14,400 | Every 24 hours, a new validator set is elected according to Phragmen's method. | +| Bonding duration | 14 days | 201,600 | How long until your funds will be transferable after unbonding. | + +### Parameters of Validators + +One preliminary method to make profit is to nominate a validator. There are multiple factors to consider when choosing a validator wisely. Although we do not make recommendations out of neutrality, we provide an explanation of the meaning of the parameters related to a validator. A comprehensive understanding can help you assess your candidates accurately. + +#### Active Commission + +The *active commission* is the percentage of the gain that the validator will draw before distributing according to staking power in the current era. This parameter is set by the validator. From one perspective, it measures the willingness of the validator to share the profit with nominators. Meanwhile, it can be interpreted as an indicator of their confidence in themselves. In a nutshell, one cannot say that the higher the better or otherwise. + +#### Next Commission + +The *next commission* is the percentage of the gain that the validator will draw before distributing according to staking power in the next era. This parameter is set by the validator. It may directly affect your profit if you endorse this validator. As explained above, this is not a simple measure of good or bad. + +#### Own Stake(Power) + +The *own stake (power)* is the amount of power that the validator has locked for staking currently. It indicates how much stake the validator has put in the game. Since if the validator is punished for some reason, part of the staking power will be slashed, the higher this number is, the higher risk the validator is willing to take. + +#### Other Stake(Power) + +The *other stake (power)* is the amount of power that nominators have trusted the validator with. This partly indicates the level of confidence that nominators have on the validator. + +#### Points + +The *point* is a measure of the validator's achievement in the current era. The validator normally gets 20 points for each block produced by them. If a validator has 1200 *points*, it means that this validator has produced 60(1200/20) blocks successfully so far in current era. diff --git a/docs/builder/networks/pangolin.md b/docs/builder/networks/pangolin.md new file mode 100644 index 00000000..39bcbf43 --- /dev/null +++ b/docs/builder/networks/pangolin.md @@ -0,0 +1,41 @@ +--- +sidebar_position: 3 +title: Pangolin +--- + +Pangolin is the testnet of Crab. + +## Network Info + +- Network Name: Pangolin +- Token Name: PRING +- Token Decimal: 9 +- Block Explorer: + - https://pangolin.subscan.io/ +- HTTP Endpoints: + - https://pangolin-rpc.darwinia.network +- WSS Endpoints: + - wss://pangolin-rpc.darwinia.network + +#### EVM Info +- Network Name: Pangolin Smart Chain +- Token Name: PRING +- Token Decimal: 18 +- ChainId: 43 +- Block Explorer: + - https://pangolin.subscan.io/ +- HTTP Endpoints: + - https://pangolin-rpc.darwinia.network +- WSS Endpoints: + - wss://pangolin-rpc.darwinia.network + +## Params + +### Block, Epoch and Era Time + +| Darwinia | Time | Slots | +| -------- | --------- | ----- | +| Block | 6 seconds | 1 | +| Epoch | 0.5 hour | 300 | +| Era | 1.5 hours | 900 | + diff --git a/docs/builder/networks/pangoro.md b/docs/builder/networks/pangoro.md new file mode 100644 index 00000000..78f637e7 --- /dev/null +++ b/docs/builder/networks/pangoro.md @@ -0,0 +1,41 @@ +--- +sidebar_position: 2 +title: Pangoro +--- + +Pangoro is the testnet of Darwinia. + +## Network Info + +- Network Name: Pangoro +- Token Name: ORING +- Token Decimal: 9 +- Block Explorer: + - https://pangoro.subscan.io/ +- HTTP Endpoints: + - https://pangoro-rpc.darwinia.network +- WSS Endpoints: + - wss://pangoro-rpc.darwinia.network + +#### EVM Info +- Network Name: Pangoro Smart Chain +- Token Name: ORING +- Token Decimal: 18 +- Block Explorer: +- ChainId: 45 + - https://pangoro.subscan.io/ +- HTTP Endpoints: + - https://pangoro-rpc.darwinia.network +- WSS Endpoints: + - wss://pangoro-rpc.darwinia.network + +## Params + +### Block, Epoch and Era Time + +| Darwinia | Time | Slots | +| -------- | --------- | ----- | +| Block | 6 seconds | 1 | +| Epoch | 2 hour | 1,200 | +| Era | 6 hours | 3,600 | + diff --git a/docs/builder/public-endpoints.md b/docs/builder/public-endpoints.md new file mode 100644 index 00000000..74d737e2 --- /dev/null +++ b/docs/builder/public-endpoints.md @@ -0,0 +1,39 @@ +--- +sidebar_position: 102 +--- + +# Public Endpoints + +## Darwinia + +- HTTP Endpoints: + - https://rpc.darwinia.network + - https://darwinia-rpc.dwellir.com +- WSS Endpoints: + - wss://rpc.darwinia.network + - wss://darwinia-rpc.dwellir.com + +## Crab + +- HTTP Endpoints: + - https://crab-rpc.darwinia.network + - https://darwinia-crab.api.onfinality.io/public + - https://darwiniacrab-rpc.dwellir.com +- WSS Endpoints: + - wss://crab-rpc.darwinia.network + - wss://darwinia-crab.api.onfinality.io/public-ws + - wss://darwiniacrab-rpc.dwellir.com + +## Pangoro + +- HTTP Endpoints: + - https://pangoro-rpc.darwinia.network +- WSS Endpoints: + - wss://pangoro-rpc.darwinia.network + +## Pangolin + +- HTTP Endpoints: + - https://pangolin-rpc.darwinia.network +- WSS Endpoints: + - wss://pangolin-rpc.darwinia.network diff --git a/docs/builder/solidity-precompiles.md b/docs/builder/solidity-precompiles.md new file mode 100644 index 00000000..25418157 --- /dev/null +++ b/docs/builder/solidity-precompiles.md @@ -0,0 +1,96 @@ +--- +sidebar_position: 103 +--- + +# Solidity Precompiles + +## Darwinia + +Ethereum compatible: + +- `0x0000000000000000000000000000000000000001`: ECRecover +- `0x0000000000000000000000000000000000000002`: Sha256 +- `0x0000000000000000000000000000000000000003`: Ripemd160 +- `0x0000000000000000000000000000000000000004`: Identity +- `0x0000000000000000000000000000000000000005`: Modexp +- `0x0000000000000000000000000000000000000006`: Bn128Add +- `0x0000000000000000000000000000000000000007`: Bn128Mul +- `0x0000000000000000000000000000000000000008`: Bn128Pairing +- `0x0000000000000000000000000000000000000009`: Blake2F +- `0x0000000000000000000000000000000000000400`: StateStorage +- `0x0000000000000000000000000000000000000401`: Dispatch + +Darwinia dedicated: + +- `0x0000000000000000000000000000000000000400`: StateStorage + - This contract is used to get the storage values from substrate modules by storage key. + - Function signature: `state_storage(bytes)` + - Params: the substrate storage key +- `0x0000000000000000000000000000000000000401`: Dispatch + - This contract is used to dispatch the substrate dispatch calls. + - Function signature: `(bytes)` + - Params: scale encoded substrate dispatch call + +## Crab + +Ethereum compatible: + +- `0x0000000000000000000000000000000000000001`: ECRecover +- `0x0000000000000000000000000000000000000002`: Sha256 +- `0x0000000000000000000000000000000000000003`: Ripemd160 +- `0x0000000000000000000000000000000000000004`: Identity +- `0x0000000000000000000000000000000000000005`: Modexp +- `0x0000000000000000000000000000000000000006`: Bn128Add +- `0x0000000000000000000000000000000000000007`: Bn128Mul +- `0x0000000000000000000000000000000000000008`: Bn128Pairing +- `0x0000000000000000000000000000000000000009`: Blake2F + +Darwinia dedicated: + +- `0x0000000000000000000000000000000000000400`: StateStorage +- `0x0000000000000000000000000000000000000401`: Dispatch +- `0x0000000000000000000000000000000000000402`: KTON + - KTON contract which compatible with the Ethereum ERC20 protocol. + +## Pangoro + +Ethereum compatible: + +- `0x0000000000000000000000000000000000000001`: ECRecover +- `0x0000000000000000000000000000000000000002`: Sha256 +- `0x0000000000000000000000000000000000000003`: Ripemd160 +- `0x0000000000000000000000000000000000000004`: Identity +- `0x0000000000000000000000000000000000000005`: Modexp +- `0x0000000000000000000000000000000000000006`: Bn128Add +- `0x0000000000000000000000000000000000000007`: Bn128Mul +- `0x0000000000000000000000000000000000000008`: Bn128Pairing +- `0x0000000000000000000000000000000000000009`: Blake2F +- `0x0000000000000000000000000000000000000400`: StateStorage +- `0x0000000000000000000000000000000000000401`: Dispatch + +Darwinia dedicated: + +- `0x0000000000000000000000000000000000000400`: StateStorage +- `0x0000000000000000000000000000000000000401`: Dispatch +- `0x0000000000000000000000000000000000000800`: BLS12381 + - function signature: `fast_aggregate_verify(bytes[],bytes,bytes) + +## Pangolin + +Ethereum compatible: + +- `0x0000000000000000000000000000000000000001`: ECRecover +- `0x0000000000000000000000000000000000000002`: Sha256 +- `0x0000000000000000000000000000000000000003`: Ripemd160 +- `0x0000000000000000000000000000000000000004`: Identity +- `0x0000000000000000000000000000000000000005`: Modexp +- `0x0000000000000000000000000000000000000006`: Bn128Add +- `0x0000000000000000000000000000000000000007`: Bn128Mul +- `0x0000000000000000000000000000000000000008`: Bn128Pairing +- `0x0000000000000000000000000000000000000009`: Blake2F + +Darwinia dedicated: + +- `0x0000000000000000000000000000000000000400`: StateStorage +- `0x0000000000000000000000000000000000000401`: Dispatch +- `0x0000000000000000000000000000000000000402`: KTON diff --git a/docs/builder/solidity-sdk/_category_.json b/docs/builder/solidity-sdk/_category_.json new file mode 100644 index 00000000..060bcfcd --- /dev/null +++ b/docs/builder/solidity-sdk/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Solidity SDK", + "position": 107 +} diff --git a/docs/sdk/api-reference.md b/docs/builder/solidity-sdk/api-reference.md similarity index 100% rename from docs/sdk/api-reference.md rename to docs/builder/solidity-sdk/api-reference.md diff --git a/docs/sdk/constants.md b/docs/builder/solidity-sdk/constants.md similarity index 100% rename from docs/sdk/constants.md rename to docs/builder/solidity-sdk/constants.md diff --git a/docs/sdk/guides/01-using-smart-chain-with-metamask.md b/docs/builder/solidity-sdk/guides/01-using-smart-chain-with-metamask.md similarity index 92% rename from docs/sdk/guides/01-using-smart-chain-with-metamask.md rename to docs/builder/solidity-sdk/guides/01-using-smart-chain-with-metamask.md index b120441c..db6c3dd2 100644 --- a/docs/sdk/guides/01-using-smart-chain-with-metamask.md +++ b/docs/builder/solidity-sdk/guides/01-using-smart-chain-with-metamask.md @@ -12,7 +12,7 @@ sidebar_position: 1 ### Smart Chain Parameters -See [Darwinia Smart Chain](../../chains/darwinia-smart-chain) +See [Darwinia Smart Chain](../../networks/darwinia) ## Deposit tokens diff --git a/docs/sdk/guides/02-know-your-cross-chain-status.md b/docs/builder/solidity-sdk/guides/02-know-your-cross-chain-status.md similarity index 100% rename from docs/sdk/guides/02-know-your-cross-chain-status.md rename to docs/builder/solidity-sdk/guides/02-know-your-cross-chain-status.md diff --git a/docs/sdk/guides/03-execute-remote-smart-contract-call.md b/docs/builder/solidity-sdk/guides/03-execute-remote-smart-contract-call.md similarity index 96% rename from docs/sdk/guides/03-execute-remote-smart-contract-call.md rename to docs/builder/solidity-sdk/guides/03-execute-remote-smart-contract-call.md index 070b938f..4e438f2a 100644 --- a/docs/sdk/guides/03-execute-remote-smart-contract-call.md +++ b/docs/builder/solidity-sdk/guides/03-execute-remote-smart-contract-call.md @@ -40,8 +40,8 @@ In this example, we need two endpoints. One is for Pangoro Smart Chain, and the Copy the flattened PangoroToPangolinEndpoint.sol to [Remix](https://remix.ethereum.org/) and deploy it to Pangoro Smart Chain. > How to use Remix to deploy a contract? here are some useful articles. [Creating and Deploying a Contract in Remix](https://remix-ide.readthedocs.io/en/latest/create_deploy.html) - [Using Smart Chain with MetaMask](/sdk/guides/using-smart-chain-with-metamask) - [Pangoro Smart Chain Info](/chains/darwinia-smart-chain#for-pangoro-smart-chain) + [Using Smart Chain with MetaMask](./using-smart-chain-with-metamask) + [Pangoro Smart Chain Info](../../networks/darwinia) 3. Deploy `PangolinToPangoroEndpoint` to Pangolin Smart Chain. diff --git a/docs/sdk/guides/04-dispatch-remote-substrate-call.md b/docs/builder/solidity-sdk/guides/04-dispatch-remote-substrate-call.md similarity index 100% rename from docs/sdk/guides/04-dispatch-remote-substrate-call.md rename to docs/builder/solidity-sdk/guides/04-dispatch-remote-substrate-call.md diff --git a/docs/sdk/guides/_category_.json b/docs/builder/solidity-sdk/guides/_category_.json similarity index 100% rename from docs/sdk/guides/_category_.json rename to docs/builder/solidity-sdk/guides/_category_.json diff --git a/docs/sdk/darwinia.js/Substrate API/Constants.md b/docs/builder/substrate-api/Constants.md similarity index 100% rename from docs/sdk/darwinia.js/Substrate API/Constants.md rename to docs/builder/substrate-api/Constants.md diff --git a/docs/sdk/darwinia.js/Substrate API/Extrinsics.md b/docs/builder/substrate-api/Extrinsics.md similarity index 100% rename from docs/sdk/darwinia.js/Substrate API/Extrinsics.md rename to docs/builder/substrate-api/Extrinsics.md diff --git a/docs/sdk/darwinia.js/Substrate API/Storage.md b/docs/builder/substrate-api/Storage.md similarity index 100% rename from docs/sdk/darwinia.js/Substrate API/Storage.md rename to docs/builder/substrate-api/Storage.md diff --git a/docs/builder/substrate-api/_category_.json b/docs/builder/substrate-api/_category_.json new file mode 100644 index 00000000..45680b38 --- /dev/null +++ b/docs/builder/substrate-api/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Substrate API", + "position": 106 +} diff --git a/docs/sdk/darwinia.js/Substrate API/api-derive.md b/docs/builder/substrate-api/api-derive.md similarity index 100% rename from docs/sdk/darwinia.js/Substrate API/api-derive.md rename to docs/builder/substrate-api/api-derive.md diff --git a/docs/sdk/darwinia.js/Substrate API/overview.md b/docs/builder/substrate-api/overview.md similarity index 100% rename from docs/sdk/darwinia.js/Substrate API/overview.md rename to docs/builder/substrate-api/overview.md diff --git a/docs/sdk/darwinia.js/Substrate API/rpc.md b/docs/builder/substrate-api/rpc.md similarity index 100% rename from docs/sdk/darwinia.js/Substrate API/rpc.md rename to docs/builder/substrate-api/rpc.md diff --git a/docs/builder/testnet-faucets.md b/docs/builder/testnet-faucets.md new file mode 100644 index 00000000..1af48db0 --- /dev/null +++ b/docs/builder/testnet-faucets.md @@ -0,0 +1,8 @@ +--- +sidebar_position: 109 +--- + +# Testnet Faucets + +* [Pangoro ORING Faucet](https://apps.darwinia.network/toolbox?rpc=wss%253A%252F%252Fpangoro-rpc.darwinia.network&tab=faucet) +* [Pangolin PRING Faucet](https://apps.darwinia.network/toolbox?rpc=wss%253A%252F%252Fpangolin-rpc.darwinia.network&tab=faucet) diff --git a/docs/chains/Introduction.md b/docs/chains/Introduction.md deleted file mode 100644 index 3f83bdf8..00000000 --- a/docs/chains/Introduction.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -sidebar_position: 0 -title: Introduction ---- - -Darwinia offers a number of different chains for development of messaging infrastructure and Dapp deployment, each with its own features and benefits. - -## [Darwinia Chain](darwinia-chain.md) - -Darwinia Chain is designed to be the primary chain for tokens and governance, main communication hub and routing point of the LCMP, and will support most on-chain light clients for other public chains. - -Darwinia Chain is a public chain that can operate independently with its own consensus and security model, with its core business and application services, including cross-chain functionality of each application chain, controlled by the Darwinia Chain itself. - -## [Darwinia Parachain](darwinia-parachain.md) -Darwinia Parachain is designed to be protected by the shared security of the Polkadot Relay Chain. It will integrate Polkadot’s XCMP, open channels with other parachains, and connect to the Darwinia Chain via LCMP. - -Darwinia Parachain does not have its own economy. - -## [Darwinia Smart Chain](darwinia-smart-chain.md) - -Darwinia Smart Chain adds an Ethereum-Compatible layer to the Darwinia Chain and provides users with the ability to create and interact with solidity smart contracts. The node of Darwinia Smart Chain provides Ethereum RPCs endpoint for reading chain states and sending transactions which can be included in Ethereum blocks, and these blocks are chained together as an Ethereum blockchain in the Darwinia Chain. Therefore, it is easy for projects in the Ethereum ecosystem to migrate to the Darwinia Chain. \ No newline at end of file diff --git a/docs/chains/_category_.json b/docs/chains/_category_.json deleted file mode 100644 index 69f0f5f5..00000000 --- a/docs/chains/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Darwinia Chains", - "position": 6 -} diff --git a/docs/chains/darwinia-chain.md b/docs/chains/darwinia-chain.md deleted file mode 100644 index 4221fca9..00000000 --- a/docs/chains/darwinia-chain.md +++ /dev/null @@ -1,79 +0,0 @@ ---- -sidebar_position: 1 -title: Darwinia Chain ---- - -## Introduction - -The Darwinia Chain is a public chain based on substrate with cross-chain components, including substrate to ethereum and substrate to substrate. In this article we will cover a number of topics that are important to developers, such as network configuration, on-chain runtime params and so on. In addition, we have set up a free test network, the pangoro network, where the latest features will be fully tested before they are added to the Darwinia Chain. The user can obtain test tokens at [Pangoro Test Token Faucet](https://apps.darwinia.network/?network=pangoro). - -### Network Info - -#### For Darwinia Chain - -- Network Name: `Darwinia` -- Token Name: `RING` -- Token Decimal: `9` -- Block Explorer URL: `https://darwinia.subscan.io/` -- HTTP Endpoints: - - `https://rpc.darwinia.network` - - `https://darwinia-rpc.dwellir.com` -- WSS Endpoints: - - `wss://rpc.darwinia.network` - - `wss://darwinia-rpc.dwellir.com` - -#### For Pangoro Chain - -- Network Name: `Pangoro` -- Token Name: `ORING` -- Token Decimal: `9` -- Block Explorer URL: `https://pangoro.subscan.io/` -- HTTP Endpoints: - - `https://pangoro-rpc.darwinia.network` -- WSS Endpoints: - - `wss://pangoro-rpc.darwinia.network` - -### On-Chain Params - -> This page intends to reflect the current configurations of the Darwinia Chain and provide some brief explanation to their meanings when necessary. - -- Block, Epoch and Era Time - - | Darwinia | Time | Slots | - | -------- | --------- | ----- | - | Block | 6 seconds | 1 | - | Epoch | 4 hour | 2,400 | - | Era | 24 hours |14,400 | - - -- Staking, Validating and Nominating Time - - | Darwinia | Time | Slots | Description | - | --- | --- | --- | --- | - | Term duration | 24 hours | 14,400 | The time for which a validator is in the set after being elected. Note, this duration can be shortened in the case that a validator misbehaves. | - | Nomination period | 24 hours | 14,400 | Every 24 hours, a new validator set is elected according to Phragmen's method. | - | Bonding duration | 14 days | 201,600 | How long until your funds will be transferable after unbonding. | - -- Parameters of Validators - - One preliminary method to make profit is to nominate a validator. There are multiple factors to consider when choosing a validator wisely. Although we do not make recommendations out of neutrality, we provide an explanation of the meaning of the parameters related to a validator. A comprehensive understanding can help you assess your candidates accurately. - -- Active Commission - - The *active commission* is the percentage of the gain that the validator will draw before distributing according to staking power in the current era. This parameter is set by the validator. From one perspective, it measures the willingness of the validator to share the profit with nominators. Meanwhile, it can be interpreted as an indicator of their confidence in themselves. In a nutshell, one cannot say that the higher the better or otherwise. - -- Next Commission - - The *next commission* is the percentage of the gain that the validator will draw before distributing according to staking power in the next era. This parameter is set by the validator. It may directly affect your profit if you endorse this validator. As explained above, this is not a simple measure of good or bad. - -- Own Stake(Power) - - The *own stake (power)* is the amount of power that the validator has locked for staking currently. It indicates how much stake the validator has put in the game. Since if the validator is punished for some reason, part of the staking power will be slashed, the higher this number is, the higher risk the validator is willing to take. - -- Other Stake(Power) - - The *other stake (power)* is the amount of power that nominators have trusted the validator with. This partly indicates the level of confidence that nominators have on the validator. - -- Points - - The *point* is a measure of the validator's achievement in the current era. The validator normally gets 20 points for each block produced by them. If a validator has 1200 *points*, it means that this validator has produced 60(1200/20) blocks successfully so far in current era. \ No newline at end of file diff --git a/docs/chains/darwinia-parachain.md b/docs/chains/darwinia-parachain.md deleted file mode 100644 index ab090d28..00000000 --- a/docs/chains/darwinia-parachain.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -sidebar_position: 3 -title: Darwinia Parachain ---- - -TODO \ No newline at end of file diff --git a/docs/chains/darwinia-smart-chain.md b/docs/chains/darwinia-smart-chain.md deleted file mode 100644 index 135d0685..00000000 --- a/docs/chains/darwinia-smart-chain.md +++ /dev/null @@ -1,123 +0,0 @@ ---- -sidebar_position: 2 -title: Darwinia Smart Chain ---- - -## Introduction - -Darwinia Smart Chain is a substrate based ethereum compatible smart contract platform where contract developers can easily migrate -smart contracts from the Ethereum chain to run their business. In this article we will cover a number of topics that are important to contract developers, such as network configuration, precompiled contracts and so on. In addition, we have set up a free test network, the pangoro network, where the latest features will be fully tested before they are added to the Darwinia Smart Chain. The user can obtain test tokens at [Pangoro Test Token Faucet](https://apps.darwinia.network/?network=pangoro). - -### Network Info - -#### For Darwinia Smart Chain - -- Network Name: `Darwinia Smart Chain` -- Token Name: `RING` -- Token Decimal: `18` -- ChainId: `46` -- Block Explorer URL: `https://darwinia.subscan.io/` -- HTTP Endpoints: - - `https://rpc.darwinia.network` - - `https://darwinia-rpc.dwellir.com` -- WSS Endpoints: - - `wss://rpc.darwinia.network` - - `wss://darwinia-rpc.dwellir.com` - -#### For Pangoro Smart Chain - -- Network Name: `Pangoro Smart Chain` -- Token Name: `ORING` -- Token Decimal: `18` -- ChainId: `45` -- Block Explorer URL: `https://pangoro.subscan.io/` -- HTTP Endpoints: - - `https://pangoro-rpc.darwinia.network` -- WSS Endpoints: - - `wss://pangoro-rpc.darwinia.network` - - -### Other Tokens For Darwinia Smart Chain - -| Token Symbol | Spec | Decimals | Smart Contract Address | -| --- | --- | --- | --- | -| KTON | ERC20 | 18 | 0x0000000000000000000000000000000000000402 | -| WRING | ERC20 | 18 | 0xE7578598Aac020abFB918f33A20faD5B71d670b4 | - - -### Precompiled Contracts - -#### For Darwinia Smart Chain - -Ethereum compatible: - -- `0x0000000000000000000000000000000000000001`: ECRecover -- `0x0000000000000000000000000000000000000002`: Sha256 -- `0x0000000000000000000000000000000000000003`: Ripemd160 -- `0x0000000000000000000000000000000000000004`: Identity -- `0x0000000000000000000000000000000000000005`: Modexp -- `0x0000000000000000000000000000000000000006`: Bn128Add -- `0x0000000000000000000000000000000000000007`: Bn128Mul -- `0x0000000000000000000000000000000000000008`: Bn128Pairing -- `0x0000000000000000000000000000000000000009`: Blake2F - -Darwinia dedicated: - -- `0x0000000000000000000000000000000000000400`: StateStorage - - This contract is used to get the storage values from substrate modules by storage key. - - Function signature: `state_storage(bytes)` - - Params: the substrate storage key -- `0x0000000000000000000000000000000000000401`: Dispatch - - This contract is used to dispatch the substrate dispatch calls. - - Function signature: `(bytes)` - - Params: scale encoded substrate dispatch call -- `0x0000000000000000000000000000000000000402`: KTON - - KTON contract which compatible with the Ethereum ERC20 protocol. - -#### For Pangoro Smart Chain - -Ethereum compatible: - -- `0x0000000000000000000000000000000000000001`: ECRecover -- `0x0000000000000000000000000000000000000002`: Sha256 -- `0x0000000000000000000000000000000000000003`: Ripemd160 -- `0x0000000000000000000000000000000000000004`: Identity -- `0x0000000000000000000000000000000000000005`: Modexp -- `0x0000000000000000000000000000000000000006`: Bn128Add -- `0x0000000000000000000000000000000000000007`: Bn128Mul -- `0x0000000000000000000000000000000000000008`: Bn128Pairing -- `0x0000000000000000000000000000000000000009`: Blake2F - -Darwinia dedicated: - -- `0x0000000000000000000000000000000000000400`: StateStorage - - This contract is used to get the storage values from substrate modules by storage key. - - Function signature: `state_storage(bytes)` - - Params: the substrate storage key -- `0x0000000000000000000000000000000000000401`: Dispatch - - This contract is used to dispatch the substrate dispatch calls. - - Function signature: `(bytes)` - - Params: scale encoded substrate dispatch call -- `0x0000000000000000000000000000000000000402`: KTON - - KTON contract which compatible with the Ethereum ERC20 protocol. -- `0x0000000000000000000000000000000000000800`: BLS12381 - - function signature: `fast_aggregate_verify(bytes[],bytes,bytes)` - - -### Things Dapp developers must know - -#### Ethereum Block Author - -The author(miner) of the ethereum block you get from `eth_getBlockByNumber()` or `eth_getBlockByHash()` is the last 20 bytes of the actual substrate block author. It's because the ethereum block is built based on substrate block and who's author is a 32-bytes address. We have to truncate to adapt ethereum block needs. **Please do not tranfer to the ethereum block author, since the private key of this address is unknown.** -#### Genesis Block - -It is particularly important to note that Darwinia Smart Chain's genesis block does not start at 0 like Ethereum. It is `9453251`. This means that if you try to query the block history before this with `eth_getBlockByNumber()` or `eth_getBlockByHash()`, you will get `null`. This is because the DVM smart contract solution was added in the middle of the Substrate-base Darwinia chain, there are no Ethereum transactions in the Substrate history blocks and no corresponding Ethereum history blocks generated. - -#### Consensus Related Field - -Ethereum uses a consensus protocol named Proof-of-Work (PoW). While Darwinia Smart Chain uses the Nominated Proof of Stake(NPOS). They are two completely different consensus mechanisms. Consequently, Proof of Work concepts, such as `difficulty`, `uncles`, `hashrate`, generally is not applicable to Darwinia Smart Chain. For APIs that return value related to Ethereum’s Proof of Work, default value are returned. - -#### Use `block.timestamp` instead of `block.number` - -On Ethereum or other EVM-Compatible platform, you may use `block.number` in contract, but this is not recommended in Darwinia Smart Chain. We may introduce Darwinia Smart Chain 2.0 (The Next Generation) in the future and export the data from Darwinia Smart Chain 1.0 to Darwinia Smart Chain 2.0, which may reset the chain height to zero, so we recommend using `block.timestamp`. - diff --git a/docs/protocols/_category_.json b/docs/protocols/_category_.json new file mode 100644 index 00000000..04530207 --- /dev/null +++ b/docs/protocols/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "Protocols", + "collapsible": false, + "position": 3 +} diff --git a/docs/lcmp-overview.md b/docs/protocols/lcmp-overview.md similarity index 100% rename from docs/lcmp-overview.md rename to docs/protocols/lcmp-overview.md diff --git a/docs/relayer/_category_.json b/docs/relayer/_category_.json new file mode 100644 index 00000000..40fb5d6e --- /dev/null +++ b/docs/relayer/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "Relayer", + "collapsible": false, + "position": 2 +} diff --git a/docs/fee.md b/docs/relayer/cross-chain-fee.md similarity index 90% rename from docs/fee.md rename to docs/relayer/cross-chain-fee.md index deda3ead..9aff29e9 100644 --- a/docs/fee.md +++ b/docs/relayer/cross-chain-fee.md @@ -1,8 +1,8 @@ --- -sidebar_position: 3 +sidebar_position: 1 --- -# Fee +# Cross-chain Fee ## Fee Structure @@ -20,7 +20,7 @@ The fees is payed with the source chain assets. The transaction fee of the targe Fees paid to the Treasury and relayers are not set in stone. Anyone can become a relayer of `Darwinia Cross-Chain Messaging Service`, and they quote through their respective quotation strategies, and the quotations of all relayers form a fee market. -Each time the cross-chain starts, the user's cross-chain fees will be prepaid, and after the cross-chain is successful, these fees will be allocated to the Treasury and relayers according to some rules. If you want to know more details of the rules, please check [this article](https://github.com/darwinia-network/darwinia-common/blob/main/frame/fee-market/README.md). +Each time the cross-chain starts, the user's cross-chain fees will be prepaid, and after the cross-chain is successful, these fees will be allocated to the Treasury and relayers according to some rules. If you want to know more details of the rules, please check [this article](https://medium.com/darwinianetwork/what-can-a-cross-chain-message-relayer-get-ffb683b689cb). ## Fee Estimation @@ -32,4 +32,3 @@ Dapp developers can estimate fees through the App SDK. }); ``` - diff --git a/docs/relayer/fee-market.md b/docs/relayer/fee-market.md new file mode 100644 index 00000000..8ec80ad5 --- /dev/null +++ b/docs/relayer/fee-market.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 2 +--- + +# Fee Market + +Darwinia Fee Market System is a market-based cross-chain infrastructure that provides financial incentives for cross-chain message deliverers(relayers). Through the profitability mechanism, promoting relayers actively participate in and deliver messages efficiently, which will make the cross-chain transaction system more robust and sustainable. + +The calculation of fees for cross-chain messages usually requires the consideration of the token value exchange ratio between the source and target chains on the blockchain, which is what Oracle is used to do. Unlike Oracle, the fee market mechanism does not require the chain to be aware of the token value exchange ratio between the source and target chains in real time, but relies on the relayers‘ quotes to generate the final cross-chain fee. + +The relayer is the third off-chain role of the message carrier, responsible for delivering messages between the source and target chains. Before delivering a message, the relayer calculates its own costs and expected profits by combining the transaction fees of the source and target chains and finally submits its own quote to the fee market. When the fee market has received enough quotes, it selects a suitable quote as the cross-chain fee at that moment according to the pre-defined rules. diff --git a/docs/relayer/relayer-client.md b/docs/relayer/relayer-client.md new file mode 100644 index 00000000..7e1d9e9a --- /dev/null +++ b/docs/relayer/relayer-client.md @@ -0,0 +1,10 @@ +--- +sidebar_position: 3 +--- + +# Relayer Client + +The software used by relayers to relay states and messages from the source chain to the target chain. + +* [Bridger](https://github.com/darwinia-network/bridger) + diff --git a/docs/sdk/_category_.json b/docs/sdk/_category_.json deleted file mode 100644 index 62ac1094..00000000 --- a/docs/sdk/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "SDK", - "position": 5 -} diff --git a/docs/sdk/darwinia.js/smart-chain-api.md b/docs/sdk/darwinia.js/smart-chain-api.md deleted file mode 100644 index 0005d957..00000000 --- a/docs/sdk/darwinia.js/smart-chain-api.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -sidebar_position: 4 ---- - -# Smart Chain API - -### Introduction - -DVM(Darwinia Virtual Machine) is fully compatible with EVM (Ethereum Virtual Machine) in Darwinia Network. We have Crab and Pangolin chain for dapp developer to apply dapp. Darwinia.js also provide common api to interact with Darwinia DVM same as web3.js interact with ethereum. - - - - - -Install it in your project directory with the following command: - -``` javascript -yarn add @darwinia/api-evm -``` - - -#### Balance Tranfer - -In this example we will introduce Crab Smart chain(EVM comatible) to Crab Chain balance tranfer. - -Here is an example to call DVM api to send transaction from ethereum address to substrate account. - - -``` javascript -// Import -import { ethers } from 'ethers'; -import { DarwiniaDvmApi } from '@darwinia/api-evm/index'; -import { CrabCallIndex } from '@darwinia/api-evm/model'; - -// Crab node provider -const providerRPC = { - carb: { - chainId: 44, - name: 'Crab', - rpc: 'https://crab-rpc.darwinia.network' - } - }; - - // ethereum address - const from = "
"; - // substrate address - const to = "
"; - - const gasLimit = 10000; - const amount = 1; // crab precision is 1000_000_000, 1 present 1/10*9 token - - const provider = new ethers.providers.JsonRpcProvider(providerRPC.carb.rpc, { - chainId: providerRPC.carb.chainId, - name: providerRPC.carb.name - }); - - const dvm = new DarwiniaDvmApi(CrabCallIndex, provider); - const resulte = await balanceTransfer(from, to, amount, gasLimit); - console.log(`transaction resulte ${resulte}`); - -``` - -Then return contains transcation hash and check more detail information at [Crab Subscan](https://crab.subscan.io/) diff --git a/docs/what-is-darwinia.md b/docs/what-is-darwinia.md index 0a3aabb9..10118139 100644 --- a/docs/what-is-darwinia.md +++ b/docs/what-is-darwinia.md @@ -1,5 +1,5 @@ --- -sidebar_position: 1 +sidebar_position: 0 slug: / --- diff --git a/sidebars.js b/sidebars.js index fd342f2c..ff1e5a82 100644 --- a/sidebars.js +++ b/sidebars.js @@ -14,7 +14,8 @@ /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ const sidebars = { // By default, Docusaurus generates a sidebar from the docs folder structure - tutorialSidebar: [{type: 'autogenerated', dirName: '.'}], + tutorialSidebar: [{type: 'autogenerated', dirName: './builder', }], + relayerSidebar: [{type: 'autogenerated', dirName: '.'}] // But you can create a sidebar manually /* diff --git a/src/css/custom.css b/src/css/custom.css index b1d62d36..246450b0 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -49,15 +49,9 @@ html[data-theme='dark'] { background-color: rgba(0, 0, 0, 0.3); } -article { - max-width: 95%; - margin-left: auto; - margin-right: auto; -} - -.navbar .navbar__items { +/* .navbar .navbar__items { flex: auto; -} +} */ /* Announcement Bar */ div[class^='announcementBarContent'] { @@ -95,9 +89,4 @@ div[class^='announcementBarContent'] a:hover { text-decoration: underline; } -@media screen and (min-width: 997px) { - /* Show inline table of contents on mobile only */ - div[class^='tableOfContentsInline'] { - display: none; - } -} +