Contract 0x1c7aEA8B6498F0854D1fCE542a27ed6a10D71d2f 1

Txn Hash Method
Block
From
To
Value [Txn Fee]
0x1d0754e3de7fd550bf46ff6ea5ad3976d43c43b195b334019f4ba195e16a1de40x60a06040197370952021-10-22 5:45:4647 days 13 hrs ago0x55d56e1bb2fc8280a775ccfe9ececcecf1a01562 IN  Contract Creation0 FTM0.121033652265
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0x1d0754e3de7fd550bf46ff6ea5ad3976d43c43b195b334019f4ba195e16a1de4197370952021-10-22 5:45:4647 days 13 hrs ago 0x55d56e1bb2fc8280a775ccfe9ececcecf1a01562  Contract Creation0 FTM
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
VaultManagerParameters

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 2 : VaultManagerParameters.sol
// SPDX-License-Identifier: bsl-1.1

/*
  Copyright 2020 Unit Protocol: Artem Zakharov ([email protected]).
*/
pragma solidity 0.7.6;

import "../VaultParameters.sol";


/**
 * @title VaultManagerParameters
 **/
contract VaultManagerParameters is Auth {

    // determines the minimum percentage of COL token part in collateral, 0 decimals
    mapping(address => uint) public minColPercent;

    // determines the maximum percentage of COL token part in collateral, 0 decimals
    mapping(address => uint) public maxColPercent;

    // map token to initial collateralization ratio; 0 decimals
    mapping(address => uint) public initialCollateralRatio;

    // map token to liquidation ratio; 0 decimals
    mapping(address => uint) public liquidationRatio;

    // map token to liquidation discount; 3 decimals
    mapping(address => uint) public liquidationDiscount;

    // map token to devaluation period in blocks
    mapping(address => uint) public devaluationPeriod;

    constructor(address _vaultParameters) Auth(_vaultParameters) {}

    /**
     * @notice Only manager is able to call this function
     * @dev Sets ability to use token as the main collateral
     * @param asset The address of the main collateral token
     * @param stabilityFeeValue The percentage of the year stability fee (3 decimals)
     * @param liquidationFeeValue The liquidation fee percentage (0 decimals)
     * @param initialCollateralRatioValue The initial collateralization ratio
     * @param liquidationRatioValue The liquidation ratio
     * @param liquidationDiscountValue The liquidation discount (3 decimals)
     * @param devaluationPeriodValue The devaluation period in blocks
     * @param usdpLimit The USDP token issue limit
     * @param oracles The enabled oracles type IDs
     * @param minColP The min percentage of COL value in position (0 decimals)
     * @param maxColP The max percentage of COL value in position (0 decimals)
     **/
    function setCollateral(
        address asset,
        uint stabilityFeeValue,
        uint liquidationFeeValue,
        uint initialCollateralRatioValue,
        uint liquidationRatioValue,
        uint liquidationDiscountValue,
        uint devaluationPeriodValue,
        uint usdpLimit,
        uint[] calldata oracles,
        uint minColP,
        uint maxColP
    ) external onlyManager {
        vaultParameters.setCollateral(asset, stabilityFeeValue, liquidationFeeValue, usdpLimit, oracles);
        setInitialCollateralRatio(asset, initialCollateralRatioValue);
        setLiquidationRatio(asset, liquidationRatioValue);
        setDevaluationPeriod(asset, devaluationPeriodValue);
        setLiquidationDiscount(asset, liquidationDiscountValue);
        setColPartRange(asset, minColP, maxColP);
    }

    /**
     * @notice Only manager is able to call this function
     * @dev Sets the initial collateral ratio
     * @param asset The address of the main collateral token
     * @param newValue The collateralization ratio (0 decimals)
     **/
    function setInitialCollateralRatio(address asset, uint newValue) public onlyManager {
        require(newValue != 0 && newValue <= 100, "Unit Protocol: INCORRECT_COLLATERALIZATION_VALUE");
        initialCollateralRatio[asset] = newValue;
    }

    /**
     * @notice Only manager is able to call this function
     * @dev Sets the liquidation ratio
     * @param asset The address of the main collateral token
     * @param newValue The liquidation ratio (0 decimals)
     **/
    function setLiquidationRatio(address asset, uint newValue) public onlyManager {
        require(newValue != 0 && newValue >= initialCollateralRatio[asset], "Unit Protocol: INCORRECT_COLLATERALIZATION_VALUE");
        liquidationRatio[asset] = newValue;
    }

    /**
     * @notice Only manager is able to call this function
     * @dev Sets the liquidation discount
     * @param asset The address of the main collateral token
     * @param newValue The liquidation discount (3 decimals)
     **/
    function setLiquidationDiscount(address asset, uint newValue) public onlyManager {
        require(newValue < 1e5, "Unit Protocol: INCORRECT_DISCOUNT_VALUE");
        liquidationDiscount[asset] = newValue;
    }

    /**
     * @notice Only manager is able to call this function
     * @dev Sets the devaluation period of collateral after liquidation
     * @param asset The address of the main collateral token
     * @param newValue The devaluation period in blocks
     **/
    function setDevaluationPeriod(address asset, uint newValue) public onlyManager {
        require(newValue != 0, "Unit Protocol: INCORRECT_DEVALUATION_VALUE");
        devaluationPeriod[asset] = newValue;
    }

    /**
     * @notice Only manager is able to call this function
     * @dev Sets the percentage range of the COL token part for specific collateral token
     * @param asset The address of the main collateral token
     * @param min The min percentage (0 decimals)
     * @param max The max percentage (0 decimals)
     **/
    function setColPartRange(address asset, uint min, uint max) public onlyManager {
        require(max <= 100 && min <= max, "Unit Protocol: WRONG_RANGE");
        minColPercent[asset] = min;
        maxColPercent[asset] = max;
    }
}

File 2 of 2 : VaultParameters.sol
// SPDX-License-Identifier: bsl-1.1

/*
  Copyright 2020 Unit Protocol: Artem Zakharov ([email protected]).
*/
pragma solidity 0.7.6;



/**
 * @title Auth
 * @dev Manages USDP's system access
 **/
contract Auth {

    // address of the the contract with vault parameters
    VaultParameters public immutable vaultParameters;

    constructor(address _parameters) {
        vaultParameters = VaultParameters(_parameters);
    }

    // ensures tx's sender is a manager
    modifier onlyManager() {
        require(vaultParameters.isManager(msg.sender), "Unit Protocol: AUTH_FAILED");
        _;
    }

    // ensures tx's sender is able to modify the Vault
    modifier hasVaultAccess() {
        require(vaultParameters.canModifyVault(msg.sender), "Unit Protocol: AUTH_FAILED");
        _;
    }

    // ensures tx's sender is the Vault
    modifier onlyVault() {
        require(msg.sender == vaultParameters.vault(), "Unit Protocol: AUTH_FAILED");
        _;
    }
}



/**
 * @title VaultParameters
 **/
contract VaultParameters is Auth {

    // map token to stability fee percentage; 3 decimals
    mapping(address => uint) public stabilityFee;

    // map token to liquidation fee percentage, 0 decimals
    mapping(address => uint) public liquidationFee;

    // map token to USDP mint limit
    mapping(address => uint) public tokenDebtLimit;

    // permissions to modify the Vault
    mapping(address => bool) public canModifyVault;

    // managers
    mapping(address => bool) public isManager;

    // enabled oracle types
    mapping(uint => mapping (address => bool)) public isOracleTypeEnabled;

    // address of the Vault
    address payable public immutable vault;

    // The foundation address
    address public foundation;

    /**
     * The address for an Ethereum contract is deterministically computed from the address of its creator (sender)
     * and how many transactions the creator has sent (nonce). The sender and nonce are RLP encoded and then
     * hashed with Keccak-256.
     * Therefore, the Vault address can be pre-computed and passed as an argument before deployment.
    **/
    constructor(address payable _vault, address _foundation) Auth(address(this)) {
        require(_vault != address(0), "Unit Protocol: ZERO_ADDRESS");
        require(_foundation != address(0), "Unit Protocol: ZERO_ADDRESS");

        isManager[msg.sender] = true;
        vault = _vault;
        foundation = _foundation;
    }

    /**
     * @notice Only manager is able to call this function
     * @dev Grants and revokes manager's status of any address
     * @param who The target address
     * @param permit The permission flag
     **/
    function setManager(address who, bool permit) external onlyManager {
        isManager[who] = permit;
    }

    /**
     * @notice Only manager is able to call this function
     * @dev Sets the foundation address
     * @param newFoundation The new foundation address
     **/
    function setFoundation(address newFoundation) external onlyManager {
        require(newFoundation != address(0), "Unit Protocol: ZERO_ADDRESS");
        foundation = newFoundation;
    }

    /**
     * @notice Only manager is able to call this function
     * @dev Sets ability to use token as the main collateral
     * @param asset The address of the main collateral token
     * @param stabilityFeeValue The percentage of the year stability fee (3 decimals)
     * @param liquidationFeeValue The liquidation fee percentage (0 decimals)
     * @param usdpLimit The USDP token issue limit
     * @param oracles The enables oracle types
     **/
    function setCollateral(
        address asset,
        uint stabilityFeeValue,
        uint liquidationFeeValue,
        uint usdpLimit,
        uint[] calldata oracles
    ) external onlyManager {
        setStabilityFee(asset, stabilityFeeValue);
        setLiquidationFee(asset, liquidationFeeValue);
        setTokenDebtLimit(asset, usdpLimit);
        for (uint i=0; i < oracles.length; i++) {
            setOracleType(oracles[i], asset, true);
        }
    }

    /**
     * @notice Only manager is able to call this function
     * @dev Sets a permission for an address to modify the Vault
     * @param who The target address
     * @param permit The permission flag
     **/
    function setVaultAccess(address who, bool permit) external onlyManager {
        canModifyVault[who] = permit;
    }

    /**
     * @notice Only manager is able to call this function
     * @dev Sets the percentage of the year stability fee for a particular collateral
     * @param asset The address of the main collateral token
     * @param newValue The stability fee percentage (3 decimals)
     **/
    function setStabilityFee(address asset, uint newValue) public onlyManager {
        stabilityFee[asset] = newValue;
    }

    /**
     * @notice Only manager is able to call this function
     * @dev Sets the percentage of the liquidation fee for a particular collateral
     * @param asset The address of the main collateral token
     * @param newValue The liquidation fee percentage (0 decimals)
     **/
    function setLiquidationFee(address asset, uint newValue) public onlyManager {
        require(newValue <= 100, "Unit Protocol: VALUE_OUT_OF_RANGE");
        liquidationFee[asset] = newValue;
    }

    /**
     * @notice Only manager is able to call this function
     * @dev Enables/disables oracle types
     * @param _type The type of the oracle
     * @param asset The address of the main collateral token
     * @param enabled The control flag
     **/
    function setOracleType(uint _type, address asset, bool enabled) public onlyManager {
        isOracleTypeEnabled[_type][asset] = enabled;
    }

    /**
     * @notice Only manager is able to call this function
     * @dev Sets USDP limit for a specific collateral
     * @param asset The address of the main collateral token
     * @param limit The limit number
     **/
    function setTokenDebtLimit(address asset, uint limit) public onlyManager {
        tokenDebtLimit[asset] = limit;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_vaultParameters","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"devaluationPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"initialCollateralRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"liquidationDiscount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"liquidationRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxColPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"minColPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"min","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"setColPartRange","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"stabilityFeeValue","type":"uint256"},{"internalType":"uint256","name":"liquidationFeeValue","type":"uint256"},{"internalType":"uint256","name":"initialCollateralRatioValue","type":"uint256"},{"internalType":"uint256","name":"liquidationRatioValue","type":"uint256"},{"internalType":"uint256","name":"liquidationDiscountValue","type":"uint256"},{"internalType":"uint256","name":"devaluationPeriodValue","type":"uint256"},{"internalType":"uint256","name":"usdpLimit","type":"uint256"},{"internalType":"uint256[]","name":"oracles","type":"uint256[]"},{"internalType":"uint256","name":"minColP","type":"uint256"},{"internalType":"uint256","name":"maxColP","type":"uint256"}],"name":"setCollateral","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"setDevaluationPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"setInitialCollateralRatio","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"setLiquidationDiscount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"setLiquidationRatio","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vaultParameters","outputs":[{"internalType":"contract VaultParameters","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60a060405234801561001057600080fd5b50604051610d94380380610d948339818101604052602081101561003357600080fd5b5051606081901b6001600160601b0319166080526001600160a01b0316610d0a61008a600039806103c8528061052752806105da52806106f15280610733528061087352806109c25280610afa5250610d0a6000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063a540c19d1161008c578063b85c449611610066578063b85c4496146102d4578063bf1b8dd3146102fa578063d709b4b014610326578063f9ba141b14610352576100cf565b8063a540c19d146101d2578063aca345ee14610284578063b7fc3ada146102a8576100cf565b80630aaddb50146100d457806315a04ea21461010c5780631c7130981461013257806335e92539146101605780633bffbbe21461018657806384b381d4146101ac575b600080fd5b6100fa600480360360208110156100ea57600080fd5b50356001600160a01b0316610384565b60408051918252519081900360200190f35b6100fa6004803603602081101561012257600080fd5b50356001600160a01b0316610396565b61015e6004803603604081101561014857600080fd5b506001600160a01b0381351690602001356103a8565b005b6100fa6004803603602081101561017657600080fd5b50356001600160a01b03166104d1565b6100fa6004803603602081101561019c57600080fd5b50356001600160a01b03166104e3565b6100fa600480360360208110156101c257600080fd5b50356001600160a01b03166104f5565b61015e60048036036101608110156101e957600080fd5b6001600160a01b038235169160208101359160408201359160608101359160808201359160a08101359160c08201359160e081013591810190610120810161010082013564010000000081111561023f57600080fd5b82018360208201111561025157600080fd5b8035906020019184602083028401116401000000008311171561027357600080fd5b919350915080359060200135610507565b61028c6106ef565b604080516001600160a01b039092168252519081900360200190f35b61015e600480360360408110156102be57600080fd5b506001600160a01b038135169060200135610713565b6100fa600480360360208110156102ea57600080fd5b50356001600160a01b0316610841565b61015e6004803603604081101561031057600080fd5b506001600160a01b038135169060200135610853565b61015e6004803603604081101561033c57600080fd5b506001600160a01b0381351690602001356109a2565b61015e6004803603606081101561036857600080fd5b506001600160a01b038135169060208101359060400135610ada565b60056020526000908152604090205481565b60046020526000908152604090205481565b6040805163f3ae241560e01b815233600482015290516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163f3ae2415916024808301926020929190829003018186803b15801561040e57600080fd5b505afa158015610422573d6000803e3d6000fd5b505050506040513d602081101561043857600080fd5b5051610479576040805162461bcd60e51b815260206004820152601a6024820152600080516020610c8b833981519152604482015290519081900360640190fd5b806104b55760405162461bcd60e51b815260040180806020018281038252602a815260200180610cab602a913960400191505060405180910390fd5b6001600160a01b03909116600090815260056020526040902055565b60016020526000908152604090205481565b60036020526000908152604090205481565b60006020819052908152604090205481565b6040805163f3ae241560e01b815233600482015290516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163f3ae2415916024808301926020929190829003018186803b15801561056d57600080fd5b505afa158015610581573d6000803e3d6000fd5b505050506040513d602081101561059757600080fd5b50516105d8576040805162461bcd60e51b815260206004820152601a6024820152600080516020610c8b833981519152604482015290519081900360640190fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663674d106e8d8d8d8989896040518763ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001806020018281038252848482818152602001925060200280828437600081840152601f19601f820116905080830192505050975050505050505050600060405180830381600087803b15801561069657600080fd5b505af11580156106aa573d6000803e3d6000fd5b505050506106b88c8a6109a2565b6106c28c89610853565b6106cc8c876103a8565b6106d68c88610713565b6106e18c8383610ada565b505050505050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6040805163f3ae241560e01b815233600482015290516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163f3ae2415916024808301926020929190829003018186803b15801561077957600080fd5b505afa15801561078d573d6000803e3d6000fd5b505050506040513d60208110156107a357600080fd5b50516107e4576040805162461bcd60e51b815260206004820152601a6024820152600080516020610c8b833981519152604482015290519081900360640190fd5b620186a081106108255760405162461bcd60e51b8152600401808060200182810382526027815260200180610c346027913960400191505060405180910390fd5b6001600160a01b03909116600090815260046020526040902055565b60026020526000908152604090205481565b6040805163f3ae241560e01b815233600482015290516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163f3ae2415916024808301926020929190829003018186803b1580156108b957600080fd5b505afa1580156108cd573d6000803e3d6000fd5b505050506040513d60208110156108e357600080fd5b5051610924576040805162461bcd60e51b815260206004820152601a6024820152600080516020610c8b833981519152604482015290519081900360640190fd5b801580159061094b57506001600160a01b0382166000908152600260205260409020548110155b6109865760405162461bcd60e51b8152600401808060200182810382526030815260200180610c5b6030913960400191505060405180910390fd5b6001600160a01b03909116600090815260036020526040902055565b6040805163f3ae241560e01b815233600482015290516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163f3ae2415916024808301926020929190829003018186803b158015610a0857600080fd5b505afa158015610a1c573d6000803e3d6000fd5b505050506040513d6020811015610a3257600080fd5b5051610a73576040805162461bcd60e51b815260206004820152601a6024820152600080516020610c8b833981519152604482015290519081900360640190fd5b8015801590610a83575060648111155b610abe5760405162461bcd60e51b8152600401808060200182810382526030815260200180610c5b6030913960400191505060405180910390fd5b6001600160a01b03909116600090815260026020526040902055565b6040805163f3ae241560e01b815233600482015290516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163f3ae2415916024808301926020929190829003018186803b158015610b4057600080fd5b505afa158015610b54573d6000803e3d6000fd5b505050506040513d6020811015610b6a57600080fd5b5051610bab576040805162461bcd60e51b815260206004820152601a6024820152600080516020610c8b833981519152604482015290519081900360640190fd5b60648111158015610bbc5750808211155b610c0d576040805162461bcd60e51b815260206004820152601a60248201527f556e69742050726f746f636f6c3a2057524f4e475f52414e4745000000000000604482015290519081900360640190fd5b6001600160a01b039092166000908152602081815260408083209390935560019052205556fe556e69742050726f746f636f6c3a20494e434f52524543545f444953434f554e545f56414c5545556e69742050726f746f636f6c3a20494e434f52524543545f434f4c4c41544552414c495a4154494f4e5f56414c5545556e69742050726f746f636f6c3a20415554485f4641494c4544000000000000556e69742050726f746f636f6c3a20494e434f52524543545f444556414c554154494f4e5f56414c5545a26469706673582212209f79ec76072a657997987f0cdb952cc56595f160eb2e36066cea90c8c8c0892764736f6c63430007060033000000000000000000000000a8f0b5758041158cf0375b7adc8ac175ff031b6c

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000a8f0b5758041158cf0375b7adc8ac175ff031b6c

-----Decoded View---------------
Arg [0] : _vaultParameters (address): 0xa8f0b5758041158cf0375b7adc8ac175ff031b6c

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000a8f0b5758041158cf0375b7adc8ac175ff031b6c


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Validator ID :
0 FTM

Amount Staked
0

Amount Delegated
0

Staking Total
0

Staking Start Epoch
0

Staking Start Time
0

Proof of Importance
0

Origination Score
0

Validation Score
0

Active
0

Online
0

Downtime
0 s
Address Amount claimed Rewards Created On Epoch Created On
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.