This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "pruebas/app.sol": { | |
| "__sources__": { | |
| "pruebas/app.sol": { | |
| "content": "// SPDX-License-Identifier: MIT\r\n\r\npragma solidity 0.8.35;\r\n\r\ncontract Transferencia {\r\n\r\n address public administrador;\r\n mapping(address => uint) public balances;\r\n\r\n constructor() payable {\r\n require(msg.value > 1 wei, \"Debes enviar al menos 1 wei\");\r\n administrador = msg.sender;\r\n balances[msg.sender] = msg.value;\r\n }\r\n\r\n function depositar() public payable {\r\n balances[msg.sender] += msg.value;\r\n }\r\n\r\n function consultarSaldo() public view returns (uint) {\r\n return balances[msg.sender];\r\n }\r\n\r\n function saldoTotal() public view returns (uint) {\r\n require(msg.sender == administrador, \"Solo el administrador puede ver el saldo total\");\r\n return address(this).balance;\r\n }\r\n\r\n function retirar(uint monto) public {\r\n require(balances[msg.sender] >= monto, \"No hay fondos |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "pruebas/app.sol": { | |
| "__sources__": { | |
| "pruebas/app.sol": { | |
| "content": "// SPDX-License-Identifier: MIT\r\n\r\npragma solidity 0.8.35;\r\n\r\ncontract Transferencia {\r\n\r\n address public administrador;\r\n mapping(address => uint) public balances;\r\n\r\n constructor() payable {\r\n require(msg.value > 1 wei, \"Debes enviar al menos 1 wei\");\r\n administrador = msg.sender;\r\n balances[msg.sender] = msg.value;\r\n }\r\n\r\n function depositar() public payable {\r\n balances[msg.sender] += msg.value;\r\n }\r\n\r\n function consultarSaldo() public view returns (uint) {\r\n return balances[msg.sender];\r\n }\r\n\r\n function saldoTotal() public view returns (uint) {\r\n require(msg.sender == administrador, \"Solo el administrador puede ver el saldo total\");\r\n return address(this).balance;\r\n }\r\n\r\n function retirar(uint monto) public {\r\n require(balances[msg.sender] >= monto, \"No hay fondos |