Skip to content
Verified contractExactGPL-3.0

VaultProxy

Address0xfe68d7e5903f98a79b2d649cd0548a02e8ebdd67
Balance

0 ETH

 

Transactions

0

 

Compiler

solc 0.6.12

 

Same code

1,548 more contracts

 

Details

Compiler
solc 0.6.12+commit.27d51765
Language
solidity
Optimization
No
EVM version
istanbul
License
GPL-3.0
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
22,705,131
Creation transaction
0x94ad6f5b04…bc02c6d48e
Proxy implementation
0x891dee04…33468a38VaultLib
Main copy (most transactions)
0x4819ac09…31fa6ab6

138 files

The source code is large: one file is shown at a time. Choose a file in the list.

contracts/mocks/tokens/MockSynthetixToken.sol

// SPDX-License-Identifier: GPL-3.0

/*
    This file is part of the Enzyme Protocol.

    (c) Enzyme Council <[email protected]>

    For the full license information, please view the LICENSE
    file that was distributed with this source code.
*/

pragma solidity 0.6.12;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./../../release/interfaces/ISynthetixProxyERC20.sol";
import "./../../release/interfaces/ISynthetixSynth.sol";
import "./MockToken.sol";

contract MockSynthetixToken is ISynthetixProxyERC20, ISynthetixSynth, MockToken, Ownable {
    using SafeMath for uint256;

    bytes32 public override currencyKey;
    uint256 public constant WAITING_PERIOD_SECS = 3 * 60;

    mapping(address => uint256) public timelockByAccount;

    constructor(
        string memory _name,
        string memory _symbol,
        uint8 _decimals,
        bytes32 _currencyKey
    ) public MockToken(_name, _symbol, _decimals) {
        currencyKey = _currencyKey;
    }

    function setCurrencyKey(bytes32 _currencyKey) external onlyOwner {
        currencyKey = _currencyKey;
    }

    function _isLocked(address account) internal view returns (bool) {
        return timelockByAccount[account] >= now;
    }

    function _beforeTokenTransfer(
        address from,
        address,
        uint256
    ) internal override {
        require(!_isLocked(from), "Cannot settle during waiting period");
    }

    function target() external view override returns (address) {
        return address(this);
    }

    function isLocked(address account) external view returns (bool) {
        return _isLocked(account);
    }

    function burnFrom(address account, uint256 amount) public override {
        _burn(account, amount);
    }

    function lock(address account) public {
        timelockByAccount[account] = now.add(WAITING_PERIOD_SECS);
    }

    function unlock(address account) public {
        timelockByAccount[account] = 0;
    }
}
Compiler settingsShow
{
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "details": {
      "cse": true,
      "yul": false,
      "peephole": true,
      "deduplicate": true,
      "orderLiterals": true,
      "jumpdestRemover": true,
      "constantOptimizer": true
    }
  },
  "evmVersion": "istanbul",
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.