Skip to content

Commit

Permalink
quick-fix-keccack256
Browse files Browse the repository at this point in the history
quick-fix-keccack256
  • Loading branch information
andreipope committed Mar 8, 2019
1 parent 2184cb2 commit a50f03b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion es/2/4-require.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function sayHiToVitalik(string _name) public returns (string) {
// Compara si _name es igual a "Vitalik". Lanza un error si no lo son.
// (Nota: Solidity no tiene su propio comparador de strings, por lo que
// compararemos sus hashes keccak256 para ver si sus strings son iguales)
require(keccak256(_name)== keccak256("Vitalik"));
require(keccak256(abi.encodePacked(_name)) == keccak256(abi.encodePacked("Vitalik")));
// Si es verdad, continuamos con la función:
return "Hi!";
}
Expand Down

0 comments on commit a50f03b

Please sign in to comment.