Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0xcB84d72e61e383767C4DFEb2d8ff7f4FB89abc6e
Balance 0 ETH
Nonce 1
Code Size 6523 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

6523 bytes
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806366304afd11610097578063a457c2d711610066578063a457c2d714610288578063a9059cbb146102b8578063dd62ed3e146102e8578063f77c479114610318576100f5565b806366304afd1461020057806370a082311461021e578063711d03ce1461024e57806395d89b411461026a576100f5565b806323b872dd116100d357806323b872dd1461016657806328231bf214610196578063313ce567146101b257806339509351146101d0576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610336565b60405161010f919061130c565b60405180910390f35b610132600480360381019061012d91906110c7565b6103c8565b60405161013f91906112f1565b60405180910390f35b6101506103e6565b60405161015d919061146e565b60405180910390f35b610180600480360381019061017b9190611078565b6103f0565b60405161018d91906112f1565b60405180910390f35b6101b060048036038101906101ab91906110c7565b6104f1565b005b6101ba6105d3565b6040516101c79190611489565b60405180910390f35b6101ea60048036038101906101e591906110c7565b6105dc565b6040516101f791906112f1565b60405180910390f35b610208610688565b604051610215919061146e565b60405180910390f35b61023860048036038101906102339190611013565b61068e565b604051610245919061146e565b60405180910390f35b61026860048036038101906102639190611013565b6106d6565b005b6102726107ed565b60405161027f919061130c565b60405180910390f35b6102a2600480360381019061029d91906110c7565b61087f565b6040516102af91906112f1565b60405180910390f35b6102d260048036038101906102cd91906110c7565b610973565b6040516102df91906112f1565b60405180910390f35b61030260048036038101906102fd919061103c565b610991565b60405161030f919061146e565b60405180910390f35b610320610a18565b60405161032d91906112d6565b60405180910390f35b606060038054610345906115d2565b80601f0160208091040260200160405190810160405280929190818152602001828054610371906115d2565b80156103be5780601f10610393576101008083540402835291602001916103be565b820191906000526020600020905b8154815290600101906020018083116103a157829003601f168201915b5050505050905090565b60006103dc6103d5610a3e565b8484610a46565b6001905092915050565b6000600254905090565b60006103fd848484610c11565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610448610a3e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156104c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104bf906113ce565b60405180910390fd5b6104e5856104d4610a3e565b85846104e09190611516565b610a46565b60019150509392505050565b6005544211610535576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052c9061138e565b60405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146105c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105bc906113ae565b60405180910390fd5b6105cf8282610e90565b5050565b60006012905090565b600061067e6105e9610a3e565b8484600160006105f7610a3e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461067991906114c0565b610a46565b6001905092915050565b60055481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610766576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075d906113ae565b60405180910390fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167fdacf3394e265c5a9b5a0b8b7f9c64619dd468f6abe1fc900bd429e6a8700bed960405160405180910390a250565b6060600480546107fc906115d2565b80601f0160208091040260200160405190810160405280929190818152602001828054610828906115d2565b80156108755780601f1061084a57610100808354040283529160200191610875565b820191906000526020600020905b81548152906001019060200180831161085857829003601f168201915b5050505050905090565b6000806001600061088e610a3e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561094b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109429061142e565b60405180910390fd5b610968610956610a3e565b8585846109639190611516565b610a46565b600191505092915050565b6000610987610980610a3e565b8484610c11565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ab6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aad9061140e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b1d9061134e565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610c04919061146e565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c78906113ee565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610cf1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce89061132e565b60405180910390fd5b610cfc838383610fe4565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610d82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d799061136e565b60405180910390fd5b8181610d8e9190611516565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e1e91906114c0565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610e82919061146e565b60405180910390a350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ef79061144e565b60405180910390fd5b610f0c60008383610fe4565b8060026000828254610f1e91906114c0565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f7391906114c0565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610fd8919061146e565b60405180910390a35050565b505050565b600081359050610ff881611917565b92915050565b60008135905061100d8161192e565b92915050565b60006020828403121561102557600080fd5b600061103384828501610fe9565b91505092915050565b6000806040838503121561104f57600080fd5b600061105d85828601610fe9565b925050602061106e85828601610fe9565b9150509250929050565b60008060006060848603121561108d57600080fd5b600061109b86828701610fe9565b93505060206110ac86828701610fe9565b92505060406110bd86828701610ffe565b9150509250925092565b600080604083850312156110da57600080fd5b60006110e885828601610fe9565b92505060206110f985828601610ffe565b9150509250929050565b61110c8161154a565b82525050565b61111b8161155c565b82525050565b600061112c826114a4565b61113681856114af565b935061114681856020860161159f565b61114f81611662565b840191505092915050565b60006111676023836114af565b915061117282611673565b604082019050919050565b600061118a6022836114af565b9150611195826116c2565b604082019050919050565b60006111ad6026836114af565b91506111b882611711565b604082019050919050565b60006111d06011836114af565b91506111db82611760565b602082019050919050565b60006111f3600f836114af565b91506111fe82611789565b602082019050919050565b60006112166028836114af565b9150611221826117b2565b604082019050919050565b60006112396025836114af565b915061124482611801565b604082019050919050565b600061125c6024836114af565b915061126782611850565b604082019050919050565b600061127f6025836114af565b915061128a8261189f565b604082019050919050565b60006112a2601f836114af565b91506112ad826118ee565b602082019050919050565b6112c181611588565b82525050565b6112d081611592565b82525050565b60006020820190506112eb6000830184611103565b92915050565b60006020820190506113066000830184611112565b92915050565b600060208201905081810360008301526113268184611121565b905092915050565b600060208201905081810360008301526113478161115a565b9050919050565b600060208201905081810360008301526113678161117d565b9050919050565b60006020820190508181036000830152611387816111a0565b9050919050565b600060208201905081810360008301526113a7816111c3565b9050919050565b600060208201905081810360008301526113c7816111e6565b9050919050565b600060208201905081810360008301526113e781611209565b9050919050565b600060208201905081810360008301526114078161122c565b9050919050565b600060208201905081810360008301526114278161124f565b9050919050565b6000602082019050818103600083015261144781611272565b9050919050565b6000602082019050818103600083015261146781611295565b9050919050565b600060208201905061148360008301846112b8565b92915050565b600060208201905061149e60008301846112c7565b92915050565b600081519050919050565b600082825260208201905092915050565b60006114cb82611588565b91506114d683611588565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561150b5761150a611604565b5b828201905092915050565b600061152182611588565b915061152c83611588565b92508282101561153f5761153e611604565b5b828203905092915050565b600061155582611568565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b838110156115bd5780820151818401526020810190506115a2565b838111156115cc576000848401525b50505050565b600060028204905060018216806115ea57607f821691505b602082108114156115fe576115fd611633565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f6d696e74696e67206973206c6f636b6564000000000000000000000000000000600082015250565b7f6f6e6c7920636f6e74726f6c6c65720000000000000000000000000000000000600082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b6119208161154a565b811461192b57600080fd5b50565b61193781611588565b811461194257600080fd5b5056fea264697066735822122003b6964b2bf61dd38fb0f99ffd90072a54eeed95849b11cd02261d36ad55081464736f6c63430008010033

Verified Source Code Partial Match

Compiler: v0.8.1+commit.df193b15 EVM: istanbul Optimization: No
Vega_2.sol 464 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.1;

/**
 * @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);
}



/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is IERC20 {
    mapping (address => uint256) private _balances;

    mapping (address => mapping (address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
    * brought in function from Context
    */
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The defaut value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overloaded;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        _approve(sender, _msgSender(), currentAllowance - amount);

        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        _approve(_msgSender(), spender, currentAllowance - subtractedValue);

        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(address sender, address recipient, uint256 amount) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        _balances[sender] = senderBalance - amount;
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        _balances[account] = accountBalance - amount;
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be to transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}



/// @title Vega 2 Token
/// @author Vega Protocol
/// @notice This contract is the Vega V2 ERC20 token that replaces the initial VEGA token
contract Vega_2 is ERC20 {

  event Controller_Changed(address indexed new_controller);

  /// @notice Timestamp of when mint becomes available to the current controller of the token
  uint256 public mint_lock_expiry;
  /// @notice Address of the controller of this contract (similar to "owner" in other contracts)
  address public controller;

  /// @notice Constructor mints and issues total_supply_to the address that deploys the contract
  /// @dev Runs ERC20 _mint function
  /// @param total_supply_ The initial supply to mint, these will be the only tokens minted until after mint_lock_expiry
  /// @param mint_lock_expiry_ The timestamp of when the mint_and_issue function becomes available to the controller
  /// @param name_ The name of the ERC20 token
  /// @param symbol_ The symbol of the ERC20 token
  /// @dev emits Controller_Changed event
  constructor(uint256 total_supply_, uint256 mint_lock_expiry_, string memory name_, string memory symbol_) ERC20 (name_, symbol_) {
      //mint and issue
      mint_lock_expiry = mint_lock_expiry_;
      _mint(msg.sender, total_supply_);
      controller = msg.sender;
      emit Controller_Changed(controller);
  }

  /// @notice This function allows the controller to assign a new controller
  /// @dev Emits Controller_Changed event
  /// @param new_controller Address of the new controller
  function change_controller(address new_controller) public {
    require(msg.sender == controller, "only controller");
    controller = new_controller;
    emit Controller_Changed(new_controller);
  }

  /// @notice This function allows the controller to mint and issue tokens to the target address
  /// @notice This function is locked until mint_lock_expiry
  /// @dev Runs ERC20 _mint function
  /// @param target Target address for the newly minted tokens
  /// @param amount Amount of tokens to mint and issue
  function mint_and_issue(address target, uint256 amount) public {
    require(block.timestamp > mint_lock_expiry, "minting is locked");
    require(msg.sender == controller, "only controller");
    _mint(target, amount);
  }
}

/**
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMWEMMMMMMMMMMMMMMMMMMMMMMMMMM...............MMMMMMMMMMMMM
MMMMMMLOVEMMMMMMMMMMMMMMMMMMMMMM...............MMMMMMMMMMMMM
MMMMMMMMMMHIXELMMMMMMMMMMMM....................MMMMMNNMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMM....................MMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMM88=........................+MMMMMMMMMM
MMMMMMMMMMMMMMMMM....................MMMMM...MMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMM....................MMMMM...MMMMMMMMMMMMMMM
MMMMMMMMMMMM.........................MM+..MMM....+MMMMMMMMMM
MMMMMMMMMNMM...................... ..MM?..MMM.. .+MMMMMMMMMM
MMMMNDDMM+........................+MM........MM..+MMMMMMMMMM
MMMMZ.............................+MM....................MMM
MMMMZ.............................+MM....................MMM
MMMMZ.............................+MM....................DDD
MMMMZ.............................+MM..ZMMMMMMMMMMMMMMMMMMMM
MMMMZ.............................+MM..ZMMMMMMMMMMMMMMMMMMMM
MM..............................MMZ....ZMMMMMMMMMMMMMMMMMMMM
MM............................MM.......ZMMMMMMMMMMMMMMMMMMMM
MM............................MM.......ZMMMMMMMMMMMMMMMMMMMM
MM......................ZMMMMM.......MMMMMMMMMMMMMMMMMMMMMMM
MM............... ......ZMMMMM.... ..MMMMMMMMMMMMMMMMMMMMMMM
MM...............MMMMM88~.........+MM..ZMMMMMMMMMMMMMMMMMMMM
MM.......$DDDDDDD.......$DDDDD..DDNMM..ZMMMMMMMMMMMMMMMMMMMM
MM.......$DDDDDDD.......$DDDDD..DDNMM..ZMMMMMMMMMMMMMMMMMMMM
MM.......ZMMMMMMM.......ZMMMMM..MMMMM..ZMMMMMMMMMMMMMMMMMMMM
MMMMMMMMM+.......MMMMM88NMMMMM..MMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMM+.......MMMMM88NMMMMM..MMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM*/

Read Contract

allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
controller 0xf77c4791 → address
decimals 0x313ce567 → uint8
mint_lock_expiry 0x66304afd → uint256
name 0x06fdde03 → string
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256

Write Contract 7 functions

These functions modify contract state and require a wallet transaction to execute.

approve 0x095ea7b3
address spender
uint256 amount
returns: bool
change_controller 0x711d03ce
address new_controller
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
mint_and_issue 0x28231bf2
address target
uint256 amount
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool

Recent Transactions

No transactions found for this address