Last active
August 12, 2016 15:01
-
-
Save eddieoz/883d96d1bdaead07116b4b3440dbef91 to your computer and use it in GitHub Desktop.
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
contract Proto_Petition | |
{ | |
Petition[] public pets; | |
uint public numAssinaturas; | |
mapping (bytes32 => uint256) public assinatura; | |
struct Petition{ | |
bytes32 campo1; | |
} | |
event PeticaoAdded(uint peticaoID); | |
function novoRegistro( bytes32 campo1 ) returns (uint peticaoID){ | |
peticaoID = pets.length++; | |
Petition p = pets[peticaoID]; | |
p.campo1 = campo1; | |
numAssinaturas = peticaoID + 1; | |
assinatura[p.campo1] = peticaoID; | |
PeticaoAdded(peticaoID); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment