This file contains 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 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 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 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 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 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()); |
This file contains 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; | |
contract RefriToken { | |
uint public id_da_latinha = 4321; // identificador da latinha | |
address public dono = msg.sender; // dono inicial da latinha é quem cria o contrato | |
uint public quantos_ml = 310; // volume de liquido na latinha quantos_ml | |
function comprar() public payable { |
This file contains 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; | |
contract RefriToken { | |
// identificador da latinha | |
uint latinha = 4321; | |
// dono inicial da latinha é quem cria o contrato | |
address public dono = msg.sender; |
NewerOlder