diff --git a/src/config/sidebar.ts b/src/config/sidebar.ts index a4694dad2..9819e1936 100644 --- a/src/config/sidebar.ts +++ b/src/config/sidebar.ts @@ -81,10 +81,6 @@ export const getSidebar = () => { contents: [ { title: t("sidebar.developers.buildingOnScroll"), url: formatUrl("developers") }, { title: t("sidebar.developers.faq"), url: formatUrl("developers/faq") }, - { - title: t("sidebar.developers.verifyingSmartContracts"), - url: formatUrl("developers/verifying-smart-contracts"), - }, { title: t("sidebar.developers.scrollContracts"), url: formatUrl("developers/scroll-contracts"), diff --git a/src/content/docs/en/developers/verifying-smart-contracts.mdx b/src/content/docs/en/developers/verifying-smart-contracts.mdx deleted file mode 100644 index bbb02f953..000000000 --- a/src/content/docs/en/developers/verifying-smart-contracts.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -section: developers -date: Last Modified -title: "Verifying Smart Contracts" -lang: "en" -permalink: "developers/verifying-smart-contracts" -whatsnext: { "Scroll Contracts": "/en/developers/scroll-contracts" } -excerpt: "Easily verify your smart contracts with Scroll-supported developer tooling" ---- - -import Aside from "../../../../components/Aside.astro" -import ClickToZoom from "../../../../components/ClickToZoom.astro" -import verify1 from "./_images/verify1.png" -import CodeSample from "../../../../components/CodeSample/CodeSample.astro" - -After deploying your smart contracts, it's important to verify your code on a block explorer. This can be done in an automated way using your developer tooling or the Web UI. - -## Using Developer Tools - -Most smart contract tooling has plugins for verifying your contracts easily on Etherscan. - -- Scroll Mainnet: https://api.scrollscan.com/api -- Scroll Sepolia: https://api-sepolia.scrollscan.com/api - - - -### Hardhat - -Modify `hardhat.config.ts` to point to Scroll's RPC and block explorer API. - -For example, the config for Scroll Sepolia will look like this: -```javascript -... - -const config: HardhatUserConfig = { - ... - networks: { - scrollSepolia: { - url: 'https://sepolia-rpc.scroll.io' || '', - accounts: - process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], - }, - }, - etherscan: { - apiKey: { - scrollSepolia: , - }, - customChains: [ - { - network: 'scrollSepolia', - chainId: 534351, - urls: { - apiURL: 'https://api-sepolia.scrollscan.com/api', - browserURL: 'https://sepolia.scrollscan.com/', - }, - }, - ], - }, -} - -... -``` - -Now you can verify the smart contract by running the following command. - -```solidity -npx hardhat verify --network scrollSepolia -``` - -For example, this is how a smart contract that receives two uint parameters in the constructor should look: - -```solidity -npx hardhat verify --network scrollSepolia 0xD9880690bd717189cC3Fbe7B9020F27fae7Ac76F 123 456 -``` - - - -### Foundry - -When using Foundry, the `verify-contract` command helps automate the process of verifying contracts. If your contract has constructor arguments, you can specify these in ABI-encoded form with the `--constructor-args` option. For example, if your constructor takes two `uint256` variables: -```bash - --constructor-args $(cast abi-encode "constructor(uint256,uint256)" 0 7) -``` - -Refer to the [Foundry documentation](https://book.getfoundry.sh/reference/forge/forge-verify-contract) for further options you can specify. - -```bash -forge verify-contract \ - --verifier-url https://api-sepolia.scrollscan.com/api \ - --etherscan-api-key \ - --constructor-args -``` - diff --git a/src/content/docs/es/developers/verifying-smart-contracts.mdx b/src/content/docs/es/developers/verifying-smart-contracts.mdx deleted file mode 100644 index 759612546..000000000 --- a/src/content/docs/es/developers/verifying-smart-contracts.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -section: developers -date: Last Modified -title: "Verificando Smart Contracts" -lang: "es" -permalink: "developers/verifying-smart-contracts" -whatsnext: { "Scroll Contracts": "/es/developers/scroll-contracts" } -excerpt: "Verifique fácilmente sus smart contracts con herramientas para desarrolladores compatibles con Scroll o con la Blockscout Web API." ---- - -import Aside from "../../../../components/Aside.astro" -import ClickToZoom from "../../../../components/ClickToZoom.astro" -import verify1 from "./_images/verify1.png" -import CodeSample from "../../../../components/CodeSample/CodeSample.astro" - -Después de desplegar tus smart contracts, es importante verificar tu código en [nuestro block explorer](https://scrollscan.com/)o en el [block explorer de Sepolia](https://sepolia-blockscout.scroll.io). Esto se puede hacer de forma automatizada utilizando tus herramientas de desarrollo o la IU web de Blockscout. - -Esto se puede automatizar utilizando nuestras herramientas para desarrolladores o a través de UI en la web de Blockscout. - - - -## Uso de las herramientas para desarrolladores -La mayoría de las herramientas de smart contracts tienen plugins para verificar tus contratos fácilmente en Etherscan. Blockscout soporta las APIs de verificación de contratos de Etherscan, y es sencillo utilizar estas herramientas con la Scroll Sepolia Testnet. - -### Hardhat - -Primero, modifica `hardhat.config.ts` para que apunte al RPC de Scroll y a `sepolia-blockscout.scroll.io/api`. Se requiere un valor `apyKey` ficticio, cualquier valor servirá. - -```javascript -... - -const config: HardhatUserConfig = { - ... - networks: { - scrollSepolia: { - url: 'https://sepolia-rpc.scroll.io' || '', - accounts: - process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], - }, - }, - etherscan: { - apiKey: { - scrollSepolia: 'abc', - }, - customChains: [ - { - network: 'scrollSepolia', - chainId: 534351, - urls: { - apiURL: 'https://sepolia-blockscout.scroll.io/api', - browserURL: 'https://sepolia-blockscout.scroll.io/', - }, - }, - ], - }, -} - -... -``` - -Ahora puedes verificar el smart contract ejecutando el siguiente comando. - -```solidity -npx hardhat verify --network scrollSepolia -``` - -Por ejemplo, así es como debería verse un smart contract que recibe dos parámetros tipo uint en el constructor: - -```solidity -npx hardhat verify --network scrollSepolia 0xD9880690bd717189cC3Fbe7B9020F27fae7Ac76F 123 456 -``` - - - -### Foundry - - - -Cuando se utiliza Foundry, la función `verify-contract` ayuda a automatizar el proceso de verificación de los contratos. - -```bash -forge verify-contract : --chain-id 534351 --verifier-url https://sepolia-blockscout.scroll.io/api\? --verifier blockscout -``` - - \ No newline at end of file diff --git a/src/content/docs/tr/developers/verifying-smart-contracts.mdx b/src/content/docs/tr/developers/verifying-smart-contracts.mdx deleted file mode 100644 index b6e53a64a..000000000 --- a/src/content/docs/tr/developers/verifying-smart-contracts.mdx +++ /dev/null @@ -1,128 +0,0 @@ ---- -section: developers -date: Last Modified -title: "Akıllı Sözleşmeleri Doğrulama" -lang: "tr" -permalink: "developers/verifying-smart-contracts" -whatsnext: { "Scroll Sözleşmeleri": "/tr/developers/scroll-contracts" } -excerpt: "Scroll destekli geliştirici araçlarıyla akıllı sözleşmelerinizi kolayca doğrulayın" ---- - -import Aside from "../../../../components/Aside.astro" -import ClickToZoom from "../../../../components/ClickToZoom.astro" -import verify1 from "./_images/verify1.png" -import CodeSample from "../../../../components/CodeSample/CodeSample.astro" - -Akıllı sözleşmelerinizi dağıttıktan sonra kodunuzu bir blok gezgininde doğrulamanız önemlidir. Bu, geliştirici araçlarını veya web kullanıcı arayüzlerini kullanarak otomatik bir şekilde yapılabilir. - -## Geliştirici Araçlarını Kullanma - -Çoğu akıllı sözleşme aracı, sözleşmelerinizi Etherscan'de kolayca doğrulamak için eklentilere sahiptir. Blockscout, Etherscan'in sözleşme doğrulama API'lerini destekler; dolayısıyla bu araçları, bu blok kaşiflerinden herhangi birinin API'lerini kullanarak kullanmak kolaydır. - -| Ağ | Scroll | Scroll Sepolia | -| ---------- | -------------------------------- | ---------------------------------------- | -| Scrollscan | https://api.scrollscan.com/api | https://api-sepolia.scrollscan.com/api | -| Blockscout | https://blockscout.scroll.io/api | https://sepolia-blockscout.scroll.io/api | - - - -### Hardhat - -'hardhat.config.ts'yi Scroll'un RPC'sine ve blok gezgini API'sine işaret edecek şekilde değiştirin. Blockscout için sahte bir "apiKey" değeri gereklidir, ancak bu değer için herhangi bir değer işe yarar. Scrollscan için kendi API anahtarınızı kullanın. - -Örneğin Blockscout'ta Scroll Sepolia kullanıyorsanız yapılandırmanız şu şekilde görünecektir: -```javascript -... - -const config: HardhatUserConfig = { - ... - networks: { - scrollSepolia: { - url: 'https://sepolia-rpc.scroll.io' || '', - accounts: - process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], - }, - }, - etherscan: { - apiKey: { - scrollSepolia: 'abc', - }, - customChains: [ - { - network: 'scrollSepolia', - chainId: 534351, - urls: { - apiURL: 'https://sepolia-blockscout.scroll.io/api', - browserURL: 'https://sepolia-blockscout.scroll.io/', - }, - }, - ], - }, -} - -... -``` - -Artık aşağıdaki komutu çalıştırarak akıllı sözleşmeyi doğrulayabilirsiniz. - -```solidity -npx hardhat verify --network scrollSepolia -``` - -Örneğin, yapıcıda iki uint parametresi alan bir akıllı sözleşme şu şekilde görünmelidir: - -```solidity -npx hardhat verify --network scrollSepolia 0xD9880690bd717189cC3Fbe7B9020F27fae7Ac76F 123 456 -``` - - - -### Foundry - -Foundry'yi kullanırken "verify-contract" komutu sözleşmelerin doğrulanması sürecinin otomatikleştirilmesine yardımcı olur. Sözleşmenizde yapıcı argümanlar varsa, bunları ABI kodlu biçimde `--constructor-args` seçeneğiyle belirtebilirsiniz. Örneğin, kurucunuz iki "uint256" değişkeni alıyorsa: -```bash - --constructor-args $(cast abi-encode "constructor(uint256,uint256)" 0 7) -``` - -Belirleyebileceğiniz diğer seçenekler için [Foundry belgelerine](https://book.getfoundry.sh/reference/forge/forge-verify-contract) bakın. - - -#### Scrollscan - -```bash -forge verify-contract \ - --verifier-url https://api-sepolia.scrollscan.com/api \ - --etherscan-api-key \ - --constructor-args -``` - - -#### Blockscout - -Doğrulama sağlayıcısını "blockscout" olarak belirtin. - -##### Scroll -```bash -forge verify-contract \ - --verifier-url https://blockscout.scroll.io/api\? \ - --verifier blockscout \ - --constructor-args -``` - -##### Scroll Sepolia -```bash -forge verify-contract \ - --verifier-url https://sepolia-blockscout.scroll.io/api\? \ - --verifier blockscout \ - --constructor-args -``` - - \ No newline at end of file diff --git a/src/content/docs/zh/developers/verifying-smart-contracts.mdx b/src/content/docs/zh/developers/verifying-smart-contracts.mdx deleted file mode 100644 index 1e2e4dbf4..000000000 --- a/src/content/docs/zh/developers/verifying-smart-contracts.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -section: developers -date: Last Modified -title: "验证智能合约" -lang: "zh" -permalink: "developers/verifying-smart-contracts" -whatsnext: { "Scroll 合约": "/zh/developers/scroll-contracts" } -excerpt: "Easily verify your smart contracts with Scroll-supported developer tooling or the Blockscout Web API" ---- - -import Aside from "../../../../components/Aside.astro" -import ClickToZoom from "../../../../components/ClickToZoom.astro" -import verify1 from "./_images/verify1.png" -import CodeSample from "../../../../components/CodeSample/CodeSample.astro" - -部署智能合约后,在[我们的区块浏览器](https://sepolia-blockscout.scroll.io/)上验证您的代码非常重要。这可以使用您的开发者工具或使用Blockscout的网页以自动化方式完成。 - - - -## 使用开发者工具 - -大多数智能合约工具都有插件,可以在Etherscan上轻松验证您的合约。Blockscout支持Etherscan的合约验证API,将这些工具与Scroll Sepolia测试网一起使用非常简单。 - -| 网络 | Scroll | Scroll Sepolia | -| ---------- | -------------------------------- | ---------------------------------------- | -| Scrollscan | https://api.scrollscan.com/api | https://api-sepolia.scrollscan.com/api | -| Blockscout | https://blockscout.scroll.io/api | https://sepolia-blockscout.scroll.io/api | - - - -### Hardhat - -首先,修改 `hardhat.config.ts` 以指向 Scroll 的 RPC 和 `sepolia-blockscout.scroll.io/api`. `apyKey` 设置为虚拟值是必需的,但任何内容都适合其 `apyKey` 值。 - -例如,如果您在 Blockscout 上使用 Scroll Sepolia,您的配置将如下所示: -```javascript -... - -const config: HardhatUserConfig = { - ... - networks: { - scrollSepolia: { - url: 'https://sepolia-rpc.scroll.io' || '', - accounts: - process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], - }, - }, - etherscan: { - apiKey: { - scrollSepolia: 'abc', - }, - customChains: [ - { - network: 'scrollSepolia', - chainId: 534351, - urls: { - apiURL: 'https://sepolia-blockscout.scroll.io/api', - browserURL: 'https://sepolia-blockscout.scroll.io/', - }, - }, - ], - }, -} - -... -``` - -现在,您可以通过运行以下命令来验证智能合约。 - -```solidity -npx hardhat verify --network scrollSepolia -``` - -例如,如下是在智能合约的构造函数中接收两个 uint 参数的: - -```solidity -npx hardhat verify --network scrollSepolia 0xD9880690bd717189cC3Fbe7B9020F27fae7Ac76F 123 456 -``` - - - -### Foundry - -在使用 Foundry 时,`verify-contract` 命令有助于自动化合约验证的过程。如果您的合约具有构造函数参数,您可以使用 `--constructor-args` 选项以 ABI 编码形式指定这些参数。例如,如果您的构造函数接受两个 `uint256` 变量: -```bash - --constructor-args $(cast abi-encode "constructor(uint256,uint256)" 0 7) -``` - -请参考 [Foundry 文档](https://book.getfoundry.sh/reference/forge/forge-verify-contract) 以获取您可以指定的更多选项。 - - -#### Scrollscan - -```bash -forge verify-contract \ - --verifier-url https://api-sepolia.scrollscan.com/api \ - --etherscan-api-key \ - --constructor-args -``` - - -#### Blockscout - -将验证提供者指定为 `blockscout`。 - -##### Scroll -```bash -forge verify-contract \ - --verifier-url https://blockscout.scroll.io/api\? \ - --verifier blockscout \ - --constructor-args -``` - -##### Scroll Sepolia -```bash -forge verify-contract \ - --verifier-url https://sepolia-blockscout.scroll.io/api\? \ - --verifier blockscout \ - --constructor-args -``` - -