Skip to content

Instantly share code, notes, and snippets.

@kimagure44
Last active January 18, 2019 18:40
Show Gist options
  • Save kimagure44/3ad5b97bb33c3f12994f9c420519df35 to your computer and use it in GitHub Desktop.
Save kimagure44/3ad5b97bb33c3f12994f9c420519df35 to your computer and use it in GitHub Desktop.
// Versión
pragma solidity ^0.4.0;
// Definición de contrato
contract HolaMundoProtectProfesional {
string saludo = "Hola mundo";
address propietario;
function HolaMundoProtectProfesional() {
propietario = msg.sender;
}
modifier propietarioContrato {
if (propietario != msg.sender) {
throw;
} else {
_;
}
}
function getSaludo() constant returns(string) {
return saludo;
}
function setSaludo(string nuevoSaludo) propietarioContrato returns(string){
saludo = nuevoSaludo;
return "Se ha cambiado el contenido correctamente";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment