P&R expertos
Consulta a los expertos de la comunidad de Cyfrin Updraft
Publicaciones
189- P&R expertosJan 04, 2025
Prueba de solidez en fundición
¿Qué puede estar mal en mi código? function testFundUpdatesFundedDataStructure() public { fundMe.fund{value: 10e18}(); uint256 amountFunded = fundMe.getAddressToAmountFunded(address(this)); assertEq(amountFunded, 10e18); } recibiendo este error: [14658] FundMeTest: :testFundUpdatesFundedDataStructure () ├─ [2658] FundMe: :fund {valor: 1000000000000000000} () │ ├─ [0] 0x00000000000000000000000000000000: :latestRoundData () [llamada estática] │ │ ─ ← [Detener] │ ─ ← [Revertir] evmError: Revertir ─ ← [Revertir] evmError: Revertir
- Cyfrin Updraft
- Foundry
- Solidity
13 - P&R expertosDec 19, 2024
Instalación de Zksync Foundry
parece que la instalación de zksync foundry ya no está en el repositorio de github, intenté escribir la línea de comando en mi terminal «permiso denegado, no se pudo leer desde el repositorio remoto»
- Cyfrin Updraft
- Foundry
- Solidity
12 - P&R expertosDec 14, 2024
Configuración de SimpleStorage Deployer
¿Por qué me sigue apareciendo este error cuando intento implementar mi código en VS Code? Pregunté a AI y sigue igual. Este es el error: [] Compilando... [] Compilando 14 archivos con Solc 0.8.18 [] Solc 0.8.18 finalizó en 149,20 ms Error: no se pudo ejecutar el compilador: Error (2314): se esperaba un ';' pero se obtuvo el identificador --> Script/DeploySimpleStorage.s.sol: 11:9: | 11 | vm.stopBroadcast (); | ^^ Y aquí está mi código. solidity «' //Identificador de licencia SPDX: MIT pragma solidity ^0.8.18; importar {Script} desde «Forge-std/Script.sol»; importar {SimpleStorage} desde «.. /src/SimpleStorage.sol «; contract DeploySimpleStorage es Script { function run () retornos externos (SimpleStorage) { vm.startBroadcast (); SimpleStorage SimpleStorage = nuevo SimpleStorage (); vm.stopBroadcast (); devuelve SimpleStorage; } } «'
- Cyfrin Updraft
- Foundry
- Solidity
11 - P&R expertosDec 12, 2024
Setting Foundry
Al intentar configurar mi Foundry después de la instalación con el comando «forge init», aparece este error: Error: error al confirmar (code=some (128), stdout= "», stderr="Identidad del autor desconocida\n\n*Por favor, dime quién eres. \n\nEjecuta\n\ngit config --global user.email\» you@example.com\»\ngit config --global user.name\ "Tu nombre\»\n\npara establecer la identidad predeterminada de tu cuenta. \nOmite --global para establecer la identidad solo en este repositorio. \n\nfatal: no se puede detectar automáticamente la dirección de correo electrónico (tengo 'user @MACs -MBP. (ninguno) ')») Aunque pude obtener toda la carpeta que necesitaba, excepto «lib» y «.gitmodules», espero que esto no me afecte en el futuro. Y también intento usar el «forge init --force», que sigue siendo el mismo
- Cyfrin Updraft
- Foundry
- Solidity
12 - P&R expertosMar 29, 2024
What are the recommended protocols for smart contract audit?
I am looking to conduct a smart contract audit and would like to know the best protocols to follow. Can anyone suggest a wide range of protocols that are commonly used in competitive audits? Any insights or recommendations would be greatly appreciated. Thank you.
- Foundry
- Security
- Blockchain
01Respuesta Oficial - P&R expertosMar 29, 2024
Error `make deploy` in VS Code - `bash: make: command not found`
I am encountering an issue while trying to deploy using make deploy in VS Code with Foundry and Anvil. Despite Anvil launching properly without any errors, when I attempt to deploy using the command make deploy, I consistently receive the error message bash: make: command not found. Has anyone faced a similar problem or can provide guidance on resolving this issue? Any assistance would be greatly valued as I have been unable to progress since yesterday. Thank you.
- Foundry
01Respuesta Oficial - P&R expertosMar 29, 2024
Which function selector and input data should be used in solveChallenge?
I am working on the solveChallenge function which requires a function selector and input data to be passed. I am unsure about which function I should get the function selector for, and what the input data should be that needs to be turned into bytes. Any guidance on this would be greatly appreciated. Thank you in advance for your help. function solveChallenge(bytes4 selectorOne, bytes memory inputData, string memory yourTwitterHandle) external { (bool successOne, bytes memory responseDataOne) = i_helperContract.call(abi.encodeWithSelector(selectorOne)); if (!successOne || uint256(bytes32((responseDataOne))) != 1) { revert S1__WrongSelector(); } (bool successTwo, bytes memory responseDataTwo) = i_helperContract.call(inputData); if (!successTwo || uint256(bytes32((responseDataTwo))) != 1) { revert S1__WrongData(); } _updateAndRewardSolver(yourTwitterHandle); } I am motivated to understand how to find the solution, not just for obtaining the NFT. Thank you for your assistance.
- Transaction
- Solidity
- Smart Contract
01Respuesta Oficial - P&R expertosMar 29, 2024
How to Report Multiple Instances of an Attack Vector in Base Code?
I have encountered the same attack vector multiple times in a base code. Should I include each instance separately in my report or consolidate them into a single entry? For instance, if I identify a Denial of Service (DOS) attack in three different functions, should I classify these findings as three distinct high-severity issues in my report, or combine them into a single report entry for efficiency and clarity? Any insights on the best approach for reporting such repeated vulnerabilities would be greatly appreciated. Thank you.
- Security
01Respuesta Oficial - P&R expertosMar 29, 2024
Seeking Small LaTeX Package for Linux Installation
I attempted to install LaTeX on my Linux machine using sudo apt-get install texlive-full, which consumed over 7 GB of storage, causing my 120 GB SSD system to run out of space. As a result, I had to remove it. Could someone provide a link to a smaller LaTeX package (less than 1 GB) that is sufficient for my needs? Any guidance or recommendations would be greatly appreciated. Thank you.
- Foundry
- Course
01Respuesta Oficial - P&R expertosMar 29, 2024
Does mitigation of DoS in Section 4 Lesson 15 work correctly?
I am currently working on Section 4 Lesson 15 and addressing the PuppyRaffle::enterRaffle function. I have identified a potential issue with the second recommended mitigation of DoS. function enterRaffle(address[] memory newPlayers) public payable { require(msg.value == entranceFee * newPlayers.length, 'PuppyRaffle: Must send enough to enter raffle'); for (uint256 i = 0; i < newPlayers.length; i++) { players.push(newPlayers[i]); addressToRaffleId[newPlayers[i]] = raffleId; } for (uint256 i = 0; i < newPlayers.length ; i++) { require(addressToRaffleId[newPlayers[i]] != raffleId, 'PuppyRaffle: Duplicate player'); } } The concern is that the duplicate check in the function will always fail due to the way addressToRaffleId[newPlayers[i]] is being set to raffleId for each new player. This results in the condition addressToRaffleId[newPlayers[i]] != raffleId never being true for new players, rendering the duplicate check ineffective. I would like to confirm if my understanding of this issue is correct. Any insights or feedback on this matter would be greatly appreciated.
- Security
- Solidity
- Smart Contract
01Respuesta Oficial
- 1780
- 75
- 60
- 11
- 10
- 10
- 10
- 10
- 10
- 10
- Solidity
- Smart Contract
- Transaction
- Foundry
- Blockchain
- Gas
- Security
- Cyfrin Updraft
- Course
- erc20