Skip to content

Instantly share code, notes, and snippets.

View rpaskin's full-sized avatar

Ronnie Paskin rpaskin

  • Rio de Janeiro, Brazil
  • 05:11 (UTC -03:00)
  • LinkedIn in/rpaskin
View GitHub Profile
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.2 <0.9.0;
contract ArmazenarAcoes {
mapping (address => uint) acoes;
address public proprietario;
constructor() {
@rpaskin
rpaskin / RedeSocial2.sol
Created July 29, 2024 18:17
RedeSocial2 de introduçao a contratos inteligents
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.2 <0.9.0;
contract RedeSocial {
string public perfil;
address private dono;
function guardar(string calldata _perfil, address _dono) public {
// 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 {
// 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 {
// 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")
// 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;
// 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;
@rpaskin
rpaskin / RefriTokenOZ.sol
Created April 25, 2024 19:31
Contrato Inteligente de Token de Refrigerante usando OpenZeppelin (com limitação de transferência)
// 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());
@rpaskin
rpaskin / refritoken.sol
Created April 1, 2024 00:27
M2A5 Código solidity para um "NFT" de uma latinha de refrigerante
// 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 {
@rpaskin
rpaskin / refritoken.sol
Created March 24, 2024 20:42
Um token muito muito simples em Solidity
// 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;