Contract 0xe2D6F08e8C13E4810d770787F25d92028f06fb99 1

Txn Hash Method
Block
From
To
Value [Txn Fee]
0x569edfa4029f1cfe4b1935e02b6f3161c20cdc49a0d3c091302f4bb245d523600x6080604074317122023-03-17 7:46:433 days 23 hrs ago0x9fc1d58149abb125e04a3666f428b69d4a7b45f2 IN  Create: LFWUtils_Cronos_LB0 CRO2.1004928936920
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
LFWUtils_Cronos_LB

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 1 : LFWUtils_Cronos_LB.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.7;

interface IToken {
    function decimals() external view returns (uint256);
}

interface ITectonicLendingBorrowingInterface {
    function balanceOf(address _user) external view returns (uint256);
    function borrowBalanceStored(address _user) external view returns (uint256);
    function supplyRatePerBlock() external view returns (uint256);
    function borrowRatePerBlock() external view returns (uint256);
    function underlying() external view returns (address);
    function decimals() external view returns (uint256);
    function exchangeRateStored() external view returns (uint256);
}


contract LFWUtils_Cronos_LB {
    address private vBNB = 0xeAdf7c01DA7E93FdB5f16B0aa9ee85f978e89E95;
    address private wBNB = 0x5C7F8A570d578ED84E63fdFA7b1eE72dEae1AE23;

    function getTectonicLendingInfo(
        address _scAddress,
        address _userAddress
    ) public view returns (uint256[] memory lendingInfo, address[] memory lendingData) {
        // Define array to return
        lendingInfo = new uint256[](1);
        lendingData = new address[](1);
        ITectonicLendingBorrowingInterface scInterface = ITectonicLendingBorrowingInterface(_scAddress); 
        if (_scAddress == vBNB) {
            lendingData[0] = wBNB;
        } else {
            lendingData[0] = scInterface.underlying();
        }
        uint256 vTokenAmount = scInterface.balanceOf(_userAddress);
        uint256 exchangeRateCurrent = scInterface.exchangeRateStored();
        lendingInfo[0] = (vTokenAmount * exchangeRateCurrent) / 10**18;
    }

    function getTectonicBorrowingInfo(
        address _scAddress,
        address _userAddress
    ) public view returns (uint256[] memory borrowingInfo, address[] memory borrowingData) {
        // Define array to return
        borrowingInfo = new uint256[](1);
        borrowingData = new address[](1);
        ITectonicLendingBorrowingInterface scInterface = ITectonicLendingBorrowingInterface(_scAddress); 
        // [3] is the pool countdown by block
        if (_scAddress == vBNB) {
            borrowingData[0] = wBNB;
        } else {
            borrowingData[0] = scInterface.underlying();
        }  
        uint256 vTokenAmount = scInterface.borrowBalanceStored(_userAddress);
        uint256 exchangeRateCurrent = scInterface.exchangeRateStored();
        borrowingInfo[0] = (vTokenAmount * exchangeRateCurrent) / 10**18; 
    }

}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"_scAddress","type":"address"},{"internalType":"address","name":"_userAddress","type":"address"}],"name":"getTectonicBorrowingInfo","outputs":[{"internalType":"uint256[]","name":"borrowingInfo","type":"uint256[]"},{"internalType":"address[]","name":"borrowingData","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_scAddress","type":"address"},{"internalType":"address","name":"_userAddress","type":"address"}],"name":"getTectonicLendingInfo","outputs":[{"internalType":"uint256[]","name":"lendingInfo","type":"uint256[]"},{"internalType":"address[]","name":"lendingData","type":"address[]"}],"stateMutability":"view","type":"function"}]

6080604052600080546001600160a01b031990811673eadf7c01da7e93fdb5f16b0aa9ee85f978e89e951790915560018054909116735c7f8a570d578ed84e63fdfa7b1ee72deae1ae2317905534801561005857600080fd5b50610626806100686000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806329bdeeb21461003b578063a0ba72b014610065575b600080fd5b61004e61004936600461049d565b610078565b60405161005c9291906104ef565b60405180910390f35b61004e61007336600461049d565b6102fd565b6040805160018082528183019092526060918291906020808301908036833750506040805160018082528183019092529294509050602080830190803683370190505060005490915084906001600160a01b038083169116141561011d5760015482516001600160a01b039091169083906000906100f8576100f86105c2565b60200260200101906001600160a01b031690816001600160a01b0316815250506101c2565b806001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b15801561015657600080fd5b505afa15801561016a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018e9190610479565b826000815181106101a1576101a16105c2565b60200260200101906001600160a01b031690816001600160a01b0316815250505b6040516370a0823160e01b81526001600160a01b038581166004830152600091908316906370a08231906024015b60206040518083038186803b15801561020857600080fd5b505afa15801561021c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061024091906104d6565b90506000826001600160a01b031663182df0f56040518163ffffffff1660e01b815260040160206040518083038186803b15801561027d57600080fd5b505afa158015610291573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102b591906104d6565b9050670de0b6b3a76400006102ca8284610595565b6102d49190610573565b856000815181106102e7576102e76105c2565b6020026020010181815250505050509250929050565b6040805160018082528183019092526060918291906020808301908036833750506040805160018082528183019092529294509050602080830190803683370190505060005490915084906001600160a01b03808316911614156103a25760015482516001600160a01b0390911690839060009061037d5761037d6105c2565b60200260200101906001600160a01b031690816001600160a01b031681525050610447565b806001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b1580156103db57600080fd5b505afa1580156103ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104139190610479565b82600081518110610426576104266105c2565b60200260200101906001600160a01b031690816001600160a01b0316815250505b6040516395dd919360e01b81526001600160a01b038581166004830152600091908316906395dd9193906024016101f0565b60006020828403121561048b57600080fd5b8151610496816105d8565b9392505050565b600080604083850312156104b057600080fd5b82356104bb816105d8565b915060208301356104cb816105d8565b809150509250929050565b6000602082840312156104e857600080fd5b5051919050565b604080825283519082018190526000906020906060840190828701845b828110156105285781518452928401929084019060010161050c565b5050508381038285015284518082528583019183019060005b818110156105665783516001600160a01b031683529284019291840191600101610541565b5090979650505050505050565b60008261059057634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156105bd57634e487b7160e01b600052601160045260246000fd5b500290565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b03811681146105ed57600080fd5b5056fea2646970667358221220705fa1cffc5f0b4c157193bf6ee6bd3915eb797a85f39807483511fbcdcf902564736f6c63430008070033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.