Overview
S Balance
0 S
S Value
-More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
_set Pending Adm... | 1734709 | 11 days ago | IN | 0 S | 0.00005252 |
Loading...
Loading
Contract Name:
ImpermaxWhitelist
Compiler Version
v0.5.16+commit.9c3226ce
Optimization Enabled:
Yes with 999999 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity =0.5.16; pragma experimental ABIEncoderV2; interface IBorrowable { function reserveFactor() external view returns (uint); function borrowTracker() external view returns (address); function kinkUtilizationRate() external view returns (uint); function adjustSpeed() external view returns (uint); function RESERVE_FACTOR_MAX() external pure returns (uint); function KINK_UR_MIN() external pure returns (uint); function KINK_UR_MAX() external pure returns (uint); function ADJUST_SPEED_MIN() external pure returns (uint); function ADJUST_SPEED_MAX() external pure returns (uint); function _setReserveFactor(uint newReserveFactor) external; function _setKinkUtilizationRate(uint newKinkUtilizationRate) external; function _setAdjustSpeed(uint newAdjustSpeed) external; function _setBorrowTracker(address newBorrowTracker) external; } interface ICollateral { function safetyMarginSqrt() external view returns (uint); function liquidationIncentive() external view returns (uint); function liquidationFee() external view returns (uint); function SAFETY_MARGIN_SQRT_MIN() external pure returns (uint); function SAFETY_MARGIN_SQRT_MAX() external pure returns (uint); function LIQUIDATION_INCENTIVE_MIN() external pure returns (uint); function LIQUIDATION_INCENTIVE_MAX() external pure returns (uint); function LIQUIDATION_FEE_MAX() external pure returns (uint); function _setSafetyMarginSqrt(uint newSafetyMarginSqrt) external; function _setLiquidationIncentive(uint newLiquidationIncentive) external; function _setLiquidationFee(uint newLiquidationFee) external; } interface IFactory { function admin() external view returns (address); function pendingAdmin() external view returns (address); function reservesAdmin() external view returns (address); function reservesPendingAdmin() external view returns (address); function reservesManager() external view returns (address); function getLendingPool(address uniswapV2Pair) external view returns ( bool initialized, uint24 lendingPoolId, address collateral, address borrowable0, address borrowable1 ); function allLendingPools(uint) external view returns (address uniswapV2Pair); function allLendingPoolsLength() external view returns (uint); function _setPendingAdmin(address newPendingAdmin) external; function _acceptAdmin() external; function _setReservesPendingAdmin(address newPendingAdmin) external; function _acceptReservesAdmin() external; function _setReservesManager(address newReservesManager) external; } contract Ownable { address public admin; address public pendingAdmin; event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin); event NewAdmin(address oldAdmin, address newAdmin); constructor(address _admin) public { admin = _admin; emit NewAdmin(address(0), admin); } function _setPendingAdmin(address newPendingAdmin) external onlyOwner { address oldPendingAdmin = pendingAdmin; pendingAdmin = newPendingAdmin; emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin); } function _acceptAdmin() external { require(msg.sender == pendingAdmin, "ImpermaxOwnable: UNAUTHORIZED"); address oldAdmin = admin; address oldPendingAdmin = pendingAdmin; admin = pendingAdmin; pendingAdmin = address(0); emit NewAdmin(oldAdmin, admin); emit NewPendingAdmin(oldPendingAdmin, address(0)); } modifier onlyOwner() { require(msg.sender == admin, "ImpermaxOwnable: UNAUTHORIZED"); _; } } interface IImpermaxWhitelist { enum State { Unlisted, Listed, Deprecated, Blacklisted } function pairsState(address factory, address pair) external view returns(State); event ChangedState(address indexed factory, address indexed pair, State state); function setPairState(address factory, address pair, State state) external; } contract ImpermaxWhitelist is Ownable, IImpermaxWhitelist { mapping(address => mapping(address => State)) public pairsState; constructor(address _admin) public Ownable(_admin) {} function setPairState(address factory, address pair, State state) onlyOwner external { pairsState[factory][pair] = state; emit ChangedState(factory, pair, state); } } interface IImpermaxConfigManager { struct CollateralConfig { uint safetyMarginSqrt; uint liquidationIncentive; uint liquidationFee; } struct BorrowableConfig { uint reserveFactor; uint kinkUtilizationRate; uint adjustSpeed; address borrowTracker; } struct PairConfig { address factory; address pair; CollateralConfig collateralConfig; BorrowableConfig borrowable0Config; BorrowableConfig borrowable1Config; IImpermaxWhitelist.State whitelistState; } event NewProposal(uint indexed index, PairConfig[] proposal); event RejectedProposal(uint indexed index, PairConfig[] proposal); event ApprovedProposal(uint indexed index, PairConfig[] proposal); event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin); event NewAdmin(address oldAdmin, address newAdmin); event BecomeContractAdmin(address factory); event TransferContractOwnership(address factory, address newPendingAdmin); function admin() external view returns(address); function pendingAdmin() external view returns(address); function proposals(uint, uint) external view returns(PairConfig memory); function proposalsLength() external view returns(uint); function getProposal(uint) external view returns (PairConfig[] memory); function whitelist() external view returns(address); function makeProposal(PairConfig[] calldata proposal) external; function rejectProposal(uint index) external; function approveProposal(uint index) external; function _setPendingAdmin(address newPendingAdmin) external; function _acceptAdmin() external; function _becomeContractAdmin(address ownableContract) external; function _setContractAdmin(address ownableContract, address newPendingAdmin) external; } contract ImpermaxConfigManager is IImpermaxConfigManager, Ownable { mapping(uint => PairConfig[]) public proposals; uint public proposalsLength; function getProposal(uint index) external view returns (PairConfig[] memory) { return proposals[index]; } address public whitelist; constructor(address _admin, address _whitelist) public Ownable(_admin) { whitelist = _whitelist; } /* Internal */ function _checkSetting(uint parameter, uint min, uint max) internal pure { require(parameter >= min, "ImpermaxConfigManager: INVALID_SETTING"); require(parameter <= max, "ImpermaxConfigManager: INVALID_SETTING"); } function _checkCSetting(address collateral, CollateralConfig memory config) internal pure { _checkSetting(config.safetyMarginSqrt, ICollateral(collateral).SAFETY_MARGIN_SQRT_MIN(), ICollateral(collateral).SAFETY_MARGIN_SQRT_MAX()); _checkSetting(config.liquidationIncentive, ICollateral(collateral).LIQUIDATION_INCENTIVE_MIN(), ICollateral(collateral).LIQUIDATION_INCENTIVE_MAX()); _checkSetting(config.liquidationFee, 0, ICollateral(collateral).LIQUIDATION_FEE_MAX()); } function _checkBSetting(address borrowable, BorrowableConfig memory config) internal pure { _checkSetting(config.reserveFactor, 0, IBorrowable(borrowable).RESERVE_FACTOR_MAX()); _checkSetting(config.kinkUtilizationRate, IBorrowable(borrowable).KINK_UR_MIN(), IBorrowable(borrowable).KINK_UR_MAX()); _checkSetting(config.adjustSpeed, IBorrowable(borrowable).ADJUST_SPEED_MIN(), IBorrowable(borrowable).ADJUST_SPEED_MAX()); } function _removeProposal(uint index) internal { delete proposals[index]; } function _checkPending(uint index) internal view { require(proposals[index][0].factory != address(0), "ImpermaxConfigManager: NOT_PENDING"); } function _actualCollateralConfig(address collateral) internal view returns (CollateralConfig memory oldConfig) { oldConfig.safetyMarginSqrt = ICollateral(collateral).safetyMarginSqrt(); oldConfig.liquidationIncentive = ICollateral(collateral).liquidationIncentive(); oldConfig.liquidationFee = ICollateral(collateral).liquidationFee(); } function _actualBorrowableConfig(address borrowable) internal view returns (BorrowableConfig memory oldConfig) { oldConfig.reserveFactor = IBorrowable(borrowable).reserveFactor(); oldConfig.kinkUtilizationRate = IBorrowable(borrowable).kinkUtilizationRate(); oldConfig.adjustSpeed = IBorrowable(borrowable).adjustSpeed(); oldConfig.borrowTracker = IBorrowable(borrowable).borrowTracker(); } function _setCollateralConfig(address collateral, CollateralConfig memory newConfig) internal { CollateralConfig memory oldConfig = _actualCollateralConfig(collateral); if(newConfig.safetyMarginSqrt != oldConfig.safetyMarginSqrt) ICollateral(collateral)._setSafetyMarginSqrt(newConfig.safetyMarginSqrt); if(newConfig.liquidationIncentive != oldConfig.liquidationIncentive) ICollateral(collateral)._setLiquidationIncentive(newConfig.liquidationIncentive); if(newConfig.liquidationFee != oldConfig.liquidationFee) ICollateral(collateral)._setLiquidationFee(newConfig.liquidationFee); } function _setBorrowableConfig(address borrowable, BorrowableConfig memory newConfig) internal { BorrowableConfig memory oldConfig = _actualBorrowableConfig(borrowable); if(newConfig.reserveFactor != oldConfig.reserveFactor) IBorrowable(borrowable)._setReserveFactor(newConfig.reserveFactor); if(newConfig.kinkUtilizationRate != oldConfig.kinkUtilizationRate) IBorrowable(borrowable)._setKinkUtilizationRate(newConfig.kinkUtilizationRate); if(newConfig.adjustSpeed != oldConfig.adjustSpeed) IBorrowable(borrowable)._setAdjustSpeed(newConfig.adjustSpeed); if(newConfig.borrowTracker != oldConfig.borrowTracker) IBorrowable(borrowable)._setBorrowTracker(newConfig.borrowTracker); } /* External */ function makeProposal(PairConfig[] calldata proposal) external nonReentrant { for(uint i = 0; i < proposal.length; i++) { PairConfig memory config = proposal[i]; (,, address collateral, address borrowable0, address borrowable1) = IFactory(config.factory).getLendingPool(config.pair); _checkCSetting(collateral, config.collateralConfig); _checkBSetting(borrowable0, config.borrowable0Config); _checkBSetting(borrowable1, config.borrowable1Config); proposals[proposalsLength].push(config); } emit NewProposal(proposalsLength, proposal); proposalsLength++; } function rejectProposal(uint index) external onlyOwner nonReentrant { _checkPending(index); emit RejectedProposal(index, proposals[index]); _removeProposal(index); } function approveProposal(uint index) external onlyOwner nonReentrant { _checkPending(index); PairConfig[] memory proposal = proposals[index]; uint length = proposal.length; for(uint i = 0; i < length; i++) { PairConfig memory config = proposal[i]; (,, address collateral, address borrowable0, address borrowable1) = IFactory(config.factory).getLendingPool(config.pair); _setCollateralConfig(collateral, config.collateralConfig); _setBorrowableConfig(borrowable0, config.borrowable0Config); _setBorrowableConfig(borrowable1, config.borrowable1Config); IImpermaxWhitelist(whitelist).setPairState(config.factory, config.pair, config.whitelistState); } emit ApprovedProposal(index, proposal); _removeProposal(index); } /* Ownership management */ function _becomeContractAdmin(address ownableContract) external onlyOwner nonReentrant { Ownable(ownableContract)._acceptAdmin(); emit BecomeContractAdmin(ownableContract); } function _setContractAdmin(address ownableContract, address newPendingAdmin) external onlyOwner nonReentrant { Ownable(ownableContract)._setPendingAdmin(newPendingAdmin); emit TransferContractOwnership(ownableContract, newPendingAdmin); } /* Utils */ // prevents a contract from calling itself, directly or indirectly. bool internal _notEntered = true; modifier nonReentrant() { require(_notEntered, "ImpermaxConfigManager: REENTERED"); _notEntered = false; _; _notEntered = true; } }
{ "optimizer": { "enabled": true, "runs": 999999 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_admin","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"factory","type":"address"},{"indexed":true,"internalType":"address","name":"pair","type":"address"},{"indexed":false,"internalType":"enum IImpermaxWhitelist.State","name":"state","type":"uint8"}],"name":"ChangedState","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"NewAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldPendingAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newPendingAdmin","type":"address"}],"name":"NewPendingAdmin","type":"event"},{"constant":false,"inputs":[],"name":"_acceptAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"newPendingAdmin","type":"address"}],"name":"_setPendingAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"pairsState","outputs":[{"internalType":"enum IImpermaxWhitelist.State","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pendingAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"factory","type":"address"},{"internalType":"address","name":"pair","type":"address"},{"internalType":"enum IImpermaxWhitelist.State","name":"state","type":"uint8"}],"name":"setPairState","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5060405161080438038061080483398101604081905261002f916100a4565b600080546001600160a01b0319166001600160a01b038381169190911780835560405184937ff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc936100849391929116906100e2565b60405180910390a1505061013d565b805161009e81610126565b92915050565b6000602082840312156100b657600080fd5b60006100c28484610093565b949350505050565b6100d381610115565b82525050565b6100d381610104565b604081016100f082856100ca565b6100fd60208301846100d9565b9392505050565b60006001600160a01b03821661009e565b600061009e82600061009e82610104565b61012f81610104565b811461013a57600080fd5b50565b6106b88061014c6000396000f3fe608060405234801561001057600080fd5b50600436106100725760003560e01c8063bae1ece811610050578063bae1ece8146100bd578063e9c714f2146100dd578063f851a440146100e557610072565b806326782247146100775780637306447114610095578063b71d1a0c146100aa575b600080fd5b61007f6100ed565b60405161008c9190610581565b60405180910390f35b6100a86100a33660046104da565b610109565b005b6100a86100b836600461047a565b610239565b6100d06100cb3660046104a0565b61030e565b60405161008c91906105cc565b6100a861032e565b61007f610442565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314610163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161015a906105da565b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff808416600090815260026020908152604080832093861683529290522080548291907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018360038111156101ca57fe5b02179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fa812b6fe214165be927e2d0a50cb6a01b65bf521d660c2bbf4bc58442669c3808360405161022c91906105cc565b60405180910390a3505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461028a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161015a906105da565b6001805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff00000000000000000000000000000000000000008316179092556040519116907fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a990610302908390859061058f565b60405180910390a15050565b600260209081526000928352604080842090915290825290205460ff1681565b60015473ffffffffffffffffffffffffffffffffffffffff16331461037f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161015a906105da565b600080546001805473ffffffffffffffffffffffffffffffffffffffff8082167fffffffffffffffffffffffff00000000000000000000000000000000000000008086168217968790559092169092556040519282169390927ff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc9261040892869291169061058f565b60405180910390a17fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a98160006040516103029291906105b1565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b803561046981610654565b92915050565b803561046981610668565b60006020828403121561048c57600080fd5b6000610498848461045e565b949350505050565b600080604083850312156104b357600080fd5b60006104bf858561045e565b92505060206104d08582860161045e565b9150509250929050565b6000806000606084860312156104ef57600080fd5b60006104fb868661045e565b935050602061050c8682870161045e565b925050604061051d8682870161046f565b9150509250925092565b61053081610626565b82525050565b610530816105f3565b61053081610631565b6000610555601d836105ea565b7f496d7065726d61784f776e61626c653a20554e415554484f52495a4544000000815260200192915050565b602081016104698284610536565b6040810161059d8285610536565b6105aa6020830184610536565b9392505050565b604081016105bf8285610536565b6105aa6020830184610527565b60208101610469828461053f565b6020808252810161046981610548565b90815260200190565b60006104698261060d565b8061060881610647565b919050565b73ffffffffffffffffffffffffffffffffffffffff1690565b60006104698261063c565b6000610469826105fe565b6000610469826105f3565b6004811061065157fe5b50565b61065d816105f3565b811461065157600080fd5b6004811061065157600080fdfea365627a7a7231582065056a1fc1900c93317b1fb57753d81b1787b2343aeca12ee7a0a8d99a105e356c6578706572696d656e74616cf564736f6c634300051000400000000000000000000000007226c7ca07056c655865216e04512e9b28782959
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100725760003560e01c8063bae1ece811610050578063bae1ece8146100bd578063e9c714f2146100dd578063f851a440146100e557610072565b806326782247146100775780637306447114610095578063b71d1a0c146100aa575b600080fd5b61007f6100ed565b60405161008c9190610581565b60405180910390f35b6100a86100a33660046104da565b610109565b005b6100a86100b836600461047a565b610239565b6100d06100cb3660046104a0565b61030e565b60405161008c91906105cc565b6100a861032e565b61007f610442565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314610163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161015a906105da565b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff808416600090815260026020908152604080832093861683529290522080548291907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018360038111156101ca57fe5b02179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fa812b6fe214165be927e2d0a50cb6a01b65bf521d660c2bbf4bc58442669c3808360405161022c91906105cc565b60405180910390a3505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461028a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161015a906105da565b6001805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff00000000000000000000000000000000000000008316179092556040519116907fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a990610302908390859061058f565b60405180910390a15050565b600260209081526000928352604080842090915290825290205460ff1681565b60015473ffffffffffffffffffffffffffffffffffffffff16331461037f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161015a906105da565b600080546001805473ffffffffffffffffffffffffffffffffffffffff8082167fffffffffffffffffffffffff00000000000000000000000000000000000000008086168217968790559092169092556040519282169390927ff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc9261040892869291169061058f565b60405180910390a17fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a98160006040516103029291906105b1565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b803561046981610654565b92915050565b803561046981610668565b60006020828403121561048c57600080fd5b6000610498848461045e565b949350505050565b600080604083850312156104b357600080fd5b60006104bf858561045e565b92505060206104d08582860161045e565b9150509250929050565b6000806000606084860312156104ef57600080fd5b60006104fb868661045e565b935050602061050c8682870161045e565b925050604061051d8682870161046f565b9150509250925092565b61053081610626565b82525050565b610530816105f3565b61053081610631565b6000610555601d836105ea565b7f496d7065726d61784f776e61626c653a20554e415554484f52495a4544000000815260200192915050565b602081016104698284610536565b6040810161059d8285610536565b6105aa6020830184610536565b9392505050565b604081016105bf8285610536565b6105aa6020830184610527565b60208101610469828461053f565b6020808252810161046981610548565b90815260200190565b60006104698261060d565b8061060881610647565b919050565b73ffffffffffffffffffffffffffffffffffffffff1690565b60006104698261063c565b6000610469826105fe565b6000610469826105f3565b6004811061065157fe5b50565b61065d816105f3565b811461065157600080fd5b6004811061065157600080fdfea365627a7a7231582065056a1fc1900c93317b1fb57753d81b1787b2343aeca12ee7a0a8d99a105e356c6578706572696d656e74616cf564736f6c63430005100040
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000007226c7ca07056c655865216e04512e9b28782959
-----Decoded View---------------
Arg [0] : _admin (address): 0x7226C7ca07056c655865216E04512E9B28782959
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000007226c7ca07056c655865216e04512e9b28782959
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.