ETH Price: $1,986.10 (-4.70%)

Contract

0x4e24596a6484f5b45Cf4C7708F6f652Ee034b235
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Advanced mode:
Parent Transaction Hash Method Block
From
To
View All Internal Transactions
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Configuration

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: MIT

pragma solidity 0.8.7;

import "./DataTypes.sol";

library Configuration {
    uint8 public constant BORROW_MASK = 0x0E;
    uint8 public constant REPAY_MASK = 0x0D;
    uint8 public constant WITHDRAW_MASK = 0x0B;
    uint8 public constant LIQUIDATE_MASK = 0x07;

    uint8 constant IS_BORROW_START_BIT_POSITION = 0;
    uint8 constant IS_REPAY_START_BIT_POSITION = 1;
    uint8 constant IS_WITHDRAW_START_BIT_POSITION = 2;
    uint8 constant IS_LIQUIDATE_START_BIT_POSITION = 3;

    function setBorrow(DataTypes.NFT storage self, bool active) internal {
        self.marks =
            (self.marks & BORROW_MASK) |
            (uint8(active ? 1 : 0) << IS_BORROW_START_BIT_POSITION);
    }

    function setRepay(DataTypes.NFT storage self, bool active) internal {
        self.marks =
            (self.marks & REPAY_MASK) |
            (uint8(active ? 1 : 0) << IS_REPAY_START_BIT_POSITION);
    }

    function setWithdraw(DataTypes.NFT storage self, bool active) internal {
        self.marks =
            (self.marks & WITHDRAW_MASK) |
            (uint8(active ? 1 : 0) << IS_WITHDRAW_START_BIT_POSITION);
    }

    function setLiquidate(DataTypes.NFT storage self, bool active) internal {
        self.marks =
            (self.marks & LIQUIDATE_MASK) |
            (uint8(active ? 1 : 0) << IS_LIQUIDATE_START_BIT_POSITION);
    }

    function getBorrow(DataTypes.NFT storage self)
        internal
        view
        returns (bool)
    {
        return self.marks & ~BORROW_MASK != 0;
    }

    function getRepay(DataTypes.NFT storage self) internal view returns (bool) {
        return self.marks & ~REPAY_MASK != 0;
    }

    function getWithdraw(DataTypes.NFT storage self)
        internal
        view
        returns (bool)
    {
        return self.marks & ~WITHDRAW_MASK != 0;
    }

    function getLiquidate(DataTypes.NFT storage self)
        internal
        view
        returns (bool)
    {
        return self.marks & ~LIQUIDATE_MASK != 0;
    }

    function getState(DataTypes.NFT storage self)
        internal
        view
        returns (
            bool,
            bool,
            bool,
            bool
        )
    {
        return (
            self.marks & ~BORROW_MASK != 0,
            self.marks & ~REPAY_MASK != 0,
            self.marks & ~WITHDRAW_MASK != 0,
            self.marks & ~LIQUIDATE_MASK != 0
        );
    }
}

File 2 of 2 : DataTypes.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.7;

library DataTypes {
    struct COLLATERAL {
        uint256 apy;
        uint256 price;
        uint256 period;
        uint256 buffering;
        address erc20Token;
        string description;
    }

    struct OFFER {
        uint256 apy;
        uint256 price;
        uint256 period;
        uint256 buffering;
        address erc20Token;
        bool accept;
        bool cancel;
        uint256 offerId; //final sold offerId
        uint256 lTokenId; //lTokenId, the token's id given to the lender
        address user; //the person who given this offer
        uint256 fee;// The fee when the user adds an offer
    }

    struct NFT {
        address holder;
        address lender;
        uint256 nftId; // nft tokenId
        address nftAdr; // nft address
        uint256 depositId; // depositId
        uint256 lTokenId; // ltoken id
        uint256 borrowTimestamp; // borrow timestamp
        uint256 emergencyTimestamp; // emergency timestamp
        uint256 repayAmount; // repayAmount
        //bit 0: borrow
        //bit 1: repay
        //bit 2: withdraw
        //bit 3: liquidate
        uint8 marks;
        COLLATERAL collateral;
    }
}

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "london",
  "libraries": {},
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[],"name":"BORROW_MASK","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LIQUIDATE_MASK","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REPAY_MASK","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAW_MASK","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"}]

60be610039600b82828239805160001a60731461002c57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361060515760003560e01c806309c618ac14605657806327dab8eb146073578063c2d580a014607a578063f3c3b070146081575b600080fd5b605d600b81565b60405160ff909116815260200160405180910390f35b605d600781565b605d600d81565b605d600e8156fea26469706673582212200fd6979de506b35d31fdcca2f6dc64e435c2ed200134d72fd22b8713e4ef098364736f6c63430008070033

Deployed Bytecode

0x734e24596a6484f5b45cf4c7708f6f652ee034b235301460806040526004361060515760003560e01c806309c618ac14605657806327dab8eb146073578063c2d580a014607a578063f3c3b070146081575b600080fd5b605d600b81565b60405160ff909116815260200160405180910390f35b605d600781565b605d600d81565b605d600e8156fea26469706673582212200fd6979de506b35d31fdcca2f6dc64e435c2ed200134d72fd22b8713e4ef098364736f6c63430008070033

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

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.