Caricamento del resto di questo confronto.

VoterProxy

Creato Il diff non scade mai
75 rimozioni
668 linee
52 aggiunte
645 linee
/**
/**
*Submitted for verification at Etherscan.io on 2021-04-23
*Submitted for verification at Etherscan.io on 2022-04-20
*/
*/


// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT

// File: contracts\Interfaces.sol

pragma solidity 0.6.12;
pragma solidity 0.6.12;



interface ICurveGauge {
interface ICurveGauge {
function deposit(uint256) external;
function deposit(uint256) external;
function balanceOf(address) external view returns (uint256);
function balanceOf(address) external view returns (uint256);
function withdraw(uint256) external;
function withdraw(uint256) external;
function claim_rewards() external;
function claim_rewards() external;
function reward_tokens(uint256) external view returns(address);//v2
function reward_tokens(uint256) external view returns(address);//v2
function rewarded_token() external view returns(address);//v1
function rewarded_token() external view returns(address);//v1
function lp_token() external view returns(address);
}
}


interface ICurveVoteEscrow {
interface ICurveVoteEscrow {
function create_lock(uint256, uint256) external;
function create_lock(uint256, uint256) external;
function increase_amount(uint256) external;
function increase_amount(uint256) external;
function increase_unlock_time(uint256) external;
function increase_unlock_time(uint256) external;
function withdraw() external;
function withdraw() external;
function smart_wallet_checker() external view returns (address);
function smart_wallet_checker() external view returns (address);
function commit_smart_wallet_checker(address) external;
function apply_smart_wallet_checker() external;
}
}


interface IVoting{
interface IVoting {
function vote(uint256, bool, bool) external; //voteId, support, executeIfDecided
function vote(uint256, bool, bool) external; //voteId, support, executeIfDecided
function getVote(uint256) external view returns(bool,bool,uint64,uint64,uint64,uint64,uint256,uint256,uint256,bytes memory);
function getVote(uint256) external view returns(bool,bool,uint64,uint64,uint64,uint64,uint256,uint256,uint256,bytes memory);
function vote_for_gauge_weights(address,uint256) external;
function vote_for_gauge_weights(address,uint256) external;
}
}


interface IMinter{
interface IMinter {
function mint(address) external;
function mint(address) external;
}
}


interface IFeeDistro{
interface IStash {
function claim() external;
function stashRewards() external returns (bool);
function processStash() external returns (bool);
function claimRewards() external returns (bool);
function initialize(uint256 _pid, address _operator, address _staker, address _gauge, address _rewardFactory) external;
}
}


interface IDeposit{
interface IFeeDistributor {
function claimToken(address user, address token) external returns (uint256);
function claimTokens(address user, address[] calldata tokens) external returns (uint256[] memory);
function getTokenTimeCursor(address token) external view returns (uint256);
}

interface IDeposit {
function isShutdown() external view returns(bool);
function isShutdown() external view returns(bool);
function balanceOf(address _account) external view returns(uint256);
function balanceOf(address _account) external view returns(uint256);
function totalSupply() external view returns(uint256);
function totalSupply() external view returns(uint256);
function poolInfo(uint256) external view returns(address,address,address,address,address, bool);
function poolInfo(uint256) external view returns(address,address,address,address,address, bool);
function rewardClaimed(uint256,address,uint256) external;
function rewardClaimed(uint256,address,uint256) external;
function withdrawTo(uint256,uint256,address) external;
function withdrawTo(uint256,uint256,address) external;
function claimRewards(uint256,address) external returns(bool);
function claimRewards(uint256,address) external returns(bool);
function rewardArbitrator() external returns(address);
function rewardArbitrator() external returns(address);
function setGaugeRedirect(uint256 _pid) external returns(bool);
function owner() external returns(address);
function deposit(uint256 _pid, uint256 _amount, bool _stake) external returns(bool);
}
}



interface IRewardDeposit {
// File: @openzeppelin\contracts\math\SafeMath.sol
function addReward(address, uint256) external;

}
pragma solidity >=0.6.0 <0.8.0;


/**
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
* checks.
*
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
* operation overflows.
*
*
* Using this library instead of the unchecked operations eliminates an entire
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
* class of bugs, so it's recommended to use it always.
*/
*/
library SafeMath {
library SafeMath {
/**
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
*
* _Available since v3.4._
* _Available since v3.4._
*/
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
uint256 c = a + b;
uint256 c = a + b;
if (c < a) return (false, 0);
if (c < a) return (false, 0);
return (true, c);
return (true, c);
}
}


/**
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
*
* _Available since v3.4._
* _Available since v3.4._
*/
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b > a) return (false, 0);
if (b > a) return (false, 0);
return (true, a - b);
return (true, a - b);
}
}


/**
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
*
* _Available since v3.4._
* _Available since v3.4._
*/
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
if (a == 0) return (true, 0);