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
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity >=0.8.2 <0.9.0; | |
| contract RefriToken { | |
| uint public numeroDeLatas; | |
| uint public precoDaLata; // em wei | |
| address public donoDaMaquina; |
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
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| # Setup local para macOS conforme as instruções fornecidas: | |
| # 1. Verifica/instala Homebrew | |
| # 2. Desinstala OpenCode anterior + backup para ~/.Trash | |
| # 3. Instala OpenCode | |
| # 4. Configura OpenCode | |
| # 5. Verifica se Xcode Beta está instalado |
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
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.20; | |
| /// @title ServiceEscrow - Exemplo didático de escrow para prestação de serviços | |
| /// @notice Contrato simples: buyer deposita; se aceitar no prazo, paga seller; se prazo expirar sem aceite, reembolsa buyer. | |
| contract ServiceEscrow { | |
| enum State { Created, Funded, Completed, Refunded } | |
| address public buyer; // Contratante | |
| address payable public seller; // Prestadora |
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
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity >=0.8.2 <0.9.0; | |
| contract Carro { | |
| address payable public dono_atual; | |
| uint256 public renavam; | |
| uint256 public valor; |
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
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity >=0.8.2 <0.9.0; | |
| contract ArmazenarAcoes { | |
| mapping (address => uint) acoes; | |
| address public proprietario; | |
| constructor() { |
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
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity >=0.8.2 <0.9.0; | |
| contract RedeSocial { | |
| string perfil; | |
| address dono; | |
| function guardar(string calldata _perfil, address _dono) public { |
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
| // SPDX-License-Identifier: MIT | |
| // Compatible with OpenZeppelin Contracts ^5.0.0 | |
| pragma solidity ^0.8.20; | |
| import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
| import "@openzeppelin/contracts/access/Ownable.sol"; | |
| contract RefriToken is ERC20, Ownable { | |
| constructor(address initialOwner) | |
| ERC20("RefriToken", "RTK") |
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
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.20; | |
| contract RefriToken { | |
| // dono do contrato | |
| address public donoDoContrato = msg.sender; | |
| // unidades (ether, data/hora, etc.) | |
| // https://docs.soliditylang.org/en/latest/units-and-global-variables.html | |
| uint public precoBase = 0.001 ether; |
NewerOlder