Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Multichain Info
No addresses found
Loading...
Loading
Contract Name:
VesperVotingPowerV3
Compiler Version
v0.8.5+commit.a4f2e591
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.5; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /** * @title Calculate voting power for VSP holders */ contract VesperVotingPowerV3 { IERC20 public constant ESVSP = IERC20(0xD02d6eC21851092A9cca8a8eb388fdF66bA96F9B); uint256 public constant MINIMUM_VOTING_POWER = 1e18; /// @notice Get the voting power for an account function balanceOf(address holder_) public view returns (uint256 _votingPower) { require(holder_ != address(0), "holder-address-is-zero"); _votingPower = ESVSP.balanceOf(holder_); if (_votingPower < MINIMUM_VOTING_POWER) { return 0; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
{ "evmVersion": "berlin", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"name":"ESVSP","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINIMUM_VOTING_POWER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"holder_","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"_votingPower","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5061022c806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806370a08231146100465780639b40b4c71461006c578063f250e5ea1461009f575b600080fd5b6100596100543660046101ad565b6100ae565b6040519081526020015b60405180910390f35b61008773d02d6ec21851092a9cca8a8eb388fdf66ba96f9b81565b6040516001600160a01b039091168152602001610063565b610059670de0b6b3a764000081565b60006001600160a01b0382166101035760405162461bcd60e51b8152602060048201526016602482015275686f6c6465722d616464726573732d69732d7a65726f60501b604482015260640160405180910390fd5b6040516370a0823160e01b81526001600160a01b038316600482015273d02d6ec21851092a9cca8a8eb388fdf66ba96f9b906370a082319060240160206040518083038186803b15801561015657600080fd5b505afa15801561016a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018e91906101dd565b9050670de0b6b3a76400008110156101a857506000919050565b919050565b6000602082840312156101bf57600080fd5b81356001600160a01b03811681146101d657600080fd5b9392505050565b6000602082840312156101ef57600080fd5b505191905056fea26469706673582212202bb03ef26af8c9d1ab30461645c45b50685e6dfadac1a34208b545f73168918464736f6c63430008050033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100415760003560e01c806370a08231146100465780639b40b4c71461006c578063f250e5ea1461009f575b600080fd5b6100596100543660046101ad565b6100ae565b6040519081526020015b60405180910390f35b61008773d02d6ec21851092a9cca8a8eb388fdf66ba96f9b81565b6040516001600160a01b039091168152602001610063565b610059670de0b6b3a764000081565b60006001600160a01b0382166101035760405162461bcd60e51b8152602060048201526016602482015275686f6c6465722d616464726573732d69732d7a65726f60501b604482015260640160405180910390fd5b6040516370a0823160e01b81526001600160a01b038316600482015273d02d6ec21851092a9cca8a8eb388fdf66ba96f9b906370a082319060240160206040518083038186803b15801561015657600080fd5b505afa15801561016a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018e91906101dd565b9050670de0b6b3a76400008110156101a857506000919050565b919050565b6000602082840312156101bf57600080fd5b81356001600160a01b03811681146101d657600080fd5b9392505050565b6000602082840312156101ef57600080fd5b505191905056fea26469706673582212202bb03ef26af8c9d1ab30461645c45b50685e6dfadac1a34208b545f73168918464736f6c63430008050033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.