Uniswap Changes

Creado El diff nunca expira
12 eliminaciones
315 líneas
12 adiciones
311 líneas
/**
*Submitted for verification at Etherscan.io on 2020-09-16
*/

/**
/**
*Submitted for verification at Etherscan.io on 2020-09-15
*Submitted for verification at Etherscan.io on 2021-05-31
*/
*/


pragma solidity ^0.5.16;
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
pragma experimental ABIEncoderV2;


// Even fish can make waves.
contract GovernorAlpha {
contract GovernorAlpha {
/// @notice The name of this contract
/// @notice The name of this contract
string public constant name = "Uniswap Governor Alpha";
string public constant name = "Uniswap Governor Alpha";


/// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed
/// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed
function quorumVotes() public pure returns (uint) { return 40_000_000e18; } // 4% of Uni
function quorumVotes() public pure returns (uint) { return 40_000_000e18; } // 4% of Uni


/// @notice The number of votes required in order for a voter to become a proposer
/// @notice The number of votes required in order for a voter to become a proposer
function proposalThreshold() public pure returns (uint) { return 10_000_000e18; } // 1% of Uni
function proposalThreshold() public pure returns (uint) { return 2_500_000e18; } // 0.25% of Uni


/// @notice The maximum number of actions that can be included in a proposal
/// @notice The maximum number of actions that can be included in a proposal
function proposalMaxOperations() public pure returns (uint) { return 10; } // 10 actions
function proposalMaxOperations() public pure returns (uint) { return 10; } // 10 actions


/// @notice The delay before voting on a proposal may take place, once proposed
/// @notice The delay before voting on a proposal may take place, once proposed
function votingDelay() public pure returns (uint) { return 1; } // 1 block
function votingDelay() public pure returns (uint) { return 1; } // 1 block


/// @notice The duration of voting on a proposal, in blocks
/// @notice The duration of voting on a proposal, in blocks
function votingPeriod() public pure returns (uint) { return 40_320; } // ~7 days in blocks (assuming 15s blocks)
function votingPeriod() public pure returns (uint) { return 40_320; } // ~7 days in blocks (assuming 15s blocks)


/// @notice The address of the Uniswap Protocol Timelock
/// @notice The address of the Uniswap Protocol Timelock
TimelockInterface public timelock;
TimelockInterface public constant timelock = TimelockInterface(0x1a9C8182C09F50C8318d769245beA52c32BE35BC);


/// @notice The address of the Uniswap governance token
/// @notice The address of the Uniswap governance token
UniInterface public uni;
UniInterface public constant uni = UniInterface(0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984);


/// @notice The total number of proposals
/// @notice The total number of proposals
uint public proposalCount;
uint public proposalCount;


struct Proposal {
struct Proposal {
/// @notice Unique id for looking up a proposal
/// @notice Unique id for looking up a proposal
uint id;
uint id;


/// @notice Creator of the proposal
/// @notice Creator of the proposal
address proposer;
address proposer;


/// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds
/// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds
uint eta;
uint eta;


/// @notice the ordered list of target addresses for calls to be made
/// @notice the ordered list of target addresses for calls to be made
address[] targets;
address[] targets;


/// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made
/// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint[] values;
uint[] values;


/// @notice The ordered list of function signatures to be called
/// @notice The ordered list of function signatures to be called
string[] signatures;
string[] signatures;


/// @notice The ordered list of calldata to be passed to each call
/// @notice The ordered list of calldata to be passed to each call
bytes[] calldatas;
bytes[] calldatas;


/// @notice The block at which voting begins: holders must delegate their votes prior to this block
/// @notice The block at which voting begins: holders must delegate their votes prior to this block
uint startBlock;
uint startBlock;


/// @notice The block at which voting ends: votes must be cast prior to this block
/// @notice The block at which voting ends: votes must be cast prior to this block
uint endBlock;
uint endBlock;


/// @notice Current number of votes in favor of this proposal
/// @notice Current number of votes in favor of this proposal
uint forVotes;
uint forVotes;


/// @notice Current number of votes in opposition to this proposal
/// @notice Current number of votes in opposition to this proposal
uint againstVotes;
uint againstVotes;


/// @notice Flag marking whether the proposal has been canceled
/// @notice Flag marking whether the proposal has been canceled
bool canceled;
bool canceled;


/// @notice Flag marking whether the proposal has been executed
/// @notice Flag marking whether the proposal has been executed
bool executed;
bool executed;


/// @notice Receipts of ballots for the entire set of voters
/// @notice Receipts of ballots for the entire set of voters
mapping (address => Receipt) receipts;
mapping (address => Receipt) receipts;
}
}


/// @notice Ballot receipt record for a voter
/// @notice Ballot receipt record for a voter
struct Receipt {
struct Receipt {
/// @notice Whether or not a vote has been cast
/// @notice Whether or not a vote has been cast
bool hasVoted;
bool hasVoted;


/// @notice Whether or not the voter supports the proposal
/// @notice Whether or not the voter supports the proposal
bool support;
bool support;


/// @notice The number of votes the voter had, which were cast
/// @notice The number of votes the voter had, which were cast
uint96 votes;
uint96 votes;
}
}


/// @notice Possible states that a proposal may be in
/// @notice Possible states that a proposal may be in
enum ProposalState {
enum ProposalState {
Pending,
Pending,
Active,
Active,