Skip to content
Snippets Groups Projects
Commit c8527952 authored by Robert Martin-Legene's avatar Robert Martin-Legene
Browse files

Majority actualizado para solc 0.7

parent 225eb8ce
No related branches found
No related tags found
No related merge requests found
source diff could not be displayed: it is too large. Options to address this: view the blob.
// Robert Martin-Legene <robert@nic.ar> // Robert Martin-Legene <robert@nic.ar>
// vim:syntax:filetype=javascript:ai:sm // vim:syntax:filetype=javascript:ai:sm
pragma solidity ^0.5; // SPDX-License-Identifier: GPL-2.0-or-later
// Copyright 2020 de la Direccion General de Sistemas Informaticos - Secretaria Legal y Tecnica - Nacion - Argentina.
//
// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/
pragma solidity >0.7.0;
// This contract is supposed to maintain a list of accounts authorized // This contract is supposed to maintain a list of accounts authorized
// to control members of "the club" using a majority (n/1+1). We call // to control members of "the club" using a majority (n/1+1). We call
...@@ -27,7 +37,7 @@ contract Majority { ...@@ -27,7 +37,7 @@ contract Majority {
event voteCast( address voter, address victim, bool promotion ); event voteCast( address voter, address victim, bool promotion );
event adminChange( address admin, bool promotion ); event adminChange( address admin, bool promotion );
constructor( uint timeout ) public constructor( uint timeout )
{ {
if ( timeout >= 3600 ) if ( timeout >= 3600 )
votetimeout = timeout; votetimeout = timeout;
...@@ -70,7 +80,7 @@ contract Majority { ...@@ -70,7 +80,7 @@ contract Majority {
while ( ++idx < max ) while ( ++idx < max )
votes[idx-1] = votes[idx]; votes[idx-1] = votes[idx];
// "pop" the end of the list, making the list shorter. // "pop" the end of the list, making the list shorter.
votes.length--; votes.pop();
} }
function _remove_council_member( address exmember ) private function _remove_council_member( address exmember ) private
...@@ -92,7 +102,7 @@ contract Majority { ...@@ -92,7 +102,7 @@ contract Majority {
while ( ++idx < max ) while ( ++idx < max )
council[idx-1] = council[idx]; council[idx-1] = council[idx];
// "pop" the end of the list, making the list shorter. // "pop" the end of the list, making the list shorter.
council.length--; council.pop();
return; return;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment