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; |
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 { | |
| // o que vamos guardar? | |
| address public dono; | |
| uint public codigoDeBarras; | |
| string public sabor; | |
| string public marca; | |
| uint public preco; |
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@5.0.2/token/ERC20/ERC20.sol"; | |
| import "@openzeppelin/contracts@5.0.2/token/ERC20/extensions/ERC20Permit.sol"; | |
| contract RefriToken is ERC20, ERC20Permit { | |
| constructor() ERC20("RefriToken", "RFT") ERC20Permit("RefriToken") { | |
| _mint(msg.sender, 12 * 10 ** decimals()); |
NewerOlder