Contract 0xa8F0b5758041158Cf0375b7AdC8AC175ff031B6C 1

Txn Hash Method
Block
From
To
Value [Txn Fee]
0x02ec338f922fbdf58e65184da2049b52b1f4455214e4a27afd6bfe1510a9a363Set Manager197373192021-10-22 5:49:3547 days 13 hrs ago0x55d56e1bb2fc8280a775ccfe9ececcecf1a01562 IN  0xa8f0b5758041158cf0375b7adc8ac175ff031b6c0 FTM0.002509397336
0x74a05bd3c2d265ef283dfe97cedeb58a575ab05076bef5eaf71eb4ffd9407e8dSet Manager197373112021-10-22 5:49:2947 days 13 hrs ago0x55d56e1bb2fc8280a775ccfe9ececcecf1a01562 IN  0xa8f0b5758041158cf0375b7adc8ac175ff031b6c0 FTM0.007332878392
0x823bfd934ab391e3fc62f2ceb3839a8c98671c69178acacaa319b182e28b3b94Set Vault Access197372612021-10-22 5:48:2847 days 13 hrs ago0x55d56e1bb2fc8280a775ccfe9ececcecf1a01562 IN  0xa8f0b5758041158cf0375b7adc8ac175ff031b6c0 FTM0.007660238129
0x75147e7e319b5e12b6a4d07bc801b402440d94404ab07383c6f0424744c21942Set Vault Access197372562021-10-22 5:48:2147 days 13 hrs ago0x55d56e1bb2fc8280a775ccfe9ececcecf1a01562 IN  0xa8f0b5758041158cf0375b7adc8ac175ff031b6c0 FTM0.007222115774
0xe6e145f7730b2227196b0b749463d7b1ea8b4447e4973c008dd5583c541a1fc2Set Manager197372482021-10-22 5:48:1447 days 13 hrs ago0x55d56e1bb2fc8280a775ccfe9ececcecf1a01562 IN  0xa8f0b5758041158cf0375b7adc8ac175ff031b6c0 FTM0.007180568584
0xdaa6aae86f323ac689610684a6a6ffbcdd93b20bb195a391df3b68b334c9a1d30x60c06040197368792021-10-22 5:42:2747 days 13 hrs ago0x55d56e1bb2fc8280a775ccfe9ececcecf1a01562 IN  Contract Creation0 FTM0.137552183395
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0xdaa6aae86f323ac689610684a6a6ffbcdd93b20bb195a391df3b68b334c9a1d3197368792021-10-22 5:42:2747 days 13 hrs ago 0x55d56e1bb2fc8280a775ccfe9ececcecf1a01562  Contract Creation0 FTM
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
VaultParameters

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 1 : 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 payable","name":"_vault","type":"address"},{"internalType":"address","name":"_foundation","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"canModifyVault","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"foundation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"isOracleTypeEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"liquidationFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"stabilityFeeValue","type":"uint256"},{"internalType":"uint256","name":"liquidationFeeValue","type":"uint256"},{"internalType":"uint256","name":"usdpLimit","type":"uint256"},{"internalType":"uint256[]","name":"oracles","type":"uint256[]"}],"name":"setCollateral","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newFoundation","type":"address"}],"name":"setFoundation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"setLiquidationFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"who","type":"address"},{"internalType":"bool","name":"permit","type":"bool"}],"name":"setManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_type","type":"uint256"},{"internalType":"address","name":"asset","type":"address"},{"internalType":"bool","name":"enabled","type":"bool"}],"name":"setOracleType","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"setStabilityFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"limit","type":"uint256"}],"name":"setTokenDebtLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"who","type":"address"},{"internalType":"bool","name":"permit","type":"bool"}],"name":"setVaultAccess","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"stabilityFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokenDebtLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vaultParameters","outputs":[{"internalType":"contract VaultParameters","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60c060405234801561001057600080fd5b50604051610f7e380380610f7e8339818101604052604081101561003357600080fd5b5080516020909101513060601b6080526001600160a01b03821661009e576040805162461bcd60e51b815260206004820152601b60248201527f556e69742050726f746f636f6c3a205a45524f5f414444524553530000000000604482015290519081900360640190fd5b6001600160a01b0381166100f9576040805162461bcd60e51b815260206004820152601b60248201527f556e69742050726f746f636f6c3a205a45524f5f414444524553530000000000604482015290519081900360640190fd5b3360009081526004602052604081208054600160ff19909116179055606083811b6001600160601b03191660a052600680546001600160a01b0319166001600160a01b03948516179055608051901c929190911690610deb90610193903980610d325250806104655280610552528061068d528061077a5280610858528061089a52806109d95280610adf5280610c2d5250610deb6000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063bf33bd4c116100a2578063ede2362f11610071578063ede2362f14610373578063f2e323ba146103a1578063f3ae2415146103c7578063fbfa77cf146103ed578063fec0feb3146103f55761010b565b8063bf33bd4c146102c7578063c8023af4146102f3578063cc9a10a614610319578063db3543f51461034d5761010b565b8063997a2572116100de578063997a25721461022d578063a526ae2c14610265578063a5e90eee14610291578063aca345ee146102bf5761010b565b80630db063b01461011057806341fbb0501461014a5780634df143411461016e578063674d106e1461019c575b600080fd5b6101366004803603602081101561012657600080fd5b50356001600160a01b0316610421565b604080519115158252519081900360200190f35b610152610436565b604080516001600160a01b039092168252519081900360200190f35b61019a6004803603604081101561018457600080fd5b506001600160a01b038135169060200135610445565b005b61019a600480360360a08110156101b257600080fd5b6001600160a01b038235169160208101359160408201359160608101359181019060a0810160808201356401000000008111156101ee57600080fd5b82018360208201111561020057600080fd5b8035906020019184602083028401116401000000008311171561022257600080fd5b509092509050610532565b6102536004803603602081101561024357600080fd5b50356001600160a01b031661065b565b60408051918252519081900360200190f35b61019a6004803603604081101561027b57600080fd5b506001600160a01b03813516906020013561066d565b61019a600480360360408110156102a757600080fd5b506001600160a01b038135169060200135151561075a565b610152610856565b61019a600480360360408110156102dd57600080fd5b506001600160a01b03813516906020013561087a565b6102536004803603602081101561030957600080fd5b50356001600160a01b03166109a7565b61019a6004803603606081101561032f57600080fd5b508035906001600160a01b03602082013516906040013515156109b9565b61019a6004803603602081101561036357600080fd5b50356001600160a01b0316610abf565b61019a6004803603604081101561038957600080fd5b506001600160a01b0381351690602001351515610c0d565b610253600480360360208110156103b757600080fd5b50356001600160a01b0316610d09565b610136600480360360208110156103dd57600080fd5b50356001600160a01b0316610d1b565b610152610d30565b6101366004803603604081101561040b57600080fd5b50803590602001356001600160a01b0316610d54565b60036020526000908152604090205460ff1681565b6006546001600160a01b031681565b6040805163f3ae241560e01b815233600482015290516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163f3ae2415916024808301926020929190829003018186803b1580156104ab57600080fd5b505afa1580156104bf573d6000803e3d6000fd5b505050506040513d60208110156104d557600080fd5b5051610516576040805162461bcd60e51b815260206004820152601a6024820152600080516020610d96833981519152604482015290519081900360640190fd5b6001600160a01b03909116600090815260026020526040902055565b6040805163f3ae241560e01b815233600482015290516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163f3ae2415916024808301926020929190829003018186803b15801561059857600080fd5b505afa1580156105ac573d6000803e3d6000fd5b505050506040513d60208110156105c257600080fd5b5051610603576040805162461bcd60e51b815260206004820152601a6024820152600080516020610d96833981519152604482015290519081900360640190fd5b61060d868661066d565b610617868561087a565b6106218684610445565b60005b818110156106525761064a83838381811061063b57fe5b905060200201358860016109b9565b600101610624565b50505050505050565b60006020819052908152604090205481565b6040805163f3ae241560e01b815233600482015290516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163f3ae2415916024808301926020929190829003018186803b1580156106d357600080fd5b505afa1580156106e7573d6000803e3d6000fd5b505050506040513d60208110156106fd57600080fd5b505161073e576040805162461bcd60e51b815260206004820152601a6024820152600080516020610d96833981519152604482015290519081900360640190fd5b6001600160a01b03909116600090815260208190526040902055565b6040805163f3ae241560e01b815233600482015290516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163f3ae2415916024808301926020929190829003018186803b1580156107c057600080fd5b505afa1580156107d4573d6000803e3d6000fd5b505050506040513d60208110156107ea57600080fd5b505161082b576040805162461bcd60e51b815260206004820152601a6024820152600080516020610d96833981519152604482015290519081900360640190fd5b6001600160a01b03919091166000908152600460205260409020805460ff1916911515919091179055565b7f000000000000000000000000000000000000000000000000000000000000000081565b6040805163f3ae241560e01b815233600482015290516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163f3ae2415916024808301926020929190829003018186803b1580156108e057600080fd5b505afa1580156108f4573d6000803e3d6000fd5b505050506040513d602081101561090a57600080fd5b505161094b576040805162461bcd60e51b815260206004820152601a6024820152600080516020610d96833981519152604482015290519081900360640190fd5b606481111561098b5760405162461bcd60e51b8152600401808060200182810382526021815260200180610d756021913960400191505060405180910390fd5b6001600160a01b03909116600090815260016020526040902055565b60016020526000908152604090205481565b6040805163f3ae241560e01b815233600482015290516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163f3ae2415916024808301926020929190829003018186803b158015610a1f57600080fd5b505afa158015610a33573d6000803e3d6000fd5b505050506040513d6020811015610a4957600080fd5b5051610a8a576040805162461bcd60e51b815260206004820152601a6024820152600080516020610d96833981519152604482015290519081900360640190fd5b60009283526005602090815260408085206001600160a01b039490941685529290529120805460ff1916911515919091179055565b6040805163f3ae241560e01b815233600482015290516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163f3ae2415916024808301926020929190829003018186803b158015610b2557600080fd5b505afa158015610b39573d6000803e3d6000fd5b505050506040513d6020811015610b4f57600080fd5b5051610b90576040805162461bcd60e51b815260206004820152601a6024820152600080516020610d96833981519152604482015290519081900360640190fd5b6001600160a01b038116610beb576040805162461bcd60e51b815260206004820152601b60248201527f556e69742050726f746f636f6c3a205a45524f5f414444524553530000000000604482015290519081900360640190fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6040805163f3ae241560e01b815233600482015290516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163f3ae2415916024808301926020929190829003018186803b158015610c7357600080fd5b505afa158015610c87573d6000803e3d6000fd5b505050506040513d6020811015610c9d57600080fd5b5051610cde576040805162461bcd60e51b815260206004820152601a6024820152600080516020610d96833981519152604482015290519081900360640190fd5b6001600160a01b03919091166000908152600360205260409020805460ff1916911515919091179055565b60026020526000908152604090205481565b60046020526000908152604090205460ff1681565b7f000000000000000000000000000000000000000000000000000000000000000081565b600560209081526000928352604080842090915290825290205460ff168156fe556e69742050726f746f636f6c3a2056414c55455f4f55545f4f465f52414e4745556e69742050726f746f636f6c3a20415554485f4641494c4544000000000000a2646970667358221220458fdc40e6c0b95e2967212ad8470b78089a363b3372865f48916381286f173f64736f6c63430007060033000000000000000000000000d7a9b0d75e51bfb91c843b23fb2c19aa3b8d958e000000000000000000000000f1c0ffce3ada8b6f591a161968fc254ac323cfa4

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

000000000000000000000000d7a9b0d75e51bfb91c843b23fb2c19aa3b8d958e000000000000000000000000f1c0ffce3ada8b6f591a161968fc254ac323cfa4

-----Decoded View---------------
Arg [0] : _vault (address): 0xd7a9b0d75e51bfb91c843b23fb2c19aa3b8d958e
Arg [1] : _foundation (address): 0xf1c0ffce3ada8b6f591a161968fc254ac323cfa4

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000d7a9b0d75e51bfb91c843b23fb2c19aa3b8d958e
Arg [1] : 000000000000000000000000f1c0ffce3ada8b6f591a161968fc254ac323cfa4


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.