From 0bb48e3e9a4df4770a45ed10574a1a066ebac50e Mon Sep 17 00:00:00 2001 From: Nadai <112663528+Nadai2010@users.noreply.github.com> Date: Mon, 29 Jan 2024 11:12:31 +0000 Subject: [PATCH] [i18n] Update Spanish --- po/es.po | 3310 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 2485 insertions(+), 825 deletions(-) diff --git a/po/es.po b/po/es.po index 9c1d6bb3e..b1f23e0cc 100644 --- a/po/es.po +++ b/po/es.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: The Starknet Book\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2024-01-25 20:49+0000\n" +"PO-Revision-Date: 2024-01-29 11:10+0000\n" "Last-Translator: dami \n" "Language-Team: Spanish \n" "Language: es\n" @@ -34,7 +34,7 @@ msgstr "Instalación básica" #: src/SUMMARY.md:14 msgid "Introduction: Starkli, Scarb and Katana" -msgstr "Introducción: Starkli, Scarb and Katana" +msgstr "Introducción: Starkli, Scarb y Katana" #: src/SUMMARY.md:15 msgid "Scarb: The Package Manager" @@ -141,154 +141,158 @@ msgid "Fee Mechanism" msgstr "Mecanismo de Fee" #: src/SUMMARY.md:45 +msgid "Data Availability" +msgstr "Data Availability" + +#: src/SUMMARY.md:46 msgid "Sequencers" msgstr "Secuenciadores" -#: src/SUMMARY.md:46 +#: src/SUMMARY.md:47 msgid "Madara 🚧" msgstr "Madara 🚧" -#: src/SUMMARY.md:47 +#: src/SUMMARY.md:48 msgid "Provers 🚧" msgstr "Provers 🚧" -#: src/SUMMARY.md:48 +#: src/SUMMARY.md:49 msgid "Nodes" msgstr "Nodos" -#: src/SUMMARY.md:49 +#: src/SUMMARY.md:50 msgid "Example: Pathfinder Node" msgstr "Ejemplo: Nodo Pathfinder" -#: src/SUMMARY.md:50 +#: src/SUMMARY.md:51 msgid "Layer 3 and App Chains 🚧 " msgstr "Layer 3 y App Chains 🚧 " -#: src/SUMMARY.md:51 +#: src/SUMMARY.md:52 msgid "Solidity Verifier" msgstr "Verificador de Solidity" -#: src/SUMMARY.md:52 +#: src/SUMMARY.md:53 msgid "Decentralization 🚧" msgstr "Descentralización 🚧" -#: src/SUMMARY.md:53 +#: src/SUMMARY.md:54 msgid "Smart Contracts 🚧" msgstr "Smart Contracts 🚧" -#: src/SUMMARY.md:54 +#: src/SUMMARY.md:55 msgid "Deployment and Interaction" msgstr "Implementación e Interacción" -#: src/SUMMARY.md:55 +#: src/SUMMARY.md:56 msgid "Important Methods" msgstr "Métodos Importantes" -#: src/SUMMARY.md:57 +#: src/SUMMARY.md:58 msgid "Account Abstraction" msgstr "Abstracción de Cuenta" -#: src/SUMMARY.md:60 +#: src/SUMMARY.md:61 msgid "Accounts" msgstr "Cuentas" -#: src/SUMMARY.md:61 +#: src/SUMMARY.md:62 msgid "Hello, Account Contract!" msgstr "¡Hola, Contrato de Cuenta!" -#: src/SUMMARY.md:62 +#: src/SUMMARY.md:63 msgid "Standard Account Contract" msgstr "Contrato de Cuenta Estándar" -#: src/SUMMARY.md:63 +#: src/SUMMARY.md:64 msgid "Deploy Standard Account" msgstr "Implementar Cuenta Estándar" -#: src/SUMMARY.md:64 +#: src/SUMMARY.md:65 msgid "Examples" msgstr "Ejemplos" -#: src/SUMMARY.md:65 +#: src/SUMMARY.md:66 msgid "Multicaller" msgstr "Multicaller" -#: src/SUMMARY.md:66 +#: src/SUMMARY.md:67 msgid "Multisig 🚧" msgstr "Multisig 🚧" -#: src/SUMMARY.md:67 +#: src/SUMMARY.md:68 msgid "Auto-Payments 🚧" msgstr "Auto-Payments 🚧" -#: src/SUMMARY.md:68 +#: src/SUMMARY.md:69 msgid "Alternative Signature Schemes 🚧" msgstr "Esquemas de Firma Alternativos 🚧" -#: src/SUMMARY.md:69 +#: src/SUMMARY.md:70 msgid "Web Wallet: seedless, multi-device wallet" msgstr "Web Wallet: wallet multidispositivo sin semillas" -#: src/SUMMARY.md:73 +#: src/SUMMARY.md:74 msgid "STARKs 🚧" msgstr "STARKs 🚧" -#: src/SUMMARY.md:74 +#: src/SUMMARY.md:75 msgid "Basics 🚧" msgstr "Básicos 🚧" -#: src/SUMMARY.md:75 +#: src/SUMMARY.md:76 msgid "Math Primer 🚧" msgstr "Manual de Matemáticas 🚧" -#: src/SUMMARY.md:76 +#: src/SUMMARY.md:77 msgid "Number Theory 🚧" msgstr "Teoría de Números 🚧" -#: src/SUMMARY.md:77 +#: src/SUMMARY.md:78 msgid "Geometry 🚧" msgstr "Geometría 🚧" -#: src/SUMMARY.md:78 +#: src/SUMMARY.md:79 msgid "Cryptographic Primitives 🚧" msgstr "Primitivas Criptográficas 🚧" -#: src/SUMMARY.md:79 +#: src/SUMMARY.md:80 msgid "Arithimization 🚧" msgstr "Aritimización 🚧" -#: src/SUMMARY.md:80 +#: src/SUMMARY.md:81 msgid "Low Degree Testing 🚧" msgstr "Pruebas de Bajo Grado 🚧" -#: src/SUMMARY.md:81 +#: src/SUMMARY.md:82 msgid "FRI Protocol 🚧" msgstr "FRI 🚧" -#: src/SUMMARY.md:82 +#: src/SUMMARY.md:83 msgid "Efficient STARKs" msgstr "STARK Eficientes" -#: src/SUMMARY.md:83 +#: src/SUMMARY.md:84 msgid "STARKs Protocol (Python) 🚧" msgstr "Protocolo STARK (Python) 🚧" -#: src/SUMMARY.md:84 src/SUMMARY.md:89 +#: src/SUMMARY.md:85 src/SUMMARY.md:90 msgid "Trace/Low Degree Extension 🚧" msgstr "Traza/Extensión de Bajo Grado 🚧" -#: src/SUMMARY.md:85 src/SUMMARY.md:90 +#: src/SUMMARY.md:86 src/SUMMARY.md:91 msgid "Constraints 🚧" msgstr "Restricciones 🚧" -#: src/SUMMARY.md:86 src/SUMMARY.md:91 +#: src/SUMMARY.md:87 src/SUMMARY.md:92 msgid "FRI Commitments 🚧" msgstr "Compromisos de FRI 🚧" -#: src/SUMMARY.md:87 src/SUMMARY.md:92 +#: src/SUMMARY.md:88 src/SUMMARY.md:93 msgid "Query Phase 🚧" msgstr "Fase de Consulta 🚧" -#: src/SUMMARY.md:88 +#: src/SUMMARY.md:89 msgid "STARKs Protocol (Rust) 🚧" msgstr "Protocolo STARK (Rust) 🚧" @@ -434,7 +438,7 @@ msgstr "" "\n" "- Si eres un **desarrollador experimentado** y buscas sumergirte rápidamente en\n" " escribir contratos inteligentes escalables y descentralizados, centrarse en el\n" -" Libro de Cairo, en particular **capítulo 12: Contratos inteligentes de Starknet**\n" +" Libro de Cairo, en particular **capítulo 12: Smart Contracts en Starknet**\n" " ([enlace](https://book.cairo-lang.org/ch99-00-starknet-smart-contracts.html)).\n" "\n" "- Si eres un **desarrollador frontend** que desea integrar Starknet\n" @@ -626,7 +630,7 @@ msgstr "" #: src/ch00-00-introduction.md:15 msgid "## Defining \"Blockchain\"" -msgstr "## Definición de \"Blockchain" +msgstr "## Definición de \"Blockchain\"" #: src/ch00-00-introduction.md:17 msgid "" @@ -2060,7 +2064,7 @@ msgstr "" msgid "These settings streamline Starkli command operations." msgstr "Estas configuraciones agilizan las operaciones de comando de Starkli." -#: src/ch02-02-starkli-scarb-katana.md:64 src/ch02-05-testnet-deployment.md:293 +#: src/ch02-02-starkli-scarb-katana.md:64 src/ch02-05-testnet-deployment.md:297 msgid "## Declaring Smart Contracts in Starknet" msgstr "## Declarando Smart Contracts en Starknet" @@ -2101,7 +2105,6 @@ msgid "" " }\n" " #[external(v0)]\n" " fn set_name(ref self: ContractState, name: felt252) {\n" -" let previous = self.name.read();\n" " self.name.write(name);\n" " }\n" "}\n" @@ -2126,21 +2129,20 @@ msgstr "" " }\n" " #[external(v0)]\n" " fn set_name(ref self: ContractState, name: felt252) {\n" -" let previous = self.name.read();\n" " self.name.write(name);\n" " }\n" "}\n" "```" -#: src/ch02-02-starkli-scarb-katana.md:98 +#: src/ch02-02-starkli-scarb-katana.md:97 msgid "This rudimentary smart contract serves as a starting point." msgstr "Este smart contract rudimentario sirve como punto de partida." -#: src/ch02-02-starkli-scarb-katana.md:100 +#: src/ch02-02-starkli-scarb-katana.md:99 msgid "Compile the contract with the Scarb compiler. If Scarb isn't installed, consult the [Installation](ch02-01-basic-installation.md) section." msgstr "Compile el contrato con el compilador Scarb. Si Scarb no está instalado, consulte la sección [Instalación](ch02-01-basic-installation.md)." -#: src/ch02-02-starkli-scarb-katana.md:102 src/ch02-09-02-erc20-ui.md:109 src/ch02-10-01-erc20-ui.md:108 src/ch04-02-hello-account.md:113 src/ch04-03-standard-account.md:80 +#: src/ch02-02-starkli-scarb-katana.md:101 src/ch02-09-02-erc20-ui.md:109 src/ch02-10-01-erc20-ui.md:108 src/ch04-02-hello-account.md:113 src/ch04-03-standard-account.md:80 msgid "" "```bash\n" "scarb build\n" @@ -2150,15 +2152,15 @@ msgstr "" "scarb build\n" "```" -#: src/ch02-02-starkli-scarb-katana.md:106 +#: src/ch02-02-starkli-scarb-katana.md:105 msgid "The above command results in a compiled contract under `target/dev/`, named \"`my_contract_hello.contract_class.json`\" (check Scarb's subchapter for more details)." msgstr "El comando anterior da como resultado un contrato compilado en `target/dev/`, llamado \"`my_contract_hello.contract_class.json`\" (consulte el subcapítulo de Scarb para obtener más detalles)." -#: src/ch02-02-starkli-scarb-katana.md:108 +#: src/ch02-02-starkli-scarb-katana.md:107 msgid "Having compiled the smart contract, it's time to declare it with Starkli and katana. First, ensure your project acknowledges the environmental variables:" msgstr "Habiendo compilado el smart contract, es hora de declararlo con Starkli y Katana. Primero, asegúrese de que su proyecto reconozca las variables ambientales:" -#: src/ch02-02-starkli-scarb-katana.md:110 +#: src/ch02-02-starkli-scarb-katana.md:109 msgid "" "```bash\n" "source .env\n" @@ -2168,11 +2170,11 @@ msgstr "" "source .env\n" "```" -#: src/ch02-02-starkli-scarb-katana.md:114 +#: src/ch02-02-starkli-scarb-katana.md:113 msgid "Next, launch Katana. In a separate terminal, run (more details in the Katan subchapter):" msgstr "A continuación, lanza Katana. En una terminal separada, ejecute (más detalles en el subcapítulo de Katana):" -#: src/ch02-02-starkli-scarb-katana.md:116 src/ch02-06-starkli.md:29 src/ch02-06-01-connection-script.md:11 +#: src/ch02-02-starkli-scarb-katana.md:115 src/ch02-06-starkli.md:29 src/ch02-06-01-connection-script.md:11 msgid "" "```bash\n" "katana\n" @@ -2182,11 +2184,11 @@ msgstr "" "katana\n" "```" -#: src/ch02-02-starkli-scarb-katana.md:120 +#: src/ch02-02-starkli-scarb-katana.md:119 msgid "To declare your contract, execute:" msgstr "Para declarar su contrato, ejecute:" -#: src/ch02-02-starkli-scarb-katana.md:122 src/ch02-06-starkli.md:61 +#: src/ch02-02-starkli-scarb-katana.md:121 src/ch02-06-starkli.md:61 msgid "" "```bash\n" "starkli declare target/dev/my_contract_hello.contract_class.json\n" @@ -2196,7 +2198,7 @@ msgstr "" "starkli declare target/dev/my_contract_hello.contract_class.json\n" "```" -#: src/ch02-02-starkli-scarb-katana.md:126 +#: src/ch02-02-starkli-scarb-katana.md:125 msgid "" "Facing an \"Error: Invalid contract class\"? It indicates a version mismatch between Scarb's compiler and Starkli. Refer to the earlier steps to sync the versions. Typically, Starkli supports " "compiler versions approved by mainnet, even if the most recent Scarb version isn't compatible." @@ -2204,7 +2206,7 @@ msgstr "" "¿Se enfrenta a un \"Error: Invalid contract class\"? Indica una discrepancia de versiones entre el compilador de Scarb y Starkli. Consulte los pasos anteriores para sincronizar las versiones. " "Normalmente, Starkli admite versiones del compilador aprobadas por la red principal, incluso si la versión más reciente de Scarb no es compatible." -#: src/ch02-02-starkli-scarb-katana.md:128 +#: src/ch02-02-starkli-scarb-katana.md:127 msgid "" "Upon successful command execution, you'll obtain a contract class hash: This\n" "unique hash serves as the identifier for your contract class within\n" @@ -2214,7 +2216,7 @@ msgstr "" "hash único sirve como identificador para su clase de contrato dentro\n" "Starknet. Por ejemplo:" -#: src/ch02-02-starkli-scarb-katana.md:132 src/ch02-06-starkli.md:67 +#: src/ch02-02-starkli-scarb-katana.md:131 src/ch02-06-starkli.md:67 msgid "" "```bash\n" "Class hash declared: 0x00bfb49ff80fd7ef5e84662d6d256d49daf75e0c5bd279b20a786f058ca21418\n" @@ -2224,15 +2226,15 @@ msgstr "" "Class hash declared: 0x00bfb49ff80fd7ef5e84662d6d256d49daf75e0c5bd279b20a786f058ca21418\n" "```" -#: src/ch02-02-starkli-scarb-katana.md:136 +#: src/ch02-02-starkli-scarb-katana.md:135 msgid "Consider this hash as the contract class's _address_." msgstr "Considere este hash como la class's _address_ del contrato." -#: src/ch02-02-starkli-scarb-katana.md:138 +#: src/ch02-02-starkli-scarb-katana.md:137 msgid "If you try to declare an already existing contract class, don't fret. Just proceed. You might see:" msgstr "Si intenta declarar una clase de contrato ya existente, no se preocupe. Simplemente continúa. Es posible que vea:" -#: src/ch02-02-starkli-scarb-katana.md:140 +#: src/ch02-02-starkli-scarb-katana.md:139 msgid "" "```bash\n" "Not declaring class as its already declared. Class hash:\n" @@ -2244,15 +2246,15 @@ msgstr "" "0x00bfb49ff80fd7ef5e84662d6d256d49daf75e0c5bd279b20a786f058ca21418\n" "```" -#: src/ch02-02-starkli-scarb-katana.md:145 +#: src/ch02-02-starkli-scarb-katana.md:144 msgid "## Deploying Starknet Smart Contracts" msgstr "## Implementación de Smart Contracts en Starknet" -#: src/ch02-02-starkli-scarb-katana.md:147 +#: src/ch02-02-starkli-scarb-katana.md:146 msgid "To deploy a smart contract on the katana local devnet, use the following command. It primarily requires:" msgstr "Para implementar un smart contract en el devnet local de katana, utilice el siguiente comando. Requiere principalmente:" -#: src/ch02-02-starkli-scarb-katana.md:149 +#: src/ch02-02-starkli-scarb-katana.md:148 msgid "" "1. Your contract's class hash.\n" "2. Constructor arguments your contract needs (in our example, a _name_ of type `felt252`)." @@ -2260,11 +2262,11 @@ msgstr "" "1. El hash de clase de su contrato.\n" "2. Argumentos del constructor que su contrato necesita (en nuestro ejemplo, a _name_ of type `felt252`)." -#: src/ch02-02-starkli-scarb-katana.md:152 +#: src/ch02-02-starkli-scarb-katana.md:151 msgid "Here's the command structure:" msgstr "Aquí está la estructura de comando:" -#: src/ch02-02-starkli-scarb-katana.md:154 src/ch02-05-testnet-deployment.md:383 +#: src/ch02-02-starkli-scarb-katana.md:153 src/ch02-05-testnet-deployment.md:380 msgid "" "```bash\n" " starkli deploy \\\n" @@ -2278,11 +2280,11 @@ msgstr "" " \n" "```" -#: src/ch02-02-starkli-scarb-katana.md:160 +#: src/ch02-02-starkli-scarb-katana.md:159 msgid "Notice the constructor inputs are in felt format. So we need to convert a short string to a felt252 format. We can use the `to-cairo-string` command for this:" msgstr "Observe que las entradas del constructor están en formato felt. Entonces necesitamos convertir una string corta al formato Felt252. Podemos usar el comando `to-cairo-string` para esto:" -#: src/ch02-02-starkli-scarb-katana.md:162 +#: src/ch02-02-starkli-scarb-katana.md:161 msgid "" "```bash\n" " starkli to-cairo-string \n" @@ -2292,11 +2294,11 @@ msgstr "" " starkli to-cairo-string \n" "```" -#: src/ch02-02-starkli-scarb-katana.md:166 +#: src/ch02-02-starkli-scarb-katana.md:165 msgid "In this case, we'll use the string \"starknetbook\" as the name:" msgstr "En este caso, usaremos la cadena \"starknetbook\" como nombre:" -#: src/ch02-02-starkli-scarb-katana.md:168 +#: src/ch02-02-starkli-scarb-katana.md:167 msgid "" "```bash\n" " starkli to-cairo-string starknetbook\n" @@ -2306,11 +2308,11 @@ msgstr "" " starkli to-cairo-string starknetbook\n" "```" -#: src/ch02-02-starkli-scarb-katana.md:172 +#: src/ch02-02-starkli-scarb-katana.md:171 msgid "The output:" msgstr "La salida:" -#: src/ch02-02-starkli-scarb-katana.md:174 +#: src/ch02-02-starkli-scarb-katana.md:173 msgid "" "```bash\n" " 0x737461726b6e6574626f6f6b\n" @@ -2320,11 +2322,11 @@ msgstr "" " 0x737461726b6e6574626f6f6b\n" "```" -#: src/ch02-02-starkli-scarb-katana.md:178 +#: src/ch02-02-starkli-scarb-katana.md:177 msgid "Now deploy using a class hash and constructor input:" msgstr "Ahora implemente usando un class hash y una entrada de constructor:" -#: src/ch02-02-starkli-scarb-katana.md:180 +#: src/ch02-02-starkli-scarb-katana.md:179 msgid "" "```bash\n" " starkli deploy \\\n" @@ -2338,11 +2340,11 @@ msgstr "" " 0x737461726b6e6574626f6f6b\n" "```" -#: src/ch02-02-starkli-scarb-katana.md:186 +#: src/ch02-02-starkli-scarb-katana.md:185 msgid "After running, expect an output similar to:" msgstr "Después de ejecutar, espere un resultado similar a:" -#: src/ch02-02-starkli-scarb-katana.md:188 +#: src/ch02-02-starkli-scarb-katana.md:187 msgid "" "```bash\n" " Deploying class 0x00bfb49ff80fd7ef5e84662d6d256d49daf75e0c5bd279b20a786f058ca21418 with salt 0x054645c0d1e766ddd927b3bde150c0a3dc0081af7fb82160c1582e05f6018794...\n" @@ -2358,15 +2360,15 @@ msgstr "" " Contract deployed: 0x07cdd583619462c2b14532eddb2b169b8f8d94b63bfb5271dae6090f95147a44\n" "```" -#: src/ch02-02-starkli-scarb-katana.md:195 +#: src/ch02-02-starkli-scarb-katana.md:194 msgid "## Interacting with Starknet Contracts" msgstr "## Interactuar con Contracts de Starknet" -#: src/ch02-02-starkli-scarb-katana.md:197 +#: src/ch02-02-starkli-scarb-katana.md:196 msgid "Using Starkli, you can interact with smart contracts through two primary methods:" msgstr "Con Starkli, puede interactuar con contratos inteligentes a través de dos métodos principales:" -#: src/ch02-02-starkli-scarb-katana.md:199 +#: src/ch02-02-starkli-scarb-katana.md:198 msgid "" "- `call`: For read-only functions.\n" "- `invoke`: For functions that alter the state." @@ -2374,11 +2376,11 @@ msgstr "" "- `call`: Para funciones de solo lectura.\n" "- `invoke`: Para funciones que alteran el estado." -#: src/ch02-02-starkli-scarb-katana.md:202 +#: src/ch02-02-starkli-scarb-katana.md:201 msgid "### Reading Data with `call`" msgstr "### Leyendo Datos con `call`" -#: src/ch02-02-starkli-scarb-katana.md:204 +#: src/ch02-02-starkli-scarb-katana.md:203 msgid "" "The `call` command let's you query contract functions without transacting. For instance, if you want to determine the current contract owner using the `get_name` function, which\n" "requires no arguments:" @@ -2386,7 +2388,7 @@ msgstr "" "El comando `call` le permite consultar funciones de contrato sin realizar transacciones. Por ejemplo, si desea determinar el propietario del contrato actual utilizando la función `get_name`, que\n" "no requiere argumentos:" -#: src/ch02-02-starkli-scarb-katana.md:207 +#: src/ch02-02-starkli-scarb-katana.md:206 msgid "" "```bash\n" " starkli call \\\n" @@ -2400,14 +2402,14 @@ msgstr "" " get_name\n" "```" -#: src/ch02-02-starkli-scarb-katana.md:213 +#: src/ch02-02-starkli-scarb-katana.md:212 msgid "" "Replace `` with the address of your contract. The\n" "command will return the owner’s address, which was initially set during\n" "the contract’s deployment:" msgstr "Reemplace `` con la dirección de su contrato. El comando devolverá la dirección del owner, que se estableció inicialmente durante la implementación del contrato:" -#: src/ch02-02-starkli-scarb-katana.md:217 +#: src/ch02-02-starkli-scarb-katana.md:216 msgid "" "```bash\n" " [\n" @@ -2421,11 +2423,11 @@ msgstr "" " ]\n" "```" -#: src/ch02-02-starkli-scarb-katana.md:223 +#: src/ch02-02-starkli-scarb-katana.md:222 msgid "But what is this lengthy output? In Starknet, we use the `felt252` data type to represent strings. This can be decoded into its string representation:" msgstr "¿Pero qué es este largo resultado? En Starknet, utilizamos el tipo de datos `felt252` para representar cadenas. Esto se puede decodificar en su representación de cadena:" -#: src/ch02-02-starkli-scarb-katana.md:225 +#: src/ch02-02-starkli-scarb-katana.md:224 msgid "" "```bash\n" "starkli parse-cairo-string 0x737461726b6e6574626f6f6b\n" @@ -2435,11 +2437,11 @@ msgstr "" "starkli parse-cairo-string 0x737461726b6e6574626f6f6b\n" "```" -#: src/ch02-02-starkli-scarb-katana.md:229 +#: src/ch02-02-starkli-scarb-katana.md:228 msgid "The result:" msgstr "El resultado:" -#: src/ch02-02-starkli-scarb-katana.md:231 +#: src/ch02-02-starkli-scarb-katana.md:230 msgid "" "```bash\n" "starknetbook\n" @@ -2449,15 +2451,15 @@ msgstr "" "starknetbook\n" "```" -#: src/ch02-02-starkli-scarb-katana.md:235 +#: src/ch02-02-starkli-scarb-katana.md:234 msgid "## Modifying Contract State with `invoke`" msgstr "## Modificando el Estado del Contrato con `invoke`" -#: src/ch02-02-starkli-scarb-katana.md:237 +#: src/ch02-02-starkli-scarb-katana.md:236 msgid "To alter the contract's state, use the `invoke` command. For instance, if you want to update the name field in the storage, utilize the `set_name` function:" msgstr "Para alterar el estado del contrato, use el comando `invoke`. Por ejemplo, si desea actualizar el campo de nombre en el almacenamiento, utilice la función `set_name`:" -#: src/ch02-02-starkli-scarb-katana.md:239 +#: src/ch02-02-starkli-scarb-katana.md:238 msgid "" "```bash\n" " starkli invoke \\\n" @@ -2473,11 +2475,11 @@ msgstr "" " \n" "```" -#: src/ch02-02-starkli-scarb-katana.md:246 +#: src/ch02-02-starkli-scarb-katana.md:245 msgid "Where:" msgstr "Dónde:" -#: src/ch02-02-starkli-scarb-katana.md:248 +#: src/ch02-02-starkli-scarb-katana.md:247 msgid "" "- **``** is the address of your contract.\n" "- **``** is the new value for the **`name`** field, in felt252 format." @@ -2485,11 +2487,11 @@ msgstr "" "- **``** es la dirección de su contrato.\n" "- **``** es el nuevo valor para el campo **`name`**, en formato felt252." -#: src/ch02-02-starkli-scarb-katana.md:251 +#: src/ch02-02-starkli-scarb-katana.md:250 msgid "For example, to update the name to \"Omar\", first convert the string \"Omar\" to its felt252 representation:" msgstr "Por ejemplo, para actualizar el nombre a \"Omar\", primero convierta la cadena \"Omar\" a su representación felt252:" -#: src/ch02-02-starkli-scarb-katana.md:253 +#: src/ch02-02-starkli-scarb-katana.md:252 msgid "" "```bash\n" " starkli to-cairo-string Omar\n" @@ -2499,11 +2501,11 @@ msgstr "" " starkli to-cairo-string Omar\n" "```" -#: src/ch02-02-starkli-scarb-katana.md:257 +#: src/ch02-02-starkli-scarb-katana.md:256 msgid "This will return:" msgstr "Esto devolverá:" -#: src/ch02-02-starkli-scarb-katana.md:259 +#: src/ch02-02-starkli-scarb-katana.md:258 msgid "" "```bash\n" " 0x4f6d6172\n" @@ -2513,11 +2515,11 @@ msgstr "" " 0x4f6d6172\n" "```" -#: src/ch02-02-starkli-scarb-katana.md:263 +#: src/ch02-02-starkli-scarb-katana.md:262 msgid "Now, proceed with the `invoke` command:" msgstr "Ahora, continúa con el comando `invoke`:" -#: src/ch02-02-starkli-scarb-katana.md:265 +#: src/ch02-02-starkli-scarb-katana.md:264 msgid "" "```bash\n" " starkli invoke 0x07cdd583619462c2b14532eddb2b169b8f8d94b63bfb5271dae6090f95147a44 set_name 0x4f6d6172\n" @@ -2527,7 +2529,7 @@ msgstr "" " starkli invoke 0x07cdd583619462c2b14532eddb2b169b8f8d94b63bfb5271dae6090f95147a44 set_name 0x4f6d6172\n" "```" -#: src/ch02-02-starkli-scarb-katana.md:269 +#: src/ch02-02-starkli-scarb-katana.md:268 msgid "Bravo! You've adeptly modified and interfaced with your Starknet contract." msgstr "¡Bravo! Ha modificado e interactuado hábilmente con su contrato Starknet." @@ -3550,8 +3552,8 @@ msgstr "" #: src/ch02-05-testnet-deployment.md:19 msgid "" "In order for an account to be used as a signer it must be deployed to the appropriate network,\n" -"Starknet Sepolia or mainnet, and funded. For this example we are going to use Sepolia Testnet. To deploy your wallet, visit [Smart Wallet Setup](https://book.starknet.io/ch01-00-getting-started." -"html#smart-wallet-setup).\n" +"Starknet Goerli, Sepolia or mainnet, and funded. For this example we are going to use Goerli Testnet. To deploy your wallet, visit [Smart Wallet Setup](https://book.starknet.io/ch01-00-getting-" +"started.html#smart-wallet-setup).\n" "Now you’re ready to interact with Starknet smart contracts." msgstr "" "Para que una cuenta pueda ser utilizada como firmante debe estar desplegada en la red apropiada,\n" @@ -3889,24 +3891,30 @@ msgid "" "2. **Your Own Node**: For those who want full control. It’s the most\n" " complex but offers the most freedom. Check out [Chapter 4 of the\n" " Starknet Book](https://book.starknet.io/chapter_4/node.html) or\n" -" [Kasar](https://www.kasar.io/) for setup guides." +" [Kasar](https://www.kasar.io/) for setup guides.\n" +"\n" +"3. **Free RPC vendor**: These 3 networks are eligible for free RPC vendors: mainet, goerli, sepolia.\n" +" You can choose [Blast](https://blastapi.io/public-api/starknet) or [Nethermind](https://data.voyager.online/)" msgstr "" -"1. **Infura o Alchemy**: Un paso adelante en complejidad. Necesitarás configurar\n" -" una clave API y elegir un punto final. Para Infura, sería así\n" -" `https://starknet-sepolia.infura.io/v3/`. Obtenga más información en la\n" -" [documentación de\n" -" Infura](https://docs.infura.io/networks/starknet/how-to/choose-a-network).\n" +"1. **Infura o Alchemy**: Un paso adelante en complejidad. Tendrá que configurar\n" +" una clave API y elegir un punto final. Para Infura, sería algo así\n" +" `https://starknet-sepolia.infura.io/v3/`. Más información en\n" +" [Infura\n" +" documentación](https://docs.infura.io/networks/starknet/how-to/choose-a-network).\n" "\n" -"2. **Tu Propio Nodo**: Para aquellos que quieren control total. es lo más\n" -" complejo pero ofrece la mayor libertad. Consulte el [Capítulo 4 del\n" -" Libro Starknet](https://book.starknet.io/chapter_4/node.html) o\n" -" [Kasar](https://www.kasar.io/) para obtener guías de configuración." +"2. **Tu Propio Nodo**: Para los que quieren control total. Es el más\n" +" complejo pero ofrece la mayor libertad. Consulta el [Capítulo 4 del\n" +" Libro Starknet](https://book.starknet.io/chapter_4/node.html) o\n" +" [Kasar](https://www.kasar.io/) para obtener guías de configuración.\n" +"\n" +"3. **Proveedor RPC gratuito**: Estas 3 redes son elegibles para proveedores RPC gratuitos: mainet, goerli, sepolia.\n" +" Puedes elegir [Blast](https://blastapi.io/public-api/starknet) o [Nethermind](https://data.voyager.online/)" -#: src/ch02-05-testnet-deployment.md:195 +#: src/ch02-05-testnet-deployment.md:198 msgid "### Creating an Account Descriptor" msgstr "### Creación de un Descriptor de Cuenta" -#: src/ch02-05-testnet-deployment.md:197 +#: src/ch02-05-testnet-deployment.md:200 msgid "" "An Account Descriptor informs Starkli about your smart wallet’s unique\n" "features, such as its signing mechanism. You can generate this\n" @@ -3922,21 +3930,25 @@ msgstr "" "entrada y genera el archivo descriptor de cuenta. El descriptor de cuenta\n" "es un archivo JSON que contiene los detalles de su billetera inteligente. También tenemos que pasar el proveedor rpc aquí." -#: src/ch02-05-testnet-deployment.md:204 +#: src/ch02-05-testnet-deployment.md:207 msgid "" "```bash\n" -" starkli account fetch --output ~/.starkli-wallets/deployer/my_account_1.json --rpc https://starknet-sepolia.infura.io/v3/\n" +" starkli account fetch --output ~/.starkli-wallets/deployer/my_account_1.json --rpc https://starknet-testnet.public.blastapi.io/rpc/v0_6\n" "```" msgstr "" "```bash\n" -" starkli account fetch --output ~/.starkli-wallets/deployer/my_account_1.json --rpc https://starknet-sepolia.infura.io/v3/\n" +" starkli account fetch --output ~/.starkli-wallets/deployer/my_account_1.json --rpc https://starknet-testnet.public.blastapi.io/rpc/v0_6\n" "```" -#: src/ch02-05-testnet-deployment.md:208 -msgid "Note: If you don't specify the rpc provider, Starkli will use Goerli, which will be deprecated soon." -msgstr "Nota: Si no especifica el proveedor rpc, Starkli utilizará Goerli, que pronto quedará obsoleto." +#: src/ch02-05-testnet-deployment.md:211 +msgid "" +"Note: Here we used the Public RPC Endpoint v0.6 Starknet (Goerli) Testnet from **Blast**. If you don't specify the rpc provider, Starkli will use Goerli, which will be deprecated in the upcoming " +"months. Thus you can check the rpc url for Sepolia network on [Blast](https://blastapi.io/public-api/starknet)." +msgstr "" +"Nota: Aquí usamos el Public RPC Endpoint v0.6 Starknet (Goerli) Testnet de **Blast**. Si no especifica el proveedor rpc, Starkli utilizará Goerli, que será obsoleto en los próximos meses. Por lo " +"tanto, puede consultar la url rpc para la red Sepolia en [Blast](https://blastapi.io/public-api/starknet)." -#: src/ch02-05-testnet-deployment.md:210 +#: src/ch02-05-testnet-deployment.md:213 msgid "" "> ⚠️ **Contract not found?**\n" ">\n" @@ -3949,43 +3961,44 @@ msgid "" "> #### 🟩 Solution:\n" ">\n" "> It means you probably just created a new wallet and it has **not been deployed yet**. To accomplish this you have to fund your wallet with tokens and **transfer tokens** to a **different** wallet " -"address. Detailed intructons can be found in the [Get Seplia Tokens](./ch02-05-01-start-with-sepolia.md) section.\n" +"address. For goerli tokens you can check this [faucet](https://faucet.goerli.starknet.io/). For Sepolia tokens detailed intructons can be found in the [Get Sepolia Tokens](./ch02-05-01-start-with-" +"sepolia.md) section.\n" ">\n" "> **Still doesn't work?**\n" ">\n" -"> Check if your wallet's testnet network isn't yet set with Sepolia, that means you have to after deploying your wallet testnet, use instead the soon to be deprecated Goerli network:\n" +"> Check if your wallet's testnet network isn't yet set with Goerli or Sepolia, try again with your blast rpc url.\n" ">\n" "> ```bash\n" -"> starknet account fetch ... --rpc https://starknet-goerli.infura.io/v3/\n" +"> starknet account fetch ... --rpc https://starknet-testnet.public.blastapi.io/rpc/\n" "> ```\n" ">\n" "> ⚠️ And if you use Goerli, make sure you use it in subsequent commands as well." msgstr "" "> ⚠️ **¿Contrato no encontrado?**\n" ">\n" -"> En caso de que se enfrente a un error como este:\n" +"> En caso de que te encuentres con un error como este:\n" ">\n" -"> ```bash\n" -"> Error: ContractNotFound\n" +"> ``bash\n" +"> Error: ContractNotFound\n" "> ```\n" ">\n" "> #### 🟩 Solución:\n" ">\n" -"> Significa que probablemente acabas de crear una nueva billetera y **aún no se ha implementado**. Para lograr esto, debe financiar su billetera con tokens y **transferir tokens** a una dirección " -"de billetera **diferente**. Se pueden encontrar instrucciones detalladas en la sección [Obtener tokens Seplia](./ch02-05-01-start-with-sepolia.md).\n" +"> Significa que probablemente acabas de crear un nuevo monedero y **todavía no ha sido desplegado**. Para ello tienes que financiar tu monedero con tokens y **transferir tokens** a una dirección de " +"monedero **diferente**. Para los tokens goerli puedes consultar este [faucet](https://faucet.goerli.starknet.io/). Para los tokens Sepolia puedes encontrar instrucciones detalladas en la sección " +"[Get Sepolia Tokens](./ch02-05-01-start-with-sepolia.md).\n" ">\n" -"> **¿Aún no funciona?**\n" +"> ¿Sigue sin funcionar?\n" ">\n" -"> Verifique si la red testnet de su billetera aún no está configurada con Sepolia, eso significa que después de implementar la testnet de su billetera, debe usar en su lugar la red Goerli que " -"pronto quedará obsoleta:\n" +"> Comprueba si la red testnet de tu wallet aún no está configurada con Goerli o Sepolia, inténtalo de nuevo con tu url rpc blast.\n" ">\n" -"> ```bash\n" -"> starknet account fetch ... --rpc https://starknet-goerli.infura.io/v3/\n" +"> ``bash\n" +"> starknet account fetch ... --rpc https://starknet-testnet.public.blastapi.io/rpc/\n" "> ```\n" ">\n" -"> ⚠️ Y si usas Goerli, asegúrate de usarlo también en los comandos posteriores." +"> ⚠️ Y si usas Goerli, asegúrate de usarlo también en los comandos siguientes." -#: src/ch02-05-testnet-deployment.md:232 +#: src/ch02-05-testnet-deployment.md:235 msgid "" "After this process, search your wallet address on the Starknet explorer. To see the details, go back to [Smart Wallet Setup](https://book.starknet.io/ch01-00-getting-started.html#smart-wallet-" "setup)." @@ -3993,14 +4006,14 @@ msgstr "" "Después de este proceso, busque la dirección de su billetera en el explorador Starknet. Para ver los detalles, regrese a [Configuración de Smart Wallet](https://book.starknet.io/ch01-00-getting-" "started.html#smart-wallet-setup)." -#: src/ch02-05-testnet-deployment.md:234 +#: src/ch02-05-testnet-deployment.md:237 msgid "" "After running the command, you’ll see a message like the one below.\n" "We’re using a Braavos wallet as an example, but the steps are the same\n" "for an Argent wallet." msgstr "Después de ejecutar el comando, verá un mensaje como el siguiente. Estamos usando una billetera Braavos como ejemplo, pero los pasos son los mismos para una billetera Argent." -#: src/ch02-05-testnet-deployment.md:238 +#: src/ch02-05-testnet-deployment.md:241 msgid "" "```bash\n" " Account contract type identified as: Braavos\n" @@ -4014,11 +4027,11 @@ msgstr "" " Downloaded new account config file: ~/.starkli-wallets/deployer/my_account_1.json\n" "```" -#: src/ch02-05-testnet-deployment.md:244 +#: src/ch02-05-testnet-deployment.md:247 msgid "After the acount descriptor file is generated, you can see its details, run:" msgstr "Una vez generado el archivo descriptor de la cuenta, puede ver sus detalles y ejecutar:" -#: src/ch02-05-testnet-deployment.md:246 +#: src/ch02-05-testnet-deployment.md:249 msgid "" "```bash\n" " cat ~/.starkli-wallets/deployer/my_account_1.json\n" @@ -4028,11 +4041,11 @@ msgstr "" " cat ~/.starkli-wallets/deployer/my_account_1.json\n" "```" -#: src/ch02-05-testnet-deployment.md:250 +#: src/ch02-05-testnet-deployment.md:253 msgid "Here’s what a typical descriptor might look like:" msgstr "Así es como podría verse un descriptor típico:" -#: src/ch02-05-testnet-deployment.md:252 +#: src/ch02-05-testnet-deployment.md:255 msgid "" "```json\n" "{\n" @@ -4084,15 +4097,15 @@ msgstr "" "}\n" "```" -#: src/ch02-05-testnet-deployment.md:277 +#: src/ch02-05-testnet-deployment.md:280 msgid "Note: The structure will differ if you use an Argent wallet." msgstr "Note: The structure will differ if you use an Argent wallet." -#: src/ch02-05-testnet-deployment.md:279 +#: src/ch02-05-testnet-deployment.md:282 msgid "## Setting up Environment Variables" msgstr "## Configuración de Variables de Entorno" -#: src/ch02-05-testnet-deployment.md:281 +#: src/ch02-05-testnet-deployment.md:284 msgid "" "To simplify Starkli commands, you can set environment variables. Two key\n" "variables are crucial: one for the Signer’s keystore file location and\n" @@ -4101,29 +4114,31 @@ msgstr "" "Para simplificar los comandos de Starkli, puede configurar variables de entorno. Dos variables clave son cruciales: una para la ubicación del archivo del keystore del firmante y otra para el " "archivo del descriptor de cuenta." -#: src/ch02-05-testnet-deployment.md:285 +#: src/ch02-05-testnet-deployment.md:288 msgid "" "```bash\n" " export STARKNET_ACCOUNT=~/.starkli-wallets/deployer/my_account_1.json\n" " export STARKNET_KEYSTORE=~/.starkli-wallets/deployer/my_keystore_1.json\n" +" export STARKNET_RPC=https://starknet-testnet.public.blastapi.io/rpc/v0_6\n" "```" msgstr "" "```bash\n" " export STARKNET_ACCOUNT=~/.starkli-wallets/deployer/my_account_1.json\n" " export STARKNET_KEYSTORE=~/.starkli-wallets/deployer/my_keystore_1.json\n" +" export STARKNET_RPC=https://starknet-testnet.public.blastapi.io/rpc/v0_6\n" "```" -#: src/ch02-05-testnet-deployment.md:290 +#: src/ch02-05-testnet-deployment.md:294 msgid "" "Setting these variables makes running Starkli commands easier and more\n" "efficient." msgstr "Configurar estas variables hace que la ejecución de comandos Starkli sea más fácil y eficiente." -#: src/ch02-05-testnet-deployment.md:295 +#: src/ch02-05-testnet-deployment.md:299 msgid "Deploying a smart contract on Starknet involves two steps:" msgstr "Implementar un contrato inteligente en Starknet implica dos pasos:" -#: src/ch02-05-testnet-deployment.md:297 +#: src/ch02-05-testnet-deployment.md:301 msgid "" "- Declare your contract’s code.\n" "- Deploy an instance of the declared code." @@ -4131,7 +4146,7 @@ msgstr "" "- Declara el código de tu contrato.\n" "- Implementar una instancia del código declarado." -#: src/ch02-05-testnet-deployment.md:300 +#: src/ch02-05-testnet-deployment.md:304 msgid "" "To get started, navigate to the `src/` directory in the [examples/Ownable-Starknet](https://github.com/starknet-edu/starknetbook/tree/main/examples/Ownable-Starknet) directory\n" "of the Starknet Book repo. The `src/lib.cairo` file contains a basic\n" @@ -4141,7 +4156,7 @@ msgstr "" "del repositorio de Starknet Book. El archivo `src/lib.cairo` contiene un contrato básico\n" "para practicar." -#: src/ch02-05-testnet-deployment.md:304 +#: src/ch02-05-testnet-deployment.md:308 msgid "" "First, compile the contract using the Scarb compiler. If you haven’t\n" "installed Scarb, follow the installation guide in the [basic installation](./ch02-01-basic-installation)\n" @@ -4150,7 +4165,7 @@ msgstr "" "Primero, compila el contrato usando el compilador Scarb. Si no has instalado\n" "Scarb, siga la guía de instalación en la sección [instalación básica](./ch02-01-basic-installation)." -#: src/ch02-05-testnet-deployment.md:308 +#: src/ch02-05-testnet-deployment.md:312 msgid "" "```bash\n" " scarb build\n" @@ -4160,7 +4175,7 @@ msgstr "" " scarb build\n" "```" -#: src/ch02-05-testnet-deployment.md:312 +#: src/ch02-05-testnet-deployment.md:316 msgid "" "This creates a compiled contract in `target/dev/` as\n" "`ownable_starknet_ownable.compiled_contract_class.json` (in Chapter 2 of the book we will learn\n" @@ -4170,35 +4185,17 @@ msgstr "" "`ownable_starknet_ownable.compiled_contract_class.json` (en el Capítulo 2 del libro aprenderemos\n" "más detalles sobre Scarb)." -#: src/ch02-05-testnet-deployment.md:316 -msgid "" -"With the smart contract compiled, we’re ready to declare it using\n" -"Starkli. Then we can set the STARKNET_RPC environment variable to make command invocations easier:" -msgstr "" -"Con el smart contract compilado, estamos listos para declararlo usando\n" -"Starkli. Luego podemos configurar la variable de entorno STARKNET_RPC para facilitar la invocación de comandos:" - -#: src/ch02-05-testnet-deployment.md:319 -msgid "" -"```bash\n" -" export STARKNET_RPC=\"https://starknet-sepolia.infura.io/v3/\"\n" -"```" -msgstr "" -"```bash\n" -" export STARKNET_RPC=\"https://starknet-sepolia.infura.io/v3/\"\n" -"```" - -#: src/ch02-05-testnet-deployment.md:323 +#: src/ch02-05-testnet-deployment.md:320 msgid "### Declaring Your Contract" msgstr "### Declarando su Contrato" -#: src/ch02-05-testnet-deployment.md:325 +#: src/ch02-05-testnet-deployment.md:322 msgid "" "Run this command to declare your contract using the default Starknet\n" "Sequencer’s Gateway:" msgstr "Ejecute este comando para declarar su contrato utilizando la puerta de enlace predeterminada del secuenciador Starknet:" -#: src/ch02-05-testnet-deployment.md:328 +#: src/ch02-05-testnet-deployment.md:325 msgid "" "```bash\n" " starkli declare ./target/dev/ownable_starknet_ownable.contract_class.json\n" @@ -4208,17 +4205,17 @@ msgstr "" " starkli declare ./target/dev/ownable_starknet_ownable.contract_class.json\n" "```" -#: src/ch02-05-testnet-deployment.md:332 +#: src/ch02-05-testnet-deployment.md:329 msgid "" "According to the `STARKNET_RPC` url, starkli can recognize the target\n" -"blockchain network, in this case \"sepolia\", so it is not necessary\n" +"blockchain network, in this case \"goerli\", so it is not necessary\n" "explicitly specify it." msgstr "" -"Según la URL `STARKNET_RPC`, starkli puede reconocer el objetivo\n" -"red blockchain, en este caso \"sepolia\", por lo que no es necesario\n" +"De acuerdo con la url `STARKNET_RPC`, starkli puede reconocer la red blockchain\n" +"de destino, en este caso \"goerli\", por lo que no es necesario\n" "especificarlo explícitamente." -#: src/ch02-05-testnet-deployment.md:336 +#: src/ch02-05-testnet-deployment.md:333 msgid "" "Unless you’re working with custom networks where it’s infeasible for\n" "Starkli to detect the right compiler version, you shouldn’t need to\n" @@ -4227,7 +4224,7 @@ msgstr "" "A menos que esté trabajando con redes personalizadas donde a Starkli no le resulta factible detectar la versión correcta del compilador, no debería necesitar elegir manualmente una versión con `--" "network` y `--compiler-version`." -#: src/ch02-05-testnet-deployment.md:340 +#: src/ch02-05-testnet-deployment.md:337 msgid "" "If you encounter an \"Error: Invalid contract class,\" it likely means\n" "your Scarb’s compiler version is incompatible with Starkli. Follow the\n" @@ -4238,14 +4235,14 @@ msgstr "" "Si encuentra un \"Error: Invalid contract class\", probablemente significa que la versión del compilador de Scarb no es compatible con Starkli. Siga los pasos anteriores para alinear las versiones. " "Starkli generalmente admite versiones de compiladores aceptadas por la red principal, incluso si la última versión de Scarb aún no es compatible." -#: src/ch02-05-testnet-deployment.md:346 +#: src/ch02-05-testnet-deployment.md:343 msgid "" "After running the command, you’ll receive a contract class hash. This\n" "unique hash serves as the identifier for your contract class within\n" "Starknet. For example:" msgstr "Después de ejecutar el comando, recibirá un hash de clase de contrato. Este hash único sirve como identificador de su clase de contrato (contract class) dentro de Starknet. Por ejemplo:" -#: src/ch02-05-testnet-deployment.md:350 +#: src/ch02-05-testnet-deployment.md:347 msgid "" "```bash\n" " Class hash declared: 0x04c70a75f0246e572aa2e1e1ec4fffbe95fa196c60db8d5677a5c3a3b5b6a1a8\n" @@ -4255,7 +4252,7 @@ msgstr "" " Class hash declared: 0x04c70a75f0246e572aa2e1e1ec4fffbe95fa196c60db8d5677a5c3a3b5b6a1a8\n" "```" -#: src/ch02-05-testnet-deployment.md:354 +#: src/ch02-05-testnet-deployment.md:351 msgid "" "You can think of this hash as the contract class’s _address._ Use a\n" "block explorer like\n" @@ -4265,13 +4262,13 @@ msgstr "" "Puede considerar este hash como la dirección de la clase de contrato. Utilice un explorador de bloques como [StarkScan](https://testnet.starkscan.co/" "class/0x04c70a75f0246e572aa2e1e1ec4fffbe95fa196c60db8d5677a5c3a3b5b6a1a8) para verificar este hash en la cadena de bloques." -#: src/ch02-05-testnet-deployment.md:359 +#: src/ch02-05-testnet-deployment.md:356 msgid "" "If the contract class you’re attempting to declare already exists, it is\n" "ok we can continue. You’ll receive a message like:" msgstr "Si la contract class que intenta declarar ya existe, está bien, podemos continuar. Recibirás un mensaje como:" -#: src/ch02-05-testnet-deployment.md:362 +#: src/ch02-05-testnet-deployment.md:359 msgid "" "```bash\n" " Not declaring class as its already declared. Class hash:\n" @@ -4283,11 +4280,11 @@ msgstr "" " 0x04c70a75f0246e572aa2e1e1ec4fffbe95fa196c60db8d5677a5c3a3b5b6a1a8\n" "```" -#: src/ch02-05-testnet-deployment.md:367 +#: src/ch02-05-testnet-deployment.md:364 msgid "## Deploying Smart Contracts on Starknet" msgstr "## Implementación de Smart Contracts en Starknet" -#: src/ch02-05-testnet-deployment.md:369 +#: src/ch02-05-testnet-deployment.md:366 msgid "" "To deploy a smart contract, you’ll need to instantiate it on Starknet’s\n" "testnet. This process involves executing a command that requires two\n" @@ -4295,7 +4292,7 @@ msgid "" msgstr "" "Para implementar un contrato inteligente, deberá crear una instancia del mismo en la red de prueba de Starknet. Este proceso implica ejecutar un comando que requiere dos componentes principales:" -#: src/ch02-05-testnet-deployment.md:373 +#: src/ch02-05-testnet-deployment.md:370 msgid "" "1. The class hash of your smart contract.\n" "\n" @@ -4305,7 +4302,7 @@ msgstr "" "\n" "2. Cualquier argumento del constructor que el contrato espera." -#: src/ch02-05-testnet-deployment.md:377 +#: src/ch02-05-testnet-deployment.md:374 msgid "" "In our example, the constructor expects an _owner_ address. You can\n" "learn more about constructors in [Chapter 12 of The Cairo\n" @@ -4315,11 +4312,11 @@ msgstr "" "obtener más información sobre los constructores en el [Capítulo 12 del Libro de \n" "Cairo](https://book.cairo-lang.org/ch99-01-03-02-contract-functions.html?highlight=constructor#1-constructors)." -#: src/ch02-05-testnet-deployment.md:381 +#: src/ch02-05-testnet-deployment.md:378 msgid "The command would look like this:" msgstr "El comando se vería así:" -#: src/ch02-05-testnet-deployment.md:389 +#: src/ch02-05-testnet-deployment.md:386 msgid "" "Here’s a specific example with an actual class hash and constructor\n" "inputs (as the owner address use the address of your smart wallet so you\n" @@ -4328,7 +4325,7 @@ msgstr "" "Aquí hay un ejemplo específico con un class hash real y entradas de constructor (como dirección del owner, use la dirección de su billetera inteligente para poder invocar la función " "transfer_ownership más adelante):" -#: src/ch02-05-testnet-deployment.md:393 +#: src/ch02-05-testnet-deployment.md:390 msgid "" "```bash\n" " starkli deploy \\\n" @@ -4342,13 +4339,13 @@ msgstr "" " 0x02cdAb749380950e7a7c0deFf5ea8eDD716fEb3a2952aDd4E5659655077B8510\n" "```" -#: src/ch02-05-testnet-deployment.md:399 +#: src/ch02-05-testnet-deployment.md:396 msgid "" "After executing the command and entering your password, you should see\n" "output like the following:" msgstr "Después de ejecutar el comando e ingresar su contraseña, debería ver un resultado como el siguiente:" -#: src/ch02-05-testnet-deployment.md:402 +#: src/ch02-05-testnet-deployment.md:399 msgid "" "```bash\n" " Deploying class 0x04c70a75f0246e572aa2e1e1ec4fffbe95fa196c60db8d5677a5c3a3b5b6a1a8 with salt 0x065034b27a199cbb2a5b97b78a8a6a6c6edd027c7e398b18e5c0e5c0c65246b7...\n" @@ -4366,7 +4363,7 @@ msgstr "" " 0x02a83c32d4b417d3c22f665acbc10e9a1062033b9ab5b2c3358952541bc6c012\n" "```" -#: src/ch02-05-testnet-deployment.md:410 +#: src/ch02-05-testnet-deployment.md:407 msgid "" "The contract is now live on the Starknet testnet. You can verify its\n" "status using a block explorer like\n" @@ -4377,11 +4374,11 @@ msgstr "" "El contrato ya está activo en la red de prueba de Starknet. Puede verificar su estado utilizando un explorador de bloques como [StarkScan](https://testnet.starkscan.co/" "contract/0x02a83c32d4b417d3c22f665acbc10e9a1062033b9ab5b2c3358952541bc6c012). En la pestaña \"Read/Write Contract\", verá las funciones externas del contrato." -#: src/ch02-05-testnet-deployment.md:416 +#: src/ch02-05-testnet-deployment.md:413 msgid "## Interacting with the Starknet Contract" msgstr "## Interactuando con el Contrato Starknet" -#: src/ch02-05-testnet-deployment.md:418 +#: src/ch02-05-testnet-deployment.md:415 msgid "" "Starkli enables interaction with smart contracts via two primary\n" "methods: `call` for read-only functions and `invoke` for write functions\n" @@ -4389,11 +4386,11 @@ msgid "" msgstr "" "Starkli permite la interacción con contratos inteligentes a través de dos métodos principales: `call` para funciones de solo lectura e invoke`para funciones de escritura que modifican el estado." -#: src/ch02-05-testnet-deployment.md:422 +#: src/ch02-05-testnet-deployment.md:419 msgid "### Calling a Read Function" msgstr "### Llamar a una Función de Lectura" -#: src/ch02-05-testnet-deployment.md:424 +#: src/ch02-05-testnet-deployment.md:421 msgid "" "The `call` command enables you to query a smart contract function\n" "without sending a transaction. For instance, to find out who the current\n" @@ -4403,7 +4400,7 @@ msgstr "" "El comando `call` le permite consultar una función de contrato inteligente sin enviar una transacción. Por ejemplo, para saber quién es el propietario actual del contrato, puede utilizar la función " "`get_owner`, que no requiere argumentos." -#: src/ch02-05-testnet-deployment.md:429 src/ch02-05-testnet-deployment.md:485 +#: src/ch02-05-testnet-deployment.md:426 src/ch02-05-testnet-deployment.md:482 msgid "" "```bash\n" " starkli call \\\n" @@ -4417,7 +4414,7 @@ msgstr "" " owner\n" "```" -#: src/ch02-05-testnet-deployment.md:435 +#: src/ch02-05-testnet-deployment.md:432 msgid "" "Replace `` with the address of your recently deployed contract. The command will return the owner’s address, which was initially set during\n" "the contract’s deployment:" @@ -4425,7 +4422,7 @@ msgstr "" "Reemplace `` con la dirección de su contrato implementado recientemente. El comando devolverá la dirección del propietario, que se configuró inicialmente durante\n" "el despliegue del contrato:" -#: src/ch02-05-testnet-deployment.md:438 +#: src/ch02-05-testnet-deployment.md:435 msgid "" "```bash\n" " [\n" @@ -4439,18 +4436,18 @@ msgstr "" " ]\n" "```" -#: src/ch02-05-testnet-deployment.md:444 +#: src/ch02-05-testnet-deployment.md:441 msgid "## Invoking a Write Function" msgstr "## Invocar una Función de Escritura" -#: src/ch02-05-testnet-deployment.md:446 +#: src/ch02-05-testnet-deployment.md:443 msgid "" "You can modify the contract’s state using the `invoke` command. For\n" "example, let’s transfer the contract’s ownership with the\n" "`transfer_ownership` function." msgstr "Puede modificar el estado del contrato utilizando el comando`invoke`. Por ejemplo, transfiramos la propiedad del contrato con la función `transfer_ownership`." -#: src/ch02-05-testnet-deployment.md:450 +#: src/ch02-05-testnet-deployment.md:447 msgid "" "```bash\n" " starkli invoke \\\n" @@ -4466,7 +4463,7 @@ msgstr "" " \n" "```" -#: src/ch02-05-testnet-deployment.md:457 +#: src/ch02-05-testnet-deployment.md:454 msgid "" "Replace `` with the address of the contract and\n" "`` with the address you want to transfer ownership\n" @@ -4477,7 +4474,7 @@ msgstr "" "Reemplace `` con la dirección del contrato y `` con la dirección a la que desea transferir la propiedad. Si la billetera inteligente que está utilizando no es " "la propietaria del contrato, aparecerá un error. Tenga en cuenta que el propietario inicial se estableció al implementar el contrato:" -#: src/ch02-05-testnet-deployment.md:463 +#: src/ch02-05-testnet-deployment.md:460 msgid "" "```bash\n" " Execution was reverted; failure reason: [0x43616c6c6572206973206e6f7420746865206f776e6572].\n" @@ -4487,13 +4484,13 @@ msgstr "" " Execution was reverted; failure reason: [0x43616c6c6572206973206e6f7420746865206f776e6572].\n" "```" -#: src/ch02-05-testnet-deployment.md:467 +#: src/ch02-05-testnet-deployment.md:464 msgid "" "The failure reason is encoded as a felt. o decode it, use the starkli’s\n" "`parse-cairo-string` command." msgstr "El motivo del fracaso está codificado como un sentimiento. Para decodificarlo, use el comando `parse-cairo-string` de starkli." -#: src/ch02-05-testnet-deployment.md:470 +#: src/ch02-05-testnet-deployment.md:467 msgid "" "```bash\n" " starkli parse-cairo-string \n" @@ -4503,33 +4500,33 @@ msgstr "" " starkli parse-cairo-string \n" "```" -#: src/ch02-05-testnet-deployment.md:474 +#: src/ch02-05-testnet-deployment.md:471 msgid "" "For example, if you see\n" "`0x43616c6c6572206973206e6f7420746865206f776e6572`, decoding it will\n" "yield \"Caller is not the owner.\"" msgstr "Por ejemplo, si ve `0x43616c6c6572206973206e6f7420746865206f776e6572`, al decodificarlo se obtendrá \"Caller is not the owner.\"" -#: src/ch02-05-testnet-deployment.md:478 +#: src/ch02-05-testnet-deployment.md:475 msgid "" "After a successful transaction on L2, use a block explorer like\n" "StarkScan or Voyager to confirm the transaction status using the hash\n" "provided by the `invoke` command." msgstr "Después de una transacción exitosa en L2, use un explorador de bloques como StarkScan o Voyager para confirmar el estado de la transacción usando el hash proporcionado por el comando`invoke`." -#: src/ch02-05-testnet-deployment.md:482 +#: src/ch02-05-testnet-deployment.md:479 msgid "" "To verify that the ownership has successfully transferred, you can call\n" "the `get_owner` function again:" msgstr "Para verificar que la propiedad se haya transferido exitosamente, puedes volver a llamar a la función `get_owner`:" -#: src/ch02-05-testnet-deployment.md:491 +#: src/ch02-05-testnet-deployment.md:488 msgid "" "If the function returns the new owner’s address, the transfer was\n" "successful." msgstr "Si la función devuelve la dirección del nuevo propietario, la transferencia fue exitosa." -#: src/ch02-05-testnet-deployment.md:494 +#: src/ch02-05-testnet-deployment.md:491 msgid "" "Congratulations! You’ve successfully deployed and interacted with a\n" "Starknet contract." @@ -7440,38 +7437,41 @@ msgstr "" #: src/ch02-09-starknet-js.md:163 msgid "With Starknet.js, you can also automate the process of deploying a smart contract to Starknet testnet / mainnet." -msgstr "" +msgstr "Con Starknet.js, también puedes automatizar el proceso de despliegue de un smart contract en Starknet testnet / mainnet." #: src/ch02-09-starknet-js.md:165 -#, fuzzy msgid "# Deployment of Smart Contracts using Starknet.js" -msgstr "## Implementación de Smart Contracts en Starknet" +msgstr "# Despliegue de Smart Contracts usando Starknet.js" #: src/ch02-09-starknet-js.md:167 msgid "" "Starknet.js offers capabilities for deploying smart contracts. In this tutorial, we demonstrate this by deploying an account contract, which we previously developed in [Chapter 4](https://book." "starknet.io/ch04-03-standard-account.html), through a scripted approach." msgstr "" +"Starknet.js ofrece capacidades para desplegar smart contracts. En este tutorial, demostramos esto desplegando un contrato de cuenta, que desarrollamos previamente en [Capítulo 4](https://book." +"starknet.io/ch04-03-standard-account.html), a través de un enfoque de secuencias de comandos." #: src/ch02-09-starknet-js.md:169 msgid "## STEP 1: Initial Setup and Dependency Installation" -msgstr "" +msgstr "## PASO 1: Configuración Inicial e Instalación de Dependencias" #: src/ch02-09-starknet-js.md:171 msgid "To begin, set up your project environment for the account contract deployment. Within your project'sroot directory, start by initializing a Node.js environment:" -msgstr "" +msgstr "Para empezar, configura el entorno de tu proyecto para el despliegue del contrato de cuenta. Dentro del directorio raíz del proyecto, empieza por inicializar un entorno Node.js:" #: src/ch02-09-starknet-js.md:173 -#, fuzzy msgid "" "```sh\n" "npm init -y\n" "```" -msgstr "npm install starknet" +msgstr "" +"```sh\n" +"npm init -y\n" +"```" #: src/ch02-09-starknet-js.md:177 msgid "This command generates a package.json file. Next, update this file to include the latest versions of the necessary dependencies:" -msgstr "" +msgstr "Este comando genera un archivo package.json. A continuación, actualice este archivo para incluir las últimas versiones de las dependencias necesarias:" #: src/ch02-09-starknet-js.md:179 msgid "" @@ -7485,26 +7485,37 @@ msgid "" "\"typescript\": \"^5.2.2\"\n" "```" msgstr "" +"```json\n" +"\"@tsconfig/node20\": \"^20.1.2\",\n" +"\"axios\": \"^1.6.0\",\n" +"\"chalk\": \"^5.3.0\",\n" +"\"dotenv\": \"^16.3.1\",\n" +"\"starknet\": \"^5.19.5\",\n" +"\"ts-node\": \"^10.9.1\",\n" +"\"typescript\": \"^5.2.2\"\n" +"```" #: src/ch02-09-starknet-js.md:189 msgid "With the dependencies specified, install them using:" -msgstr "" +msgstr "Con las dependencias especificadas, instálalas utilizando:" #: src/ch02-09-starknet-js.md:191 -#, fuzzy msgid "" "```sh\n" "npm install\n" "```" -msgstr "npm install starknet" +msgstr "" +"```sh\n" +"npm install\n" +"```" #: src/ch02-09-starknet-js.md:195 msgid "## Configuration of TypeScript Environment" -msgstr "" +msgstr "## Configuración del entorno TypeScript" #: src/ch02-09-starknet-js.md:197 msgid "Create a `tsconfig.json` file in your project directory:" -msgstr "" +msgstr "Cree un archivo `tsconfig.json` en el directorio de su proyecto:" #: src/ch02-09-starknet-js.md:199 msgid "" @@ -7515,14 +7526,20 @@ msgid "" "}\n" "```" msgstr "" +"```json\n" +"{\n" +" \"extends\": \"./node_modules/@tsconfig/node20/tsconfig.json\",\n" +" \"include\": [\"scripts/**/*\"]\n" +"}\n" +"```" #: src/ch02-09-starknet-js.md:206 msgid "Ensure your Node.js version aligns with v20 to match this configuration." -msgstr "" +msgstr "Asegúrate de que tu versión de Node.js coincide con la v20 para que coincida con esta configuración." #: src/ch02-09-starknet-js.md:208 msgid "Furthermore, establish a `.env` file at the root of your project. This file should contain your RPC endpoint and the private key of your deployer account:" -msgstr "" +msgstr "Además, cree un archivo `.env` en la raíz de su proyecto. Este archivo debe contener su punto final RPC y la clave privada de su cuenta deployer:" #: src/ch02-09-starknet-js.md:210 msgid "" @@ -7531,19 +7548,22 @@ msgid "" "RPC_ENDPOINT=\"\"\n" "```" msgstr "" +"```sh\n" +"DEPLOYER_PRIVATE_KEY=\n" +"RPC_ENDPOINT=\"\"\n" +"```" #: src/ch02-09-starknet-js.md:215 msgid "Your environment is successfully set up." -msgstr "" +msgstr "Su entorno se ha configurado correctamente." #: src/ch02-09-starknet-js.md:217 -#, fuzzy msgid "## Preparation of Deployment Scripts" -msgstr "Ejemplo - Script de Implantación" +msgstr "## Preparación de los Deployment Scripts" #: src/ch02-09-starknet-js.md:219 msgid "To facilitate the deployment of the account contract, three key files are necessary:" -msgstr "" +msgstr "Para facilitar el despliegue del contrato de cuenta, son necesarios tres ficheros clave:" #: src/ch02-09-starknet-js.md:221 msgid "" @@ -7551,16 +7571,21 @@ msgid "" "- `deploy.ts`: This is the main deployment script.\n" "- `l2-eth-abi.json`: his file will hold the ABI (Application Binary Interface) for the account contract." msgstr "" +"- `utils.ts`: Este archivo contendrá las funciones y la lógica para el despliegue.\n" +"- `deploy.ts`: Este es el script principal de despliegue.\n" +"- `l2-eth-abi.json`: Este archivo contendrá el ABI (Application Binary Interface) para el contrato de cuenta." #: src/ch02-09-starknet-js.md:225 msgid "## STEP 2: Import Required Modules and Functions" -msgstr "" +msgstr "## PASO 2: Importe los Módulos y Funciones Necesarios" #: src/ch02-09-starknet-js.md:227 msgid "" "In the `utils.ts` file, import the necessary modules and functions from various packages. This includes functionality from Starknet, filesystem operations, path handling, and environment variable " "configuration:" msgstr "" +"En el archivo `utils.ts`, importa los módulos y funciones necesarios de varios paquetes. Esto incluye la funcionalidad de Starknet, las operaciones del sistema de archivos, el manejo de rutas y la " +"configuración de variables de entorno:" #: src/ch02-09-starknet-js.md:229 msgid "" @@ -7581,15 +7606,32 @@ msgid "" "import \"dotenv/config\";\n" "```" msgstr "" +"```ts\n" +"import {\n" +" Account,\n" +" stark,\n" +" ec,\n" +" hash,\n" +" CallData,\n" +" RpcProvider,\n" +" Contract,\n" +" cairo,\n" +"} from \"starknet\";\n" +"import { promises as fs } from \"fs\";\n" +"import path from \"path\";\n" +"import readline from \"readline\";\n" +"import \"dotenv/config\";\n" +"```" #: src/ch02-09-starknet-js.md:246 -#, fuzzy msgid "## STEP 3: Implementing the `waitForEnter` Function" -msgstr "## Invocar una Función de Escritura" +msgstr "## PASO 3: Implementación de la Función `waitForEnter`" #: src/ch02-09-starknet-js.md:248 msgid "To enhance user interaction during the deployment process, implement the `waitForEnter` function. This function prompts the user to press 'Enter' to proceed, ensuring an interactive session:" msgstr "" +"Para mejorar la interacción del usuario durante el proceso de despliegue, implemente la función `waitForEnter`. Esta función pide al usuario que pulse 'Enter' para continuar, lo que garantiza una " +"sesión interactiva:" #: src/ch02-09-starknet-js.md:250 msgid "" @@ -7609,14 +7651,29 @@ msgid "" "}\n" "```" msgstr "" +"```ts\n" +"export async function waitForEnter(message: string): Promise {\n" +" return new Promise((resolve) => {\n" +" const rl = readline.createInterface({\n" +" input: process.stdin,\n" +" output: process.stdout,\n" +" });\n" +"\n" +" rl.question(message, (_) => {\n" +" rl.close();\n" +" resolve();\n" +" });\n" +" });\n" +"}\n" +"```" #: src/ch02-09-starknet-js.md:266 msgid "## STEP 4: Styling Terminal Output Messages" -msgstr "" +msgstr "## PASO 4: Estilizar los mensajes de salida del terminal" #: src/ch02-09-starknet-js.md:268 msgid "Integrate the `chalk` module for styling terminal output messages. This enhances the readability and user experience in the command line interface:" -msgstr "" +msgstr "Integra el módulo `chalk` para dar estilo a los mensajes de salida del terminal. Esto mejora la legibilidad y la experiencia del usuario en la interfaz de línea de comandos:" #: src/ch02-09-starknet-js.md:270 msgid "" @@ -7626,15 +7683,21 @@ msgid "" "}\n" "```" msgstr "" +"```ts\n" +"export async function importChalk() {\n" +" return import(\"chalk\").then((m) => m.default);\n" +"}\n" +"```" #: src/ch02-09-starknet-js.md:276 -#, fuzzy msgid "## STEP 5: Establishing Connection to the Starknet Network" -msgstr "## Establecer Conexión y Administrar Cuenta" +msgstr "## PASO 5: Establecer la Conexión a la Red Starknet" #: src/ch02-09-starknet-js.md:278 msgid "Configure the `RpcProvider` object to connect to the Starknet network. This connection uses the RPC endpoint specified in the `.env` file, facilitating communication through the Infura client:" msgstr "" +"Configure el objeto `RpcProvider` para conectarse a la red Starknet. Esta conexión utiliza el punto final RPC especificado en el archivo `.env`, facilitando la comunicación a través del cliente " +"Infura:" #: src/ch02-09-starknet-js.md:280 msgid "" @@ -7646,16 +7709,25 @@ msgid "" "}\n" "```" msgstr "" +"```ts\n" +"export function connectToStarknet() {\n" +" return new RpcProvider({\n" +" nodeUrl: process.env.RPC_ENDPOINT as string,\n" +" });\n" +"}\n" +"```" #: src/ch02-09-starknet-js.md:288 msgid "## STEP 6: Preparing the Deployer Account" -msgstr "" +msgstr "## PASO 6: Preparación de la Cuenta del Deployer" #: src/ch02-09-starknet-js.md:290 msgid "" "Set up the deployer account for contract deployment.\n" "Utilize the private key from the `.env` file and its respective pre-deployed address to create a new `Account` object:" msgstr "" +"Configure la cuenta del deployer para el despliegue de contratos.\n" +"Utilice la clave privada del archivo `.env` y su respectiva dirección predesplegada para crear un nuevo objeto `Account`:" #: src/ch02-09-starknet-js.md:293 msgid "" @@ -7668,14 +7740,24 @@ msgid "" "}\n" "```" msgstr "" +"```ts\n" +"export function getDeployerWallet(provider: RpcProvider) {\n" +" const privateKey = process.env.DEPLOYER_PRIVATE_KEY as string;\n" +" const address =\n" +" \"0x070a0122733c00716cb9f4ab5a77b8bcfc04b707756bbc27dc90973844a752d1\";\n" +" return new Account(provider, address, privateKey);\n" +"}\n" +"```" #: src/ch02-09-starknet-js.md:302 msgid "## STEP 7: Generating a Key Pair for the Account Contract" -msgstr "" +msgstr "## PASO 7: Generación de un Key Pair para el Contrato de Cuenta" #: src/ch02-09-starknet-js.md:304 msgid "The next step involves generating a key pair for the account contract using the `stark` object from Starknet.js. The key pair consists of a private key and a corresponding public key:" msgstr "" +"El siguiente paso consiste en generar un par de claves para el contrato de cuenta utilizando el objeto `stark` de Starknet.js. El par de claves consta de una clave privada y su correspondiente " +"clave pública:" #: src/ch02-09-starknet-js.md:306 msgid "" @@ -7690,28 +7772,40 @@ msgid "" "}\n" "```" msgstr "" +"```ts\n" +"export function createKeyPair() {\n" +" const privateKey = stark.randomAddress();\n" +" const publicKey = ec.starkCurve.getStarkKey(privateKey);\n" +" return {\n" +" privateKey,\n" +" publicKey,\n" +" };\n" +"}\n" +"```" #: src/ch02-09-starknet-js.md:317 msgid "Note: If a specific private key is required, replace `stark.randomAddress()` with the desired private key." -msgstr "" +msgstr "Nota: Si se requiere una clave privada específica, sustituya `stark.randomAddress()` por la clave privada deseada." #: src/ch02-09-starknet-js.md:319 msgid "## STEP 8: Importing Compiled Account Contract Files" -msgstr "" +msgstr "## PASO 8: Importación de Ficheros de Contratos de Cuentas Compilados" #: src/ch02-09-starknet-js.md:321 msgid "After compiling the account contract with `scarb build`, Sierra and Casm files are generated in the `target/dev/`directory:" -msgstr "" +msgstr "Después de compilar el contrato de cuenta con `scarb build`, se generan archivos Sierra y Casm en el directorio `target/dev/`:" #: src/ch02-09-starknet-js.md:323 msgid "" "- Sierra File: `.contract_class.json`\n" "- Casm File: `.compiled_contract_class.json`" msgstr "" +"- Sierra File: `.contract_class.json`\n" +"- Casm File: `.compiled_contract_class.json`" #: src/ch02-09-starknet-js.md:326 msgid "To import these files into the deployment script, specify their absolute paths:" -msgstr "" +msgstr "Para importar estos archivos en el script de despliegue, especifique sus rutas absolutas:" #: src/ch02-09-starknet-js.md:328 msgid "" @@ -7740,19 +7834,42 @@ msgid "" "}\n" "```" msgstr "" +"```ts\n" +"export async function getCompiledCode(filename: string) {\n" +" const sierraFilePath = path.join(\n" +" __dirname,\n" +" `../target/dev/${filename}.contract_class.json`,\n" +" );\n" +" const casmFilePath = path.join(\n" +" __dirname,\n" +" `../target/dev/${filename}.compiled_contract_class.json`,\n" +" );\n" +"\n" +" const code = [sierraFilePath, casmFilePath].map(async (filePath) => {\n" +" const file = await fs.readFile(filePath);\n" +" return JSON.parse(file.toString(\"ascii\"));\n" +" });\n" +"\n" +" const [sierraCode, casmCode] = await Promise.all(code);\n" +"\n" +" return {\n" +" sierraCode,\n" +" casmCode,\n" +" };\n" +"}\n" +"```" #: src/ch02-09-starknet-js.md:353 msgid "We use `fs` method to read the file contents." -msgstr "" +msgstr "Utilizamos el método `fs` para leer el contenido del archivo." #: src/ch02-09-starknet-js.md:355 -#, fuzzy msgid "## STEP 9: Declaration of the Account Contract" -msgstr "### Declarando su Contrato" +msgstr "## PASO 9: Declaración del Contrato de Cuenta" #: src/ch02-09-starknet-js.md:357 msgid "To declare the account contract's class, define an `interface` containing all necessary fields for the declaration, then use the `declare()` method:" -msgstr "" +msgstr "Para declarar la clase del contrato de cuenta, defina una `interface` que contenga todos los campos necesarios para la declaración y, a continuación, utilice el método `declare()`:" #: src/ch02-09-starknet-js.md:359 msgid "" @@ -7778,17 +7895,39 @@ msgid "" "}\n" "```" msgstr "" - -#: src/ch02-09-starknet-js.md:381 -#, fuzzy +"```ts\n" +"interface DeclareAccountConfig {\n" +" provider: RpcProvider;\n" +" deployer: Account;\n" +" sierraCode: any;\n" +" casmCode: any;\n" +"}\n" +"\n" +"export async function declareContract({\n" +" provider,\n" +" deployer,\n" +" sierraCode,\n" +" casmCode,\n" +"}: DeclareAccountConfig) {\n" +" const declare = await deployer.declare({\n" +" contract: sierraCode,\n" +" casm: casmCode,\n" +" });\n" +" await provider.waitForTransaction(declare.transaction_hash);\n" +"}\n" +"```" + +#: src/ch02-09-starknet-js.md:381 msgid "## STEP 10: Deploying the Account Contract" -msgstr "## Implementación del Contrato ERC20" +msgstr "## PASO 10: Despliegue del Contrato de Cuenta" #: src/ch02-09-starknet-js.md:383 msgid "" "To deploy the account contract, calculate its address using the contract's class hash. After determining the address, fund it using the [Starknet Faucet](https://faucet.goerli.starknet.io/) to " "cover gas fees during deployment:" msgstr "" +"Para desplegar el contrato de cuenta, calcula su dirección utilizando el hash de clase del contrato. Una vez determinada la dirección, fúndala utilizando el [Starknet Faucet](https://faucet.goerli." +"starknet.io/) para cubrir los gastos de gas durante el despliegue:" #: src/ch02-09-starknet-js.md:385 msgid "" @@ -7836,15 +7975,57 @@ msgid "" "}\n" "```" msgstr "" +"```ts\n" +"interface DeployAccountConfig {\n" +" privateKey: string;\n" +" publicKey: string;\n" +" classHash: string;\n" +" provider: RpcProvider;\n" +"}\n" +"\n" +"export async function deployAccount({\n" +" privateKey,\n" +" publicKey,\n" +" classHash,\n" +" provider,\n" +"}: DeployAccountConfig) {\n" +" const chalk = await importChalk();\n" +"\n" +" const constructorArgs = CallData.compile({\n" +" public_key: publicKey,\n" +" });\n" +"\n" +" const myAccountAddress = hash.calculateContractAddressFromHash(\n" +" publicKey,\n" +" classHash,\n" +" constructorArgs,\n" +" 0,\n" +" );\n" +"\n" +" console.log(`Send ETH to contract address ${chalk.bold(myAccountAddress)}`);\n" +" const message = \"Press [Enter] when ready...\";\n" +" await waitForEnter(message);\n" +"\n" +" const account = new Account(provider, myAccountAddress, privateKey, \"1\");\n" +"\n" +" const deploy = await account.deployAccount({\n" +" classHash: classHash,\n" +" constructorCalldata: constructorArgs,\n" +" addressSalt: publicKey,\n" +" });\n" +"\n" +" await provider.waitForTransaction(deploy.transaction_hash);\n" +" return deploy.contract_address;\n" +"}\n" +"```" #: src/ch02-09-starknet-js.md:429 -#, fuzzy msgid "## STEP 11: Interacting with the Deployed Account Contract" -msgstr "## Interacción con el Contrato" +msgstr "## PASO 11: Interacción con el Contrato de Cuenta Desplegado" #: src/ch02-09-starknet-js.md:431 msgid "Once the account contract is successfully deployed, we can test it by sending test Ethereum (ETH) to another address:" -msgstr "" +msgstr "Una vez desplegado con éxito el contrato de cuenta, podemos probarlo enviando Ethereum (ETH) de prueba a otra dirección:" #: src/ch02-09-starknet-js.md:433 msgid "" @@ -7886,10 +8067,47 @@ msgid "" "}\n" "```" msgstr "" +"```ts\n" +"interface TransferEthConfig {\n" +" provider: RpcProvider;\n" +" account: Account;\n" +"}\n" +"\n" +"export async function transferEth({ provider, account }: TransferEthConfig) {\n" +" const L2EthAddress =\n" +" \"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7\";\n" +"\n" +" const L2EthAbiPath = path.join(__dirname, \"./l2-eth-abi.json\");\n" +" const L2EthAbiFile = await fs.readFile(L2EthAbiPath);\n" +" const L2ETHAbi = JSON.parse(L2EthAbiFile.toString(\"ascii\"));\n" +"\n" +" const contract = new Contract(L2ETHAbi, L2EthAddress, provider);\n" +"\n" +" contract.connect(account);\n" +"\n" +" const recipient =\n" +" \"0x05feeb3a0611b8f1f602db065d36c0f70bb01032fc1f218bf9614f96c8f546a9\";\n" +" const amountInGwei = cairo.uint256(100);\n" +"\n" +" await contract.transfer(recipient, amountInGwei);\n" +"}\n" +"\n" +"export async function isContractAlreadyDeclared(\n" +" classHash: string,\n" +" provider: RpcProvider,\n" +") {\n" +" try {\n" +" await provider.getClassByHash(classHash);\n" +" return true;\n" +" } catch (error) {\n" +" return false;\n" +" }\n" +"}\n" +"```" #: src/ch02-09-starknet-js.md:471 msgid "With the necessary functions in place, we can now write the deployment script in `deploy.ts`, which orchestrates the deployment and verification process:" -msgstr "" +msgstr "Con las funciones necesarias en su lugar, ahora podemos escribir el script de despliegue en `deploy.ts`, que orquesta el proceso de despliegue y verificación:" #: src/ch02-09-starknet-js.md:473 msgid "" @@ -7988,12 +8206,108 @@ msgid "" "main();\n" "```" msgstr "" +"```ts\n" +"import { hash, LibraryError, Account } from \"starknet\";\n" +"\n" +"import {\n" +" importChalk,\n" +" connectToStarknet,\n" +" getDeployerWallet,\n" +" createKeyPair,\n" +" getCompiledCode,\n" +" declareContract,\n" +" deployAccount,\n" +" transferEth,\n" +" isContractAlreadyDeclared,\n" +"} from \"./utils\";\n" +"\n" +"async function main() {\n" +" const chalk = await importChalk();\n" +" const provider = connectToStarknet();\n" +" const deployer = getDeployerWallet(provider);\n" +" const { privateKey, publicKey } = createKeyPair();\n" +"\n" +" console.log(chalk.yellow(\"Account Contract:\"));\n" +" console.log(`Private Key = ${privateKey}`);\n" +" console.log(`Public Key = ${publicKey}`);\n" +"\n" +" let sierraCode, casmCode;\n" +" try {\n" +" ({ sierraCode, casmCode } = await getCompiledCode(\"aa_Account\"));\n" +" } catch (error: any) {\n" +" console.log(chalk.red(\"Failed to read contract files\"));\n" +" process.exit(1);\n" +" }\n" +"\n" +" const classHash = hash.computeContractClassHash(sierraCode);\n" +" const isAlreadyDeclared = await isContractAlreadyDeclared(\n" +" classHash,\n" +" provider,\n" +" );\n" +"\n" +" if (isAlreadyDeclared) {\n" +" console.log(chalk.yellow(\"Contract class already declared\"));\n" +" } else {\n" +" try {\n" +" console.log(\"Declaring account contract...\");\n" +" await declareContract({ provider, deployer, sierraCode, casmCode });\n" +" console.log(chalk.green(\"Account contract successfully declared\"));\n" +" } catch (error: any) {\n" +" console.log(chalk.red(\"Declare transaction failed\"));\n" +" console.log(error);\n" +" process.exit(1);\n" +" }\n" +" }\n" +"\n" +" console.log(`Class Hash = ${classHash}`);\n" +"\n" +" let address: string;\n" +" try {\n" +" console.log(\"Deploying account contract...\");\n" +" address = await deployAccount({\n" +" privateKey,\n" +" publicKey,\n" +" classHash,\n" +" provider,\n" +" });\n" +" console.log(\n" +" chalk.green(`Account contract successfully deployed to Starknet testnet`),\n" +" );\n" +" } catch (error: any) {\n" +" if (\n" +" error instanceof LibraryError &&\n" +" error.message.includes(\"balance is smaller\")\n" +" ) {\n" +" console.log(chalk.red(\"Insufficient account balance for deployment\"));\n" +" process.exit(1);\n" +" } else {\n" +" console.log(chalk.red(\"Deploy account transaction failed\"));\n" +" process.exit(1);\n" +" }\n" +" }\n" +"\n" +" const account = new Account(provider, address, privateKey, \"1\");\n" +"\n" +" try {\n" +" console.log(\"Testing account by transferring ETH...\");\n" +" await transferEth({ provider, account });\n" +" console.log(chalk.green(`Account works!`));\n" +" } catch (error) {\n" +" console.log(chalk.red(\"Failed to transfer ETH\"));\n" +" process.exit(1);\n" +" }\n" +"}\n" +"\n" +"main();\n" +"```" #: src/ch02-09-starknet-js.md:568 msgid "" "The `main` function orchestrates the entire deployment process, from creating a key pair to declaring and deploying the account contract, and finally testing its functionality by executing a " "transfer transaction." msgstr "" +"La función `main` orquesta todo el proceso de despliegue, desde la creación de un par de claves hasta la declaración y despliegue del contrato de cuenta, y finalmente prueba su funcionalidad " +"ejecutando una transacción de transferencia." #: src/ch02-09-starknet-js.md:572 msgid "" @@ -8001,6 +8315,9 @@ msgid "" "final steps of declaring, deploying, and interacting with the contract, each phase has been covered in detail. This approach ensures that developers can easily deploy their account contracts on the " "Starknet network." msgstr "" +"Hemos recorrido el proceso de implementación de un contrato de cuenta utilizando Starknet.js. Desde la configuración del entorno, la compilación del contrato y la preparación de los scripts de " +"implementación, hasta los pasos finales de declarar, implementar e interactuar con el contrato, cada fase se ha cubierto en detalle. Este enfoque garantiza que los desarrolladores puedan " +"implementar fácilmente sus contratos de cuenta en la red Starknet." #: src/ch02-09-01-counter-ui.md:1 msgid "# Counter Smart Contract UI Integration" @@ -8336,10 +8653,12 @@ msgstr "" #: src/ch02-09-01-counter-ui.md:143 msgid "Signers are especially linked to write operations that change the state of the blockchain. These operations need cryptographic signing for security and validity." msgstr "" +"Los signers están especialmente vinculados a operaciones de escritura que cambian el estado de la cadena de bloques. Estas operaciones necesitan firma criptográfica por motivos de seguridad y " +"validez." #: src/ch02-09-01-counter-ui.md:147 msgid "The Provider acts as the medium for:" -msgstr "" +msgstr "El Proveedor actúa como medio para:" #: src/ch02-09-01-counter-ui.md:149 msgid "" @@ -8347,15 +8666,17 @@ msgid "" "- Creating transactions.\n" "- Fetching data from the blockchain." msgstr "" +"- Comunicación con la blockchain.\n" +"- Creación de transacciones.\n" +"- Obtención de datos de la blockchain." #: src/ch02-09-01-counter-ui.md:153 msgid "To initiate a write transaction, the connected account (signer) must be provided. This signer then signs the transaction, bearing the necessary fee for execution." -msgstr "" +msgstr "Para iniciar una transacción de escritura, debe facilitarse la cuenta conectada (signer). A continuación, este signer firma la transacción, soportando la tasa necesaria para su ejecución." #: src/ch02-09-01-counter-ui.md:155 -#, fuzzy msgid "## Invoking the `increment` Function" -msgstr "## Invocar una Función de Escritura" +msgstr "## Invocando la función `increment`" #: src/ch02-09-01-counter-ui.md:157 msgid "" @@ -8371,10 +8692,21 @@ msgid "" "};\n" "```" msgstr "" +"```javascript\n" +"const increaseCounter = async () => {\n" +" try {\n" +" const contract = new Contract(contractAbi, contractAddress, account);\n" +" await contract.increment();\n" +" alert(\"You successfully incremented the counter!\");\n" +" } catch (err) {\n" +" alert(err.message);\n" +" }\n" +"};\n" +"```" #: src/ch02-09-01-counter-ui.md:169 msgid "The **`increaseCounter`** function is crafted to interact with a smart contract and increment a specific counter. Here's a step-by-step breakdown:" -msgstr "" +msgstr "La función **`increaseCounter`** está diseñada para interactuar con un smart contract e incrementar un contador específico. He aquí un desglose paso a paso:" #: src/ch02-09-01-counter-ui.md:171 msgid "" @@ -8383,11 +8715,15 @@ msgid "" "3. On successful execution, the user receives a confirmation alert indicating the counter's increment.\n" "4. In case of any errors during the process, an alert displays the corresponding error message to the user." msgstr "" +"1. Establece una nueva instancia de contrato utilizando el ABI del contrato proporcionado, su dirección y la cuenta conectada. La cuenta es esencial ya que esta transacción de escritura altera el " +"estado del contrato.\n" +"2. 2. Ejecuta el método **`increment`** del contrato. La palabra clave **`await`** asegura que el programa haga una pausa hasta que esta acción se complete.\n" +"3. En caso de ejecución exitosa, el usuario recibe una alerta de confirmación indicando el incremento del contador.\n" +"4. En caso de que se produzca algún error durante el proceso, una alerta muestra al usuario el mensaje de error correspondiente." #: src/ch02-09-01-counter-ui.md:176 -#, fuzzy msgid "## Invoking the `decrement` Function" -msgstr "## Invocar una Función de Escritura" +msgstr "## Invocando la Función `decrement`" #: src/ch02-09-01-counter-ui.md:178 msgid "" @@ -8403,10 +8739,21 @@ msgid "" "};\n" "```" msgstr "" +"```javascript\n" +"const decreaseCounter = async () => {\n" +" try {\n" +" const contract = new Contract(contractAbi, contractAddress, account);\n" +" await contract.decrement();\n" +" alert(\"You successfully decremented the counter!\");\n" +" } catch (err) {\n" +" alert(err.message);\n" +" }\n" +"};\n" +"```" #: src/ch02-09-01-counter-ui.md:190 msgid "The **`decreaseCounter`** function is designed to interact with a smart contract and decrement a specific counter. Here's a succinct breakdown of its operation:" -msgstr "" +msgstr "La función **`decreaseCounter`** está diseñada para interactuar con un smart contract y disminuir un contador específico. He aquí un desglose sucinto de su funcionamiento:" #: src/ch02-09-01-counter-ui.md:192 msgid "" @@ -8415,10 +8762,15 @@ msgid "" "3. Upon successful execution, the user is notified with an alert indicating the counter's decrement.\n" "4. Should any errors arise during the interaction, the user is promptly alerted with the pertinent error message." msgstr "" +"1. Crea una nueva instancia de contrato utilizando el ABI del contrato proporcionado, su dirección y la cuenta conectada. La cuenta es vital ya que esta transacción de escritura modifica el estado " +"del contrato.\n" +"2. Inicia el método **`decrement`** del contrato. Con el uso de la palabra clave **`await`**, el programa se asegura de esperar a que la acción de decremento finalice.\n" +"3. Al ejecutarse con éxito, se notifica al usuario con una alerta que indica la disminución del contador.\n" +"4. Si se produce algún error durante la interacción, se avisa al usuario con el mensaje de error correspondiente." #: src/ch02-09-01-counter-ui.md:197 msgid "## Fetching the Current Count with `get_current_count` Function" -msgstr "" +msgstr "## Obtención del Recuento Actual con la Función `get_current_count`" #: src/ch02-09-01-counter-ui.md:199 msgid "" @@ -8437,10 +8789,24 @@ msgid "" "};\n" "```" msgstr "" +"```javascript\n" +"const getCounter = async () => {\n" +" const provider = new Provider({\n" +" sequencer: { network: constants.NetworkName.SN_MAIN },\n" +" });\n" +" try {\n" +" const mycontract = new Contract(contractAbi, contractAddress, provider);\n" +" const num = await mycontract.get_current_count();\n" +" setRetrievedValue(num.toString());\n" +" } catch (err) {\n" +" alert(err.message);\n" +" }\n" +"};\n" +"```" #: src/ch02-09-01-counter-ui.md:214 msgid "The **`getCounter`** function is designed to retrieve the current count from a smart contract. Here's a breakdown of its operation:" -msgstr "" +msgstr "La función **`getCounter`** está diseñada para recuperar el recuento actual de un smart contract. Aquí tienes un desglose de su funcionamiento:" #: src/ch02-09-01-counter-ui.md:216 msgid "" @@ -8451,25 +8817,33 @@ msgid "" "4. Once successfully retrieved, the count, which is presumably a number, is converted to a string and stored using the **`setRetrievedValue`** function.\n" "5. In the event of any errors during the process, an alert provides the user with the relevant error message." msgstr "" +"1. Establece una instancia de proveedor, especificando la red del secuenciador - en este caso, se establece en **`mainnet`** a través de **`constants.NetworkName.SN_MAIN`**.\n" +"2. Con este proveedor, a continuación, inicia una instancia de contrato utilizando el ABI del contrato proporcionado, su dirección, y el proveedor antes mencionado.\n" +"3. A continuación, la función invoca el método **`get_current_count`** del contrato para obtener el recuento actual. Esta es una acción asíncrona, y el programa espera a que se complete con la " +"palabra clave **`await`**.\n" +"4. Una vez recuperado con éxito, el recuento, que presumiblemente es un número, se convierte en una cadena y se almacena utilizando la función **`setRetrievedValue`**.\n" +"5. En caso de que se produzca algún error durante el proceso, una alerta proporciona al usuario el mensaje de error correspondiente." #: src/ch02-09-01-counter-ui.md:222 msgid "" "It's essential to emphasize that while performing read operations, like fetching data from a blockchain network, the function uses the provider. Unlike write operations, which typically require a " "signer (or an account) for transaction signing, read operations don't mandate such authentication. Thus, in this function, only the provider is specified, and not the signer." msgstr "" +"Es esencial destacar que al realizar operaciones de lectura, como la obtención de datos de una red blockchain, la función utiliza el proveedor. A diferencia de las operaciones de escritura, que " +"normalmente requieren un firmante (o una cuenta) para la firma de la transacción, las operaciones de lectura no requieren dicha autenticación. Por lo tanto, en esta función, sólo se especifica el " +"proveedor, y no el firmante." #: src/ch02-09-01-counter-ui.md:224 -#, fuzzy msgid "## Wrapping It Up: Integrating a Frontend with a Counter Smart Contract" -msgstr "## Interactuando con el Contrato Starknet" +msgstr "## Conclusión: Integración de un Frontend con un Smart Contract de Contador" #: src/ch02-09-01-counter-ui.md:226 msgid "In this tutorial, we review the process of integrating a basic counter smart contract with a frontend application." -msgstr "" +msgstr "En este tutorial, revisamos el proceso de integración de un contrato inteligente de smart contract con una aplicación frontend." #: src/ch02-09-01-counter-ui.md:228 msgid "Here's a quick recap:" -msgstr "" +msgstr "He aquí un breve resumen:" #: src/ch02-09-01-counter-ui.md:230 msgid "" @@ -8480,15 +8854,21 @@ msgid "" " - Adjust the counter value (increment or decrement)\n" " - Fetch data from the blockchain" msgstr "" +"1. **Establecimiento de la Conexión**: Con la función **`connectWallet`**, establecimos conexiones fluidas con la blockchain, allanando el camino para las interacciones con nuestro smart contract.\n" +"2. **Terminar la Conexión**: La función **`disconnectWallet`** garantiza que los usuarios puedan finalizar de forma segura sus conexiones activas a la blockchain, manteniendo la seguridad y el " +"control.\n" +"3. **Interactuar con el Smart Contract**: Usando las funciones **`increaseCounter`**, **`decreaseCounter`**, y **`getCounter`**, exploramos cómo:\n" +" - Iniciar transacciones\n" +" - Ajustar el valor del contador (incrementarlo o disminuirlo)\n" +" - Obtener datos de la blockchain" #: src/ch02-09-02-erc20-ui.md:1 src/ch02-10-01-erc20-ui.md:1 msgid "# ERC-20 UI" msgstr "# ERC-20 UI" #: src/ch02-09-02-erc20-ui.md:3 -#, fuzzy msgid "This guide offers steps to build an ERC20 smart contract using Cairo and to incorporate it within a React web application with StarknetJS. Readers will:" -msgstr "Esta guía ofrece pasos para crear un contrato inteligente ERC20 usando Cairo e incorporarlo dentro de una aplicación web React con Starknet React. Los lectores:" +msgstr "Esta guía ofrece pasos para construir un contrato inteligente ERC20 usando Cairo e incorporarlo dentro de una aplicación web React con StarknetJS. Los lectores podrán:" #: src/ch02-09-02-erc20-ui.md:5 src/ch02-10-01-erc20-ui.md:5 msgid "" @@ -8503,25 +8883,23 @@ msgstr "" "- Diseñar su propio token ERC20 e iniciarlo en Starknet" #: src/ch02-09-02-erc20-ui.md:10 -#, fuzzy msgid "A prerequisite for this guide is a foundational understanding of both the Cairo programming language and StarknetJS. Additionally, ensure Node.js and NPM are installed on the system." -msgstr "Un requisito previo para esta guía es una comprensión básica tanto del lenguaje de programación Cairo como de ReactJS. Además, asegúrese de que Node.js y NPM estén instalados en el sistema." +msgstr "" +"Un requisito previo para esta guía es una comprensión básica tanto del lenguaje de programación Cairo como de StarknetJS. Además, asegúrese de que Node.js y NPM están instalados en el sistema." #: src/ch02-09-02-erc20-ui.md:12 src/ch02-10-01-erc20-ui.md:12 msgid "The example will walk through creating an ERC20 token named MKT and crafting a web3 interface for functionalities such as balance verification and token transfer." msgstr "El ejemplo explicará la creación de un token ERC20 llamado MKT y la creación de una interfaz web3 para funcionalidades como la verificación de saldo y la transferencia de tokens." #: src/ch02-09-02-erc20-ui.md:14 -#, fuzzy msgid "\"Basic" -msgstr "\"Basic" +msgstr "\"Basic" #: src/ch02-09-02-erc20-ui.md:16 src/ch02-10-01-erc20-ui.md:16 msgid "Throughout this guide, the following tools and libraries will be utilized:" msgstr "A lo largo de esta guía, se utilizarán las siguientes herramientas y bibliotecas:" #: src/ch02-09-02-erc20-ui.md:18 -#, fuzzy msgid "" "- Scarb 0.7.0 with Cairo 2.2.0\n" "- Starkli 0.1.9\n" @@ -8536,9 +8914,10 @@ msgstr "" "- Scarb 0.7.0 with Cairo 2.2.0\n" "- Starkli 0.1.9\n" "- Oppenzeppelin libraries v0.7.0\n" -"- Starknet React v1.0.4\n" +"- StarknetJS v5.19.5\n" +"- get-starknet v3.0.1\n" "- NodeJS v19.6.1\n" -"- Next.js 13.1.6\n" +"- Next.js 13.5.5\n" "- Visual Studio Code\n" "- Vercel" @@ -8569,7 +8948,6 @@ msgid "Subsequently, update the Scarb.toml to include the essential OpenZeppelin msgstr "Posteriormente, actualice Scarb.toml para incluir las bibliotecas esenciales de OpenZeppelin. Después de las ediciones, Scarb.toml debería aparecer como:" #: src/ch02-09-02-erc20-ui.md:40 -#, fuzzy msgid "" "```toml\n" "[package]\n" @@ -8594,7 +8972,7 @@ msgstr "" "\n" "[dependencies]\n" "starknet = \">=2.2.0\"\n" -"openzeppelin = { git = \"https://github.com/OpenZeppelin-contracts.git\", tag = \"v0.7.0\" }\n" +"openzeppelin = { git = \"https://github.com/OpenZeppelin/cairo-contracts.git\", tag = \"v0.7.0\" }\n" "\n" "[[target.starknet-contract]]\n" "```" @@ -8688,39 +9066,34 @@ msgstr "" "```" #: src/ch02-09-02-erc20-ui.md:97 -#, fuzzy msgid "\"Basic" -msgstr "\"Basic" +msgstr "\"Basic" #: src/ch02-09-02-erc20-ui.md:99 src/ch02-10-01-erc20-ui.md:98 -#, fuzzy msgid "Now edit `src/lib.cairo` and replace the content with:" -msgstr "Borre todo el contenido en `src/lib.cairo` y reemplácelo con lo siguiente:" +msgstr "Ahora edita `src/lib.cairo` y sustituye el contenido por:" #: src/ch02-09-02-erc20-ui.md:101 src/ch02-10-01-erc20-ui.md:100 -#, fuzzy msgid "" "```rust\n" "mod erc20;\n" "```" msgstr "" -"```bash\n" -"vercel\n" +"```rust\n" +"mod erc20;\n" "```" #: src/ch02-09-02-erc20-ui.md:105 src/ch02-10-01-erc20-ui.md:104 -#, fuzzy msgid "\"Basic" -msgstr "\"Basic" +msgstr "\"Basic" #: src/ch02-09-02-erc20-ui.md:107 src/ch02-10-01-erc20-ui.md:106 msgid "Upon completing your contract, proceed to compile it using Scarb:" msgstr "Al completar tu contrato, procede a compilarlo usando Scarb:" #: src/ch02-09-02-erc20-ui.md:113 -#, fuzzy msgid "Subsequent to the compilation, declare the smart contract on the Starknet testnet (using your own account and keystore):" -msgstr "Después de la compilación, declare el contrato inteligente en la red de prueba de Starknet:" +msgstr "Tras la compilación, declara el smart contract en la red de pruebas de Starknet (utilizando tu propia cuenta y keystore):" #: src/ch02-09-02-erc20-ui.md:115 src/ch02-10-01-erc20-ui.md:114 msgid "" @@ -8737,7 +9110,6 @@ msgid "The output should appear similar to:" msgstr "El resultado debería ser similar a:" #: src/ch02-09-02-erc20-ui.md:121 src/ch02-10-01-erc20-ui.md:120 -#, fuzzy msgid "" "```bash\n" "Enter keystore password:\n" @@ -8747,7 +9119,7 @@ msgid "" "```" msgstr "" "```bash\n" -"Enter keystore password: \n" +"Enter keystore password:\n" "Declaring Cairo 1 class: 0x04940154eae35788e899ceb0ef2794eaa5ea6818af5c1c726d6d278fd4979713\n" "... [shortened for brevity]\n" "Class hash declared: 0x04940154eae35788e899ceb0ef2794eaa5ea6818af5c1c726d6d278fd4979713\n" @@ -8758,7 +9130,6 @@ msgid "In cases where no modifications have been made to the provided contract, msgstr "En los casos en que no se hayan realizado modificaciones al contrato proporcionado, una notificación indicará que el contrato ha sido declarado previamente en Starknet:" #: src/ch02-09-02-erc20-ui.md:130 src/ch02-10-01-erc20-ui.md:129 -#, fuzzy msgid "" "```bash\n" "Enter keystore password:\n" @@ -8766,7 +9137,7 @@ msgid "" "```" msgstr "" "```bash\n" -"Enter keystore password: \n" +"Enter keystore password:\n" "Not declaring class as it's already declared. Class hash: 0x04940154eae35788e899ceb0ef2794eaa5ea6818af5c1c726d6d278fd4979713\n" "```" @@ -8779,7 +9150,6 @@ msgid "Proceed to deploy the MKT Token using Starkli. Provide these arguments fo msgstr "Proceda a implementar el token MKT usando Starkli. Proporcione estos argumentos para una implementación exitosa:" #: src/ch02-09-02-erc20-ui.md:139 -#, fuzzy msgid "" "- `Initial mint`: Mint 1,000,000 tokens. Given that the MKT token comprises 18 decimals (a standard of OpenZeppelin), the input required is 1,000,000 \\* 10^18 or 0xd3c21bcecceda1000000. Due to the " "contract's expectation of a u256 mint value, provide both low and high values: 0xd3c21bcecceda1000000 and 0 respectively.\n" @@ -8802,7 +9172,6 @@ msgstr "" "```" #: src/ch02-09-02-erc20-ui.md:148 src/ch02-10-01-erc20-ui.md:147 -#, fuzzy msgid "" "```bash\n" "Enter keystore password:\n" @@ -8811,7 +9180,7 @@ msgid "" "```" msgstr "" "```bash\n" -"Enter keystore password: \n" +"Enter keystore password:\n" "... [shortened for brevity]\n" "Contract deployed: 0x001892d81e09cb2c2005f0112891dacb92a6f8ce571edd03ed1f3e549abcf37f\n" "```" @@ -8831,11 +9200,12 @@ msgid "## Setting Up a New React Project" msgstr "## Configurando un Nuevo Proyecto de React" #: src/ch02-09-02-erc20-ui.md:160 -#, fuzzy msgid "" "With the contract in place, initiate the development of the web application. Begin by\n" "setting up our react project. To do this, Nextjs framework provides the `create-next-app` script that streamlines the setup of a Nextjs application:" -msgstr "Con el contrato en vigor, iniciar el desarrollo de la aplicación web. Comience incorporando la biblioteca Starknet React:" +msgstr "" +"Con el contrato en vigor, inicie el desarrollo de la aplicación web. Empezaremos\n" +"nuestro proyecto react. Para ello, el framework Nextjs proporciona el script `create-next-app` que agiliza la configuración de una aplicación Nextjs:" #: src/ch02-09-02-erc20-ui.md:163 msgid "" @@ -8849,11 +9219,19 @@ msgid "" "✔ Would you like to customize the default import alias (@/*)? … No\n" "```" msgstr "" +"```bash\n" +"npx create-next-app@latest erc20_web --use-npm\n" +"✔ Would you like to use TypeScript? … Yes\n" +"✔ Would you like to use ESLint? … Yes\n" +"✔ Would you like to use Tailwind CSS? … Yes\n" +"✔ Would you like to use `src/` directory? … Yes\n" +"✔ Would you like to use App Router? (recommended) … Yes\n" +"✔ Would you like to customize the default import alias (@/*)? … No\n" +"```" #: src/ch02-09-02-erc20-ui.md:173 -#, fuzzy msgid "Then, you should see something like this:" -msgstr "El comando se vería así:" +msgstr "Entonces, deberías ver algo como esto:" #: src/ch02-09-02-erc20-ui.md:175 msgid "" @@ -8872,18 +9250,30 @@ msgid "" "Success! Created erc20_web at /home/kali/cairo/erc20_web\n" "```" msgstr "" +"```bash\n" +"Creating a new Next.js app in /home/kali/cairo/erc20_web.\n" +"Using npm.\n" +"Initializing project with template: app-tw\n" +"Installing dependencies:\n" +"- react\n" +"- react-dom\n" +"- next\n" +"\n" +"... [shortened for brevity]\n" +"\n" +"Initialized a git repository.\n" +"Success! Created erc20_web at /home/kali/cairo/erc20_web\n" +"```" #: src/ch02-09-02-erc20-ui.md:190 -#, fuzzy msgid "## Installing the Starknet.js Library" -msgstr "## Instalación de la Biblioteca Starknet React" +msgstr "## Instalación de la Librería Starknet.js" #: src/ch02-09-02-erc20-ui.md:192 msgid "Now, let's install the starknet.js and recommended get-starknet (manage wallet connections) libraries:" -msgstr "" +msgstr "Ahora, vamos a instalar las bibliotecas starknet.js y get-starknet recomendada (gestionar conexiones de wallet):" #: src/ch02-09-02-erc20-ui.md:194 -#, fuzzy msgid "" "```bash\n" "cd erc20_web\n" @@ -8891,13 +9281,13 @@ msgid "" "```" msgstr "" "```bash\n" -"cd erc20_web/\n" -"npm run dev\n" +"cd erc20_web\n" +"npm install get-starknet\n" "```" #: src/ch02-09-02-erc20-ui.md:199 src/ch02-09-02-erc20-ui.md:213 msgid "You should see something like this:" -msgstr "" +msgstr "Deberías ver algo como esto:" #: src/ch02-09-02-erc20-ui.md:201 msgid "" @@ -8907,19 +9297,25 @@ msgid "" "Run `npm audit` for details.\n" "```" msgstr "" +"```bash\n" +"added 3 packages, changed 1 package, and audited 1549 packages in 7s\n" +"... [shortened for brevity]\n" +"Run `npm audit` for details.\n" +"```" #: src/ch02-09-02-erc20-ui.md:207 -#, fuzzy msgid "Install starknetJS:" -msgstr "npm install starknet" +msgstr "Instala starknetJS:" #: src/ch02-09-02-erc20-ui.md:209 -#, fuzzy msgid "" "```bash\n" "npm install starknet\n" "```" -msgstr "npm install starknet" +msgstr "" +"```bash\n" +"npm install starknet\n" +"```" #: src/ch02-09-02-erc20-ui.md:215 msgid "" @@ -8929,14 +9325,17 @@ msgid "" "Run `npm audit` for details.\n" "```" msgstr "" +"```bash\n" +"added 18 packages, and audited 1546 packages in 6s\n" +"... [shortened for brevity]\n" +"Run `npm audit` for details.\n" +"```" #: src/ch02-09-02-erc20-ui.md:221 -#, fuzzy msgid "Post-installation, confirm the version of the Starknet.js library:" -msgstr "Después de la instalación, confirme la versión de la biblioteca Starknet React:" +msgstr "Tras la instalación, confirma la versión de la biblioteca Starknet.js:" #: src/ch02-09-02-erc20-ui.md:223 -#, fuzzy msgid "" "```bash\n" "npm list starknet\n" @@ -8945,23 +9344,22 @@ msgid "" "```" msgstr "" "```bash\n" -"npm list @starknet-react/core\n" +"npm list starknet\n" +"\n" +"npm list get-starknet\n" "```" #: src/ch02-09-02-erc20-ui.md:229 -#, fuzzy msgid "The output should display the installed version, such as `starknet@5.19.5` and `get-starknet@3.0.1`." -msgstr "El resultado debería mostrar la versión instalada, como `@starknet-react/core@1.0.4`." +msgstr "La salida debería mostrar la versión instalada, como `starknet@5.19.5` y `get-starknet@3.0.1`." #: src/ch02-09-02-erc20-ui.md:231 -#, fuzzy msgid "## Building our Project" -msgstr "# Construyendo un Proyecto Scarb" +msgstr "## Construir nuestro Proyecto" #: src/ch02-09-02-erc20-ui.md:233 -#, fuzzy msgid "Once set up, make modifications to `erc20_web/src/app/layout.tsx` by replacing its content with the following code:" -msgstr "Una vez configurado, realice modificaciones en `erc20_web/index.tsx` reemplazando su contenido con el siguiente código:" +msgstr "Una vez configurado, realice modificaciones en `erc20_web/src/app/layout.tsx` sustituyendo su contenido por el siguiente código:" #: src/ch02-09-02-erc20-ui.md:235 msgid "" @@ -8987,11 +9385,31 @@ msgid "" "\n" "```" msgstr "" +"```typescript\n" +"import type { Metadata } from 'next'\n" +"\n" +"export const metadata: Metadata = {\n" +" title: 'Create Next App',\n" +" description: 'Generated by create next app',\n" +"}\n" +"\n" +"export default function RootLayout({\n" +" children,\n" +"}: {\n" +" children: React.ReactNode\n" +"}) {\n" +" return (\n" +" \n" +" {children}\n" +" \n" +" )\n" +"}\n" +"\n" +"```" #: src/ch02-09-02-erc20-ui.md:257 -#, fuzzy msgid "Now, edit `erc20_web/src/app/page.tsx` and replace its content with the following code:" -msgstr "Una vez configurado, realice modificaciones en `erc20_web/index.tsx` reemplazando su contenido con el siguiente código:" +msgstr "Ahora, edita `erc20_web/src/app/page.tsx` y sustituye su contenido por el siguiente código:" #: src/ch02-09-02-erc20-ui.md:259 msgid "" @@ -9016,15 +9434,34 @@ msgid "" "}\n" "```" msgstr "" +"```typescript\n" +"import Head from \"next/head\";\n" +"import App from \"../components/App\";\n" +"\n" +"export default function Home() {\n" +"\n" +" return (\n" +" <>\n" +" \n" +" Homepage\n" +" \n" +" \n" +"
\n" +"

A basic web3 example with StarknetJS

\n" +" \n" +"
\n" +" \n" +" );\n" +"}\n" +"```" #: src/ch02-09-02-erc20-ui.md:280 src/ch02-10-01-erc20-ui.md:234 msgid "## Enhancing Your React Application with Additional Features" msgstr "## Mejora de su Aplicación React con Funciones Adicionales" #: src/ch02-09-02-erc20-ui.md:282 -#, fuzzy msgid "To enhance the app's functionality, create one component (`erc20_web/src/components/App.tsx`) for balance and transfer with the following code." -msgstr "Para mejorar la funcionalidad de la aplicación, cree dos componentes para saldo y transferencia. Posteriormente, actualice el archivo `Wallet.tsx` para incorporar las nuevas funcionalidades:" +msgstr "Para mejorar la funcionalidad de la aplicación, cree un componente (`erc20_web/src/components/App.tsx`) para el saldo y la transferencia con el siguiente código." #: src/ch02-09-02-erc20-ui.md:284 msgid "" @@ -9173,118 +9610,271 @@ msgid "" "export default App;\n" "```" msgstr "" - -#: src/ch02-09-02-erc20-ui.md:429 -#, fuzzy -msgid "Finally, launch the web3 application:" -msgstr "Para iniciar la aplicación web3:" - -#: src/ch02-09-02-erc20-ui.md:431 src/ch02-10-01-erc20-ui.md:227 -msgid "" -"```bash\n" -"cd erc20_web/\n" -"npm run dev\n" -"```" -msgstr "" -"```bash\n" -"cd erc20_web/\n" -"npm run dev\n" -"```" - -#: src/ch02-09-02-erc20-ui.md:436 -msgid "Congratulations, you have your starknetjs web3 application. Now connect your wallet in goerli testnet, check your balance and transfer MKT tokens to your friends:" -msgstr "" - -#: src/ch02-09-02-erc20-ui.md:438 -#, fuzzy -msgid "\"Localhost\"" -msgstr "\"Localhost\"" - -#: src/ch02-09-02-erc20-ui.md:440 src/ch02-10-01-erc20-ui.md:410 -msgid "## Deploying Your Project Online" -msgstr "## Implementación de su Proyecto Online" - -#: src/ch02-09-02-erc20-ui.md:442 src/ch02-10-01-erc20-ui.md:412 -msgid "To share your application with friends and allow them to check their balances and transfer tokens, publish your app online. Vercel offers a straightforward way to do this:" -msgstr "Para compartir su aplicación con amigos y permitirles consultar sus saldos y transferir tokens, publique su aplicación en línea. Vercel ofrece una forma sencilla de hacer esto:" - -#: src/ch02-09-02-erc20-ui.md:444 src/ch02-10-01-erc20-ui.md:414 -msgid "### Set Up Vercel" -msgstr "### Configurar Vercel" - -#: src/ch02-09-02-erc20-ui.md:446 src/ch02-10-01-erc20-ui.md:416 -msgid "" -"1. Register for an account at [Vercel Signup](https://vercel.com/signup).\n" -"2. Install Vercel in your web application folder (`erc20_web`):" -msgstr "" -"1. Regístrese para obtener una cuenta en [Vercel Signup](https://vercel.com/signup).\n" -"2. Instale Vercel en la carpeta de su aplicación web (`erc20_web`):" - -#: src/ch02-09-02-erc20-ui.md:449 -#, fuzzy -msgid "" -"```bash\n" -"cd erc20_web/\n" -"npm i -g vercel\n" -"```" -msgstr "" -"```bash\n" -"cd erc20_web/\n" -"npm i -g vercel\n" -"vercel init\n" -"```" - -#: src/ch02-09-02-erc20-ui.md:454 src/ch02-10-01-erc20-ui.md:425 -msgid "3. Authenticate your Vercel account:" -msgstr "3. Autentique su cuenta Vercel:" - -#: src/ch02-09-02-erc20-ui.md:456 -msgid "" -"```bash\n" -"vercel login\n" -"Continue with Email (or select your preferred login method)\n" -"```" -msgstr "" - -#: src/ch02-09-02-erc20-ui.md:461 src/ch02-10-01-erc20-ui.md:431 -msgid "After entering your email, check your inbox and click on the \"Verify\" button." -msgstr "Después de ingresar su correo electrónico, revise su bandeja de entrada y haga clic en el botón \"Verify\"." - -#: src/ch02-09-02-erc20-ui.md:463 -#, fuzzy -msgid "" -"\"Vercel\n" +"```typescript\n" +"'use client';\n" +"import { useState, useMemo } from \"react\"\n" +"import { connect, disconnect } from \"get-starknet\"\n" +"import { Contract, Provider, SequencerProvider, constants } from \"starknet\"\n" "\n" -"\"Vercel" -msgstr "" -"\"Vercel\n" +"const contractAddress = \"0x001892d81e09cb2c2005f0112891dacb92a6f8ce571edd03ed1f3e549abcf37f\"\n" "\n" -"\"Vercel" - -#: src/ch02-09-02-erc20-ui.md:467 src/ch02-10-01-erc20-ui.md:437 -msgid "On successful verification, you'll receive a confirmation in the console." -msgstr "Si la verificación es exitosa, recibirás una confirmación en la consola." - -#: src/ch02-09-02-erc20-ui.md:469 src/ch02-10-01-erc20-ui.md:439 -msgid "4. Link your project to Vercel:" -msgstr "4. Vincula tu proyecto a Vercel:" - -#: src/ch02-09-02-erc20-ui.md:471 -msgid "" -"```bash\n" -"vercel link\n" -"? Set up “~/cairo/erc20_web”? [Y/n] y\n" -"? Which scope should contain your project? (just press enter)\n" -"? Link to existing project? [y/N] n\n" -"? What’s your project’s name? erc20-web\n" -"? In which directory is your code located? ./\n" -"? Want to modify these settings? [y/N] n\n" -"✅ Linked erc20-web (created .vercel)\n" -"```" -msgstr "" - -#: src/ch02-09-02-erc20-ui.md:482 src/ch02-10-01-erc20-ui.md:445 -msgid "5. Upload it:" +"function App() {\n" +" const [provider, setProvider] = useState({} as Provider)\n" +" const [address, setAddress] = useState('')\n" +" const [currentBlockHash, setCurrentBlockHash] = useState('')\n" +" const [balance, setBalance] = useState('')\n" +" const [isConnected, setIsConnected] = useState(false)\n" +" const [recipient, setRecipient] = useState('0x');\n" +" const [amount, setAmount] = useState('1000000000000000000');\n" +"\n" +" const disconnectWallet = async () => {\n" +" try {\n" +" await disconnect({ clearLastWallet: true })\n" +" setProvider({} as Provider)\n" +" setAddress('')\n" +" setIsConnected(false)\n" +" }\n" +" catch (error: any) {\n" +" alert(error.message)\n" +" }\n" +" }\n" +"\n" +" const connectWallet = async () => {\n" +" try {\n" +" const starknet = await connect()\n" +" if (!starknet) throw new Error(\"Failed to connect to wallet.\")\n" +" await starknet.enable({ starknetVersion: \"v5\" })\n" +" setProvider(starknet.account)\n" +" setAddress(starknet.selectedAddress || '')\n" +" setIsConnected(true)\n" +" }\n" +" catch (error: any) {\n" +" alert(error.message)\n" +" }\n" +" }\n" +"\n" +" const checkBalance = async () => {\n" +" try {\n" +" // initialize contract using abi, address and provider\n" +" const { abi: testAbi } = await provider.getClassAt(contractAddress);\n" +" if (testAbi === undefined) { throw new Error(\"no abi.\") };\n" +" const contract = new Contract(testAbi, contractAddress, provider)\n" +" // make contract call\n" +" const data = await contract.balance_of(address)\n" +" setBalance(data.toString())\n" +" }\n" +" catch (error: any) {\n" +" alert(error.message)\n" +" }\n" +" }\n" +"\n" +" const transfer = async () => {\n" +" try {\n" +" // initialize contract using abi, address and provider\n" +" const { abi: testAbi } = await provider.getClassAt(contractAddress);\n" +" if (testAbi === undefined) { throw new Error(\"no abi.\") };\n" +" const contract = new Contract(testAbi, contractAddress, provider)\n" +" // make contract call\n" +" await contract.transfer(recipient, amount)\n" +" }\n" +" catch (error: any) {\n" +" alert(error.message)\n" +" }\n" +" }\n" +"\n" +" const current_block_hash = async () => {\n" +" try {\n" +" const provider1 = new SequencerProvider({ baseUrl: constants.BaseUrl.SN_GOERLI });\n" +"\n" +" const block = await provider1.getBlock(\"latest\"); // <- Get latest block\n" +" setCurrentBlockHash(block.block_hash);\n" +" }\n" +" catch (error: any) {\n" +" alert(error.message)\n" +" }\n" +" }\n" +"\n" +" current_block_hash()\n" +"\n" +" const shortenedAddress = useMemo(() => {\n" +" if (!isConnected) return ''\n" +" return `${address.slice(0, 6)}...${address.slice(-4)}`\n" +" }, [isConnected, address])\n" +"\n" +" const handleRecipientChange = (event: React.ChangeEvent) => {\n" +" setRecipient(event.target.value);\n" +" };\n" +"\n" +" const handleAmountChange = (event: React.ChangeEvent) => {\n" +" setAmount(event.target.value);\n" +" };\n" +"\n" +" return (\n" +"
\n" +"

Latest block hash: {currentBlockHash}

\n" +" {isConnected ?\n" +"
\n" +" Connected: {shortenedAddress}\n" +"

\n" +"
\n" +"

Balance.

\n" +"

{balance}

\n" +"

\n" +"
\n" +"

Transfer.

\n" +"

Recipient:\n" +" \n" +"

\n" +"

Amount (default 1 MKT with 18 decimals):\n" +" \n" +"

\n" +"

\n" +" \n" +"

\n" +"
\n" +"
:\n" +"
\n" +" Choose a wallet:\n" +"

\n" +" \n" +"

\n" +"
\n" +" }\n" +"
\n" +" );\n" +"}\n" +"\n" +"export default App;\n" +"```" + +#: src/ch02-09-02-erc20-ui.md:429 +msgid "Finally, launch the web3 application:" +msgstr "Por último, inicie la aplicación web3:" + +#: src/ch02-09-02-erc20-ui.md:431 src/ch02-10-01-erc20-ui.md:227 +msgid "" +"```bash\n" +"cd erc20_web/\n" +"npm run dev\n" +"```" +msgstr "" +"```bash\n" +"cd erc20_web/\n" +"npm run dev\n" +"```" + +#: src/ch02-09-02-erc20-ui.md:436 +msgid "Congratulations, you have your starknetjs web3 application. Now connect your wallet in goerli testnet, check your balance and transfer MKT tokens to your friends:" +msgstr "Enhorabuena, ya tienes tu aplicación starknetjs web3. Ahora conecta tu wallet en goerli testnet, comprueba tu balance y transfiere tokens MKT a tus amigos:" + +#: src/ch02-09-02-erc20-ui.md:438 +msgid "\"Localhost\"" +msgstr "\"Localhost\"" + +#: src/ch02-09-02-erc20-ui.md:440 src/ch02-10-01-erc20-ui.md:410 +msgid "## Deploying Your Project Online" +msgstr "## Implementación de su Proyecto Online" + +#: src/ch02-09-02-erc20-ui.md:442 src/ch02-10-01-erc20-ui.md:412 +msgid "To share your application with friends and allow them to check their balances and transfer tokens, publish your app online. Vercel offers a straightforward way to do this:" +msgstr "Para compartir su aplicación con amigos y permitirles consultar sus saldos y transferir tokens, publique su aplicación en línea. Vercel ofrece una forma sencilla de hacer esto:" + +#: src/ch02-09-02-erc20-ui.md:444 src/ch02-10-01-erc20-ui.md:414 +msgid "### Set Up Vercel" +msgstr "### Configurar Vercel" + +#: src/ch02-09-02-erc20-ui.md:446 src/ch02-10-01-erc20-ui.md:416 +msgid "" +"1. Register for an account at [Vercel Signup](https://vercel.com/signup).\n" +"2. Install Vercel in your web application folder (`erc20_web`):" +msgstr "" +"1. Regístrese para obtener una cuenta en [Vercel Signup](https://vercel.com/signup).\n" +"2. Instale Vercel en la carpeta de su aplicación web (`erc20_web`):" + +#: src/ch02-09-02-erc20-ui.md:449 +msgid "" +"```bash\n" +"cd erc20_web/\n" +"npm i -g vercel\n" +"```" +msgstr "" +"```bash\n" +"cd erc20_web/\n" +"npm i -g vercel\n" +"```" + +#: src/ch02-09-02-erc20-ui.md:454 src/ch02-10-01-erc20-ui.md:425 +msgid "3. Authenticate your Vercel account:" +msgstr "3. Autentique su cuenta Vercel:" + +#: src/ch02-09-02-erc20-ui.md:456 +msgid "" +"```bash\n" +"vercel login\n" +"Continue with Email (or select your preferred login method)\n" +"```" +msgstr "" +"```bash\n" +"vercel login\n" +"Continue with Email (or select your preferred login method)\n" +"```" + +#: src/ch02-09-02-erc20-ui.md:461 src/ch02-10-01-erc20-ui.md:431 +msgid "After entering your email, check your inbox and click on the \"Verify\" button." +msgstr "Después de ingresar su correo electrónico, revise su bandeja de entrada y haga clic en el botón \"Verify\"." + +#: src/ch02-09-02-erc20-ui.md:463 +msgid "" +"\"Vercel\n" +"\n" +"\"Vercel" +msgstr "" +"\"Vercel\n" +"\n" +"\"Vercel" + +#: src/ch02-09-02-erc20-ui.md:467 src/ch02-10-01-erc20-ui.md:437 +msgid "On successful verification, you'll receive a confirmation in the console." +msgstr "Si la verificación es exitosa, recibirás una confirmación en la consola." + +#: src/ch02-09-02-erc20-ui.md:469 src/ch02-10-01-erc20-ui.md:439 +msgid "4. Link your project to Vercel:" +msgstr "4. Vincula tu proyecto a Vercel:" + +#: src/ch02-09-02-erc20-ui.md:471 +msgid "" +"```bash\n" +"vercel link\n" +"? Set up “~/cairo/erc20_web”? [Y/n] y\n" +"? Which scope should contain your project? (just press enter)\n" +"? Link to existing project? [y/N] n\n" +"? What’s your project’s name? erc20-web\n" +"? In which directory is your code located? ./\n" +"? Want to modify these settings? [y/N] n\n" +"✅ Linked erc20-web (created .vercel)\n" +"```" +msgstr "" +"```bash\n" +"vercel link\n" +"? Set up “~/cairo/erc20_web”? [Y/n] y\n" +"? Which scope should contain your project? (just press enter)\n" +"? Link to existing project? [y/N] n\n" +"? What’s your project’s name? erc20-web\n" +"? In which directory is your code located? ./\n" +"? Want to modify these settings? [y/N] n\n" +"✅ Linked erc20-web (created .vercel)\n" +"```" + +#: src/ch02-09-02-erc20-ui.md:482 src/ch02-10-01-erc20-ui.md:445 +msgid "5. Upload it:" msgstr "5. Cárgalo:" #: src/ch02-09-02-erc20-ui.md:484 src/ch02-10-01-erc20-ui.md:447 @@ -9308,66 +9898,60 @@ msgid "" "✅ Production: https://erc20-ch3cn791b-devnet0x-gmailcom.vercel.app [1s]\n" "```" msgstr "" +"```bash\n" +"vercel --prod\n" +"✅ Production: https://erc20-ch3cn791b-devnet0x-gmailcom.vercel.app [1s]\n" +"```" #: src/ch02-09-02-erc20-ui.md:495 -#, fuzzy msgid "Check your production URL and congratulations! Your MKT token web3 application is now accessible to everyone." -msgstr "¡Felicidades! Su aplicación web3 de token MKT ahora es accesible para todos." +msgstr "Compruebe su URL de producción y ¡enhorabuena! Tu aplicación MKT token web3 ya es accesible para todo el mundo." #: src/ch02-09-02-erc20-ui.md:497 -#, fuzzy msgid "\"Vercel" -msgstr "\"Vercel" +msgstr "\"Vercel" #: src/ch02-09-02-erc20-ui.md:499 src/ch02-10-01-erc20-ui.md:461 msgid "Engage with your app by:" msgstr "Interactúe con su aplicación de la siguiente manera:" #: src/ch02-09-02-erc20-ui.md:501 src/ch02-10-01-erc20-ui.md:463 -#, fuzzy msgid "- Connecting your wallet:" -msgstr "* Conectando tu wallet:" +msgstr "- Conectando tu wallet:" #: src/ch02-09-02-erc20-ui.md:503 -#, fuzzy msgid "\"Vercel" -msgstr "\"Vercel" +msgstr "\"Vercel" #: src/ch02-09-02-erc20-ui.md:505 src/ch02-10-01-erc20-ui.md:467 -#, fuzzy msgid "- Checking your balance:" -msgstr "* Consulta de tu balance:" +msgstr "- Consulta de tu balance:" #: src/ch02-09-02-erc20-ui.md:507 -#, fuzzy msgid "\"Vercel" -msgstr "\"Vercel" +msgstr "\"Vercel" #: src/ch02-09-02-erc20-ui.md:509 src/ch02-10-01-erc20-ui.md:471 -#, fuzzy msgid "- Transferring tokens:" -msgstr "* Transferencia de tokens:" +msgstr "- Transferencia de tokens:" #: src/ch02-09-02-erc20-ui.md:511 -#, fuzzy msgid "\"Vercel" -msgstr "\"Vercel" +msgstr "\"Vercel" #: src/ch02-09-02-erc20-ui.md:513 src/ch02-10-01-erc20-ui.md:475 msgid "## Wrapping Up" msgstr "## Conclusión" #: src/ch02-09-02-erc20-ui.md:515 -#, fuzzy msgid "" "Throughout this tutorial, you've walked through the steps to craft a web3 application using React, StarknetJS and Cairo. This application, complete with an ERC20 smart contract, offers a modern web " "interface for user interaction. Here's a snapshot of your achievements:" msgstr "" -"A lo largo de este tutorial, ha seguido los pasos para crear una aplicación web3 utilizando React y Starknet Cairo. Esta aplicación, completa con un contrato inteligente ERC20, ofrece una interfaz " -"web moderna para la interacción del usuario. Aquí tienes una instantánea de tus logros:" +"A lo largo de este tutorial, has recorrido los pasos para crear una aplicación web3 usando React, StarknetJS y Cairo. Esta aplicación, completa con un contrato inteligente ERC20, ofrece una " +"interfaz web moderna para la interacción del usuario. Aquí tienes una instantánea de tus logros:" #: src/ch02-09-02-erc20-ui.md:517 -#, fuzzy msgid "" "- **Project Initialization**: Set up a Starknet project with Scarb and incorporated OpenZeppelin libraries.\n" "\n" @@ -9379,17 +9963,15 @@ msgid "" "- **Online Deployment**: Brought your application to a wider audience by deploying it on Vercel. This empowered users to connect their wallets, scrutinize their balances, and execute token " "transactions." msgstr "" -"- **Inicialización del proyecto**: Configure un proyecto Starknet con Scarb y bibliotecas OpenZeppelin incorporadas.\n" -" \n" -"- **Elaboración del contrato ERC20**: Desarrollé un token ERC20 usando Cairo, enriquecido con funcionalidades como verificación de saldo y transferencias de tokens. Luego se compiló y se lanzó en " -"la red Starknet.\n" +"- **Inicialización del Proyecto**: Configurar un proyecto Starknet con Scarb y las librerías OpenZeppelin incorporadas.\n" "\n" -"- **Aplicación React**: creó una aplicación React impulsada por Starknet React, que presenta componentes dedicados a consultas de saldo y transacciones de tokens.\n" +"- Elaboración del contrato ERC20**: Desarrollamos un token ERC20 usando Cairo, enriquecido con funcionalidades como comprobaciones de saldo y transferencias de tokens. A continuación, se compiló y " +"se lanzó en la red Starknet.\n" "\n" -"- **Creación de ABI**: Produje el ABI para el token MKT, un componente crítico para vincularse con el contrato.\n" +"- Aplicación React**: Construimos una aplicación React impulsada por StarknetJS, con componentes dedicados a consultas de saldo y transacciones de tokens.\n" "\n" -"- **Implementación en línea**: llevó su aplicación a una audiencia más amplia al implementarla en Vercel. Esto permitió a los usuarios conectar sus billeteras, examinar sus saldos y ejecutar " -"transacciones simbólicas." +"- Despliegue Online**: Llevó su aplicación a un público más amplio desplegándola en Vercel. Esto permitió a los usuarios conectar sus carteras, examinar sus saldos y ejecutar transacciones de " +"tokens." #: src/ch02-09-02-erc20-ui.md:525 src/ch02-10-01-erc20-ui.md:488 msgid "" @@ -9405,34 +9987,27 @@ msgstr "# Starknet-React: Integración de React" #: src/ch02-10-starknet-react.md:3 msgid "In the starknet ecosystem, several tools are available for front-end development. The most notable are:" -msgstr "" +msgstr "En el ecosistema de starknet hay varias herramientas disponibles para el desarrollo front-end. Las más destacadas son:" #: src/ch02-10-starknet-react.md:5 -#, fuzzy msgid "" "- [starknet-react](https://github.com/apibara/starknet-react) ([documentation](https://starknet-react.com/docs/getting-started)): A collection of React hooks tailored for Starknet, inspired by " "[wagmi](https://github.com/tmm/wagmi) and powered by [starknet.js](https://github.com/0xs34n/starknet.js).\n" "\n" "- [starknet.js](https://github.com/0xs34n/starknet.js): This JavaScript library facilitates interactions with Starknet contracts, akin to [web3.js](https://web3js.org/) for Ethereum." msgstr "" -"- [starknet-react](https://github.com/apibara/starknet-react)\n" -" ([documentation](https://apibara.github.io/starknet-react)):\n" -" Collection of React hooks for Starknet. It is inspired by\n" -" [wagmi](https://github.com/tmm/wagmi), powered by\n" -" [starknet.js](https://github.com/0xs34n/starknet.js).\n" +"- [starknet-react](https://github.com/apibara/starknet-react) ([documentación](https://starknet-react.com/docs/getting-started)): Una colección de hooks React adaptados para Starknet, inspirados en " +"[wagmi](https://github.com/tmm/wagmi) y potenciados por [starknet.js](https://github.com/0xs34n/starknet.js).\n" "\n" -"- [starknet.js](https://github.com/0xs34n/starknet.js): A JavaScript\n" -" library for interacting with Starknet contracts. It would be the\n" -" equivalent of [web3.js](https://web3js.org/) for Ethereum." +"- [starknet.js](https://github.com/0xs34n/starknet.js): Esta biblioteca JavaScript facilita las interacciones con los contratos de Starknet, similar a [web3.js](https://web3js.org/) para Ethereum." #: src/ch02-10-starknet-react.md:9 -#, fuzzy msgid "" "Developed by the [Apibara](https://github.com/apibara/) team, [Starknet React](https://github.com/apibara/starknet-react/) is an open-source suite of React providers and hooks specifically for " "Starknet." msgstr "" -"Escrito por el equipo de [Apibara](https://github.com/apibara/), [Starknet React](https://github.com/apibara/starknet-react/) es una colección de código abierto de proveedores y enlaces de React " -"meticulosamente diseñados para Starknet." +"Desarrollado por el equipo [Apibara](https://github.com/apibara/), [Starknet React](https://github.com/apibara/starknet-react/) es un conjunto de código abierto de proveedores y hooks React " +"específicos para Starknet." #: src/ch02-10-starknet-react.md:11 msgid "## Integrating Starknet React" @@ -9441,39 +10016,46 @@ msgstr "## Integrando Starknet React" #: src/ch02-10-starknet-react.md:13 msgid "The fastest way to get started using Starknet React is by using the `create-starknet` Command Line Interface (CLI). The tool will guide you through setting up your Starknet application:" msgstr "" +"La forma más rápida de empezar a utilizar Starknet React es utilizando la interfaz de línea de comandos (CLI) `create-starknet`. La herramienta le guiará a través de la configuración de su " +"aplicación Starknet:" #: src/ch02-10-starknet-react.md:15 -#, fuzzy msgid "" "```bash\n" "npm init starknet\n" "```" -msgstr "npm install starknet" +msgstr "" +"```bash\n" +"npm init starknet\n" +"```" #: src/ch02-10-starknet-react.md:19 msgid "Or, if you want to do it manually you will need to add the following dependencies to your project:" -msgstr "" +msgstr "O, si quieres hacerlo manualmente, tendrás que añadir las siguientes dependencias a tu proyecto:" #: src/ch02-10-starknet-react.md:21 -#, fuzzy msgid "" "```bash\n" "npm install @starknet-react/chains @starknet-react/core starknet get-starknet-core\n" "```" -msgstr "yarn add @starknet-react/core starknet get-starknet" +msgstr "" +"```bash\n" +"npm install @starknet-react/chains @starknet-react/core starknet get-starknet-core\n" +"```" #: src/ch02-10-starknet-react.md:25 -#, fuzzy msgid "" "[Starknet.js](https://www.starknetjs.com/) is an SDK designed to simplify interactions with Starknet. Conversely, [get-starknet](https://github.com/starknet-io/get-starknet/) specializes in wallet " "connection management." msgstr "" -"[Starknet.js](https://www.starknetjs.com/) es un SDK esencial que facilita las interacciones con Starknet. Por el contrario, [get-starknet](https://github.com/starknet-io/get-starknet/) es un " -"paquete experto en gestionar conexiones de billetera." +"[Starknet.js](https://www.starknetjs.com/) es un SDK diseñado para simplificar las interacciones con Starknet. Por el contrario, [get-starknet](https://github.com/starknet-io/get-starknet/) se " +"especializa en la gestión de conexiones de wallets." #: src/ch02-10-starknet-react.md:27 msgid "Wrap your app in the `StarknetConfig` component to configure and provide a React Context. This component lets you specify wallet connection options for users through its connectors prop." msgstr "" +"Envuelve tu aplicación en el componente `StarknetConfig` para configurar y proporcionar un Contexto React. Este componente te permite especificar opciones de conexión de wallet para los usuarios a " +"través de sus conectores prop." #: src/ch02-10-starknet-react.md:29 msgid "" @@ -9498,19 +10080,36 @@ msgid "" "}\n" "```" msgstr "" +"```javascript\n" +"export default function App({ children }) {\n" +" const chains = [goerli, mainnet];\n" +" const provider = publicProvider();\n" +" const { connectors } = useInjectedConnectors({\n" +" // Show these connectors if the user has no connector installed.\n" +" recommended: [argent(), braavos()],\n" +" // Hide recommended connectors if the user has any connector installed.\n" +" includeRecommended: \"onlyIfNoConnectors\",\n" +" // Randomize the order of the connectors.\n" +" order: \"random\",\n" +" });\n" +"\n" +" return (\n" +" \n" +" {children}\n" +" \n" +" );\n" +"}\n" +"```" #: src/ch02-10-starknet-react.md:50 msgid "## Establishing Connection and Managing Account" msgstr "## Establecer Conexión y Administrar Cuenta" #: src/ch02-10-starknet-react.md:52 -#, fuzzy msgid "After defining the connectors in the `config`, you can use a hook to access them. This enables users to connect their wallets." -msgstr "" -"Una vez que los conectores están definidos en la configuración, el escenario está listo para usar un hook para acceder a estos conectores, lo que permite a los usuarios conectar sus billeteras:" +msgstr "Tras definir los conectores en `config`, puede utilizar un gancho para acceder a ellos. Esto permite a los usuarios conectar sus wallets." #: src/ch02-10-starknet-react.md:54 -#, fuzzy msgid "" "```javascript\n" "export default function Component() {\n" @@ -9529,29 +10128,30 @@ msgid "" "}\n" "```" msgstr "" -"export default function Connect() {\n" -" const { connect, connectors, disconnect } = useConnectors();\n" -"\n" -" return (\n" -"
\n" -" {connectors.map((connector) => (\n" -" connect(connector)}\n" -" disabled={!connector.available()}\n" -" >\n" -" Connect with {connector.id}\n" -" \n" -" ))}\n" -"
\n" -" );\n" -" }" +"```javascript\n" +"export default function Component() {\n" +" const { connect, connectors } = useConnect();\n" +" return (\n" +"
    \n" +" {connectors.map((connector) => (\n" +"
  • \n" +" \n" +"
  • \n" +" ))}\n" +"
\n" +" );\n" +"}\n" +"```" #: src/ch02-10-starknet-react.md:71 msgid "" "Now, observe the `disconnect` function that terminates the connection when\n" "invoked:" msgstr "" +"Ahora, observe la función `disconnect` que termina la conexión cuando es\n" +"invocada:" #: src/ch02-10-starknet-react.md:74 msgid "" @@ -9560,13 +10160,16 @@ msgid "" "return ;\n" "```" msgstr "" +"```javascript\n" +"const { disconnect } = useDisconnect();\n" +"return ;\n" +"```" #: src/ch02-10-starknet-react.md:79 msgid "Once connected, the `useAccount` hook provides access to the connected account, giving insights into the connection's current state." -msgstr "" +msgstr "Una vez conectado, el hook `useAccount` proporciona acceso a la cuenta conectada, dando información sobre el estado actual de la conexión." #: src/ch02-10-starknet-react.md:81 -#, fuzzy msgid "" "```javascript\n" "const { address, isConnected, isReconnecting, account } = useAccount();\n" @@ -9574,36 +10177,25 @@ msgid "" "return
{isConnected ?

Hello, {address}

: }
;\n" "```" msgstr "" +"```javascript\n" "const { address, isConnected, isReconnecting, account } = useAccount();\n" "\n" -" return (\n" -"
\n" -" {isConnected ? (\n" -"

Hello, {address}

\n" -" ) : (\n" -" \n" -" )}\n" -"
\n" -" );" +"return
{isConnected ?

Hello, {address}

: }
;\n" +"```" #: src/ch02-10-starknet-react.md:87 -#, fuzzy msgid "" "State values like `isConnected` and `isReconnecting` update automatically, easing UI updates. This is particularly useful for asynchronous processes, removing the need for manual state management " "in your components." msgstr "" -"Los valores de estado, como`isConnected` y `isReconnecting`, reciben actualizaciones automáticas, lo que simplifica las actualizaciones condicionales de la interfaz de usuario. Este patrón " -"conveniente brilla cuando se trata de procesos asincrónicos, ya que elimina la necesidad de administrar manualmente el estado dentro de sus componentes." +"Los valores de estado como `isConnected` y `isReconnecting` se actualizan automáticamente, facilitando las actualizaciones de la interfaz de usuario. Esto resulta especialmente útil para los " +"procesos asíncronos, ya que elimina la necesidad de gestionar manualmente el estado de los componentes." #: src/ch02-10-starknet-react.md:89 -#, fuzzy msgid "Once connected, signing messages is easy with the account value from the `useAccount` hook. For a smoother experience, you can also use the `useSignTypedData` hook." -msgstr "" -"Una vez establecida una conexión, firmar mensajes se vuelve muy sencillo utilizando el valor de cuenta devuelto por el hook `useAccount. Para una experiencia más optimizada, el hook " -"`useSignTypedData` está a su disposición." +msgstr "Una vez conectado, firmar mensajes es fácil con el valor de la cuenta del hook `useAccount`. Para una experiencia más fluida, también puedes utilizar el hook `useSignTypedData`." #: src/ch02-10-starknet-react.md:91 -#, fuzzy msgid "" "```Javascript\n" " const { data, isPending, signTypedData } = useSignTypedData(exampleData);\n" @@ -9618,41 +10210,40 @@ msgid "" " );\n" "```" msgstr "" -"const { data, signTypedData } = useSignTypedData(typedMessage)\n" +"```Javascript\n" +" const { data, isPending, signTypedData } = useSignTypedData(exampleData);\n" "\n" " return (\n" -" <>\n" -"

\n" -" \n" -"

\n" -" {data &&

Signed: {JSON.stringify(data)}

}\n" -" \n" -" )" +" signTypedData(exampleData)}\n" +" disabled={!account}\n" +" >\n" +" {isPending ?

Waiting for wallet...

:

Sign Message

}\n" +" \n" +" );\n" +"```" #: src/ch02-10-starknet-react.md:104 -#, fuzzy msgid "" "Starknet React supports signing an array of `BigNumberish` values or an object. When signing an object, ensure the data adheres to the EIP712 type. For detailed guidance on signing, see the " "Starknet.js documentation: [here](https://www.starknetjs.com/docs/guides/signature/)." msgstr "" -"Starknet React admite la firma de una matriz de valores `BigNumberish` o un objeto. Al firmar un objeto, es fundamental asegurarse de que los datos se ajusten al tipo EIP712. Para obtener una guía " -"más completa sobre cómo firmar, consulte la documentación de Starknet.js: [aquí](https://www.starknetjs.com/docs/guides/signature/)." +"Starknet React admite la firma de una array de valores `BigNumberish` o de un objeto. Al firmar un objeto, asegúrese de que los datos se adhieren al tipo EIP712. Para obtener información detallada " +"sobre la firma, consulta la documentación de Starknet.js: [aquí](https://www.starknetjs.com/docs/guides/signature/)." #: src/ch02-10-starknet-react.md:106 msgid "## Displaying StarkName" msgstr "## Mostrando StarkName" #: src/ch02-10-starknet-react.md:108 -#, fuzzy msgid "" "Once an account is connected, the `useStarkName` hook retrieves the `StarkName` of the account. Linked to [Starknet.id](https://www.starknet.id/), it allows for displaying the user address in a " "user-friendly manner." msgstr "" -"Una vez que se ha conectado una cuenta, se puede utilizar el enlace `useStarkName` para recuperar el StarkName de esta cuenta conectada. Relacionado con [Starknet.id](https://www.starknet.id/) " -"permite mostrar la dirección del usuario de una manera más fácil de usar." +"Una vez conectada una cuenta, el hook `useStarkName` recupera el `StarkName` de la cuenta. Vinculado a [Starknet.id](https://www.starknet.id/), permite mostrar la dirección del usuario de forma " +"sencilla." #: src/ch02-10-starknet-react.md:110 -#, fuzzy msgid "" "```Javascript\n" " const { data, isLoading, isError } = useStarkName({ address });\n" @@ -9665,32 +10256,34 @@ msgid "" " return StarkName: {data};\n" "```" msgstr "" -"const { data, isLoading, isError } = useAddressFromStarkName({ name: 'vitalik.stark' })\n" +"```Javascript\n" +" const { data, isLoading, isError } = useStarkName({ address });\n" +"\n" +" if (isLoading)\n" +" return Loading...;\n" +" if (isError)\n" +" return Error fetching name...;\n" "\n" -" if (isLoading) return

Loading...

\n" -" if (isError) return

Something went wrong

\n" -" return

Address: {data}

" +" return StarkName: {data};\n" +"```" #: src/ch02-10-starknet-react.md:121 msgid "" "This hook provides additional information: **error**, **status**, **fetchStatus**, **isSuccess**, **isError**, **isPending**, **isFetching**, **isLoading**. These details offer precise insights " "into the current process." msgstr "" +"Este hook proporciona información adicional: **error**, **status**, **fetchStatus**, **isSuccess**, **isError**, **isPending**, **isFetching**, **isLoading**. Estos detalles ofrecen información " +"precisa sobre el proceso actual." #: src/ch02-10-starknet-react.md:123 -#, fuzzy msgid "## Fetching Address from `StarkName`" -msgstr "## Obteniendo dirección de StarkName" +msgstr "## Obtención de la dirección de `StarkName`" #: src/ch02-10-starknet-react.md:125 -#, fuzzy msgid "To retrieve an `address` from a `StarkName`, use the `useAddressFromStarkName` hook." -msgstr "" -"También es posible que desee recuperar una dirección correspondiente a un StarkName.\n" -"Para ello, puede utilizar el hook `useAddressFromStarkName`." +msgstr "Para recuperar una `dirección` a partir de un `StarkName`, utiliza el hook `useAddressFromStarkName`." #: src/ch02-10-starknet-react.md:127 -#, fuzzy msgid "" "```Javascript\n" " const { data, isLoading, isError } = useAddressFromStarkName({\n" @@ -9705,34 +10298,36 @@ msgid "" " return address: {data};\n" "```" msgstr "" -"const { data, isLoading, isError } = useAddressFromStarkName({ name: 'vitalik.stark' })\n" +"```Javascript\n" +" const { data, isLoading, isError } = useAddressFromStarkName({\n" +" name: \"vitalik.stark\",\n" +" });\n" +"\n" +" if (isLoading)\n" +" return Loading...;\n" +" if (isError)\n" +" return Error fetching address...;\n" "\n" -" if (isLoading) return

Loading...

\n" -" if (isError) return

Something went wrong

\n" -" return

Address: {data}

" +" return address: {data};\n" +"```" #: src/ch02-10-starknet-react.md:140 -#, fuzzy msgid "" "If the provided name does not have an associated address, it will return\n" "`0x0`" msgstr "" "Si el nombre proporcionado no tiene una dirección asociada, devolverá\n" -"**\"0x0\"**" +"`0x0`" #: src/ch02-10-starknet-react.md:143 msgid "## Navigating the Network" msgstr "## Navegando por la Red" #: src/ch02-10-starknet-react.md:145 -#, fuzzy msgid "Starknet React provides developers with tools for network interactions, including hooks like useBlock for retrieving the latest block:" -msgstr "" -"Además de la administración de cuentas y billeteras, Starknet React equipa a los desarrolladores con hooks para las interacciones de red. Por ejemplo, useBlock permite la recuperación del último " -"bloque:" +msgstr "Starknet React proporciona a los desarrolladores herramientas para las interacciones de red, incluidos ganchos como useBlock para recuperar el último bloque:" #: src/ch02-10-starknet-react.md:147 -#, fuzzy msgid "" "```Javascript\n" " const { data, isLoading, isError } = useBlock({\n" @@ -9748,38 +10343,33 @@ msgid "" " return Hash: {data.block_hash};\n" "```" msgstr "" -"const { data, isError, isFetching } = useBlock({\n" +"```Javascript\n" +" const { data, isLoading, isError } = useBlock({\n" " refetchInterval: 10_000,\n" -" blockIdentifier: \"latest\",\n" -" });\n" +" blockIdentifier: \"latest\" as BlockNumber,\n" +" });\n" "\n" -" if (isError) {\n" -" return (\n" -"

Something went wrong

\n" -" )\n" -" }\n" +" if (isLoading)\n" +" return Loading...;\n" +" if (isError || !data)\n" +" return Error...;\n" "\n" -" return (\n" -"

Current block: {isFetching ? \"Loading...\" : data?.block_number}

\n" -" )" +" return Hash: {data.block_hash};\n" +"```" #: src/ch02-10-starknet-react.md:161 -#, fuzzy msgid "" "Here, `refetchInterval` sets the data refresh rate. Starknet React uses [react-query](https://github.com/TanStack/query/) for state and query management. Other hooks like `useContractRead` and " "`useWaitForTransaction` are also available for interval-based updates." msgstr "" -"En el código mencionado anteriormente, refetchInterval controla la frecuencia de recuperación de datos. Detrás de escena, Starknet React aprovecha\n" -"[react-query](https://github.com/TanStack/query/) para gestionar el estado y las consultas. Además de useBlock, Starknet React ofrece otros hooks como useContractRead y useWaitForTransaction, que " -"se puede configurar para actualizarse a intervalos regulares." +"Aquí, `refetchInterval` establece la frecuencia de actualización de datos. Starknet React utiliza [react-query](https://github.com/TanStack/query/) para la gestión de estados y consultas. Otros " +"hooks como `useContractRead` y `useWaitForTransaction` también están disponibles para actualizaciones basadas en intervalos." #: src/ch02-10-starknet-react.md:163 -#, fuzzy msgid "The useStarknet hook gives direct access to the ProviderInterface:" -msgstr "El hook useStarknet proporciona acceso directo a ProviderInterface:" +msgstr "El hook useStarknet da acceso directo a la ProviderInterface:" #: src/ch02-10-starknet-react.md:165 -#, fuzzy msgid "" "```Javascript\n" " const { provider } = useProvider()\n" @@ -9788,10 +10378,12 @@ msgid "" " // library.getTransaction(...)\n" "```" msgstr "" -"const { library } = useStarknet();\n" +"```Javascript\n" +" const { provider } = useProvider()\n" "\n" " // library.getClassByHash(...)\n" -" // library.getTransaction(...)" +" // library.getTransaction(...)\n" +"```" #: src/ch02-10-starknet-react.md:172 msgid "## Tracking Wallet changes" @@ -9802,14 +10394,14 @@ msgid "" "For a better dApp user experience, tracking wallet changes is crucial. This includes account changes, connections, disconnections, and network switches. Reload balances on account changes, or reset " "your dApp's state on network changes. Use `useAccount` and `useNetwork` for this." msgstr "" +"Para mejorar la experiencia del usuario de una dApp, es crucial realizar un seguimiento de los cambios en el monedero. Esto incluye cambios de cuenta, conexiones, desconexiones y cambios de red. " +"Recarga los saldos en los cambios de cuenta, o restablece el estado de tu dApp en los cambios de red. Usa `useAccount` y `useNetwork` para esto." #: src/ch02-10-starknet-react.md:176 -#, fuzzy msgid "`useNetwork` provides the current network chain:" -msgstr "El hook `useNetwork` puede proporcionarle la cadena de red actualmente en uso." +msgstr "`useNetwork` proporciona la cadena de red actual:" #: src/ch02-10-starknet-react.md:178 -#, fuzzy msgid "" "```Javascript\n" " const { chain: { id, name } } = useNetwork();\n" @@ -9822,25 +10414,26 @@ msgid "" " )\n" "```" msgstr "" -"const { chain: {id, name} } = useNetwork();\n" +"```Javascript\n" +" const { chain: { id, name } } = useNetwork();\n" "\n" " return (\n" " <>\n" "

Connected chain: {name}

\n" "

Connected chain id: {id}

\n" " \n" -" )" +" )\n" +"```" #: src/ch02-10-starknet-react.md:189 msgid "This hook also offers **blockExplorer**, **testnet** for detailed network information." -msgstr "" +msgstr "Este gancho también ofrece **blockExplorer**, **testnet** para obtener información detallada de la red." #: src/ch02-10-starknet-react.md:191 msgid "Monitor user interactions with account and network using the `useEffect` hook:" -msgstr "" +msgstr "Monitoriza las interacciones del usuario con la cuenta y la red utilizando el hook `useEffect`:" #: src/ch02-10-starknet-react.md:193 -#, fuzzy msgid "" "```Javascript\n" " const { chain } = useNetwork();\n" @@ -9862,7 +10455,8 @@ msgid "" " }, [chain]);\n" "```" msgstr "" -"const { chain } = useNetwork();\n" +"```Javascript\n" +" const { chain } = useNetwork();\n" " const { address } = useAccount();\n" "\n" " useEffect(() => {\n" @@ -9878,7 +10472,8 @@ msgstr "" " useEffect(() => {\n" " // Do some work when the user changes the network on the wallet\n" " // Like reseting the state of your dApp\n" -" }, [chain]);" +" }, [chain]);\n" +"```" #: src/ch02-10-starknet-react.md:213 msgid "## Contract Interactions" @@ -9889,11 +10484,10 @@ msgid "### Read Functions" msgstr "### Leer Funciones" #: src/ch02-10-starknet-react.md:217 -#, fuzzy msgid "Starknet React introduces `useContractRead`, similar to wagmi, for read operations on contracts. These operations are independent of the user's connection status and don't require a signer." msgstr "" -"Starknet React presenta useContractRead, un hook especializado para invocar funciones de lectura en contratos, similar a wagmi. Este hook funciona\n" -"independientemente del estado de conexión del usuario, ya que las operaciones de lectura no necesitan un firmante." +"Starknet React introduce `useContractRead`, similar a wagmi, para operaciones de lectura de contratos. Estas operaciones son independientes del estado de conexión del usuario y no requieren un " +"firmante." #: src/ch02-10-starknet-react.md:219 msgid "" @@ -9914,10 +10508,26 @@ msgid "" " return
{parseFloat(data.balance.low)}n
;\n" "```" msgstr "" +"```javascript\n" +" const { data, isError, isLoading, error } = useContractRead({\n" +" functionName: \"balanceOf\",\n" +" args: [address as string],\n" +" abi,\n" +" address: testAddress,\n" +" watch: true,\n" +" });\n" +"\n" +" if (isLoading)\n" +" return
Loading ...
;\n" +" if (isError || !data)\n" +" return
{error?.message}
;\n" +"\n" +" return
{parseFloat(data.balance.low)}n
;\n" +"```" #: src/ch02-10-starknet-react.md:236 msgid "For ERC20 operations, the `useBalance` hook simplifies retrieving balances without needing an ABI." -msgstr "" +msgstr "Para las operaciones ERC20, el hook `useBalance` simplifica la recuperación de saldos sin necesidad de una ABI." #: src/ch02-10-starknet-react.md:238 msgid "" @@ -9938,6 +10548,22 @@ msgid "" ");\n" "```" msgstr "" +"```javascript\n" +"const { isLoading, isError, error, data } = useBalance({\n" +" address,\n" +" watch: true,\n" +"});\n" +"\n" +"if (isLoading) return
Loading ...
;\n" +"if (isError || !data) return
{error?.message}
;\n" +"\n" +"return (\n" +"
\n" +" {data.value.toString()}\n" +" {data.symbol}\n" +"
\n" +");\n" +"```" #: src/ch02-10-starknet-react.md:255 msgid "### Write Functions" @@ -9948,6 +10574,8 @@ msgid "" "The `useContractWrite` hook, unlike wagmi, benefits from Starknet's native support for multicall transactions. This improves user experience by facilitating multiple transactions without individual " "approvals." msgstr "" +"El hook `useContractWrite`, a diferencia de wagmi, se beneficia del soporte nativo de Starknet para transacciones multicall. Esto mejora la experiencia del usuario facilitando múltiples " +"transacciones sin aprobaciones individuales." #: src/ch02-10-starknet-react.md:259 msgid "" @@ -9976,24 +10604,46 @@ msgid "" " );\n" "```" msgstr "" +"```javascript\n" +" const calls = useMemo(() => {\n" +" if (!address || !contract) return [];\n" +" // return a single object for single transaction,\n" +" // or an array of objects for multicall**\n" +" return contract.populateTransaction[\"transfer\"]!(address, { low: 1, high: 0 });\n" +" }, [contract, address]);\n" +"\n" +" const {\n" +" writeAsync,\n" +" data,\n" +" isPending,\n" +" } = useContractWrite({\n" +" calls,\n" +" });\n" +"\n" +" return (\n" +" <>\n" +" \n" +"

status: {isPending &&

Submitting...
}

\n" +"

hash: {data?.transaction_hash}

\n" +" \n" +" );\n" +"```" #: src/ch02-10-starknet-react.md:284 msgid "This setup starts with the `populateTransaction` utility, followed by executing the transaction through `writeAsync`. The hook also provides transaction status and hash." msgstr "" +"Esta configuración comienza con la utilidad `populateTransaction`, seguida de la ejecución de la transacción a través de `writeAsync`. El gancho también proporciona el estado de la transacción y el " +"hash." #: src/ch02-10-starknet-react.md:286 msgid "### A Single Contract Instance" msgstr "### Una Unica Instancia de Contrato" #: src/ch02-10-starknet-react.md:288 -#, fuzzy msgid "For cases where a single contract instance is more than apecifying the contract address and ABI in each hook., use the `useContract` hook:" -msgstr "" -"En ciertos casos de uso, puede ser preferible trabajar con una única instancia de contrato que especificar la dirección del contrato y la ABI en cada enlace. Starknet React cumple con este " -"requisito con el hook useContract:" +msgstr "Para los casos en que una sola instancia de contrato es más que apecifying la dirección del contrato y ABI en cada hook., utilice el `useContract` hook:" #: src/ch02-10-starknet-react.md:290 -#, fuzzy msgid "" "```javascript\n" "const { contract } = useContract({\n" @@ -10006,14 +10656,16 @@ msgid "" "// contract.balanceOf(...);\n" "```" msgstr "" +"```javascript\n" "const { contract } = useContract({\n" -" address: CONTRACT_ADDRESS,\n" -" abi: abi_erc20,\n" -" });\n" +" address: CONTRACT_ADDRESS,\n" +" abi: abi_erc20,\n" +"});\n" "\n" -" // Call functions directly on contract\n" -" // contract.transfer(...);\n" -" // contract.balanceOf(...);" +"// Call functions directly on contract\n" +"// contract.transfer(...);\n" +"// contract.balanceOf(...);\n" +"```" #: src/ch02-10-starknet-react.md:301 msgid "## Tracking Transactions" @@ -10021,7 +10673,7 @@ msgstr "## Seguimiento de Transacciones" #: src/ch02-10-starknet-react.md:303 msgid "`UseWaitForTransaction` tracks transaction states with a transaction hash, reducing network requests through caching." -msgstr "" +msgstr "`UseWaitForTransaction` realiza un seguimiento de los estados de transacción con un hash de transacción, reduciendo las peticiones de red mediante el almacenamiento en caché." #: src/ch02-10-starknet-react.md:305 msgid "" @@ -10037,22 +10689,29 @@ msgid "" "return
{data.status?.length}
;\n" "```" msgstr "" +"```javascript\n" +"const { isLoading, isError, error, data } = useWaitForTransaction({\n" +" hash: transaction,\n" +" watch: true,\n" +"});\n" +"\n" +"if (isLoading) return
Loading ...
;\n" +"if (isError || !data) return
{error?.message}
;\n" +"\n" +"return
{data.status?.length}
;\n" +"```" #: src/ch02-10-starknet-react.md:317 -#, fuzzy msgid "Explore all available hooks in Starknet React's documentation: ." -msgstr "" -"La gama completa de hooks disponibles se puede descubrir en la documentación de Starknet React, a la que se puede acceder aquí:\n" -"." +msgstr "Explora todos los hooks disponibles en la documentación de Starknet React: ." #: src/ch02-10-starknet-react.md:321 -#, fuzzy msgid "" "The Starknet React library provides a range of React hooks and providers specifically designed for Starknet and the Starknet.js SDK. These tools enable developers to create applications on the " "Starknet network." msgstr "" -"La biblioteca Starknet React ofrece un conjunto completo de hook React y proveedores, diseñados específicamente para Starknet y el SDK de Starknet.js. Al aprovechar estas herramientas bien " -"diseñadas, los desarrolladores pueden crear aplicaciones descentralizadas sólidas que aprovechen el poder de la red Starknet." +"La biblioteca React de Starknet proporciona una serie de hooks y proveedores React diseñados específicamente para Starknet y el SDK Starknet.js. Estas herramientas permiten a los desarrolladores " +"crear aplicaciones en la red Starknet." #: src/ch02-10-01-erc20-ui.md:3 msgid "This guide offers steps to build an ERC20 smart contract using Cairo and to incorporate it within a React web application with Starknet React. Readers will:" @@ -10067,7 +10726,6 @@ msgid "\"Basic" #: src/ch02-10-01-erc20-ui.md:18 -#, fuzzy msgid "" "- Scarb 0.7.0 with Cairo 2.2.0\n" "- Starkli 0.1.9\n" @@ -10081,14 +10739,13 @@ msgstr "" "- Scarb 0.7.0 with Cairo 2.2.0\n" "- Starkli 0.1.9\n" "- Oppenzeppelin libraries v0.7.0\n" -"- Starknet React v1.0.4\n" +"- Starknet React v2.1.1\n" "- NodeJS v19.6.1\n" "- Next.js 13.1.6\n" "- Visual Studio Code\n" "- Vercel" #: src/ch02-10-01-erc20-ui.md:39 -#, fuzzy msgid "" "```toml\n" "[package]\n" @@ -10113,7 +10770,7 @@ msgstr "" "\n" "[dependencies]\n" "starknet = \">=2.2.0\"\n" -"openzeppelin = { git = \"https://github.com/OpenZeppelin-contracts.git\", tag = \"v0.7.0\" }\n" +"openzeppelin = { git = \"https://github.com/OpenZeppelin/cairo-contracts.git\", tag = \"v0.8.0-beta.0\" }\n" "\n" "[[target.starknet-contract]]\n" "```" @@ -10127,7 +10784,6 @@ msgid "Subsequent to the compilation, declare the smart contract on the Starknet msgstr "Después de la compilación, declare el contrato inteligente en la red de prueba de Starknet:" #: src/ch02-10-01-erc20-ui.md:138 -#, fuzzy msgid "" "- `Initial mint`: Mint 1,000,000 tokens. Given that the MKT token comprises 18 decimals (a standard of OpenZeppelin), the input required is 1,000,000 \\* 10^18 or 0xd3c21bcecceda1000000. Due to the " "contract's expectation of a u256 mint value, provide both low and high values: 0xd3c21bcecceda1000000 and 0 respectively.\n" @@ -10142,9 +10798,8 @@ msgid "## Installing the Starknet React Library" msgstr "## Instalación de la Biblioteca Starknet React" #: src/ch02-10-01-erc20-ui.md:159 -#, fuzzy msgid "With the contract in place, initiate the development of the web application. Begin by incorporating the Starknet React library and setting up a new React Project called 'erc20':" -msgstr "Con el contrato en vigor, iniciar el desarrollo de la aplicación web. Comience incorporando la biblioteca Starknet React:" +msgstr "Con el contrato en su lugar, iniciar el desarrollo de la aplicación web. Comienza incorporando la librería React de Starknet y configurando un nuevo proyecto React llamado 'erc20':" #: src/ch02-10-01-erc20-ui.md:161 msgid "" @@ -10164,6 +10819,21 @@ msgid "" " npm run dev\n" "```" msgstr "" +"```bash\n" +"$ npm init starknet\n" +"Need to install the following packages:\n" +" create-starknet@2.0.1\n" +"Ok to proceed? (y) y\n" +"✔ What is your project named? … erc20_web\n" +"✔ What framework would you like to use? › Next.js\n" +"Installing dependencies...\n" +"Success! Created erc20_web at ~/erc20_web\n" +"\n" +"We suggest that you begin by typing:\n" +"\n" +" cd erc20\n" +" npm run dev\n" +"```" #: src/ch02-10-01-erc20-ui.md:177 msgid "Post-installation, confirm the version of the Starknet React library:" @@ -10180,17 +10850,14 @@ msgstr "" "```" #: src/ch02-10-01-erc20-ui.md:183 -#, fuzzy msgid "The output should display the installed version, such as `@starknet-react/core@2.1.1`." -msgstr "El resultado debería mostrar la versión instalada, como `@starknet-react/core@1.0.4`." +msgstr "La salida debería mostrar la versión instalada, como `@starknet-react/core@2.1.1`." #: src/ch02-10-01-erc20-ui.md:185 -#, fuzzy msgid "Once set up, make modifications to `erc20_web/page.tsx` by replacing its content with the following code:" -msgstr "Una vez configurado, realice modificaciones en `erc20_web/index.tsx` reemplazando su contenido con el siguiente código:" +msgstr "Una vez configurado, realice modificaciones en `erc20_web/page.tsx` sustituyendo su contenido por el siguiente código:" #: src/ch02-10-01-erc20-ui.md:187 -#, fuzzy msgid "" "```typescript\n" "'use client';\n" @@ -10231,9 +10898,10 @@ msgid "" "```" msgstr "" "```typescript\n" +"'use client';\n" "import Head from 'next/head'\n" "import { useBlock } from '@starknet-react/core'\n" -"import WalletBar from '../components/WalletBar'\n" +"import WalletBar from \"@/components/WalletBar\";\n" "import { BlockTag } from 'starknet';\n" "\n" "export default function Home() {\n" @@ -10292,7 +10960,6 @@ msgid "Design a balance component inside `components/Balance.tsx` and integrate msgstr "Diseñe un componente de equilibrio dentro de `components/Balance.tsx` e integre el siguiente código:" #: src/ch02-10-01-erc20-ui.md:244 -#, fuzzy msgid "" "```typescript\n" "import { useAccount, useContractRead } from \"@starknet-react/core\";\n" @@ -10332,7 +10999,8 @@ msgid "" msgstr "" "```typescript\n" "import { useAccount, useContractRead } from \"@starknet-react/core\";\n" -"import erc20ABI from '../assets/erc20.json';\n" +"import erc20ABI from '../../assets/erc20.json';\n" +"import { MouseEventHandler } from \"react\";\n" "\n" "function Balance() {\n" " const { address } = useAccount();\n" @@ -10340,23 +11008,28 @@ msgstr "" " address: '0x001892d81e09cb2c2005f0112891dacb92a6f8ce571edd03ed1f3e549abcf37f',\n" " abi: erc20ABI,\n" " functionName: 'balance_of',\n" -" args: [address],\n" +" args: [address || ''], // Provide a default value if address is undefined\n" " watch: false\n" " });\n" "\n" " if (isLoading) return Loading...;\n" " if (error) return Error: {JSON.stringify(error)};\n" "\n" +" const handleClick: MouseEventHandler = async (event) => {\n" +" event.preventDefault();\n" +" await refetch();\n" +" };\n" +"\n" " return (\n" "
\n" "

Balance:

\n" "

{data?data.toString(): 0}

\n" -"

\n" +"

\n" "
\n" "
\n" " );\n" "}\n" -" \n" +"\n" "export default Balance;\n" "```" @@ -10373,7 +11046,6 @@ msgid "Craft a transfer component in `components/Transfer.tsx` and embed the sub msgstr "Cree un componente de transferencia en `components/Transfer.tsx` e incruste el código siguiente:" #: src/ch02-10-01-erc20-ui.md:286 -#, fuzzy msgid "" "```typescript\n" "import { useAccount, useContractWrite } from \"@starknet-react/core\";\n" @@ -10470,7 +11142,6 @@ msgid "Proceed to modify the `components/Wallet.tsx` file. Replace any existing msgstr "Proceda a modificar el archivo `components/Wallet.tsx`. Reemplace cualquier contenido existente con el siguiente código mejorado:" #: src/ch02-10-01-erc20-ui.md:333 -#, fuzzy msgid "" "```typescript\n" "\"use client\";\n" @@ -10530,53 +11201,44 @@ msgid "" "```" msgstr "" "```typescript\n" -"import { useAccount, useConnectors } from '@starknet-react/core'\n" -"import { useMemo } from 'react'\n" -"import Balance from '../components/Balance'\n" -"import Transfer from '../components/Transfer'\n" -"\n" -"function WalletConnected() {\n" -" const { address } = useAccount();\n" -" const { disconnect } = useConnectors();\n" +"import { useAccount, useContractWrite } from \"@starknet-react/core\";\n" +"import React, { useState, useMemo } from \"react\";\n" "\n" -" const shortenedAddress = useMemo(() => {\n" -" if (!address) return '';\n" -" return `${address.slice(0, 6)}...${address.slice(-4)}`;\n" -" }, [address]);\n" +"function Transfer() {\n" +" const { address } = useAccount();\n" +" const [count] = useState(1);\n" +" const [recipient, setRecipient] = useState('0x');\n" +" const [amount, setAmount] = useState('1000000000000000000');\n" "\n" -" return (\n" -"
\n" -" Connected: {shortenedAddress}\n" -"

\n" -"
\n" -" \n" -" \n" -"
\n" -" );\n" -"}\n" +" const calls = useMemo(() => {\n" +" const tx = {\n" +" contractAddress: '0x001892d81e09cb2c2005f0112891dacb92a6f8ce571edd03ed1f3e549abcf37f',\n" +" entrypoint: 'transfer',\n" +" calldata: [recipient, amount, 0]\n" +" };\n" +" return Array(count).fill(tx);\n" +" }, [address, count, recipient, amount]);\n" "\n" -"function ConnectWallet() {\n" -" const { connectors, connect } = useConnectors();\n" +" const { write } = useContractWrite({ calls });\n" "\n" -" return (\n" -"
\n" -" Select a wallet:\n" -"

\n" -" {connectors.map((connector) => (\n" -" \n" -" ))}\n" -"

\n" -"
\n" -" );\n" +" return (\n" +" <>\n" +"

Transfer:

\n" +"

\n" +" Recipient:\n" +" setRecipient(e.target.value)} />\n" +"

\n" +"

\n" +" Amount (default: 1 MKT with 18 decimals):\n" +" setAmount(e.target.value)} />\n" +"

\n" +"

\n" +"
\n" +" \n" +" );\n" "}\n" "\n" -"export default function WalletBar() {\n" -" const { address } = useAccount();\n" -"\n" -" return address ? : ;\n" -"}\n" +"export default Transfer;\n" "```" #: src/ch02-10-01-erc20-ui.md:390 @@ -10708,7 +11370,6 @@ msgstr "" "web moderna para la interacción del usuario. Aquí tienes una instantánea de tus logros:" #: src/ch02-10-01-erc20-ui.md:479 -#, fuzzy msgid "" "- **Project Initialization**: Set up a Starknet project with Scarb and incorporated OpenZeppelin libraries.\n" "- **Crafting the ERC20 Contract**: Developed an ERC20 token using Cairo, enriched with functionalities like balance checks and token transfers. This was then compiled and launched on the Starknet " @@ -10721,16 +11382,16 @@ msgid "" "- **Online Deployment**: Brought your application to a wider audience by deploying it on Vercel. This empowered users to connect their wallets, scrutinize their balances, and execute token " "transactions." msgstr "" -"- **Inicialización del proyecto**: Configure un proyecto Starknet con Scarb y bibliotecas OpenZeppelin incorporadas.\n" +"- **Inicialización del proyecto**: Configuró un proyecto Starknet con Scarb y bibliotecas OpenZeppelin incorporadas.\n" " \n" "- **Elaboración del contrato ERC20**: Desarrollé un token ERC20 usando Cairo, enriquecido con funcionalidades como verificación de saldo y transferencias de tokens. Luego se compiló y se lanzó en " "la red Starknet.\n" "\n" -"- **Aplicación React**: creó una aplicación React impulsada por Starknet React, que presenta componentes dedicados a consultas de saldo y transacciones de tokens.\n" +"- **Aplicación React**: Creó una aplicación React impulsada por Starknet React, que presenta componentes dedicados a consultas de saldo y transacciones de tokens.\n" "\n" -"- **Creación de ABI**: Produje el ABI para el token MKT, un componente crítico para vincularse con el contrato.\n" +"- **Creación de ABI**: Produjo el ABI para el token MKT, un componente crítico para vincularse con el contrato.\n" "\n" -"- **Implementación en línea**: llevó su aplicación a una audiencia más amplia al implementarla en Vercel. Esto permitió a los usuarios conectar sus billeteras, examinar sus saldos y ejecutar " +"- **Implementación Online**: LLevó su aplicación a una audiencia más amplia al implementarla en Vercel. Esto permitió a los usuarios conectar sus billeteras, examinar sus saldos y ejecutar " "transacciones simbólicas." #: src/ch02-10-02-million-dollar-homepage.md:1 @@ -11720,6 +12381,8 @@ msgid "" "Starknet.py is a Python SDK designed for integrating websites, decentralized applications, backends, and more, with Starknet. It serves as a bridge, enabling smooth interaction between your " "application and the Starknet blockchain." msgstr "" +"Starknet.py es un SDK de Python diseñado para integrar sitios web, aplicaciones descentralizadas, backends, y más, con Starknet. Sirve de puente, permitiendo una interacción fluida entre tu " +"aplicación y la blockchain de Starknet." #: src/ch02-11-starknet-py.md:5 msgid "" @@ -11728,15 +12391,18 @@ msgid "" "- For community support, discussions, and staying connected with other developers, join the Starknet Discord community. Look for the `🐍starknet-py` channel in [Starknet Discord](https://discord.gg/" "qypnmzkhbc)." msgstr "" +"- Para obtener información detallada, documentación y guías de inicio, visita [Starknet.py documentation](https://starknetpy.readthedocs.io/en/latest/).\n" +"- Para acceder al código fuente, contribuir o ver las últimas actualizaciones, visita el repositorio [Starknet.py GitHub repository](https://github.com/software-mansion/starknet.py).\n" +"- Para soporte comunitario, discusiones y estar conectado con otros desarrolladores, únete a la comunidad Discord de Starknet. Busca el canal `🐍starknet-py` en [Starknet Discord](https://discord.gg/" +"qypnmzkhbc)." #: src/ch02-12-starknet-rs.md:1 msgid "# Starknet-rs: Rust SDK 🚧" msgstr "# Starknet-rs: Rust SDK 🚧" #: src/ch02-13-foundry-forge.md:1 -#, fuzzy msgid "# Foundry Forge: Testing" -msgstr "# Foundry Forge: Testing 🚧" +msgstr "# Foundry Forge: Testing" #: src/ch02-13-foundry-forge.md:3 msgid "" @@ -11756,15 +12422,15 @@ msgstr "" #: src/ch02-13-foundry-forge.md:7 msgid "## `snForge` Command-Line Usage" -msgstr "" +msgstr "## `snForge` Uso de la Línea de Comandos" #: src/ch02-13-foundry-forge.md:9 msgid "This section guides you through the Starknet Foundry `snforge` command-line tool. Learn how to set up a new project, compile the code, and execute tests." -msgstr "" +msgstr "Esta sección le guiará a través de la herramienta de línea de comandos `snforge` de Starknet Foundry. Aprende a configurar un nuevo proyecto, compilar el código y ejecutar pruebas." #: src/ch02-13-foundry-forge.md:11 msgid "To start a new project with Starknet Foundry, use the `--init` command and replace `project_name` with your project's name." -msgstr "" +msgstr "Para iniciar un nuevo proyecto con Starknet Foundry, utilice el comando `--init` y sustituya `project_name` por el nombre de su proyecto." #: src/ch02-13-foundry-forge.md:13 msgid "" @@ -11772,10 +12438,13 @@ msgid "" "snforge --init project_name\n" "```" msgstr "" +"```shell\n" +"snforge --init project_name\n" +"```" #: src/ch02-13-foundry-forge.md:17 msgid "Once you've set up the project, inspect its layout:" -msgstr "" +msgstr "Una vez que hayas configurado el proyecto, inspecciona su diseño:" #: src/ch02-13-foundry-forge.md:19 msgid "" @@ -11784,10 +12453,14 @@ msgid "" "tree . -L 1\n" "```" msgstr "" +"```shell\n" +"cd project_name\n" +"tree . -L 1\n" +"```" #: src/ch02-13-foundry-forge.md:24 msgid "The project structure is as follows:" -msgstr "" +msgstr "La estructura del proyecto es la siguiente:" #: src/ch02-13-foundry-forge.md:26 msgid "" @@ -11799,6 +12472,13 @@ msgid "" "└── tests\n" "```" msgstr "" +"```shell\n" +".\n" +"├── README.md\n" +"├── Scarb.toml\n" +"├── src\n" +"└── tests\n" +"```" #: src/ch02-13-foundry-forge.md:34 msgid "" @@ -11806,10 +12486,13 @@ msgid "" "- `tests/` is the location of your test files.\n" "- `Scarb.toml` is for project and **`snforge`** configurations." msgstr "" +"- `src/` contiene el código fuente del contrato.\n" +"- `tests/` es la ubicación de tus archivos de prueba.\n" +"- `Scarb.toml` es para las configuraciones del proyecto y **`snforge`**." #: src/ch02-13-foundry-forge.md:38 msgid "Ensure the CASM code generation is active in the `Scarb.toml` file:" -msgstr "" +msgstr "Asegúrese de que la generación de código CASM está activa en el archivo `Scarb.toml`:" #: src/ch02-13-foundry-forge.md:40 msgid "" @@ -11820,10 +12503,16 @@ msgid "" "# ...\n" "```" msgstr "" +"```shell\n" +"# ...\n" +"[[target.starknet-contract]]\n" +"casm = true\n" +"# ...\n" +"```" #: src/ch02-13-foundry-forge.md:47 msgid "To run tests using `snforge`:" -msgstr "" +msgstr "Para realizar pruebas con `snforge`:" #: src/ch02-13-foundry-forge.md:49 msgid "" @@ -11838,19 +12527,30 @@ msgid "" "Tests: 2 passed, 0 failed, 0 skipped\n" "```" msgstr "" +"```shell\n" +"snforge\n" +"\n" +"Collected 2 test(s) from the `test_name` package\n" +"Running 0 test(s) from `src/`\n" +"Running 2 test(s) from `tests/`\n" +"[PASS] tests::test_contract::test_increase_balance\n" +"[PASS] tests::test_contract::test_cannot_increase_balance_with_zero_value\n" +"Tests: 2 passed, 0 failed, 0 skipped\n" +"```" #: src/ch02-13-foundry-forge.md:60 msgid "## Integrating `snforge` with Existing Scarb Projects" -msgstr "" +msgstr "## Integración de `snforge` con proyectos Scarb existentes" #: src/ch02-13-foundry-forge.md:62 msgid "" "For those with an established Scarb project who wish to incorporate `snforge`, ensure the `snforge_std package` is declared as a dependency. Insert the line below in the [dependencies] section of " "your `Scarb.toml`:" msgstr "" +"Para aquellos con un proyecto Scarb establecido que deseen incorporar `snforge`, asegúrese de que el paquete `snforge_std` se declara como una dependencia. Inserte la siguiente línea en la sección " +"[dependencies] de su `Scarb.toml`:" #: src/ch02-13-foundry-forge.md:64 -#, fuzzy msgid "" "```shell\n" "# ...\n" @@ -11858,28 +12558,29 @@ msgid "" "snforge_std = { git = \"https://github.com/foundry-rs/starknet-foundry.git\", tag = \"[VERSION]\" }\n" "```" msgstr "" +"```shell\n" +"# ...\n" "[dependencies]\n" -" alexandria_math = { git = \"https://github.com/keep-starknet-strange/alexandria.git\", rev = \"81bb93c\" }" +"snforge_std = { git = \"https://github.com/foundry-rs/starknet-foundry.git\", tag = \"[VERSION]\" }\n" +"```" #: src/ch02-13-foundry-forge.md:70 msgid "Ensure the tag version corresponds with your `snforge` version. To verify your `snforge` version:" -msgstr "" +msgstr "Asegúrese de que la versión de la etiqueta se corresponde con su versión de `snforge`. Para verificar la versión de `snforge`:" #: src/ch02-13-foundry-forge.md:72 -#, fuzzy msgid "" "```sh\n" "snforge --version\n" "```" msgstr "" -"```bash\n" -"starkli --version\n" +"```sh\n" +"snforge --version\n" "```" #: src/ch02-13-foundry-forge.md:76 -#, fuzzy msgid "Or, add this dependency using the `scarb` command:" -msgstr "Para eliminar una dependencia, puede utilizar el comando `scarb rm`." +msgstr "O añada esta dependencia mediante el comando `scarb`:" #: src/ch02-13-foundry-forge.md:78 msgid "" @@ -11887,41 +12588,43 @@ msgid "" "scarb add snforge_std --git https://github.com/foundry-rs/starknet-foundry.git --tag VERSION\n" "```" msgstr "" +"```shell\n" +"scarb add snforge_std --git https://github.com/foundry-rs/starknet-foundry.git --tag VERSION\n" +"```" #: src/ch02-13-foundry-forge.md:82 msgid "With these steps, your existing Scarb project is now **`snforge`**-ready." -msgstr "" +msgstr "Con estos pasos, su proyecto Scarb ya está listo para **`snforge`**." #: src/ch02-13-foundry-forge.md:84 msgid "## Testing with `snforge`" -msgstr "" +msgstr "## Testing con `snforge`" #: src/ch02-13-foundry-forge.md:86 msgid "Utilize Starknet Foundry's `snforge` command to efficiently run tests." -msgstr "" +msgstr "Utilice el comando `snforge` de Starknet Foundry para ejecutar pruebas de forma eficaz." #: src/ch02-13-foundry-forge.md:88 msgid "### Executing Tests" -msgstr "" +msgstr "### Ejecutando Tests" #: src/ch02-13-foundry-forge.md:90 msgid "Navigate to the package directory and issue this command to run tests:" -msgstr "" +msgstr "Navegue hasta el directorio del paquete y ejecute este comando para realizar los tests:" #: src/ch02-13-foundry-forge.md:92 -#, fuzzy msgid "" "```shell\n" "snforge\n" "```" msgstr "" -"```bash\n" -"vercel login\n" +"```shell\n" +"snforge\n" "```" #: src/ch02-13-foundry-forge.md:96 msgid "Sample output might resemble:" -msgstr "" +msgstr "La salida de ejemplo podría parecerse:" #: src/ch02-13-foundry-forge.md:98 msgid "" @@ -11934,14 +12637,22 @@ msgid "" "Tests: 3 passed, 0 failed, 0 skipped\n" "```" msgstr "" +"```shell\n" +"Collected 3 test(s) from `package_name` package\n" +"Running 3 test(s) from `src/`\n" +"[PASS] package_name::executing\n" +"[PASS] package_name::calling\n" +"[PASS] package_name::calling_another\n" +"Tests: 3 passed, 0 failed, 0 skipped\n" +"```" #: src/ch02-13-foundry-forge.md:107 msgid "## Example: Testing a Simple Contract" -msgstr "" +msgstr "## Ejemplo: Testing de un Contrato Simple" #: src/ch02-13-foundry-forge.md:109 msgid "The example provided below demonstrates how to test a Starknet contract using `snforge`." -msgstr "" +msgstr "El siguiente ejemplo muestra cómo probar un contrato Starknet utilizando `snforge`." #: src/ch02-13-foundry-forge.md:111 msgid "" @@ -11975,18 +12686,47 @@ msgid "" "}\n" "```" msgstr "" +"```rust\n" +"#[starknet::interface]\n" +"trait IHelloStarknet {\n" +" fn increase_balance(ref self: TContractState, amount: felt252);\n" +" fn get_balance(self: @TContractState) -> felt252;\n" +"}\n" +"\n" +"#[starknet::contract]\n" +"mod HelloStarknet {\n" +" #[storage]\n" +" struct Storage {\n" +" balance: felt252,\n" +" }\n" +"\n" +" #[external(v0)]\n" +" impl HelloStarknetImpl of super::IHelloStarknet {\n" +" // Increases the balance by the specified amount.\n" +" fn increase_balance(ref self: ContractState, amount: felt252) {\n" +" self.balance.write(self.balance.read() + amount);\n" +" }\n" +"\n" +" // Returns the balance.\n" +"\n" +" fn get_balance(self: @ContractState) -> felt252 {\n" +" self.balance.read()\n" +" }\n" +" }\n" +"}\n" +"```" #: src/ch02-13-foundry-forge.md:141 msgid "Remember, the identifier following `mod` signifies the contract name. Here, the contract name is `HelloStarknet`." -msgstr "" +msgstr "Recuerde que el identificador que sigue a `mod` significa el nombre del contrato. En este caso, el nombre del contrato es `HelloStarknet`." #: src/ch02-13-foundry-forge.md:143 msgid "### Craft the Test" -msgstr "" +msgstr "### Elaborar el Test" #: src/ch02-13-foundry-forge.md:145 msgid "Below is a test for the **`HelloStarknet`** contract. This test deploys **`HelloStarknet`** and interacts with its functions:" -msgstr "" +msgstr "A continuación se muestra una prueba para el contrato **`HelloStarknet`**. Este test despliega **`HelloStarknet`** e interactúa con sus funciones:" #: src/ch02-13-foundry-forge.md:147 msgid "" @@ -12015,10 +12755,34 @@ msgid "" "}\n" "```" msgstr "" +"```rust\n" +"use snforge_std::{ declare, ContractClassTrait };\n" +"\n" +"#[test]\n" +"fn call_and_invoke() {\n" +" // Declare and deploy the contract\n" +" let contract = declare('HelloStarknet');\n" +" let contract_address = contract.deploy(@ArrayTrait::new()).unwrap();\n" +"\n" +" // Instantiate a Dispatcher object for contract interactions\n" +" let dispatcher = IHelloStarknetDispatcher { contract_address };\n" +"\n" +" // Invoke a contract's view function\n" +" let balance = dispatcher.get_balance();\n" +" assert(balance == 0, 'balance == 0');\n" +"\n" +" // Invoke another function to modify the storage state\n" +" dispatcher.increase_balance(100);\n" +"\n" +" // Validate the transaction's effect\n" +" let balance = dispatcher.get_balance();\n" +" assert(balance == 100, 'balance == 100');\n" +"}\n" +"```" #: src/ch02-13-foundry-forge.md:172 msgid "To run the test, execute the `snforge` command. The expected output is:" -msgstr "" +msgstr "Para realizar la prueba, ejecute el comando `snforge`. La salida esperada es:" #: src/ch02-13-foundry-forge.md:174 msgid "" @@ -12029,42 +12793,53 @@ msgid "" "Tests: 1 passed, 0 failed, 0 skipped\n" "```" msgstr "" +"```shell\n" +"Collected 1 test(s) from using_dispatchers package\n" +"Running 1 test(s) from src/\n" +"[PASS] using_dispatchers::call_and_invoke\n" +"Tests: 1 passed, 0 failed, 0 skipped\n" +"```" #: src/ch02-13-foundry-forge.md:181 -#, fuzzy msgid "## Example: Testing ERC20 Contract" -msgstr "## Implementación del Contrato ERC20" +msgstr "## Ejemplo: Testing del Contrato ERC20" #: src/ch02-13-foundry-forge.md:183 msgid "" "There are several methods to test smart contracts, such as unit tests, integration tests, fuzz tests, fork tests, E2E tests, and using foundry cheatcodes. This section discusses testing an ERC20 " "example contract from the `starknet-js` subchapter examples using unit and integration tests, filtering, foundry cheatcodes, and fuzz tests through the `snforge` CLI." msgstr "" +"Hay varios métodos para probar los smart contracts, tales como test unitarios, test de integración, test fuzz, test de bifurcación, test E2E, y el uso de chetacode de la fundición. Esta sección " +"discute los test de un contrato de ejemplo ERC20 de los ejemplos del subcapítulo `starknet-js` utilizando test unitarios y de integración, filtrado, foundry cheatcodes, y pruebas fuzz a través de " +"la CLI `snforge`." #: src/ch02-13-foundry-forge.md:185 -#, fuzzy msgid "## ERC20 Contract Example" -msgstr "## Implementación del Contrato ERC20" +msgstr "## Ejemplo de Contrato ERC20" #: src/ch02-13-foundry-forge.md:187 msgid "" "After setting up your foundry project, add the following dependency to your `Scarb.toml` (in this case we are using version 0.7.0 of the OpenZeppelin Cairo contracts, but you can use any version " "you want):" msgstr "" +"Después de configurar tu proyecto foundry, añade la siguiente dependencia a tu `Scarb.toml` (en este caso estamos usando la versión 0.7.0 de los contratos OpenZeppelin Cairo, pero puedes usar " +"cualquier versión que desees):" #: src/ch02-13-foundry-forge.md:189 msgid "" "```shell\n" "openzeppelin = { git = \"https://github.com/OpenZeppelin/cairo-contracts.git\", tag = \"v0.7.0\" }\n" "```" -msgstr "" +msgstr "" +"```shell\n" +"openzeppelin = { git = \"https://github.com/OpenZeppelin/cairo-contracts.git\", tag = \"v0.7.0\" }\n" +"```" #: src/ch02-13-foundry-forge.md:193 msgid "Here's a basic ERC20 contract:" -msgstr "" +msgstr "He aquí un contrato ERC20 básico:" #: src/ch02-13-foundry-forge.md:195 -#, fuzzy msgid "" "```rust\n" "use starknet::ContractAddress;\n" @@ -12113,6 +12888,14 @@ msgid "" "```" msgstr "" "```rust\n" +"use starknet::ContractAddress;\n" +"\n" +"#[starknet::interface]\n" +"trait Ierc20 {\n" +" fn balance_of(self: @TContractState, account: ContractAddress) -> u256;\n" +" fn transfer(ref self: TContractState, recipient: ContractAddress, amount: u256) -> bool;\n" +"}\n" +"\n" "#[starknet::contract]\n" "mod erc20 {\n" " use starknet::ContractAddress;\n" @@ -12124,7 +12907,7 @@ msgstr "" " #[constructor]\n" " fn constructor(\n" " ref self: ContractState,\n" -" initial_supply: u256,\n" +" initial_supply: felt252,\n" " recipient: ContractAddress\n" " ) {\n" " let name = 'MyToken';\n" @@ -12132,12 +12915,11 @@ msgstr "" "\n" " let mut unsafe_state = ERC20::unsafe_new_contract_state();\n" " ERC20::InternalImpl::initializer(ref unsafe_state, name, symbol);\n" -" ERC20::InternalImpl::_mint(ref unsafe_state, recipient, initial_supply);\n" +" ERC20::InternalImpl::_mint(ref unsafe_state, recipient, initial_supply.into());\n" " }\n" "\n" " #[external(v0)]\n" -" #[generate_trait]\n" -" impl Ierc20Impl of Ierc20 {\n" +" impl Ierc20Impl of super::Ierc20 {\n" " fn balance_of(self: @ContractState, account: ContractAddress) -> u256 {\n" " let unsafe_state = ERC20::unsafe_new_contract_state();\n" " ERC20::ERC20Impl::balance_of(@unsafe_state, account)\n" @@ -12153,15 +12935,15 @@ msgstr "" #: src/ch02-13-foundry-forge.md:241 msgid "This contract allows minting tokens to a recipient during deployment, checking balances, and transferring tokens, relying on the openzeppelin ERC20 library." -msgstr "" +msgstr "Este contrato permite mintear tokens a un destinatario durante el despliegue, comprobar saldos y transferir tokens, basándose en la biblioteca ERC20 de openzeppelin." #: src/ch02-13-foundry-forge.md:243 msgid "### Test Preparation" -msgstr "" +msgstr "### Preparación del Test" #: src/ch02-13-foundry-forge.md:245 msgid "Organize your test file and include the required imports:" -msgstr "" +msgstr "Organice su archivo de test e incluya las importaciones necesarias:" #: src/ch02-13-foundry-forge.md:247 msgid "" @@ -12179,10 +12961,23 @@ msgid "" "}\n" "```" msgstr "" +"```rust\n" +"#[cfg(test)]\n" +"mod tests {\n" +" use array::ArrayTrait;\n" +" use result::ResultTrait;\n" +" use option::OptionTrait;\n" +" use traits::TryInto;\n" +" use starknet::ContractAddress;\n" +" use starknet::Felt252TryIntoContractAddress;\n" +" use snforge_std::{declare, ContractClassTrait};\n" +" // Additional code here.\n" +"}\n" +"```" #: src/ch02-13-foundry-forge.md:261 msgid "For testing, you'll need a helper function to deploy the contract instance. This function requires a `supply` amount and `recipient` address:" -msgstr "" +msgstr "Para los test, necesitará una función de ayuda para desplegar la instancia del contrato. Esta función requiere una cantidad de `supply` y una dirección de `recipient`:" #: src/ch02-13-foundry-forge.md:263 msgid "" @@ -12199,23 +12994,34 @@ msgid "" "// Additional code here.\n" "```" msgstr "" +"```rust\n" +"use snforge_std::{declare, ContractClassTrait};\n" +"\n" +"fn deploy_contract(name: felt252) -> ContractAddress {\n" +" let recipient = starknet::contract_address_const::<0x01>();\n" +" let supply: felt252 = 20000000;\n" +" let contract = declare(name);\n" +" let mut calldata = array![supply, recipient.into()];\n" +" contract.deploy(@calldata).unwrap()\n" +"}\n" +"// Additional code here.\n" +"```" #: src/ch02-13-foundry-forge.md:276 msgid "Use `declare` and `ContractClassTrait` from `snforge_std`. Then, initialize the `supply` and `recipient`, declare the contract, compute the calldata, and deploy." -msgstr "" +msgstr "Utiliza `declare` y `ContractClassTrait` de `snforge_std`. A continuación, inicializa el `supply` y el `recipient`, declara el contrato, calcula los calldata y despliega." #: src/ch02-13-foundry-forge.md:278 -#, fuzzy msgid "### Writing the Test Cases" -msgstr "### Actualización del Componente Wallet" +msgstr "### Escribir los Casos de Test" #: src/ch02-13-foundry-forge.md:280 msgid "#### Verifying the Balance After Deployment" -msgstr "" +msgstr "#### Verificación del Balance Después del Deployment" #: src/ch02-13-foundry-forge.md:282 msgid "To begin, test the deployment helper function to confirm the recipient's balance:" -msgstr "" +msgstr "Para empezar, pruebe la función de ayuda al despliegue para confirmar el balance del destinatario:" #: src/ch02-13-foundry-forge.md:284 msgid "" @@ -12235,10 +13041,25 @@ msgid "" " }\n" "```" msgstr "" +"```rust\n" +" // ...\n" +" use erc20_contract::erc20::Ierc20SafeDispatcher;\n" +" use erc20_contract::erc20::Ierc20SafeDispatcherTrait;\n" +"\n" +" #[test]\n" +" #[available_gas(3000000000000000)]\n" +" fn test_balance_of() {\n" +" let contract_address = deploy_contract('erc20');\n" +" let safe_dispatcher = Ierc20SafeDispatcher { contract_address };\n" +" let recipient = starknet::contract_address_const::<0x01>();\n" +" let balance = safe_dispatcher.balance_of(recipient).unwrap();\n" +" assert(balance == 20000000, 'Invalid Balance');\n" +" }\n" +"```" #: src/ch02-13-foundry-forge.md:300 msgid "Execute `snforge` to verify:" -msgstr "" +msgstr "Ejecute `snforge` para verificarlo:" #: src/ch02-13-foundry-forge.md:302 msgid "" @@ -12247,31 +13068,43 @@ msgid "" "[PASS] tests::test_erc20::test_balance_of\n" "```" msgstr "" +"```shell\n" +"Collected 1 test from erc20_contract package\n" +"[PASS] tests::test_erc20::test_balance_of\n" +"```" #: src/ch02-13-foundry-forge.md:307 msgid "#### Utilizing Foundry Cheat Codes" msgstr "" +"#### Utilizando los Cheat Codes\n" +" de Foundry" #: src/ch02-13-foundry-forge.md:309 msgid "" "When testing smart contracts, simulating different conditions is essential. `Foundry Cheat Codes` from the `snforge_std` library offer these simulation capabilities for Starknet smart contracts." msgstr "" +"Cuando se prueban contratos inteligentes, es esencial simular diferentes condiciones. Los `Foundry Cheat Codes` de la biblioteca `snforge_std` ofrecen estas capacidades de simulación para los smart " +"contracts de Starknet." #: src/ch02-13-foundry-forge.md:311 msgid "" "These cheat codes consist of helper functions that adjust the smart contract's environment. They allow developers to modify parameters or conditions to examine contract behavior in specific " "scenarios." msgstr "" +"Estos cheat codes consisten en funciones de ayuda que ajustan el entorno del smart contract. Permiten a los desarrolladores modificar parámetros o condiciones para examinar el comportamiento del " +"contrato en escenarios específicos." #: src/ch02-13-foundry-forge.md:313 msgid "" "Using `snforge_std`'s cheat codes, you can change elements like block numbers, timestamps, or even the caller of a function. This guide focuses on `start_prank` and `stop_prank`. You can find a " "reference to available cheat codes [here](https://foundry-rs.github.io/starknet-foundry/appendix/cheatcodes.html)" msgstr "" +"Usando los cheat codes de `snforge_std`, puedes cambiar elementos como números de bloque, timestamps, o incluso el invocador de una función. Esta guía se centra en `start_prank` y `stop_prank`. " +"Puedes encontrar una referencia a los códigos de trucos disponibles [aquí](https://foundry-rs.github.io/starknet-foundry/appendix/cheatcodes.html)" #: src/ch02-13-foundry-forge.md:315 msgid "Below is a transfer test example:" -msgstr "" +msgstr "A continuación se muestra un ejemplo de test de transferencia:" #: src/ch02-13-foundry-forge.md:317 msgid "" @@ -12300,10 +13133,34 @@ msgid "" " }\n" "```" msgstr "" +"```rust\n" +" use snforge_std::{declare, ContractClassTrait, start_prank, stop_prank};\n" +"\n" +" #[test]\n" +" #[available_gas(3000000000000000)]\n" +" fn test_transfer() {\n" +" let contract_address = deploy_contract('erc20');\n" +" let safe_dispatcher = Ierc20SafeDispatcher { contract_address };\n" +"\n" +" let sender = starknet::contract_address_const::<0x01>();\n" +" let receiver = starknet::contract_address_const::<0x02>();\n" +" let amount : felt252 = 10000000;\n" +"\n" +" // Set the function's caller\n" +" start_prank(contract_address, sender);\n" +" safe_dispatcher.transfer(receiver.into(), amount.into());\n" +"\n" +" let balance_after_transfer = safe_dispatcher.balance_of(receiver).unwrap();\n" +" assert(balance_after_transfer == 10000000, 'Incorrect Amount');\n" +"\n" +" // End the prank\n" +" stop_prank(contract_address);\n" +" }\n" +"```" #: src/ch02-13-foundry-forge.md:342 msgid "Executing `snforge` for the tests displays:" -msgstr "" +msgstr "Ejecutando `snforge` para las pruebas muestra:" #: src/ch02-13-foundry-forge.md:344 msgid "" @@ -12313,10 +13170,15 @@ msgid "" "[PASS] tests::test_erc20::test_transfer\n" "```" msgstr "" +"```shell\n" +"Collected 2 tests from erc20_contract package\n" +"[PASS] tests::test_erc20::test_balance_of\n" +"[PASS] tests::test_erc20::test_transfer\n" +"```" #: src/ch02-13-foundry-forge.md:350 msgid "In this example, `start_prank` determines the transfer function's caller, while `stop_prank` concludes the prank." -msgstr "" +msgstr "En este ejemplo, `start_prank` determina el llamador de la función de transferencia, mientras que `stop_prank` concluye el prank." #: src/ch02-13-foundry-forge.md:352 msgid "" @@ -12331,6 +13193,16 @@ msgid "" " use starknet::ContractAddress;\n" " use starknet::Felt252TryIntoContractAddress;" msgstr "" +"
\n" +"Full `ERC20 test example` file\n" +" #[cfg(test)]\n" +" mod tests {\n" +" use array::ArrayTrait;\n" +" use result::ResultTrait;\n" +" use option::OptionTrait;\n" +" use traits::TryInto;\n" +" use starknet::ContractAddress;\n" +" use starknet::Felt252TryIntoContractAddress;" #: src/ch02-13-foundry-forge.md:363 msgid "" @@ -12374,21 +13246,61 @@ msgid "" " }\n" " }" msgstr "" +" use snforge_std::{declare, ContractClassTrait, start_prank, stop_prank};\n" +" use erc20_contract::erc20::Ierc20SafeDispatcher;\n" +" use erc20_contract::erc20::Ierc20SafeDispatcherTrait;\n" +"\n" +" fn deploy_contract(name: felt252) -> ContractAddress {\n" +" let recipient = starknet::contract_address_const::<0x01>();\n" +" let supply : felt252 = 20000000;\n" +" let contract = declare(name);\n" +" let mut calldata = array![supply, recipient.into()];\n" +" contract.deploy(@calldata).unwrap()\n" +" }\n" +"\n" +" #[test]\n" +" #[available_gas(3000000000000000)]\n" +" fn test_balance_of() {\n" +" let contract_address = deploy_contract('erc20');\n" +" let safe_dispatcher = Ierc20SafeDispatcher { contract_address };\n" +" let recipient = starknet::contract_address_const::<0x01>();\n" +" let balance = safe_dispatcher.balance_of(recipient).unwrap();\n" +" assert(balance == 20000000, 'Invalid Balance');\n" +" }\n" +"\n" +" #[test]\n" +" #[available_gas(3000000000000000)]\n" +" fn test_transfer() {\n" +" let contract_address = deploy_contract('erc20');\n" +" let safe_dispatcher = Ierc20SafeDispatcher { contract_address };\n" +"\n" +" let sender = starknet::contract_address_const::<0x01>();\n" +" let receiver = starknet::contract_address_const::<0x02>();\n" +" let amount : felt252 = 10000000;\n" +"\n" +" start_prank(contract_address, sender);\n" +" safe_dispatcher.transfer(receiver.into(), amount.into());\n" +" let balance_after_transfer = safe_dispatcher.balance_of(receiver).unwrap();\n" +" assert(balance_after_transfer == 10000000, 'Incorrect Amount');\n" +" stop_prank(contract_address);\n" +" }\n" +" }" #: src/ch02-13-foundry-forge.md:403 msgid "
" -msgstr "" +msgstr "" #: src/ch02-13-foundry-forge.md:405 -#, fuzzy msgid "## Fuzz Testing" -msgstr "## Otras Lecturas" +msgstr "## Fuzz Testing" #: src/ch02-13-foundry-forge.md:407 msgid "" "Fuzz testing introduces random inputs to the code to identify vulnerabilities, security issues, and unforeseen behaviors. While you can manually provide these inputs, automation is preferable when " "testing a broad set of values. See the example below in `test_fuzz.cairo`:" msgstr "" +"Las testing fuzz introducen entradas aleatorias en el código para identificar vulnerabilidades, problemas de seguridad y comportamientos imprevistos. Aunque puede introducir estas entradas " +"manualmente, la automatización es preferible cuando se prueba un amplio conjunto de valores. Véase el ejemplo siguiente en `test_fuzz.cairo`:" #: src/ch02-13-foundry-forge.md:409 msgid "" @@ -12403,10 +13315,20 @@ msgid "" " }\n" "```" msgstr "" +"```rust\n" +" fn mul(a: felt252, b: felt252) -> felt252 {\n" +" return a * b;\n" +" }\n" +"\n" +" #[test]\n" +" fn test_fuzz_sum(x: felt252, y: felt252) {\n" +" assert(mul(x, y) == x * y, 'incorrect');\n" +" }\n" +"```" #: src/ch02-13-foundry-forge.md:420 msgid "Running `snforge` produces:" -msgstr "" +msgstr "Ejecutando `snforge` produce:" #: src/ch02-13-foundry-forge.md:422 msgid "" @@ -12419,10 +13341,18 @@ msgid "" " Fuzzer seed: 6375310854403272271\n" "```" msgstr "" +"```shell\n" +" Collected 1 test(s) from erc20_contract package\n" +" Running 0 test(s) from src/\n" +" Running 1 test(s) from tests/\n" +" [PASS] tests::test_fuzz::test_fuzz_sum (fuzzer runs = 256)\n" +" Tests: 1 passed, 0 failed, 0 skipped\n" +" Fuzzer seed: 6375310854403272271\n" +"```" #: src/ch02-13-foundry-forge.md:431 msgid "The fuzzer supports these types by November 2023:" -msgstr "" +msgstr "El fuzzer soporta estos tipos para noviembre de 2023:" #: src/ch02-13-foundry-forge.md:433 msgid "" @@ -12434,14 +13364,21 @@ msgid "" "- u256\n" "- felt252" msgstr "" +"- u8\n" +"- u16\n" +"- u32\n" +"- u64\n" +"- u128\n" +"- u256\n" +"- felt252" #: src/ch02-13-foundry-forge.md:441 msgid "`Fuzzer Configuration`" -msgstr "" +msgstr "`Fuzzer Configuration`" #: src/ch02-13-foundry-forge.md:443 msgid "You can set the number of runs and the seed for a test:" -msgstr "" +msgstr "Puede establecer el número de ejecuciones y la seed para un test:" #: src/ch02-13-foundry-forge.md:445 msgid "" @@ -12453,10 +13390,17 @@ msgid "" " }\n" "```" msgstr "" +"```rust\n" +" #[test]\n" +" #[fuzzer(runs: 100, seed: 38)]\n" +" fn test_fuzz_sum(x: felt252, y: felt252) {\n" +" assert(mul(x, y) == x * y, 'incorrect');\n" +" }\n" +"```" #: src/ch02-13-foundry-forge.md:453 msgid "Or, use the command line:" -msgstr "" +msgstr "O bien, utilice la línea de comandos:" #: src/ch02-13-foundry-forge.md:455 msgid "" @@ -12464,10 +13408,13 @@ msgid "" " $ snforge --fuzzer-runs 500 --fuzzer-seed 4656\n" "```" msgstr "" +"```shell\n" +" $ snforge --fuzzer-runs 500 --fuzzer-seed 4656\n" +"```" #: src/ch02-13-foundry-forge.md:459 msgid "Or in `scarb.toml`:" -msgstr "" +msgstr "O en `scarb.toml`:" #: src/ch02-13-foundry-forge.md:461 msgid "" @@ -12479,37 +13426,43 @@ msgid "" " # ...\n" "```" msgstr "" +"```shell\n" +" # ...\n" +" [tool.snforge]\n" +" fuzzer_runs = 500\n" +" fuzzer_seed = 4656\n" +" # ...\n" +"```" #: src/ch02-13-foundry-forge.md:469 msgid "For more insight on fuzz tests, you can view it [here](https://foundry-rs.github.io/starknet-foundry/testing/fuzz-testing.html#fuzz-testing)" -msgstr "" +msgstr "Para más información sobre los tests fuzz, puede consultar [aquí](https://foundry-rs.github.io/starknet-foundry/testing/fuzz-testing.html#fuzz-testing)" #: src/ch02-13-foundry-forge.md:471 msgid "## Filter Tests" -msgstr "" +msgstr "## Tests de Filtrado" #: src/ch02-13-foundry-forge.md:473 msgid "To execute specific tests, use a filter string with the `snforge` command. Tests matching the filter based on their absolute module tree path will be executed." -msgstr "" +msgstr "Para ejecutar test específicos, utilice una string de filtro con el comando `snforge`. Se ejecutarán las pruebas que coincidan con el filtro basado en la ruta absoluta del árbol de módulos." #: src/ch02-13-foundry-forge.md:475 msgid "For instance, to run all tests with the string 'test\\_' in their name:" -msgstr "" +msgstr "Por ejemplo, para ejecutar todas las pruebas con la string 'test\\_' en su nombre:" #: src/ch02-13-foundry-forge.md:477 -#, fuzzy msgid "" "```shell\n" "snforge test_\n" "```" msgstr "" "```shell\n" -"npx create-starknet\n" +"snforge test_\n" "```" #: src/ch02-13-foundry-forge.md:481 msgid "Expected output:" -msgstr "" +msgstr "Resultado esperado:" #: src/ch02-13-foundry-forge.md:483 msgid "" @@ -12524,29 +13477,38 @@ msgid "" " Fuzzer seed: 10426315620495146768\n" "```" msgstr "" +"```shell\n" +" Collected 3 test(s) from erc20_contract package\n" +" Running 0 test(s) from src/\n" +" Running 3 test(s) from tests/\n" +" [PASS] tests::test_erc20::tests::test_balance_of\n" +" [PASS] tests::test_erc20::tests::test_transfer\n" +" [PASS] tests::test_fuzz::test_fuzz_sum (fuzzer runs = 256)\n" +" Tests: 3 passed, 0 failed, 0 skipped\n" +" Fuzzer seed: 10426315620495146768\n" +"```" #: src/ch02-13-foundry-forge.md:494 msgid "All the tests with the string 'test\\_' in their test name went through." -msgstr "" +msgstr "Todos los tests con la string 'test\\_' en su nombre pasaron." #: src/ch02-13-foundry-forge.md:496 msgid "Another example: To filter and run `test_fuzz_sum` we can partially match the test name with the string 'fuzz_sum' like this:" -msgstr "" +msgstr "Otro ejemplo: Para filtrar y ejecutar `test_fuzz_sum` podemos hacer coincidir parcialmente el nombre de la prueba con la cadena `fuzz_sum` de esta forma:" #: src/ch02-13-foundry-forge.md:498 -#, fuzzy msgid "" "```shell\n" "snforge test_fuzz_sum\n" "```" msgstr "" "```shell\n" -"npx create-starknet\n" +"snforge test_fuzz_sum\n" "```" #: src/ch02-13-foundry-forge.md:502 msgid "To execute an exact test, combine the `--exact` flag with a fully qualified test name:" -msgstr "" +msgstr "Para ejecutar un test exacto, combine el indicador `--exact` con un nombre de prueba completo:" #: src/ch02-13-foundry-forge.md:504 msgid "" @@ -12554,28 +13516,49 @@ msgid "" "snforge package_name::test_name --exact\n" "```" msgstr "" +"```shell\n" +"snforge package_name::test_name --exact\n" +"```" #: src/ch02-13-foundry-forge.md:508 msgid "To halt the test suite upon the first test failure, use the `--exit-first` flag:" -msgstr "" +msgstr "Para detener el conjunto de test tras el primer fallo, utilice el indicador `--exit-first`:" #: src/ch02-13-foundry-forge.md:510 -#, fuzzy msgid "" "```shell\n" "snforge --exit-first\n" "```" msgstr "" "```shell\n" -"npx create-starknet\n" +"snforge --exit-first\n" +"```" + +#: src/ch02-13-foundry-forge.md:514 +msgid "If a test fails, the output will resemble:" +msgstr "" +"Si in test\n" +" falla, la salida será similar:" + +#: src/ch02-13-foundry-forge.md:516 +msgid "" +"```shell\n" +" Collected 3 test(s) from erc20_contract package\n" +" Running 0 test(s) from src/\n" +" Running 3 test(s) from tests/\n" +" [FAIL] tests::test_erc20::tests::test_balance_of\n" +"\n" +" Failure data:\n" +" original value: [381278114803728420489684244530881381], converted to a string: [Invalid Balance]\n" +"\n" +" [SKIP] tests::test_erc20::tests::test_transfer\n" +" [SKIP] tests::test_fuzz::test_fuzz_sum\n" +" Tests: 0 passed, 1 failed, 2 skipped\n" +"\n" +" Failures:\n" +" tests::test_erc20::tests::test_balance_of\n" "```" - -#: src/ch02-13-foundry-forge.md:514 -msgid "If a test fails, the output will resemble:" msgstr "" - -#: src/ch02-13-foundry-forge.md:516 -msgid "" "```shell\n" " Collected 3 test(s) from erc20_contract package\n" " Running 0 test(s) from src/\n" @@ -12592,61 +13575,67 @@ msgid "" " Failures:\n" " tests::test_erc20::tests::test_balance_of\n" "```" -msgstr "" #: src/ch02-13-foundry-forge.md:533 -#, fuzzy msgid "### Conclusion" -msgstr "## Conclusión" +msgstr "### Conclusión" #: src/ch02-13-foundry-forge.md:535 msgid "" "Starknet Foundry offers a notable step forward in Starknet contract development and testing. This toolset sharpens the process of creating, deploying, and testing Cairo contracts. Its main " "components, Forge and Cast, provide developers with robust tools for Cairo contract work." msgstr "" +"Starknet Foundry ofrece un notable paso adelante en el desarrollo y los tests de contratos de Starknet. Este conjunto de herramientas perfecciona el proceso de creación, despliegue y comprobación " +"de los contratos de Cairo. Sus componentes principales, Forge y Cast, proporcionan a los desarrolladores herramientas robustas para el trabajo con contratos de Cairo." #: src/ch02-13-foundry-forge.md:537 msgid "" "Forge shines with its dual functionality: deploying and thoroughly testing Cairo contracts. It directly supports test writing in Cairo, removing the need for other languages and simplifying the " "task. Moreover, Forge seamlessly integrates with Scarb, emphasizing its adaptability, especially with existing Scarb projects." msgstr "" +"Forge brilla por su doble funcionalidad: desplegar y probar a fondo los contratos de Cairo. Soporta directamente la escritura de pruebas en Cairo, eliminando la necesidad de otros lenguajes y " +"simplificando la tarea. Además, Forge se integra perfectamente con Scarb, destacando su adaptabilidad, especialmente con proyectos Scarb existentes." #: src/ch02-13-foundry-forge.md:539 msgid "The `snforge` command-line tool makes initializing, setting up, and testing Starknet contracts straightforward." -msgstr "" +msgstr "La herramienta de línea de comandos `snforge` facilita la inicialización, configuración y comprobación de los contratos Starknet." #: src/ch02-14-security-considerations.md:1 msgid "# Security Considerations" -msgstr "" +msgstr "# Consideraciones de Seguridad" #: src/ch02-14-security-considerations.md:3 msgid "In blockchain programming, understanding and mitigating smart contract vulnerabilities is vital to maintain user trust. This is as true for Cairo as any other language." msgstr "" +"En la programación de blockchain, comprender y mitigar las vulnerabilidades de los smart contract es vital para mantener la confianza de los usuarios. Esto es tan cierto para Cairo como para " +"cualquier otro lenguaje." #: src/ch02-14-security-considerations.md:5 msgid "We'll cover common security issues and Starknet-specific vulnerabilities in Cairo, along with strategies to safeguard your contracts." -msgstr "" +msgstr "Trataremos los problemas de seguridad más comunes y las vulnerabilidades específicas de Starknet en Cairo, junto con estrategias para salvaguardar sus contratos." #: src/ch02-14-security-considerations.md:7 msgid "Your insights can enhance this chapter. To contribute, submit a pull request to the [Book repo](https://github.com/starknet-edu/starknetbook)." -msgstr "" +msgstr "Sus ideas pueden mejorar este capítulo. Para contribuir, envíe una solicitud de extracción al [repositorio del Libro de Starknet](https://github.com/starknet-edu/starknetbook)." #: src/ch02-14-security-considerations.md:9 msgid "> Note: Some code examples here are simplified pseudo-code, meant for concept explanation, not for production use." -msgstr "" +msgstr "> Nota: Algunos ejemplos de código aquí son pseudocódigos simplificados, destinados a la explicación de conceptos, no al uso en producción." #: src/ch02-14-security-considerations.md:11 msgid "## 1. Access Control" -msgstr "" +msgstr "## 1. Control de Acceso" #: src/ch02-14-security-considerations.md:13 msgid "" "Access control vulnerabilities occur when a smart contract's functions are insufficiently protected, allowing unauthorized actions. This can result in unexpected behavior and data manipulation." msgstr "" +"Las vulnerabilidades de control de acceso ocurren cuando las funciones de un smart contract no están suficientemente protegidas, lo que permite acciones no autorizadas. Esto puede dar lugar a " +"comportamientos inesperados y manipulación de datos." #: src/ch02-14-security-considerations.md:15 msgid "Take, for instance, a smart contract for token minting without proper access control:" -msgstr "" +msgstr "Tomemos, por ejemplo, un smart contract para la acuñación de tokens sin un control de acceso adecuado:" #: src/ch02-14-security-considerations.md:17 msgid "" @@ -12669,29 +13658,52 @@ msgid "" "}\n" "```" msgstr "" +"```rust\n" +"#[starknet::contract]\n" +"mod Token {\n" +" #[storage]\n" +" struct Storage {\n" +" total_supply: u256, // Stores the total supply of tokens.\n" +" }\n" +"\n" +" #[external(v0)]\n" +" impl ITokenImpl of IToken {\n" +" fn mint_tokens(ref self: ContractState, amount: u256) {\n" +" // The mint_tokens function updates the total supply.\n" +" // Without access control, any user can call this function, posing a risk.\n" +" self.total_supply.write(self.total_supply.read() + amount);\n" +" }\n" +" }\n" +"}\n" +"```" #: src/ch02-14-security-considerations.md:36 msgid "" "In this code, the `mint_tokens` function is vulnerable because any user can call it, leading to potential token supply exploitation. Implementing access controls would restrict this function to " "authorized users only." msgstr "" +"En este código, la función `mint_tokens` es vulnerable porque cualquier usuario puede llamarla, lo que lleva a una posible explotación del suministro de tokens. La implementación de controles de " +"acceso restringiría esta función únicamente a usuarios autorizados." #: src/ch02-14-security-considerations.md:38 -#, fuzzy msgid "### Recommendation" -msgstr "## Proceso de Compilación" +msgstr "### Recomendación" #: src/ch02-14-security-considerations.md:40 msgid "" "To prevent access control vulnerabilities, integrate authorization mechanisms like role-based access control (RBAC) or ownership checks. You can develop a custom solution or use templates from " "sources like [OpenZeppelin](https://docs.openzeppelin.com/contracts-cairo/access)." msgstr "" +"Para evitar vulnerabilidades en el control de acceso, integre mecanismos de autorización como control de acceso basado en roles (RBAC) o comprobaciones de propiedad. Puede desarrollar una solución " +"personalizada o utilizar plantillas de fuentes como [OpenZeppelin](https://docs.openzeppelin.com/contracts-cairo/access)." #: src/ch02-14-security-considerations.md:42 msgid "" "In our earlier example, we can enhance security by adding an owner variable, initializing the owner in the constructor, and including a verification in the `mint_tokens` function to allow only the " "owner to mint tokens." msgstr "" +"En nuestro ejemplo anterior, podemos mejorar la seguridad agregando una variable de owner, inicializando el owner en el constructor e incluyendo una verificación en la función `mint_tokens` para " +"permitir que solo el owner acuñe tokens." #: src/ch02-14-security-considerations.md:44 msgid "" @@ -12724,26 +13736,60 @@ msgid "" "}\n" "```" msgstr "" +"```rust\n" +"#[starknet::contract]\n" +"mod Token {\n" +"\n" +" #[storage]\n" +" struct Storage {\n" +" owner: ContractAddress, // New variable to store the contract owner's address.\n" +" total_supply: u256,\n" +" }\n" +"\n" +" #[constructor]\n" +" fn constructor(ref self: ContractState,) {\n" +" let sender = get_caller_address(); // Get the address of the contract creator.\n" +" self.owner.write(sender); // Set the creator as the owner.\n" +" }\n" +"\n" +" #[external(v0)]\n" +" impl ITokenImpl of IToken {\n" +" fn mint_tokens(ref self: ContractState, amount: u256) {\n" +" // Check if the caller is the owner before minting tokens.\n" +" let sender = get_caller_address();\n" +" assert(sender == self.owner.read()); // Assert ensures only the owner can mint.\n" +"\n" +" self.total_supply.write(self.total_supply.read() + amount);\n" +" }\n" +" }\n" +"}\n" +"```" #: src/ch02-14-security-considerations.md:73 msgid "By establishing robust access control, you ensure that only authorized entities execute your smart contract functions, significantly reducing the risk of unauthorized interference." msgstr "" +"Al establecer un control de acceso sólido, se asegura de que solo las entidades autorizadas ejecuten las funciones de su smart contract, lo que reduce significativamente el riesgo de interferencia " +"no autorizada." #: src/ch02-14-security-considerations.md:75 msgid "## 2. Reentrancy" -msgstr "" +msgstr "## 2. Reentrada" #: src/ch02-14-security-considerations.md:77 msgid "" "Reentrancy vulnerabilities arise when a smart contract calls an external contract before updating its state. This allows the external contract to recursively call the original function, potentially " "leading to unintended behavior." msgstr "" +"Las vulnerabilidades de reentrada (reentrancy) surgen cuando un smart contract llama a un contrato externo antes de actualizar su estado. Esto permite que el contrato externo llame de forma " +"recursiva a la función original, lo que podría provocar un comportamiento no deseado." #: src/ch02-14-security-considerations.md:79 msgid "" "Consider a game contract where whitelisted addresses can mint an NFT sword and then execute an `on_receive_sword()` function before returning it. This NFT contract is at risk of a reentrancy " "attack, where an attacker can mint multiple swords." msgstr "" +"Considere un contrato de juego en el que las direcciones incluidas en la whitelisted pueden acuñar una espada NFT y luego ejecutar una función `on_receive_sword()` antes de devolverla. Este " +"contrato NFT corre el riesgo de sufrir un ataque de reentrada, donde un atacante puede acuñar varias espadas." #: src/ch02-14-security-considerations.md:81 msgid "" @@ -12780,12 +13826,46 @@ msgid "" "}\n" "```" msgstr "" +"```rust\n" +"#[storage]\n" +"struct Storage {\n" +" available_swords: u256, // Stores available swords.\n" +" sword: LegacyMap::, // Maps swords to addresses.\n" +" whitelisted: LegacyMap::, // Tracks whitelisted addresses.\n" +" ...\n" +" ...\n" +"}\n" +"\n" +"#[constructor]\n" +"fn constructor(ref self: ContractState,) {\n" +" self.available_swords.write(100); // Initializes the sword count.\n" +"}\n" +"\n" +"#[external(v0)]\n" +"impl IGameImpl of IGame {\n" +" fn mint_one_sword(ref self: ContractState) {\n" +" let sender = get_caller_address();\n" +" if self.whitelisted.read(sender) {\n" +" // Update the sword count before minting.\n" +" let sword_count = self.available_swords.read();\n" +" self.available_swords.write(sword_count - 1);\n" +" // Mint a sword.\n" +" self.sword.write(sender, 1);\n" +" // Callback to sender's contract.\n" +" let callback = ICallerDispatcher { contract_address: sender }.on_receive_sword();\n" +" // Remove sender from whitelist after callback to prevent reentrancy.\n" +" self.whitelisted.write(sender, false);\n" +" }\n" +"}\n" +"```" #: src/ch02-14-security-considerations.md:114 msgid "" "An attacker's contract can implement the `on_receive_sword` function to exploit the reentry vulnerability and mint multiple swords by calling `mint_one_sword` again before removing the sender from " "the `whitelist`:" msgstr "" +"El contrato de un atacante puede implementar la función `on_receive_sword` para explotar la vulnerabilidad de reentrada y acuñar múltiples espadas llamando a `mint_one_sword` nuevamente antes de " +"eliminar al remitente de la `whitelist`:" #: src/ch02-14-security-considerations.md:116 msgid "" @@ -12801,23 +13881,37 @@ msgid "" "}\n" "```" msgstr "" +"```rust\n" +"fn on_receive_sword(ref self: ContractState) {\n" +" let nft_sword_contract = get_caller_address();\n" +" let call_number: felt252 = self.total_calls.read();\n" +" self.total_calls.write(call_number + 1);\n" +" if call_number < 10 {\n" +" // Attempt to mint a sword again.\n" +" let call = ISwordDispatcher { contract_address: nft_sword_contract }.mint_one_sword();\n" +" }\n" +"}\n" +"```" #: src/ch02-14-security-considerations.md:128 msgid "" "Reentrancy protections are critical in many ERC standards with `safeTransfer` functions (like ERC721, ERC777, ERC1155, ERC223) and in flash loans, where borrower contracts need to safely use and " "return funds." msgstr "" +"Las protecciones de reentrada son fundamentales en muchos estándares ERC con funciones de `safeTransfer` (como ERC721, ERC777, ERC1155, ERC223) y en préstamos flash, donde los contratos de los " +"prestatarios deben utilizar y devolver los fondos de forma segura." #: src/ch02-14-security-considerations.md:130 src/ch02-14-security-considerations.md:202 src/ch02-14-security-considerations.md:261 src/ch02-14-security-considerations.md:369 -#, fuzzy msgid "### Recommendation:" -msgstr "## Proceso de Compilación" +msgstr "### Recomendación:" #: src/ch02-14-security-considerations.md:132 msgid "" "To prevent reentrancy attacks, use the check-effects-interactions pattern. This means updating your contract's internal state before interacting with external contracts. In the previous example, " "remove the sender from the whitelist before making the external call." msgstr "" +"Para evitar ataques de reentrada, utilice el patrón de verificación-efectos-interacciones. Esto significa actualizar el estado interno de su contrato antes de interactuar con contratos externos. En " +"el ejemplo anterior, elimine al remitente de la whitelist antes de realizar la llamada externa." #: src/ch02-14-security-considerations.md:134 msgid "" @@ -12835,30 +13929,47 @@ msgid "" "}\n" "```" msgstr "" +"```rust\n" +"if self.whitelisted.read(sender) {\n" +" // Update the sword count first.\n" +" let sword_count = self.available_swords.read();\n" +" self.available_swords.write(sword_count - 1);\n" +" // Mint a sword to the caller.\n" +" self.sword.write(sender, 1);\n" +" // Crucially, remove the sender from the whitelist before the external call.\n" +" self.whitelisted.write(sender, false);\n" +" // Only then, make the callback to the sender.\n" +" let callback = ICallerDispatcher { contract_address: sender }.on_receive_sword();\n" +"}\n" +"```" #: src/ch02-14-security-considerations.md:148 msgid "Adhering to this pattern enhances the security of your smart contract by minimizing the risk of reentrancy attacks and preserving the integrity of its internal state." -msgstr "" +msgstr "Cumplir con este patrón mejora la seguridad de su smart contract al minimizar el riesgo de ataques de reentrada y preservar la integridad de su estado interno." #: src/ch02-14-security-considerations.md:150 msgid "## 3. Tx.Origin Authentication" -msgstr "" +msgstr "## 3. Autenticación de Origen de Tx" #: src/ch02-14-security-considerations.md:152 msgid "" "In Solidity, `tx.origin` is a global variable that stores the address of the transaction initiator, while `msg.sender` stores the address of the transaction caller. In Cairo, we have the " "`account_contract_address` global variable and `get_caller_address` function, which serve the same purpose." msgstr "" +"En Solidity, `tx.origin` es una variable global que almacena la dirección del iniciador de la transacción, mientras que `msg.sender` almacena la dirección de quien llama a la transacción. En Cairo, " +"tenemos la variable global `account_contract_address` y la función `get_caller_address`, que tienen el mismo propósito." #: src/ch02-14-security-considerations.md:154 msgid "" "Using `account_contract_address` (the equivalent of `tx.origin`) for authentication in your smart contract functions can lead to phishing attacks. Attackers can create custom smart contracts and " "trick users into placing them as intermediaries in a transaction call, effectively impersonating the contract owner." msgstr "" +"El uso de `account_contract_address` (el equivalente de `tx.origin`) para la autenticación en las funciones de su smart contract puede provocar ataques de phishing. Los atacantes pueden crear smart " +"contract personalizados y engañar a los usuarios para que los coloquen como intermediarios en una llamada de transacción, haciéndose pasar por el propietario del contrato." #: src/ch02-14-security-considerations.md:156 msgid "For example, consider a Cairo smart contract that allows transferring funds to the owner and uses `account_contract_address` for authentication:" -msgstr "" +msgstr "Por ejemplo, considere un smart contract de Cairo que permite transferir fondos al propietario y utiliza `account_contract_address` para la autenticación:" #: src/ch02-14-security-considerations.md:158 msgid "" @@ -12890,10 +14001,37 @@ msgid "" "}\n" "```" msgstr "" +"```rust\n" +"use starknet::get_caller_address;\n" +"use box::BoxTrait;\n" +"\n" +"struct Storage {\n" +" owner: ContractAddress, // Stores the owner's address.\n" +"}\n" +"\n" +"#[constructor]\n" +"fn constructor(){\n" +" // Initialize the owner as the contract deployer.\n" +" let contract_deployer = get_caller_address();\n" +" self.owner.write(contract_deployer)\n" +"}\n" +"\n" +"#[external(v0)]\n" +"impl ITokenImpl of IToken {\n" +" fn transferTo(ref self: ContractState, to: ContractAddress, amount: u256) {\n" +" let tx_info = starknet::get_tx_info().unbox();\n" +" let authorizer: ContractAddress = tx_info.account_contract_address;\n" +" // Verifies the transaction initiator as the owner.\n" +" assert(authorizer == self.owner.read());\n" +" // Processes the fund transfer.\n" +" self.balance.write(to + amount);\n" +" }\n" +"}\n" +"```" #: src/ch02-14-security-considerations.md:186 msgid "An attacker can trick the owner into using a malicious contract, allowing the attacker to call the `transferTo` function and impersonate the contract owner:" -msgstr "" +msgstr "Un atacante puede engañar al owner para que utilice un contrato malicioso, permitiéndole llamar a la función `transferTo` y hacerse pasar por el propietario del contrato:" #: src/ch02-14-security-considerations.md:188 msgid "" @@ -12911,10 +14049,23 @@ msgid "" "}\n" "```" msgstr "" +"```rust\n" +"#[starknet::contract]\n" +"mod MaliciousContract {\n" +"...\n" +"...\n" +"#[external(v0)]\n" +"impl IMaliciousContractImpl of IMaliciousContract {\n" +" fn transferTo(ref self: ContractState, to: ContractAddress, amount: u256) {\n" +" // Malicious callback to transfer funds.\n" +" let callback = ICallerDispatcher { contract_address: sender }.transferTo(ATTACKER_ACCOUNT, amount);\n" +" }\n" +"}\n" +"```" #: src/ch02-14-security-considerations.md:204 msgid "To guard against phishing attacks, replace `account_contract_address` (origin) authentication with `get_caller_address` (sender) in the `transferTo` function:" -msgstr "" +msgstr "Para protegerse contra ataques de phishing, reemplace la autenticación `account_contract_address` (origen) con `get_caller_address` (remitente) en la función `transferTo`:" #: src/ch02-14-security-considerations.md:206 msgid "" @@ -12944,22 +14095,47 @@ msgid "" "}\n" "```" msgstr "" +"```rust\n" +"use starknet::get_caller_address;\n" +"\n" +"struct Storage {\n" +" owner: ContractAddress, // Stores the owner's address.\n" +"}\n" +"\n" +"#[constructor]\n" +"fn constructor(){\n" +" // Initialize the owner as the contract deployer.\n" +" let contract_deployer = get_caller_address();\n" +" self.owner.write(contract_deployer)\n" +"}\n" +"\n" +"#[external(v0)]\n" +"impl ITokenImpl of IToken {\n" +" fn transferTo(ref self: ContractState, to: ContractAddress, amount: u256) {\n" +" let authorizer = get_caller_address();\n" +" // Verify that the caller is the owner.\n" +" assert(authorizer == self.owner.read());\n" +" // Execute the fund transfer.\n" +" self.balance.write(to + amount);\n" +" }\n" +"}\n" +"```" #: src/ch02-14-security-considerations.md:232 msgid "This change ensures secure authentication, preventing unauthorized users from executing critical functions and safeguarding against phishing attempts." -msgstr "" +msgstr "Este cambio garantiza una autenticación segura, evitando que usuarios no autorizados ejecuten funciones críticas y protegiendo contra intentos de phishing." #: src/ch02-14-security-considerations.md:234 msgid "## 4. Handling Overflow and Underflow in Smart Contracts" -msgstr "" +msgstr "## 4. Manejo de Overflow y Underflow en Smart Contracts" #: src/ch02-14-security-considerations.md:236 msgid "Overflow and underflow vulnerabilities arise from assigning values too large (overflow) or too small (underflow) for a specific data type." -msgstr "" +msgstr "Las vulnerabilidades de overflow y underflow surgen al asignar valores demasiado grandes (overflow) o demasiado pequeños (underflow) para un tipo de datos específico." #: src/ch02-14-security-considerations.md:238 msgid "Consider the `felt252` data type: adding or subtracting values beyond its range can yield incorrect results:" -msgstr "" +msgstr "Considere el tipo de datos `felt252`: sumar o restar valores más allá de su rango puede generar resultados incorrectos:" #: src/ch02-14-security-considerations.md:240 msgid "" @@ -12980,23 +14156,38 @@ msgid "" " }\n" "```" msgstr "" +"```rust\n" +" fn overflow_felt252() -> felt252 {\n" +" // Assigns the maximum felt252 value: 2^251 + 17 * 2^192\n" +" let max: felt252 = 3618502788666131106986593281521497120414687020801267626233049500247285301248 + 17 * 6277101735386680763835789423207666416102355444464034512896;\n" +" // Attempting to add beyond the maximum value.\n" +" max + 3\n" +" }\n" +"\n" +" fn underflow_felt252() -> felt252 {\n" +" let min: felt252 = 0;\n" +" // Same maximum value as in overflow.\n" +" let subtract = (3618502788666131106986593281521497120414687020801267626233049500247285301248 + 17 * 6277101735386680763835789423207666416102355444464034512896);\n" +" // Subtracting more than the minimum, leading to underflow.\n" +" min - subtract\n" +" }\n" +"```" #: src/ch02-14-security-considerations.md:257 msgid "Executing these functions will result in incorrect values due to overflow and underflow, as illustrated in the following image:" -msgstr "" +msgstr "La ejecución de estas funciones dará como resultado valores incorrectos debido a desbordamiento y desbordamiento insuficiente, como se ilustra en la siguiente imagen:" #: src/ch02-14-security-considerations.md:259 -#, fuzzy msgid "\"felt252\"" -msgstr "\"Wallets\"" +msgstr "\"felt252\"" #: src/ch02-14-security-considerations.md:263 msgid "To prevent incorrect results, use protected data types like `u128` or `u256`, which are designed to manage overflows and underflows." -msgstr "" +msgstr "Para evitar resultados incorrectos, utilice tipos de datos protegidos como `u128` o `u256`, que están diseñados para gestionar overflows y underflows." #: src/ch02-14-security-considerations.md:265 msgid "Here's how you can use the `u256` data type to handle these issues:" -msgstr "" +msgstr "A continuación se explica cómo puede utilizar el tipo de datos `u256` para solucionar estos problemas:" #: src/ch02-14-security-considerations.md:267 msgid "" @@ -13015,34 +14206,48 @@ msgid "" " }\n" "```" msgstr "" +"```rust\n" +" fn overflow_u256() -> u256 {\n" +" let max_u128: u128 = 0xffffffffffffffffffffffffffffffff_u128; // Maximum u128 value.\n" +" let max: u256 = u256 { low: max_u128, high: max_u128 }; // Maximum u256 value.\n" +" let three: u256 = u256 { low: 3_u128, high: 0_u128 }; // Value of 3.\n" +" max + three // Attempting to add beyond max, will trigger overflow protection.\n" +" }\n" +"\n" +" fn underflow_u256() -> u256 {\n" +" let min: u256 = u256 { low: 0_u128, high: 0_u128 }; // Zero value for u256.\n" +" let three: u256 = u256 { low: 3_u128, high: 0_u128 }; // Value of 3.\n" +" min - three // Attempting to subtract from zero, will trigger underflow protection.\n" +" }\n" +"```" #: src/ch02-14-security-considerations.md:282 msgid "When these functions encounter overflows or underflows, the transaction will revert, as shown in these images:" -msgstr "" +msgstr "Cuando estas funciones encuentran overflows o underflows, la transacción se revertirá, como se muestra en estas imágenes:" #: src/ch02-14-security-considerations.md:284 -#, fuzzy msgid "" "\"u256\"\n" "\"u256\"" msgstr "" -"\"Vercel\n" -"\n" -"\"Vercel" +"\"u256\"\n" +"\"u256\"" #: src/ch02-14-security-considerations.md:287 msgid "Failure reasons for `u256`:" -msgstr "" +msgstr "Razones de falla para `u256`:" #: src/ch02-14-security-considerations.md:289 msgid "" "- Overflow: `0x753235365f616464204f766572666c6f77=u256_add Overflow`\n" "- Underflow: `0x753235365f737562204f766572666c6f77=u256_sub Overflow`" msgstr "" +"- Overflow: `0x753235365f616464204f766572666c6f77=u256_add Overflow`\n" +"- Underflow: `0x753235365f737562204f766572666c6f77=u256_sub Overflow`" #: src/ch02-14-security-considerations.md:292 msgid "Similarly, the `u128` data type can be used to handle overflow and underflow:" -msgstr "" +msgstr "De manera similar, el tipo de datos `u128` se puede utilizar para manejar el overflow y el underflow:" #: src/ch02-14-security-considerations.md:294 msgid "" @@ -13058,44 +14263,57 @@ msgid "" " }\n" "```" msgstr "" +"```rust\n" +" fn overflow_u128() -> u128 {\n" +" let max: u128 = 0xffffffffffffffffffffffffffffffff_u128; // Maximum u128 value.\n" +" max + 3_u128 // Adding to max, overflow protection triggers if necessary.\n" +" }\n" +"\n" +" fn underflow_u128() -> u128 {\n" +" let min: u128 = 0_u128; // Zero value for u128.\n" +" min - 3_u128 // Subtracting from zero, underflow protection activates if needed.\n" +" }\n" +"```" #: src/ch02-14-security-considerations.md:306 msgid "Overflow or underflow in u128 will similarly revert the transaction, with corresponding failure reasons:" -msgstr "" +msgstr "El overflow o underflow en u128 revertirá de manera similar la transacción, con las correspondientes razones de falla:" #: src/ch02-14-security-considerations.md:308 -#, fuzzy msgid "" "\"u128\"\n" "\"u128\"" msgstr "" -"\"Vercel\n" -"\n" -"\"Vercel" +"\"u128\"\n" +"\"u128\"" #: src/ch02-14-security-considerations.md:311 msgid "Failure reasons for u128:" -msgstr "" +msgstr "Razones del fracaso del u128:" #: src/ch02-14-security-considerations.md:313 msgid "" "- Overflow: `0x753132385f616464204f766572666c6f77=u128_add Overflow`\n" "- Underflow: `0x753132385f737562204f766572666c6f77=u128_sub Overflow`" msgstr "" +"- Overflow: `0x753132385f616464204f766572666c6f77=u128_add Overflow`\n" +"- Underflow: `0x753132385f737562204f766572666c6f77=u128_sub Overflow`" #: src/ch02-14-security-considerations.md:316 msgid "Using these data types, you can ensure safer arithmetic operations in your smart contracts, avoiding unintended consequences of overflows and underflows." -msgstr "" +msgstr "Al utilizar estos tipos de datos, puede garantizar operaciones aritméticas más seguras en sus smart contracts, evitando consecuencias no deseadas de desbordamientos y desbordamientos." #: src/ch02-14-security-considerations.md:318 msgid "## 5. Private Data On-Chain." -msgstr "" +msgstr "## 5. Datos Privados On-Chain." #: src/ch02-14-security-considerations.md:320 msgid "" "Storing secret values in smart contracts presents a challenge because all on-chain data is publicly accessible, even if the code isn't published. For example, consider a smart contract storing a " "password (12345678) using a constructor parameter:" msgstr "" +"Almacenar valores secretos en smart contracts presenta un desafío porque todos los datos en on-chain son accesibles públicamente, incluso si el código no está publicado. Por ejemplo, considere un " +"contrato inteligente que almacena una contraseña (12345678) usando un parámetro de constructor:" #: src/ch02-14-security-considerations.md:322 msgid "" @@ -13114,16 +14332,31 @@ msgid "" "}\n" "```" msgstr "" +"```rust\n" +"#[starknet::contract]\n" +"mod StoreSecretPassword {\n" +" struct Storage {\n" +" password: felt252, // Field to store the password.\n" +" }\n" +"\n" +" #[constructor]\n" +" fn constructor(_password: felt252) {\n" +" // Writing the password to the storage.\n" +" self.password.write(_password);\n" +" }\n" +"}\n" +"```" #: src/ch02-14-security-considerations.md:337 -#, fuzzy msgid "\"deploy\"" -msgstr "\"Vercel" +msgstr "\"deploy\"" #: src/ch02-14-security-considerations.md:339 msgid "" "However, understanding Cairo's [storage layout](https://book.cairo-lang.org/ch99-01-03-01-contract-storage.html?highlight=kecc#storage-addresses), we can create a script to read the stored variable:" msgstr "" +"Sin embargo, al comprender el [storage de Cairo](https://book.cairo-lang.org/ch99-01-03-01-contract-storage.html?highlight=kecc#storage-addresses), podemos crear un script para leer la variable " +"almacenada:" #: src/ch02-14-security-considerations.md:341 msgid "" @@ -13147,40 +14380,61 @@ msgid "" ");\n" "```" msgstr "" +"```javascript\n" +"import { Provider, hash } from \"starknet\";\n" +"\n" +"const provider = new Provider({\n" +" sequencer: {\n" +" network: \"goerli-alpha\",\n" +" },\n" +"});\n" +"\n" +"var passHash = hash.starknetKeccak(\"password\");\n" +"console.log(\n" +" \"getStor=\",\n" +" await provider.getStorageAt(\n" +" \"0x032d0392eae7440063ea0f3f50a75dbe664aaa1df76b4662223430851a113369\",\n" +" passHash,\n" +" 812512,\n" +" ),\n" +");\n" +"```" #: src/ch02-14-security-considerations.md:361 msgid "Executing this script reveals the stored password value (hex value of 12345678):" -msgstr "" +msgstr "La ejecución de este script revela el valor de la contraseña almacenada (valor hexadecimal de 12345678):" #: src/ch02-14-security-considerations.md:363 -#, fuzzy msgid "\"get_storage\"" -msgstr "\"homepage\"" +msgstr "\"get_storage\"" #: src/ch02-14-security-considerations.md:365 msgid "Moreover, using a block explorer, we can view the deployed parameters in the transaction:" -msgstr "" +msgstr "Además, utilizando un explorador de bloques, podemos ver los parámetros implementados en la transacción:" #: src/ch02-14-security-considerations.md:367 -#, fuzzy msgid "\"block" -msgstr "\"homepage\"" +msgstr "\"block" #: src/ch02-14-security-considerations.md:371 msgid "" "If your smart contract requires storing private data on-chain, consider off-chain encryption before sending data to the blockchain. Alternatively, explore options like hashes, merkle trees, or " "commit-reveal patterns to maintain data privacy." msgstr "" +"Si su smart contract requiere almacenar datos privados en la cadena, considere el cifrado fuera de la cadena antes de enviar datos a la cadena de bloques. Alternativamente, explore opciones como " +"hashes, árboles merkle o patrones de confirmación y revelación para mantener la privacidad de los datos." #: src/ch02-14-security-considerations.md:373 msgid "## Call for Contributions: Additional Vulnerabilities" -msgstr "" +msgstr "## Convocatoria de Contribuciones: Vulnerabilidades Adicionales" #: src/ch02-14-security-considerations.md:375 msgid "" "We've discussed several common vulnerabilities in Cairo smart contracts, but many other security risks need attention. We invite community contributions to expand this chapter with more " "vulnerabilities:" msgstr "" +"Hemos discutido varias vulnerabilidades comunes en los smart contracts de Cairo, pero muchos otros riesgos de seguridad requieren atención. Invitamos a la comunidad a contribuir para ampliar este " +"capítulo con más vulnerabilidades:" #: src/ch02-14-security-considerations.md:377 msgid "" @@ -13192,16 +14446,25 @@ msgid "" "- Untrusted Delegate Calls\n" "- Public Burn" msgstr "" +"- Storage Collision\n" +"- Flash Loan Attacks\n" +"- Oracle Manipulation\n" +"- Bad Randomness\n" +"- Denial of Service\n" +"- Untrusted Delegate Calls\n" +"- Public Burn" #: src/ch02-14-security-considerations.md:385 msgid "" "If you have expertise in these areas, please consider contributing your knowledge, including explanations and examples of these vulnerabilities. Your input will greatly benefit the Starknet and " "Cairo developer community, aiding in the development of more secure and resilient smart contracts." msgstr "" +"Si tiene experiencia en estas áreas, considere contribuir con sus conocimientos, incluidas explicaciones y ejemplos de estas vulnerabilidades. Su aporte beneficiará enormemente a la comunidad de " +"desarrolladores de Starknet y Cairo, ayudando en el desarrollo de smart contracts más seguros y resistentes." #: src/ch02-14-security-considerations.md:387 msgid "We appreciate your support in enhancing the safety and security of the Starknet ecosystem for developers and users alike." -msgstr "" +msgstr "Agradecemos su apoyo para mejorar la seguridad del ecosistema Starknet tanto para desarrolladores como para usuarios." #: src/ch02-15-security-tools.md:1 #, fuzzy @@ -14500,6 +15763,384 @@ msgid "" "| EC_OP | 10.24 gwei/gas | per application |" msgstr "" +#: src/ch03-01-03-data-availability.md:1 +msgid "# Data Availability" +msgstr "" + +#: src/ch03-01-03-data-availability.md:3 +msgid "Data availability is key in blockchain networks, especially in Layer 2 solutions like Starknet." +msgstr "" + +#: src/ch03-01-03-data-availability.md:5 +msgid "" +"Rollups, acting as a bridge between the Ethereum blockchain and off-chain computation, enable transactions off-chain while maintaining Ethereum's security and asset system. The focus often lies on " +"scaling computation and execution, but it's just part of the challenge. Both computation and data aspects are vital for effective blockchain scaling." +msgstr "" + +#: src/ch03-01-03-data-availability.md:7 +msgid "" +"The growing use of rollups, which facilitate more off-chain execution, intensifies the need for efficient data availability solutions. This demand arises from the necessity to store, access, and " +"verify data from off-chain transactions. Robust data availability solutions are critical for rollup success. Without effective data handling, the scalability and performance advantages of rollups " +"could be significantly undermined." +msgstr "" + +#: src/ch03-01-03-data-availability.md:9 +msgid "" +"Base layer blockchains such as Ethereum are evolving towards becoming Data Availability (DA) layers (more [here](https://www.youtube.com/watch?v=PNPryqrJg3s)). A prime example of this evolution is " +"Celestia. They have spearheaded this movement by developing a Layer 1 blockchain with a DA-centric approach." +msgstr "" + +#: src/ch03-01-03-data-availability.md:11 +msgid "" +"In parallel, Ethereum is undergoing a significant transition. Historically an execution-focused blockchain, Ethereum is now incorporating new Ethereum Improvement Proposals (EIPs) to shift its " +"focus towards DA." +msgstr "" + +#: src/ch03-01-03-data-availability.md:13 +#, fuzzy +msgid "## Data Availability in Starknet" +msgstr "## Mostrando StarkName" + +#: src/ch03-01-03-data-availability.md:15 +msgid "" +"1. **State Transition Process**: In Starknet, as in most blockchain networks, the system transitions from a state $n$ to state $(n+1)$ by executing a series of transactions within a block. In " +"Starknet's case, this is done through the Cairo language.\n" +"\n" +"2. **Accessing Current State Information**: To know the current state $n$ of the network, there are two primary sources:\n" +" - **The Sequencer**: It holds comprehensive details about the network's current state.\n" +" - **Layer 2 Full Nodes**: In Starknet, there are multiple full nodes, such as Juno, Papyrus, and Pathfinder, which users can run on their computers." +msgstr "" + +#: src/ch03-01-03-data-availability.md:21 +msgid "" +"The liveness problem arises from a concern: what happens if both the sequencer and all the full nodes become unresponsive? This could be due to a variety of reasons, such as technical failures or " +"external attacks." +msgstr "" + +#: src/ch03-01-03-data-availability.md:23 +msgid "" +"If for some reason, both the sequencer and the Layer 2 full nodes stop responding, there would be no way to ascertain the current state $n$ of the network. In such a scenario, while transactions " +"could still be received, the network would be unable to transition to state $(n+1)$ due to the lack of information about state $n$. Consequently, the network would essentially become stuck." +msgstr "" + +#: src/ch03-01-03-data-availability.md:25 +msgid "" +"Although this situation is highly unlikely, its potential impact is significant. It would halt the progress of the network, preventing any state transitions and effectively freezing operations." +msgstr "" + +#: src/ch03-01-03-data-availability.md:27 +msgid "## State Diffs" +msgstr "" + +#: src/ch03-01-03-data-availability.md:29 +msgid "" +"Starknet addresses the liveness problem through the transmission of validity proofs and state differences to Layer 1. This process is critical for ensuring that the network remains operational and " +"its state can be verified independently of the sequencer and Layer 2 full nodes." +msgstr "" + +#: src/ch03-01-03-data-availability.md:31 +msgid "" +"1. **Validity Proof to Layer 1**: After computing the validity proof, Starknet sends it to Layer 1, specifically to the Verifier.\n" +"\n" +"2. **State Diff as Cold Data**: Along with the validity proof, Starknet also sends what's known as the 'state diff.' The state diff represents the changes in the Layer 2 state since the last " +"validity proof was sent. This includes updates and modifications made to the network's state." +msgstr "" + +#: src/ch03-01-03-data-availability.md:35 +#, fuzzy +msgid "\"\"" +msgstr "\"Vercel" + +#: src/ch03-01-03-data-availability.md:37 +msgid "" +"The state diff involves a substantial amount of data. To manage this, the data is sent as 'cold data' to Layer 1. It implies that the data isn't directly stored but is made available in a way that " +"requires significant transactional capacity to transfer to Layer 1." +msgstr "" + +#: src/ch03-01-03-data-availability.md:39 +#, fuzzy +msgid "## Data Availability and State Changes in Transactions" +msgstr "## Seguimiento de Transacciones" + +#: src/ch03-01-03-data-availability.md:41 +msgid "" +"**Transmitting Changes, Not Balances**: What Starknet sends to Layer 1 for data availability are the changes in state, not the new balances. This involves capturing how each transaction within a " +"validity proof alters the state." +msgstr "" + +#: src/ch03-01-03-data-availability.md:43 +msgid "" +"1. **Example 1**: Consider a simple scenario with three participants: Jimmy, Rose, and Nick.\n" +"\n" +" - **Transaction Sequence**: Jimmy sends one ETH to Rose, then Rose sends half an ETH to Nick.\n" +" - **State Changes Sent to Layer 1**: The data sent to Layer 1 would reflect that Jimmy has one ETH less, Rose has half an ETH more, and Nick also gains half an ETH.\n" +"\n" +"2. **Example 2**: The net changes are what matter. For instance, if Jimmy and Rose send ETH back and forth, but the end result is Jimmy having half an ETH more and Rose half an ETH less, only these " +"net changes are sent to Layer 1." +msgstr "" + +#: src/ch03-01-03-data-availability.md:50 +#, fuzzy +msgid "\"\"" +msgstr "\"Starknet-js" + +#: src/ch03-01-03-data-availability.md:52 +msgid "This approach means that even with multiple transactions, the actual data sent for availability can be less if the net state changes are minimal." +msgstr "" + +#: src/ch03-01-03-data-availability.md:54 +msgid "" +"In cases where transactions between parties nullify each other (e.g., Rose sends one ETH to Nick, and then Nick sends it back), no change in the state occurs. Consequently, nothing is sent to Layer " +"1 for data availability, making it the cheapest form of transaction." +msgstr "" + +#: src/ch03-01-03-data-availability.md:56 +msgid "" +"Since the cost of sending data to Ethereum as cold data constitutes about 90% of a Layer 2 transaction's cost, reducing the amount of data sent can significantly impact overall transaction costs. " +"Projects on Starknet often use strategies to minimize state changes in their transactions, thereby reducing the data sent to Layer 1 and lowering transaction costs." +msgstr "" + +#: src/ch03-01-03-data-availability.md:58 +#, fuzzy +msgid "## Reducing Data Availability Costs in Starknet" +msgstr "## Declarando Smart Contracts en Starknet" + +#: src/ch03-01-03-data-availability.md:60 +msgid "" +"Two main mechanisms to reduce data availability costs are currently under consideration: the implementation of EIP 4844 and the concept of Volition. Both aim to optimize how data is stored and " +"reduce the associated costs." +msgstr "" + +#: src/ch03-01-03-data-availability.md:62 +msgid "### EIP 4844: Blob Data and Cost Reduction" +msgstr "" + +#: src/ch03-01-03-data-availability.md:64 +msgid "" +"EIP 4844 proposes a change in how data availability information is sent to Layer 1. Instead of using call data, the information would be sent as blobs. This mechanism is expected to be cheaper than " +"the current method used by Starknet for posting data to Ethereum. Consequently, it would make Layer 2 transactions more affordable. A notable downside of this approach is the limited lifespan of " +"blob data. Once posted to Ethereum, this data will only be available for one month before being pruned by Layer 1 nodes." +msgstr "" + +#: src/ch03-01-03-data-availability.md:66 +msgid "Starknet's adoption of this feature depends on its implementation on the Ethereum mainnet. It's anticipated to be incorporated into Starknet by mid-2024, following its activation on Ethereum." +msgstr "" + +#: src/ch03-01-03-data-availability.md:68 +msgid "### Volition: Flexible Data Storage Options" +msgstr "" + +#: src/ch03-01-03-data-availability.md:70 +msgid "" +"Volition introduces the concept of choosing where to store data for transaction liveness. Users can opt to post data either to Ethereum or off-chain alternatives such as a data availability " +"committee, systems like Celestia, or EigenDA. The cost of using Volition varies based on the chosen storage option. Off-chain options are expected to be cheaper than using EIP 4844." +msgstr "" + +#: src/ch03-01-03-data-availability.md:72 +msgid "The timeline for enabling Volition on Starknet is not yet determined, but it's certain to follow the support of EIP 4844." +msgstr "" + +#: src/ch03-01-03-data-availability.md:74 +msgid "" +"While EIP 4844's blob data approach will be beneficial for multiple rollups, Volition offers a unique advantage for Starknet by providing more flexibility in data storage and potentially lowering " +"costs further. The implementation of Volition requires having a virtual machine that is not limited by the adherence to emulate the EVM, so a custom virtual machine like Cairo is required." +msgstr "" + +#: src/ch03-01-03-data-availability.md:76 +#, fuzzy +msgid "## Recreating Starknet's State" +msgstr "## Integrando Starknet React" + +#: src/ch03-01-03-data-availability.md:78 +msgid "This process is a contingency plan for extreme scenarios where the sequencer and Layer 2 full nodes become unavailable." +msgstr "" + +#: src/ch03-01-03-data-availability.md:80 +msgid "" +"1. Starknet, like any blockchain network, started with an empty state and a genesis block. Over time, it has processed multiple blocks, leading to changes in its state.\n" +"\n" +"2. Periodically, Starknet sends a validity proof to Layer 1. This proof attests to the computations of all the blocks processed since the last proof was sent.\n" +"\n" +"3. Along with the validity proof, Starknet sends the state difference. This state difference details the changes from the empty state to the current state, as a result of executing transactions in " +"all these blocks. The state difference is transmitted to Layer 1.\n" +"\n" +"4. As Starknet continues to produce more blocks on Layer 2, the process repeats. At some point, a new validity proof, along with a new set of transactions for data availability and the new state " +"difference, is sent to Layer 1.\n" +"\n" +"5. By applying the state differences in order, as they are sent to Layer 1, it's possible to reconstruct the Layer 2 state. This means that the entire history and current state of Starknet can be " +"pieced together from the data available on Layer 1. This is the role of the Layer 1 indexer." +msgstr "" + +#: src/ch03-01-03-data-availability.md:90 +#, fuzzy +msgid "\"\"" +msgstr "\"Wallets\"" + +#: src/ch03-01-03-data-availability.md:92 +msgid "This process ensures that the network's state is never lost and can always be recovered from Layer 1 data." +msgstr "" + +#: src/ch03-01-03-data-availability.md:94 +#, fuzzy +msgid "## The StarknetOS" +msgstr "# El Libro de Starknet" + +#: src/ch03-01-03-data-availability.md:96 +msgid "" +"The StarknetOS, the last step inside the Sequencer, plays a crucial role in determining why the state diff is the output of the SHARP and how it interacts with the network's state. The StarknetOS " +"is based on Cairo Zero, an older version of the Cairo programming language." +msgstr "" + +#: src/ch03-01-03-data-availability.md:98 +#, fuzzy +msgid "\"\"" +msgstr "\"Wallets\"" + +#: src/ch03-01-03-data-availability.md:100 +msgid "The StarknetOS receives four main inputs:" +msgstr "" + +#: src/ch03-01-03-data-availability.md:102 +msgid "" +"- The current state of the network.\n" +"- New blocks created since the last validity proof was sent to Layer 1. These include declare_account and invoke transactions.\n" +"- Class hashes resulting from declared transactions.\n" +"- Compiled class hashes resulting from declared transactions." +msgstr "" + +#: src/ch03-01-03-data-availability.md:107 +msgid "" +"The StarknetOS takes the current state and processes the new transactions and blocks. It evaluates what changes occur in the state as a result of these transactions. The output from this process " +"includes:" +msgstr "" + +#: src/ch03-01-03-data-availability.md:109 +msgid "" +"- The state diff: Changes in the state.\n" +"- Class hashes of newly declared smart contracts.\n" +"- Compiled class hashes of newly declared smart contracts." +msgstr "" + +#: src/ch03-01-03-data-availability.md:113 +#, fuzzy +msgid "\"\"" +msgstr "\"homepage\"" + +#: src/ch03-01-03-data-availability.md:115 +msgid "" +"The sequencer executes numerous transactions and creates blocks. When enough blocks accumulate, they trigger the creation of a validity proof. These blocks are passed to the StarknetOS to calculate " +"the state diff, class hashes, and compiled class hashes. This is the information that the Prover is tasked with proving. The output from the [Blockchain Writer](https://etherscan.io/" +"address/0x16d5783a96ab20c9157d7933ac236646b29589a4), therefore, includes these three elements: state diff, class hashes, and compiled class hashes. This output is what gets sent to the memory pages " +"smart contract on Ethereum." +msgstr "" + +#: src/ch03-01-03-data-availability.md:117 +msgid "## The Blockchain Writer Module" +msgstr "" + +#: src/ch03-01-03-data-availability.md:119 +msgid "" +"Contrary to a direct interaction between the Prover and the Ethereum Verifier, there's an intermediary process involving SHARP. The Prover in Starknet (currently [the Stone Prover](https://github." +"com/starkware-libs/stone-prover)) is focused solely on proving the execution of a Cairo program. Its role is confined to generating proofs without concerning itself with Ethereum directly. The " +"primary concern of the Prover is to accurately prove the execution of Cairo programs." +msgstr "" + +#: src/ch03-01-03-data-availability.md:121 +msgid "Internally, SHARP utilizes an Externally Owned Account (EOA) specifically for interacting with Ethereum. This account is responsible for conducting transactions on the Ethereum network." +msgstr "" + +#: src/ch03-01-03-data-availability.md:123 +msgid "" +"1. **Handling Validity Proofs and State Diff**: The actual module within SHARP that sends the validity proof and state diff to the memory pages on Ethereum is known as the [Blockchain Writer]" +"(https://etherscan.io/address/0x16d5783a96ab20c9157d7933ac236646b29589a4). This module bridges the gap between the internal workings of Starknet and the Ethereum blockchain.\n" +"\n" +"2. **Direct Interaction with Ethereum**: The output from the Prover is directed to the Blockchain Writer. It is this Blockchain Writer that interacts with Ethereum, sending data to the appropriate " +"location on the Layer 1.\n" +"\n" +"3. **Final Step in Data Transmission**: The Blockchain Writer represents the final step in the process where the proven data from Starknet's internal operations is transmitted to Ethereum for " +"storage and verification." +msgstr "" + +#: src/ch03-01-03-data-availability.md:129 +#, fuzzy +msgid "\"\"" +msgstr "\"Vercel" + +#: src/ch03-01-03-data-availability.md:131 +msgid "" +"This is Ethereum address of the Blockchain Writer, which is by itself an EOA holding resources: [0x16d5783a96ab20c9157d7933ac236646b29589a4](https://etherscan.io/" +"address/0x16d5783a96ab20c9157d7933ac236646b29589a4)." +msgstr "" + +#: src/ch03-01-03-data-availability.md:133 +msgid "" +"The cost for data availability in Starknet, as handled by SHARP, is a direct expense. There isn't any form of subsidy for these costs. SHARP bears the full financial responsibility for the block " +"space required on Ethereum. The lack of subsidy in DA costs directly influences the fees users pay for transactions on Starknet." +msgstr "" + +#: src/ch03-01-03-data-availability.md:135 +msgid "" +"A closer look at the transactions emanating from the [Blockchain Writer](https://etherscan.io/address/0x16d5783a96ab20c9157d7933ac236646b29589a4), which are responsible for DA, reveals substantial " +"costs. SHARP incurs millions of dollars in expenses for block space on Ethereum each month." +msgstr "" + +#: src/ch03-01-03-data-availability.md:137 +msgid "## Data Availability Modes" +msgstr "" + +#: src/ch03-01-03-data-availability.md:139 +msgid "Currently, there are three primary modes, with two already in use and a third on the horizon. These modes are Rollup, Validium, and Volition." +msgstr "" + +#: src/ch03-01-03-data-availability.md:141 +msgid "### 1. Rollup Mode" +msgstr "" + +#: src/ch03-01-03-data-availability.md:143 +msgid "" +"- **Definition and Characteristics**: The data for DA is posted directly on Ethereum. This approach is what classifies a Layer 2 solution as a Rollup.\n" +"- **Advantages**: The primary benefit of Rollup mode is enhanced liveness due to the reliability and track record of Ethereum. It provides robust guarantees about data availability.\n" +"- **Cost Implications**: This mode tends to be more expensive due to the cost associated with posting data on Ethereum. However, future implementations like EIP 4844 may reduce these costs.\n" +"- **Example**: Starknet, which sends data to the memory pages smart contract, is an example of a Rollup." +msgstr "" + +#: src/ch03-01-03-data-availability.md:148 +msgid "### 2. Validium Mode" +msgstr "" + +#: src/ch03-01-03-data-availability.md:150 +msgid "" +"- **Definition and Characteristics**: Characterized by Layer 2 networks not utilizing Ethereum for DA. Instead, data is stored off-chain.\n" +"- **Advantages**: The primary advantage of Validium is cost efficiency. Transactions in Validiums are typically much cheaper than in Rollups.\n" +"- **Liveness Guarantees**: The trade-off for reduced cost is weaker liveness guarantees compared to Ethereum-based DA.\n" +"- **Example**: StarkEx is an example of Validium, known for its significantly lower transaction costs compared to Rollups." +msgstr "" + +#: src/ch03-01-03-data-availability.md:155 +msgid "### 3. Volition Mode (Upcoming)" +msgstr "" + +#: src/ch03-01-03-data-availability.md:157 +msgid "" +"- **Definition and Characteristics**: Volition mode is a hybrid DA mode that combines aspects of both Rollup and Validium. It offers users the choice of where to store data, either on-chain " +"(Ethereum) or off-chain.\n" +"- **User Choice**: The key feature of Volition mode is the flexibility it provides users in deciding their data storage preferences, balancing between cost and liveness guarantees.\n" +"- **Implementation Timeline**: Volition mode is expected to be introduced to networks like Starknet in the near future, potentially within a year or so." +msgstr "" + +#: src/ch03-01-03-data-availability.md:161 +msgid "The following table summarizes the key characteristics of each mode:" +msgstr "" + +#: src/ch03-01-03-data-availability.md:163 +msgid "" +"| Mode | Definition | Advantages | Cost | Example |\n" +"| -------- | --------------------------------------------- | ------------------------------------------- | ------------ | -------- |\n" +"| Rollup | Data posted on Ethereum; a Layer 2 solution. | Reliable, robust data availability. | Higher cost. | Starknet |\n" +"| Validium | Data stored off-chain, not on Ethereum. | Lower transaction costs. | Lower cost. | StarkEx |\n" +"| Volition | Hybrid mode, choice of on-chain or off-chain. | Balance between cost and data availability. | - | - |" +msgstr "" + #: src/ch03-02-sequencers.md:1 msgid "# Sequencers" msgstr "" @@ -22363,6 +24004,25 @@ msgid "" "wallet may be connected but not yet deployed." msgstr "" +#~ msgid "Note: If you don't specify the rpc provider, Starkli will use Goerli, which will be deprecated soon." +#~ msgstr "Nota: Si no especifica el proveedor rpc, Starkli utilizará Goerli, que pronto quedará obsoleto." + +#~ msgid "" +#~ "With the smart contract compiled, we’re ready to declare it using\n" +#~ "Starkli. Then we can set the STARKNET_RPC environment variable to make command invocations easier:" +#~ msgstr "" +#~ "Con el smart contract compilado, estamos listos para declararlo usando\n" +#~ "Starkli. Luego podemos configurar la variable de entorno STARKNET_RPC para facilitar la invocación de comandos:" + +#~ msgid "" +#~ "```bash\n" +#~ " export STARKNET_RPC=\"https://starknet-sepolia.infura.io/v3/\"\n" +#~ "```" +#~ msgstr "" +#~ "```bash\n" +#~ " export STARKNET_RPC=\"https://starknet-sepolia.infura.io/v3/\"\n" +#~ "```" + #, fuzzy #~ msgid "### `is_valid_signature_span` Function" #~ msgstr "### Llamar a una Función de Lectura"