Address Contract Partially Verified
Address
0x69e8b9528CABDA89fe846C67675B5D73d463a916
Balance
0 ETH
Nonce
1
Code Size
6821 bytes
Creator
0xa13b3E79...AFE2 at tx 0x3ab29fcc...a8be0e
Indexed Transactions
0
Contract Bytecode
6821 bytes
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063b4b5ea5711610071578063b4b5ea571461025f578063c3cda52014610272578063dd62ed3e14610285578063e7a324dc14610298578063f1127ed8146102a057610121565b806370a08231146101fe578063782d6fe1146102115780637ecebe001461023157806395d89b4114610244578063a9059cbb1461024c57610121565b806323b872dd116100f457806323b872dd14610181578063313ce56714610194578063587cde1e146101a95780635c19a95c146101c95780636fcfff45146101de57610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd1461016457806320606b7014610179575b600080fd5b61012e6102c1565b60405161013b9190611756565b60405180910390f35b61015761015236600461121f565b6102f2565b60405161013b91906116ac565b61016c6103af565b60405161013b91906116ba565b61016c6103be565b61015761018f3660046111d2565b6103d5565b61019c61051a565b60405161013b91906117f0565b6101bc6101b7366004611172565b61051f565b60405161013b919061169e565b6101dc6101d7366004611172565b61053a565b005b6101f16101ec366004611172565b610547565b60405161013b91906117c7565b61016c61020c366004611172565b61055f565b61022461021f36600461121f565b610583565b60405161013b919061180c565b61016c61023f366004611172565b61079a565b61012e6107ac565b61015761025a36600461121f565b6107cc565b61022461026d366004611172565b610808565b6101dc61028036600461124f565b610878565b61016c610293366004611198565b610a6f565b61016c610aa1565b6102b36102ae3660046112d6565b610aad565b60405161013b9291906117d5565b6040518060400160405280601581526020017427a822a71023b7bb32b93730b731b2902a37b5b2b760591b81525081565b600080600019831415610308575060001961032d565b61032a8360405180606001604052806025815260200161192860259139610ae2565b90505b336000818152602081815260408083206001600160a01b03891680855292529182902080546001600160601b0319166001600160601b03861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061039b9085906117fe565b60405180910390a360019150505b92915050565b6a52b7d2dcc80cd2e400000081565b6040516103ca90611688565b604051809103902081565b6001600160a01b0383166000908152602081815260408083203380855290835281842054825160608101909352602580845291936001600160601b0390911692859261042b928892919061192890830139610ae2565b9050866001600160a01b0316836001600160a01b03161415801561045857506001600160601b0382811614155b1561050057600061048283836040518060600160405280603d81526020016119ff603d9139610b11565b6001600160a01b03898116600081815260208181526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906104f69085906117fe565b60405180910390a3505b61050b878783610b50565b600193505050505b9392505050565b601281565b6002602052600090815260409020546001600160a01b031681565b6105443382610cfb565b50565b60046020526000908152604090205463ffffffff1681565b6001600160a01b03166000908152600160205260409020546001600160601b031690565b60004382106105ad5760405162461bcd60e51b81526004016105a490611787565b60405180910390fd5b6001600160a01b03831660009081526004602052604090205463ffffffff16806105db5760009150506103a9565b6001600160a01b038416600090815260036020908152604080832063ffffffff600019860181168552925290912054168310610657576001600160a01b03841660009081526003602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b031690506103a9565b6001600160a01b038416600090815260036020908152604080832083805290915290205463ffffffff168310156106925760009150506103a9565b600060001982015b8163ffffffff168163ffffffff16111561075557600282820363ffffffff160481036106c461112f565b506001600160a01b038716600090815260036020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b03169181019190915290871415610730576020015194506103a99350505050565b805163ffffffff168711156107475781935061074e565b6001820392505b505061069a565b506001600160a01b038516600090815260036020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b60056020526000908152604090205481565b6040518060400160405280600481526020016327a822a760e11b81525081565b6000806107f18360405180606001604052806026815260200161194d60269139610ae2565b90506107fe338583610b50565b5060019392505050565b6001600160a01b03811660009081526004602052604081205463ffffffff1680610833576000610513565b6001600160a01b0383166000908152600360209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03169392505050565b600060405161088690611688565b60408051918290038220828201909152601582527427a822a71023b7bb32b93730b731b2902a37b5b2b760591b6020909201919091527f4369f728b0da74f880d0d9a3beb478ffc8555703cfbf8937198279bd8e0200cd6108e5610d85565b306040516020016108f99493929190611706565b604051602081830303815290604052805190602001209050600060405161091f90611693565b60405190819003812061093a918a908a908a906020016116c8565b60405160208183030381529060405280519060200120905060008282604051602001610967929190611657565b6040516020818303038152906040528051906020012090506000600182888888604051600081526020016040526040516109a4949392919061173b565b6020604051602081039080840390855afa1580156109c6573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166109f95760405162461bcd60e51b81526004016105a490611767565b6001600160a01b03811660009081526005602052604090208054600181019091558914610a385760405162461bcd60e51b81526004016105a490611797565b87421115610a585760405162461bcd60e51b81526004016105a490611777565b610a62818b610cfb565b505050505b505050505050565b6001600160a01b039182166000908152602081815260408083209390941682529190915220546001600160601b031690565b6040516103ca90611693565b600360209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b600081600160601b8410610b095760405162461bcd60e51b81526004016105a49190611756565b509192915050565b6000836001600160601b0316836001600160601b031611158290610b485760405162461bcd60e51b81526004016105a49190611756565b505050900390565b6001600160a01b038316610b765760405162461bcd60e51b81526004016105a4906117b7565b6001600160a01b038216610b9c5760405162461bcd60e51b81526004016105a4906117a7565b6001600160a01b038316600090815260016020908152604091829020548251606081019093526036808452610be7936001600160601b0390921692859291906118f290830139610b11565b6001600160a01b03848116600090815260016020908152604080832080546001600160601b0319166001600160601b03968716179055928616825290829020548251606081019093526030808452610c4f94919091169285929091906119cf90830139610d89565b6001600160a01b038381166000818152600160205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610cbc9085906117fe565b60405180910390a36001600160a01b03808416600090815260026020526040808220548584168352912054610cf692918216911683610dc5565b505050565b6001600160a01b03808316600081815260026020818152604080842080546001845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4610d7f828483610dc5565b50505050565b4690565b6000838301826001600160601b038087169083161015610dbc5760405162461bcd60e51b81526004016105a49190611756565b50949350505050565b816001600160a01b0316836001600160a01b031614158015610df057506000816001600160601b0316115b15610cf6576001600160a01b03831615610ea8576001600160a01b03831660009081526004602052604081205463ffffffff169081610e30576000610e6f565b6001600160a01b0385166000908152600360209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b90506000610e9682856040518060600160405280602881526020016119a760289139610b11565b9050610ea486848484610f53565b5050505b6001600160a01b03821615610cf6576001600160a01b03821660009081526004602052604081205463ffffffff169081610ee3576000610f22565b6001600160a01b0384166000908152600360209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b90506000610f498285604051806060016040528060278152602001611a3c60279139610d89565b9050610a67858484845b6000610f774360405180606001604052806034815260200161197360349139611108565b905060008463ffffffff16118015610fc057506001600160a01b038516600090815260036020908152604080832063ffffffff6000198901811685529252909120548282169116145b1561101f576001600160a01b0385166000908152600360209081526040808320600019880163ffffffff168452909152902080546fffffffffffffffffffffffff000000001916600160201b6001600160601b038516021790556110be565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b166000818152600383528781208c871682528352878120965187549451909516600160201b026fffffffffffffffffffffffff000000001995871663ffffffff19958616179590951694909417909555938252600490935292909220805460018801909316929091169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72484846040516110f992919061181a565b60405180910390a25050505050565b600081600160201b8410610b095760405162461bcd60e51b81526004016105a49190611756565b604080518082019091526000808252602082015290565b80356103a9816118c2565b80356103a9816118d6565b80356103a9816118df565b80356103a9816118e8565b60006020828403121561118457600080fd5b60006111908484611146565b949350505050565b600080604083850312156111ab57600080fd5b60006111b78585611146565b92505060206111c885828601611146565b9150509250929050565b6000806000606084860312156111e757600080fd5b60006111f38686611146565b935050602061120486828701611146565b925050604061121586828701611151565b9150509250925092565b6000806040838503121561123257600080fd5b600061123e8585611146565b92505060206111c885828601611151565b60008060008060008060c0878903121561126857600080fd5b60006112748989611146565b965050602061128589828a01611151565b955050604061129689828a01611151565b94505060606112a789828a01611167565b93505060806112b889828a01611151565b92505060a06112c989828a01611151565b9150509295509295509295565b600080604083850312156112e957600080fd5b60006112f58585611146565b92505060206111c88582860161115c565b61130f81611847565b82525050565b61130f81611852565b61130f81611857565b61130f61133382611857565b611857565b600061134382611835565b61134d8185611839565b935061135d81856020860161188c565b611366816118b8565b9093019392505050565b600061137d602683611839565b7f436f6d703a3a64656c656761746542795369673a20696e76616c6964207369678152656e617475726560d01b602082015260400192915050565b60006113c5602683611839565b7f436f6d703a3a64656c656761746542795369673a207369676e617475726520658152651e1c1a5c995960d21b602082015260400192915050565b600061140d600283611842565b61190160f01b815260020192915050565b600061142b602783611839565b7f436f6d703a3a6765745072696f72566f7465733a206e6f742079657420646574815266195c9b5a5b995960ca1b602082015260400192915050565b6000611474602283611839565b7f436f6d703a3a64656c656761746542795369673a20696e76616c6964206e6f6e815261636560f01b602082015260400192915050565b60006114b8603a83611839565b7f436f6d703a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747281527f616e7366657220746f20746865207a65726f2061646472657373000000000000602082015260400192915050565b6000611517604383611842565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201526263742960e81b604082015260430192915050565b6000611582603c83611839565b7f436f6d703a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747281527f616e736665722066726f6d20746865207a65726f206164647265737300000000602082015260400192915050565b60006115e1603a83611842565b7f44656c65676174696f6e28616464726573732064656c6567617465652c75696e81527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020820152603a0192915050565b61130f81611866565b61130f8161186f565b61130f81611881565b61130f81611875565b600061166282611400565b915061166e8285611327565b60208201915061167e8284611327565b5060200192915050565b60006103a98261150a565b60006103a9826115d4565b602081016103a98284611306565b602081016103a98284611315565b602081016103a9828461131e565b608081016116d6828761131e565b6116e36020830186611306565b6116f0604083018561131e565b6116fd606083018461131e565b95945050505050565b60808101611714828761131e565b611721602083018661131e565b61172e604083018561131e565b6116fd6060830184611306565b60808101611749828761131e565b6116e3602083018661163c565b602080825281016105138184611338565b602080825281016103a981611370565b602080825281016103a9816113b8565b602080825281016103a98161141e565b602080825281016103a981611467565b602080825281016103a9816114ab565b602080825281016103a981611575565b602081016103a98284611633565b604081016117e38285611633565b610513602083018461164e565b602081016103a9828461163c565b602081016103a98284611645565b602081016103a9828461164e565b604081016118288285611645565b6105136020830184611645565b5190565b90815260200190565b919050565b60006103a98261185a565b151590565b90565b6001600160a01b031690565b63ffffffff1690565b60ff1690565b6001600160601b031690565b60006103a982611875565b60005b838110156118a757818101518382015260200161188f565b83811115610d7f5750506000910152565b601f01601f191690565b6118cb81611847565b811461054457600080fd5b6118cb81611857565b6118cb81611866565b6118cb8161186f56fe436f6d703a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365436f6d703a3a617070726f76653a20616d6f756e7420657863656564732039362062697473436f6d703a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473436f6d703a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473436f6d703a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f7773436f6d703a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773436f6d703a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365436f6d703a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773a365627a7a723158208bf684aa195e4991b1935fc38c5ae9341c49142e5e24e871132d21aaae4108c16c6578706572696d656e74616cf564736f6c63430005100040
Verified Source Code Partial Match
Compiler: v0.5.16+commit.9c3226ce
EVM: istanbul
Optimization: Yes (200 runs)
Comp.sol 303 lines
// File: contracts/Governance/Comp.sol
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
contract Comp {
/// @notice EIP-20 token name for this token
string public constant name = "OPEN Governance Token";
/// @notice EIP-20 token symbol for this token
string public constant symbol = "OPEN";
/// @notice EIP-20 token decimals for this token
uint8 public constant decimals = 18;
/// @notice Total number of tokens in circulation
uint public constant totalSupply = 100000000e18; // 100 million OPEN
/// @notice Allowance amounts on behalf of others
mapping (address => mapping (address => uint96)) internal allowances;
/// @notice Official record of token balances for each account
mapping (address => uint96) internal balances;
/// @notice A record of each accounts delegate
mapping (address => address) public delegates;
/// @notice A checkpoint for marking number of votes from a given block
struct Checkpoint {
uint32 fromBlock;
uint96 votes;
}
/// @notice A record of votes checkpoints for each account, by index
mapping (address => mapping (uint32 => Checkpoint)) public checkpoints;
/// @notice The number of checkpoints for each account
mapping (address => uint32) public numCheckpoints;
/// @notice The EIP-712 typehash for the contract's domain
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
/// @notice The EIP-712 typehash for the delegation struct used by the contract
bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
/// @notice A record of states for signing / validating signatures
mapping (address => uint) public nonces;
/// @notice An event thats emitted when an account changes its delegate
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
/// @notice An event thats emitted when a delegate account's vote balance changes
event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance);
/// @notice The standard EIP-20 transfer event
event Transfer(address indexed from, address indexed to, uint256 amount);
/// @notice The standard EIP-20 approval event
event Approval(address indexed owner, address indexed spender, uint256 amount);
/**
* @notice Construct a new Comp token
* @param account The initial account to grant all the tokens
*/
constructor(address account) public {
balances[account] = uint96(totalSupply);
emit Transfer(address(0), account, totalSupply);
}
/**
* @notice Get the number of tokens `spender` is approved to spend on behalf of `account`
* @param account The address of the account holding the funds
* @param spender The address of the account spending the funds
* @return The number of tokens approved
*/
function allowance(address account, address spender) external view returns (uint) {
return allowances[account][spender];
}
/**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param rawAmount The number of tokens that are approved (2^256-1 means infinite)
* @return Whether or not the approval succeeded
*/
function approve(address spender, uint rawAmount) external returns (bool) {
uint96 amount;
if (rawAmount == uint(-1)) {
amount = uint96(-1);
} else {
amount = safe96(rawAmount, "Comp::approve: amount exceeds 96 bits");
}
allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
/**
* @notice Get the number of tokens held by the `account`
* @param account The address of the account to get the balance of
* @return The number of tokens held
*/
function balanceOf(address account) external view returns (uint) {
return balances[account];
}
/**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transfer(address dst, uint rawAmount) external returns (bool) {
uint96 amount = safe96(rawAmount, "Comp::transfer: amount exceeds 96 bits");
_transferTokens(msg.sender, dst, amount);
return true;
}
/**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transferFrom(address src, address dst, uint rawAmount) external returns (bool) {
address spender = msg.sender;
uint96 spenderAllowance = allowances[src][spender];
uint96 amount = safe96(rawAmount, "Comp::approve: amount exceeds 96 bits");
if (spender != src && spenderAllowance != uint96(-1)) {
uint96 newAllowance = sub96(spenderAllowance, amount, "Comp::transferFrom: transfer amount exceeds spender allowance");
allowances[src][spender] = newAllowance;
emit Approval(src, spender, newAllowance);
}
_transferTokens(src, dst, amount);
return true;
}
/**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegatee The address to delegate votes to
*/
function delegate(address delegatee) public {
return _delegate(msg.sender, delegatee);
}
/**
* @notice Delegates votes from signatory to `delegatee`
* @param delegatee The address to delegate votes to
* @param nonce The contract state required to match the signature
* @param expiry The time at which to expire the signature
* @param v The recovery byte of the signature
* @param r Half of the ECDSA signature pair
* @param s Half of the ECDSA signature pair
*/
function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public {
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "Comp::delegateBySig: invalid signature");
require(nonce == nonces[signatory]++, "Comp::delegateBySig: invalid nonce");
require(now <= expiry, "Comp::delegateBySig: signature expired");
return _delegate(signatory, delegatee);
}
/**
* @notice Gets the current votes balance for `account`
* @param account The address to get votes balance
* @return The number of current votes for `account`
*/
function getCurrentVotes(address account) external view returns (uint96) {
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
/**
* @notice Determine the prior number of votes for an account as of a block number
* @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
* @param account The address of the account to check
* @param blockNumber The block number to get the vote balance at
* @return The number of votes the account had as of the given block
*/
function getPriorVotes(address account, uint blockNumber) public view returns (uint96) {
require(blockNumber < block.number, "Comp::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
// First check most recent balance
if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
return checkpoints[account][nCheckpoints - 1].votes;
}
// Next check implicit zero balance
if (checkpoints[account][0].fromBlock > blockNumber) {
return 0;
}
uint32 lower = 0;
uint32 upper = nCheckpoints - 1;
while (upper > lower) {
uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow
Checkpoint memory cp = checkpoints[account][center];
if (cp.fromBlock == blockNumber) {
return cp.votes;
} else if (cp.fromBlock < blockNumber) {
lower = center;
} else {
upper = center - 1;
}
}
return checkpoints[account][lower].votes;
}
function _delegate(address delegator, address delegatee) internal {
address currentDelegate = delegates[delegator];
uint96 delegatorBalance = balances[delegator];
delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
_moveDelegates(currentDelegate, delegatee, delegatorBalance);
}
function _transferTokens(address src, address dst, uint96 amount) internal {
require(src != address(0), "Comp::_transferTokens: cannot transfer from the zero address");
require(dst != address(0), "Comp::_transferTokens: cannot transfer to the zero address");
balances[src] = sub96(balances[src], amount, "Comp::_transferTokens: transfer amount exceeds balance");
balances[dst] = add96(balances[dst], amount, "Comp::_transferTokens: transfer amount overflows");
emit Transfer(src, dst, amount);
_moveDelegates(delegates[src], delegates[dst], amount);
}
function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal {
if (srcRep != dstRep && amount > 0) {
if (srcRep != address(0)) {
uint32 srcRepNum = numCheckpoints[srcRep];
uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
uint96 srcRepNew = sub96(srcRepOld, amount, "Comp::_moveVotes: vote amount underflows");
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
uint32 dstRepNum = numCheckpoints[dstRep];
uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
uint96 dstRepNew = add96(dstRepOld, amount, "Comp::_moveVotes: vote amount overflows");
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}
}
}
function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal {
uint32 blockNumber = safe32(block.number, "Comp::_writeCheckpoint: block number exceeds 32 bits");
if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
} else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
numCheckpoints[delegatee] = nCheckpoints + 1;
}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}
function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {
require(n < 2**32, errorMessage);
return uint32(n);
}
function safe96(uint n, string memory errorMessage) internal pure returns (uint96) {
require(n < 2**96, errorMessage);
return uint96(n);
}
function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
uint96 c = a + b;
require(c >= a, errorMessage);
return c;
}
function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
require(b <= a, errorMessage);
return a - b;
}
function getChainId() internal pure returns (uint) {
uint256 chainId;
assembly { chainId := chainid() }
return chainId;
}
}
Read Contract
DELEGATION_TYPEHASH 0xe7a324dc → bytes32
DOMAIN_TYPEHASH 0x20606b70 → bytes32
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
checkpoints 0xf1127ed8 → uint32, uint96
decimals 0x313ce567 → uint8
delegates 0x587cde1e → address
getCurrentVotes 0xb4b5ea57 → uint96
getPriorVotes 0x782d6fe1 → uint96
name 0x06fdde03 → string
nonces 0x7ecebe00 → uint256
numCheckpoints 0x6fcfff45 → uint32
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 5 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 rawAmount
returns: bool
delegate 0x5c19a95c
address delegatee
delegateBySig 0xc3cda520
address delegatee
uint256 nonce
uint256 expiry
uint8 v
bytes32 r
bytes32 s
transfer 0xa9059cbb
address dst
uint256 rawAmount
returns: bool
transferFrom 0x23b872dd
address src
address dst
uint256 rawAmount
returns: bool
Recent Transactions
No transactions found for this address