Discover more of SonicScan Block Explorer's tools and services in one place.
Contract Source Code:
File 1 of 1 : VestedTotalReader
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; interface IPacaFinance { function getVestedTotals(address[] calldata _tokens) external view returns ( uint256[] memory amounts, uint256[] memory usdValues, uint256 totalUsd ); } contract VestedTotalReader { address public immutable mainContract; address[] public tokenList; /** * @dev Constructor takes the main contract address and 2 individual token addresses. */ constructor( address _mainContract, address _token1, address _token2 ) { require(_mainContract != address(0), "Main contract address cannot be zero"); mainContract = _mainContract; // Add non-zero token addresses to the token list if (_token1 != address(0)) tokenList.push(_token1); if (_token2 != address(0)) tokenList.push(_token2); } /** * @dev Fetch the total vested USD value for the predefined token list. */ function getTotalVestedUsd() external view returns (uint256) { (, , uint256 totalUsd) = IPacaFinance(mainContract).getVestedTotals(tokenList); return totalUsd; } /** * @dev Updates the token list for vested queries. * Only the owner of the contract should call this in production scenarios (add access control as needed). */ function updateTokenList(address[] calldata _tokens) external { require(_tokens.length == 2, "Token list must contain exactly 2 tokens"); tokenList = _tokens; } /** * @dev Retrieves the current token list. */ function getTokenList() external view returns (address[] memory) { return tokenList; } }
Please enter a contract address above to load the contract details and source code.
Please DO NOT store any passwords or private keys here. A private note (up to 100 characters) can be saved and is useful for transaction tracking.
This website uses cookies to improve your experience. By continuing to use this website, you agree to its Terms and Privacy Policy.