Created
June 26, 2018 01:03
-
-
Save danielmme/778a5adc2e36f0a83215e89640d883a2 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
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
| pragma solidity ^0.4.18; | |
| contract ContratoQualquer { | |
| // variável qualquer | |
| string public valor; | |
| // função qualquer | |
| function alterarValor(string novoValor) public { | |
| valor = novoValor; | |
| } | |
| } |
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
| pragma solidity ^0.4.18; | |
| contract NomeDoContrato { | |
| // [tipo] [visibilidade] [nome] = [valor] [opcional] | |
| uint public idade = 10; | |
| string public nomeJogador = "Neymar Jr"; | |
| uint public numeroCamisa = 10; | |
| string public selecao = "Brasil"; | |
| address public dono; | |
| function alterarDono(address novoDono) public returns(address){ | |
| require(dono == msg.sender, 'somente o dono pode alterar o novoDono'); | |
| dono = novoDono; | |
| return novoDono; | |
| } | |
| constructor(string _nomeJogador, uint _numeroCamisa, string _selecao) public { | |
| nomeJogador = _nomeJogador; | |
| numeroCamisa = _numeroCamisa; | |
| selecao = _selecao; | |
| dono = msg.sender; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment