-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/audit results #68
Changes from all commits
2014022
6244491
e211ac9
c107b87
495af62
c81b88d
0a2eecd
00e639c
c210c24
b956442
753ffd5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
/** | ||
* @authors: [@unknownunknown1*, @clesaege] | ||
* @reviewers: [] | ||
* @auditors: [] | ||
* @bounties: [] | ||
* @deployments: [] | ||
* @tools: [] | ||
*/ | ||
|
||
pragma solidity 0.8.20; | ||
|
||
import {IProofOfHumanity} from "./interfaces/IProofOfHumanity.sol"; | ||
|
||
/** | ||
* @title ProofOfHumanityProxyV2 | ||
* A proxy contract for ProofOfHumanity that implements a token interface to interact with other dapps. | ||
* Note that it isn't an ERC20 and only implements its interface in order to be compatible with Snapshot. | ||
*/ | ||
contract ProofOfHumanityProxyV2 { | ||
|
||
// ========== STORAGE ========== | ||
|
||
/// @dev The address that can make governance changes to the parameters of the contract. | ||
address public governor; | ||
|
||
/// @dev Instance of the ProofOfHumanity contract | ||
IProofOfHumanity public proofOfHumanity; | ||
|
||
string public name = "Human Vote"; | ||
string public symbol = "VOTE"; | ||
Check warning Code scanning / Slither State variables that could be declared constant Warning
ProofOfHumanityProxyV2.symbol should be constant
|
||
uint8 public decimals = 0; | ||
Check warning Code scanning / Slither State variables that could be declared constant Warning
ProofOfHumanityProxyV2.decimals should be constant
|
||
|
||
/* Modifiers */ | ||
|
||
modifier onlyGovernor() { | ||
require(msg.sender == governor); | ||
_; | ||
} | ||
|
||
// ========== CONSTRUCTOR ========== | ||
|
||
/** @dev Constructor. | ||
* @param _proofOfHumanity The address of the related ProofOfHumanity contract. | ||
*/ | ||
constructor(IProofOfHumanity _proofOfHumanity) { | ||
proofOfHumanity = _proofOfHumanity; | ||
} | ||
|
||
|
||
/** @dev Changes the address of the the related ProofOfHumanity contract. | ||
* @param _proofOfHumanity The address of the new contract. | ||
*/ | ||
function changePoH(IProofOfHumanity _proofOfHumanity) external onlyGovernor { | ||
Check warning Code scanning / Slither Conformance to Solidity naming conventions Warning
Parameter ProofOfHumanityProxyV2.changePoH(IProofOfHumanity)._proofOfHumanity is not in mixedCase
|
||
proofOfHumanity = _proofOfHumanity; | ||
} | ||
|
||
/** @dev Changes the address of the the governor. | ||
* @param _governor The address of the new governor. | ||
*/ | ||
function changeGovernor(address _governor) external onlyGovernor { | ||
Check notice Code scanning / Slither Missing zero address validation Low
ProofOfHumanityProxyV2.changeGovernor(address)._governor lacks a zero-check on :
- governor = _governor Check warning Code scanning / Slither Conformance to Solidity naming conventions Warning
Parameter ProofOfHumanityProxyV2.changeGovernor(address)._governor is not in mixedCase
|
||
//require(msg.sender == governor, "The caller must be the governor."); | ||
governor = _governor; | ||
} | ||
Comment on lines
+60
to
+63
Check notice Code scanning / Slither Missing events access control Low |
||
|
||
|
||
/** @dev Returns true if the account corresponds to a claimed humanity. | ||
* @param _account The account address. | ||
* @return Whether the account is registered or not. | ||
*/ | ||
function isHuman(address _account) public view returns (bool) { | ||
Check warning Code scanning / Slither Conformance to Solidity naming conventions Warning
Parameter ProofOfHumanityProxyV2.isHuman(address)._account is not in mixedCase
|
||
return proofOfHumanity.isHuman(_account); | ||
} | ||
|
||
// ******************** // | ||
// * IERC20 * // | ||
// ******************** // | ||
|
||
/** @dev Returns the balance of a particular account of the ProofOfHumanity contract. | ||
* Note that this function takes the expiration date into account. | ||
* @param _account The account address. | ||
* @return The balance of the account. | ||
*/ | ||
function balanceOf(address _account) external view returns (uint256) { | ||
Check warning Code scanning / Slither Conformance to Solidity naming conventions Warning
Parameter ProofOfHumanityProxyV2.balanceOf(address)._account is not in mixedCase
|
||
return isHuman(_account) ? 1 : 0; | ||
} | ||
|
||
/** @dev Returns the count of all humanities that made a registration request at some point. | ||
* Note that with the current implementation of ProofOfHumanity it'd be very costly to count only the humanities that are currently registered. | ||
* @return The total count of humanities. | ||
*/ | ||
function totalSupply() external view returns (uint256) { | ||
return proofOfHumanity.getHumanityCount(); | ||
} | ||
|
||
function transfer(address _recipient, uint256 _amount) external pure returns (bool) { return false; } | ||
|
||
function allowance(address _owner, address _spender) external view returns (uint256) {} | ||
|
||
function approve(address _spender, uint256 _amount) external pure returns (bool) { return false; } | ||
|
||
function transferFrom(address _sender, address _recipient, uint256 _amount) external pure returns (bool) { return false; } | ||
} |
Check warning
Code scanning / Slither
State variables that could be declared constant Warning