pragma solidity ^0.4.11; contract ListGestion{ event OnCreateListB(address _from, uint256 _value); event OnCreateListN(address _from, uint256 _value); event OnSupprimer(address _from,uint256 _value); struct List { string ip; } uint numListB; uint numListN; List[] public ListBlanches; List[] public ListNoirs; //mapping (uint => ListBlanche) listBlanches; //function createList function AjouterListB(string _ip) public returns(uint listID) { listID=numListB++; ListBlanches.push( List({ ip:_ip }) ); OnCreateListB(msg.sender,listID); } //function retourner IP function GetIpB(uint id) public constant returns(string){ return ListBlanches[id].ip; } }
0.4.18